From 65982fda4cab08c75359acfa39f52f3aa379c595 Mon Sep 17 00:00:00 2001 From: Christian Kienle Date: Mon, 1 Jul 2019 20:00:19 +0200 Subject: [PATCH] feat: new documentation, lots of small improvements --- .eslintrc.js | 4 +- .gitignore | 2 +- .vscode/settings.json | 24 - DEVELOPING.md | 6 + README.md | 42 +- SIZES.csv | 1 + babel.config.js | 27 +- bili-babel.config.js | 17 + bili.config.js | 8 + jest.config.js | 12 +- loaders/block-loader.js | 2 + loaders/remove-docs-loader.js | 2 + loaders/tsconfig.json | 32 + loaders/vuese-loader.js | 21 + netlify.toml | 2 +- package.json | 40 +- .../ContextButton/ContextButton.vue | 1 + src/components/Counter/Counter.vue | 1 + src/components/DatePicker/DatePicker.vue | 6 + src/components/Identifier/Identifier.vue | 2 +- src/components/Layout/App/App.vue | 15 - src/components/Layout/App/_app.vue | 14 + .../Layout/App/{AppMain.vue => app-main.vue} | 4 +- .../{AppNavigation.vue => app-navigation.vue} | 0 src/components/Layout/Shell/Shell.vue | 9 - src/components/Layout/Shell/_shell.vue | 16 + src/components/Layout/Shell/shell-app.vue | 12 + .../{ShellFooter.vue => shell-footer.vue} | 8 +- .../{ShellHeader.vue => shell-header.vue} | 6 +- src/components/Layout/index.js | 17 +- src/directives/click-out.js | 1 + src/directives/modal.js | 2 + src/docs/App.vue | 18 +- src/docs/DocumentationLoader/index.js | 54 - src/docs/_node/component-name.js | 100 + src/docs/_node/deslugify.js | 20 + src/docs/_node/get-example-collections.js | 25 - src/docs/_node/kebab-case.js | 9 + src/docs/_node/markdown-plugins/index.js | 17 + .../markdown-it-plugin-component-api-link.js | 21 + .../markdown-it-plugin-make-styleable.js | 39 + .../markdown-it-plugin-related-components.js | 30 + .../markdown-it-plugin-slot.js | 37 + .../markdown-it-plugin-tip.js | 30 + src/docs/_node/markdown/highlight.js | 73 + src/docs/_node/slugify.js | 2 + src/docs/_pages/example-collection-page.vue | 7 + .../component-api-repository.test.js | 9 - src/docs/component-api-repository/index.js | 39 - src/docs/components/ComponentExample.vue | 139 - src/docs/components/ExampleCollection.vue | 88 - src/docs/components/ExpandTransition.vue | 2 +- src/docs/components/FullscreenDemo.vue | 21 - src/docs/components/StaticContent.vue | 123 - src/docs/components/component-api-link.vue | 29 - src/docs/components/component-picker.vue | 82 - .../{CodeView.vue => d-code-view.vue} | 57 +- .../d-component-api-link-target.vue | 27 + src/docs/components/d-component-api-link.vue | 57 + src/docs/components/d-component-api.vue | 138 +- src/docs/components/d-component-picker.vue | 88 + src/docs/components/d-example-collection.vue | 57 + src/docs/components/d-example-fullscreen.vue | 28 + src/docs/components/d-example/_d-example.scss | 4 + .../components/d-example/d-example-footer.vue | 82 + src/docs/components/d-example/d-example.vue | 108 + .../components/d-example/d-toolbar-item.vue | 13 + src/docs/components/d-md-provide-content.js | 21 + src/docs/components/d-md-slot.vue | 39 + .../d-playground-button/_package.json | 40 + .../d-playground-button.vue | 96 + .../d-related-components-section.vue | 17 + src/docs/components/d-related-components.vue | 53 + src/docs/components/{Tip.vue => d-tip.vue} | 19 +- src/docs/components/doc/component-doc.vue | 88 - src/docs/components/index.js | 46 +- src/docs/content/en_us/action-bar.md | 16 + src/docs/content/en_us/alert.md | 35 + src/docs/content/en_us/badge.md | 10 + src/docs/content/en_us/breadcrumb.md | 12 + src/docs/content/en_us/button.md | 104 + src/docs/content/en_us/calendar.md | 105 + src/docs/content/en_us/colors.md | 8 + src/docs/content/en_us/combobox.md | 34 + src/docs/content/en_us/container.md | 30 + src/docs/content/en_us/context-menu.md | 19 + src/docs/content/en_us/counter.md | 16 + src/docs/content/en_us/date-input.md | 23 + src/docs/content/en_us/date-picker.md | 45 + .../content/en_us/design-system-utilities.md | 47 + src/docs/content/en_us/directives.md | 12 + src/docs/content/en_us/dropdown.md | 26 + src/docs/content/en_us/form.md | 74 + src/docs/content/en_us/icon.md | 16 + src/docs/content/en_us/identifier.md | 40 + src/docs/content/en_us/image.md | 9 + src/docs/content/en_us/index.js | 109 + src/docs/content/en_us/inline-help.md | 9 + src/docs/content/en_us/input-group.md | 37 + src/docs/content/en_us/label.md | 9 + src/docs/content/en_us/link.md | 26 + src/docs/content/en_us/list-group.md | 19 + src/docs/content/en_us/menu-popover.md | 23 + src/docs/content/en_us/menu.md | 86 + src/docs/content/en_us/modal.md | 37 + src/docs/content/en_us/pagination.md | 9 + src/docs/content/en_us/panel.md | 39 + .../en_us/popover.md} | 55 +- src/docs/content/en_us/search-input.md | 38 + src/docs/content/en_us/section.md | 28 + src/docs/content/en_us/shell-bar.md | 54 + src/docs/content/en_us/shell.md | 12 + src/docs/content/en_us/side-navigation.md | 41 + src/docs/content/en_us/spinner.md | 10 + src/docs/content/en_us/status.md | 22 + src/docs/content/en_us/table.md | 168 + src/docs/content/en_us/tabs.md | 10 + src/docs/content/en_us/tile-grid.md | 34 + src/docs/content/en_us/tile.md | 36 + src/docs/content/en_us/time-picker.md | 32 + src/docs/content/en_us/toggle.md | 33 + src/docs/content/en_us/token.md | 9 + src/docs/content/en_us/virtualized-list.md | 87 + .../content/examples/action-bar/0-full.vue | 7 + .../examples/action-bar}/1-title-slot.vue | 4 +- .../examples/alert/default.vue} | 5 +- src/docs/content/examples/alert/error.vue | 11 + .../content/examples/alert/information.vue | 13 + src/docs/content/examples/alert/success.vue | 11 + src/docs/content/examples/alert/vmodel.vue | 22 + src/docs/content/examples/alert/warning.vue | 13 + .../examples/badge}/default.vue | 1 - .../examples/breadcrumb}/default.vue | 4 +- .../examples/button/groups-compact.vue | 30 + src/docs/content/examples/button/groups.vue | 29 + .../examples/button/icons.vue} | 2 - .../examples/button/sizes.vue} | 3 - .../button/split-button-playground.vue} | 11 - .../examples/button/split-button-popover.vue} | 4 - .../examples/button/states.vue} | 2 - .../examples/button/styling.vue} | 2 - .../examples/calendar/bindings.vue} | 4 - .../examples/calendar/blocked-items.vue} | 2 - .../content/examples/calendar/buttons.vue | 30 + .../examples/calendar/custom-names.vue} | 6 - .../examples/calendar/default-date.vue | 5 + .../content/examples/calendar/default.vue | 5 + .../examples/calendar/disabled-items.vue} | 2 - .../examples/calendar/first-day-of-week.vue | 5 + .../content/examples/calendar/no-header.vue | 5 + .../examples/calendar/popover.vue} | 10 +- .../examples/calendar/selection-range.vue | 5 + .../examples/colors}/all.vue | 2 - .../examples/combobox/custom-menu.vue} | 5 - .../content/examples/combobox/default.vue | 21 + src/docs/content/examples/combobox/sizes.vue | 33 + .../container/0-container-default.vue | 3 + .../examples/container/1-container-fluid.vue | 3 + .../container}/2-container-centered.vue | 1 - .../3-container-fluid-with-cols.vue | 1 - .../context-menu-custom-button.vue} | 6 - .../context-menu/context-menu-default.vue} | 2 - .../examples/counter/default.vue} | 1 - .../examples/counter/notification-center.vue | 5 + .../date-input/date-input-default.vue | 11 + .../examples/date-input/date-input-range.vue} | 2 - .../date-input/date-input-vmodel.vue} | 2 - .../date-picker/date-picker-custom.vue} | 10 - .../date-picker/date-picker-default.vue | 28 + .../design-system-utilities/font-family.vue} | 2 - .../design-system-utilities/font-type.vue} | 2 - .../design-system-utilities/font-weight.vue} | 2 - .../design-system-utilities/margin.vue} | 6 +- .../design-system-utilities/padding.vue} | 7 +- .../remove-padding.vue} | 7 +- .../examples/directives/icon.vue} | 13 +- .../examples/dropdown/default-dropdown.vue} | 1 - .../examples/dropdown/disabled-dropdown.vue} | 1 - .../examples/dropdown/icon-dropdown.vue} | 1 - .../examples/dropdown/toolbar-dropdown.vue} | 1 - .../examples/form/binding.vue} | 11 +- .../examples/form/checkbox.vue} | 7 - .../examples/form/mixing-model.vue} | 10 +- .../examples/form/radio.vue} | 1 - .../examples/form/select-model.vue} | 4 +- .../examples/form/select.vue} | 2 - src/docs/content/examples/form/states.vue | 37 + src/docs/content/examples/icon/all-icons.vue | 650 +++ .../Icon => content/examples/icon}/icon.vue | 2 - .../examples/identifier/accent.vue} | 2 - .../examples/identifier/sizes.vue} | 16 - .../examples/identifier/types.vue} | 7 - .../examples/image/image.vue} | 2 - src/docs/content/examples/index.js | 65 + .../examples/inline-help}/default.vue | 2 - .../input-group/input-group-compact.vue} | 1 - .../input-group/input-group-search.vue} | 8 - .../input-group-slot-addon-button.vue} | 2 - .../input-group-slot-addon-icon.vue} | 2 - .../input-group-slot-addon-text.vue | 21 + src/docs/content/examples/label/default.vue | 8 + src/docs/content/examples/link/default.vue | 36 + .../examples/list-group/action.vue} | 11 +- .../examples/list-group/checkboxes.vue} | 2 - .../examples/list-group/simple.vue} | 3 - .../menu-popover/default-menu-popover.vue} | 4 - .../menu-popover/menu-popover-placement.vue} | 4 - src/docs/content/examples/menu/menu-addon.vue | 13 + src/docs/content/examples/menu/menu-group.vue | 24 + .../examples/menu/menu-selection.vue} | 12 - .../content/examples/menu/menu-separated.vue | 10 + src/docs/content/examples/menu/menu.vue | 26 + .../content/examples/menu/menuitem-link.vue | 14 + .../examples/modal/0-default-modal.vue | 25 + .../content/examples/modal/default-modal.vue | 25 + .../examples/modal/nested-modals.vue} | 6 +- .../content/examples/pagination/default.vue | 24 + src/docs/content/examples/panel/cols-2.vue | 8 + src/docs/content/examples/panel/cols-4.vue | 12 + src/docs/content/examples/panel/cols-5.vue | 14 + src/docs/content/examples/panel/cols-6.vue | 16 + .../content/examples/panel/default-grid.vue | 9 + src/docs/content/examples/panel/nogap.vue | 9 + src/docs/content/examples/panel/span.vue | 19 + .../examples/panel/structure.vue} | 6 +- .../examples/popover/custom-content.vue | 15 + .../examples/popover/custom-controls.vue | 16 + .../examples/popover/default-popover.vue | 16 + .../examples/popover/placement-options.vue | 149 + .../examples/search-input/completions.vue | 27 + .../examples/search-input/confirm-on-tab.vue} | 6 - .../examples/search-input/default.vue} | 2 - src/docs/content/examples/section/grid.vue | 11 + src/docs/content/examples/section/header.vue | 5 + src/docs/content/examples/section/panels.vue | 20 + .../content/examples/section/structure.vue | 7 + .../content/examples/shell-bar/actions.vue | 54 + .../content/examples/shell-bar/minimal.vue | 53 + .../content/examples/shell-bar/products.vue | 168 + src/docs/content/examples/shell/default.vue | 21 + .../data-driven-complex-sync.vue} | 4 - .../examples/side-navigation/dynamic.vue} | 15 - src/docs/content/examples/spinner/default.vue | 5 + src/docs/content/examples/status/default.vue | 8 + .../examples/status/status-custom-icon.vue | 8 + .../content/examples/status/status-icon.vue | 8 + .../examples/table/complex.vue} | 42 +- src/docs/content/examples/table/default.vue | 36 + .../examples/table/dynamic-columns.vue} | 0 .../examples/table/fixed-col.vue} | 9 - .../examples/table/no-border.vue} | 6 - .../examples/table/performance-test.vue} | 12 +- .../examples/table/select-by-row-click.vue | 2 - .../examples/table/selection-modes.vue} | 11 - .../examples/table/stripes.vue} | 5 - .../examples/table/with-components.vue} | 9 - .../examples/tabs/default.vue} | 22 +- .../tile-grid/tile-grid--col-2-with-tile.vue} | 2 - .../tile-grid/tile-grid--col-3-with-tile.vue} | 2 - .../tile-grid/tile-grid--col-4-with-tile.vue} | 2 - .../tile-grid/tile-grid--col-5-with-tile.vue} | 0 .../tile-grid/tile-grid--col-6-with-tile.vue} | 0 .../tile-grid--col-and-prod-tile.vue} | 2 - .../tile-grid/tile-grid--span-helpers.vue} | 2 - .../examples/tile/actions.vue} | 2 - .../examples/tile/button.vue} | 6 - .../examples/tile/media.vue} | 2 - .../examples/tile/product-tile-button.vue} | 2 - .../examples/tile/product-tile-default.vue} | 2 - .../examples/tile/tile-default.vue} | 2 - .../examples/time-picker/default.vue} | 9 +- .../examples/time-picker/multiple-times.vue} | 8 +- .../content/examples/time-picker/time.vue | 16 + .../examples/toggle/default.vue} | 5 - .../examples/toggle/sizes.vue} | 41 +- .../examples/toggle/v-model.vue} | 9 +- src/docs/content/examples/token/default.vue | 18 + .../virtualized-list-default.vue | 40 + .../virtualized-list-filter.vue} | 2 - .../virtualized-list-initial-load.vue} | 2 - .../virtualized-list-loading-more.vue | 45 + .../virtualized-list-mutate.vue} | 8 - .../virtualized-list-reset.vue} | 2 - .../documented-component.js | 23 + src/docs/get-documented-components/index.js | 31 + .../get-documented-components/vue-plugin.js | 30 + src/docs/index.js | 73 +- ...DefaultLayout.vue => d-default-layout.vue} | 9 +- ...reenLayout.vue => d-fullscreen-layout.vue} | 0 src/docs/layouts/default/ShellBar.vue | 39 +- src/docs/layouts/default/SideNav.vue | 10 +- src/docs/layouts/index.js | 11 + src/docs/main.scss | 6 +- src/docs/pages/Action Bar/0-full.vue | 9 - src/docs/pages/Action Bar/index.js | 3 - src/docs/pages/Alert/1-warning.vue | 13 - src/docs/pages/Alert/2-error.vue | 12 - src/docs/pages/Alert/3-information.vue | 12 - src/docs/pages/Alert/4-success.vue | 13 - src/docs/pages/Alert/5-vmodel.vue | 24 - src/docs/pages/Alert/index.js | 3 - src/docs/pages/Badge/index.js | 3 - src/docs/pages/Breadcrumb/index.js | 3 - src/docs/pages/Button/4-groups.vue | 65 - src/docs/pages/Button/5-groups-compact.vue | 33 - src/docs/pages/Button/index.js | 3 - src/docs/pages/Calendar/0-default.vue | 15 - src/docs/pages/Calendar/1-selection-range.vue | 7 - src/docs/pages/Calendar/10-no-header.vue | 11 - src/docs/pages/Calendar/7-buttons.vue | 33 - .../pages/Calendar/8-first-day-of-week.vue | 14 - src/docs/pages/Calendar/9-default-date.vue | 14 - src/docs/pages/Calendar/index.js | 3 - src/docs/pages/Colors/index.js | 3 - src/docs/pages/Combobox/0-default.vue | 41 - src/docs/pages/Combobox/1-sizes.vue | 35 - src/docs/pages/Combobox/index.js | 3 - .../pages/Container/0-container-default.vue | 8 - .../1-container-fluid-default copy.vue | 9 - src/docs/pages/Container/index.js | 3 - src/docs/pages/Context Menu/index.js | 3 - .../pages/Counter/2-NotificationCounter.vue | 9 - src/docs/pages/Counter/index.js | 3 - .../pages/Date Input/0-date-input-default.vue | 15 - src/docs/pages/Date Input/index.js | 3 - .../Date Picker/0-date-picker-default.vue | 52 - src/docs/pages/Date Picker/index.js | 3 - src/docs/pages/Design System Utils/index.js | 3 - src/docs/pages/Directives/index.js | 3 - src/docs/pages/Dropdown/index.js | 3 - src/docs/pages/Form/3-states.vue | 39 - src/docs/pages/Form/index.js | 15 - src/docs/pages/Icon/index.js | 3 - src/docs/pages/Identifier/index.js | 3 - src/docs/pages/Image/index.js | 3 - src/docs/pages/Inline Help/index.js | 3 - src/docs/pages/Input Group/index.js | 3 - src/docs/pages/Label/default.vue | 9 - src/docs/pages/Label/index.js | 3 - src/docs/pages/Link/default.vue | 52 - src/docs/pages/Link/index.js | 3 - src/docs/pages/List Group/index.js | 3 - src/docs/pages/Menu Popover/index.js | 3 - src/docs/pages/Menu/1-menu.vue | 37 - src/docs/pages/Menu/2-menuitem-link.vue | 34 - src/docs/pages/Menu/3-menu-group.vue | 27 - src/docs/pages/Menu/4-menu-addon.vue | 16 - src/docs/pages/Menu/5-menu-separated.vue | 15 - src/docs/pages/Menu/index.js | 3 - src/docs/pages/Modal/0-default-modal.vue | 43 - src/docs/pages/Modal/index.js | 3 - src/docs/pages/Pagination/Example.vue | 17 - src/docs/pages/Pagination/index.js | 3 - src/docs/pages/Panel/1-default-grid.vue | 11 - src/docs/pages/Panel/2-nogap.vue | 11 - src/docs/pages/Panel/5-cols-2-.vue | 10 - src/docs/pages/Panel/5-cols-4.vue | 14 - src/docs/pages/Panel/5-cols-5.vue | 16 - src/docs/pages/Panel/5-cols-6.vue | 18 - src/docs/pages/Panel/index.js | 3 - src/docs/pages/Panel/span.vue | 21 - .../pages/Popover/1-placement-options.vue | 152 - src/docs/pages/Popover/3-custom-content.vue | 16 - src/docs/pages/Popover/4-custom-controls.vue | 18 - src/docs/pages/Popover/index.js | 3 - .../Search Input/2-Search-Completions.vue | 37 - src/docs/pages/Search Input/index.js | 3 - src/docs/pages/Section/0-structure.vue | 9 - src/docs/pages/Section/1-header.vue | 7 - src/docs/pages/Section/2-panels.vue | 22 - src/docs/pages/Section/3-grid.vue | 13 - src/docs/pages/Section/index.js | 3 - src/docs/pages/Shell Bar/0-minimal.vue | 56 - src/docs/pages/Shell Bar/1-actions.vue | 57 - src/docs/pages/Shell Bar/3-products.vue | 171 - src/docs/pages/Shell Bar/index.js | 18 - src/docs/pages/Shell/default.vue | 81 - src/docs/pages/Shell/index.js | 3 - src/docs/pages/Side Navigation/index.js | 14 - src/docs/pages/Spinner/Example.vue | 5 - src/docs/pages/Spinner/index.js | 3 - src/docs/pages/Status/1-statusIcon.vue | 9 - src/docs/pages/Status/2-anyIcon.vue | 10 - src/docs/pages/Status/3-default.vue | 10 - src/docs/pages/Status/index.js | 3 - src/docs/pages/Table/.vscode/settings.json | 3 - src/docs/pages/Table/0-table-default.vue | 92 - src/docs/pages/Table/index.js | 3 - src/docs/pages/Tabs/index.js | 3 - src/docs/pages/Tile Grid/index.js | 3 - src/docs/pages/Tile/index.js | 3 - src/docs/pages/Time Picker/1-Time.vue | 23 - src/docs/pages/Time Picker/3-TimeItem.vue | 33 - src/docs/pages/Time Picker/index.js | 3 - src/docs/pages/Toggle/index.js | 3 - src/docs/pages/Token/Example.vue | 20 - src/docs/pages/Token/index.js | 3 - .../Virtualized List/0-VirtualizedList.vue | 52 - .../1-VirtualizedList-Loading-More.vue | 83 - src/docs/pages/Virtualized List/index.js | 3 - src/docs/pages/index.js | 86 - src/docs/router/component-api-route.js | 14 + src/docs/router/create.js | 73 +- src/docs/router/resolve-example.js | 20 + .../NEW_COMPONENT/NEW_COMPONENT.md | 27 +- src/docs/static-pages/start.md | 128 - src/docs/styles/_markdown-vars.scss | 2 + src/docs/styles/markdown.scss | 56 + .../util/__tests__/component-name.test.js | 38 + src/docs/util/component-name.js | 89 + src/docs/util/kebab-case.js | 7 + src/lib/__mocks__/uuid.js | 2 + src/tools/index.js | 161 - src/tools/parse-result-from-sfc.js | 50 + tests/e2e/.eslintrc.js | 2 + tests/e2e/plugins/index.js | 2 + tsconfig.json | 2 + vue-config/vue-spa.config.js | 174 +- vue.config.js | 152 +- yarn.lock | 3822 ++++++++++++++--- 420 files changed, 9357 insertions(+), 4599 deletions(-) delete mode 100644 .vscode/settings.json create mode 100644 DEVELOPING.md create mode 100644 bili-babel.config.js create mode 100644 loaders/tsconfig.json create mode 100644 loaders/vuese-loader.js delete mode 100644 src/components/Layout/App/App.vue create mode 100644 src/components/Layout/App/_app.vue rename src/components/Layout/App/{AppMain.vue => app-main.vue} (61%) rename src/components/Layout/App/{AppNavigation.vue => app-navigation.vue} (100%) delete mode 100644 src/components/Layout/Shell/Shell.vue create mode 100644 src/components/Layout/Shell/_shell.vue create mode 100644 src/components/Layout/Shell/shell-app.vue rename src/components/Layout/Shell/{ShellFooter.vue => shell-footer.vue} (57%) rename src/components/Layout/Shell/{ShellHeader.vue => shell-header.vue} (63%) delete mode 100644 src/docs/DocumentationLoader/index.js create mode 100644 src/docs/_node/component-name.js create mode 100644 src/docs/_node/deslugify.js delete mode 100644 src/docs/_node/get-example-collections.js create mode 100644 src/docs/_node/kebab-case.js create mode 100644 src/docs/_node/markdown-plugins/index.js create mode 100644 src/docs/_node/markdown-plugins/markdown-it-plugin-component-api-link.js create mode 100644 src/docs/_node/markdown-plugins/markdown-it-plugin-make-styleable.js create mode 100644 src/docs/_node/markdown-plugins/markdown-it-plugin-related-components.js create mode 100644 src/docs/_node/markdown-plugins/markdown-it-plugin-slot.js create mode 100644 src/docs/_node/markdown-plugins/markdown-it-plugin-tip.js create mode 100644 src/docs/_node/markdown/highlight.js create mode 100644 src/docs/_pages/example-collection-page.vue delete mode 100644 src/docs/component-api-repository/__tests__/component-api-repository.test.js delete mode 100644 src/docs/component-api-repository/index.js delete mode 100644 src/docs/components/ComponentExample.vue delete mode 100644 src/docs/components/ExampleCollection.vue delete mode 100644 src/docs/components/FullscreenDemo.vue delete mode 100644 src/docs/components/StaticContent.vue delete mode 100644 src/docs/components/component-api-link.vue delete mode 100644 src/docs/components/component-picker.vue rename src/docs/components/{CodeView.vue => d-code-view.vue} (80%) create mode 100644 src/docs/components/d-component-api-link-target.vue create mode 100644 src/docs/components/d-component-api-link.vue create mode 100644 src/docs/components/d-component-picker.vue create mode 100644 src/docs/components/d-example-collection.vue create mode 100644 src/docs/components/d-example-fullscreen.vue create mode 100644 src/docs/components/d-example/_d-example.scss create mode 100644 src/docs/components/d-example/d-example-footer.vue create mode 100644 src/docs/components/d-example/d-example.vue create mode 100644 src/docs/components/d-example/d-toolbar-item.vue create mode 100644 src/docs/components/d-md-provide-content.js create mode 100644 src/docs/components/d-md-slot.vue create mode 100644 src/docs/components/d-playground-button/_package.json create mode 100644 src/docs/components/d-playground-button/d-playground-button.vue create mode 100644 src/docs/components/d-related-components-section.vue create mode 100644 src/docs/components/d-related-components.vue rename src/docs/components/{Tip.vue => d-tip.vue} (63%) delete mode 100644 src/docs/components/doc/component-doc.vue create mode 100644 src/docs/content/en_us/action-bar.md create mode 100644 src/docs/content/en_us/alert.md create mode 100644 src/docs/content/en_us/badge.md create mode 100644 src/docs/content/en_us/breadcrumb.md create mode 100644 src/docs/content/en_us/button.md create mode 100644 src/docs/content/en_us/calendar.md create mode 100644 src/docs/content/en_us/colors.md create mode 100644 src/docs/content/en_us/combobox.md create mode 100644 src/docs/content/en_us/container.md create mode 100644 src/docs/content/en_us/context-menu.md create mode 100644 src/docs/content/en_us/counter.md create mode 100644 src/docs/content/en_us/date-input.md create mode 100644 src/docs/content/en_us/date-picker.md create mode 100644 src/docs/content/en_us/design-system-utilities.md create mode 100644 src/docs/content/en_us/directives.md create mode 100644 src/docs/content/en_us/dropdown.md create mode 100644 src/docs/content/en_us/form.md create mode 100644 src/docs/content/en_us/icon.md create mode 100644 src/docs/content/en_us/identifier.md create mode 100644 src/docs/content/en_us/image.md create mode 100644 src/docs/content/en_us/index.js create mode 100644 src/docs/content/en_us/inline-help.md create mode 100644 src/docs/content/en_us/input-group.md create mode 100644 src/docs/content/en_us/label.md create mode 100644 src/docs/content/en_us/link.md create mode 100644 src/docs/content/en_us/list-group.md create mode 100644 src/docs/content/en_us/menu-popover.md create mode 100644 src/docs/content/en_us/menu.md create mode 100644 src/docs/content/en_us/modal.md create mode 100644 src/docs/content/en_us/pagination.md create mode 100644 src/docs/content/en_us/panel.md rename src/docs/{pages/Popover/0-default-popover.vue => content/en_us/popover.md} (65%) create mode 100644 src/docs/content/en_us/search-input.md create mode 100644 src/docs/content/en_us/section.md create mode 100644 src/docs/content/en_us/shell-bar.md create mode 100644 src/docs/content/en_us/shell.md create mode 100644 src/docs/content/en_us/side-navigation.md create mode 100644 src/docs/content/en_us/spinner.md create mode 100644 src/docs/content/en_us/status.md create mode 100644 src/docs/content/en_us/table.md create mode 100644 src/docs/content/en_us/tabs.md create mode 100644 src/docs/content/en_us/tile-grid.md create mode 100644 src/docs/content/en_us/tile.md create mode 100644 src/docs/content/en_us/time-picker.md create mode 100644 src/docs/content/en_us/toggle.md create mode 100644 src/docs/content/en_us/token.md create mode 100644 src/docs/content/en_us/virtualized-list.md create mode 100644 src/docs/content/examples/action-bar/0-full.vue rename src/docs/{pages/Action Bar => content/examples/action-bar}/1-title-slot.vue (77%) rename src/docs/{pages/Alert/0-default.vue => content/examples/alert/default.vue} (58%) create mode 100644 src/docs/content/examples/alert/error.vue create mode 100644 src/docs/content/examples/alert/information.vue create mode 100644 src/docs/content/examples/alert/success.vue create mode 100644 src/docs/content/examples/alert/vmodel.vue create mode 100644 src/docs/content/examples/alert/warning.vue rename src/docs/{pages/Badge => content/examples/badge}/default.vue (97%) rename src/docs/{pages/Breadcrumb => content/examples/breadcrumb}/default.vue (79%) create mode 100644 src/docs/content/examples/button/groups-compact.vue create mode 100644 src/docs/content/examples/button/groups.vue rename src/docs/{pages/Button/1-icons.vue => content/examples/button/icons.vue} (96%) rename src/docs/{pages/Button/2-sizes.vue => content/examples/button/sizes.vue} (65%) rename src/docs/{pages/Button/2.1-split-button.vue => content/examples/button/split-button-playground.vue} (80%) rename src/docs/{pages/Button/2.2-split-button-popover.vue => content/examples/button/split-button-popover.vue} (82%) rename src/docs/{pages/Button/3-states.vue => content/examples/button/states.vue} (98%) rename src/docs/{pages/Button/0-styling.vue => content/examples/button/styling.vue} (91%) rename src/docs/{pages/Calendar/4-bindings.vue => content/examples/calendar/bindings.vue} (74%) rename src/docs/{pages/Calendar/2-blocked-items.vue => content/examples/calendar/blocked-items.vue} (84%) create mode 100644 src/docs/content/examples/calendar/buttons.vue rename src/docs/{pages/Calendar/6-custom-names.vue => content/examples/calendar/custom-names.vue} (54%) create mode 100644 src/docs/content/examples/calendar/default-date.vue create mode 100644 src/docs/content/examples/calendar/default.vue rename src/docs/{pages/Calendar/3-disabled-items.vue => content/examples/calendar/disabled-items.vue} (84%) create mode 100644 src/docs/content/examples/calendar/first-day-of-week.vue create mode 100644 src/docs/content/examples/calendar/no-header.vue rename src/docs/{pages/Calendar/5-popover.vue => content/examples/calendar/popover.vue} (51%) create mode 100644 src/docs/content/examples/calendar/selection-range.vue rename src/docs/{pages/Colors => content/examples/colors}/all.vue (99%) rename src/docs/{pages/Combobox/3-custom-menu.vue => content/examples/combobox/custom-menu.vue} (68%) create mode 100644 src/docs/content/examples/combobox/default.vue create mode 100644 src/docs/content/examples/combobox/sizes.vue create mode 100644 src/docs/content/examples/container/0-container-default.vue create mode 100644 src/docs/content/examples/container/1-container-fluid.vue rename src/docs/{pages/Container => content/examples/container}/2-container-centered.vue (78%) rename src/docs/{pages/Container => content/examples/container}/3-container-fluid-with-cols.vue (95%) rename src/docs/{pages/Context Menu/1-context-menu-custom-button.vue => content/examples/context-menu/context-menu-custom-button.vue} (78%) rename src/docs/{pages/Context Menu/0-context-menu-default.vue => content/examples/context-menu/context-menu-default.vue} (89%) rename src/docs/{pages/Counter/1-DefaultCounter.vue => content/examples/counter/default.vue} (80%) create mode 100644 src/docs/content/examples/counter/notification-center.vue create mode 100644 src/docs/content/examples/date-input/date-input-default.vue rename src/docs/{pages/Date Input/1-date-input-range.vue => content/examples/date-input/date-input-range.vue} (87%) rename src/docs/{pages/Date Input/3-date-input-vmodel.vue => content/examples/date-input/date-input-vmodel.vue} (92%) rename src/docs/{pages/Date Picker/1-date-picker-custom.vue => content/examples/date-picker/date-picker-custom.vue} (68%) create mode 100644 src/docs/content/examples/date-picker/date-picker-default.vue rename src/docs/{pages/Design System Utils/5-font-family.vue => content/examples/design-system-utilities/font-family.vue} (87%) rename src/docs/{pages/Design System Utils/6-font-type.vue => content/examples/design-system-utilities/font-type.vue} (95%) rename src/docs/{pages/Design System Utils/4-font-weight.vue => content/examples/design-system-utilities/font-weight.vue} (89%) rename src/docs/{pages/Design System Utils/0-margin.vue => content/examples/design-system-utilities/margin.vue} (58%) rename src/docs/{pages/Design System Utils/1-padding.vue => content/examples/design-system-utilities/padding.vue} (58%) rename src/docs/{pages/Design System Utils/2-remove-padding.vue => content/examples/design-system-utilities/remove-padding.vue} (68%) rename src/docs/{pages/Directives/0-icon.vue => content/examples/directives/icon.vue} (81%) rename src/docs/{pages/Dropdown/0-default-dropdown.vue => content/examples/dropdown/default-dropdown.vue} (95%) rename src/docs/{pages/Dropdown/3-disabled-dropdown.vue => content/examples/dropdown/disabled-dropdown.vue} (95%) rename src/docs/{pages/Dropdown/2-icon-dropdown.vue => content/examples/dropdown/icon-dropdown.vue} (95%) rename src/docs/{pages/Dropdown/1-toolbar-dropdown.vue => content/examples/dropdown/toolbar-dropdown.vue} (95%) rename src/docs/{pages/Form/1-binding.vue => content/examples/form/binding.vue} (60%) rename src/docs/{pages/Form/4-checkbox.vue => content/examples/form/checkbox.vue} (75%) rename src/docs/{pages/Form/8-mixing-model.vue => content/examples/form/mixing-model.vue} (86%) rename src/docs/{pages/Form/5-radio.vue => content/examples/form/radio.vue} (96%) rename src/docs/{pages/Form/7-select-model.vue => content/examples/form/select-model.vue} (80%) rename src/docs/{pages/Form/6-select.vue => content/examples/form/select.vue} (97%) create mode 100644 src/docs/content/examples/form/states.vue create mode 100644 src/docs/content/examples/icon/all-icons.vue rename src/docs/{pages/Icon => content/examples/icon}/icon.vue (84%) rename src/docs/{pages/Identifier/1-accent.vue => content/examples/identifier/accent.vue} (96%) rename src/docs/{pages/Identifier/2-sizes.vue => content/examples/identifier/sizes.vue} (91%) rename src/docs/{pages/Identifier/0-types.vue => content/examples/identifier/types.vue} (66%) rename src/docs/{pages/Image/Example.vue => content/examples/image/image.vue} (95%) create mode 100644 src/docs/content/examples/index.js rename src/docs/{pages/Inline Help => content/examples/inline-help}/default.vue (97%) rename src/docs/{pages/Input Group/5-input-group-compact.vue => content/examples/input-group/input-group-compact.vue} (93%) rename src/docs/{pages/Input Group/3-input-group-search.vue => content/examples/input-group/input-group-search.vue} (56%) rename src/docs/{pages/Input Group/1-3-input-group-slot-addon-button.vue => content/examples/input-group/input-group-slot-addon-button.vue} (98%) rename src/docs/{pages/Input Group/1-1-input-group-slot-addon-icon.vue => content/examples/input-group/input-group-slot-addon-icon.vue} (95%) create mode 100644 src/docs/content/examples/input-group/input-group-slot-addon-text.vue create mode 100644 src/docs/content/examples/label/default.vue create mode 100644 src/docs/content/examples/link/default.vue rename src/docs/{pages/List Group/1-action.vue => content/examples/list-group/action.vue} (65%) rename src/docs/{pages/List Group/2-checkboxes.vue => content/examples/list-group/checkboxes.vue} (95%) rename src/docs/{pages/List Group/0-simple.vue => content/examples/list-group/simple.vue} (92%) rename src/docs/{pages/Menu Popover/0-default-menu-popover.vue => content/examples/menu-popover/default-menu-popover.vue} (84%) rename src/docs/{pages/Menu Popover/1-menu-popover-placement.vue => content/examples/menu-popover/menu-popover-placement.vue} (60%) create mode 100644 src/docs/content/examples/menu/menu-addon.vue create mode 100644 src/docs/content/examples/menu/menu-group.vue rename src/docs/{pages/Menu/6-menu-selection.vue => content/examples/menu/menu-selection.vue} (62%) create mode 100644 src/docs/content/examples/menu/menu-separated.vue create mode 100644 src/docs/content/examples/menu/menu.vue create mode 100644 src/docs/content/examples/menu/menuitem-link.vue create mode 100644 src/docs/content/examples/modal/0-default-modal.vue create mode 100644 src/docs/content/examples/modal/default-modal.vue rename src/docs/{pages/Modal/1-nested-modals.vue => content/examples/modal/nested-modals.vue} (84%) create mode 100644 src/docs/content/examples/pagination/default.vue create mode 100644 src/docs/content/examples/panel/cols-2.vue create mode 100644 src/docs/content/examples/panel/cols-4.vue create mode 100644 src/docs/content/examples/panel/cols-5.vue create mode 100644 src/docs/content/examples/panel/cols-6.vue create mode 100644 src/docs/content/examples/panel/default-grid.vue create mode 100644 src/docs/content/examples/panel/nogap.vue create mode 100644 src/docs/content/examples/panel/span.vue rename src/docs/{pages/Panel/0-structure.vue => content/examples/panel/structure.vue} (58%) create mode 100644 src/docs/content/examples/popover/custom-content.vue create mode 100644 src/docs/content/examples/popover/custom-controls.vue create mode 100644 src/docs/content/examples/popover/default-popover.vue create mode 100644 src/docs/content/examples/popover/placement-options.vue create mode 100644 src/docs/content/examples/search-input/completions.vue rename src/docs/{pages/Search Input/3-Search-Completions-Confirm-on-tab.vue => content/examples/search-input/confirm-on-tab.vue} (65%) rename src/docs/{pages/Search Input/1-Search.vue => content/examples/search-input/default.vue} (63%) create mode 100644 src/docs/content/examples/section/grid.vue create mode 100644 src/docs/content/examples/section/header.vue create mode 100644 src/docs/content/examples/section/panels.vue create mode 100644 src/docs/content/examples/section/structure.vue create mode 100644 src/docs/content/examples/shell-bar/actions.vue create mode 100644 src/docs/content/examples/shell-bar/minimal.vue create mode 100644 src/docs/content/examples/shell-bar/products.vue create mode 100644 src/docs/content/examples/shell/default.vue rename src/docs/{pages/Side Navigation/2-data-driven-complex-sync.vue => content/examples/side-navigation/data-driven-complex-sync.vue} (89%) rename src/docs/{pages/Side Navigation/1-1-dynamic.vue => content/examples/side-navigation/dynamic.vue} (66%) create mode 100644 src/docs/content/examples/spinner/default.vue create mode 100644 src/docs/content/examples/status/default.vue create mode 100644 src/docs/content/examples/status/status-custom-icon.vue create mode 100644 src/docs/content/examples/status/status-icon.vue rename src/docs/{pages/Table/3-table-complex.vue => content/examples/table/complex.vue} (63%) create mode 100644 src/docs/content/examples/table/default.vue rename src/docs/{pages/Table/10-table-dynamic-columns.vue => content/examples/table/dynamic-columns.vue} (100%) rename src/docs/{pages/Table/4-table-fixed-col.vue => content/examples/table/fixed-col.vue} (93%) rename src/docs/{pages/Table/1-table-no-border.vue => content/examples/table/no-border.vue} (87%) rename src/docs/{pages/Table/8-table-performance-test.vue => content/examples/table/performance-test.vue} (77%) rename "src/docs/pages/Table/11-table-select\342\200\223by-row-click.vue" => src/docs/content/examples/table/select-by-row-click.vue (96%) rename src/docs/{pages/Table/6-table-selection-modes.vue => content/examples/table/selection-modes.vue} (80%) rename src/docs/{pages/Table/2-table-no-stripes.vue => content/examples/table/stripes.vue} (88%) rename src/docs/{pages/Table/9-table-table-with-components.vue => content/examples/table/with-components.vue} (81%) rename src/docs/{pages/Tabs/Example.vue => content/examples/tabs/default.vue} (56%) rename src/docs/{pages/Tile Grid/1-tile-grid--col-2-with-tile.vue => content/examples/tile-grid/tile-grid--col-2-with-tile.vue} (97%) rename src/docs/{pages/Tile Grid/2-tile-grid--col-3-with-tile.vue => content/examples/tile-grid/tile-grid--col-3-with-tile.vue} (95%) rename src/docs/{pages/Tile Grid/3-tile-grid--col-4-with-tile.vue => content/examples/tile-grid/tile-grid--col-4-with-tile.vue} (97%) rename src/docs/{pages/Tile Grid/4-tile-grid--col-5-with-tile.vue => content/examples/tile-grid/tile-grid--col-5-with-tile.vue} (100%) rename src/docs/{pages/Tile Grid/5-tile-grid--col-6-with-tile.vue => content/examples/tile-grid/tile-grid--col-6-with-tile.vue} (100%) rename src/docs/{pages/Tile Grid/0-tile-grid--col-and-prod-tile.vue => content/examples/tile-grid/tile-grid--col-and-prod-tile.vue} (93%) rename src/docs/{pages/Tile Grid/6-tile-grid--span-helpers.vue => content/examples/tile-grid/tile-grid--span-helpers.vue} (97%) rename src/docs/{pages/Tile/2-actions.vue => content/examples/tile/actions.vue} (90%) rename src/docs/{pages/Tile/3-button.vue => content/examples/tile/button.vue} (83%) rename src/docs/{pages/Tile/1-media.vue => content/examples/tile/media.vue} (96%) rename src/docs/{pages/Tile/6-product-tile-button.vue => content/examples/tile/product-tile-button.vue} (84%) rename src/docs/{pages/Tile/5-product-tile-default.vue => content/examples/tile/product-tile-default.vue} (83%) rename src/docs/{pages/Tile/0-tile-default.vue => content/examples/tile/tile-default.vue} (85%) rename src/docs/{pages/Time Picker/0-TimePicker.vue => content/examples/time-picker/default.vue} (54%) rename src/docs/{pages/Time Picker/2-Time.vue => content/examples/time-picker/multiple-times.vue} (68%) create mode 100644 src/docs/content/examples/time-picker/time.vue rename src/docs/{pages/Toggle/0-Default-Toggle.vue => content/examples/toggle/default.vue} (71%) rename src/docs/{pages/Toggle/1-Toggle-Sizes.vue => content/examples/toggle/sizes.vue} (68%) rename src/docs/{pages/Toggle/2-Model.vue => content/examples/toggle/v-model.vue} (70%) create mode 100644 src/docs/content/examples/token/default.vue create mode 100644 src/docs/content/examples/virtualized-list/virtualized-list-default.vue rename src/docs/{pages/Virtualized List/5-VirtualizedList-filter.vue => content/examples/virtualized-list/virtualized-list-filter.vue} (98%) rename src/docs/{pages/Virtualized List/3-VirtualizedList-InitialLoad.vue => content/examples/virtualized-list/virtualized-list-initial-load.vue} (97%) create mode 100644 src/docs/content/examples/virtualized-list/virtualized-list-loading-more.vue rename src/docs/{pages/Virtualized List/6-VirtualizedList-add-remove.vue => content/examples/virtualized-list/virtualized-list-mutate.vue} (80%) rename src/docs/{pages/Virtualized List/4-VirtualizedList-reset.vue => content/examples/virtualized-list/virtualized-list-reset.vue} (96%) create mode 100644 src/docs/get-documented-components/documented-component.js create mode 100644 src/docs/get-documented-components/index.js create mode 100644 src/docs/get-documented-components/vue-plugin.js rename src/docs/layouts/{DefaultLayout.vue => d-default-layout.vue} (93%) rename src/docs/layouts/{FullscreenLayout.vue => d-fullscreen-layout.vue} (100%) create mode 100644 src/docs/layouts/index.js delete mode 100644 src/docs/pages/Action Bar/0-full.vue delete mode 100644 src/docs/pages/Action Bar/index.js delete mode 100644 src/docs/pages/Alert/1-warning.vue delete mode 100644 src/docs/pages/Alert/2-error.vue delete mode 100644 src/docs/pages/Alert/3-information.vue delete mode 100644 src/docs/pages/Alert/4-success.vue delete mode 100644 src/docs/pages/Alert/5-vmodel.vue delete mode 100644 src/docs/pages/Alert/index.js delete mode 100644 src/docs/pages/Badge/index.js delete mode 100644 src/docs/pages/Breadcrumb/index.js delete mode 100644 src/docs/pages/Button/4-groups.vue delete mode 100644 src/docs/pages/Button/5-groups-compact.vue delete mode 100644 src/docs/pages/Button/index.js delete mode 100644 src/docs/pages/Calendar/0-default.vue delete mode 100644 src/docs/pages/Calendar/1-selection-range.vue delete mode 100644 src/docs/pages/Calendar/10-no-header.vue delete mode 100644 src/docs/pages/Calendar/7-buttons.vue delete mode 100644 src/docs/pages/Calendar/8-first-day-of-week.vue delete mode 100644 src/docs/pages/Calendar/9-default-date.vue delete mode 100644 src/docs/pages/Calendar/index.js delete mode 100644 src/docs/pages/Colors/index.js delete mode 100644 src/docs/pages/Combobox/0-default.vue delete mode 100644 src/docs/pages/Combobox/1-sizes.vue delete mode 100644 src/docs/pages/Combobox/index.js delete mode 100644 src/docs/pages/Container/0-container-default.vue delete mode 100644 src/docs/pages/Container/1-container-fluid-default copy.vue delete mode 100644 src/docs/pages/Container/index.js delete mode 100644 src/docs/pages/Context Menu/index.js delete mode 100644 src/docs/pages/Counter/2-NotificationCounter.vue delete mode 100644 src/docs/pages/Counter/index.js delete mode 100644 src/docs/pages/Date Input/0-date-input-default.vue delete mode 100644 src/docs/pages/Date Input/index.js delete mode 100644 src/docs/pages/Date Picker/0-date-picker-default.vue delete mode 100644 src/docs/pages/Date Picker/index.js delete mode 100644 src/docs/pages/Design System Utils/index.js delete mode 100644 src/docs/pages/Directives/index.js delete mode 100644 src/docs/pages/Dropdown/index.js delete mode 100644 src/docs/pages/Form/3-states.vue delete mode 100644 src/docs/pages/Form/index.js delete mode 100644 src/docs/pages/Icon/index.js delete mode 100644 src/docs/pages/Identifier/index.js delete mode 100644 src/docs/pages/Image/index.js delete mode 100644 src/docs/pages/Inline Help/index.js delete mode 100644 src/docs/pages/Input Group/index.js delete mode 100644 src/docs/pages/Label/default.vue delete mode 100644 src/docs/pages/Label/index.js delete mode 100644 src/docs/pages/Link/default.vue delete mode 100644 src/docs/pages/Link/index.js delete mode 100644 src/docs/pages/List Group/index.js delete mode 100644 src/docs/pages/Menu Popover/index.js delete mode 100644 src/docs/pages/Menu/1-menu.vue delete mode 100644 src/docs/pages/Menu/2-menuitem-link.vue delete mode 100644 src/docs/pages/Menu/3-menu-group.vue delete mode 100644 src/docs/pages/Menu/4-menu-addon.vue delete mode 100644 src/docs/pages/Menu/5-menu-separated.vue delete mode 100644 src/docs/pages/Menu/index.js delete mode 100644 src/docs/pages/Modal/0-default-modal.vue delete mode 100644 src/docs/pages/Modal/index.js delete mode 100644 src/docs/pages/Pagination/Example.vue delete mode 100644 src/docs/pages/Pagination/index.js delete mode 100644 src/docs/pages/Panel/1-default-grid.vue delete mode 100644 src/docs/pages/Panel/2-nogap.vue delete mode 100644 src/docs/pages/Panel/5-cols-2-.vue delete mode 100644 src/docs/pages/Panel/5-cols-4.vue delete mode 100644 src/docs/pages/Panel/5-cols-5.vue delete mode 100644 src/docs/pages/Panel/5-cols-6.vue delete mode 100644 src/docs/pages/Panel/index.js delete mode 100644 src/docs/pages/Panel/span.vue delete mode 100644 src/docs/pages/Popover/1-placement-options.vue delete mode 100644 src/docs/pages/Popover/3-custom-content.vue delete mode 100644 src/docs/pages/Popover/4-custom-controls.vue delete mode 100644 src/docs/pages/Popover/index.js delete mode 100644 src/docs/pages/Search Input/2-Search-Completions.vue delete mode 100644 src/docs/pages/Search Input/index.js delete mode 100644 src/docs/pages/Section/0-structure.vue delete mode 100644 src/docs/pages/Section/1-header.vue delete mode 100644 src/docs/pages/Section/2-panels.vue delete mode 100644 src/docs/pages/Section/3-grid.vue delete mode 100644 src/docs/pages/Section/index.js delete mode 100644 src/docs/pages/Shell Bar/0-minimal.vue delete mode 100644 src/docs/pages/Shell Bar/1-actions.vue delete mode 100644 src/docs/pages/Shell Bar/3-products.vue delete mode 100644 src/docs/pages/Shell Bar/index.js delete mode 100644 src/docs/pages/Shell/default.vue delete mode 100644 src/docs/pages/Shell/index.js delete mode 100644 src/docs/pages/Side Navigation/index.js delete mode 100644 src/docs/pages/Spinner/Example.vue delete mode 100644 src/docs/pages/Spinner/index.js delete mode 100644 src/docs/pages/Status/1-statusIcon.vue delete mode 100644 src/docs/pages/Status/2-anyIcon.vue delete mode 100644 src/docs/pages/Status/3-default.vue delete mode 100644 src/docs/pages/Status/index.js delete mode 100644 src/docs/pages/Table/.vscode/settings.json delete mode 100644 src/docs/pages/Table/0-table-default.vue delete mode 100644 src/docs/pages/Table/index.js delete mode 100644 src/docs/pages/Tabs/index.js delete mode 100644 src/docs/pages/Tile Grid/index.js delete mode 100644 src/docs/pages/Tile/index.js delete mode 100644 src/docs/pages/Time Picker/1-Time.vue delete mode 100644 src/docs/pages/Time Picker/3-TimeItem.vue delete mode 100644 src/docs/pages/Time Picker/index.js delete mode 100644 src/docs/pages/Toggle/index.js delete mode 100644 src/docs/pages/Token/Example.vue delete mode 100644 src/docs/pages/Token/index.js delete mode 100644 src/docs/pages/Virtualized List/0-VirtualizedList.vue delete mode 100644 src/docs/pages/Virtualized List/1-VirtualizedList-Loading-More.vue delete mode 100644 src/docs/pages/Virtualized List/index.js delete mode 100644 src/docs/pages/index.js create mode 100644 src/docs/router/component-api-route.js create mode 100644 src/docs/router/resolve-example.js delete mode 100644 src/docs/static-pages/start.md create mode 100644 src/docs/styles/_markdown-vars.scss create mode 100644 src/docs/styles/markdown.scss create mode 100644 src/docs/util/__tests__/component-name.test.js create mode 100644 src/docs/util/component-name.js create mode 100644 src/docs/util/kebab-case.js delete mode 100644 src/tools/index.js create mode 100644 src/tools/parse-result-from-sfc.js diff --git a/.eslintrc.js b/.eslintrc.js index fde299ad..ae6bf52c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,7 +1,8 @@ module.exports = { root: true, env: { - node: true + browser: true, + es6: true }, rules: { "max-len": "off", @@ -20,6 +21,7 @@ module.exports = { jest: true } } + ], extends: ["plugin:vue/essential", "@vue/prettier"] diff --git a/.gitignore b/.gitignore index b57215f6..47f7a4bb 100644 --- a/.gitignore +++ b/.gitignore @@ -84,7 +84,6 @@ node_modules/ ### VisualStudioCode ### .vscode/* -!.vscode/settings.json #!.vscode/tasks.json #!.vscode/launch.json #!.vscode/extensions.json @@ -98,3 +97,4 @@ node_modules tests/e2e/videos/*.mp4 /api /tests/e2e/screenshots +/.vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index ed7b7ef4..00000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "eslint.validate": [ - "js", - "javascript", - "vue" - ], - "vetur.grammar.customBlocks": { - "docs": "md", - "tip": "md", - "title": "md" - }, - "debug.node.autoAttach": "on", - "eslint.alwaysShowStatus": true, - "eslint.enable": true, - "eslint.packageManager": "yarn", - "jest.debugMode": true, - "jest.pathToConfig": "jest.config.js", - "jest.pathToJest": "yarn test", - "jest.restartJestOnSnapshotUpdate": true, - "jest.showCoverageOnLoad": true, - "prettier.eslintIntegration": true, - "editor.wordWrap": "on" -} - diff --git a/DEVELOPING.md b/DEVELOPING.md new file mode 100644 index 00000000..3297f8c1 --- /dev/null +++ b/DEVELOPING.md @@ -0,0 +1,6 @@ +## Environment Variables used during the Build Process + +- `NODE_ENV` is required to be set +- `BASE_URL` must be used to set the base url +- If `FDD_PRERENDER` is set to `true` then a special Webpack configuration is used that will generate a static version of the documentation. +- If `FDD_PRERENDER_TEST_RUN` is set to `true` then not all different routes are generated. There are a lot of routes and sometimes you only want to test if some routes still work. By setting this to `true` you tell the build process to only render a handful of pages per major route (`/api`, `/example`, `/examples`, …). \ No newline at end of file diff --git a/README.md b/README.md index f1b98921..ce461230 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ Some prior knowledge of Vue is required for using this library. Paste the following snippet in your ``-tag: -```html +```xml `-tag: Then you can use Fundamental Vue like this: -```html +```xml

