diff --git a/.eslintignore b/.eslintignore index 3c68eb7399f6..6e714f19dddd 100644 --- a/.eslintignore +++ b/.eslintignore @@ -3,3 +3,6 @@ dist demo/demo.js node_modules + +# TODO: Upgrade to ESLint4 so we can apply a specific rule (one for CJS code) for below files +src/**/*.config.js diff --git a/.travis.yml b/.travis.yml index df1d0893fba1..d849f457d82c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,8 +42,8 @@ install: - if [[ -n "${AAT_TOKEN}" && "$TEST_SUITE" == "a11y" ]]; then npm i https://aat.mybluemix.net/dist/karma-ibma.tgz; fi script: - - if [[ "$TEST_SUITE" == "misc" ]]; then npm run lint; fi - if [[ "$TEST_SUITE" == "misc" ]]; then npm run build; fi + - if [[ "$TEST_SUITE" == "misc" ]]; then npm run lint; fi - if [[ "$TEST_SUITE" == "unit" ]]; then npm run test:unit -- -b ChromeHeadless_Travis -b Firefox; fi - if [[ "$TEST_SUITE" == "unit-each" ]]; then find tests/spec -name "*.js" ! -name left-nav_spec.js -print0 | xargs -0 -n 1 -P 1 npm run test:unit -- -d -f; fi - if [[ -n "${AAT_TOKEN}" && "$TEST_SUITE" == "a11y" ]]; then npm run test:a11y; fi diff --git a/demo/.babelrc b/demo/.babelrc index 0bcbdc77956a..f4f9840193db 100644 --- a/demo/.babelrc +++ b/demo/.babelrc @@ -11,5 +11,5 @@ ], "react" ], - "plugins": ["transform-class-properties", "dev-expression"] + "plugins": ["transform-class-properties", "transform-object-rest-spread", "dev-expression"] } diff --git a/demo/js/components/CodePage/CodePage.js b/demo/js/components/CodePage/CodePage.js index badaeb66d0b7..b22873190c37 100644 --- a/demo/js/components/CodePage/CodePage.js +++ b/demo/js/components/CodePage/CodePage.js @@ -4,54 +4,26 @@ import Markdown from 'markdown-it'; import ComponentExample from '../ComponentExample/ComponentExample'; -/** - * @param {ComponentCollection|Component} metadata The component data. - * @returns {string} The HTML snippet for the component. - */ -const getContent = metadata => { - const { variants = {} } = metadata; - const { items = [] } = variants; - const variant = items[0]; - return metadata.content || (variant && variant.content) || ''; -}; - -/** - * @param {ComponentCollection|Component} metadata The component data. - * @returns {Component[]|Variant[]} The data of the component variants. - */ -const getSubItems = metadata => { - if (metadata.isCollection) { - return metadata.items; - } - if (!metadata.isCollated) { - return metadata.variants.items; - } - return []; -}; - /** * The page to show the component demo, its code as well as its README. */ const CodePage = ({ metadata, hideViewFullRender }) => { const md = new Markdown({ html: true }); - const subItems = getSubItems(metadata).filter(item => !item.isHidden); + const subItems = (metadata.items || []).filter(item => !item.isHidden); + /* eslint-disable react/no-danger */ const componentContent = !metadata.isCollection && subItems.length <= 1 ? ( - + ) : ( subItems.map(item => (

{item.label}

