@carbon/vue 2.45.0 → 3.0.4-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -264
- package/dist/carbon-vue-3.common.js +27392 -0
- package/dist/carbon-vue-3.common.js.map +1 -0
- package/dist/carbon-vue-3.umd.js +27403 -0
- package/dist/carbon-vue-3.umd.js.map +1 -0
- package/dist/carbon-vue-3.umd.min.js +17 -0
- package/dist/carbon-vue-3.umd.min.js.map +1 -0
- package/dist/demo.html +1 -34
- package/package.json +185 -62
- package/src/components/CvAccordion/CvAccordion.stories.js +54 -0
- package/src/components/CvAccordion/CvAccordion.vue +95 -0
- package/src/components/CvAccordion/CvAccordionItem.vue +101 -0
- package/src/components/{cv-accordion/cv-accordion-skeleton.vue → CvAccordion/CvAccordionSkeleton.vue} +14 -18
- package/src/components/CvAccordion/_CvAccordionItemSkeleton.vue +30 -0
- package/src/components/CvAccordion/consts.js +17 -0
- package/src/components/CvAccordion/index.js +6 -0
- package/src/components/CvAspectRatio/CvAspectRatio.stories.js +56 -0
- package/src/components/CvAspectRatio/CvAspectRatio.stories.scss +4 -0
- package/src/components/CvAspectRatio/CvAspectRatio.vue +33 -0
- package/src/components/CvAspectRatio/consts.js +2 -0
- package/src/components/CvAspectRatio/index.js +4 -0
- package/src/components/CvBreadcrumb/CvBreadcrumb.stories.js +75 -0
- package/src/components/CvBreadcrumb/CvBreadcrumb.vue +37 -0
- package/src/components/CvBreadcrumb/CvBreadcrumbItem.vue +28 -0
- package/src/components/CvBreadcrumb/CvBreadcrumbSkeleton.vue +29 -0
- package/src/components/CvBreadcrumb/CvBreadcrumbSkeletonItem.vue +14 -0
- package/src/components/CvBreadcrumb/index.js +11 -0
- package/src/components/CvButton/CvButton.stories.js +119 -0
- package/src/components/CvButton/CvButton.vue +68 -0
- package/src/components/CvButton/CvButtonCommon.js +75 -0
- package/src/components/CvButton/CvButtonSet.stories.js +36 -0
- package/src/components/CvButton/CvButtonSet.vue +30 -0
- package/src/components/CvButton/CvIconButton.stories.js +139 -0
- package/src/components/CvButton/CvIconButton.vue +88 -0
- package/src/components/CvButton/index.js +7 -0
- package/src/components/CvButton/sbBtnPrefix.js +2 -0
- package/src/components/CvCheckbox/CvCheckbox.stories.js +111 -0
- package/src/components/CvCheckbox/CvCheckbox.vue +73 -0
- package/src/components/CvCheckbox/index.js +3 -0
- package/src/components/CvCodeSnippet/CvCodeSnippet.stories.js +181 -0
- package/src/components/CvCodeSnippet/CvCodeSnippet.stories.scss +4 -0
- package/src/components/CvCodeSnippet/CvCodeSnippet.vue +125 -0
- package/src/components/CvCodeSnippet/CvCodeSnippetSkeleton.vue +43 -0
- package/src/components/CvCodeSnippet/_CviCodeSnippetInline.vue +72 -0
- package/src/components/CvCodeSnippet/_CviCodeSnippetMultiline.vue +199 -0
- package/src/components/CvCodeSnippet/_CviCodeSnippetOneline.vue +106 -0
- package/src/components/CvCodeSnippet/consts.js +2 -0
- package/src/components/CvCodeSnippet/index.js +4 -0
- package/src/components/CvComboBox/CvComboBox.stories.js +174 -0
- package/src/components/CvComboBox/CvComboBox.vue +460 -0
- package/src/components/CvComboBox/index.js +3 -0
- package/src/components/CvContentSwitcher/CvContentSwitcher.stories.mdx +196 -0
- package/src/components/CvContentSwitcher/CvContentSwitcher.vue +64 -0
- package/src/components/CvContentSwitcher/CvContentSwitcherButton.vue +117 -0
- package/src/components/CvContentSwitcher/CvContentSwitcherContent.vue +21 -0
- package/src/components/CvContentSwitcher/cvContentSwitcherStore.js +30 -0
- package/src/components/CvContentSwitcher/index.js +3 -0
- package/src/components/CvCopyButton/CvCopyButton.stories.js +28 -0
- package/src/components/CvCopyButton/CvCopyButton.vue +45 -0
- package/src/components/CvCopyButton/_CviCopyButton.vue +71 -0
- package/src/components/CvCopyButton/index.js +3 -0
- package/src/components/CvDataTable/CvDataTable.stories.mdx +304 -0
- package/src/components/CvDataTable/CvDataTable.vue +648 -0
- package/src/components/CvDataTable/CvDataTableAction.vue +22 -0
- package/src/components/CvDataTable/CvDataTableCell.vue +11 -0
- package/src/components/CvDataTable/CvDataTableHeading.vue +143 -0
- package/src/components/CvDataTable/CvDataTableRow.vue +139 -0
- package/src/components/CvDataTable/CvDataTableSkeleton.vue +48 -0
- package/src/components/CvDataTable/_CvDataTableRowInner.vue +169 -0
- package/src/components/CvDataTable/cvDataTableStore.js +340 -0
- package/src/components/CvDataTable/index.js +3 -0
- package/src/components/CvEmpty/_CvEmpty.vue +22 -0
- package/src/components/CvGrid/CvColumn.vue +85 -0
- package/src/components/CvGrid/CvGrid.vue +42 -0
- package/src/components/{cv-grid/cv-row.vue → CvGrid/CvRow.vue} +8 -12
- package/src/components/CvGrid/GvGrid.stories.mdx +217 -0
- package/src/components/CvGrid/_SbContainer.vue +22 -0
- package/src/components/CvGrid/_cvColumnValidation.js +48 -0
- package/src/components/CvLink/CvLink.stories.js +169 -0
- package/src/components/CvLink/CvLink.vue +38 -0
- package/src/components/CvLink/index.js +4 -0
- package/src/components/CvList/CvList.stories.js +88 -0
- package/src/components/CvList/CvList.vue +50 -0
- package/src/components/CvList/CvListItem.vue +12 -0
- package/src/components/CvList/index.js +4 -0
- package/src/components/CvLoading/CvLoading.stories.js +78 -0
- package/src/components/CvLoading/CvLoading.stories.scss +4 -0
- package/src/components/CvLoading/CvLoading.vue +106 -0
- package/src/components/CvLoading/index.js +4 -0
- package/src/components/CvNotification/CvInlineNotification.stories.js +109 -0
- package/src/components/CvNotification/CvInlineNotification.vue +102 -0
- package/src/components/CvNotification/CvToastNotification.stories.js +108 -0
- package/src/components/CvNotification/CvToastNotification.vue +88 -0
- package/src/components/CvNotification/consts.js +31 -0
- package/src/components/CvNotification/index.js +5 -0
- package/src/components/CvOverflowMenu/CvOverflowMenu.stories.mdx +119 -0
- package/src/components/CvOverflowMenu/CvOverflowMenu.vue +283 -0
- package/src/components/{cv-overflow-menu/cv-overflow-menu-item.vue → CvOverflowMenu/CvOverflowMenuItem.vue} +26 -20
- package/src/components/CvOverflowMenu/index.js +3 -0
- package/src/components/CvPagination/CvPagination.stories.mdx +160 -0
- package/src/components/CvPagination/CvPagination.vue +246 -0
- package/src/components/CvPagination/index.js +3 -0
- package/src/components/CvSelect/CvSelect.stories.mdx +227 -0
- package/src/components/CvSelect/CvSelect.vue +224 -0
- package/src/components/CvSelect/CvSelectOptgroup.vue +9 -0
- package/src/components/CvSelect/CvSelectOption.vue +22 -0
- package/src/components/CvSelect/index.js +3 -0
- package/src/components/CvSkeletonText/CvSkeletonText.stories.js +56 -0
- package/src/components/CvSkeletonText/CvSkeletonText.vue +63 -0
- package/src/components/CvSkeletonText/index.js +3 -0
- package/src/components/CvSvg/_CvSvg.vue +48 -0
- package/src/components/CvSvg/__tests__/_TestIcon.vue +19 -0
- package/src/components/CvSvg/__tests__/test-svg.svg +5 -0
- package/src/components/CvTag/CvTag.stories.js +64 -0
- package/src/components/CvTag/CvTag.vue +105 -0
- package/src/components/CvTag/consts.js +15 -0
- package/src/components/CvTag/index.js +5 -0
- package/src/components/CvUIShell/CvHeader.vue +203 -0
- package/src/components/CvUIShell/CvHeaderGlobalAction.vue +105 -0
- package/src/components/{cv-ui-shell/cv-header-menu.vue → CvUIShell/CvHeaderMenu.vue} +41 -37
- package/src/components/CvUIShell/CvHeaderMenuButton.vue +103 -0
- package/src/components/CvUIShell/CvHeaderMenuItem.vue +38 -0
- package/src/components/CvUIShell/CvHeaderName.vue +25 -0
- package/src/components/CvUIShell/CvHeaderNav.vue +18 -0
- package/src/components/CvUIShell/CvHeaderPanel.vue +106 -0
- package/src/components/CvUIShell/CvSideNav.vue +131 -0
- package/src/components/CvUIShell/CvSideNavIcon.vue +17 -0
- package/src/components/CvUIShell/CvSideNavItems.vue +22 -0
- package/src/components/CvUIShell/CvSideNavLink.vue +47 -0
- package/src/components/CvUIShell/CvSideNavMenu.vue +85 -0
- package/src/components/CvUIShell/CvSideNavMenuDivider.vue +7 -0
- package/src/components/CvUIShell/CvSideNavMenuItem.vue +31 -0
- package/src/components/CvUIShell/CvSkipToContent.vue +20 -0
- package/src/components/CvUIShell/CvSwitcher.vue +9 -0
- package/src/components/CvUIShell/CvSwitcherItem.vue +9 -0
- package/src/components/CvUIShell/CvSwitcherItemLink.vue +26 -0
- package/src/components/CvUIShell/CvUIShell.stories.mdx +454 -0
- package/src/components/{cv-ui-shell/_cv-side-nav-footer.vue → CvUIShell/_CvSideNavFooter.vue} +11 -15
- package/src/components/CvUIShell/_CvSideNavLinkText.vue +9 -0
- package/src/components/CvWrapper/CvWrapper.js +23 -0
- package/src/global/component-utils/event-bus.js +23 -0
- package/src/global/component-utils/validators.js +14 -0
- package/src/global/settings.js +5 -0
- package/src/global/storybook-utils/__tests__/story-source-code.js +162 -0
- package/src/global/storybook-utils/controls-from-props.js +72 -0
- package/src/global/storybook-utils/index.js +5 -0
- package/src/global/storybook-utils/sbCompPrefix.js +1 -0
- package/src/global/storybook-utils/split-slot-args.js +14 -0
- package/src/global/storybook-utils/story-source-code.js +52 -0
- package/src/index.js +13 -83
- package/src/use/components.js +24 -0
- package/src/use/cvCheck.js +94 -0
- package/src/use/cvId.js +57 -0
- package/src/use/cvLink.js +42 -0
- package/src/use/cvTheme.js +30 -0
- package/src/use/index.js +1 -0
- package/src/use/overflow.js +37 -0
- package/dist/carbon-vue.common.js +0 -23411
- package/dist/carbon-vue.common.js.map +0 -1
- package/dist/carbon-vue.umd.js +0 -23421
- package/dist/carbon-vue.umd.js.map +0 -1
- package/dist/carbon-vue.umd.min.js +0 -30
- package/dist/carbon-vue.umd.min.js.map +0 -1
- package/src/assets/images/component-icons.svg +0 -57
- package/src/assets/images/example-icon-svg.js +0 -10
- package/src/assets/images/example-icon.svg +0 -6
- package/src/assets/images/example-icons.svg +0 -6
- package/src/carbon.yml +0 -442
- package/src/components/cv-accordion/_cv-accordion-item-skeleton.vue +0 -29
- package/src/components/cv-accordion/cv-accordion-item.vue +0 -87
- package/src/components/cv-accordion/cv-accordion.vue +0 -59
- package/src/components/cv-accordion/index.js +0 -5
- package/src/components/cv-aspect-ratio/cv-aspect-ratio.vue +0 -28
- package/src/components/cv-aspect-ratio/index.js +0 -2
- package/src/components/cv-breadcrumb/_cv-breadcrumb-item-skeleton.vue +0 -13
- package/src/components/cv-breadcrumb/cv-breadcrumb-item.vue +0 -28
- package/src/components/cv-breadcrumb/cv-breadcrumb-skeleton.vue +0 -30
- package/src/components/cv-breadcrumb/cv-breadcrumb.vue +0 -21
- package/src/components/cv-breadcrumb/index.js +0 -5
- package/src/components/cv-button/button-mixin.js +0 -91
- package/src/components/cv-button/cv-button-set.vue +0 -17
- package/src/components/cv-button/cv-button-skeleton.vue +0 -12
- package/src/components/cv-button/cv-button.vue +0 -19
- package/src/components/cv-button/cv-icon-button.vue +0 -42
- package/src/components/cv-button/index.js +0 -6
- package/src/components/cv-checkbox/cv-checkbox-skeleton.vue +0 -15
- package/src/components/cv-checkbox/cv-checkbox.vue +0 -70
- package/src/components/cv-checkbox/index.js +0 -3
- package/src/components/cv-code-snippet/_cv-code-snippet-inline.vue +0 -39
- package/src/components/cv-code-snippet/_cv-code-snippet-multiline.vue +0 -79
- package/src/components/cv-code-snippet/_cv-code-snippet-oneline.vue +0 -47
- package/src/components/cv-code-snippet/cv-code-snippet-skeleton.vue +0 -30
- package/src/components/cv-code-snippet/cv-code-snippet.vue +0 -83
- package/src/components/cv-code-snippet/index.js +0 -3
- package/src/components/cv-combo-box/cv-combo-box.vue +0 -386
- package/src/components/cv-combo-box/index.js +0 -3
- package/src/components/cv-content-switcher/cv-content-switcher-button.vue +0 -104
- package/src/components/cv-content-switcher/cv-content-switcher-content.vue +0 -26
- package/src/components/cv-content-switcher/cv-content-switcher-store.js +0 -22
- package/src/components/cv-content-switcher/cv-content-switcher.vue +0 -117
- package/src/components/cv-content-switcher/index.js +0 -4
- package/src/components/cv-data-table/_cv-data-table-row-inner.vue +0 -139
- package/src/components/cv-data-table/cv-data-table-action.vue +0 -25
- package/src/components/cv-data-table/cv-data-table-cell.vue +0 -14
- package/src/components/cv-data-table/cv-data-table-heading.vue +0 -109
- package/src/components/cv-data-table/cv-data-table-row.vue +0 -113
- package/src/components/cv-data-table/cv-data-table-skeleton.vue +0 -64
- package/src/components/cv-data-table/cv-data-table.vue +0 -525
- package/src/components/cv-data-table/index.js +0 -8
- package/src/components/cv-date-picker/cv-date-picker.vue +0 -362
- package/src/components/cv-date-picker/index.js +0 -3
- package/src/components/cv-date-picker/plugins/appendToPlugin.js +0 -52
- package/src/components/cv-date-picker/plugins/fixEventsPlugin.js +0 -75
- package/src/components/cv-date-picker/plugins/monthSelectPlugin.js +0 -66
- package/src/components/cv-date-picker/plugins/rangePlugin.js +0 -45
- package/src/components/cv-dropdown/cv-dropdown-item.vue +0 -84
- package/src/components/cv-dropdown/cv-dropdown-skeleton.vue +0 -20
- package/src/components/cv-dropdown/cv-dropdown.vue +0 -373
- package/src/components/cv-dropdown/index.js +0 -5
- package/src/components/cv-feedback-button/_cv-feedback-button.vue +0 -74
- package/src/components/cv-file-uploader/consts.js +0 -12
- package/src/components/cv-file-uploader/cv-file-uploader-skeleton.vue +0 -22
- package/src/components/cv-file-uploader/cv-file-uploader.vue +0 -348
- package/src/components/cv-file-uploader/index.js +0 -5
- package/src/components/cv-form/cv-form-group.vue +0 -32
- package/src/components/cv-form/cv-form-item.vue +0 -13
- package/src/components/cv-form/cv-form.vue +0 -13
- package/src/components/cv-form/index.js +0 -5
- package/src/components/cv-grid/cv-column.vue +0 -77
- package/src/components/cv-grid/cv-grid.vue +0 -32
- package/src/components/cv-grid/index.js +0 -5
- package/src/components/cv-icon/_cv-icon.vue +0 -30
- package/src/components/cv-inline-loading/consts.js +0 -8
- package/src/components/cv-inline-loading/cv-inline-loading.vue +0 -91
- package/src/components/cv-inline-loading/index.js +0 -4
- package/src/components/cv-inline-notification/cv-inline-notification.vue +0 -89
- package/src/components/cv-inline-notification/index.js +0 -3
- package/src/components/cv-link/cv-link.vue +0 -30
- package/src/components/cv-link/index.js +0 -3
- package/src/components/cv-list/cv-list-item.vue +0 -13
- package/src/components/cv-list/cv-list.vue +0 -42
- package/src/components/cv-list/index.js +0 -4
- package/src/components/cv-loading/cv-loading.vue +0 -86
- package/src/components/cv-loading/index.js +0 -3
- package/src/components/cv-modal/cv-modal.vue +0 -295
- package/src/components/cv-modal/index.js +0 -2
- package/src/components/cv-multi-select/cv-multi-select.vue +0 -484
- package/src/components/cv-multi-select/index.js +0 -3
- package/src/components/cv-number-input/cv-number-input-skeleton.vue +0 -14
- package/src/components/cv-number-input/cv-number-input.vue +0 -215
- package/src/components/cv-number-input/index.js +0 -3
- package/src/components/cv-overflow-menu/cv-overflow-menu.vue +0 -253
- package/src/components/cv-overflow-menu/index.js +0 -4
- package/src/components/cv-pagination/cv-pagination.vue +0 -268
- package/src/components/cv-pagination/index.js +0 -2
- package/src/components/cv-progress/cv-progress-step.vue +0 -135
- package/src/components/cv-progress/cv-progress.vue +0 -82
- package/src/components/cv-progress/index.js +0 -4
- package/src/components/cv-radio-button/cv-radio-button.vue +0 -40
- package/src/components/cv-radio-button/cv-radio-group.vue +0 -24
- package/src/components/cv-radio-button/index.js +0 -4
- package/src/components/cv-search/cv-search.vue +0 -194
- package/src/components/cv-search/index.js +0 -2
- package/src/components/cv-select/cv-select-optgroup.vue +0 -14
- package/src/components/cv-select/cv-select-option.vue +0 -14
- package/src/components/cv-select/cv-select.vue +0 -158
- package/src/components/cv-select/index.js +0 -4
- package/src/components/cv-skeleton-text/cv-skeleton-text.vue +0 -64
- package/src/components/cv-skeleton-text/index.js +0 -2
- package/src/components/cv-slider/cv-slider-skeleton.vue +0 -22
- package/src/components/cv-slider/cv-slider.vue +0 -247
- package/src/components/cv-slider/index.js +0 -4
- package/src/components/cv-structured-list/_cv-structured-list-item-selectable.vue +0 -37
- package/src/components/cv-structured-list/_cv-structured-list-item-standard.vue +0 -13
- package/src/components/cv-structured-list/cv-structured-list-data.vue +0 -23
- package/src/components/cv-structured-list/cv-structured-list-heading.vue +0 -13
- package/src/components/cv-structured-list/cv-structured-list-item.vue +0 -46
- package/src/components/cv-structured-list/cv-structured-list.vue +0 -38
- package/src/components/cv-structured-list/index.js +0 -5
- package/src/components/cv-svg/_cv-svg.vue +0 -38
- package/src/components/cv-tabs/cv-tab.vue +0 -68
- package/src/components/cv-tabs/cv-tabs-skeleton.vue +0 -20
- package/src/components/cv-tabs/cv-tabs.vue +0 -410
- package/src/components/cv-tabs/index.js +0 -5
- package/src/components/cv-tag/cv-tag-skeleton.vue +0 -19
- package/src/components/cv-tag/cv-tag.vue +0 -121
- package/src/components/cv-tag/index.js +0 -4
- package/src/components/cv-text-area/cv-text-area.vue +0 -98
- package/src/components/cv-text-area/index.js +0 -2
- package/src/components/cv-text-input/cv-text-input.vue +0 -173
- package/src/components/cv-text-input/index.js +0 -2
- package/src/components/cv-tile/_cv-tile-clickable.vue +0 -22
- package/src/components/cv-tile/_cv-tile-expandable.vue +0 -92
- package/src/components/cv-tile/_cv-tile-selectable.vue +0 -48
- package/src/components/cv-tile/_cv-tile-standard.vue +0 -11
- package/src/components/cv-tile/cv-tile.vue +0 -83
- package/src/components/cv-tile/index.js +0 -2
- package/src/components/cv-time-picker/cv-time-picker.vue +0 -138
- package/src/components/cv-time-picker/index.js +0 -2
- package/src/components/cv-toast-notification/cv-toast-notification.vue +0 -72
- package/src/components/cv-toast-notification/index.js +0 -2
- package/src/components/cv-toggle/cv-toggle-skeleton.vue +0 -25
- package/src/components/cv-toggle/cv-toggle.vue +0 -52
- package/src/components/cv-toggle/index.js +0 -3
- package/src/components/cv-toolbar/cv-toolbar-divider.vue +0 -11
- package/src/components/cv-toolbar/cv-toolbar-option.vue +0 -16
- package/src/components/cv-toolbar/cv-toolbar-search.vue +0 -40
- package/src/components/cv-toolbar/cv-toolbar-title.vue +0 -14
- package/src/components/cv-toolbar/cv-toolbar.vue +0 -13
- package/src/components/cv-toolbar/index.js +0 -6
- package/src/components/cv-tooltip/consts.js +0 -2
- package/src/components/cv-tooltip/cv-definition-tooltip.vue +0 -44
- package/src/components/cv-tooltip/cv-interactive-tooltip.vue +0 -241
- package/src/components/cv-tooltip/cv-tooltip.vue +0 -44
- package/src/components/cv-tooltip/index.js +0 -6
- package/src/components/cv-ui-shell/_cv-side-nav-link-text.vue +0 -13
- package/src/components/cv-ui-shell/cv-content.vue +0 -16
- package/src/components/cv-ui-shell/cv-header-global-action.vue +0 -84
- package/src/components/cv-ui-shell/cv-header-menu-button.vue +0 -80
- package/src/components/cv-ui-shell/cv-header-menu-item.vue +0 -36
- package/src/components/cv-ui-shell/cv-header-name.vue +0 -18
- package/src/components/cv-ui-shell/cv-header-nav.vue +0 -18
- package/src/components/cv-ui-shell/cv-header-panel.vue +0 -72
- package/src/components/cv-ui-shell/cv-header-side-nav-items.vue +0 -21
- package/src/components/cv-ui-shell/cv-header.vue +0 -119
- package/src/components/cv-ui-shell/cv-side-nav-divider.vue +0 -12
- package/src/components/cv-ui-shell/cv-side-nav-icon.vue +0 -16
- package/src/components/cv-ui-shell/cv-side-nav-items.vue +0 -21
- package/src/components/cv-ui-shell/cv-side-nav-link.vue +0 -54
- package/src/components/cv-ui-shell/cv-side-nav-menu-item.vue +0 -30
- package/src/components/cv-ui-shell/cv-side-nav-menu.vue +0 -84
- package/src/components/cv-ui-shell/cv-side-nav.vue +0 -97
- package/src/components/cv-ui-shell/cv-skip-to-content.vue +0 -19
- package/src/components/cv-ui-shell/cv-switcher-item-link.vue +0 -26
- package/src/components/cv-ui-shell/cv-switcher-item.vue +0 -13
- package/src/components/cv-ui-shell/cv-switcher.vue +0 -13
- package/src/components/cv-ui-shell/index.js +0 -45
- package/src/components/cv-wrapper/_cv-wrapper.js +0 -33
- package/src/directives/clickout.js +0 -29
- package/src/index-components-vue.js +0 -5
- package/src/internal/feature-flags.js +0 -22
- package/src/mixins/carbon-prefix-mixin.js +0 -7
- package/src/mixins/check-mixin.js +0 -106
- package/src/mixins/index.js +0 -12
- package/src/mixins/link-mixin.js +0 -23
- package/src/mixins/methods-mixin.js +0 -18
- package/src/mixins/notification-mixin.js +0 -18
- package/src/mixins/radio-mixin.js +0 -36
- package/src/mixins/theme-mixin.js +0 -23
- package/src/mixins/uid-mixin.js +0 -23
- package/src/thumbnails/inline-notification.svg +0 -23
- package/src/thumbnails/skeleton-text.svg +0 -15
- package/src/thumbnails/toast-notification.svg +0 -34
- /package/src/components/{cv-button → CvButton}/consts.js +0 -0
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { action } from '@storybook/addon-actions';
|
|
2
|
+
import { CvIconButton } from './';
|
|
3
|
+
import { buttonKinds, buttonSizes } from './consts.js';
|
|
4
|
+
import {
|
|
5
|
+
sbCompPrefix,
|
|
6
|
+
storybookControlsFromProps,
|
|
7
|
+
storyParametersObject,
|
|
8
|
+
} from '../../global/storybook-utils';
|
|
9
|
+
import { sbBtnPrefix } from './sbBtnPrefix';
|
|
10
|
+
|
|
11
|
+
import { props as commonCvButtonProps } from './CvButtonCommon';
|
|
12
|
+
import {
|
|
13
|
+
Bee20,
|
|
14
|
+
Carbon20,
|
|
15
|
+
Watson20,
|
|
16
|
+
IbmCloud20,
|
|
17
|
+
EdtLoop20,
|
|
18
|
+
IbmSecurity20,
|
|
19
|
+
} from '@carbon/icons-vue';
|
|
20
|
+
|
|
21
|
+
const icons = {
|
|
22
|
+
Bee20,
|
|
23
|
+
Carbon20,
|
|
24
|
+
Watson20,
|
|
25
|
+
IbmCloud20,
|
|
26
|
+
EdtLoop20,
|
|
27
|
+
IbmSecurity20,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default {
|
|
31
|
+
title: `${sbCompPrefix}/${sbBtnPrefix}/CvIconButton`,
|
|
32
|
+
component: CvIconButton,
|
|
33
|
+
argTypes: {
|
|
34
|
+
...storybookControlsFromProps(commonCvButtonProps),
|
|
35
|
+
/**
|
|
36
|
+
* \@carbon/icons-vue icon, href, svg or symbol
|
|
37
|
+
*/
|
|
38
|
+
icon: {
|
|
39
|
+
control: {
|
|
40
|
+
type: 'select',
|
|
41
|
+
options: Object.keys(icons),
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Carbon button kind
|
|
46
|
+
*/
|
|
47
|
+
kind: {
|
|
48
|
+
control: { type: 'select', options: buttonKinds },
|
|
49
|
+
defaultValue: CvIconButton.props.kind.default,
|
|
50
|
+
},
|
|
51
|
+
/**
|
|
52
|
+
* Size of the button
|
|
53
|
+
*/
|
|
54
|
+
size: {
|
|
55
|
+
control: { type: 'select', options: buttonSizes },
|
|
56
|
+
defaultValue: CvIconButton.props.size.default,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
const template = `<cv-icon-button @click="onClick" v-bind="newArgs" />`;
|
|
62
|
+
const Template = (args, { argTypes }) => {
|
|
63
|
+
const newArgs = { ...args, icon: icons[args.icon] };
|
|
64
|
+
return {
|
|
65
|
+
props: Object.keys(argTypes),
|
|
66
|
+
components: { CvIconButton },
|
|
67
|
+
template,
|
|
68
|
+
setup() {
|
|
69
|
+
return { newArgs, onClick: action('click') };
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
const defaultArgs = { icon: 'Bee20' };
|
|
75
|
+
|
|
76
|
+
export const Primary = Template.bind({});
|
|
77
|
+
Primary.args = {
|
|
78
|
+
...defaultArgs,
|
|
79
|
+
kind: 'primary',
|
|
80
|
+
label: 'primary',
|
|
81
|
+
};
|
|
82
|
+
Primary.parameters = storyParametersObject(
|
|
83
|
+
Primary.parameters,
|
|
84
|
+
template,
|
|
85
|
+
Primary.args,
|
|
86
|
+
'v-bind="newArgs"'
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
export const Secondary = Template.bind({});
|
|
90
|
+
Secondary.args = {
|
|
91
|
+
kind: 'secondary',
|
|
92
|
+
label: 'Secondary',
|
|
93
|
+
icon: 'Bee20',
|
|
94
|
+
};
|
|
95
|
+
Secondary.parameters = storyParametersObject(
|
|
96
|
+
Secondary.parameters,
|
|
97
|
+
template,
|
|
98
|
+
Secondary.args,
|
|
99
|
+
'v-bind="newArgs"'
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
export const Field = Template.bind({});
|
|
103
|
+
Field.args = {
|
|
104
|
+
label: 'Field size',
|
|
105
|
+
size: 'field',
|
|
106
|
+
icon: 'Bee20',
|
|
107
|
+
};
|
|
108
|
+
Field.parameters = storyParametersObject(
|
|
109
|
+
Field.parameters,
|
|
110
|
+
template,
|
|
111
|
+
Field.args,
|
|
112
|
+
'v-bind="newArgs"'
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
export const Small = Template.bind({});
|
|
116
|
+
Small.args = {
|
|
117
|
+
label: 'sm',
|
|
118
|
+
size: 'sm',
|
|
119
|
+
icon: 'Bee20',
|
|
120
|
+
};
|
|
121
|
+
Small.parameters = storyParametersObject(
|
|
122
|
+
Small.parameters,
|
|
123
|
+
template,
|
|
124
|
+
Small.args,
|
|
125
|
+
'v-bind="newArgs"'
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
export const Large = Template.bind({});
|
|
129
|
+
Large.args = {
|
|
130
|
+
label: 'Large size',
|
|
131
|
+
size: 'lg',
|
|
132
|
+
icon: 'Bee20',
|
|
133
|
+
};
|
|
134
|
+
Large.parameters = storyParametersObject(
|
|
135
|
+
Large.parameters,
|
|
136
|
+
template,
|
|
137
|
+
Large.args,
|
|
138
|
+
'v-bind="newArgs"'
|
|
139
|
+
);
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<button
|
|
3
|
+
:class="[
|
|
4
|
+
buttonClasses,
|
|
5
|
+
`${carbonPrefix}--tooltip__trigger`,
|
|
6
|
+
`${carbonPrefix}--tooltip--a11y`,
|
|
7
|
+
`${carbonPrefix}--tooltip--${tipPosition || 'bottom'}`,
|
|
8
|
+
`${carbonPrefix}--tooltip--align-${tipAlignment || 'center'}`,
|
|
9
|
+
]"
|
|
10
|
+
:disabled="disabled"
|
|
11
|
+
@click="$emit('click', $event)"
|
|
12
|
+
>
|
|
13
|
+
<span :class="`${carbonPrefix}--assistive-text`">{{ label }}</span>
|
|
14
|
+
|
|
15
|
+
<slot name="icon">
|
|
16
|
+
<cv-svg :svg="icon" :class="`${carbonPrefix}--btn__icon`" />
|
|
17
|
+
</slot>
|
|
18
|
+
</button>
|
|
19
|
+
</template>
|
|
20
|
+
|
|
21
|
+
<script>
|
|
22
|
+
import { carbonPrefix } from '../../global/settings';
|
|
23
|
+
import {
|
|
24
|
+
props as commonCvButtonProps,
|
|
25
|
+
useCvButtonCommon,
|
|
26
|
+
} from './CvButtonCommon';
|
|
27
|
+
import CvSvg from '../CvSvg/_CvSvg.vue';
|
|
28
|
+
|
|
29
|
+
const { disabled, icon, kind, size } = commonCvButtonProps;
|
|
30
|
+
|
|
31
|
+
export default {
|
|
32
|
+
name: 'CvIconButton',
|
|
33
|
+
components: { CvSvg },
|
|
34
|
+
emits: ['click'], // emitted to allow testing of click
|
|
35
|
+
props: {
|
|
36
|
+
// Docgen comments added for storybook doc page
|
|
37
|
+
/**
|
|
38
|
+
* disabled by property or if skeleton
|
|
39
|
+
*/
|
|
40
|
+
disabled,
|
|
41
|
+
/**
|
|
42
|
+
* \@carbon/icons-vue icon, href, svg or symbol
|
|
43
|
+
*/
|
|
44
|
+
icon,
|
|
45
|
+
/**
|
|
46
|
+
* Carbon button kind
|
|
47
|
+
*/
|
|
48
|
+
kind,
|
|
49
|
+
/**
|
|
50
|
+
* label displayed as a tooltip for the icon
|
|
51
|
+
*/
|
|
52
|
+
label: { type: String, default: undefined },
|
|
53
|
+
/**
|
|
54
|
+
* Size of the button
|
|
55
|
+
*/
|
|
56
|
+
size,
|
|
57
|
+
/**
|
|
58
|
+
* tipPosition as per CvTooltip
|
|
59
|
+
*/
|
|
60
|
+
tipPosition: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: 'bottom',
|
|
63
|
+
validator: val => ['top', 'left', 'bottom', 'right'.includes(val)],
|
|
64
|
+
},
|
|
65
|
+
/**
|
|
66
|
+
* tipAlignment as per CvTooltip
|
|
67
|
+
*/
|
|
68
|
+
tipAlignment: {
|
|
69
|
+
type: String,
|
|
70
|
+
default: 'center',
|
|
71
|
+
validator: val => ['start', 'center', 'end'].includes(val),
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
setup(props) {
|
|
75
|
+
const { buttonClasses } = useCvButtonCommon(
|
|
76
|
+
props.kind,
|
|
77
|
+
props.size,
|
|
78
|
+
false,
|
|
79
|
+
true
|
|
80
|
+
);
|
|
81
|
+
|
|
82
|
+
return {
|
|
83
|
+
buttonClasses,
|
|
84
|
+
carbonPrefix,
|
|
85
|
+
};
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
</script>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import CvButton from './CvButton.vue';
|
|
2
|
+
import CvIconButton from './CvIconButton.vue';
|
|
3
|
+
import CvButtonSet from './CvButtonSet.vue';
|
|
4
|
+
import CvButtonConsts from './consts';
|
|
5
|
+
|
|
6
|
+
export { CvButton, CvButtonConsts, CvButtonSet, CvIconButton };
|
|
7
|
+
export default CvButton;
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sbCompPrefix,
|
|
3
|
+
storybookControlsFromProps,
|
|
4
|
+
storyParametersObject,
|
|
5
|
+
} from '../../global/storybook-utils';
|
|
6
|
+
|
|
7
|
+
import { CvCheckbox } from '.';
|
|
8
|
+
import { action } from '@storybook/addon-actions';
|
|
9
|
+
import { props as propsCvCheck } from '../../use/cvCheck';
|
|
10
|
+
import { ref } from 'vue';
|
|
11
|
+
|
|
12
|
+
export default {
|
|
13
|
+
title: `${sbCompPrefix}/CvCheckbox`,
|
|
14
|
+
component: CvCheckbox,
|
|
15
|
+
argTypes: {
|
|
16
|
+
...storybookControlsFromProps(propsCvCheck),
|
|
17
|
+
label: { description: 'checkbox label' },
|
|
18
|
+
value: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
table: {
|
|
21
|
+
type: { summary: 'string' },
|
|
22
|
+
category: 'props',
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
hideLabel: {
|
|
26
|
+
description:
|
|
27
|
+
'makes the label visually hidden but still labels the checkbox',
|
|
28
|
+
},
|
|
29
|
+
mixed: {
|
|
30
|
+
type: 'boolean',
|
|
31
|
+
description: 'if true aria-checkbox set to mixed if checked is false',
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: 'boolean' },
|
|
34
|
+
category: 'props',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
change: { description: 'emitted when state changes' },
|
|
38
|
+
modelValue: {
|
|
39
|
+
table: {
|
|
40
|
+
disable: true,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
name: {
|
|
44
|
+
table: {
|
|
45
|
+
disable: true,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
checked: {
|
|
49
|
+
type: 'boolean',
|
|
50
|
+
table: {
|
|
51
|
+
type: { summary: 'boolean' },
|
|
52
|
+
category: 'props',
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const template = `
|
|
59
|
+
<cv-checkbox @change="onChange" v-bind='args' >
|
|
60
|
+
</cv-checkbox>
|
|
61
|
+
`;
|
|
62
|
+
const Template = args => {
|
|
63
|
+
return {
|
|
64
|
+
components: { CvCheckbox },
|
|
65
|
+
setup: () => ({ args, onChange: action('change') }),
|
|
66
|
+
template,
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
export const Default = Template.bind({});
|
|
71
|
+
Default.args = { label: 'checkbox', value: 'check-1' };
|
|
72
|
+
Default.parameters = storyParametersObject(
|
|
73
|
+
Default.parameters,
|
|
74
|
+
template,
|
|
75
|
+
Default.args
|
|
76
|
+
);
|
|
77
|
+
|
|
78
|
+
// v-model story
|
|
79
|
+
const modelValue = ref(false);
|
|
80
|
+
const templateVModel = `<div>
|
|
81
|
+
<cv-checkbox @change="onChange" v-bind='args' v-model="modelValue">
|
|
82
|
+
</cv-checkbox>
|
|
83
|
+
<div style="margin-top:1rem; background-color: #888888; padding:1rem"><div style="font-size: 150%">Sample interaction</div>
|
|
84
|
+
<label for="checkbox">V-model: Check 1:</label>
|
|
85
|
+
<input id="checkbox" type="checkbox" @change="(ev) => {modelValue = ev.currentTarget.checked}" />
|
|
86
|
+
<div>Checked: <span style="font-weight: bold;">{{modelValue}}</span></div>
|
|
87
|
+
</div>
|
|
88
|
+
</div>
|
|
89
|
+
`;
|
|
90
|
+
|
|
91
|
+
const TemplateVModel = args => {
|
|
92
|
+
return {
|
|
93
|
+
components: { CvCheckbox },
|
|
94
|
+
setup: () => ({
|
|
95
|
+
args,
|
|
96
|
+
modelValue,
|
|
97
|
+
onChange: action('change'),
|
|
98
|
+
}),
|
|
99
|
+
template: templateVModel,
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export const vModel = TemplateVModel.bind({});
|
|
103
|
+
vModel.args = {
|
|
104
|
+
label: 'checkbox',
|
|
105
|
+
value: 'check-1',
|
|
106
|
+
};
|
|
107
|
+
vModel.parameters = storyParametersObject(
|
|
108
|
+
vModel.parameters,
|
|
109
|
+
templateVModel,
|
|
110
|
+
vModel.args
|
|
111
|
+
);
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
class="cv-checkbox"
|
|
4
|
+
:class="[
|
|
5
|
+
`${carbonPrefix}--checkbox--${inline ? 'inline' : 'wrapper'}`,
|
|
6
|
+
{ [`${carbonPrefix}--form-item`]: formItem },
|
|
7
|
+
]"
|
|
8
|
+
>
|
|
9
|
+
<input
|
|
10
|
+
ref="input"
|
|
11
|
+
v-bind="$attrs"
|
|
12
|
+
type="checkbox"
|
|
13
|
+
:class="`${carbonPrefix}--checkbox`"
|
|
14
|
+
:checked="isChecked === true"
|
|
15
|
+
:aria-checked="`${isChecked}`"
|
|
16
|
+
@focus="onFocus"
|
|
17
|
+
@blur="onBlur"
|
|
18
|
+
@change="onChange"
|
|
19
|
+
:value="value"
|
|
20
|
+
:id="cvId"
|
|
21
|
+
/><label
|
|
22
|
+
:for="cvId"
|
|
23
|
+
:class="[
|
|
24
|
+
`${carbonPrefix}--checkbox-label`,
|
|
25
|
+
{
|
|
26
|
+
[`${carbonPrefix}--label--disabled`]:
|
|
27
|
+
$attrs.disabled !== undefined && this.$attrs.disabled,
|
|
28
|
+
[`${carbonPrefix}--checkbox-label__focus`]: hasFocus,
|
|
29
|
+
},
|
|
30
|
+
]"
|
|
31
|
+
><span
|
|
32
|
+
:class="[
|
|
33
|
+
`${carbonPrefix}--checkbox-label-text`,
|
|
34
|
+
{ [`${carbonPrefix}--visually-hidden`]: hideLabel },
|
|
35
|
+
]"
|
|
36
|
+
dir="auto"
|
|
37
|
+
>{{ label }}</span
|
|
38
|
+
></label
|
|
39
|
+
>
|
|
40
|
+
</div>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<script setup>
|
|
44
|
+
import { ref, toRefs } from 'vue';
|
|
45
|
+
import { carbonPrefix } from '../../global/settings';
|
|
46
|
+
import { useCheck, props as propsCvCheck } from '../../use/cvCheck';
|
|
47
|
+
import { useCvId, props as propsCvId } from '../../use/cvId';
|
|
48
|
+
|
|
49
|
+
const props = defineProps({
|
|
50
|
+
hideLabel: { type: Boolean, default: null },
|
|
51
|
+
label: { type: String, default: null },
|
|
52
|
+
formItem: { type: Boolean, default: true },
|
|
53
|
+
inline: { type: Boolean, default: false },
|
|
54
|
+
...propsCvCheck,
|
|
55
|
+
...propsCvId,
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
// Track focus
|
|
59
|
+
let hasFocus = ref(false);
|
|
60
|
+
function onFocus() {
|
|
61
|
+
hasFocus = true;
|
|
62
|
+
}
|
|
63
|
+
function onBlur() {
|
|
64
|
+
hasFocus = false;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
const cvId = useCvId(props);
|
|
68
|
+
|
|
69
|
+
const emit = defineEmits(['update:modelValue', 'change']);
|
|
70
|
+
const { onChange, isChecked } = useCheck(toRefs(props), emit);
|
|
71
|
+
</script>
|
|
72
|
+
|
|
73
|
+
<style scoped></style>
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
import { carbonPrefix } from '../../global/settings';
|
|
2
|
+
import {
|
|
3
|
+
sbCompPrefix,
|
|
4
|
+
splitSlotArgs,
|
|
5
|
+
storyParametersObject,
|
|
6
|
+
} from '../../global/storybook-utils';
|
|
7
|
+
import { action } from '@storybook/addon-actions';
|
|
8
|
+
|
|
9
|
+
import { CvCodeSnippet, CvCodeSnippetSkeleton } from '.';
|
|
10
|
+
import CvCodeSnippetConsts from './consts';
|
|
11
|
+
|
|
12
|
+
import './CvCodeSnippet.stories.scss';
|
|
13
|
+
|
|
14
|
+
export default {
|
|
15
|
+
title: `${sbCompPrefix}/CvCodeSnippet`,
|
|
16
|
+
component: CvCodeSnippet,
|
|
17
|
+
argTypes: {
|
|
18
|
+
default: { control: { type: 'text' } },
|
|
19
|
+
kind: {
|
|
20
|
+
control: { type: 'select' },
|
|
21
|
+
options: CvCodeSnippetConsts.codeSnippetKinds,
|
|
22
|
+
defaultValue: CvCodeSnippetConsts.codeSnippetKinds[0],
|
|
23
|
+
table: {
|
|
24
|
+
defaultValue: {
|
|
25
|
+
summary: `'${CvCodeSnippetConsts.codeSnippetKinds[0]}'`,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
const template = `
|
|
33
|
+
<div class="code-snippet-story" :class="{ '${carbonPrefix}--tile': args.light }">
|
|
34
|
+
<small v-if="args.light">
|
|
35
|
+
The snippet container should never be the same color as the page background.<br />
|
|
36
|
+
Do not use the <cv-code-snippet kind="inline" :light="true" :hide-copy-button="true">light</cv-code-snippet> variant on <cv-code-snippet kind="inline" :light="true" :hide-copy-button="true">$ui-background</cv-code-snippet> or <cv-code-snippet kind="inline" :light="true" :hide-copy-button="true">$ui-02</cv-code-snippet>.
|
|
37
|
+
</small>
|
|
38
|
+
<cv-code-snippet v-bind="args" @copy="copy">{{ slotArgs.default }}</cv-code-snippet>
|
|
39
|
+
</div>
|
|
40
|
+
`;
|
|
41
|
+
const Template = argsIn => {
|
|
42
|
+
const { args, slotArgs } = splitSlotArgs(argsIn, ['default']);
|
|
43
|
+
|
|
44
|
+
return {
|
|
45
|
+
components: { CvCodeSnippet },
|
|
46
|
+
setup: () => ({ args, slotArgs, copy: action('copy') }),
|
|
47
|
+
template,
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export const Default = Template.bind({});
|
|
52
|
+
Default.args = {
|
|
53
|
+
kind: CvCodeSnippetConsts.codeSnippetKinds[0],
|
|
54
|
+
default:
|
|
55
|
+
'yarn add carbon-components@latest carbon-components-react@latest @carbon/icons-react@latest carbon-icons@latest',
|
|
56
|
+
ariaLabel: 'Container label',
|
|
57
|
+
};
|
|
58
|
+
Default.parameters = storyParametersObject(
|
|
59
|
+
Default.parameters,
|
|
60
|
+
'<cv-code-snippet v-bind="args" @copy="copy">{{ slotArgs.default }}</cv-code-snippet>',
|
|
61
|
+
Default.args
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
export const Oneline = Template.bind({});
|
|
65
|
+
Oneline.args = {
|
|
66
|
+
kind: CvCodeSnippetConsts.codeSnippetKinds[0],
|
|
67
|
+
default:
|
|
68
|
+
'yarn add carbon-components@latest carbon-components-react@latest @carbon/icons-react@latest carbon-icons@latest',
|
|
69
|
+
ariaLabel: 'Container label',
|
|
70
|
+
};
|
|
71
|
+
Oneline.argTypes = {
|
|
72
|
+
wrapText: { table: { disable: true } },
|
|
73
|
+
lessText: { table: { disable: true } },
|
|
74
|
+
moreText: { table: { disable: true } },
|
|
75
|
+
minCollapsedNumberOfRows: { table: { disable: true } },
|
|
76
|
+
maxCollapsedNumberOfRows: { table: { disable: true } },
|
|
77
|
+
minExpandedNumberOfRows: { table: { disable: true } },
|
|
78
|
+
maxExpandedNumberOfRows: { table: { disable: true } },
|
|
79
|
+
};
|
|
80
|
+
Oneline.parameters = storyParametersObject(
|
|
81
|
+
Oneline.parameters,
|
|
82
|
+
template,
|
|
83
|
+
Oneline.args
|
|
84
|
+
);
|
|
85
|
+
|
|
86
|
+
export const Multiline = Template.bind({});
|
|
87
|
+
Multiline.args = {
|
|
88
|
+
kind: CvCodeSnippetConsts.codeSnippetKinds[1],
|
|
89
|
+
default: `"scripts": {
|
|
90
|
+
"build": "lerna run build --stream --prefix --npm-client yarn",
|
|
91
|
+
"ci-check": "carbon-cli ci-check",
|
|
92
|
+
"clean": "lerna run clean && lerna clean --yes && rimraf node_modules",
|
|
93
|
+
"doctoc": "doctoc --title '## Table of Contents'",
|
|
94
|
+
"format": "prettier --write '**/*.{js,md,scss,ts}' '!**/{build,es,lib,storybook,ts,umd}/**'",
|
|
95
|
+
"format:diff": "prettier --list-different '**/*.{js,md,scss,ts}' '!**/{build,es,lib,storybook,ts,umd}/**' '!packages/components/**'",
|
|
96
|
+
"lint": "eslint actions config codemods packages",
|
|
97
|
+
"lint:styles": "stylelint '**/*.{css,scss}' --report-needless-disables --report-invalid-scope-disables",
|
|
98
|
+
"sync": "carbon-cli sync",
|
|
99
|
+
"test": "cross-env BABEL_ENV=test jest",
|
|
100
|
+
"test:e2e": "cross-env BABEL_ENV=test jest --testPathPattern=e2e --testPathIgnorePatterns='examples,/packages/components/,/packages/react/'"
|
|
101
|
+
},
|
|
102
|
+
"resolutions": {
|
|
103
|
+
"react": "~16.9.0",
|
|
104
|
+
"react-dom": "~16.9.0",
|
|
105
|
+
"react-is": "~16.9.0",
|
|
106
|
+
"react-test-renderer": "~16.9.0"
|
|
107
|
+
},
|
|
108
|
+
"devDependencies": {
|
|
109
|
+
"@babel/core": "^7.10.0",
|
|
110
|
+
"@babel/plugin-proposal-class-properties": "^7.7.4",
|
|
111
|
+
"@babel/plugin-proposal-export-default-from": "^7.7.4",
|
|
112
|
+
"@babel/plugin-proposal-export-namespace-from": "^7.7.4",
|
|
113
|
+
"@babel/plugin-transform-runtime": "^7.10.0",
|
|
114
|
+
"@babel/preset-env": "^7.10.0",
|
|
115
|
+
"@babel/preset-react": "^7.10.0",
|
|
116
|
+
"@babel/runtime": "^7.10.0",
|
|
117
|
+
"@commitlint/cli": "^8.3.5",`,
|
|
118
|
+
};
|
|
119
|
+
Multiline.parameters = storyParametersObject(
|
|
120
|
+
Multiline.parameters,
|
|
121
|
+
template,
|
|
122
|
+
Multiline.args
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
export const Inline = Template.bind({});
|
|
126
|
+
Inline.args = {
|
|
127
|
+
kind: CvCodeSnippetConsts.codeSnippetKinds[2],
|
|
128
|
+
default: 'node -v',
|
|
129
|
+
};
|
|
130
|
+
Inline.argTypes = {
|
|
131
|
+
ariaLabel: { table: { disable: true } },
|
|
132
|
+
wrapText: { table: { disable: true } },
|
|
133
|
+
lessText: { table: { disable: true } },
|
|
134
|
+
moreText: { table: { disable: true } },
|
|
135
|
+
minCollapsedNumberOfRows: { table: { disable: true } },
|
|
136
|
+
maxCollapsedNumberOfRows: { table: { disable: true } },
|
|
137
|
+
minExpandedNumberOfRows: { table: { disable: true } },
|
|
138
|
+
maxExpandedNumberOfRows: { table: { disable: true } },
|
|
139
|
+
};
|
|
140
|
+
Inline.parameters = storyParametersObject(
|
|
141
|
+
Inline.parameters,
|
|
142
|
+
template,
|
|
143
|
+
Inline.args
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
const skeletonTemplate = `
|
|
147
|
+
<div class="code-snippet-story" :class="{ '${carbonPrefix}--tile': args.light }">
|
|
148
|
+
<small v-if="args.light">
|
|
149
|
+
The snippet container should never be the same color as the page background.<br />
|
|
150
|
+
Do not use the <cv-code-snippet kind="inline" :light="true" :hide-copy-button="true">light</cv-code-snippet> variant on <cv-code-snippet kind="inline" :light="true" :hide-copy-button="true">$ui-background</cv-code-snippet> or <cv-code-snippet kind="inline" :light="true" :hide-copy-button="true">$ui-02</cv-code-snippet>.
|
|
151
|
+
</small>
|
|
152
|
+
<cv-code-snippet-skeleton v-bind="args" />
|
|
153
|
+
</div>
|
|
154
|
+
`;
|
|
155
|
+
const SkeletonTemplate = args => ({
|
|
156
|
+
components: { CvCodeSnippet, CvCodeSnippetSkeleton },
|
|
157
|
+
setup: () => ({ args }),
|
|
158
|
+
template: skeletonTemplate,
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
export const Skeleton = SkeletonTemplate.bind({});
|
|
162
|
+
Skeleton.argTypes = {
|
|
163
|
+
kind: { options: CvCodeSnippetConsts.codeSnippetKinds.slice(0, 2) },
|
|
164
|
+
copyFeedback: { table: { disable: true } },
|
|
165
|
+
copyFeedbackTimeout: { table: { disable: true } },
|
|
166
|
+
hideCopyButton: { table: { disable: true } },
|
|
167
|
+
disabled: { table: { disable: true } },
|
|
168
|
+
ariaLabel: { table: { disable: true } },
|
|
169
|
+
wrapText: { table: { disable: true } },
|
|
170
|
+
lessText: { table: { disable: true } },
|
|
171
|
+
moreText: { table: { disable: true } },
|
|
172
|
+
minCollapsedNumberOfRows: { table: { disable: true } },
|
|
173
|
+
maxCollapsedNumberOfRows: { table: { disable: true } },
|
|
174
|
+
minExpandedNumberOfRows: { table: { disable: true } },
|
|
175
|
+
maxExpandedNumberOfRows: { table: { disable: true } },
|
|
176
|
+
};
|
|
177
|
+
Skeleton.parameters = storyParametersObject(
|
|
178
|
+
Skeleton.parameters,
|
|
179
|
+
`<cv-code-snippet-skeleton v-bind="args" />`,
|
|
180
|
+
Skeleton.args
|
|
181
|
+
);
|