@@ -60,7 +60,7 @@ When using *Fundamental Vue* via a ` diff --git a/src/components/Layout/App/_app.vue b/src/components/Layout/App/_app.vue new file mode 100644 index 00000000..39a699ef --- /dev/null +++ b/src/components/Layout/App/_app.vue @@ -0,0 +1,14 @@ + + + diff --git a/src/components/Layout/App/AppMain.vue b/src/components/Layout/App/app-main.vue similarity index 61% rename from src/components/Layout/App/AppMain.vue rename to src/components/Layout/App/app-main.vue index 74389da5..97f23363 100644 --- a/src/components/Layout/App/AppMain.vue +++ b/src/components/Layout/App/app-main.vue @@ -1,5 +1,7 @@ diff --git a/src/components/Layout/Shell/_shell.vue b/src/components/Layout/Shell/_shell.vue new file mode 100644 index 00000000..0793b2b5 --- /dev/null +++ b/src/components/Layout/Shell/_shell.vue @@ -0,0 +1,16 @@ + + + diff --git a/src/components/Layout/Shell/shell-app.vue b/src/components/Layout/Shell/shell-app.vue new file mode 100644 index 00000000..7c148cfc --- /dev/null +++ b/src/components/Layout/Shell/shell-app.vue @@ -0,0 +1,12 @@ + + + diff --git a/src/components/Layout/Shell/ShellFooter.vue b/src/components/Layout/Shell/shell-footer.vue similarity index 57% rename from src/components/Layout/Shell/ShellFooter.vue rename to src/components/Layout/Shell/shell-footer.vue index 338e1de1..8c73fb8c 100644 --- a/src/components/Layout/Shell/ShellFooter.vue +++ b/src/components/Layout/Shell/shell-footer.vue @@ -1,5 +1,7 @@ diff --git a/src/docs/DocumentationLoader/index.js b/src/docs/DocumentationLoader/index.js deleted file mode 100644 index de8dce32..00000000 --- a/src/docs/DocumentationLoader/index.js +++ /dev/null @@ -1,54 +0,0 @@ -import { getExamples, getPages } from "./../pages"; -import { log } from "./../core"; - -export class Example { - constructor({ id, title, code, tip, docs, component, condensed, fullscreenOnly }) { - this.id = id; - this.title = title; - this.code = code; - this.tip = tip; - this.docs = docs; - this.condensed = condensed; - this.component = component; - this.fullscreenOnly = fullscreenOnly; - } -} - -export default class DocumentationLoader { - static install(VueCtor) { - log("Installing DocumentationLoader Plugin…"); - VueCtor.prototype.$docLoader = new DocumentationLoader(); - } - - constructor() { - this.pages = getPages(); - } - - exampleForId(id) { - const { pages } = this; - const withId = example => example.id === id; - for (const page of pages) { - const examples = this.examplesForPage(page); - const example = examples.find(withId); - if (example != null) { - return example; - } - } - } - - examplesForPage({ slug }) { - return this.examplesForPageWithSlug(slug); - } - - examplesForPageWithSlug(slug) { - const page = this.pageForSlug(slug); - if (page == null) { - return []; - } - return getExamples(page.title).map(example => new Example(example)); - } - - pageForSlug(slug) { - return this.pages.find(page => page.slug === slug); - } -} diff --git a/src/docs/_node/component-name.js b/src/docs/_node/component-name.js new file mode 100644 index 00000000..57092c27 --- /dev/null +++ b/src/docs/_node/component-name.js @@ -0,0 +1,100 @@ +/* eslint-env node */ + +// @ts-check +const slugify = require("./slugify"); +const kebabCase = require("./kebab-case"); +const deslugified = require("./deslugify"); +const validateComponentName = require("validate-element-name"); + +// This class helps us to migrate between different representations of a component name. +// There are different naming conventions. + +/** + * @param {any} invalidName + * @returns {never} + */ +const handleInvalidName = invalidName => { + throw Error(`Invalid component name: ${invalidName}`); +}; + +const NORMALIZED_PREFIX = "fd"; + +class ComponentName { + /** + * @param {any} raw + * @returns {boolean} + */ + static hasPrefix(raw) { + if (raw == null) { + return false; + } + if (typeof raw !== "string") { + return false; + } + return raw.toLowerCase().startsWith(NORMALIZED_PREFIX); + } + + static isNormalizedValidComponentName(raw) { + if (ComponentName.hasPrefix(raw) == false) { + return false; + } + const result = validateComponentName(raw); + return result.isValid; + } + /** + * @param {any} raw + * @returns {ComponentName} + */ + static from(raw) { + if (raw == null) { + handleInvalidName(raw); + } + if (typeof raw !== "string") { + handleInvalidName(raw); + } + + if (raw.length <= NORMALIZED_PREFIX.length) { + // Name has no prefix + // let's kebab-case the raw string. + return new ComponentName(`${NORMALIZED_PREFIX}-${kebabCase(raw)}`); + } + + if (raw.toLowerCase().startsWith(NORMALIZED_PREFIX)) { + return new ComponentName(kebabCase(raw)); + } + return new ComponentName(`${NORMALIZED_PREFIX}-${kebabCase(raw)}`); + } + + /** @param {string} normalized */ + constructor(normalized) { + this._normalized = normalized; + } + /** @returns {string} */ + get normalized() { + return this._normalized; + } + /** @returns {string} */ + get slugified() { + return slugify(this.normalized); + } + /** @returns {string} */ + get slugifiedWithoutPrefix() { + return slugify(this.normalizedWithoutPrefix); + } + + /** @returns {string} */ + get normalizedWithoutPrefix() { + return this.normalized.substring(3); + } + + /** @returns {string} */ + get displayable() { + return deslugified(this.normalizedWithoutPrefix); + } + /** @returns {string} */ + get displayableWithPrefix() { + return this.normalized; + } +} + +module.exports = ComponentName; diff --git a/src/docs/_node/deslugify.js b/src/docs/_node/deslugify.js new file mode 100644 index 00000000..30edf9dd --- /dev/null +++ b/src/docs/_node/deslugify.js @@ -0,0 +1,20 @@ +/* eslint-env node */ + +// @ts-check + +/** @param {string} text */ +const capitalized = text => { + if (text.length === 0) { + return text; + } + const firstLetter = text.charAt(0); + return `${firstLetter.toUpperCase()}${text.substring(1)}`; +}; + +/** @param {string} text */ +const deslugify = text => { + const parts = text.split("-"); + return parts.map(capitalized).join(" "); +}; + +module.exports = deslugify; diff --git a/src/docs/_node/get-example-collections.js b/src/docs/_node/get-example-collections.js deleted file mode 100644 index 30ca5680..00000000 --- a/src/docs/_node/get-example-collections.js +++ /dev/null @@ -1,25 +0,0 @@ -// @ts-check - -const globby = require("globby"); -const slugify = require("./slugify"); -const Path = require("path"); - -const getExampleCollections = () => { - const pagesRoot = "src/docs/pages"; - const ingored = [Path.posix.join(pagesRoot, "index.js")]; - const allIndexFiles = globby.sync(Path.posix.join(pagesRoot, "**", "index.js")); - const exampleCollectionModules = allIndexFiles.filter(path => !ingored.includes(path)); - - const exampleCollections = exampleCollectionModules.map(collectionModule => { - const dirname = Path.basename(Path.dirname(collectionModule)); - const slug = slugify(dirname); - return { - slug, - dirname, - absolutePath: collectionModule - }; - }); - return exampleCollections; -}; - -module.exports = getExampleCollections; diff --git a/src/docs/_node/kebab-case.js b/src/docs/_node/kebab-case.js new file mode 100644 index 00000000..ecc904fd --- /dev/null +++ b/src/docs/_node/kebab-case.js @@ -0,0 +1,9 @@ +/* eslint-env node */ + +const kebabCased = str => + str + .replace(/([a-z])([A-Z])/g, "$1-$2") + .replace(/[\s_]+/g, "-") + .toLowerCase(); + +module.exports = kebabCased; diff --git a/src/docs/_node/markdown-plugins/index.js b/src/docs/_node/markdown-plugins/index.js new file mode 100644 index 00000000..8e69c8bb --- /dev/null +++ b/src/docs/_node/markdown-plugins/index.js @@ -0,0 +1,17 @@ +/* eslint-env node */ + +// @ts-check + +const MarkdownItComponentLinkPluin = require("./markdown-it-plugin-component-api-link"); +const MarkdownItPluginTip = require("./markdown-it-plugin-tip"); +const MarkdownItPluginMakeStyleable = require("./markdown-it-plugin-make-styleable"); +const MarkdownItPluginSlot = require("./markdown-it-plugin-slot"); + +module.exports = { + all: [ + MarkdownItPluginSlot, + MarkdownItComponentLinkPluin, + MarkdownItPluginTip, + MarkdownItPluginMakeStyleable + ] +}; diff --git a/src/docs/_node/markdown-plugins/markdown-it-plugin-component-api-link.js b/src/docs/_node/markdown-plugins/markdown-it-plugin-component-api-link.js new file mode 100644 index 00000000..f9c32cbd --- /dev/null +++ b/src/docs/_node/markdown-plugins/markdown-it-plugin-component-api-link.js @@ -0,0 +1,21 @@ +/* eslint-env node */ + +// This markdown-it plugin replaces every occurance of: +// `$valid-fundamental-vue-component-name` +// by a link to the corresponding Fundamental Vue component API. +const ComponentName = require("./../component-name"); + +const plugin = md => { + const defaultRender = md.renderer.rules.code_inline; + const componentApiLink = (tokens, idx, options, env, self) => { + const token = tokens[idx]; + const content = token.content; + if (ComponentName.isNormalizedValidComponentName(content)) { + return ``; + } + return defaultRender(tokens, idx, options, env, self); + }; + md.renderer.rules.code_inline = componentApiLink; +}; + +module.exports = plugin; diff --git a/src/docs/_node/markdown-plugins/markdown-it-plugin-make-styleable.js b/src/docs/_node/markdown-plugins/markdown-it-plugin-make-styleable.js new file mode 100644 index 00000000..069b35ba --- /dev/null +++ b/src/docs/_node/markdown-plugins/markdown-it-plugin-make-styleable.js @@ -0,0 +1,39 @@ +/* eslint-env node */ + +// @ts-check +const markdownItClass = require("@toycode/markdown-it-class"); + +/** + * @param {...string} tags + * @returns {{ [tag:string] : string }} + */ +const mapTags = (...tags) => { + /** @type {{ [tag:string] : string }} */ + const result = {}; + tags.forEach(tag => { + result[tag] = `fdd-md--${tag}`; + }); + return result; +}; + +/** @param {import("markdown-it")} md */ +const plugin = md => { + const mapping = mapTags( + "ul", + "ol", + "li", + "blockquote", + "code", + "pre", + "p", + "h1", + "h2", + "h3", + "h4", + "h5", + "h6" + ); + return markdownItClass(md, mapping); +}; + +module.exports = plugin; diff --git a/src/docs/_node/markdown-plugins/markdown-it-plugin-related-components.js b/src/docs/_node/markdown-plugins/markdown-it-plugin-related-components.js new file mode 100644 index 00000000..1ed13a52 --- /dev/null +++ b/src/docs/_node/markdown-plugins/markdown-it-plugin-related-components.js @@ -0,0 +1,30 @@ +/* eslint-env node */ +// @ts-check +const MarkdownItContainer = require("markdown-it-container"); + +/** + * @typedef {import("markdown-it")} MarkdownIt + * @typedef {import("markdown-it/lib/token")} Token + */ + +/** + * @param {Token[]} tokens + * @param {number} index + * @returns {string} + */ +const renderTip = (tokens, index) => { + if (tokens[index].nesting === 1) { + return `
`; + } else { + return "
"; + } +}; + +/** @param {MarkdownIt} md */ +const plugin = md => { + return MarkdownItContainer(md, "tip", { + render: renderTip + }); +}; + +module.exports = plugin; diff --git a/src/docs/_node/markdown-plugins/markdown-it-plugin-slot.js b/src/docs/_node/markdown-plugins/markdown-it-plugin-slot.js new file mode 100644 index 00000000..ffa74680 --- /dev/null +++ b/src/docs/_node/markdown-plugins/markdown-it-plugin-slot.js @@ -0,0 +1,37 @@ +/* eslint-env node */ +// @ts-check +const MarkdownItContainer = require("markdown-it-container"); + +/** + * @typedef {import("markdown-it")} MarkdownIt + * @typedef {import("markdown-it/lib/token")} Token + * @typedef {object} Options + * @prop {string} slot + */ + +/** + * @param {MarkdownIt} md + * @param {Token[]} tokens + * @param {number} index + * @returns {string} + */ +const renderSlot = (md, tokens, index) => { + const match = tokens[index].info.trim().match(/^slot\s+(.*)$/); + if (tokens[index].nesting === 1) { + return `\n`; + } else { + return "\n"; + } +}; + +/** @param {MarkdownIt} md */ +const plugin = md => { + return MarkdownItContainer(md, "slot", { + validate(params) { + return params.trim().match(/^slot\s+(.*)$/) != null; + }, + render: (tokens, index) => renderSlot(md, tokens, index) + }); +}; + +module.exports = plugin; diff --git a/src/docs/_node/markdown-plugins/markdown-it-plugin-tip.js b/src/docs/_node/markdown-plugins/markdown-it-plugin-tip.js new file mode 100644 index 00000000..1ed13a52 --- /dev/null +++ b/src/docs/_node/markdown-plugins/markdown-it-plugin-tip.js @@ -0,0 +1,30 @@ +/* eslint-env node */ +// @ts-check +const MarkdownItContainer = require("markdown-it-container"); + +/** + * @typedef {import("markdown-it")} MarkdownIt + * @typedef {import("markdown-it/lib/token")} Token + */ + +/** + * @param {Token[]} tokens + * @param {number} index + * @returns {string} + */ +const renderTip = (tokens, index) => { + if (tokens[index].nesting === 1) { + return `
`; + } else { + return "
"; + } +}; + +/** @param {MarkdownIt} md */ +const plugin = md => { + return MarkdownItContainer(md, "tip", { + render: renderTip + }); +}; + +module.exports = plugin; diff --git a/src/docs/_node/markdown/highlight.js b/src/docs/_node/markdown/highlight.js new file mode 100644 index 00000000..bf56d7fc --- /dev/null +++ b/src/docs/_node/markdown/highlight.js @@ -0,0 +1,73 @@ +/* eslint-env node */ +// @ts-check +// Inspired by from Vuepress: https://vuepress.vuejs.org + +const Prism = require("prismjs"); +const escapeHtml = require("escape-html"); +const loadLanguages = require("prismjs/components/index"); +loadLanguages(["markup", "css", "javascript"]); + +/** + * @typedef {object} WrapOptions + * @prop {string} html + * @prop {string} language + */ + +/** @param {WrapOptions} options */ +const wrap = ({ html, language }) => { + const isText = language === "text"; + const html_ = isText ? escapeHtml(html) : html; + return `
${html_}
`; +}; + +/** + * @param {string} string + * @param {string} language + */ +const highlight = (string, language) => { + if (language == null) { + return wrap({ html: string, language: "text" }); + } + let lang = language.toLowerCase(); + const rawLang = language; + if (lang === "vue" || lang === "html") { + lang = "markup"; + } + if (lang === "md") { + lang = "markdown"; + } + if (lang === "rb") { + lang = "ruby"; + } + if (lang === "ts") { + lang = "typescript"; + } + if (lang === "py") { + lang = "python"; + } + if (lang === "sh") { + lang = "bash"; + } + if (lang === "yml") { + lang = "yaml"; + } + if (lang === "styl") { + lang = "stylus"; + } + + if (!Prism.languages[lang]) { + try { + loadLanguages([lang]); + } catch (e) { + // eslint-disable-next-line no-console + console.error("failed to load language %s", lang, e); + } + } + if (Prism.languages[lang]) { + const code = Prism.highlight(string, Prism.languages[lang], lang); + return wrap({ html: code, language: rawLang }); + } + return wrap({ html: string, language: "text" }); +}; + +module.exports = highlight; diff --git a/src/docs/_node/slugify.js b/src/docs/_node/slugify.js index 2ee4015e..9c93f100 100644 --- a/src/docs/_node/slugify.js +++ b/src/docs/_node/slugify.js @@ -1,3 +1,4 @@ +/* eslint-env node */ // @ts-check // Thanks: https://gist.github.com/mathewbyrne/1280286 @@ -12,4 +13,5 @@ const slugify = text => { .replace(/^-+/, "") // Trim - from start of text .replace(/-+$/, ""); // Trim - from end of text }; + module.exports = slugify; diff --git a/src/docs/_pages/example-collection-page.vue b/src/docs/_pages/example-collection-page.vue new file mode 100644 index 00000000..3bee648e --- /dev/null +++ b/src/docs/_pages/example-collection-page.vue @@ -0,0 +1,7 @@ + + + diff --git a/src/docs/component-api-repository/__tests__/component-api-repository.test.js b/src/docs/component-api-repository/__tests__/component-api-repository.test.js deleted file mode 100644 index f09144d4..00000000 --- a/src/docs/component-api-repository/__tests__/component-api-repository.test.js +++ /dev/null @@ -1,9 +0,0 @@ -import ComponentApiRepository from "./../index"; - -describe("ComponentApiRepository", () => { - it("returns displayable component name", () => { - expect(new ComponentApiRepository([]).displayableComponentName("./FdAlert.json")).toEqual( - "FdAlert" - ); - }); -}); diff --git a/src/docs/component-api-repository/index.js b/src/docs/component-api-repository/index.js deleted file mode 100644 index 8d81d2b6..00000000 --- a/src/docs/component-api-repository/index.js +++ /dev/null @@ -1,39 +0,0 @@ -// @ts-check -import slugify from "./../util/slugify"; - -class ComponentApiRepository { - // a key looks like: './fd-alert.json' - constructor(keys) { - this.keys = keys; - } - - /** - * @param {string} key - * @returns {string} - */ - displayableComponentName(key) { - return key.replace("./", "").replace(".json", ""); - } - - /** - * @param {string} key - * @returns {string} - */ - slugifiedComponentName(key) { - return slugify(this.displayableComponentName(key)); - } - - /** @param {string} key */ - routeForKey(key) { - const path = this.slugifiedComponentName(key); - return { - props: { - componentKey: key - }, - name: `component-api.${path}`, - path - }; - } -} - -export default ComponentApiRepository; diff --git a/src/docs/components/ComponentExample.vue b/src/docs/components/ComponentExample.vue deleted file mode 100644 index b730dab5..00000000 --- a/src/docs/components/ComponentExample.vue +++ /dev/null @@ -1,139 +0,0 @@ - - - - - diff --git a/src/docs/components/ExampleCollection.vue b/src/docs/components/ExampleCollection.vue deleted file mode 100644 index fe266f1b..00000000 --- a/src/docs/components/ExampleCollection.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - - - diff --git a/src/docs/components/ExpandTransition.vue b/src/docs/components/ExpandTransition.vue index ceee93a0..f499c527 100644 --- a/src/docs/components/ExpandTransition.vue +++ b/src/docs/components/ExpandTransition.vue @@ -8,7 +8,7 @@ @enter="enter" @before-enter="beforeEnter" > - + diff --git a/src/docs/components/FullscreenDemo.vue b/src/docs/components/FullscreenDemo.vue deleted file mode 100644 index b6351f8d..00000000 --- a/src/docs/components/FullscreenDemo.vue +++ /dev/null @@ -1,21 +0,0 @@ - - - diff --git a/src/docs/components/StaticContent.vue b/src/docs/components/StaticContent.vue deleted file mode 100644 index 8efb2917..00000000 --- a/src/docs/components/StaticContent.vue +++ /dev/null @@ -1,123 +0,0 @@ - - - - - diff --git a/src/docs/components/component-api-link.vue b/src/docs/components/component-api-link.vue deleted file mode 100644 index ceceea74..00000000 --- a/src/docs/components/component-api-link.vue +++ /dev/null @@ -1,29 +0,0 @@ - - - diff --git a/src/docs/components/component-picker.vue b/src/docs/components/component-picker.vue deleted file mode 100644 index 2250604c..00000000 --- a/src/docs/components/component-picker.vue +++ /dev/null @@ -1,82 +0,0 @@ - - - - - diff --git a/src/docs/components/CodeView.vue b/src/docs/components/d-code-view.vue similarity index 80% rename from src/docs/components/CodeView.vue rename to src/docs/components/d-code-view.vue index 50e6dd23..5052efb9 100644 --- a/src/docs/components/CodeView.vue +++ b/src/docs/components/d-code-view.vue @@ -13,44 +13,44 @@ export default { } }, render(h, ctx) { - const code = ctx.props.sourcecode; + const code = + ctx.props.sourcecode || (ctx.children && ctx.children.length > 0 ? ctx.children[0].text : ""); const language = ctx.props.language; const prismLanguage = Prism.languages[language]; const className = `language-${language}`; - - return ( - h("PRE", { - ...ctx.data, - class: [ctx.data.class, className] - }), - [ - h("code", { - class: className, - domProps: { - innerHTML: Prism.highlight(code, prismLanguage) - } - }) - ] - ); + const codeEl = h("code", { + class: className, + domProps: { + innerHTML: Prism.highlight(code, prismLanguage) + } + }); + const preEl = h("pre", { class: className }, [codeEl]); + return h("div", { attrs: { "data-fdd-sourcecode": "true" }, class: "fdd-code" }, [preEl]); } }; - diff --git a/src/docs/components/d-component-api.vue b/src/docs/components/d-component-api.vue index cc6f33ef..2bac6b87 100644 --- a/src/docs/components/d-component-api.vue +++ b/src/docs/components/d-component-api.vue @@ -1,51 +1,129 @@ diff --git a/src/docs/components/d-component-picker.vue b/src/docs/components/d-component-picker.vue new file mode 100644 index 00000000..d514d644 --- /dev/null +++ b/src/docs/components/d-component-picker.vue @@ -0,0 +1,88 @@ + + + + + diff --git a/src/docs/components/d-example-collection.vue b/src/docs/components/d-example-collection.vue new file mode 100644 index 00000000..30435cfe --- /dev/null +++ b/src/docs/components/d-example-collection.vue @@ -0,0 +1,57 @@ + + + diff --git a/src/docs/components/d-example-fullscreen.vue b/src/docs/components/d-example-fullscreen.vue new file mode 100644 index 00000000..44b7917a --- /dev/null +++ b/src/docs/components/d-example-fullscreen.vue @@ -0,0 +1,28 @@ + + + diff --git a/src/docs/components/d-example/_d-example.scss b/src/docs/components/d-example/_d-example.scss new file mode 100644 index 00000000..46a03dd1 --- /dev/null +++ b/src/docs/components/d-example/_d-example.scss @@ -0,0 +1,4 @@ +$example-padding-side: 20px; +$example-margin-bottom: 25px; +$example-border-color: #ebebeb; +$example-border: 1px solid $example-border-color; diff --git a/src/docs/components/d-example/d-example-footer.vue b/src/docs/components/d-example/d-example-footer.vue new file mode 100644 index 00000000..e8185a68 --- /dev/null +++ b/src/docs/components/d-example/d-example-footer.vue @@ -0,0 +1,82 @@ + + + + + diff --git a/src/docs/components/d-example/d-example.vue b/src/docs/components/d-example/d-example.vue new file mode 100644 index 00000000..7cf3a411 --- /dev/null +++ b/src/docs/components/d-example/d-example.vue @@ -0,0 +1,108 @@ + + + + + diff --git a/src/docs/components/d-example/d-toolbar-item.vue b/src/docs/components/d-example/d-toolbar-item.vue new file mode 100644 index 00000000..a80ed6c9 --- /dev/null +++ b/src/docs/components/d-example/d-toolbar-item.vue @@ -0,0 +1,13 @@ + + + diff --git a/src/docs/components/d-md-provide-content.js b/src/docs/components/d-md-provide-content.js new file mode 100644 index 00000000..958dfdc7 --- /dev/null +++ b/src/docs/components/d-md-provide-content.js @@ -0,0 +1,21 @@ +// @ts-check + +/** + * @typedef {object} Content + * @prop {any=} after; + * @prop {any=} before; + */ + +/** @param {Content} content */ +const create = content => { + return { + provide() { + return { + $_fddMdSlots: { + ...content + } + }; + } + }; +}; +export default create; diff --git a/src/docs/components/d-md-slot.vue b/src/docs/components/d-md-slot.vue new file mode 100644 index 00000000..d5eb6c4c --- /dev/null +++ b/src/docs/components/d-md-slot.vue @@ -0,0 +1,39 @@ + + + diff --git a/src/docs/components/d-playground-button/_package.json b/src/docs/components/d-playground-button/_package.json new file mode 100644 index 00000000..1542c888 --- /dev/null +++ b/src/docs/components/d-playground-button/_package.json @@ -0,0 +1,40 @@ +{ + "name": "fundamental-vue-example", + "version": "0.1.0", + "private": true, + "scripts": { + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint" + }, + "dependencies": { + "vue": "^2.6.10", + "fundamental-vue": "^0.16.1" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "3.6.0", + "@vue/cli-plugin-eslint": "3.6.0", + "@vue/cli-service": "3.6.0", + "babel-eslint": "^10.0.1", + "eslint": "^5.8.0", + "eslint-plugin-vue": "^5.0.0", + "vue-template-compiler": "^2.6.10" + }, + "eslintConfig": { + "root": true, + "env": { + "node": true + }, + "extends": ["plugin:vue/essential", "eslint:recommended"], + "rules": {}, + "parserOptions": { + "parser": "babel-eslint" + } + }, + "postcss": { + "plugins": { + "autoprefixer": {} + } + }, + "browserslist": ["> 1%", "last 2 versions", "not ie <= 8"] +} diff --git a/src/docs/components/d-playground-button/d-playground-button.vue b/src/docs/components/d-playground-button/d-playground-button.vue new file mode 100644 index 00000000..e3021b9e --- /dev/null +++ b/src/docs/components/d-playground-button/d-playground-button.vue @@ -0,0 +1,96 @@ + + + diff --git a/src/docs/components/d-related-components-section.vue b/src/docs/components/d-related-components-section.vue new file mode 100644 index 00000000..b692a7d8 --- /dev/null +++ b/src/docs/components/d-related-components-section.vue @@ -0,0 +1,17 @@ + + + diff --git a/src/docs/components/d-related-components.vue b/src/docs/components/d-related-components.vue new file mode 100644 index 00000000..4138eb35 --- /dev/null +++ b/src/docs/components/d-related-components.vue @@ -0,0 +1,53 @@ + + + + + diff --git a/src/docs/components/Tip.vue b/src/docs/components/d-tip.vue similarity index 63% rename from src/docs/components/Tip.vue rename to src/docs/components/d-tip.vue index 6e3a6c21..aadb8070 100644 --- a/src/docs/components/Tip.vue +++ b/src/docs/components/d-tip.vue @@ -1,7 +1,7 @@ @@ -23,22 +23,35 @@ export default { } &__body { font-size: 16px; + > p { + margin: 0; + color: darken(desaturate(#f2f7ff, 50%), 60%); + } + pre[class*="language-"] { + background-color: white; + margin-top: 15px; + margin-bottom: 15px; + padding: 10px; + border: 1px solid darken(desaturate(#f2f7ff, 50%), 10%); + } } color: darken(desaturate(#f2f7ff, 50%), 60%); border-left: 0.3rem solid darken(desaturate(#f2f7ff, 50%), 60%); margin-top: 20px; - margin-bottom: 0; + margin-bottom: 20px; margin-left: 0; margin-right: 0; - padding: 30px; + padding: 20px; background-color: #f2f7ff; font-size: 16px; line-height: 29px; code { color: darken(desaturate(#f2f7ff, 50%), 60%); font-weight: 700; + font-size: 0.85em; margin-block-end: 0; margin-block-start: 0; + border-radius: 4px; } } diff --git a/src/docs/components/doc/component-doc.vue b/src/docs/components/doc/component-doc.vue deleted file mode 100644 index 08588119..00000000 --- a/src/docs/components/doc/component-doc.vue +++ /dev/null @@ -1,88 +0,0 @@ - - - - - diff --git a/src/docs/components/index.js b/src/docs/components/index.js index c9611d8a..d39c812f 100644 --- a/src/docs/components/index.js +++ b/src/docs/components/index.js @@ -1,26 +1,30 @@ -import ComponentExample from "./ComponentExample.vue"; -import CodeView from "./CodeView.vue"; -import ExampleCollection from "./ExampleCollection.vue"; -import FullscreenDemo from "./FullscreenDemo.vue"; -import StaticContent from "./StaticContent.vue"; -import ExpandTransition from "./ExpandTransition.vue"; -import Tip from "./Tip.vue"; +import DTip from "./d-tip.vue"; +import DCodeView from "./d-code-view.vue"; +import DExample from "./d-example/d-example.vue"; +import DRelatedComponents from "./d-related-components.vue"; +import DRelatedComponentsSection from "./d-related-components-section.vue"; import DMarkdown from "./d-markdown.vue"; -import ComponentApiLink from "./component-api-link.vue"; -export { default as FullscreenDemo } from "./FullscreenDemo.vue"; -export { default as ExampleCollection } from "./ExampleCollection.vue"; -export { default as StaticContent } from "./StaticContent.vue"; -export { default as ExpandTransition } from "./ExpandTransition.vue"; -export { default as Tip } from "./Tip.vue"; +import DExampleFullscreen from "./d-example-fullscreen.vue"; +import ExpandTransition from "./ExpandTransition.vue"; +import ComponentApiLink from "./d-component-api-link.vue"; +import ComponentApiLinkTarget from "./d-component-api-link-target.vue"; +import DComponentPicker from "./d-component-picker.vue"; +import DMdSlot from "./d-md-slot.vue"; -export const registerComponents = vue => { - vue.component("d-tip", Tip); - vue.component("component-api-link", ComponentApiLink); +const install = vue => { + vue.component("d-tip", DTip); + vue.component("d-component-picker", DComponentPicker); + vue.component("d-example", DExample); + vue.component("d-component-api-link", ComponentApiLink); + vue.component("d-component-api-link-target", ComponentApiLinkTarget); + vue.component("d-related-components", DRelatedComponents); + vue.component("d-related-components-section", DRelatedComponentsSection); + vue.component("d-example-fullscreen", DExampleFullscreen); vue.component("d-markdown", DMarkdown); + vue.component("d-code-view", DCodeView); + vue.component("d-md-slot", DMdSlot); + vue.component("tip", DTip); vue.component("ExpandTransition", ExpandTransition); - vue.component("FullscreenDemo", FullscreenDemo); - vue.component("StaticContent", StaticContent); - vue.component("ExampleCollection", ExampleCollection); - vue.component("ComponentExample", ComponentExample); - vue.component("CodeView", CodeView); }; + +export default { install }; diff --git a/src/docs/content/en_us/action-bar.md b/src/docs/content/en_us/action-bar.md new file mode 100644 index 00000000..488bb9b7 --- /dev/null +++ b/src/docs/content/en_us/action-bar.md @@ -0,0 +1,16 @@ +--- +fdRelatedComponents: + - fd-action-bar +--- + +# Action Bar + +## Action bar with back button, description and action buttons + + + + +## Action bar with title and description as slots + + + diff --git a/src/docs/content/en_us/alert.md b/src/docs/content/en_us/alert.md new file mode 100644 index 00000000..02a88321 --- /dev/null +++ b/src/docs/content/en_us/alert.md @@ -0,0 +1,35 @@ +--- +fdRelatedComponents: + - fd-alert +--- + +# Alert + +## Default Alert + + + +## Warning Alert + + + +## Error Alert + + + +## Success Alert + + + +## Information Alert + + + +## Alert and `v-model` + +::: tip +`fd-alert` supports `v-model`. You can use `v-model` to control the visibility of the alert. +::: + + + \ No newline at end of file diff --git a/src/docs/content/en_us/badge.md b/src/docs/content/en_us/badge.md new file mode 100644 index 00000000..6f3968ec --- /dev/null +++ b/src/docs/content/en_us/badge.md @@ -0,0 +1,10 @@ +--- +fdRelatedComponents: + - fd-badge +--- + +# Badge + +## Default Badge + + diff --git a/src/docs/content/en_us/breadcrumb.md b/src/docs/content/en_us/breadcrumb.md new file mode 100644 index 00000000..bac5404f --- /dev/null +++ b/src/docs/content/en_us/breadcrumb.md @@ -0,0 +1,12 @@ +--- +fdRelatedComponents: + - fd-breadcrumb + - fd-breadcrumb-item +--- + +# Breadcrumb + +## Default Breadcrumb + + + diff --git a/src/docs/content/en_us/button.md b/src/docs/content/en_us/button.md new file mode 100644 index 00000000..abc6fa09 --- /dev/null +++ b/src/docs/content/en_us/button.md @@ -0,0 +1,104 @@ +--- +fdRelatedComponents: + - fd-button + - fd-button-group +--- + +# Button + +## Button Styling + + + + +## Button with Icon + + + + +## Button Sizes + +::: tip +The compact size is only used on desktop and it is full size when used on a touch device. +::: + + + + +## Split Button: Playground + +`fd-split-button` is a composition of two other components: + +1. `fd-split-button-action`: The *main* area on the left. `fd-split-button` will emit a `click`-event when the action-area is clicked. +2. `fd-split-button-auxiliary`: The area on the right. `fd-split-button` will emit a `click:auxiliary`-event when the auxiliary-area is clicked. You should show a popover/menu in when this event is emitted. + +::: tip +`fd-split-button` does not display a menu or popover when clicked. It is up to you to set that up. +::: + + + + +## Split Button With Menu + +`fd-split-button` works perfectly together with `fd-menu-popover`. + + + + +## Button States + + + + +## Button Groups + +Use an `fd-buttonGroup` in order to group buttons. `fd-buttonGroupButton` supports everything (ex. `icon`, `@click(…), …`) a regular `fd-button` does. You can use `v-model` on `fd-buttonGroupButton`. The `value` of a button group is always an array which contains the `value` of each pressed/selected `fd-buttonGroupButton`. You associate a value with a button group button by using it's `value`-prop. There are also three selection modes (specified by using the `selectionMode`-prop on the group): + +1. `single`: A single button can be pressed/selected at a time. +2. `multiple`: Multiple buttons can be pressed/selected at a time. +3. **A custom selection mode function** + +**Custom Selection Mode** + +If you have special needs you can specific a custom selection mode function. Simply pass a function to the `selectionMode`-prop. The function will be called with the current selection and the value of button that has just been clicked/tapped. Your custom selection mode function then has to return an array which represents the new selection. + +```javascript +const mySelectionMode = (selection, value) => { + if(value === "foo" || value === "bar") { + return selection; + } + const index = selection.indexOf(value); + const newSelection = [...selection]; + if(index >= 0) { + // value is already selected, remove it + newSelection.splice(index); + return newSelection; + } + // value is not selected, add it + return [value, ...newSelection]; +}; +``` + +The custom selection mode above ignores any interactions with buttons that have the value `foo` or `bar`. Otherwise it acts just like the multiple selection mode. + +::: tip +A button group may only contain `fd-button-group-button`-instances. If you use `fd-button` instead, things will not work correctly. + +**Important** + +Make sure to set `aria-label` on the button group. +::: + + + + + +## Compact Button Groups + +::: tip +The compact size is only used on desktop and it is full size when used on a touch device. +::: + + + diff --git a/src/docs/content/en_us/calendar.md b/src/docs/content/en_us/calendar.md new file mode 100644 index 00000000..049a08d4 --- /dev/null +++ b/src/docs/content/en_us/calendar.md @@ -0,0 +1,105 @@ +--- +fdRelatedComponents: + - fd-calendar +--- + +# Calendar + +The `fd-calendar` component is usually displayed inside an `fd-popover`. Scroll down to see an example if you are unsure how to do that. Even though the calendar is a very complex component getting started is as easy as pie. This + +```html + +``` + +gets you the default calendar displayed below. `fd-calendar` has a lot of customization points. Please refer to the examples below for details. + +## Default Calendar + +::: tip + +`fd-calendar` is still under heavy development. Things might break. + +::: + + + + +## Calendar Rangle Selection + +By default you can only select a single date. To change that simply set the `selectionMode` to 'range'. + + + + +## Calendar with blocked Items + + + + +## Calendar with Disabled Items + + + + +## Calendar & `v-model` + +`fd-calendar` supports `v-model`. The example below shows two calendars bound to the same model. + + + + +## Calendar in a Popover + +Calendars work best when displayed in a popover. You can use `fd-popover` for that. + + + + +## Calendar with custom Names + +::: tip +You can customize the names (day of week and month of year) displayed in the calendar by using the props `dayNames` and `monthNames`. This is also how you would implement i18n. +::: + + + + +## Controlling Calendar Buttons +The `hasNext` and `hasPrevious` props can be used to control the next and previous buttons in the calendar header. Those props are functions that return either `true` or `false`. Returning `false` disables the corresponding button. The calendar passes an object containing the `min` and `max` date of the currently displayed month. + +::: tip +The example below let's you go three month into the future and past by using the previous and next buttons in the header. By using the year and month picker the user can still go to months/years that are not reachable with previous and next buttons. +::: + + + + +## Controlling the First Day of Week + +By default the first day of the week is **Sunday**. You can customize that by using the `first-day-of-week`-prop. `first-day-of-week` accepts a number between `0` (default) and `6`. By setting `first-day-of-week` to `1` you basically set the first day of the week to **Monday**. + +::: tip +If you customize weekday names by using the `day-names`-prop you do that independently from `first-day-of-week`. This means that even though you may have set a different `first-day-of-week`, the first name specified in `day-names` is always and will always be the name for **Sunday**. +::: + + + + +## Default Date + +By default the calendar displays the current month. You can change that by setting `default-value` to a custom date value. + + +::: tip +`default-value` accepts values of type `Number`, `String` and `Date`. The `Number` or `String` you pass to `default-value` simply be forwarded to the `Date`'s constructor. +::: + + + + +## Calendar without the Header + +You can hide the header by setting `header-visible` to `false`. Without a header it is hard to tell which date is displayed/selected. Thus it is a good idea to render the currently displayed/selected date separately. + + + diff --git a/src/docs/content/en_us/colors.md b/src/docs/content/en_us/colors.md new file mode 100644 index 00000000..3ad0f6ce --- /dev/null +++ b/src/docs/content/en_us/colors.md @@ -0,0 +1,8 @@ +--- +fdRelatedComponents: +--- + +# Colors + + + diff --git a/src/docs/content/en_us/combobox.md b/src/docs/content/en_us/combobox.md new file mode 100644 index 00000000..910ae19a --- /dev/null +++ b/src/docs/content/en_us/combobox.md @@ -0,0 +1,34 @@ +--- +fdRelatedComponents: + - fd-combobox + - fd-menu-item +--- + +# Combobox + +## Default Combobox + +::: tip + +`fd-combobox` supports `v-model` and thus you can easily create bi-directional bindings. +All `fd-menu-item`s need an associated `value` – otherwise `v-model` will not work. + +::: + + + +## Combobox Sizes + + + + +## Custom Menu + +::: tip + +Use the `menu`-slot in combination with `fd-combobox-menu` in order to provide a custom menu. This allows you (e.g.:) to easily apply custom attributes (`class`, `style`, …). The example below is using a custom menu in order to make it the same width as the combobox itself. A custom menu also allows you to have multiple lists. + +::: + + + \ No newline at end of file diff --git a/src/docs/content/en_us/container.md b/src/docs/content/en_us/container.md new file mode 100644 index 00000000..837c7e6b --- /dev/null +++ b/src/docs/content/en_us/container.md @@ -0,0 +1,30 @@ +--- +fdRelatedComponents: + - fd-container + - fd-col +--- + +# Container + +Layout containers used to arrange content on a 12-column grid. Can be used inside other layout containers like sections and panels. + +## Default Container + + + + +## Fluid Container +`fluid` overrides the `max-width` for a fluid layout with 100% of parent container. + + + + +## Centered Container + + + + +## Fluid with Cols + + + diff --git a/src/docs/content/en_us/context-menu.md b/src/docs/content/en_us/context-menu.md new file mode 100644 index 00000000..4c402bc9 --- /dev/null +++ b/src/docs/content/en_us/context-menu.md @@ -0,0 +1,19 @@ +--- +fdRelatedComponents: + - fd-context-menu + - fd-context-button +--- + +# Contex Menu + +## Default Context Menu + + + + +## Context Menu with custom Button + +Use the `button`-slot in order to provide a custom `fd-context-button`. + + + diff --git a/src/docs/content/en_us/counter.md b/src/docs/content/en_us/counter.md new file mode 100644 index 00000000..4e0faea0 --- /dev/null +++ b/src/docs/content/en_us/counter.md @@ -0,0 +1,16 @@ +--- +fdRelatedComponents: + - fd-counter +--- + +# Counter + +## Default Counter + + + + +## Notification Counter + + + diff --git a/src/docs/content/en_us/date-input.md b/src/docs/content/en_us/date-input.md new file mode 100644 index 00000000..a81ede80 --- /dev/null +++ b/src/docs/content/en_us/date-input.md @@ -0,0 +1,23 @@ +--- +fdRelatedComponents: + - fd-date-input +--- + +# Date Input + +`fd-date-input` can be used to get date + date range inputs from a user. Currently `fd-date-input` is used by `fd-date-picker` but you can also use it on it's own if you want. + +## Default Date Input + + + + +## Date Range Input + + + + +## Date Input & `v-model` + + + diff --git a/src/docs/content/en_us/date-picker.md b/src/docs/content/en_us/date-picker.md new file mode 100644 index 00000000..7af207f6 --- /dev/null +++ b/src/docs/content/en_us/date-picker.md @@ -0,0 +1,45 @@ +--- +fdRelatedComponents: + - fd-date-picker +--- + +# Date Picker + +`fd-date-picker` supports `v-model` and two different modes: + +1. `single`: Allows the user to only pick/enter a single date. +2. `range`: Allows the user to pick/enter a date range. + +::: tip + +`fd-date-picker` has a `value`-prop that holds the current date/date range. This object always has the same structure – no matter the current `mode`. + +The general structure of the expected `value`s looks like this: + +```typescript +interface DateValue { + from?: Date; + to?: Date; +} +``` + +If `mode` is set to `"single"` only the `from`-date is relevant. +If `mode` is set to `"range"` both properties represent the range. + +::: + +## Default Date Pickers + + + + +## Customized Date Pickers + +`fd-date-picker` has two slots that can be used to customize the calendar and input. + +The `input`-slot must render a `fd-date-picker-input`-component. + +The `calendar`-slot must render a `fd-date-picker-calendar`-component. + + + diff --git a/src/docs/content/en_us/design-system-utilities.md b/src/docs/content/en_us/design-system-utilities.md new file mode 100644 index 00000000..639f9535 --- /dev/null +++ b/src/docs/content/en_us/design-system-utilities.md @@ -0,0 +1,47 @@ +# Design System Utilities + +## Margin + +::: tip + +Supported size classes: `none`, `tiny`, `small`, `medium`, `large`. By default the size is applied to all sides. You can constrain the sides by using the modifiers `top`, `left`, `bottom` and `right`. + +::: + + + + +## Padding + +::: tip + +Supported size classes: `none`, `tiny`, `small`, `medium`, `large`. By default the size is applied to all sides. You can constrain the sides by using the modifiers `top`, `left`, `bottom` and `right`. + +::: + + + + +## Removing Padding + +::: tip +Use `v-fd-padding` multiple times to selectively remove padding. +::: + + + + +## Font Weight + + + + +## Font Family + + + + +## Font Type + + + diff --git a/src/docs/content/en_us/directives.md b/src/docs/content/en_us/directives.md new file mode 100644 index 00000000..ff47fb23 --- /dev/null +++ b/src/docs/content/en_us/directives.md @@ -0,0 +1,12 @@ +--- +fdRelatedComponents: +--- + +# Directives + +## Icon + +Use the `v-fd-icon`-directive to attach icons to any element. + + + diff --git a/src/docs/content/en_us/dropdown.md b/src/docs/content/en_us/dropdown.md new file mode 100644 index 00000000..abd4e0eb --- /dev/null +++ b/src/docs/content/en_us/dropdown.md @@ -0,0 +1,26 @@ +--- +fdRelatedComponents: + - fd-dropdown +--- + +# Dropdown + +## Default Dropdown + + + + +## Toolbar Dropdown + + + + +## Dropdown with Icon + + + + +## Disabled Dropdown + + + diff --git a/src/docs/content/en_us/form.md b/src/docs/content/en_us/form.md new file mode 100644 index 00000000..0c09bad3 --- /dev/null +++ b/src/docs/content/en_us/form.md @@ -0,0 +1,74 @@ +--- +fdRelatedComponents: + - fd-field-set + - fd-form-group + - fd-form-item + - fd-form-label + - fd-form-message + - fd-form-set + - fd-input + - fd-input-group + - fd-legend + - fd-select + - fd-text-area +--- + +# Form + +## Binding + +::: tip +`fd-input` supports `v-model` and thus you can easily create bi-directional bindings. +::: + + + + +## Input States + + + + +## Checkboxes +You can bind multiple checkboxes to a single array. For each checked control it's corresponding value is added to the bound array. + +::: tip + +Form items can be inlined. You can do this either by setting the `inline`-flag on each item or by simply setting it on the enclosing `fd-form-group`. + +::: + + + + + +## Radio Buttons + + + + + +## Select + + + + + +## Select with `v-model` + +::: tip +`fd-select` supports `v-model`. +::: + + + + + +## `v-model` Example + +The example below is using `v-model` in order to bind similar component to the same data. + + + + + diff --git a/src/docs/content/en_us/icon.md b/src/docs/content/en_us/icon.md new file mode 100644 index 00000000..c633a245 --- /dev/null +++ b/src/docs/content/en_us/icon.md @@ -0,0 +1,16 @@ +--- +fdRelatedComponents: + - fd-icon +--- + +# Icon + + + + +# Icon Gallery +::: tip +Click on an icon to copy it's name to the clipboard. +::: + + diff --git a/src/docs/content/en_us/identifier.md b/src/docs/content/en_us/identifier.md new file mode 100644 index 00000000..4b817973 --- /dev/null +++ b/src/docs/content/en_us/identifier.md @@ -0,0 +1,40 @@ +--- +fdRelatedComponents: + - fd-identifier +--- + +# Identifier + +Identifier is a way to visually present something using an icon or user initials. + +::: tip + +Include `aria-label` when there is no text equivalent for the identifier. This is not necessary if the identifier is used for illustrative purposes only. + +::: + + + + +## Accent Colors + + + + + +## Identifier Sizes + +There are multiple sizes: + +- Extra Extra Small: `size="xxs"` +- Extra Small: `size="xs"` +- Small: `size="s"` +- Medium: `size="m"` +- Large: `size="l"` +- Extra Large: `size="xl"` +- Extra Extra Large: `size="xxl"` + +Use the `size`-prop to specify the size you want. + + + diff --git a/src/docs/content/en_us/image.md b/src/docs/content/en_us/image.md new file mode 100644 index 00000000..c86497e8 --- /dev/null +++ b/src/docs/content/en_us/image.md @@ -0,0 +1,9 @@ +--- +fdRelatedComponents: + - fd-image +--- + +# Images + + + diff --git a/src/docs/content/en_us/index.js b/src/docs/content/en_us/index.js new file mode 100644 index 00000000..a7122062 --- /dev/null +++ b/src/docs/content/en_us/index.js @@ -0,0 +1,109 @@ +// @ts-check + +import matter from "gray-matter"; +import deslugify from "./../../util/deslugify"; +import slugify from "./../../util/slugify"; + +/** + * @typedef {import("webpack")} Webpack + */ +class ExamplePage { + /** @param {string} key looks like './hello-world.md' */ + constructor(key) { + this.key = key; + } + get title() { + return deslugify(this.key.replace(".md", "").replace("./", "")); + } + get slug() { + return slugify(this.key.replace(".md", "").replace("./", "")); + } +} + +// eslint-disable-next-line no-undef +const markdownContext = require + // @ts-ignore + .context("./", true, /\.md$/); + +/** + * @returns {ExamplePage[]} + */ +export const getExamplePages = () => { + return markdownContext.keys().map(key => new ExamplePage(key)); +}; + +// eslint-disable-next-line no-undef +const markdownGreyMatterContext = require + // @ts-ignore + .context("!raw-loader!./", true, /\.md$/); + +const importMarkdown = key => { + return markdownContext(key); +}; + +/** @param {string} key Webpack Key */ +const getFrontMatter = key => { + const mdModule = markdownGreyMatterContext(key); + const frontMatter = matter(mdModule.default); + return frontMatter.data; +}; + +/** @param {string} key looks like './search-input.md' */ +const getCollectionNameFromKey = key => { + return key.replace("./", "").replace(".md", ""); +}; + +/** + * @typedef {object} ContentWrapperOptions + * @prop {string} collection + * @prop {any} mdModule + * @prop {string} key Webpack Key to load the module + */ +/** + * + * @param {ContentWrapperOptions} options + */ +const CreateMdContentWrapper = ({ key, collection, mdModule }) => { + const fm = getFrontMatter(key); + const wrapper = { + name: `md-${collection}`, + inject: { + $_fddFrontmatter: { + default: { value: {} } + } + }, + data() { + return { + $_fddExampleCollection: collection + }; + }, + render(h) { + return h(mdModule.default); + }, + mounted() { + const frontMatterCollector = this.$_fddFrontmatter; + const frontMatter = fm || {}; + frontMatterCollector.value = { ...frontMatterCollector.value, ...frontMatter }; + } + }; + wrapper.$_fddFrontmatter = fm; + wrapper.groupName = getCollectionNameFromKey(key) || "default"; + wrapper.$fddExampleCollection = collection; + return wrapper; +}; + +const mdModules = markdownContext.keys().map(key => { + const mdModule = importMarkdown(key); + const collection = getCollectionNameFromKey(key.split("/").reverse()[0]); + return CreateMdContentWrapper({ key, collection, mdModule }); +}); + +export const exampleCollectionModules = mdModules; + +export default { + install: vue => { + mdModules.forEach(mdModule => { + vue.component(mdModule.name, mdModule); + }); + } +}; diff --git a/src/docs/content/en_us/inline-help.md b/src/docs/content/en_us/inline-help.md new file mode 100644 index 00000000..536c7588 --- /dev/null +++ b/src/docs/content/en_us/inline-help.md @@ -0,0 +1,9 @@ +--- +fdRelatedComponents: + - fd-inline-help +--- + +# Inline Help + + + diff --git a/src/docs/content/en_us/input-group.md b/src/docs/content/en_us/input-group.md new file mode 100644 index 00000000..018dd77e --- /dev/null +++ b/src/docs/content/en_us/input-group.md @@ -0,0 +1,37 @@ +--- +fdRelatedComponents: + - fd-input-group + - fd-input +--- + +# Input Group + +## Text add-on + + + + +## Slot add-on + + + + +## Button add-on + + + + +## Search + +You have to provide two slots in order to make `fd-input-group-search` work properly: + +1. `input`-slot: Use this slot to provide a search input. +2. `clear`-slot: Use this slot to provide a clear button. You can use `fd-input-group-clear-button` for that. + + + + +## Compact Mode + + + diff --git a/src/docs/content/en_us/label.md b/src/docs/content/en_us/label.md new file mode 100644 index 00000000..4775c78c --- /dev/null +++ b/src/docs/content/en_us/label.md @@ -0,0 +1,9 @@ +--- +fdRelatedComponents: + - fd-label +--- + +# Label + + + diff --git a/src/docs/content/en_us/link.md b/src/docs/content/en_us/link.md new file mode 100644 index 00000000..b1e81ad2 --- /dev/null +++ b/src/docs/content/en_us/link.md @@ -0,0 +1,26 @@ +--- +fdRelatedComponents: + - fd-link +--- + +# Link + +::: tip + +You can provide the visible title of the link by using a default slot or by using the `title`-prop. +If both are provided the `title`-prop is only used for the `title` attribute of the anchor. This means that + +```xml + +``` + +is **equivialent** to + +```xml +foo bar +``` + +::: + + + diff --git a/src/docs/content/en_us/list-group.md b/src/docs/content/en_us/list-group.md new file mode 100644 index 00000000..6cb20b32 --- /dev/null +++ b/src/docs/content/en_us/list-group.md @@ -0,0 +1,19 @@ +--- +fdRelatedComponents: + - fd-list-group +--- + +# List Group + + + + +## List with Action + + + + +## List with Checkboxes + + + diff --git a/src/docs/content/en_us/menu-popover.md b/src/docs/content/en_us/menu-popover.md new file mode 100644 index 00000000..bc658740 --- /dev/null +++ b/src/docs/content/en_us/menu-popover.md @@ -0,0 +1,23 @@ +--- +fdRelatedComponents: + - fd-menu-item + - fd-menu-link + - fd-menu-list + - fd-menu-popover +--- + +# Menu Popover + +`fd-menu-popover` is a relatively low-level component. It is used internally by *Fundamental Vue* for dropdowns and other more high-level components. + +## Menu Popover with multiple Lists + + + + +## Customized Menu Popover + +`fd-menu-popover` is a simple wrapper around `fd-popover`. Any attributes you set on `fd-menu-popover` that are not directly handled by `fd-menu-popver` itself will be passed through to the wrapped `fd-popover`. This allows you to set all `fd-popover`-related props. The example below shows how to set the `placement`-prop. Since `fd-menu-popover` has no custom `placement`-prop it will simply pass it to the popover. + + + diff --git a/src/docs/content/en_us/menu.md b/src/docs/content/en_us/menu.md new file mode 100644 index 00000000..1cbd547a --- /dev/null +++ b/src/docs/content/en_us/menu.md @@ -0,0 +1,86 @@ +--- +fdRelatedComponents: + - fd-menu + - fd-menu-list + - fd-menu-item + - fd-menu-link +--- + +# Menu + +Menus are created by using `fd-menu`. A menu contains one or more `fd-menu-list`s. Lists in turn contain `fd-menu-item`s. *This separation allows you to put similar items in the same group and bring order to chaos*. Further down you will find examples that show how to use multiple lists. + +**Events** + +- `fd-menu-item` emits `click` when clicked. +- Both, `fd-menu-list` and `fd-menu` emit `select`-events every time an item was clicked. The payload is the item itself. They act as some kind of event aggregator which is useful if you don't care about the context of the clicked items so much. + +## Default Menu + + + + +## Menu Item with Link + + +**`fd-menu-item` is smart:** + +`fd-menu-item` looks at what you put in it. If you have an item with just text, `fd-menu-item` will detect that and automatically wrap it with an anchor-element. So this: + +```html +click me +``` + +will yield the same *HTML* as + +```html + + click me + +``` + +If you put anything other than just plain text inside `fd-menu-item` then this automatism won't kick in. + +::: tip + +`fd-menuLink` is just a simple wrapper around the standard `a`-element. This allows you to further customize the menu item (`href`, `target`, …). + +::: + + + + +## Menu w/ Group + + + + +## Menu w/ addon before + + + + +## Menu w/ separated items + +Use the `separated` modifier on `fd-menu-list` to add separators between the items. + + + + +## Menu Highlight + +`fd-menu` currently has a limited API to control the highlighting-state. At this moment only two methods are exposed: + +1. `highlightNextItem()`: Highlights the next menu item. +2. `highlightPreviousItem()`: Highlights the previous menu item. + +You should rarely need to manually call those methods. They are mainly used to support keyboard navigation. + +::: tip + +By setting `highlights-selection` to `true` you tell `fd-menu` that selected items should be highlighted. A highlighted menu item is rendered with a background colored in light-blue. + +::: + + + diff --git a/src/docs/content/en_us/modal.md b/src/docs/content/en_us/modal.md new file mode 100644 index 00000000..e1a9e8ae --- /dev/null +++ b/src/docs/content/en_us/modal.md @@ -0,0 +1,37 @@ +--- +fdRelatedComponents: + - fd-modal +--- + +# Modal + +Each slot (*footer*, *actions*, *default*, *close*, *title*) has access to the modal itself. This allows you to call any method or query any prop/data-value by using the slot's scope. A practical use case for this is shown in the example below. The modal's body (*default* slot) contains a link that, when clicked, closes the modal. + +::: tip + +There are multiple ways to show a modal. + +**Using `$fdModal.open(modalName)`** + +You can use the `$fdModal.open(modalName)` to open modals from anywhere. Just give each modal a name (using the `name`-prop) and pass this to the `open`-function. + +**Manually showing the modal** + +Of course you can also manually show or close the modal by simply calling the corresponding methods in it: + +- `show(event?)`: shows the modal. +- `close(event?)`: closes the modal. + +::: + +## Default Modal + + + + +## Nested Modals + +You can nest modals just by calling `$fdModal.open(…)` multiple times. + + + diff --git a/src/docs/content/en_us/pagination.md b/src/docs/content/en_us/pagination.md new file mode 100644 index 00000000..76660da2 --- /dev/null +++ b/src/docs/content/en_us/pagination.md @@ -0,0 +1,9 @@ +--- +fdRelatedComponents: + - fd-pagination +--- + +# Pagination + + + diff --git a/src/docs/content/en_us/panel.md b/src/docs/content/en_us/panel.md new file mode 100644 index 00000000..e59767cd --- /dev/null +++ b/src/docs/content/en_us/panel.md @@ -0,0 +1,39 @@ +--- +fdRelatedComponents: + - fd-panel + - fd-panel-grid +--- + +# Panel + +## Panel Structure + + + +## Default Panel Grid (3 Columns) + + + +## Panel Grid without Gaps + + + +## Panel Grid (2 Columns) + + + +## Panel Grid (4 Columns) + + + +## Panel Grid (5 Columns) + + + +## Panel Grid (6 Columns) + + + +## Panel Grid with Column Span + + diff --git a/src/docs/pages/Popover/0-default-popover.vue b/src/docs/content/en_us/popover.md similarity index 65% rename from src/docs/pages/Popover/0-default-popover.vue rename to src/docs/content/en_us/popover.md index 03d41d0c..224a97d5 100644 --- a/src/docs/pages/Popover/0-default-popover.vue +++ b/src/docs/content/en_us/popover.md @@ -1,5 +1,11 @@ -Popovers - +--- +fdRelatedComponents: + - fd-popover + - fd-menu-popover +--- + +# Popovers + A popover is made up of two parts: - **Popover Control:** This part triggers the popover content to be displayed. You specify the popover control by providing content for the `control`-slot. @@ -12,24 +18,31 @@ Each slot (`control` and `default`) have access to the following *slot-props*: - `hide` – *Function*: When called, the popover's content will be dismissed. - `toggle` – *Function*: When called, the popover's visibility will be toggled. - `placement` – *String*: The current popover placement. - - + +## Default Popover +::: tip + You can use those slot-props to customize all sorts of things. For example, showing the popover's content when the user hovers over the *control* just means that you have to call `toggle` or `show` for `mouseenter` instead of `click`. - - + +::: + + + + +## Placement Options + +Use the `placement`-prop to any of the following values: `bottom-start`, `bottom`, `bottom-end`, `left-start`, `left`, `left-end`, `right-start`, `right`, `right-end`, `top-start`, `top` and `top-end`. + + + + +## Custom Content + + + + +## Custom Controls + + + diff --git a/src/docs/content/en_us/search-input.md b/src/docs/content/en_us/search-input.md new file mode 100644 index 00000000..eb0a5af2 --- /dev/null +++ b/src/docs/content/en_us/search-input.md @@ -0,0 +1,38 @@ +--- +fdRelatedComponents: + - fd-search-input +--- + +# Search Input + +## Default Search Input + +`fd-search-input` supports `v-model`: The *model value* is simply the currently entered predicate/query/value. + + + + +## Search Input with Autocompletion + +Use the `completions`-prop in order to pass an array of strings to `fd-search-input`. `fd-search-input` will then render a completion list that is automatically filtered. + +::: tip + +Use the `popoverClass`- and `inputGroupClass`-props in order to apply custom CSS classes. The class specified by `popoverClass` is attached to be popover body/content and the class specified by `inputGroupClass` is applied to the input group. The example below is using those two props in order to make the auto completion menu the same width as the input group. + +::: + + + + +## Confirm on Tab + +::: tip + +Set `confirmOn` to `keyup.tab` in order to allow the user to select suggestions by using the tab key. By default, selected suggestions are confirmed when the user hits the **Enter**-key. + +::: + + + + diff --git a/src/docs/content/en_us/section.md b/src/docs/content/en_us/section.md new file mode 100644 index 00000000..6c99fa22 --- /dev/null +++ b/src/docs/content/en_us/section.md @@ -0,0 +1,28 @@ +--- +fdRelatedComponents: + - fd-section + - fd-panel + - fd-panel-grid +--- + +# Section + +## Section Structure + + + + +## Section with Header + + + + +## Section with Panels + + + + +## Section with Panel Grid + + + diff --git a/src/docs/content/en_us/shell-bar.md b/src/docs/content/en_us/shell-bar.md new file mode 100644 index 00000000..1c158dc5 --- /dev/null +++ b/src/docs/content/en_us/shell-bar.md @@ -0,0 +1,54 @@ +--- +fdRelatedComponents: + - fd-shell-bar + - fd-shell-bar-action + - fd-shell-bar-actions + - fd-shell-bar-group + - fd-shell-bar-logo + - fd-shell-bar-product + - fd-shell-bar-product-menu + - fd-shell-bar-product-switcher + - fd-shell-bar-product-switcher-item + - fd-shell-bar-product-switcher-item-img + - fd-shell-bar-product-switcher-item-title + - fd-shell-bar-product-title + - fd-shell-bar-subtitle + - fd-shell-bar-user-menu +--- + +# Shell Bar + +## Minimal Shell Bar + +::: tip + +This example shows the minimum Shellbar for a single application product with only user settings. If no user thumbnail is available then display initials. + +::: + + + + +## Shell Bar with additional Actions + +::: tip + +Use `fd-shell-bar-action-button` to add additional action buttons to the shell bar. + +::: + + + + +## Shell Bar with Product Switcher + +::: tip + +You have to embed a `fd-shell-bar` in a `fd-shell` for things to work properly. + +::: + + + + + diff --git a/src/docs/content/en_us/shell.md b/src/docs/content/en_us/shell.md new file mode 100644 index 00000000..cc74e151 --- /dev/null +++ b/src/docs/content/en_us/shell.md @@ -0,0 +1,12 @@ +--- +fdRelatedComponents: + - fd-shell +--- + +# Shell (Application-level Layout) + +::: tip +`fd-shell` is not production ready. There are several bugs that have to be fixed first. This is tracked in the [Fundamental Styles](https://github.com/SAP/fundamental-styles) repository. +::: + + diff --git a/src/docs/content/en_us/side-navigation.md b/src/docs/content/en_us/side-navigation.md new file mode 100644 index 00000000..7044e12d --- /dev/null +++ b/src/docs/content/en_us/side-navigation.md @@ -0,0 +1,41 @@ +--- +fdRelatedComponents: + - fd-side-nav + - fd-side-nav-list + - fd-side-nav-item + - fd-side-nav-link + - fd-side-nav-group + - fd-side-nav-group-title + - fd-side-nav-sub-list + - fd-side-nav-sub-item + - fd-side-nav-sub-link + - fd-side-nav-icon +--- + +# Side Navigation + +## Dynamic Side Navigation + +`fd-side-nav-list` requires which you set via the `items`-prop. You can put anything into your items. However there are a few special attributes you should be aware of: + +```typescript +type Item = { + // A SideNav-wide unique id + id?: string; // default: random string + + // Child items – if this is non-empty the + // item becomes expandable. + children: Item[] = []; +} +``` + + + + +## Working with the current Selection + +The prop `selectedId` supports the `.sync`-modifier. This way you can bind the selection of the navigation to your data model. + + + + diff --git a/src/docs/content/en_us/spinner.md b/src/docs/content/en_us/spinner.md new file mode 100644 index 00000000..3e3959dd --- /dev/null +++ b/src/docs/content/en_us/spinner.md @@ -0,0 +1,10 @@ +--- +fdRelatedComponents: + - fd-spinner +--- + +# Spinner + + + + diff --git a/src/docs/content/en_us/status.md b/src/docs/content/en_us/status.md new file mode 100644 index 00000000..9fe6dcf1 --- /dev/null +++ b/src/docs/content/en_us/status.md @@ -0,0 +1,22 @@ +--- +fdRelatedComponents: + - fd-status +--- + +# Status + +## Status Indicator Label with built-in Status Icons + + + + +## Status Indicator Label with custom Icons + + + + +## Semantic Status Indicator + + + + diff --git a/src/docs/content/en_us/table.md b/src/docs/content/en_us/table.md new file mode 100644 index 00000000..593b8dfc --- /dev/null +++ b/src/docs/content/en_us/table.md @@ -0,0 +1,168 @@ +--- +fdRelatedComponents: + - fd-table + - fd-table-cell + - fd-table-row +--- + +# Table + +Use `fd-table` in order to display data best visualized by rows and columns. + +::: tip +In a previous release you didn't have to put `fd-table-row` in a `