- + {item.notes && metadata.notes !== item.notes &&

{item.notes}

} +
)) ); - /* eslint-disable react/no-danger */ return (
{componentContent} diff --git a/demo/js/components/ComponentExample/ComponentExample.js b/demo/js/components/ComponentExample/ComponentExample.js index 89e872fe9db7..adeeeceb4262 100644 --- a/demo/js/components/ComponentExample/ComponentExample.js +++ b/demo/js/components/ComponentExample/ComponentExample.js @@ -20,7 +20,7 @@ const ComponentExample = ({ htmlFile, component, variant, codepenSlug, hideViewF }); const codepenLink = codepenSlug && `https://codepen.io/team/carbon/full/${codepenSlug}/`; - const componentLink = variant ? `/component/${component}/${variant}` : `/component/${component}`; + const componentLink = variant ? `/component/${variant}` : `/component/${component}`; const viewFullRender = hideViewFullRender ? null : ( diff --git a/demo/js/components/RootPage.js b/demo/js/components/RootPage.js index ce47f3d02ed1..5657e465c0fb 100644 --- a/demo/js/components/RootPage.js +++ b/demo/js/components/RootPage.js @@ -6,6 +6,62 @@ import SideNav from './SideNav'; import PageHeader from './PageHeader/PageHeader'; import SideNavToggle from './SideNavToggle/SideNavToggle'; +const checkStatus = response => { + if (response.status >= 200 && response.status < 400) { + return response; + } + + const error = new Error(response.statusText); + error.response = response; + throw error; +}; + +const load = (componentItems, selectedNavItemId) => { + const metadata = componentItems && componentItems.find(item => item.id === selectedNavItemId); + const subItems = metadata.items || []; + const hasRenderedContent = + !metadata.isCollection && subItems.length <= 1 ? metadata.renderedContent : subItems.every(item => item.renderedContent); + if (!hasRenderedContent) { + return fetch(`/code/${metadata.name}`) + .then(checkStatus) + .then(response => { + const contentType = response.headers.get('content-type'); + return contentType && contentType.includes('application/json') ? response.json() : response.text(); + }) + .then(responseContent => { + if (Object(responseContent) === responseContent) { + return componentItems.map( + item => + item.id !== selectedNavItemId + ? item + : { + ...item, + items: item.items.map( + subItem => + !responseContent[subItem.handle] + ? subItem + : { + ...subItem, + renderedContent: responseContent[subItem.handle], + } + ), + } + ); + } + return componentItems.map( + item => + item.id !== selectedNavItemId + ? item + : { + ...item, + renderedContent: responseContent, + } + ); + }); + } + return Promise.resolve(null); +}; + /** * The top-most React component for dev env page. */ @@ -22,9 +78,19 @@ class RootPage extends Component { docItems: PropTypes.arrayOf(PropTypes.shape()).isRequired, // eslint-disable-line react/no-unused-prop-types }; - constructor() { + constructor(props) { super(); - this.state = {}; + + const { componentItems } = props; + + this.state = { + /** + * The array of component data. + * @type {Object[]} + */ + componentItems, + }; + window.addEventListener('popstate', evt => { this.switchTo(evt.state.name); }); @@ -42,6 +108,13 @@ class RootPage extends Component { } } + componentWillReceiveProps(props) { + const { componentItems } = props; + if (this.props.componentItems !== componentItems) { + this.setState({ componentItems }); + } + } + /** * The handler for changing in the state of side nav's toggle button. */ @@ -53,7 +126,7 @@ class RootPage extends Component { * The handler for the `click` event on the side nav for changing selection. */ onSideNavItemClick = evt => { - const { componentItems } = this.props; + const { componentItems } = this.state; const selectedNavItem = componentItems && componentItems.find(item => item.id === evt.target.dataset.navId); if (selectedNavItem) { this.switchTo(selectedNavItem.id); @@ -64,7 +137,7 @@ class RootPage extends Component { * @returns The component data that is currently selected. */ getCurrentComponentItem() { - const { componentItems } = this.props; + const { componentItems } = this.state; return componentItems && componentItems.find(item => item.id === this.state.selectedNavItemId); } @@ -74,17 +147,22 @@ class RootPage extends Component { */ switchTo(selectedNavItemId) { this.setState({ selectedNavItemId }, () => { - const { componentItems } = this.props; + const { componentItems } = this.state; const selectedNavItem = componentItems && componentItems.find(item => item.id === selectedNavItemId); const { name } = selectedNavItem || {}; if (name) { history.pushState({ name }, name, `/demo/${name}`); } + load(componentItems, selectedNavItemId).then(newComponentItems => { + if (newComponentItems) { + this.setState({ componentItems: newComponentItems }); + } + }); }); } render() { - const { componentItems } = this.props; + const { componentItems } = this.state; const metadata = this.getCurrentComponentItem(); const { name, label } = metadata || {}; const classNames = classnames({ diff --git a/demo/views/_layout.dust b/demo/views/_layout.dust new file mode 100644 index 000000000000..ab3b7e3477a9 --- /dev/null +++ b/demo/views/_layout.dust @@ -0,0 +1 @@ +{>"{preview}"/} diff --git a/demo/views/_preview-default.dust b/demo/views/_preview-default.dust new file mode 100644 index 000000000000..4465d1d4153f --- /dev/null +++ b/demo/views/_preview-default.dust @@ -0,0 +1,40 @@ + + + + + + + Carbon Components + + + + + +
+ {+content} + {/content} +
+ + + + + + + + + + + + + diff --git a/demo/views/_preview-empty.dust b/demo/views/_preview-empty.dust new file mode 100644 index 000000000000..3641f31597bd --- /dev/null +++ b/demo/views/_preview-empty.dust @@ -0,0 +1,2 @@ +{+content} +{/content} diff --git a/gulpfile.js b/gulpfile.js index cd9d007d5ac9..03c1f639b5bb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,6 +1,7 @@ 'use strict'; // Node +const fs = require('fs'); const path = require('path'); // Styles @@ -40,10 +41,16 @@ const jsdocConfig = require('gulp-jsdoc3/dist/jsdocConfig.json'); // Generic utility const del = require('del'); +const writeFile = promisify(fs.writeFile); +const mkdirp = promisify(require('mkdirp')); + // Test environment const Server = require('karma').Server; const commander = require('commander'); +// Fractal templates +const templates = require('./tools/templates'); + const assign = v => v; const cloptions = commander .option('-k, --keepalive', 'Keeps browser open after first run of Karma test finishes') @@ -64,8 +71,7 @@ gulp.task('browser-sync', ['sass:dev'], cb => { let started; nodemon({ script: './server.js', - ext: 'dust js', - watch: ['./demo/views', './server.js'], + watch: ['demo/**/*.dust', 'src/**/*.dust', 'src/**/*.config.js', 'server.js'], env: { PORT: cloptions.serverport, }, @@ -250,11 +256,17 @@ gulp.task('sass:source', () => { return gulp.src(srcFiles).pipe(gulp.dest('scss')); }); -gulp.task('html:source', () => { - const srcFiles = './src/components/**/*.html'; - - return gulp.src(srcFiles).pipe(gulp.dest('html')); -}); +gulp.task('html:source', () => + templates.render({ preview: '_preview-empty' }).then(renderedItems => { + const promises = []; + renderedItems.forEach((rendered, item) => { + const dirname = path.dirname(path.resolve(__dirname, 'html', item.relViewPath)); + const filename = `${item.handle.replace(/--default$/, '')}.html`; + promises.push(mkdirp(dirname).then(() => writeFile(path.resolve(dirname, filename), rendered))); + }); + return Promise.all(promises); + }) +); /** * Lint @@ -330,7 +342,7 @@ gulp.task('jsdoc', cb => { gulp.task('test', ['test:unit', 'test:a11y']); -gulp.task('test:unit', done => { +gulp.task('test:unit', ['html:source'], done => { new Server( { configFile: path.resolve(__dirname, 'tests/karma.conf.js'), diff --git a/package.json b/package.json index a535d4bac726..676409ae0b11 100644 --- a/package.json +++ b/package.json @@ -66,6 +66,8 @@ "cz-conventional-changelog": "^1.2.0", "del": "~2.0.2", "diff": "^3.4.0", + "dustjs-helpers": "^1.7.0", + "dustjs-linkedin": "^2.7.0", "eslint": "^3.0.0", "eslint-config-airbnb": "^11.0.0", "eslint-config-airbnb-base": "^11.0.0", @@ -109,9 +111,10 @@ "markdown-it": "^8.4.0", "merge-stream": "^1.0.0", "minimatch": "^3.0.0", + "mkdirp": "^0.5.0", "mock-raf": "^1.0.0", "nodemon": "1.9.1", - "prettier": "^1.7.0", + "prettier": "^1.10.0", "prop-types": "^15.6.0", "pump": "^1.0.2", "react": "^16.2.0", @@ -131,7 +134,8 @@ "vinyl-named": "^1.1.0", "webpack": "^3.10.0", "webpack-dev-middleware": "^2.0.0", - "webpack-hot-middleware": "^2.21.0" + "webpack-hot-middleware": "^2.21.0", + "whatwg-fetch": "^2.0.0" }, "files": [ "css/**/*", diff --git a/server.js b/server.js index 15a8d1787384..50bf70b43ac9 100644 --- a/server.js +++ b/server.js @@ -2,7 +2,6 @@ const globby = require('globby'); // eslint-disable-line const { promisify } = require('bluebird'); // eslint-disable-line -const fs = require('fs'); const path = require('path'); const express = require('express'); // eslint-disable-line const Fractal = require('@frctl/fractal'); // eslint-disable-line @@ -11,7 +10,7 @@ const webpack = require('webpack'); // eslint-disable-line const webpackDevMiddleware = require('webpack-dev-middleware'); // eslint-disable-line const webpackHotMiddleware = require('webpack-hot-middleware'); // eslint-disable-line -const readFile = promisify(fs.readFile); +const templates = require('./tools/templates'); const app = express(); const adaro = require('adaro'); // eslint-disable-line @@ -26,7 +25,7 @@ app.use(webpackHotMiddleware(compiler)); const fractal = Fractal.create(); fractal.components.set('path', path.join(__dirname, 'src/components')); -fractal.components.set('ext', '.html'); +fractal.components.set('ext', '.dust'); fractal.docs.set('path', path.join(__dirname, 'docs')); app.engine('dust', adaro.dust()); @@ -38,34 +37,44 @@ app.use(express.static('scripts')); app.use('/docs/js', express.static('docs/js')); /** - * @param {string} glob The glob. - * @returns {string} The file contents of files matching the given glob, concatenated. - */ -const getContent = glob => - globby(glob).then(filePaths => { - if (filePaths.length === 0) { - return undefined; - } - return Promise.all(filePaths.map(filePath => readFile(filePath, { encoding: 'utf8' }))).then(contents => - contents.reduce((a, b) => a.concat(b)) - ); - }); - -/** - * @param {ComponentCollection|Component} item The component data. + * @param {ComponentCollection|Component} metadata The component data. * @returns {Promise} - * The component data, with README.md content assigned to `.notes` property for component with variants (`ComponentCollection`). + * The normalized component data, + * esp. with README.md content assigned to `.notes` property for component with variants (`ComponentCollection`). * Fractal automatically populate `.notes` for component without variants (`Component`). */ -const ensureComponentItemNotes = item => { - if (!item.isCollection || !item.config.readme) { - return item; +const normalizeMetadata = metadata => { + const items = metadata.isCollection ? metadata : !metadata.isCollated && metadata.variants && metadata.variants(); + const visibleItems = items && items.filter(item => !item.isHidden); + const metadataJSON = typeof metadata.toJSON !== 'function' ? metadata : metadata.toJSON(); + if (!metadata.isCollection && visibleItems && visibleItems.size === 1) { + const firstVariant = visibleItems.first(); + return Object.assign(metadataJSON, { + context: firstVariant.context, + notes: firstVariant.notes, + preview: firstVariant.preview, + variants: undefined, + }); } - return item.config.readme - .getContent() - .then(notes => Object.assign(typeof item.toJSON !== 'function' ? item : item.toJSON(), { notes })); + return Object.assign(metadataJSON, { + items: !items || items.size <= 1 ? undefined : items.map(normalizeMetadata).toJSON().items, + variants: undefined, + }); }; +/** + * The promise resolved with the list of nav items. + * @type {Promise<(ComponentCollection|Component)[]>} + */ +const promiseNavItems = templates.promiseCache + .then(({ componentSource, docSource }) => + Promise.all([Promise.all(componentSource.items().map(normalizeMetadata)), docSource.items()]) + ) + .then(([componentItems, docItems]) => ({ + componentItems, + docItems, + })); + ['/', '/demo/:component'].forEach(route => { app.get(route, (req, res) => { const name = req.params.component; @@ -73,12 +82,8 @@ const ensureComponentItemNotes = item => { if (name && path.relative('src/components', `src/components/${name}`).substr(0, 2) === '..') { res.status(404).end(); } else { - fractal - .load() - .then(([componentSource, docSource]) => - Promise.all([Promise.all(componentSource.items().map(ensureComponentItemNotes)), docSource.items()]) - ) - .then(([componentItems, docItems]) => { + promiseNavItems + .then(({ componentItems, docItems }) => { res.render('demo-nav', { componentItems, docItems, @@ -92,29 +97,44 @@ const ensureComponentItemNotes = item => { }); }); -['/component/:component', '/component/:component/:variant'].forEach(route => { - app.get(route, (req, res) => { - const glob = `src/components/${req.params.component}/**/${req.params.variant || '*'}.html`; +app.get('/component/:component', (req, res) => { + const name = req.params.component; + + if (path.relative('src/components', `src/components/${name}`).substr(0, 2) === '..') { + res.status(404).end(); + } else { + templates + .render({ defaultPreview: '_preview-default', concat: true }, name) + .then(rendered => { + res.send(rendered); + }) + .catch(error => { + console.error(error.stack); // eslint-disable-line no-console + res.status(500).end(); + }); + } +}); - if (path.relative('src/components', glob).substr(0, 2) === '..') { - res.status(404).end(); - } else { - getContent(glob) - .then(html => { - if (typeof html === 'undefined') { - res.status(404).end(); - } else { - res.render('demo-live', { - content: html, - }); - } - }) - .catch(error => { - console.error(error.stack); // eslint-disable-line no-console - res.status(500).end(); +app.get('/code/:component', (req, res) => { + const name = req.params.component; + + if (name && path.relative('src/components', `src/components/${name}`).substr(0, 2) === '..') { + res.status(404).end(); + } else { + templates + .render({ preview: '_preview-empty' }, name) + .then(renderedItems => { + const o = {}; + renderedItems.forEach((rendered, item) => { + o[item.handle] = rendered.trim(); }); - } - }); + res.json(o); + }) + .catch(error => { + console.error(error.stack); // eslint-disable-line no-console + res.status(500).end(); + }); + } }); app.listen(port, () => { diff --git a/src/components/accordion/accordion--legacy.dust b/src/components/accordion/accordion--legacy.dust new file mode 100644 index 000000000000..18bb649354e5 --- /dev/null +++ b/src/components/accordion/accordion--legacy.dust @@ -0,0 +1,54 @@ +{>_layout/} + +{ +
  • +
    + + + +

    Label

    +
    +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +
  • +
  • +
    + + + +

    Label with multiple words

    +
    +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +
  • +
  • +
    + + + +

    Label

    +
    +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +
  • +
  • +
    + + + +

    Label

    +
    +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +
  • + +{/content} diff --git a/src/components/accordion/accordion.dust b/src/components/accordion/accordion.dust new file mode 100644 index 000000000000..c443aa2d7fd8 --- /dev/null +++ b/src/components/accordion/accordion.dust @@ -0,0 +1,54 @@ +{>_layout/} + +{ +
  • + +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +
  • +
  • + +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +
  • +
  • + +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +
  • +
  • + +
    +

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna + aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +
  • + +{/content} diff --git a/src/components/accordion/accordion.html b/src/components/accordion/accordion.html deleted file mode 100644 index 4539f1c06d81..000000000000 --- a/src/components/accordion/accordion.html +++ /dev/null @@ -1,50 +0,0 @@ -
      -
    • - -
      -

      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

      -
      -
    • -
    • - -
      -

      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

      -
      -
    • -
    • - -
      -

      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

      -
      -
    • -
    • - -
      -

      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

      -
      -
    • -
    diff --git a/src/components/accordion/legacyaccordion.html b/src/components/accordion/legacyaccordion.html deleted file mode 100644 index 7c475b840d67..000000000000 --- a/src/components/accordion/legacyaccordion.html +++ /dev/null @@ -1,50 +0,0 @@ -
      -
    • -
      - - - -

      Label

      -
      -
      -

      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

      -
      -
    • -
    • -
      - - - -

      Label with multiple words

      -
      -
      -

      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

      -
      -
    • -
    • -
      - - - -

      Label

      -
      -
      -

      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

      -
      -
    • -
    • -
      - - - -

      Label

      -
      -
      -

      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna - aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

      -
      -
    • -
    \ No newline at end of file diff --git a/src/components/breadcrumb/breadcrumb.dust b/src/components/breadcrumb/breadcrumb.dust new file mode 100644 index 000000000000..e0ae611b1d0f --- /dev/null +++ b/src/components/breadcrumb/breadcrumb.dust @@ -0,0 +1,17 @@ +{>_layout/} + +{ + + + +
    +
    + +{/content} diff --git a/src/components/breadcrumb/breadcrumb.html b/src/components/breadcrumb/breadcrumb.html deleted file mode 100644 index d064d3c643b2..000000000000 --- a/src/components/breadcrumb/breadcrumb.html +++ /dev/null @@ -1,13 +0,0 @@ - diff --git a/src/components/button/button.config.js b/src/components/button/button.config.js new file mode 100644 index 000000000000..7f512fc3e68a --- /dev/null +++ b/src/components/button/button.config.js @@ -0,0 +1,90 @@ +'use stirct'; + +module.exports = { + default: 'primary', + variants: [ + { + name: 'primary', + label: 'Primary Buttons', + notes: 'Primary buttons should be used for the principle call to action on the page.', + context: { + variant: 'primary', + }, + }, + { + name: 'primary--small', + label: 'Primary Buttons (Small)', + notes: ` + Small buttons may be used when there is not enough space for a + regular sized button. This issue is most found in tables. Small button should have three words + or less. + `, + context: { + variant: 'primary', + small: true, + }, + }, + { + name: 'secondary', + label: 'Secondary Buttons', + notes: 'Secondary buttons should be used for secondary actions on each page.', + context: { + variant: 'secondary', + }, + }, + { + name: 'secondary--small', + label: 'Secondary Buttons (Small)', + notes: ` + Small buttons may be used when there is not enough space for a + regular sized button. This issue is most found in tables. Small button should have three words + or less. + `, + context: { + variant: 'secondary', + small: true, + }, + }, + { + name: 'danger', + label: 'Danger Buttons', + notes: 'Danger buttons should be used for a negative action (such as Delete) on the page.', + context: { + variant: 'danger', + }, + }, + { + name: 'danger--small', + label: 'Danger Buttons (Small)', + notes: ` + Small buttons may be used when there is not enough space for a + regular sized button. This issue is most found in tables. Small button should have three words + or less. + `, + context: { + variant: 'danger', + small: true, + }, + }, + { + name: 'ghost', + label: 'Ghost Buttons', + context: { + variant: 'ghost', + }, + }, + { + name: 'ghost--small', + label: 'Ghost Buttons (Small)', + notes: ` + Small buttons may be used when there is not enough space for a + regular sized button. This issue is most found in tables. Small button should have three words + or less. + `, + context: { + variant: 'ghost', + small: true, + }, + }, + ], +}; diff --git a/src/components/button/button.dust b/src/components/button/button.dust new file mode 100644 index 000000000000..1cf5496409d0 --- /dev/null +++ b/src/components/button/button.dust @@ -0,0 +1,12 @@ +{>_layout/} + +{Button + + +{/content} diff --git a/src/components/button/danger-button.html b/src/components/button/danger-button.html deleted file mode 100644 index ffeff0de806e..000000000000 --- a/src/components/button/danger-button.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/src/components/button/ghost-button.html b/src/components/button/ghost-button.html deleted file mode 100644 index e9ad25e85b8d..000000000000 --- a/src/components/button/ghost-button.html +++ /dev/null @@ -1,18 +0,0 @@ - - - diff --git a/src/components/button/primary-button.html b/src/components/button/primary-button.html deleted file mode 100644 index db89714ea6ce..000000000000 --- a/src/components/button/primary-button.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/src/components/button/secondary-button.html b/src/components/button/secondary-button.html deleted file mode 100644 index 2b30cc9e91f5..000000000000 --- a/src/components/button/secondary-button.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - - diff --git a/src/components/card/card--with-status.html b/src/components/card/card--with-status.html deleted file mode 100644 index 9c2a15d81043..000000000000 --- a/src/components/card/card--with-status.html +++ /dev/null @@ -1,65 +0,0 @@ -
    -
    - -
    - - list of options - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -
    - -
    -
    -

    Card Name

    - Secondary Information -
    -
    -
    - -
    diff --git a/src/components/card/card.config.js b/src/components/card/card.config.js new file mode 100644 index 000000000000..81145e1d2890 --- /dev/null +++ b/src/components/card/card.config.js @@ -0,0 +1,22 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + notes: ` + Cards provide an at-a glance preview of the content they link to and frequently contain + easily-consumable content. + `, + }, + { + name: 'with-status', + label: 'With status', + notes: 'Card Status displays the current status of the application (RUNNING, NOT_RUNNING, STOPPED).', + context: { + hasStatus: true, + }, + }, + ], +}; diff --git a/src/components/card/card.dust b/src/components/card/card.dust new file mode 100644 index 000000000000..0081be652cf8 --- /dev/null +++ b/src/components/card/card.dust @@ -0,0 +1,76 @@ +{>_layout/} + +{ +
    + +
    + + list of options + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +
    + +
    +
    +

    Card Name

    +

    Secondary Information

    +
    +
    + + {^hasStatus} +
    + + Docs +
    + {:else} + + {/hasStatus} + +{/content} diff --git a/src/components/card/card.html b/src/components/card/card.html deleted file mode 100644 index 1d18f07ae86e..000000000000 --- a/src/components/card/card.html +++ /dev/null @@ -1,43 +0,0 @@ -
    -
    - -
    - - list of options - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -
    - -
    -
    -

    Card Name

    -

    Secondary Information

    -
    -
    - -
    - - Docs -
    -
    diff --git a/src/components/carousel/carousel.dust b/src/components/carousel/carousel.dust new file mode 100644 index 000000000000..cf856daf15af --- /dev/null +++ b/src/components/carousel/carousel.dust @@ -0,0 +1,62 @@ +{>_layout/} + +{Carousel Title
    + + + +{/content} diff --git a/src/components/carousel/carousel.html b/src/components/carousel/carousel.html deleted file mode 100644 index ec553724278c..000000000000 --- a/src/components/carousel/carousel.html +++ /dev/null @@ -1,58 +0,0 @@ -
    Carousel Title
    - - - diff --git a/src/components/checkbox/checkbox.dust b/src/components/checkbox/checkbox.dust new file mode 100644 index 000000000000..e04cf2d9ced6 --- /dev/null +++ b/src/components/checkbox/checkbox.dust @@ -0,0 +1,32 @@ +{>_layout/} + +{ + Checkbox heading + +
    + + +
    + +
    + +
    + +
    + + +
    + +
    + +
    + + +{/content} diff --git a/src/components/checkbox/checkbox.html b/src/components/checkbox/checkbox.html deleted file mode 100644 index 0904cdbd22ac..000000000000 --- a/src/components/checkbox/checkbox.html +++ /dev/null @@ -1,28 +0,0 @@ -
    - Checkbox heading - -
    - - -
    - -
    - -
    - -
    - - -
    - -
    - -
    - -
    \ No newline at end of file diff --git a/src/components/code-snippet/code-snippet--terminal.html b/src/components/code-snippet/code-snippet--terminal.html deleted file mode 100644 index 1b01bff0afe2..000000000000 --- a/src/components/code-snippet/code-snippet--terminal.html +++ /dev/null @@ -1,12 +0,0 @@ -
    -
    -
    node -v Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis, veritatis voluptate id incidunt molestiae officia possimus, quasi itaque alias, architecto hic, dicta fugit? Debitis delectus quidem explicabo vitae fuga laboriosam!
    -
    - -
    diff --git a/src/components/code-snippet/code-snippet.config.js b/src/components/code-snippet/code-snippet.config.js new file mode 100644 index 000000000000..5b6a910d1acd --- /dev/null +++ b/src/components/code-snippet/code-snippet.config.js @@ -0,0 +1,30 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Code', + notes: ` + Code snippets are small blocks of reusable code that can be inserted in a code file. + + The Code style is for larger, multi-line code snippets. + `, + context: { + variant: 'code', + }, + }, + { + name: 'terminal', + label: 'Terminal', + notes: ` + Code snippets are small blocks of reusable code that can be inserted in a code file. + + The Terminal style is for single-line . + `, + context: { + variant: 'terminal', + }, + }, + ], +}; diff --git a/src/components/code-snippet/code-snippet.dust b/src/components/code-snippet/code-snippet.dust new file mode 100644 index 000000000000..6e0ce6945159 --- /dev/null +++ b/src/components/code-snippet/code-snippet.dust @@ -0,0 +1,40 @@ +{>_layout/} + +{ +
    + {@eq key=variant value="code"} + +
    +@mixin bx--snippet($type) {
    +  @if $type == 'terminal' {
    +    background-color: red;
    +  } @else if $type == 'code' {
    +    background-color: blue;
    +  } @else if $type == 'text' {
    +    background-color: white;
    +  }
    +
    +  @if $type == 'terminal' {
    +    background-color: red;
    +  } @else if $type == 'code' {
    +    background-color: blue;
    +  } @else if $type == 'text' {
    +    background-color: white;
    +  }
    +}
    +          
    +
    + {:else} +
    node -v Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis, veritatis voluptate id incidunt molestiae officia possimus, quasi itaque alias, architecto hic, dicta fugit? Debitis delectus quidem explicabo vitae fuga laboriosam!
    + {/eq} +
    + + +{/content} diff --git a/src/components/code-snippet/code-snippet.html b/src/components/code-snippet/code-snippet.html deleted file mode 100644 index 229335ed9285..000000000000 --- a/src/components/code-snippet/code-snippet.html +++ /dev/null @@ -1,32 +0,0 @@ -
    -
    - -
    -@mixin bx--snippet($type) {
    -  @if $type == 'terminal' {
    -    background-color: red;
    -  } @else if $type == 'code' {
    -    background-color: blue;
    -  } @else if $type == 'text' {
    -    background-color: white;
    -  }
    -
    -  @if $type == 'terminal' {
    -    background-color: red;
    -  } @else if $type == 'code' {
    -    background-color: blue;
    -  } @else if $type == 'text' {
    -    background-color: white;
    -  }
    -}
    -      
    -
    -
    - -
    diff --git a/src/components/combo-box/combo-box--disabled.html b/src/components/combo-box/combo-box--disabled.html deleted file mode 100644 index 84d49c40f776..000000000000 --- a/src/components/combo-box/combo-box--disabled.html +++ /dev/null @@ -1,11 +0,0 @@ -
    - -
    diff --git a/src/components/combo-box/combo-box.config.js b/src/components/combo-box/combo-box.config.js new file mode 100644 index 000000000000..ed087691cd71 --- /dev/null +++ b/src/components/combo-box/combo-box.config.js @@ -0,0 +1,17 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + }, + { + name: 'disabled', + label: 'Disabled', + context: { + disabled: true, + }, + }, + ], +}; diff --git a/src/components/combo-box/combo-box.dust b/src/components/combo-box/combo-box.dust new file mode 100644 index 000000000000..ca4b8a41ff01 --- /dev/null +++ b/src/components/combo-box/combo-box.dust @@ -0,0 +1,32 @@ +{>_layout/} + +{ + + +
    +
    + +
    + + Close menu + + +
    +
    +
    +
    Option 1
    +
    Option 2
    +
    Option 3
    +
    Option 4
    +
    +
    +{/content} diff --git a/src/components/combo-box/combo-box.html b/src/components/combo-box/combo-box.html deleted file mode 100644 index e1282ba87706..000000000000 --- a/src/components/combo-box/combo-box.html +++ /dev/null @@ -1,28 +0,0 @@ -
    - -
    -
    -
    - -
    - - Close menu - - -
    -
    -
    -
    Option 1
    -
    Option 2
    -
    Option 3
    -
    Option 4
    -
    -
    diff --git a/src/components/content-switcher/content-switcher.dust b/src/components/content-switcher/content-switcher.dust new file mode 100644 index 000000000000..ae242e3e57e7 --- /dev/null +++ b/src/components/content-switcher/content-switcher.dust @@ -0,0 +1,9 @@ +{>_layout/} + +{ + + + + +{/content} diff --git a/src/components/content-switcher/content-switcher.html b/src/components/content-switcher/content-switcher.html deleted file mode 100644 index 87472a54d07d..000000000000 --- a/src/components/content-switcher/content-switcher.html +++ /dev/null @@ -1,5 +0,0 @@ -
    - - - -
    diff --git a/src/components/copy-button/copy-button.dust b/src/components/copy-button/copy-button.dust new file mode 100644 index 000000000000..85ecb950c110 --- /dev/null +++ b/src/components/copy-button/copy-button.dust @@ -0,0 +1,11 @@ +{>_layout/} + +{ + Copy button + + + + + +{/content} diff --git a/src/components/copy-button/copy-button.html b/src/components/copy-button/copy-button.html deleted file mode 100644 index 923e4a98507f..000000000000 --- a/src/components/copy-button/copy-button.html +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/src/components/data-table-v2/data-table-v2--expandable.dust b/src/components/data-table-v2/data-table-v2--expandable.dust new file mode 100644 index 000000000000..a2d8304e9b4a --- /dev/null +++ b/src/components/data-table-v2/data-table-v2--expandable.dust @@ -0,0 +1,92 @@ +{>_layout/} + +{ +

    Table title

    +
    +
    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    NameProtocolPortsRuleAttached GroupsStatus
    + + Load Balancer 1HTTP80Round RobinMaureen's VM GroupsActive
    +

    + Harry Potter +

    +

    Harry James Potter (b. 31 July, 1980) was a half-blood wizard, the only child and son of the late James and Lily + Potter (née Evans), and one of the most famous and powerful wizards of modern times. In what proved to be a vain + attempt to circumvent a prophecy that stated that a boy born at the end of July of 1980 could be able to defeat + him, Lord Voldemort tried to murder him when he was a year and three months old. Voldemort murdered Harry's parents + as they tried to protect him, shortly before attacking Harry.

    +
    + Load Balancer 1HTTP80Round RobinMaureen's VM GroupsActive
    +

    + Harry Potter +

    +

    Harry James Potter (b. 31 July, 1980) was a half-blood wizard, the only child and son of the late James and Lily + Potter (née Evans), and one of the most famous and powerful wizards of modern times. In what proved to be a vain + attempt to circumvent a prophecy that stated that a boy born at the end of July of 1980 could be able to defeat + him, Lord Voldemort tried to murder him when he was a year and three months old. Voldemort murdered Harry's parents + as they tried to protect him, shortly before attacking Harry.

    +
    + +{/content} diff --git a/src/components/data-table-v2/data-table-v2--pagination.dust b/src/components/data-table-v2/data-table-v2--pagination.dust new file mode 100644 index 000000000000..8c7fd9a0706b --- /dev/null +++ b/src/components/data-table-v2/data-table-v2--pagination.dust @@ -0,0 +1,415 @@ +{>_layout/} + +{ +

    Table title

    +
    +
    +
    + + + + + +
    +
    +

    + 3 items selected

    + +
    +
    +
    + +
    + +
    + + + + + + + +
    + + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + +
    + + + Load Balancer 1HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + + + Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + + + Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + + + Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + + + Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + +
    +
    + Items per page: +
    + + + + + +
    + + + 1-10 of + 40 items +
    +
    + + 1 of + 4 pages + + +
    + + + + + +
    + +
    +
    +{/content} diff --git a/src/components/data-table-v2/data-table-v2--pagination.html b/src/components/data-table-v2/data-table-v2--pagination.html deleted file mode 100644 index e04de64a9eec..000000000000 --- a/src/components/data-table-v2/data-table-v2--pagination.html +++ /dev/null @@ -1,411 +0,0 @@ -
    -

    Table title

    -
    -
    -
    - - - - - -
    -
    -

    - 3 items selected

    - -
    -
    -
    - -
    - -
    - - - - - - - -
    - - -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - - - Load Balancer 1HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - - - Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - - - Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - - - Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - - - Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -
    -
    -
    - Items per page: -
    - - - - - -
    - - - 1-10 of - 40 items -
    -
    - - 1 of - 4 pages - - -
    - - - - - -
    - -
    -
    diff --git a/src/components/data-table-v2/data-table-v2--small.dust b/src/components/data-table-v2/data-table-v2--small.dust new file mode 100644 index 000000000000..6de7f5a7d2f5 --- /dev/null +++ b/src/components/data-table-v2/data-table-v2--small.dust @@ -0,0 +1,58 @@ +{>_layout/} + +{ + + + Name + Protocol + Ports + Rule + Attached Groups + Status + + + + + Load Balancer 1 + HTTP + 80 + Round Robin + Maureen's VM Groups + Active + + + Load Balancer 5 + HTTP + 80 + Round Robin + Maureen's VM Groups + Active + + + Load Balancer 5 + HTTP + 80 + Round Robin + Maureen's VM Groups + Active + + + Load Balancer 5 + HTTP + 80 + Round Robin + Maureen's VM Groups + Active + + + Load Balancer 5 + HTTP + 80 + Round Robin + Maureen's VM Groups + Active + + + +{/content} diff --git a/src/components/data-table-v2/data-table-v2--small.html b/src/components/data-table-v2/data-table-v2--small.html deleted file mode 100644 index bb49e9af5fa2..000000000000 --- a/src/components/data-table-v2/data-table-v2--small.html +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameProtocolPortsRuleAttached GroupsStatus
    Load Balancer 1HTTP80Round RobinMaureen's VM GroupsActive
    Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive
    Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive
    Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive
    Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive
    diff --git a/src/components/data-table-v2/data-table-v2-expandable.html b/src/components/data-table-v2/data-table-v2-expandable.html deleted file mode 100644 index 828c1cb2f24f..000000000000 --- a/src/components/data-table-v2/data-table-v2-expandable.html +++ /dev/null @@ -1,88 +0,0 @@ -
    -

    Table title

    -
    -
    - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    NameProtocolPortsRuleAttached GroupsStatus
    - - Load Balancer 1HTTP80Round RobinMaureen's VM GroupsActive
    -

    - Harry Potter -

    -

    Harry James Potter (b. 31 July, 1980) was a half-blood wizard, the only child and son of the late James and Lily - Potter (née Evans), and one of the most famous and powerful wizards of modern times. In what proved to be a vain - attempt to circumvent a prophecy that stated that a boy born at the end of July of 1980 could be able to defeat - him, Lord Voldemort tried to murder him when he was a year and three months old. Voldemort murdered Harry's parents - as they tried to protect him, shortly before attacking Harry.

    -
    - Load Balancer 1HTTP80Round RobinMaureen's VM GroupsActive
    -

    - Harry Potter -

    -

    Harry James Potter (b. 31 July, 1980) was a half-blood wizard, the only child and son of the late James and Lily - Potter (née Evans), and one of the most famous and powerful wizards of modern times. In what proved to be a vain - attempt to circumvent a prophecy that stated that a boy born at the end of July of 1980 could be able to defeat - him, Lord Voldemort tried to murder him when he was a year and three months old. Voldemort murdered Harry's parents - as they tried to protect him, shortly before attacking Harry.

    -
    -
    diff --git a/src/components/data-table-v2/data-table-v2.dust b/src/components/data-table-v2/data-table-v2.dust new file mode 100644 index 000000000000..687d8b61b497 --- /dev/null +++ b/src/components/data-table-v2/data-table-v2.dust @@ -0,0 +1,328 @@ +{>_layout/} + +{ +

    Table title

    +
    +
    +
    + + + + + +
    +
    +

    + 3 items selected

    + +
    +
    + +
    + +
    + +
    + + + + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + + + + + + + + + + + +
    + + + Load Balancer 1HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + + + Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + + + Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + + + Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + + + Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + +{/content} diff --git a/src/components/data-table-v2/data-table-v2.html b/src/components/data-table-v2/data-table-v2.html deleted file mode 100644 index a72aa6eecc94..000000000000 --- a/src/components/data-table-v2/data-table-v2.html +++ /dev/null @@ -1,324 +0,0 @@ -
    -

    Table title

    -
    -
    -
    - - - - - -
    -
    -

    - 3 items selected

    - -
    -
    - -
    - -
    - -
    - - - - - - - -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - - - - - - - - - - - -
    - - - Load Balancer 1HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - - - Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - - - Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - - - Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - - - Load Balancer 5HTTP80Round RobinMaureen's VM GroupsActive -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -
    diff --git a/src/components/data-table/data-table--simple.dust b/src/components/data-table/data-table--simple.dust new file mode 100644 index 000000000000..dca099a2c8cd --- /dev/null +++ b/src/components/data-table/data-table--simple.dust @@ -0,0 +1,72 @@ +{>_layout/} + +{ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + First Name + + + + + Last Name + + + + + House + + + +
    HarryPotterGryffindor
    HermoineGrangerGryffindor
    RonWeasleyGryffindor
    DracoMalfoySlytherin
    BlaiseZabiniSlytherin
    CedricDiggoryHufflepuff
    LunaLovegoodRavenclaw
    ChoChangRavenclaw
    + +{/content} diff --git a/src/components/data-table/data-table--simple.html b/src/components/data-table/data-table--simple.html deleted file mode 100644 index b119519df25a..000000000000 --- a/src/components/data-table/data-table--simple.html +++ /dev/null @@ -1,68 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - First Name - - - - - Last Name - - - - - House - - - -
    HarryPotterGryffindor
    HermoineGrangerGryffindor
    RonWeasleyGryffindor
    DracoMalfoySlytherin
    BlaiseZabiniSlytherin
    CedricDiggoryHufflepuff
    LunaLovegoodRavenclaw
    ChoChangRavenclaw
    -
    diff --git a/src/components/data-table/data-table.dust b/src/components/data-table/data-table.dust new file mode 100644 index 000000000000..df8cf7587aa3 --- /dev/null +++ b/src/components/data-table/data-table.dust @@ -0,0 +1,483 @@ +{>_layout/} + +{ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + + + First Name + + + + + Last Name + + + + + House + + + +
    + + + + + + + HarryPotterGryffindor +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +

    Harry Potter

    +

    Harry James Potter (b. 31 July, 1980) was a half-blood wizard, the only child and son of the late James and Lily + Potter (née Evans), and one of the most famous and powerful wizards of modern times. In what proved to be a vain + attempt to circumvent a prophecy that stated that a boy born at the end of July of 1980 could be able to defeat + him, Lord Voldemort tried to murder him when he was a year and three months old. Voldemort murdered Harry's parents + as they tried to protect him, shortly before attacking Harry.

    +
    + + + + + + + HermoineGrangerGryffindor +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    First NameLast NameHouseHelloColumn
    GodricGryffindorOriginSomethingHooray
    SalazarSlytherinOriginSomethingHooray
    +
    + + + + + + + RonWeasleyGryffindor +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    + +
    + + + + + + + DracoMalfoySlytherin +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +

    Draco Malfoy is in Gryffindor House. He is in his fifth year.

    +
    + + + + + + + BlaiseZabiniSlytherin +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +

    Blaise Zabini is in Gryffindor House. He is in his fifth year.

    +
    + + + + + + + CedricDiggoryHufflepuff +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +

    Cedric Diggory is in Hufflepuff House. He is in his fifth year.

    +
    + + + + + + + LunaLovegoodRavenclaw +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +

    Luna Lovegood is in Ravenclaw House. She is in her fifth year.

    +
    + + + + + + + ChoChangRavenclaw +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +

    Cho Chang is in Gryffindor House. She is in her fifth year.

    +
    + +{/content} diff --git a/src/components/data-table/data-table.html b/src/components/data-table/data-table.html deleted file mode 100644 index 1809338c1ac9..000000000000 --- a/src/components/data-table/data-table.html +++ /dev/null @@ -1,479 +0,0 @@ -
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - - - First Name - - - - - Last Name - - - - - House - - - -
    - - - - - - - HarryPotterGryffindor -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -

    Harry Potter

    -

    Harry James Potter (b. 31 July, 1980) was a half-blood wizard, the only child and son of the late James and Lily - Potter (née Evans), and one of the most famous and powerful wizards of modern times. In what proved to be a vain - attempt to circumvent a prophecy that stated that a boy born at the end of July of 1980 could be able to defeat - him, Lord Voldemort tried to murder him when he was a year and three months old. Voldemort murdered Harry's parents - as they tried to protect him, shortly before attacking Harry.

    -
    - - - - - - - HermoineGrangerGryffindor -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - - - - - - - - - - - - - - - - - - - - - - - - - - -
    First NameLast NameHouseHelloColumn
    GodricGryffindorOriginSomethingHooray
    SalazarSlytherinOriginSomethingHooray
    -
    - - - - - - - RonWeasleyGryffindor -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    - -
    - - - - - - - DracoMalfoySlytherin -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -

    Draco Malfoy is in Gryffindor House. He is in his fifth year.

    -
    - - - - - - - BlaiseZabiniSlytherin -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -

    Blaise Zabini is in Gryffindor House. He is in his fifth year.

    -
    - - - - - - - CedricDiggoryHufflepuff -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -

    Cedric Diggory is in Hufflepuff House. He is in his fifth year.

    -
    - - - - - - - LunaLovegoodRavenclaw -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -

    Luna Lovegood is in Ravenclaw House. She is in her fifth year.

    -
    - - - - - - - ChoChangRavenclaw -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -

    Cho Chang is in Gryffindor House. She is in her fifth year.

    -
    -
    \ No newline at end of file diff --git a/src/components/date-picker/date-picker--range.dust b/src/components/date-picker/date-picker--range.dust new file mode 100644 index 000000000000..7ac8da2d94ad --- /dev/null +++ b/src/components/date-picker/date-picker--range.dust @@ -0,0 +1,30 @@ +{>_layout/} + +{ +
    +
    +
    + + +
    + Invalid date format. +
    +
    +
    + + +
    + Invalid date format. +
    +
    + + + + + +
    +
    +{/content} diff --git a/src/components/date-picker/date-picker--range.html b/src/components/date-picker/date-picker--range.html deleted file mode 100644 index 184323fdd0d9..000000000000 --- a/src/components/date-picker/date-picker--range.html +++ /dev/null @@ -1,26 +0,0 @@ - -
    -
    -
    - - -
    - Invalid date format. -
    -
    -
    - - -
    - Invalid date format. -
    -
    - - - - - -
    -
    diff --git a/src/components/date-picker/date-picker--single.dust b/src/components/date-picker/date-picker--single.dust new file mode 100644 index 000000000000..651a90066399 --- /dev/null +++ b/src/components/date-picker/date-picker--single.dust @@ -0,0 +1,22 @@ +{>_layout/} + +{ +
    +
    +
    + + + + + + + +
    + Invalid date format. +
    +
    +
    +
    +{/content} diff --git a/src/components/date-picker/date-picker--single.html b/src/components/date-picker/date-picker--single.html deleted file mode 100644 index d9e4742fcf4a..000000000000 --- a/src/components/date-picker/date-picker--single.html +++ /dev/null @@ -1,18 +0,0 @@ - -
    -
    -
    - - - - - - - -
    - Invalid date format. -
    -
    -
    -
    diff --git a/src/components/date-picker/date-picker.dust b/src/components/date-picker/date-picker.dust new file mode 100644 index 000000000000..63dbeb7a20b1 --- /dev/null +++ b/src/components/date-picker/date-picker.dust @@ -0,0 +1,31 @@ +{>_layout/} + +{ +
    +
    +
    + + +
    + Invalid date format. +
    +
    +
    +
    + + +
    +
    +
    + + +
    + Invalid date format. +
    +
    +
    +
    +{/content} diff --git a/src/components/date-picker/date-picker.html b/src/components/date-picker/date-picker.html deleted file mode 100644 index ff2eb703fa44..000000000000 --- a/src/components/date-picker/date-picker.html +++ /dev/null @@ -1,27 +0,0 @@ - -
    -
    -
    - - -
    - Invalid date format. -
    -
    -
    -
    - - -
    -
    -
    - - -
    - Invalid date format. -
    -
    -
    -
    diff --git a/src/components/detail-page-header/detail-page-header--with-tabs.html b/src/components/detail-page-header/detail-page-header--with-tabs.html deleted file mode 100644 index 49ea00130a6f..000000000000 --- a/src/components/detail-page-header/detail-page-header--with-tabs.html +++ /dev/null @@ -1,79 +0,0 @@ -
    -
    -
    -
    - - - -
    -
    -
    - - - -
    -

    Title

    -
    -
    - Running -
    -
    - -
    -
    -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -
    diff --git a/src/components/detail-page-header/detail-page-header.config.js b/src/components/detail-page-header/detail-page-header.config.js new file mode 100644 index 000000000000..67daad071ca0 --- /dev/null +++ b/src/components/detail-page-header/detail-page-header.config.js @@ -0,0 +1,17 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + }, + { + name: 'with-tabs', + label: 'With tabs', + context: { + hasTabs: true, + }, + }, + ], +}; diff --git a/src/components/detail-page-header/detail-page-header.dust b/src/components/detail-page-header/detail-page-header.dust new file mode 100644 index 000000000000..ae38447bcc75 --- /dev/null +++ b/src/components/detail-page-header/detail-page-header.dust @@ -0,0 +1,88 @@ +{>_layout/} + +{ + {^hasTabs} +
    + {/hasTabs} +
    +
    +
    + + + +
    +
    +
    + + + +
    +

    Title

    +
    +
    + Running +
    +
    + {?hasTabs} + + {/hasTabs} +
    +
    +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
    +
    +{/content} diff --git a/src/components/detail-page-header/detail-page-header.html b/src/components/detail-page-header/detail-page-header.html deleted file mode 100644 index fbb78835dca5..000000000000 --- a/src/components/detail-page-header/detail-page-header.html +++ /dev/null @@ -1,55 +0,0 @@ -
    -
    -
    -
    -
    - - - -
    -
    -
    - - - -
    -

    Title

    -
    -
    - Running -
    -
    -
    -
    -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    -
    -
    diff --git a/src/components/dropdown/dropdown.dust b/src/components/dropdown/dropdown.dust new file mode 100644 index 000000000000..fb9d35579f96 --- /dev/null +++ b/src/components/dropdown/dropdown.dust @@ -0,0 +1,29 @@ +{>_layout/} + +{ +
  • Dropdown label
  • + + + +
  • + +
  • + +{/content} diff --git a/src/components/dropdown/dropdown.html b/src/components/dropdown/dropdown.html deleted file mode 100644 index e0dff10a7536..000000000000 --- a/src/components/dropdown/dropdown.html +++ /dev/null @@ -1,25 +0,0 @@ - diff --git a/src/components/fab/fab.dust b/src/components/fab/fab.dust new file mode 100644 index 000000000000..d5a05000a85b --- /dev/null +++ b/src/components/fab/fab.dust @@ -0,0 +1,11 @@ +{>_layout/} + +{ + + + + + show content + +{/content} diff --git a/src/components/fab/fab.html b/src/components/fab/fab.html deleted file mode 100644 index 16da1fd518bc..000000000000 --- a/src/components/fab/fab.html +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - show content - diff --git a/src/components/file-uploader/file-uploader.dust b/src/components/file-uploader/file-uploader.dust new file mode 100644 index 000000000000..cc6749f43195 --- /dev/null +++ b/src/components/file-uploader/file-uploader.dust @@ -0,0 +1,24 @@ +{>_layout/} + +{ + Account photo +

    only .jpg and .png files. 500kb max file size.

    +
    + + +
    +
    + +{/content} diff --git a/src/components/file-uploader/file-uploader.html b/src/components/file-uploader/file-uploader.html deleted file mode 100644 index d6ccfd3c7f1c..000000000000 --- a/src/components/file-uploader/file-uploader.html +++ /dev/null @@ -1,20 +0,0 @@ -
    - Account photo -

    only .jpg and .png files. 500kb max file size.

    -
    - - -
    -
    -
    diff --git a/src/components/footer/footer.dust b/src/components/footer/footer.dust new file mode 100644 index 000000000000..583068471fbd --- /dev/null +++ b/src/components/footer/footer.dust @@ -0,0 +1,19 @@ +{>_layout/} + +{ + + + +{/content} diff --git a/src/components/footer/footer.html b/src/components/footer/footer.html deleted file mode 100644 index 9657c95b7267..000000000000 --- a/src/components/footer/footer.html +++ /dev/null @@ -1,15 +0,0 @@ - diff --git a/src/components/form/form.dust b/src/components/form/form.dust new file mode 100644 index 000000000000..4655f7af65ee --- /dev/null +++ b/src/components/form/form.dust @@ -0,0 +1,44 @@ +{>_layout/} + +{ + + +
    + Username is taken. +
    + +
    + + +
    + Please do not leave blank. +
    +
    +
    + +
    + +
    + Please choose an option. +
    + + + +
    +
    +
    + +
    +{/content} diff --git a/src/components/form/form.html b/src/components/form/form.html deleted file mode 100644 index 4d126b5debb1..000000000000 --- a/src/components/form/form.html +++ /dev/null @@ -1,40 +0,0 @@ -
    - - -
    - Username is taken. -
    -
    -
    - - -
    - Please do not leave blank. -
    -
    -
    - -
    - -
    - Please choose an option. -
    - - - -
    -
    -
    - -
    diff --git a/src/components/grid/grid.dust b/src/components/grid/grid.dust new file mode 100644 index 000000000000..48a9362c8add --- /dev/null +++ b/src/components/grid/grid.dust @@ -0,0 +1,28 @@ +{>_layout/} + +{ +
    +
    +
    +
    +
    +

    Content space for bx--col-xs-12 bx--col-sm-6

    +
    +
    +
    +

    Full space for bx--col-xs-12 bx--col-sm-6 (columns naturally have padding on them, adding a background color to + the column directly will effect the entire column, as opposed to using a child element in the example to the + left).

    +
    +
    + +

    Columns also expand to match the vertical size of the rest of the row (see red column)

    +
    +
    +

    Background color over entire column, not just content space

    + +
    +
    + +{/content} diff --git a/src/components/grid/grid.html b/src/components/grid/grid.html deleted file mode 100644 index 40d0b2a5b570..000000000000 --- a/src/components/grid/grid.html +++ /dev/null @@ -1,24 +0,0 @@ -
    -
    -
    -
    -
    -
    -

    Content space for bx--col-xs-12 bx--col-sm-6

    -
    -
    -
    -

    Full space for bx--col-xs-12 bx--col-sm-6 (columns naturally have padding on them, adding a background color to - the column directly will effect the entire column, as opposed to using a child element in the example to the - left).

    -
    -
    - -

    Columns also expand to match the vertical size of the rest of the row (see red column)

    -
    -
    -

    Background color over entire column, not just content space

    - -
    -
    -
    \ No newline at end of file diff --git a/src/components/interior-left-nav/interior-left-nav-keep-open.html b/src/components/interior-left-nav/interior-left-nav-keep-open.html deleted file mode 100644 index 8a1d69f6256e..000000000000 --- a/src/components/interior-left-nav/interior-left-nav-keep-open.html +++ /dev/null @@ -1,74 +0,0 @@ - diff --git a/src/components/interior-left-nav/interior-left-nav.config.js b/src/components/interior-left-nav/interior-left-nav.config.js new file mode 100644 index 000000000000..804f970550fd --- /dev/null +++ b/src/components/interior-left-nav/interior-left-nav.config.js @@ -0,0 +1,22 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + notes: ` + Interior left navigation organizes the content structure and provides + context to support user orientation. This pattern accommodates the + breadth of content and tasks users expect to see. + `, + }, + { + name: 'keep-open', + label: 'Keep open', + context: { + keepOpen: true, + }, + }, + ], +}; diff --git a/src/components/interior-left-nav/interior-left-nav.dust b/src/components/interior-left-nav/interior-left-nav.dust new file mode 100644 index 000000000000..c27486874af6 --- /dev/null +++ b/src/components/interior-left-nav/interior-left-nav.dust @@ -0,0 +1,77 @@ +{>_layout/} + +{ + + + + +{/content} diff --git a/src/components/interior-left-nav/interior-left-nav.html b/src/components/interior-left-nav/interior-left-nav.html deleted file mode 100644 index b4b3a6ee6385..000000000000 --- a/src/components/interior-left-nav/interior-left-nav.html +++ /dev/null @@ -1,73 +0,0 @@ - diff --git a/src/components/lightbox/lightbox.dust b/src/components/lightbox/lightbox.dust new file mode 100644 index 000000000000..81e5df32754a --- /dev/null +++ b/src/components/lightbox/lightbox.dust @@ -0,0 +1,51 @@ +{>_layout/} + +{Open Lightbox + + +{/content} diff --git a/src/components/lightbox/lightbox.html b/src/components/lightbox/lightbox.html deleted file mode 100644 index 5746773fa60d..000000000000 --- a/src/components/lightbox/lightbox.html +++ /dev/null @@ -1,47 +0,0 @@ - - - diff --git a/src/components/link/link.dust b/src/components/link/link.dust new file mode 100644 index 000000000000..865853442063 --- /dev/null +++ b/src/components/link/link.dust @@ -0,0 +1,6 @@ +{>_layout/} + +{Link + Link +{/content} diff --git a/src/components/link/link.html b/src/components/link/link.html deleted file mode 100644 index 3acaf88a065d..000000000000 --- a/src/components/link/link.html +++ /dev/null @@ -1,2 +0,0 @@ -Link -Link diff --git a/src/components/list-box/list-box--inline.html b/src/components/list-box/list-box--inline.html deleted file mode 100644 index 9229d6bb5d78..000000000000 --- a/src/components/list-box/list-box--inline.html +++ /dev/null @@ -1,28 +0,0 @@ -
    - -
    -
    -
    - Label -
    - - Close menu - - -
    -
    -
    -
    Option 1
    -
    Option 2
    -
    Option 3
    -
    Option 4
    -
    -
    diff --git a/src/components/list-box/list-box.config.js b/src/components/list-box/list-box.config.js new file mode 100644 index 000000000000..2b787ccdb462 --- /dev/null +++ b/src/components/list-box/list-box.config.js @@ -0,0 +1,17 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + }, + { + name: 'inline', + label: 'Inline', + context: { + inline: true, + }, + }, + ], +}; diff --git a/src/components/list-box/list-box.dust b/src/components/list-box/list-box.dust new file mode 100644 index 000000000000..ce7b4a3c052b --- /dev/null +++ b/src/components/list-box/list-box.dust @@ -0,0 +1,32 @@ +{>_layout/} + +{ + + +
    +
    + Label +
    + + Close menu + + +
    +
    +
    +
    Option 1
    +
    Option 2
    +
    Option 3
    +
    Option 4
    +
    +
    +{/content} diff --git a/src/components/list-box/list-box.html b/src/components/list-box/list-box.html deleted file mode 100644 index 143825d2fa70..000000000000 --- a/src/components/list-box/list-box.html +++ /dev/null @@ -1,27 +0,0 @@ -
    - -
    -
    -
    Label -
    - - Close menu - - -
    -
    -
    -
    Option 1
    -
    Option 2
    -
    Option 3
    -
    Option 4
    -
    -
    diff --git a/src/components/list/list--ordered.html b/src/components/list/list--ordered.html deleted file mode 100644 index f45e5de75e21..000000000000 --- a/src/components/list/list--ordered.html +++ /dev/null @@ -1,10 +0,0 @@ -
      -
    1. Ordered List level 1 -
        -
      1. Ordered List level 2
      2. -
      3. Ordered List level 2
      4. -
      -
    2. -
    3. Ordered List level 1
    4. -
    5. Ordered List level 1
    6. -
    diff --git a/src/components/list/list.config.js b/src/components/list/list.config.js new file mode 100644 index 000000000000..2ddea7186861 --- /dev/null +++ b/src/components/list/list.config.js @@ -0,0 +1,24 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Unordered', + context: { + tag: 'ul', + type: 'unordered', + displayType: 'Unordered', + }, + }, + { + name: 'ordered', + label: 'Ordered', + context: { + tag: 'ol', + type: 'ordered', + displayType: 'Ordered', + }, + }, + ], +}; diff --git a/src/components/list/list.dust b/src/components/list/list.dust new file mode 100644 index 000000000000..aaf5db4d2198 --- /dev/null +++ b/src/components/list/list.dust @@ -0,0 +1,14 @@ +{>_layout/} + +{ +
  • {displayType} List level 1 + <{tag} class="bx--list--nested"> +
  • {displayType} List level 2
  • +
  • {displayType} List level 2
  • + + +
  • {displayType} List level 1
  • +
  • {displayType} List level 1
  • + +{/content} diff --git a/src/components/list/list.html b/src/components/list/list.html deleted file mode 100644 index 3cec5a430e18..000000000000 --- a/src/components/list/list.html +++ /dev/null @@ -1,10 +0,0 @@ -
      -
    • Unordered List level 1 -
        -
      • Unordered List level 2
      • -
      • Unordered List level 2
      • -
      -
    • -
    • Unordered List level 1
    • -
    • Unordered List level 1
    • -
    diff --git a/src/components/loading/loading--small.html b/src/components/loading/loading--small.html deleted file mode 100644 index 50c3d2f4b8dc..000000000000 --- a/src/components/loading/loading--small.html +++ /dev/null @@ -1,6 +0,0 @@ -
    - - Loading - - -
    diff --git a/src/components/loading/loading--without-overlay.html b/src/components/loading/loading--without-overlay.html deleted file mode 100644 index eff146fff89f..000000000000 --- a/src/components/loading/loading--without-overlay.html +++ /dev/null @@ -1,6 +0,0 @@ -
    - - Loading - - -
    diff --git a/src/components/loading/loading.config.js b/src/components/loading/loading.config.js new file mode 100644 index 000000000000..a5ce6828f328 --- /dev/null +++ b/src/components/loading/loading.config.js @@ -0,0 +1,32 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + notes: ` + Loading spinners are used when retrieving data or performing slow computations, + and help to notify users that loading is underway. + `, + context: { + overlay: true, + }, + }, + { + name: 'without-overlay', + label: 'Without overlay', + context: { + overlay: false, + }, + }, + { + name: 'small', + label: 'Small', + context: { + overlay: false, + small: true, + }, + }, + ], +}; diff --git a/src/components/loading/loading.dust b/src/components/loading/loading.dust new file mode 100644 index 000000000000..dd6c0bf6fc66 --- /dev/null +++ b/src/components/loading/loading.dust @@ -0,0 +1,12 @@ +{>_layout/} + +{{/overlay} +
    + + Loading + + +
    + {?overlay}{/overlay} +{/content} diff --git a/src/components/loading/loading.html b/src/components/loading/loading.html deleted file mode 100644 index 48626960c484..000000000000 --- a/src/components/loading/loading.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -
    - - Loading - - -
    -
    diff --git a/src/components/modal/modal--nofooter.html b/src/components/modal/modal--nofooter.html deleted file mode 100644 index 89a3930dde40..000000000000 --- a/src/components/modal/modal--nofooter.html +++ /dev/null @@ -1,21 +0,0 @@ - - -
    -
    -
    -

    Optional label

    -

    Modal heading

    - -
    - -
    -

    Passive modal notifications should only appear if there is an action the user needs to address immediately. Passive - modal notifications are persistent on the screen.

    -
    -
    -
    diff --git a/src/components/modal/modal.config.js b/src/components/modal/modal.config.js new file mode 100644 index 000000000000..ee79b91424a4 --- /dev/null +++ b/src/components/modal/modal.config.js @@ -0,0 +1,24 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + notes: ` + Modals communicate information via a secondary window and allow the user to maintain the context of a particular task. + `, + context: { + hasFooter: true, + }, + }, + { + name: 'nofooter', + label: 'Without footer', + notes: 'Passive modals are modals without footers.', + context: { + hasFooter: false, + }, + }, + ], +}; diff --git a/src/components/modal/modal.dust b/src/components/modal/modal.dust new file mode 100644 index 000000000000..d47ed5168175 --- /dev/null +++ b/src/components/modal/modal.dust @@ -0,0 +1,31 @@ +{>_layout/} + +{Show modal + + +{/content} diff --git a/src/components/modal/modal.html b/src/components/modal/modal.html deleted file mode 100644 index 412d0db022f2..000000000000 --- a/src/components/modal/modal.html +++ /dev/null @@ -1,25 +0,0 @@ - - - diff --git a/src/components/module/module.dust b/src/components/module/module.dust new file mode 100644 index 000000000000..dc33d33fe487 --- /dev/null +++ b/src/components/module/module.dust @@ -0,0 +1,80 @@ +{>_layout/} + +{ +
    +
    +

    Example header

    +
    +
    +

    + Example content +

    +
    +
    + +
    +
    +
    +

    Example header

    +
    +
    +

    + Example centered content +

    +
    +
    +
    +
    +
    +
    +

    Example header

    +
    +
    +

    + Example scrollable content. +

    +

    + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce laoreet risus a elit egestas feugiat. Class aptent taciti + sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus imperdiet, mi in aliquam condimentum, + dui quam elementum metus, in porta ex elit sed augue. +

    +

    + Donec quis orci quis ex euismod rhoncus vel eu elit. Pellentesque posuere libero id nisi aliquam, sed iaculis ligula fringilla. + Vestibulum vulputate tellus nisi, id facilisis ipsum sodales sit amet. Nam dui eros, pulvinar a sodales nec, imperdiet + non sem. Etiam pharetra velit diam, at sagittis nunc laoreet cursus. Donec faucibus fringilla nibh nec ultrices. + Curabitur urna felis, mollis feugiat elementum vel, ultricies quis neque. +

    +

    + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce laoreet risus a elit egestas feugiat. Class aptent taciti + sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus imperdiet, mi in aliquam condimentum, + dui quam elementum metus, in porta ex elit sed augue. Donec quis orci quis ex euismod rhoncus vel eu elit. Pellentesque + posuere libero id nisi aliquam, sed iaculis ligula fringilla. +

    +

    + Vestibulum vulputate tellus nisi, id facilisis ipsum sodales sit amet. Nam dui eros, pulvinar a sodales nec, imperdiet non + sem. Etiam pharetra velit diam, at sagittis nunc laoreet cursus. Donec faucibus fringilla nibh nec ultrices. Curabitur + urna felis, mollis feugiat elementum vel, ultricies quis neque. +

    +
    +
    +
    +
    +
    +
    +

    + Example centered content without header +

    +
    +
    +
    +
    +
    +
    +

    + Example content without header +

    +
    +
    +
    +{/content} diff --git a/src/components/module/module.html b/src/components/module/module.html deleted file mode 100644 index 38c5e7187227..000000000000 --- a/src/components/module/module.html +++ /dev/null @@ -1,76 +0,0 @@ -
    -
    -
    -

    Example header

    -
    -
    -

    - Example content -

    -
    -
    -
    -
    -
    -
    -

    Example header

    -
    -
    -

    - Example centered content -

    -
    -
    -
    -
    -
    -
    -

    Example header

    -
    -
    -

    - Example scrollable content. -

    -

    - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce laoreet risus a elit egestas feugiat. Class aptent taciti - sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus imperdiet, mi in aliquam condimentum, - dui quam elementum metus, in porta ex elit sed augue. -

    -

    - Donec quis orci quis ex euismod rhoncus vel eu elit. Pellentesque posuere libero id nisi aliquam, sed iaculis ligula fringilla. - Vestibulum vulputate tellus nisi, id facilisis ipsum sodales sit amet. Nam dui eros, pulvinar a sodales nec, imperdiet - non sem. Etiam pharetra velit diam, at sagittis nunc laoreet cursus. Donec faucibus fringilla nibh nec ultrices. - Curabitur urna felis, mollis feugiat elementum vel, ultricies quis neque. -

    -

    - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce laoreet risus a elit egestas feugiat. Class aptent taciti - sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Vivamus imperdiet, mi in aliquam condimentum, - dui quam elementum metus, in porta ex elit sed augue. Donec quis orci quis ex euismod rhoncus vel eu elit. Pellentesque - posuere libero id nisi aliquam, sed iaculis ligula fringilla. -

    -

    - Vestibulum vulputate tellus nisi, id facilisis ipsum sodales sit amet. Nam dui eros, pulvinar a sodales nec, imperdiet non - sem. Etiam pharetra velit diam, at sagittis nunc laoreet cursus. Donec faucibus fringilla nibh nec ultrices. Curabitur - urna felis, mollis feugiat elementum vel, ultricies quis neque. -

    -
    -
    -
    -
    -
    -
    -

    - Example centered content without header -

    -
    -
    -
    -
    -
    -
    -

    - Example content without header -

    -
    -
    -
    diff --git a/src/components/multi-select/multi-select--inline.html b/src/components/multi-select/multi-select--inline.html deleted file mode 100644 index 408512ffa71a..000000000000 --- a/src/components/multi-select/multi-select--inline.html +++ /dev/null @@ -1,80 +0,0 @@ -
    - -
    -
    -
    - Label -
    - - Close menu - - -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    diff --git a/src/components/multi-select/multi-select.config.js b/src/components/multi-select/multi-select.config.js new file mode 100644 index 000000000000..2b787ccdb462 --- /dev/null +++ b/src/components/multi-select/multi-select.config.js @@ -0,0 +1,17 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + }, + { + name: 'inline', + label: 'Inline', + context: { + inline: true, + }, + }, + ], +}; diff --git a/src/components/multi-select/multi-select.dust b/src/components/multi-select/multi-select.dust new file mode 100644 index 000000000000..f71b442ff36d --- /dev/null +++ b/src/components/multi-select/multi-select.dust @@ -0,0 +1,84 @@ +{>_layout/} + +{ + + +
    +
    + Label +
    + + Close menu + + +
    +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +{/content} diff --git a/src/components/multi-select/multi-select.html b/src/components/multi-select/multi-select.html deleted file mode 100644 index eaf7bcc213cf..000000000000 --- a/src/components/multi-select/multi-select.html +++ /dev/null @@ -1,80 +0,0 @@ -
    - -
    -
    -
    - Label -
    - - Close menu - - -
    -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    - -
    -
    -
    -
    diff --git a/src/components/notification/inline-notification.dust b/src/components/notification/inline-notification.dust new file mode 100644 index 000000000000..4b1236cc360d --- /dev/null +++ b/src/components/notification/inline-notification.dust @@ -0,0 +1,71 @@ +{>_layout/} + +{ +
    + + + +
    +

    Notification title

    +

    Subtitle text goes here.

    +
    +
    + + + +
    +
    + + + +
    +

    Notification title

    +

    Subtitle text goes here.

    +
    +
    + +
    + +
    +
    + + + +
    +

    Notification title

    +

    Subtitle text goes here.

    +
    +
    + +
    + + +{/content} diff --git a/src/components/notification/inline-notification.html b/src/components/notification/inline-notification.html deleted file mode 100644 index 3d0dfa0b5a42..000000000000 --- a/src/components/notification/inline-notification.html +++ /dev/null @@ -1,67 +0,0 @@ - - -
    -
    - - - -
    -

    Notification title

    -

    Subtitle text goes here.

    -
    -
    - -
    - -
    -
    - - - -
    -

    Notification title

    -

    Subtitle text goes here.

    -
    -
    - -
    - - diff --git a/src/components/notification/toast-notification.dust b/src/components/notification/toast-notification.dust new file mode 100644 index 000000000000..b856088e1a7c --- /dev/null +++ b/src/components/notification/toast-notification.dust @@ -0,0 +1,55 @@ +{>_layout/} + +{ +
    +

    Notification title

    +

    Subtitle text goes here.

    +

    Time stamp [00:00:00]

    +
    + + + +
    +
    +

    Notification title

    +

    Subtitle text goes here.

    +

    Time stamp [00:00:00]

    +
    + +
    + +
    +
    +

    Notification title

    +

    Subtitle text goes here.

    +

    Time stamp [00:00:00]

    +
    + +
    + + +{/content} diff --git a/src/components/notification/toast-notification.html b/src/components/notification/toast-notification.html deleted file mode 100644 index ac38035c43ab..000000000000 --- a/src/components/notification/toast-notification.html +++ /dev/null @@ -1,51 +0,0 @@ - - -
    -
    -

    Notification title

    -

    Subtitle text goes here.

    -

    Time stamp [00:00:00]

    -
    - -
    - -
    -
    -

    Notification title

    -

    Subtitle text goes here.

    -

    Time stamp [00:00:00]

    -
    - -
    - - diff --git a/src/components/number-input/number-input.dust b/src/components/number-input/number-input.dust new file mode 100644 index 000000000000..280eac64e345 --- /dev/null +++ b/src/components/number-input/number-input.dust @@ -0,0 +1,44 @@ +{>_layout/} + +{ + +
    + +
    + + +
    +
    + + +
    + +
    + +
    + + +
    +
    +
    + Invalid number +
    +
    +{/content} diff --git a/src/components/number-input/number-input.html b/src/components/number-input/number-input.html deleted file mode 100644 index 78ca84ba7a23..000000000000 --- a/src/components/number-input/number-input.html +++ /dev/null @@ -1,40 +0,0 @@ -
    - -
    - -
    - - -
    -
    -
    - -
    - -
    - -
    - - -
    -
    -
    - Invalid number -
    -
    diff --git a/src/components/order-summary/order-summary-category.html b/src/components/order-summary/order-summary-category.html deleted file mode 100644 index 5c4f585d59ee..000000000000 --- a/src/components/order-summary/order-summary-category.html +++ /dev/null @@ -1,90 +0,0 @@ -
    -
    -

    Order Summary

    - - -
    -
      -
    • -

      Category Label

      -
        -
      • -

        Detail one

        -

        $10.00 /mo

        -
      • -
      • -

        Detail one

        -

        $20.00

        -
      • -
      • -

        Detail one

        -

        $20.00

        -
      • -
      -
    • -
    • -

      Category Label

      -
        -
      • -

        Extra long detail to show what a long line is like

        -

        $20000.00

        -
      • -
      • -

        Detail one

        -

        $20.00

        -
      • -
      • -

        Detail one

        -

        $20.00

        -
      • -
      -
    • -
    • -

      Category Label

      -
        -
      • -

        Detail one

        -

        $20.00

        -
      • -
      • -

        Detail one

        -

        $20.00

        -
      • -
      • -

        Detail one

        -

        $20.00

        -
      • -
      -
    • -
    -
    -
    -

    Total due now

    -

    - $0.00 - estimated -

    -
    -

    * This is an estimated price based on a customer’s average usage, includes monthly and hourly pricing.

    - - -
    - -
    diff --git a/src/components/order-summary/order-summary.config.js b/src/components/order-summary/order-summary.config.js new file mode 100644 index 000000000000..06ab494b8b89 --- /dev/null +++ b/src/components/order-summary/order-summary.config.js @@ -0,0 +1,25 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + notes: ` + This component is used to display the items a user will be purchasing. + This version does not include OrderSummaryCategory. + `, + }, + { + name: 'with-category', + label: 'With category', + notes: ` + This component is used to display the items a user will be purchasing. + The category version of OrderSummary can break the items being purchased into categories. + `, + context: { + hasCategory: true, + }, + }, + ], +}; diff --git a/src/components/order-summary/order-summary.dust b/src/components/order-summary/order-summary.dust new file mode 100644 index 000000000000..666d036dc64e --- /dev/null +++ b/src/components/order-summary/order-summary.dust @@ -0,0 +1,117 @@ +{>_layout/} + +{ +
    +

    Order Summary

    + + +
    +
      + {?hasCategory} +
    • +

      Category Label

      +
        +
      • +

        Detail one

        +

        $10.00 /mo

        +
      • +
      • +

        Detail one

        +

        $20.00

        +
      • +
      • +

        Detail one

        +

        $20.00

        +
      • +
      +
    • +
    • +

      Category Label

      +
        +
      • +

        Extra long detail to show what a long line is like

        +

        $20000.00

        +
      • +
      • +

        Detail one

        +

        $20.00

        +
      • +
      • +

        Detail one

        +

        $20.00

        +
      • +
      +
    • +
    • +

      Category Label

      +
        +
      • +

        Detail one

        +

        $20.00

        +
      • +
      • +

        Detail one

        +

        $20.00

        +
      • +
      • +

        Detail one

        +

        $20.00

        +
      • +
      +
    • + {:else} +
    • +

      Detail one

      +

      $20.00

      +
    • +
    • +

      Detail one

      +

      $20.00

      +
    • +
    • +

      Detail one

      +

      -

      +
    • +
    • +

      Detail one

      +

      -

      +
    • + {/hasCategory} +
    +
    +
    +

    Total due now

    +

    + $0.00 + estimated +

    +
    + {?hasCategory} +

    * This is an estimated price based on a customer’s average usage, includes monthly and hourly pricing.

    + {/hasCategory} + + {?hasCategory} + + {/hasCategory} +
    + + +{/content} diff --git a/src/components/order-summary/order-summary.html b/src/components/order-summary/order-summary.html deleted file mode 100644 index 99d94dc39b9a..000000000000 --- a/src/components/order-summary/order-summary.html +++ /dev/null @@ -1,53 +0,0 @@ -
    -
    -

    Order Summary

    - - -
    -
      -
    • -

      Detail one

      -

      $20.00

      -
    • -
    • -

      Detail one

      -

      $20.00

      -
    • -
    • -

      Detail one

      -

      -

      -
    • -
    • -

      Detail one

      -

      -

      -
    • -
    -
    -
    -

    Total due now

    -

    - $0.00 - estimated -

    -
    - -
    - -
    diff --git a/src/components/overflow-menu/overflow-menu.dust b/src/components/overflow-menu/overflow-menu.dust new file mode 100644 index 000000000000..2c6f2fd75876 --- /dev/null +++ b/src/components/overflow-menu/overflow-menu.dust @@ -0,0 +1,53 @@ +{>_layout/} + +{ + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    + + +
    + + + + + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +{/content} diff --git a/src/components/overflow-menu/overflow-menu.html b/src/components/overflow-menu/overflow-menu.html deleted file mode 100644 index 2718bdcc684e..000000000000 --- a/src/components/overflow-menu/overflow-menu.html +++ /dev/null @@ -1,49 +0,0 @@ -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    - -
    - - - - - -
      -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    • - -
    • -
    -
    diff --git a/src/components/pagination/pagination-v2.dust b/src/components/pagination/pagination-v2.dust new file mode 100644 index 000000000000..d0262f909f44 --- /dev/null +++ b/src/components/pagination/pagination-v2.dust @@ -0,0 +1,55 @@ +{>_layout/} + +{ +
    + Items per page: +
    + + + + + +
    + + + 1-10 of + 40 items +
    +
    + + 1 of + 4 pages + + +
    + + + + + +
    + +
    + +{/content} diff --git a/src/components/pagination/pagination-v2.html b/src/components/pagination/pagination-v2.html deleted file mode 100644 index d0731111dea8..000000000000 --- a/src/components/pagination/pagination-v2.html +++ /dev/null @@ -1,51 +0,0 @@ -
    -
    - Items per page: -
    - - - - - -
    - - - 1-10 of - 40 items -
    -
    - - 1 of - 4 pages - - -
    - - - - - -
    - -
    -
    \ No newline at end of file diff --git a/src/components/pagination/pagination.dust b/src/components/pagination/pagination.dust new file mode 100644 index 000000000000..a6f5e8420f46 --- /dev/null +++ b/src/components/pagination/pagination.dust @@ -0,0 +1,38 @@ +{>_layout/} + +{ +
    +
    + + + + + +
    + Items per page  |   + 1-10 of 40 items +
    +
    + 1 of 4 pages + + + + +
    + +{/content} diff --git a/src/components/pagination/pagination.html b/src/components/pagination/pagination.html deleted file mode 100644 index 9da802f0bc0c..000000000000 --- a/src/components/pagination/pagination.html +++ /dev/null @@ -1,34 +0,0 @@ -
    -
    -
    - - - - - -
    - Items per page  |   - 1-10 of 40 items -
    -
    - 1 of 4 pages - - - - -
    -
    diff --git a/src/components/progress-indicator/progress-indicator.dust b/src/components/progress-indicator/progress-indicator.dust new file mode 100644 index 000000000000..f9cc7c18479f --- /dev/null +++ b/src/components/progress-indicator/progress-indicator.dust @@ -0,0 +1,36 @@ +{>_layout/} + +{ +
  • + + + + +

    First step

    + +
  • +
  • + + + + +

    Second step

    + +
  • +
  • + + + +

    Third step

    + +
  • +
  • + + + +

    Fourth step

    + +
  • + +{/content} diff --git a/src/components/progress-indicator/progress-indicator.html b/src/components/progress-indicator/progress-indicator.html deleted file mode 100644 index bf911ccd1a78..000000000000 --- a/src/components/progress-indicator/progress-indicator.html +++ /dev/null @@ -1,32 +0,0 @@ -
      -
    • - - - - -

      First step

      - -
    • -
    • - - - - -

      Second step

      - -
    • -
    • - - - -

      Third step

      - -
    • -
    • - - - -

      Fourth step

      - -
    • -
    diff --git a/src/components/radio-button/radio-button.dust b/src/components/radio-button/radio-button.dust new file mode 100644 index 000000000000..ab15db88cb85 --- /dev/null +++ b/src/components/radio-button/radio-button.dust @@ -0,0 +1,26 @@ +{>_layout/} + +{ + Radio Button heading +
    +
    + + + + + + +
    +
    + +{/content} diff --git a/src/components/radio-button/radio-button.html b/src/components/radio-button/radio-button.html deleted file mode 100644 index 1333114b70d1..000000000000 --- a/src/components/radio-button/radio-button.html +++ /dev/null @@ -1,22 +0,0 @@ -
    - Radio Button heading -
    -
    - - - - - - -
    -
    -
    diff --git a/src/components/search/search-large.html b/src/components/search/search-large.html deleted file mode 100644 index d2d7d8e55ead..000000000000 --- a/src/components/search/search-large.html +++ /dev/null @@ -1,29 +0,0 @@ - diff --git a/src/components/search/search-small.html b/src/components/search/search-small.html deleted file mode 100644 index b13131eaa668..000000000000 --- a/src/components/search/search-small.html +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/src/components/search/search.config.js b/src/components/search/search.config.js new file mode 100644 index 000000000000..6bbd071b9df3 --- /dev/null +++ b/src/components/search/search.config.js @@ -0,0 +1,32 @@ +'use stirct'; + +module.exports = { + default: 'large', + variants: [ + { + name: 'large', + label: 'Normal', + notes: ` + Search enables users to specify a word or a phrase to find particular relevant pieces of content + without the use of navigation. Search can be used as the primary means of discovering content, + or as a filter to aid the user in finding content. + `, + context: { + suffix: 'lg', + }, + }, + { + name: 'small', + label: 'Small', + notes: ` + Search enables users to specify a word or a phrase to find particular relevant pieces of content + without the use of navigation. Search can be used as the primary means of discovering content, + or as a filter to aid the user in finding content. With the small version, the search field will be + more compact. + `, + context: { + suffix: 'sm', + }, + }, + ], +}; diff --git a/src/components/search/search.dust b/src/components/search/search.dust new file mode 100644 index 000000000000..d6e95f547d01 --- /dev/null +++ b/src/components/search/search.dust @@ -0,0 +1,35 @@ +{>_layout/} + +{ + + + + + + + + + + {@eq key=suffix value="lg"} + + + {/eq} + +{/content} diff --git a/src/components/select/inline-select.html b/src/components/select/inline-select.html deleted file mode 100644 index acf828fecb66..000000000000 --- a/src/components/select/inline-select.html +++ /dev/null @@ -1,20 +0,0 @@ -
    -
    - - - - - -
    -
    diff --git a/src/components/select/select.config.js b/src/components/select/select.config.js new file mode 100644 index 000000000000..21f2871ec4e6 --- /dev/null +++ b/src/components/select/select.config.js @@ -0,0 +1,24 @@ +'use stirct'; + +module.exports = { + variants: [ + { + name: 'default', + label: 'Default', + notes: ` + Select displays a list below its title when selected. They are used primarily in forms, + where a user chooses one option from a list. Once the user selects an item, the dropdown will + dissapear and the field will reflect the user's choice. Create Select Item components for each + option in the list. + `, + }, + { + name: 'inline', + label: 'Inline', + notes: 'Inline select is for use when there will be multiple elements in a row.', + context: { + inline: true, + }, + }, + ], +}; diff --git a/src/components/select/select.dust b/src/components/select/select.dust new file mode 100644 index 000000000000..1def15814137 --- /dev/null +++ b/src/components/select/select.dust @@ -0,0 +1,29 @@ +{>_layout/} + +{ + {^inline} + + {/inline} +
    + {?inline} + + {/inline} + + + + +
    + +{/content} diff --git a/src/components/select/select.html b/src/components/select/select.html deleted file mode 100644 index d9bbccb86b2a..000000000000 --- a/src/components/select/select.html +++ /dev/null @@ -1,20 +0,0 @@ -
    - -
    - - - - -
    -
    diff --git a/src/components/slider/slider.dust b/src/components/slider/slider.dust new file mode 100644 index 000000000000..a4a598bc6705 --- /dev/null +++ b/src/components/slider/slider.dust @@ -0,0 +1,20 @@ +{>_layout/} + +{ + +
    +
    + 0 +
    +
    +
    +
    + +
    + 100 + +
    +
    + +{/content} diff --git a/src/components/slider/slider.html b/src/components/slider/slider.html deleted file mode 100644 index d7abc3d0caec..000000000000 --- a/src/components/slider/slider.html +++ /dev/null @@ -1,16 +0,0 @@ -
    - -
    -
    - 0 -
    -
    -
    -
    - -
    - 100 - -
    -
    -
    diff --git a/src/components/structured-list/structured-list--selection.dust b/src/components/structured-list/structured-list--selection.dust new file mode 100644 index 000000000000..fe376528fbc7 --- /dev/null +++ b/src/components/structured-list/structured-list--selection.dust @@ -0,0 +1,69 @@ +{>_layout/} + +{ +
    +
    +
    +
    Column A
    +
    Column B
    +
    Column C
    +
    +
    +
    + + + + +
    + +{/content} diff --git a/src/components/structured-list/structured-list--selection.html b/src/components/structured-list/structured-list--selection.html deleted file mode 100644 index 34b857881a52..000000000000 --- a/src/components/structured-list/structured-list--selection.html +++ /dev/null @@ -1,65 +0,0 @@ -
    -
    -
    -
    -
    Column A
    -
    Column B
    -
    Column C
    -
    -
    -
    - - - - -
    -
    diff --git a/src/components/structured-list/structured-list.dust b/src/components/structured-list/structured-list.dust new file mode 100644 index 000000000000..ca87b7a82097 --- /dev/null +++ b/src/components/structured-list/structured-list.dust @@ -0,0 +1,31 @@ +{>_layout/} + +{ +
    +
    +
    ColumnA
    +
    ColumnB
    +
    ColumnC
    +
    +
    +
    +
    +
    Row 1
    +
    Row 1
    +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui magna, finibus id tortor sed, aliquet bibendum augue. Aenean posuere sem vel euismod dignissim. Nulla ut cursus dolor. Pellentesque vulputate nisl a porttitor interdum. +
    +
    +
    +
    Row 2
    +
    + Row 2 +
    +
    + Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui magna, finibus id tortor sed, aliquet bibendum augue. Aenean posuere sem vel euismod dignissim. Nulla ut cursus dolor. Pellentesque vulputate nisl a porttitor interdum. +
    +
    +
    + +{/content} diff --git a/src/components/structured-list/structured-list.html b/src/components/structured-list/structured-list.html deleted file mode 100644 index 96cf4c3931ef..000000000000 --- a/src/components/structured-list/structured-list.html +++ /dev/null @@ -1,27 +0,0 @@ -
    -
    -
    -
    ColumnA
    -
    ColumnB
    -
    ColumnC
    -
    -
    -
    -
    -
    Row 1
    -
    Row 1
    -
    - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui magna, finibus id tortor sed, aliquet bibendum augue. Aenean posuere sem vel euismod dignissim. Nulla ut cursus dolor. Pellentesque vulputate nisl a porttitor interdum. -
    -
    -
    -
    Row 2
    -
    - Row 2 -
    -
    - Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc dui magna, finibus id tortor sed, aliquet bibendum augue. Aenean posuere sem vel euismod dignissim. Nulla ut cursus dolor. Pellentesque vulputate nisl a porttitor interdum. -
    -
    -
    -
    diff --git a/src/components/tabs/tabs.dust b/src/components/tabs/tabs.dust new file mode 100644 index 000000000000..1ecd1f4faee8 --- /dev/null +++ b/src/components/tabs/tabs.dust @@ -0,0 +1,47 @@ +{>_layout/} + +{ +
    + + + + +
    + + + +
    +
    +

    Content for first tab goes here.

    +
    + + + + +
    +{/content} diff --git a/src/components/tabs/tabs.html b/src/components/tabs/tabs.html deleted file mode 100644 index af51243edca2..000000000000 --- a/src/components/tabs/tabs.html +++ /dev/null @@ -1,43 +0,0 @@ - - -
    -
    -

    Content for first tab goes here.

    -
    - - - - -
    diff --git a/src/components/tag/tag.dust b/src/components/tag/tag.dust new file mode 100644 index 000000000000..173ef2b9e15f --- /dev/null +++ b/src/components/tag/tag.dust @@ -0,0 +1,13 @@ +{>_layout/} + +{IBM + Beta + Third-Party + Local + Dedicated + Custom + Experimental + Community + Private +{/content} diff --git a/src/components/tag/tag.html b/src/components/tag/tag.html deleted file mode 100644 index 447fa7dcb275..000000000000 --- a/src/components/tag/tag.html +++ /dev/null @@ -1,9 +0,0 @@ -IBM -Beta -Third-Party -Local -Dedicated -Custom -Experimental -Community -Private diff --git a/src/components/text-area/text-area.dust b/src/components/text-area/text-area.dust new file mode 100644 index 000000000000..ce0b0291a1e4 --- /dev/null +++ b/src/components/text-area/text-area.dust @@ -0,0 +1,6 @@ +{>_layout/} + +{Text Area label + +{/content} diff --git a/src/components/text-area/text-area.html b/src/components/text-area/text-area.html deleted file mode 100644 index 40b3f9c72d6b..000000000000 --- a/src/components/text-area/text-area.html +++ /dev/null @@ -1,2 +0,0 @@ - - diff --git a/src/components/text-input/text-input.dust b/src/components/text-input/text-input.dust new file mode 100644 index 000000000000..af00a1ed3028 --- /dev/null +++ b/src/components/text-input/text-input.dust @@ -0,0 +1,13 @@ +{>_layout/} + +{ + + + + +
    + + +
    +{/content} diff --git a/src/components/text-input/text-input.html b/src/components/text-input/text-input.html deleted file mode 100644 index 27b6437b518e..000000000000 --- a/src/components/text-input/text-input.html +++ /dev/null @@ -1,9 +0,0 @@ -
    - - -
    - -
    - - -
    diff --git a/src/components/tile/tile--clickable.dust b/src/components/tile/tile--clickable.dust new file mode 100644 index 000000000000..7a7adeee91c6 --- /dev/null +++ b/src/components/tile/tile--clickable.dust @@ -0,0 +1,5 @@ +{>_layout/} + +{ +{/content} diff --git a/src/components/tile/tile--clickable.html b/src/components/tile/tile--clickable.html deleted file mode 100644 index b0ec419f0783..000000000000 --- a/src/components/tile/tile--clickable.html +++ /dev/null @@ -1 +0,0 @@ - diff --git a/src/components/tile/tile--expandable.dust b/src/components/tile/tile--expandable.dust new file mode 100644 index 000000000000..779188725edf --- /dev/null +++ b/src/components/tile/tile--expandable.dust @@ -0,0 +1,19 @@ +{>_layout/} + +{ + +
    + + + + + + +
    + +{/content} diff --git a/src/components/tile/tile--expandable.html b/src/components/tile/tile--expandable.html deleted file mode 100644 index fa96b9246064..000000000000 --- a/src/components/tile/tile--expandable.html +++ /dev/null @@ -1,15 +0,0 @@ -
    - -
    - - - - - - -
    -
    diff --git a/src/components/tile/tile--grid.dust b/src/components/tile/tile--grid.dust new file mode 100644 index 000000000000..6aae6e379993 --- /dev/null +++ b/src/components/tile/tile--grid.dust @@ -0,0 +1,112 @@ +{>_layout/} + +{ + +
    +
    +
    +
    + +
    + + +

    Above the fold content here

    +
    + + +

    Below the fold content here

    +
    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    + +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    +
    + + +{/content} diff --git a/src/components/tile/tile--grid.html b/src/components/tile/tile--grid.html deleted file mode 100644 index 582e2a8255bc..000000000000 --- a/src/components/tile/tile--grid.html +++ /dev/null @@ -1,108 +0,0 @@ -
    - -
    -
    -
    -
    - -
    - - -

    Above the fold content here

    -
    - - -

    Below the fold content here

    -
    -
    -
    -
    -
    -
    -
    - -
    -
    - -
    -
    -
    -
    - -
    -
    - -
    -
    - -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    -
    - -
    diff --git a/src/components/tile/tile--selectable.dust b/src/components/tile/tile--selectable.dust new file mode 100644 index 000000000000..9fbe99376cbc --- /dev/null +++ b/src/components/tile/tile--selectable.dust @@ -0,0 +1,15 @@ +{>_layout/} + +{ + +
    + + + +
    +
    + +
    + +{/content} diff --git a/src/components/tile/tile--selectable.html b/src/components/tile/tile--selectable.html deleted file mode 100644 index cb9f39feac8d..000000000000 --- a/src/components/tile/tile--selectable.html +++ /dev/null @@ -1,11 +0,0 @@ - diff --git a/src/components/tile/tile.dust b/src/components/tile/tile.dust new file mode 100644 index 000000000000..ad2f8123041a --- /dev/null +++ b/src/components/tile/tile.dust @@ -0,0 +1,5 @@ +{>_layout/} + +{ +{/content} diff --git a/src/components/tile/tile.html b/src/components/tile/tile.html deleted file mode 100644 index ee51de8db4c3..000000000000 --- a/src/components/tile/tile.html +++ /dev/null @@ -1 +0,0 @@ -
    diff --git a/src/components/time-picker/time-picker.dust b/src/components/time-picker/time-picker.dust new file mode 100644 index 000000000000..345e74cf2672 --- /dev/null +++ b/src/components/time-picker/time-picker.dust @@ -0,0 +1,37 @@ +{>_layout/} + +{ + +
    +
    + +
    + Invalid time. +
    +
    +
    + + + + + +
    +
    + + + + + +
    +
    + +{/content} diff --git a/src/components/time-picker/time-picker.html b/src/components/time-picker/time-picker.html deleted file mode 100644 index 39a555b9fafd..000000000000 --- a/src/components/time-picker/time-picker.html +++ /dev/null @@ -1,33 +0,0 @@ -
    - -
    -
    - -
    - Invalid time. -
    -
    -
    - - - - - -
    -
    - - - - - -
    -
    -
    diff --git a/src/components/toggle/toggle--small.dust b/src/components/toggle/toggle--small.dust new file mode 100644 index 000000000000..eec82633b570 --- /dev/null +++ b/src/components/toggle/toggle--small.dust @@ -0,0 +1,25 @@ +{>_layout/} + +{ + + + + +
    + + +
    +{/content} diff --git a/src/components/toggle/toggle--small.html b/src/components/toggle/toggle--small.html deleted file mode 100644 index 6c1140b6ec60..000000000000 --- a/src/components/toggle/toggle--small.html +++ /dev/null @@ -1,21 +0,0 @@ -
    - - -
    - -
    - - -
    diff --git a/src/components/toggle/toggle.dust b/src/components/toggle/toggle.dust new file mode 100644 index 000000000000..e49e476890a9 --- /dev/null +++ b/src/components/toggle/toggle.dust @@ -0,0 +1,33 @@ +{>_layout/} + +{ + + + + +
    + Toggle w/ Label +
    + + +
    +
    + +
    + + +
    +{/content} diff --git a/src/components/toggle/toggle.html b/src/components/toggle/toggle.html deleted file mode 100644 index b82b698976e7..000000000000 --- a/src/components/toggle/toggle.html +++ /dev/null @@ -1,29 +0,0 @@ -
    - - -
    - -
    - Toggle w/ Label -
    - - -
    -
    - -
    - - -
    diff --git a/src/components/toolbar/toolbar.dust b/src/components/toolbar/toolbar.dust new file mode 100644 index 000000000000..230b047e8eec --- /dev/null +++ b/src/components/toolbar/toolbar.dust @@ -0,0 +1,91 @@ +{>_layout/} + +{ + +
    + + + +
      +
    • FILTER BY
    • +
    • + + +
    • +
    • + + +
    • +
    • + + +
    • +
    +
    +
    + + + + + +
      +
    • + +
    • +
      +
    • ROW HEIGHT
    • +
      + Select table row height +
    • + + +
    • +
    • + + +
    • +
      +
    +
    + +{/content} diff --git a/src/components/toolbar/toolbar.html b/src/components/toolbar/toolbar.html deleted file mode 100644 index af54d59a0eb5..000000000000 --- a/src/components/toolbar/toolbar.html +++ /dev/null @@ -1,87 +0,0 @@ -
    - -
    - - - -
      -
    • FILTER BY
    • -
    • - - -
    • -
    • - - -
    • -
    • - - -
    • -
    -
    -
    - - - - - -
      -
    • - -
    • -
      -
    • ROW HEIGHT
    • -
      - Select table row height -
    • - - -
    • -
    • - - -
    • -
      -
    -
    -
    diff --git a/src/components/tooltip/tooltip--simple.dust b/src/components/tooltip/tooltip--simple.dust new file mode 100644 index 000000000000..6fff846de50c --- /dev/null +++ b/src/components/tooltip/tooltip--simple.dust @@ -0,0 +1,12 @@ +{>_layout/} + +{ +

    Tooltip label

    +
    + + + +
    + +{/content} diff --git a/src/components/tooltip/tooltip--simple.html b/src/components/tooltip/tooltip--simple.html deleted file mode 100644 index 79eaa60d01fd..000000000000 --- a/src/components/tooltip/tooltip--simple.html +++ /dev/null @@ -1,8 +0,0 @@ -
    -

    Tooltip label

    -
    - - - -
    -
    diff --git a/src/components/tooltip/tooltip.dust b/src/components/tooltip/tooltip.dust new file mode 100644 index 000000000000..4392f0dc23c6 --- /dev/null +++ b/src/components/tooltip/tooltip.dust @@ -0,0 +1,14 @@ +{>_layout/} + +{ + Tooltip label + + + + +
    +

    Tooltip subtitle

    +

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, seed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    +
    +{/content} diff --git a/src/components/tooltip/tooltip.html b/src/components/tooltip/tooltip.html deleted file mode 100644 index fbd14cda4d53..000000000000 --- a/src/components/tooltip/tooltip.html +++ /dev/null @@ -1,10 +0,0 @@ - - Tooltip label - - - - -
    -

    Tooltip subtitle

    -

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, seed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.

    -
    diff --git a/src/components/unified-header/unified-header.dust b/src/components/unified-header/unified-header.dust new file mode 100644 index 000000000000..95b1f7741d63 --- /dev/null +++ b/src/components/unified-header/unified-header.dust @@ -0,0 +1,504 @@ +{>_layout/} + +{ +
    + + + + + + + + + +
    + +{/content} diff --git a/src/components/unified-header/unified-header.html b/src/components/unified-header/unified-header.html deleted file mode 100644 index e7e7bc0f56eb..000000000000 --- a/src/components/unified-header/unified-header.html +++ /dev/null @@ -1,500 +0,0 @@ - -
    - - - - - - - - - -
    - diff --git a/tests/spec/accordion_spec.js b/tests/spec/accordion_spec.js index 2159348b05f8..90e06ea7cdb7 100644 --- a/tests/spec/accordion_spec.js +++ b/tests/spec/accordion_spec.js @@ -1,6 +1,6 @@ import Accordion from '../../src/components/accordion/accordion'; -import HTML from '../../src/components/accordion/accordion.html'; -import LegacyHTML from '../../src/components/accordion/legacyaccordion.html'; +import HTML from '../../html/accordion/accordion.html'; +import LegacyHTML from '../../html/accordion/accordion--legacy.html'; import flattenOptions from '../utils/flatten-options'; describe('Test accordion', function() { diff --git a/tests/spec/carousel_spec.js b/tests/spec/carousel_spec.js index 3e9afd3c8659..cbf4e362d6a7 100644 --- a/tests/spec/carousel_spec.js +++ b/tests/spec/carousel_spec.js @@ -1,5 +1,5 @@ import Carousel from '../../src/components/carousel/carousel'; -import HTML from '../../src/components/carousel/carousel.html'; +import HTML from '../../html/carousel/carousel.html'; import flattenOptions from '../utils/flatten-options'; describe('Carousel', () => { diff --git a/tests/spec/checkbox_spec.js b/tests/spec/checkbox_spec.js index 99fcb483a1a1..d019b06ce62e 100644 --- a/tests/spec/checkbox_spec.js +++ b/tests/spec/checkbox_spec.js @@ -1,5 +1,5 @@ import Checkbox from '../../src/components/checkbox/checkbox'; -import HTML from '../../src/components/checkbox/checkbox.html'; +import HTML from '../../html/checkbox/checkbox.html'; import flattenOptions from '../utils/flatten-options'; describe('Test Checkbox', function() { diff --git a/tests/spec/content-switcher_spec.js b/tests/spec/content-switcher_spec.js index f6e50c4b8134..14c5513da705 100644 --- a/tests/spec/content-switcher_spec.js +++ b/tests/spec/content-switcher_spec.js @@ -1,7 +1,7 @@ import Promise, { promisify } from 'bluebird'; // For testing on browsers not supporting Promise import EventManager from '../utils/event-manager'; import ContentSwitcher from '../../src/components/content-switcher/content-switcher'; -import HTML from '../../src/components/content-switcher/content-switcher.html'; +import HTML from '../../html/content-switcher/content-switcher.html'; import flattenOptions from '../utils/flatten-options'; describe('Test content switcher', function() { diff --git a/tests/spec/data-table-v2_spec.js b/tests/spec/data-table-v2_spec.js index eff9918dd2f5..24ec347494bc 100644 --- a/tests/spec/data-table-v2_spec.js +++ b/tests/spec/data-table-v2_spec.js @@ -1,7 +1,7 @@ import EventManager from '../utils/event-manager'; import DataTableV2 from '../../src/components/data-table-v2/data-table-v2'; -import HTML from '../../src/components/data-table-v2/data-table-v2.html'; -import ExpandableHTML from '../../src/components/data-table-v2/data-table-v2-expandable.html'; +import HTML from '../../html/data-table-v2/data-table-v2.html'; +import ExpandableHTML from '../../html/data-table-v2/data-table-v2--expandable.html'; describe('Dropdown', function() { describe('Constructor', function() { diff --git a/tests/spec/data-table_spec.js b/tests/spec/data-table_spec.js index 4ec8a66bb1f4..30337c23ab50 100644 --- a/tests/spec/data-table_spec.js +++ b/tests/spec/data-table_spec.js @@ -1,6 +1,6 @@ import EventManager from '../utils/event-manager'; import ResponsiveTable from '../../src/components/data-table/data-table'; -import HTML from '../../src/components/data-table/data-table.html'; +import HTML from '../../html/data-table/data-table.html'; describe('Test responsive table', function() { describe('Constructor', function() { diff --git a/tests/spec/date-picker_spec.js b/tests/spec/date-picker_spec.js index ffce17f4d645..e74360d052e0 100644 --- a/tests/spec/date-picker_spec.js +++ b/tests/spec/date-picker_spec.js @@ -1,6 +1,6 @@ import DatePicker from '../../src/components/date-picker/date-picker'; -import singleCalHTML from '../../src/components/date-picker/date-picker--single.html'; -import rangeCalHTML from '../../src/components/date-picker/date-picker--range.html'; +import singleCalHTML from '../../html/date-picker/date-picker--single.html'; +import rangeCalHTML from '../../html/date-picker/date-picker--range.html'; describe('Test date picker', function() { describe('Constructor', function() { diff --git a/tests/spec/file-uploader_spec.js b/tests/spec/file-uploader_spec.js index 3d988af52641..2054d32da0b9 100644 --- a/tests/spec/file-uploader_spec.js +++ b/tests/spec/file-uploader_spec.js @@ -1,5 +1,5 @@ import FileUploader from '../../src/components/file-uploader/file-uploader'; -import HTML from '../../src/components/file-uploader/file-uploader.html'; +import HTML from '../../html/file-uploader/file-uploader.html'; import flattenOptions from '../utils/flatten-options'; describe('File Uploader', function() { diff --git a/tests/spec/floating-menu_spec.js b/tests/spec/floating-menu_spec.js index e51b3360bd6a..731db4b53cb2 100644 --- a/tests/spec/floating-menu_spec.js +++ b/tests/spec/floating-menu_spec.js @@ -1,6 +1,6 @@ import EventManager from '../utils/event-manager'; import FloatingMenu from '../../src/components/floating-menu/floating-menu'; -import HTML from '../../src/components/overflow-menu/overflow-menu.html'; // Use ul.bx--overflow-menu-options for testing +import HTML from '../../html/overflow-menu/overflow-menu.html'; // Use ul.bx--overflow-menu-options for testing describe('Test floating menu', function() { describe('Constructor', function() { diff --git a/tests/spec/interior-left-nav_spec.js b/tests/spec/interior-left-nav_spec.js index 9d7ee36ea2f9..79d39c186d12 100644 --- a/tests/spec/interior-left-nav_spec.js +++ b/tests/spec/interior-left-nav_spec.js @@ -1,6 +1,6 @@ import InteriorLeftNav from '../../src/components/interior-left-nav/interior-left-nav'; -import InteriorLeftNavHtml from '../../src/components/interior-left-nav/interior-left-nav.html'; -import KeepOpen from '../../src/components/interior-left-nav/interior-left-nav-keep-open.html'; +import InteriorLeftNavHtml from '../../html/interior-left-nav/interior-left-nav.html'; +import KeepOpen from '../../html/interior-left-nav/interior-left-nav--keep-open.html'; describe('Test interior left nav', function() { describe('Constructor', function() { diff --git a/tests/spec/lightbox_spec.js b/tests/spec/lightbox_spec.js index fff15ebd5987..be5e819f8e4c 100644 --- a/tests/spec/lightbox_spec.js +++ b/tests/spec/lightbox_spec.js @@ -1,5 +1,5 @@ import Lightbox from '../../src/components/lightbox/lightbox'; -import HTML from '../../src/components/lightbox/lightbox.html'; +import HTML from '../../html/lightbox/lightbox.html'; import flattenOptions from '../utils/flatten-options'; describe('Lightbox', () => { diff --git a/tests/spec/loading_spec.js b/tests/spec/loading_spec.js index 691215a21862..48f3a1a01450 100644 --- a/tests/spec/loading_spec.js +++ b/tests/spec/loading_spec.js @@ -1,5 +1,5 @@ import Loading from '../../src/components/loading/loading'; -import LoadingHTML from '../../src/components/loading/loading.html'; +import LoadingHTML from '../../html/loading/loading.html'; describe('Test Loading', function() { describe('Constructor', function() { diff --git a/tests/spec/modal_spec.js b/tests/spec/modal_spec.js index 29d507619fb3..cebb1cc21d8f 100644 --- a/tests/spec/modal_spec.js +++ b/tests/spec/modal_spec.js @@ -1,5 +1,5 @@ import Modal from '../../src/components/modal/modal'; -import ModalHtml from '../../src/components/modal/modal.html'; +import ModalHtml from '../../html/modal/modal.html'; import EventManager from '../utils/event-manager'; import flattenOptions from '../utils/flatten-options'; diff --git a/tests/spec/notification_spec.js b/tests/spec/notification_spec.js index 9b8954aed187..37bc721dd616 100644 --- a/tests/spec/notification_spec.js +++ b/tests/spec/notification_spec.js @@ -1,6 +1,6 @@ import EventManager from '../utils/event-manager'; import Notification from '../../src/components/notification/notification'; -import HTML from '../../src/components/notification/toast-notification.html'; +import HTML from '../../html/notification/toast-notification.html'; import flattenOptions from '../utils/flatten-options'; describe('ToastNotification', function() { diff --git a/tests/spec/number-input_spec.js b/tests/spec/number-input_spec.js index daab2bed30ff..adbd982f8e4f 100644 --- a/tests/spec/number-input_spec.js +++ b/tests/spec/number-input_spec.js @@ -1,7 +1,7 @@ import Promise from 'bluebird'; // For testing on browsers not supporting Promise import EventManager from '../utils/event-manager'; import NumberInput from '../../src/components/number-input/number-input'; -import HTML from '../../src/components/number-input/number-input.html'; +import HTML from '../../html/number-input/number-input.html'; import flattenOptions from '../utils/flatten-options'; describe('Test Number Input', function() { diff --git a/tests/spec/overflow-menu_spec.js b/tests/spec/overflow-menu_spec.js index b92923ecdcf3..8d37f7ec4fa5 100644 --- a/tests/spec/overflow-menu_spec.js +++ b/tests/spec/overflow-menu_spec.js @@ -1,6 +1,6 @@ import EventManager from '../utils/event-manager'; import OverflowMenu from '../../src/components/overflow-menu/overflow-menu'; -import HTML from '../../src/components/overflow-menu/overflow-menu.html'; +import HTML from '../../html/overflow-menu/overflow-menu.html'; describe('Test Overflow menu', function() { describe('Constructor', function() { diff --git a/tests/spec/profile-switcher_spec.js b/tests/spec/profile-switcher_spec.js index d509bfdace1d..c1d98d696a0b 100644 --- a/tests/spec/profile-switcher_spec.js +++ b/tests/spec/profile-switcher_spec.js @@ -1,5 +1,5 @@ import ProfileSwitcher from '../../src/components/unified-header/profile-switcher'; -import unifiedHeaderHtml from '../../src/components/unified-header/unified-header.html'; +import unifiedHeaderHtml from '../../html/unified-header/unified-header.html'; import flattenOptions from '../utils/flatten-options'; describe('Test profile switcher', function() { diff --git a/tests/spec/progress-indicator_spec.js b/tests/spec/progress-indicator_spec.js index 946f85874df6..1c3c67921141 100644 --- a/tests/spec/progress-indicator_spec.js +++ b/tests/spec/progress-indicator_spec.js @@ -1,6 +1,6 @@ import '../../demo/polyfills/custom-event'; import ProgressIndicator from '../../src/components/progress-indicator/progress-indicator'; -import HTML from '../../src/components/progress-indicator/progress-indicator.html'; +import HTML from '../../html/progress-indicator/progress-indicator.html'; import flattenOptions from '../utils/flatten-options'; describe('ProgressIndicator', function() { diff --git a/tests/spec/search_spec.js b/tests/spec/search_spec.js index d0d431f8ff26..6ee8479050db 100644 --- a/tests/spec/search_spec.js +++ b/tests/spec/search_spec.js @@ -1,5 +1,5 @@ import Search from '../../src/components/search/search'; -import searchHTML from '../../src/components/search/search-large.html'; +import searchHTML from '../../html/search/search--large.html'; import flattenOptions from '../utils/flatten-options'; describe('Test Search', function() { diff --git a/tests/spec/slider_spec.js b/tests/spec/slider_spec.js index f12cea8b77de..a336e800f9b2 100644 --- a/tests/spec/slider_spec.js +++ b/tests/spec/slider_spec.js @@ -1,6 +1,6 @@ import createMockRaf from 'mock-raf'; import Slider from '../../src/components/slider/slider'; -import SliderHTML from '../../src/components/slider/slider.html'; +import SliderHTML from '../../html/slider/slider.html'; import flattenOptions from '../utils/flatten-options'; describe('Test slider', function() { diff --git a/tests/spec/structured-list_spec.js b/tests/spec/structured-list_spec.js index cfbbf0358f98..fab10a4a7f2c 100644 --- a/tests/spec/structured-list_spec.js +++ b/tests/spec/structured-list_spec.js @@ -1,5 +1,5 @@ import StructuredList from '../../src/components/structured-list/structured-list'; -import HTML from '../../src/components/structured-list/structured-list--selection.html'; +import HTML from '../../html/structured-list/structured-list--selection.html'; import flattenOptions from '../utils/flatten-options'; describe('StructuredList', function() { diff --git a/tests/spec/tile_spec.js b/tests/spec/tile_spec.js index 5bcc4c8ad1af..2b58c461be42 100644 --- a/tests/spec/tile_spec.js +++ b/tests/spec/tile_spec.js @@ -1,7 +1,7 @@ import Tile from '../../src/components/tile/tile'; -import clickableTile from '../../src/components/tile/tile--clickable.html'; -import expandableTile from '../../src/components/tile/tile--expandable.html'; -import selectableTile from '../../src/components/tile/tile--selectable.html'; +import clickableTile from '../../html/tile/tile--clickable.html'; +import expandableTile from '../../html/tile/tile--expandable.html'; +import selectableTile from '../../html/tile/tile--selectable.html'; import flattenOptions from '../utils/flatten-options'; describe('Test tile', function() { diff --git a/tests/spec/toolbar_spec.js b/tests/spec/toolbar_spec.js index 4ccf108d45f7..4d97e55d24a1 100644 --- a/tests/spec/toolbar_spec.js +++ b/tests/spec/toolbar_spec.js @@ -1,6 +1,6 @@ import '../../demo/polyfills/custom-event'; import Toolbar from '../../src/components/toolbar/toolbar'; -import ToolbarHTML from '../../src/components/toolbar/toolbar.html'; +import ToolbarHTML from '../../html/toolbar/toolbar.html'; describe('Test toolbar', function() { describe('Constructor', function() { diff --git a/tests/spec/tooltip_spec.js b/tests/spec/tooltip_spec.js index 905db3bb7d6b..23685a7e915a 100644 --- a/tests/spec/tooltip_spec.js +++ b/tests/spec/tooltip_spec.js @@ -1,5 +1,5 @@ import Tooltip from '../../src/components/tooltip/tooltip'; -import HTML from '../../src/components/tooltip/tooltip.html'; +import HTML from '../../html/tooltip/tooltip.html'; describe('Test tooltip', function() { describe('Constructor', function() { diff --git a/tools/templates.js b/tools/templates.js new file mode 100644 index 000000000000..e2fd12421532 --- /dev/null +++ b/tools/templates.js @@ -0,0 +1,112 @@ +'use strict'; + +const globby = require('globby'); +const { promisify } = require('bluebird'); +const fs = require('fs'); +const path = require('path'); +const dust = require('dustjs-linkedin'); +const helpers = require('dustjs-helpers'); +const Fractal = require('@frctl/fractal'); + +const readFile = promisify(fs.readFile); +const render = promisify(dust.render); + +dust.config.whitespace = true; +Object.assign(dust.helpers, helpers); + +/** + * @param {string} glob A glob. + * @returns {Set} A set of file contents matching the given glob, keyed by the basename of the file. + */ +const getContents = glob => + globby(glob).then(filePaths => { + if (filePaths.length === 0) { + return undefined; + } + const contents = new Map(); + return Promise.all( + filePaths.map(filePath => + readFile(filePath, { encoding: 'utf8' }).then(content => { + contents.set(path.basename(filePath, '.dust'), content); + }) + ) + ).then(() => contents); + }); + +/** + * Loads Dust templates and compiles them. + * @param {string} glob A glob. + * @returns {Set} A set of file contents matching the given glob, keyed by the basename of the file. + */ +const loadContents = glob => + getContents(glob).then(contents => { + contents.forEach((content, templateName) => { + dust.loadSource(dust.compile(content, templateName)); + }); + return contents; + }); + +const fractal = Fractal.create(); +fractal.components.set('path', path.join(__dirname, '../src/components')); +fractal.components.set('ext', '.dust'); +fractal.docs.set('path', path.join(__dirname, '../docs')); + +const promiseCache = Promise.all([fractal.load(), loadContents(path.resolve(__dirname, '../{demo,src}/**/*.dust'))]).then( + ([sources, contents]) => { + const [componentSource, docSource] = sources; + return { + componentSource, + docSource, + contents, + }; + } +); + +/** + * @param {Object} [options] The options. + * @param {string} [options.preview] The preview Dust template name to force. Useful to force an empty preview. + * @param {string} [options.defauktPreview] The preview Dust template name working as the default one. + * @param {boolean} [options.concat] Setting `true` here returns rendered contents all concatenated, instead of returning a map. + * @param {string} [handle] + * The internal component name seen in Fractal. + * Can be of a component or of a variant, or left empty. + * Leaving `handle` empty renders all components. + * @returns {string|Map} The list of rendered template, keyed by Fractal `Variant` object. + */ +const renderComponent = ({ preview, defaultPreview, concat } = {}, handle) => + promiseCache.then(({ componentSource, contents }) => { + const promises = []; + const renderedItems = new Map(); + componentSource.forEach(metadata => { + const items = metadata.isCollection ? metadata : !metadata.isCollated && metadata.variants && metadata.variants(); + if (items) { + const filteredItems = !handle || handle === metadata.handle ? items : items.filter(item => handle === item.handle); + filteredItems.forEach(item => { + const { handle: itemHandle, baseHandle, context } = item; + const template = contents.has(itemHandle) ? itemHandle : baseHandle; + promises.push( + render(template, Object.assign({}, context, { preview: preview || item.preview || defaultPreview })).then( + rendered => { + renderedItems.set(item, rendered); + } + ) + ); + }); + } + }); + return Promise.all(promises).then(() => { + if (!concat) { + return renderedItems; + } + const accumulated = []; + renderedItems.forEach(rendered => { + accumulated.push(rendered); + }); + return accumulated.join('\n'); + }); + }); + +module.exports = { + promiseCache, + render: renderComponent, +};