diff --git a/docs/.vuepress/components/colors/all.vue b/docs/.vitepress/components/colors/all.vue similarity index 82% rename from docs/.vuepress/components/colors/all.vue rename to docs/.vitepress/components/colors/all.vue index a2817d63d3..4218e51462 100644 --- a/docs/.vuepress/components/colors/all.vue +++ b/docs/.vitepress/components/colors/all.vue @@ -1,7 +1,7 @@ - - diff --git a/docs/.vuepress/components/colors/blues.vue b/docs/.vitepress/components/colors/blues.vue similarity index 74% rename from docs/.vuepress/components/colors/blues.vue rename to docs/.vitepress/components/colors/blues.vue index 428009970b..4c13a14364 100644 --- a/docs/.vuepress/components/colors/blues.vue +++ b/docs/.vitepress/components/colors/blues.vue @@ -1,7 +1,7 @@ - - diff --git a/docs/.vuepress/components/colors/colors.scss b/docs/.vitepress/components/colors/colors.scss similarity index 100% rename from docs/.vuepress/components/colors/colors.scss rename to docs/.vitepress/components/colors/colors.scss diff --git a/docs/.vuepress/components/colors/grays.vue b/docs/.vitepress/components/colors/grays.vue similarity index 85% rename from docs/.vuepress/components/colors/grays.vue rename to docs/.vitepress/components/colors/grays.vue index c252303905..8d95ed1649 100644 --- a/docs/.vuepress/components/colors/grays.vue +++ b/docs/.vitepress/components/colors/grays.vue @@ -1,7 +1,7 @@ - - diff --git a/docs/.vuepress/components/colors/greens.vue b/docs/.vitepress/components/colors/greens.vue similarity index 74% rename from docs/.vuepress/components/colors/greens.vue rename to docs/.vitepress/components/colors/greens.vue index 7a4badb7ed..8b9416d858 100644 --- a/docs/.vuepress/components/colors/greens.vue +++ b/docs/.vitepress/components/colors/greens.vue @@ -1,7 +1,7 @@ - - diff --git a/docs/.vuepress/components/colors/reds.vue b/docs/.vitepress/components/colors/reds.vue similarity index 76% rename from docs/.vuepress/components/colors/reds.vue rename to docs/.vitepress/components/colors/reds.vue index 529215841e..c8c3cc85d9 100644 --- a/docs/.vuepress/components/colors/reds.vue +++ b/docs/.vitepress/components/colors/reds.vue @@ -1,7 +1,7 @@ - - diff --git a/docs/.vuepress/components/colors/theme.vue b/docs/.vitepress/components/colors/theme.vue similarity index 84% rename from docs/.vuepress/components/colors/theme.vue rename to docs/.vitepress/components/colors/theme.vue index 02f9828b61..2f57413c39 100644 --- a/docs/.vuepress/components/colors/theme.vue +++ b/docs/.vitepress/components/colors/theme.vue @@ -1,7 +1,7 @@ - - diff --git a/docs/.vuepress/components/colors/yellows.vue b/docs/.vitepress/components/colors/yellows.vue similarity index 77% rename from docs/.vuepress/components/colors/yellows.vue rename to docs/.vitepress/components/colors/yellows.vue index fe5fbca061..84eebe3809 100644 --- a/docs/.vuepress/components/colors/yellows.vue +++ b/docs/.vitepress/components/colors/yellows.vue @@ -1,7 +1,7 @@ -< diff --git a/docs/.vitepress/config.js b/docs/.vitepress/config.js new file mode 100644 index 0000000000..f86d87d485 --- /dev/null +++ b/docs/.vitepress/config.js @@ -0,0 +1,78 @@ +import { defineConfig } from "vitepress"; + +export default defineConfig({ + base: "/webui-vue/", + smoothScroll: true, + title: "OpenBMC Web UI Style Guide", + description: + "Guidance on code style and development for the OpenBMC browser-based UI", + themeConfig: { + nav: [ + { + text: "Guide", + link: "/guide/" + }, + { + text: "Customization", + link: "/customization/" + }, + { + text: "Github", + link: "https://github.com/ibm-openbmc/webui-vue/blob/1060-vue3" + } + ], + sidebar: { + "/guide/": [ + "", + { + text: "Coding Standards", + items: [ + { text: "JavaScript and SASS", link: "/guide/coding-standards/" }, + { text: "Accessibility", link: "/guide/coding-standards/accessibility" } + ] + }, + { + text: "Guidelines", + items: [ + { text: "Colors", link: "/guide/guidelines/colors" }, + { text: "Internationalization", link: "/guide/guidelines/internationalization" }, + { text: "Motion", link: "/guide/guidelines/motion" }, + { text: "Typography", link: "/guide/guidelines/typography" } + ] + }, + { + text: "Unit testing", + items: [ + { text: "Unit testing", link: "/guide/unit-testing/",} + ] + }, + { + text: "Components", + items: [ + { text: "Alerts", link: "/guide/components/alerts/" }, + { text: "Buttons", link: "/guide/components/buttons/" }, + { text: "File upload", link: "/guide/components/file-upload/" }, + { text: "Info tooltip", link: "/guide/components/info-tooltip/" }, + { text: "Page section", link: "/guide/components/page-section/" }, + { text: "Page title", link: "/guide/components/page-title/" }, + { text: "Status icon", link: "/guide/components/status-icon/" }, + { text: "Table", link: "/guide/components/table/" }, + { text: "Toasts", link: "/guide/components/toasts/" }, + ] + }, + { + text: "Quick Start", + items: [ + { text: "Forms", link: "/guide/quickstart/forms" }, + { text: "Page anatomy", link: "/guide/quickstart/page-anatomy" }, + { text: "Store anatomy", link: "/guide/quickstart/store-anatomy" }, + ] + } + ], + "/customization/": [ + { text: "Theme", link: "/customization/theme" }, + { text: "Build", link: "/customization/build" } + ] + } + } + }); \ No newline at end of file diff --git a/docs/.vuepress/styles/palette.styl b/docs/.vitepress/styles/palette.styl similarity index 100% rename from docs/.vuepress/styles/palette.styl rename to docs/.vitepress/styles/palette.styl diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js deleted file mode 100644 index d1fba7ff67..0000000000 --- a/docs/.vuepress/config.js +++ /dev/null @@ -1,73 +0,0 @@ -const path = require('path'); - -module.exports = { - base: "/webui-vue/", - filenameHashing: false, - title: "OpenBMC Web UI Style Guide", - description: - "Guidance on code style and development for the OpenBMC browser-based UI", - smoothScroll: true, - themeConfig: { - nav: [ - { - text: "Guide", - link: "/guide/" - }, - { - text: "Customization", - link: "/customization/" - }, - { - text: "Github", - link: "https://github.com/openbmc/webui-vue" - } - ], - sidebarDepth: 1, - sidebar: { - "/guide/": [ - "", - { - title: "Coding Standards", - children: [ - ["/guide/coding-standards/", "JavaScript and SASS"], - ["/guide/coding-standards/accessibility", "Accessibility"], - ] - }, - { - title: "Guidelines", - children: [ - "/guide/guidelines/colors", - "/guide/guidelines/internationalization", - "/guide/guidelines/motion", - "/guide/guidelines/typography" - ] - }, - "/guide/unit-testing/", - { - title: "Components", - children: [ - "/guide/components/", - "/guide/components/alerts/", - "/guide/components/buttons/", - "/guide/components/file-upload/", - "/guide/components/info-tooltip/", - "/guide/components/page-section/", - "/guide/components/page-title/", - "/guide/components/status-icon/", - "/guide/components/table/", - "/guide/components/toasts/" - ] - }, - { - title: "Quick Start", - children: [ - "/guide/quickstart/forms", - "/guide/quickstart/page-anatomy", - "/guide/quickstart/store-anatomy" - ] - } - ], - "/customization/": ["", "theme", "build"] - }, - } - }; \ No newline at end of file diff --git a/docs/customization/readme.md b/docs/customization/index.md similarity index 97% rename from docs/customization/readme.md rename to docs/customization/index.md index 641180607f..e3b9dc2dde 100644 --- a/docs/customization/readme.md +++ b/docs/customization/index.md @@ -53,6 +53,7 @@ files are based on these two libraries. ├─ _kvm.scss ├─ _modal.scss ├─ _pagination.scss + ├─ _section-divider.scss ├─ _sol.scss ├─ _tables.scss └─ _toasts.scss @@ -202,7 +203,6 @@ set color highlights for some pseudo-elements like `: hover`. &:hover { background-color: theme-color-dark('light'); } - } } &.alert-info { @@ -257,13 +257,13 @@ $exit-easing--expressive: cubic-bezier(0.4, 0.14, 1, 1); - [Including Animation In Your Design System](https://www.smashingmagazine.com/2019/02/animation-design-system/) - [Carbon Design System motion - guidelines](https://www.carbondesignsystem.com/guidelines/motion/basics/) + guidelines](https://carbondesignsystem.com/elements/motion/overview/) #### `_variables.scss` This file contains all the global Sass options. There are Bootstrap option overrides, Bootstrap global variable overrides, and custom BMC global variables. -Read more about these in the [Customization section](/customize/theme). +Read more about these in the [Customization section](/customization/theme). ### `bootstrap` Directory diff --git a/docs/customization/theme.md b/docs/customization/theme.md index 6dbce1a9a1..3646e23c1c 100644 --- a/docs/customization/theme.md +++ b/docs/customization/theme.md @@ -11,10 +11,10 @@ application navigation, and theming. [Read more in the Build Customization section](/customization/build) -### Configuring environment specific builds + ## Bootstrap Sass Options The Bootstrap Sass options are global styling toggles. The naming convention for @@ -58,7 +58,7 @@ and collapsing elements. ### More Information - [Carbon Design System Motion - Guidelines](https://www.carbondesignsystem.com/guidelines/motion/basics/) + Guidelines](https://carbondesignsystem.com/elements/motion/overview/) - [Including Animation In Your Design System](https://www.smashingmagazine.com/2019/02/animation-design-system/) diff --git a/docs/guide/coding-standards/readme.md b/docs/guide/coding-standards/index.md similarity index 100% rename from docs/guide/coding-standards/readme.md rename to docs/guide/coding-standards/index.md diff --git a/docs/guide/components/alerts/index.md b/docs/guide/components/alerts/index.md index aa2c5e1315..d49cf63770 100644 --- a/docs/guide/components/alerts/index.md +++ b/docs/guide/components/alerts/index.md @@ -4,8 +4,8 @@ cannot manually dismiss. With exception to the error message on the login page, alerts are not triggered by user action. Success and error notifications based on user actions are created using a toast component. -[Learn more about Bootstrap-vue alert -options](https://bootstrap-vue.js.org/docs/components/alert) +[Learn more about Bootstrap-vue-next alert +options](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/alert) ![Alert examples](./alert.png) diff --git a/docs/guide/components/buttons/index.md b/docs/guide/components/buttons/index.md index 83b8e8a7ba..bed0751628 100644 --- a/docs/guide/components/buttons/index.md +++ b/docs/guide/components/buttons/index.md @@ -6,8 +6,8 @@ can be themed by setting the `variant` prop on the component to one of the [theme-color map keys](/guide/guidelines/colors). To create a button that looks like a link, set the variant value to `link`. -[Learn more about Bootstrap-vue -buttons](https://bootstrap-vue.js.org/docs/components/button) +[Learn more about Bootstrap-vue-next +buttons](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/button.html) ### Icon only buttons Add `btn-icon-only` class to the button and add `title` attribute to get helper @@ -19,21 +19,21 @@ text on hover over the button. ```vue // Enabled Buttons -Primary - +Primary + Primary with icon - -Secondary -Danger -Link Button - + +Secondary +Danger +Link Button + Link Button - - + + - + ``` ### Disabled buttons @@ -42,19 +42,19 @@ text on hover over the button. ```vue // Disabled Buttons -Primary - +Primary + Primary with icon - -Secondary -Danger -Link Button - + +Secondary +Danger +Link Button + Link Button - - + + - + ``` \ No newline at end of file diff --git a/docs/guide/components/file-upload/readme.md b/docs/guide/components/file-upload/index.md similarity index 83% rename from docs/guide/components/file-upload/readme.md rename to docs/guide/components/file-upload/index.md index fb833648bd..517e7cfb2f 100644 --- a/docs/guide/components/file-upload/readme.md +++ b/docs/guide/components/file-upload/index.md @@ -8,8 +8,8 @@ To use this component: 2. Add the `` tag 3. Add the optional `id` , `disabled`, `accept` and `state` prop as required -[Learn more about the Bootstrap-vue Form File -component](https://bootstrap-vue.org/docs/components/form-file) +[Learn more about the Bootstrap-vue-next Form File +component](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/form-file.html#form-file) ### Optional properties - `id`- Used to set the `id` attribute on the rendered content, and used as the @@ -23,11 +23,11 @@ component](https://bootstrap-vue.org/docs/components/form-file) ## Example of form file ```vue - - + ``` ![Formfile example in firmware](./formfile.png) diff --git a/docs/guide/components/readme.md b/docs/guide/components/index.md similarity index 100% rename from docs/guide/components/readme.md rename to docs/guide/components/index.md diff --git a/docs/guide/components/info-tooltip/index.md b/docs/guide/components/info-tooltip/index.md index b611792409..b5d14a85c4 100644 --- a/docs/guide/components/info-tooltip/index.md +++ b/docs/guide/components/info-tooltip/index.md @@ -4,8 +4,8 @@ The `InfoTooltip` is a custom component that uses a Bootstrap-vue tooltip with an info icon. This custom component requires a title property containing the tooltip text to display to the user. -[Read more about the Bootstrap-vue tooltip -component](https://bootstrap-vue.org/docs/components/tooltip) +[Read more about the Bootstrap-vue-next tooltip +component](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/tooltip.html#tooltip) ## Example diff --git a/docs/guide/components/page-section/index.md b/docs/guide/components/page-section/index.md index 2a8a22ef72..6d9d341f6c 100644 --- a/docs/guide/components/page-section/index.md +++ b/docs/guide/components/page-section/index.md @@ -10,4 +10,4 @@ string will be rendered in an `h2` header element. ``` [View the page section component source -code](https://github.com/openbmc/webui-vue/blob/master/src/components/Global/PageSection.vue). \ No newline at end of file +code](https://github.com/ibm-openbmc/webui-vue/blob/1060-vue3/src/components/Global/PageSection.vue). \ No newline at end of file diff --git a/docs/guide/components/page-title/index.md b/docs/guide/components/page-title/index.md index db43f29f0c..3f3cc65af9 100644 --- a/docs/guide/components/page-title/index.md +++ b/docs/guide/components/page-title/index.md @@ -10,7 +10,7 @@ corresponds with the title property set in the route record's meta field in name: 'login', component: Login, meta: { - title: i18n.t('appPageTitle.login'), + title: i18n.global.t('appPageTitle.login'), }, }, ``` @@ -25,4 +25,4 @@ are found in the `src/locales` folder. ``` [View the page title component source -code](https://github.com/openbmc/webui-vue/blob/master/src/components/Global/PageTitle.vue). +code](https://github.com/ibm-openbmc/webui-vue/blob/1060-vue3/src/components/Global/PageTitle.vue). diff --git a/docs/guide/components/status-icon/readme.md b/docs/guide/components/status-icon/index.md similarity index 100% rename from docs/guide/components/status-icon/readme.md rename to docs/guide/components/status-icon/index.md diff --git a/docs/guide/components/table/index.md b/docs/guide/components/table/index.md index 614ef60fc9..50390d36f1 100644 --- a/docs/guide/components/table/index.md +++ b/docs/guide/components/table/index.md @@ -1,16 +1,16 @@ # Table -All tables in the application are using the [BoostrapVue table -component](https://bootstrap-vue.org/docs/components/table). +All tables in the application are using the [Boostrap-vue-next table +component](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/table.html). -To use the component, include the `` tag in the template. The component +To use the component, include the `` tag in the template. The component is registered globally so does not need to be imported in each SFC. ## Basic table There are a few required properties to maintain consistency across the -application. The full list of options can be viewed on the [Bootstrap-vue table +application. The full list of options can be viewed on the [Bootstrap-vue-next table component's documentation -page](https://bootstrap-vue.org/docs/components/table#comp-ref-b-table-props). +page](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/table.html#table-helper-components). ### Required properties @@ -30,7 +30,7 @@ example](./table-empty.png) ```vue - ``` ## Sort To enable table sort, include `sortable: true` in the fields array for sortable -columns and add the following props to the `` component: +columns and add the following props to the `` component: - `sort-by` - `no-sort-reset` @@ -88,7 +86,7 @@ columns and add the following props to the `` component: ```vue - ``` @@ -131,25 +125,25 @@ export default { To add an expandable row in the table, add a column for the expand button in the fields array. Include the tdClass `table-row-expand` to ensure icon rotation is handled. Use the built in [cell -slot](https://bootstrap-vue.org/docs/components/table#comp-ref-b-table-slots) to +slot](https://bootstrap-vue.org/docs/components/table#comp-ref-BTable-slots) to target the expand button column and add a button with the chevron icon. Include the -[TableRowExpandMixin](https://github.com/openbmc/webui-vue/blob/master/src/components/Mixins/TableRowExpandMixin.js). -The mixin contains the dynamic `aria-label` and `title` attribute values that +[useTableRowExpandComposable](https://github.com/ibm-openbmc/webui-vue/blob/1060-vue3/src/components/Composables/useTableRowExpandComposable.js). +The composable contains the dynamic `aria-label` and `title` attribute values that need to be included with the expand button. The `toggleRowDetails` method should be the button's click event callback. Be sure to pass the `row` object to the function. Use the [row-details -slot](https://bootstrap-vue.org/docs/components/table#comp-ref-b-table-slots) to +slot](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/table.html#row-details-support) to format the expanded row content. The slot has access to the row `item` property. ### Summary 1. Add a column for the expansion row button with the tdClass, `table-row-expand` -2. Include the `TableRowExpandMixin` to handle the dynamic aria label, title, +2. Include the `useTableRowExpandComposable` to handle the dynamic aria label, title, and row expansion toggling 3. Use the `#cell` slot to target the expandable row column and add the button with accessible markup and click handler @@ -159,67 +153,61 @@ format the expanded row content. The slot has access to the row `item` property. ```vue - ``` ## Search The table is leveraging [BootstrapVue table -filtering](https://bootstrap-vue.org/docs/components/table#filtering) for +filtering](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/table.html#filtering) for search. Add the -[@filtered](https://bootstrap-vue.org/docs/components/table#filter-events) event -listener onto the `` component. The event callback should track the +[@filtered](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/table.html#filter-events) event +listener onto the `` component. The event callback should track the total filtered items count. Import the `` and `` components and include them in -the template above the `` component. +the template above the `` component. Include the -[SearchFilterMixin](https://github.com/openbmc/webui-vue/blob/master/src/components/Mixins/SearchFilterMixin.js). +[useSearchFilterComposable](https://github.com/ibm-openbmc/webui-vue/blob/1060-vue3/src/components/Composables/useSearchFilterComposable.js). Add the `@change-search` and `@clear-search` event listeners on the `` component and use the corresponding `onChangeSearchInput` and `onClearSearchInput` methods as the event callbacks. The table should also @@ -239,22 +227,22 @@ if there are no search matches. ```vue - ``` @@ -310,7 +290,7 @@ component will emit a `@click-table-action` with the event value. ```vue - + ``` ## Filters To add a table dropdown filter: -1. Import the ` `component and TableFilterMixin. +1. Import the ` `component and useTableFilterComposable. 1. Add a filters prop to the `` component. This prop should be an array of filter groups–each required to have a key, label, and values prop. @@ -394,7 +365,7 @@ in the dropdown. The component will emit a `@filter-change` event that will provide the filter group and all selected values in the group. Use the getFilteredTableData method -from the TableFilterMixin to show the filtered table data. +from the useTableFilterComposable to show the filtered table data. ![Table filter example](./table-filter.png) @@ -403,15 +374,15 @@ from the TableFilterMixin to show the filtered table data. ```vue - ``` @@ -459,7 +423,7 @@ export default { To add a date filter, import the `` component. It will emit a `@change` event with the user input date values. There is a date filter method, -`getFilteredTableDataByDate`, in the `TableFilterMixin`. +`getFilteredTableDataByDate`, in the `useTableFilterComposable`. ## Batch actions @@ -468,14 +432,14 @@ Batch actions allow a user to take a single action on many items in a table at once. To add table batch actions: -1. Import the ` `component and BVTableSelectableMixin +1. Import the ` `component and useTableSelectableComposable 1. Add the `selectable`, `no-select-on-click` props and a unique `ref` to the table. The table will emit a `@row-selected` event. Use the `onRowSelected` - mixin method as a callback and provide the `$event` as the first argument and + composable method as a callback and provide the `$event` as the first argument and the total table items count as the second argument. 1. Add a table column for checkboxes. The table header checkbox should use the `tableHeaderCheckboxModel` and `tableHeaderCheckboxIndeterminate` values - provided by the mixin. The table header checkbox should also use the + provided by the composable. The table header checkbox should also use the `onChangeHeaderCheckbox` method as a callback for the `@change` event with the table `ref` passed as an argument. The table row checkboxes should use the `toggleSelectRow` method as a callback for the `@change` event with the @@ -501,7 +465,7 @@ To add table batch actions: @clear-selected="clearSelectedRows($refs.table)" @batch-action="onBatchAction" /> - - + ``` @@ -575,27 +530,27 @@ export default { ## Pagination To add table pagination: -1. Import the BVPaginationMixin +1. Import the usePaginationComposable 1. Add the `per-page` and `current-page` props to the `` component. 1. Add the below HTML snippet to the template. Make sure to update the `total-rows` prop. ```vue{21} - - - + + - - - - + + + - - + + ``` ![Table pagination example](./table-pagination.png) ```vue ``` \ No newline at end of file diff --git a/docs/guide/components/toasts/index.md b/docs/guide/components/toasts/index.md index 3f0c815da5..1c47768ff5 100644 --- a/docs/guide/components/toasts/index.md +++ b/docs/guide/components/toasts/index.md @@ -6,7 +6,7 @@ displayed. If the user action was not successful, a toast message with the There are different transitions for the toast messages. The `success` toast message will auto-hide after 10 seconds. The user must manually dismiss the -`informational`, `warning`, and `error` toast messages. The `BVToastMixin` +`informational`, `warning`, and `error` toast messages. The `useToastComposable` provides a simple API that generates a toast message that meets the transition guidelines. @@ -14,28 +14,31 @@ guidelines. ```js{5} // Sample method from Reboot BMC page +import useToastComposable from '@/components/Composables/useToastComposable'; +import { ControlStore } from '@/store'; + +const { successToast, errorToast, infoToast, warningToast } = useToastComposable(); +const controlStore = ControlStore(); + rebootBmc() { - this.$store - .dispatch('controls/rebootBmc') - .then(message => this.successToast(message)) - .catch(({ message }) => this.errorToast(message)); + controlStore.rebootBmc() + .then(message => successToast(message)) + .catch(({ message }) => errorToast(message)); } // Methods used in this example -methods: { - makeSuccessToast() { - this.successToast('This is a success toast and will be dismissed after 10 seconds.'); - }, - makeErrorToast() { - this.errorToast('This is an error toast and must be dismissed by the user.'); - }, - makeWarningToast() { - this.warningToast('This is a warning toast and must be dismissed by the user.'); - }, - makeInfoToast() { - this.infoToast('This is an info toast and must be dismissed by the user.'); - }, -} +const makeSuccessToast = () => { + successToast('This is a success toast and will be dismissed after 10 seconds.'); + }; +const makeErrorToast = () => { + errorToast('This is an error toast and must be dismissed by the user.'); + }; +const makeWarningToast = () => { + warningToast('This is a warning toast and must be dismissed by the user.'); + }; +const makeInfoToast = () => { + infoToast('This is an info toast and must be dismissed by the user.'); + }; ``` ## Additional options @@ -44,7 +47,7 @@ The first argument for each method will be the toast body content. It accepts a string value or an array of strings for toasts needing to display multiple lines of content. -The BVToastMixin also accepts additional options as a second argument. Pass an +The useToastComposable also accepts additional options as a second argument. Pass an object with a `title` property to change the default toast title. Include a `refreshAction` property, set to true, to include a link that refreshes the application. Include a `timestamp` property, set to true, to include a timestamp @@ -55,9 +58,8 @@ style="max-width:350px"> ```js -methods: { - makeInfoToast() { - this.infoToast([ +const makeInfoToast = () => { + infoToast([ 'This is a toast with multi-lined body content.', 'Just pass an array of strings!' ], { @@ -65,6 +67,5 @@ methods: { refreshAction: true, timestamp: true }) - } -} + }; ``` \ No newline at end of file diff --git a/docs/guide/guidelines/colors.md b/docs/guide/guidelines/colors.md index 3ba91b6a1e..fe3f2d5d4d 100644 --- a/docs/guide/guidelines/colors.md +++ b/docs/guide/guidelines/colors.md @@ -7,7 +7,7 @@ colors to override default styles set by the Bootstrap library. - [Learn more about theme customization](/customization/theme/) - [Open an issue in the OpenBMC webui-vue - repo](https://github.com/openbmc/webui-vue/issues/new/choose) to request a + repo](https://github.com/ibm-openbmc/webui-vue/tree/1060-vue3) to request a change - [Learn more about Bootstrap colors](https://getbootstrap.com/docs/4.4/getting-started/theming/#theme-colors) diff --git a/docs/guide/guidelines/internationalization.md b/docs/guide/guidelines/internationalization.md index 6ff17d761a..e768c096bf 100644 --- a/docs/guide/guidelines/internationalization.md +++ b/docs/guide/guidelines/internationalization.md @@ -3,7 +3,7 @@ The OpenBMC Web UI implements internationalization and separates the language- specific parts of the interface from the rest of the code, so they can be easily replaced. The OpenBMC Web UI uses the following library for internationalization: -- [Vue I18n](https://kazupon.github.io/vue-i18n/introduction.html) +- [Vue I18n](https://vue-i18n.intlify.dev/) ## Key naming convention The OpenBMC Web UI follows the following key naming conventions: @@ -17,7 +17,7 @@ structure and improves readability of the language file. - e.g. `pageEventLogs.table.eventType` - Avoid any complex linked locale messages. - Alphabetize object keys. This helps in locating the keys. -- We use the `$t()` function in markup and `this.$t` in scripts (which Vue I18n +- We use the `$t()` function in markup and `i18n.global.t` in scripts (which Vue I18n provides to our components) for outputting translation messages. ## Using the Vue I18n plugin @@ -52,7 +52,7 @@ node node_modules/vue-i18n-extract/bin/vue-i18n-extract.js -v 'src/**/*.?(js|vue - Vue I18n’s `$tc()` function can help with displaying plurals. [Learn more about -pluralization.](https://kazupon.github.io/vue-i18n/guide/pluralization.html) +pluralization.](https://vue-i18n.intlify.dev/guide/essentials/pluralization.html#custom-pluralization) ```json "modal": { diff --git a/docs/guide/guidelines/motion.md b/docs/guide/guidelines/motion.md index 4e1762937a..956dda0424 100644 --- a/docs/guide/guidelines/motion.md +++ b/docs/guide/guidelines/motion.md @@ -2,7 +2,7 @@ The motion guidelines are based on Carbon Design System guidelines. These guidelines avoid easing curves that are unnatural, distracting, or purely decorative. [The documentation below is attributed to Carbon's animation -documentation](https://www.carbondesignsystem.com/guidelines/motion/basics/). +documentation](https://carbondesignsystem.com/elements/motion/overview/). ## Easing diff --git a/docs/guide/readme.md b/docs/guide/index.md similarity index 84% rename from docs/guide/readme.md rename to docs/guide/index.md index 0a0db1d7e4..296146cc5b 100644 --- a/docs/guide/readme.md +++ b/docs/guide/index.md @@ -16,12 +16,12 @@ Having an understanding of semantic HTML, CSS, and JavaScript is the critical knowledge required to contribute to this project. The frameworks and libraries used to build this UI include: - [Vue](https://vuejs.org/) -- [Vuex](https://vuex.vuejs.org/) +- [Pinia](https://pinia.vuejs.org/) - [Vue Router](https://router.vuejs.org/) - [Axios](https://github.com/axios/axios) -- [Bootstrap-vue](https://bootstrap-vue.js.org/) +- [Bootstrap-vue-next](https://bootstrap-vue-next.github.io/bootstrap-vue-next/) - [Vuelidate](https://vuelidate.js.org/) -- [Vue I18n](https://kazupon.github.io/vue-i18n/) +- [Vue I18n](https://vue-i18n.intlify.dev/) ::: tip Acquiring an understanding of these technologies will also be necessary. ::: @@ -36,6 +36,6 @@ application. How to theme the application to meet company brand guidelines is documented in [Customization](/customization/). ## Components -The [components section](/guide/components/) is a guide to using both custom Vue +The [components section](components/) is a guide to using both custom Vue components and components from the Bootstrap-Vue library. diff --git a/docs/guide/quickstart/forms.md b/docs/guide/quickstart/forms.md index 5356eac043..e9bd6b181e 100644 --- a/docs/guide/quickstart/forms.md +++ b/docs/guide/quickstart/forms.md @@ -1,41 +1,41 @@ # Forms -Forms are created using the [bootstrap-vue form -component](https://bootstrap-vue.org/docs/components/form) +Forms are created using the [bootstrap-vue-next form +component](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/form.html#form) and validated with the [Vuelidate](https://vuelidate.js.org/#sub-installation) plugin. ## Form component -When creating a new form, use the `` [form -component](https://bootstrap-vue.org/docs/components/form). Use the `.prevent` +When creating a new form, use the `` [form +component](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/form.html#form). Use the `.prevent` event modifier on submit to prevent the submit event from reloading the page. ## Form group component -The `` [form group -component](https://bootstrap-vue.org/docs/components/form-group) +The `` [form group +component](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/form-group.html) pairs form controls with a legend or label, helper text, invalid/valid feedback text, and visual validation state feedback. Learn more about commonly used form components: -- [Form checkbox](https://bootstrap-vue.org/docs/components/form-checkbox) -- [Form input](https://bootstrap-vue.org/docs/components/form-input) -- [Form radio](https://bootstrap-vue.org/docs/components/form-radio) -- [Form select](https://bootstrap-vue.org/docs/components/form-select) -- [Form file custom component](/guide/components/file-upload) +- [Form checkbox](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/form-checkbox.html#form-checkbox) +- [Form input](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/form-input.html) +- [Form radio](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/form-radio.html) +- [Form select](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/form-select.html) +- [Form file custom component](https://bootstrap-vue-next.github.io/bootstrap-vue-next/docs/components/form-file.html#form-file) -When helper text is provided, use the `` component and `aria-describedby` on the +When helper text is provided, use the `` component and `aria-describedby` on the form group component the helper text describes. ## Validation For custom form validation messages, disable browser native HTML5 -validation by setting the `novalidate` prop on ``. Use Vuelidate to +validation by setting the `novalidate` prop on ``. Use Vuelidate to check the form validation state and add -custom validation messages in the `` component. +custom validation messages in the `` component. -When creating a new form add the `VuelidateMixin` +When creating a new form add the `useVuelidateComposable` to the `scripts` block and import any [validators](https://vuelidate.js.org/#validators) needed such as: `required`, `requiredIf`, etc. The use of built-in validators is @@ -47,15 +47,15 @@ A complete form will look like this. ```vue ``` diff --git a/docs/guide/quickstart/page-anatomy.md b/docs/guide/quickstart/page-anatomy.md index fd49a8f541..7598d656ff 100644 --- a/docs/guide/quickstart/page-anatomy.md +++ b/docs/guide/quickstart/page-anatomy.md @@ -4,21 +4,21 @@ block. ## Template block When creating a new page, each template consists of at least 3 components: -- `` +- `` - `` - `` -Learn more about the [page title](/guide/components/page-title)and [page +Learn more about the [page title](/guide/components/page-title) and [page section](/guide/components/page-section) components. ```vue ``` ## Scripts block @@ -29,13 +29,20 @@ Importing `BContainer` in the [scripts block](#scripts-block) is not required as it is already registered globally. ```vue - ``` @@ -51,21 +58,17 @@ changes should be done in global style sheets. The final SFC will look like this. ```vue +