@workday/canvas-kit-docs 12.0.0-alpha.862-next.0 → 12.0.0-alpha.899-next.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/dist/es6/docgen/docParser.d.ts +1 -1
- package/dist/es6/docgen/docParser.d.ts.map +1 -1
- package/dist/es6/docgen/docParser.js +12 -2
- package/dist/es6/docgen/docTypes.d.ts +1 -1
- package/dist/es6/docgen/docTypes.d.ts.map +1 -1
- package/dist/es6/docgen/plugins/enhancedComponentParser.d.ts +1 -1
- package/dist/es6/docgen/plugins/enhancedComponentParser.d.ts.map +1 -1
- package/dist/es6/docgen/traverse.d.ts +2 -2
- package/dist/es6/docgen/traverse.d.ts.map +1 -1
- package/dist/es6/index.d.ts +1 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -0
- package/dist/es6/lib/ExampleCodeBlock.d.ts +3 -0
- package/dist/es6/lib/ExampleCodeBlock.d.ts.map +1 -0
- package/dist/es6/lib/ExampleCodeBlock.js +93 -0
- package/dist/es6/lib/InformationHighlight/Base.js +1 -1
- package/dist/es6/lib/InformationHighlight/Body.js +1 -1
- package/dist/es6/lib/InformationHighlight/Heading.js +1 -1
- package/dist/es6/lib/InformationHighlight/Icon.d.ts +1 -1
- package/dist/es6/lib/InformationHighlight/Icon.d.ts.map +1 -1
- package/dist/es6/lib/InformationHighlight/Icon.js +1 -1
- package/dist/es6/lib/InformationHighlight/Link.js +1 -1
- package/dist/es6/lib/InformationHighlight/index.d.ts +1 -1
- package/dist/es6/lib/InformationHighlight/index.d.ts.map +1 -1
- package/dist/es6/lib/InformationHighlight/index.js +1 -1
- package/dist/es6/lib/InformationHighlight/modelHook.d.ts +1 -1
- package/dist/es6/lib/InformationHighlight/modelHook.d.ts.map +1 -1
- package/dist/es6/lib/MDXElements.d.ts +2 -1
- package/dist/es6/lib/MDXElements.d.ts.map +1 -1
- package/dist/es6/lib/MDXElements.js +1 -1
- package/dist/es6/lib/MoreTooltip.d.ts +1 -1
- package/dist/es6/lib/MoreTooltip.d.ts.map +1 -1
- package/dist/es6/lib/MoreTooltip.js +2 -2
- package/dist/es6/lib/Specifications.d.ts +2 -1
- package/dist/es6/lib/Specifications.d.ts.map +1 -1
- package/dist/es6/lib/StylePropsTable.d.ts +3 -2
- package/dist/es6/lib/StylePropsTable.d.ts.map +1 -1
- package/dist/es6/lib/Table.js +6 -6
- package/dist/es6/lib/Value.d.ts +3 -3
- package/dist/es6/lib/Value.d.ts.map +1 -1
- package/dist/es6/lib/Value.js +4 -2
- package/dist/es6/lib/docs.d.ts +3 -3
- package/dist/es6/lib/docs.d.ts.map +1 -1
- package/dist/es6/lib/docs.js +76923 -72365
- package/dist/es6/lib/specs.js +1 -7130
- package/dist/es6/lib/widgetUtils.d.ts +5 -5
- package/dist/es6/lib/widgetUtils.d.ts.map +1 -1
- package/dist/es6/lib/widgetUtils.js +2 -2
- package/dist/es6/mdx/installBlock.d.ts +2 -1
- package/dist/es6/mdx/installBlock.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Background.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Background.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Background.js +6 -4
- package/dist/es6/mdx/style-props/examples/Border.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Border.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Border.js +4 -4
- package/dist/es6/mdx/style-props/examples/Color.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Color.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Color.js +4 -4
- package/dist/es6/mdx/style-props/examples/Depth.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Depth.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Depth.js +4 -4
- package/dist/es6/mdx/style-props/examples/Flex.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Flex.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Flex.js +9 -9
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/FlexItem.js +9 -9
- package/dist/es6/mdx/style-props/examples/Grid.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Grid.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Grid.js +4 -4
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/GridItem.js +5 -5
- package/dist/es6/mdx/style-props/examples/Layout.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Layout.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Layout.js +4 -4
- package/dist/es6/mdx/style-props/examples/Other.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Other.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Other.js +4 -4
- package/dist/es6/mdx/style-props/examples/Position.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Position.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Position.js +4 -4
- package/dist/es6/mdx/style-props/examples/Space.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Space.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Space.js +4 -4
- package/dist/es6/mdx/style-props/examples/Text.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Text.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Text.js +1 -1
- package/dist/es6/mdx/versionsTable.d.ts +2 -1
- package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.d.ts +2 -1
- package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.js +5 -3
- package/dist/mdx/11.0-UPGRADE-GUIDE.mdx +8 -8
- package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +350 -39
- package/dist/mdx/4.0-UPGRADE-GUIDE.mdx +1 -11
- package/dist/mdx/5.0-UPGRADE-GUIDE.mdx +0 -10
- package/dist/mdx/6.0-UPGRADE-GUIDE.mdx +0 -10
- package/dist/mdx/7.0-UPGRADE-GUIDE.mdx +0 -10
- package/dist/mdx/8.0-UPGRADE-GUIDE.mdx +0 -10
- package/dist/mdx/API_PATTERN_GUIDELINES.mdx +0 -10
- package/dist/mdx/COMPOUND_COMPONENTS.mdx +0 -10
- package/dist/mdx/CONTRIBUTING.mdx +0 -10
- package/dist/mdx/CREATING_COMPOUND_COMPONENTS.mdx +0 -10
- package/dist/mdx/DOCUMENTATION_GUIDELINES.mdx +20 -22
- package/dist/mdx/GETTING_STARTED.mdx +0 -9
- package/dist/mdx/MAINTAINING.mdx +12 -20
- package/dist/mdx/TESTING.mdx +1 -26
- package/dist/mdx/changelog.mdx +5 -0
- package/dist/mdx/labs-react/combobox/Combobox.mdx +52 -0
- package/dist/mdx/labs-react/combobox/examples/Basic.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/DisabledItem.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/GroupOfResult.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/Grow.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/NoClearButton.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/RTL.tsx +90 -0
- package/dist/mdx/labs-react/expandable/Expandable.mdx +1 -3
- package/dist/mdx/labs-react/search-form/SearchForm.mdx +1 -4
- package/dist/mdx/preview-react/_examples/mdx/Forms.mdx +9 -0
- package/dist/mdx/preview-react/_examples/mdx/FormsWithFormik.mdx +14 -0
- package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/SelectWithFormik.tsx +1 -5
- package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/TextInputWithReactHookForm.tsx +2 -1
- package/dist/mdx/preview-react/divider/Divider.mdx +36 -0
- package/dist/mdx/preview-react/divider/examples/Basic.tsx +105 -0
- package/dist/mdx/preview-react/divider/examples/CustomSpace.tsx +32 -0
- package/dist/mdx/preview-react/loading-sparkles/LoadingSparkles.mdx +1 -2
- package/dist/mdx/preview-react/menu/Menu.mdx +2 -9
- package/dist/mdx/preview-react/pill/Pill.mdx +1 -3
- package/dist/mdx/preview-react/radio/Radio.mdx +1 -3
- package/dist/mdx/preview-react/radio/examples/Alert.tsx +26 -11
- package/dist/mdx/preview-react/radio/examples/Basic.tsx +29 -19
- package/dist/mdx/preview-react/radio/examples/Custom.tsx +32 -30
- package/dist/mdx/preview-react/radio/examples/Disabled.tsx +25 -12
- package/dist/mdx/preview-react/radio/examples/Error.tsx +26 -11
- package/dist/mdx/preview-react/radio/examples/Inverse.tsx +14 -18
- package/dist/mdx/preview-react/radio/examples/LabelPosition.tsx +25 -10
- package/dist/mdx/preview-react/radio/examples/NoValue.tsx +23 -10
- package/dist/mdx/preview-react/radio/examples/RefForwarding.tsx +17 -11
- package/dist/mdx/preview-react/radio/examples/Required.tsx +19 -11
- package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +6 -6
- package/dist/mdx/preview-react/segmented-control/SegmentedControl.mdx +1 -4
- package/dist/mdx/preview-react/select/Select.mdx +89 -0
- package/dist/mdx/preview-react/select/examples/Left Label/AlertLeft.tsx +18 -0
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultLeft.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithCustomOptionsLeft.tsx +25 -0
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithSimpleOptionsLeft.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Left Label/DisabledLeft.tsx +19 -0
- package/dist/mdx/preview-react/select/examples/Left Label/ErrorLeft.tsx +18 -0
- package/dist/mdx/preview-react/select/examples/Left Label/GrowLeft.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Left Label/ScrollableLeft.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Left Label/index.ts +8 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +18 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Default.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithCustomOptions.tsx +25 -0
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithSimpleOptions.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Disabled.tsx +19 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Error.tsx +18 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Grow.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Scrollable.tsx +15 -0
- package/dist/mdx/preview-react/select/examples/Top Label/index.ts +8 -0
- package/dist/mdx/preview-react/select/examples/storiesData.tsx +93 -0
- package/dist/mdx/preview-react/side-panel/SidePanel.mdx +1 -4
- package/dist/mdx/preview-react/status-indicator/StatusIndicator.mdx +1 -2
- package/dist/mdx/preview-react/text-area/TextArea.mdx +1 -4
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -1
- package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +1 -1
- package/dist/mdx/preview-react/text-input/TextInput.mdx +4 -7
- package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +1 -1
- package/dist/mdx/react/_examples/{AriaLiveRegions.mdx → mdx/AriaLiveRegions.mdx} +1 -0
- package/dist/mdx/react/_examples/{CompoundComponent.mdx → mdx/CompoundComponent.mdx} +2 -0
- package/dist/mdx/react/_examples/mdx/CookieBanner.mdx +9 -0
- package/dist/mdx/react/_examples/mdx/Density.mdx +11 -0
- package/dist/mdx/react/_examples/mdx/Headers.mdx +19 -0
- package/dist/mdx/react/_examples/{Layouts.mdx → mdx/Layouts.mdx} +1 -0
- package/dist/mdx/react/_examples/{MediaModal.mdx → mdx/MediaModal.mdx} +3 -2
- package/dist/mdx/react/_examples/{SearchForm.mdx → mdx/SearchForm.mdx} +1 -0
- package/dist/mdx/react/_examples/{SidePanel.mdx → mdx/SidePanel.mdx} +2 -1
- package/dist/mdx/react/_examples/{TablesAdvanced.mdx → mdx/TablesAdvanced.mdx} +5 -5
- package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/FilterListWithLiveStatus.tsx +1 -1
- package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/HiddenLiveRegion.tsx +1 -1
- package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/TextInputWithLiveError.tsx +1 -1
- package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/VisibleLiveRegion.tsx +1 -1
- package/dist/mdx/react/_examples/mdx/examples/Density.tsx +370 -0
- package/dist/mdx/react/_examples/{examples → mdx/examples}/SidePanelWithNavigation.tsx +0 -1
- package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithExpandableRows.tsx +26 -29
- package/dist/mdx/react/_examples/mdx/examples/common/FilterListWithLiveStatus.tsx +65 -0
- package/dist/mdx/react/_examples/mdx/examples/common/HiddenLiveRegion.tsx +30 -0
- package/dist/mdx/react/_examples/mdx/examples/common/IconButtonsWithLiveBadges.tsx +98 -0
- package/dist/mdx/react/_examples/mdx/examples/common/TextInputWithLiveError.tsx +25 -0
- package/dist/mdx/react/_examples/mdx/examples/common/VisibleLiveRegion.tsx +40 -0
- package/dist/mdx/react/action-bar/ActionBar.mdx +1 -5
- package/dist/mdx/react/action-bar/examples/Basic.tsx +12 -10
- package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +13 -10
- package/dist/mdx/react/action-bar/examples/index.ts +5 -0
- package/dist/mdx/react/avatar/avatar/Avatar.mdx +12 -10
- package/dist/mdx/react/avatar/avatar/examples/Button.tsx +1 -1
- package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +2 -2
- package/dist/mdx/react/avatar/avatar/examples/Image.tsx +1 -1
- package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +1 -1
- package/dist/mdx/react/avatar/avatar/examples/test-avatar.png +0 -0
- package/dist/mdx/react/badge/CountBadge.mdx +15 -18
- package/dist/mdx/react/badge/examples/NotificationBadge.tsx +30 -25
- package/dist/mdx/react/banner/Banner.mdx +3 -5
- package/dist/mdx/react/breadcrumbs/Breadcrumbs.mdx +1 -5
- package/dist/mdx/react/button/button/Button.mdx +6 -1
- package/dist/mdx/react/button/button/Hyperlink.mdx +1 -4
- package/dist/mdx/react/button/button/examples/CustomStyles.tsx +21 -7
- package/dist/mdx/react/button/button/examples/Delete.tsx +1 -1
- package/dist/mdx/react/button/button/examples/Primary.tsx +1 -1
- package/dist/mdx/react/card/card.mdx +3 -4
- package/dist/mdx/react/checkbox/Checkbox.mdx +6 -17
- package/dist/mdx/react/checkbox/examples/Alert.tsx +5 -4
- package/dist/mdx/react/checkbox/examples/Basic.tsx +14 -1
- package/dist/mdx/react/checkbox/examples/Disabled.tsx +13 -6
- package/dist/mdx/react/checkbox/examples/Error.tsx +5 -4
- package/dist/mdx/react/checkbox/examples/Inverse.tsx +0 -1
- package/dist/mdx/react/checkbox/examples/LabelPosition.tsx +11 -9
- package/dist/mdx/react/checkbox/examples/RefForwarding.tsx +21 -7
- package/dist/mdx/react/checkbox/examples/Required.tsx +10 -8
- package/dist/mdx/react/collection/{Collection.mdx → mdx/Collection.mdx} +1 -3
- package/dist/mdx/react/color-picker/color-input/ColorInput.mdx +6 -18
- package/dist/mdx/react/color-picker/color-input/examples/Alert.tsx +5 -3
- package/dist/mdx/react/color-picker/color-input/examples/Basic.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/Checked.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/Error.tsx +5 -3
- package/dist/mdx/react/color-picker/color-input/examples/Grow.tsx +9 -2
- package/dist/mdx/react/color-picker/color-input/examples/LabelPosition.tsx +5 -3
- package/dist/mdx/react/color-picker/color-input/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/Required.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/ValidColorChange.tsx +9 -7
- package/dist/mdx/react/color-picker/color-preview/ColorPreview.mdx +6 -17
- package/dist/mdx/react/color-picker/color-preview/examples/Basic.tsx +9 -1
- package/dist/mdx/react/color-picker/color-preview/examples/LabelPosition.tsx +5 -3
- package/dist/mdx/react/color-picker/color-preview/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/combobox/Combobox.mdx +1 -4
- package/dist/mdx/react/combobox/examples/Autocomplete.tsx +32 -30
- package/dist/mdx/react/common/{CompoundComponentUtilities.mdx → mdx/CompoundComponentUtilities.mdx} +2 -1
- package/dist/mdx/react/common/{Responsive.mdx → mdx/Responsive.mdx} +2 -2
- package/dist/mdx/react/common/{examples → mdx/examples}/ResponsiveStyles.tsx +1 -1
- package/dist/mdx/react/dialog/Dialog.mdx +1 -4
- package/dist/mdx/react/dialog/examples/Basic.tsx +1 -1
- package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +110 -0
- package/dist/mdx/react/dialog/examples/Focus.tsx +1 -1
- package/dist/mdx/react/form-field/FormField.mdx +104 -78
- package/dist/mdx/react/form-field/examples/Alert.tsx +11 -9
- package/dist/mdx/{preview-react → react}/form-field/examples/AllFields.tsx +43 -8
- package/dist/mdx/react/form-field/examples/Basic.tsx +9 -4
- package/dist/mdx/{preview-react → react}/form-field/examples/Custom.tsx +2 -2
- package/dist/mdx/{preview-react → react}/form-field/examples/CustomId.tsx +4 -2
- package/dist/mdx/{preview-react → react}/form-field/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/form-field/examples/Error.tsx +12 -9
- package/dist/mdx/react/form-field/examples/GroupedInputs.tsx +207 -0
- package/dist/mdx/react/form-field/examples/Grow.tsx +7 -3
- package/dist/mdx/react/form-field/examples/Hint.tsx +11 -8
- package/dist/mdx/react/form-field/examples/LabelPositionHorizontalEnd.tsx +32 -0
- package/dist/mdx/react/form-field/examples/LabelPositionHorizontalStart.tsx +32 -0
- package/dist/mdx/{preview-react → react}/form-field/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/form-field/examples/Required.tsx +11 -3
- package/dist/mdx/{preview-react → react}/form-field/examples/ThemedErrors.tsx +7 -5
- package/dist/mdx/react/icon/Assets.mdx +13 -6
- package/dist/mdx/react/icon/examples/AccentIconList.tsx +1 -1
- package/dist/mdx/react/layout/Box.mdx +1 -3
- package/dist/mdx/react/layout/Flex.mdx +8 -7
- package/dist/mdx/react/layout/Grid.mdx +2 -4
- package/dist/mdx/react/loading-dots/LoadingDots.mdx +1 -3
- package/dist/mdx/react/menu/Menu.mdx +1 -4
- package/dist/mdx/react/menu/examples/MenuWithFallbackPlacements.tsx +66 -0
- package/dist/mdx/react/modal/Modal.mdx +1 -4
- package/dist/mdx/react/modal/examples/CustomFocus.tsx +1 -1
- package/dist/mdx/react/modal/examples/FormModal.tsx +1 -1
- package/dist/mdx/react/modal/examples/IframeTest.tsx +26 -0
- package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +66 -0
- package/dist/mdx/react/modal/examples/ReturnFocus.tsx +1 -1
- package/dist/mdx/react/modal/examples/StackedModals.tsx +56 -0
- package/dist/mdx/react/modal/examples/WithRadioButtons.tsx +30 -0
- package/dist/mdx/react/modal/examples/WithTooltips.tsx +74 -0
- package/dist/mdx/react/pagination/pagination.mdx +1 -5
- package/dist/mdx/react/popup/Popup.mdx +30 -6
- package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +54 -0
- package/dist/mdx/react/popup/examples/ComboboxWithinPopup.tsx +48 -0
- package/dist/mdx/react/popup/examples/MixedPopupTypes.tsx +143 -0
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +82 -0
- package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +42 -0
- package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +68 -0
- package/dist/mdx/react/popup/examples/TooltipReturnFocus.tsx +36 -0
- package/dist/mdx/react/radio/Radio.mdx +6 -16
- package/dist/mdx/react/radio/examples/Alert.tsx +1 -1
- package/dist/mdx/react/radio/examples/Basic.tsx +1 -1
- package/dist/mdx/react/radio/examples/Disabled.tsx +1 -1
- package/dist/mdx/react/radio/examples/Error.tsx +1 -1
- package/dist/mdx/react/radio/examples/LabelPosition.tsx +2 -2
- package/dist/mdx/react/radio/examples/NoValue.tsx +2 -2
- package/dist/mdx/react/radio/examples/RefForwarding.tsx +1 -1
- package/dist/mdx/react/radio/examples/Required.tsx +1 -1
- package/dist/mdx/react/segmented-control/SegmentedControl.mdx +1 -5
- package/dist/mdx/react/select/Select.mdx +18 -28
- package/dist/mdx/react/select/examples/Alert.tsx +15 -13
- package/dist/mdx/react/select/examples/Basic.tsx +18 -16
- package/dist/mdx/react/select/examples/Complex.tsx +14 -12
- package/dist/mdx/react/select/examples/Disabled.tsx +21 -19
- package/dist/mdx/react/select/examples/DisabledOption.tsx +24 -22
- package/dist/mdx/react/select/examples/Error.tsx +21 -19
- package/dist/mdx/react/select/examples/FetchingDynamicItems.tsx +23 -19
- package/dist/mdx/react/select/examples/Grow.tsx +14 -12
- package/dist/mdx/react/select/examples/HoistedModel.tsx +14 -12
- package/dist/mdx/react/select/examples/InitialSelectedItem.tsx +18 -15
- package/dist/mdx/react/select/examples/LabelPosition.tsx +15 -12
- package/dist/mdx/react/select/examples/MenuHeight.tsx +11 -9
- package/dist/mdx/react/select/examples/Placeholder.tsx +17 -14
- package/dist/mdx/react/select/examples/RefForwarding.tsx +13 -10
- package/dist/mdx/react/select/examples/Required.tsx +12 -10
- package/dist/mdx/react/select/examples/WithIcons.tsx +25 -23
- package/dist/mdx/react/skeleton/Skeleton.mdx +1 -5
- package/dist/mdx/react/skeleton/examples/Simulation.tsx +3 -3
- package/dist/mdx/react/status-indicator/StatusIndicator.mdx +5 -8
- package/dist/mdx/react/switch/Switch.mdx +6 -17
- package/dist/mdx/react/switch/examples/Alert.tsx +5 -3
- package/dist/mdx/react/switch/examples/Basic.tsx +4 -2
- package/dist/mdx/react/switch/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/switch/examples/Error.tsx +5 -3
- package/dist/mdx/react/switch/examples/LabelPosition.tsx +5 -3
- package/dist/mdx/react/switch/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/table/Table.mdx +1 -4
- package/dist/mdx/react/tabs/Tabs.mdx +1 -4
- package/dist/mdx/react/testing/Testing.mdx +1 -4
- package/dist/mdx/react/text/BodyText.mdx +1 -3
- package/dist/mdx/react/text/Heading.mdx +1 -3
- package/dist/mdx/react/text/LabelText.mdx +1 -3
- package/dist/mdx/react/text/Subtext.mdx +1 -3
- package/dist/mdx/react/text/Text.mdx +1 -3
- package/dist/mdx/react/text/Title.mdx +1 -3
- package/dist/mdx/react/text-area/TextArea.mdx +6 -17
- package/dist/mdx/react/text-area/examples/Alert.tsx +5 -3
- package/dist/mdx/react/text-area/examples/Basic.tsx +4 -2
- package/dist/mdx/react/text-area/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/text-area/examples/Error.tsx +5 -3
- package/dist/mdx/react/text-area/examples/Grow.tsx +6 -4
- package/dist/mdx/react/text-area/examples/LabelPosition.tsx +6 -3
- package/dist/mdx/react/text-area/examples/Placeholder.tsx +9 -7
- package/dist/mdx/react/text-area/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/text-area/examples/Required.tsx +4 -2
- package/dist/mdx/react/text-area/examples/ResizeConstraints.tsx +9 -7
- package/dist/mdx/react/text-input/TextInput.mdx +7 -16
- package/dist/mdx/react/text-input/examples/Alert.tsx +5 -3
- package/dist/mdx/react/text-input/examples/Basic.tsx +5 -3
- package/dist/mdx/react/text-input/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/text-input/examples/Error.tsx +5 -3
- package/dist/mdx/react/text-input/examples/Grow.tsx +5 -3
- package/dist/mdx/react/text-input/examples/Icons.tsx +4 -2
- package/dist/mdx/react/text-input/examples/LabelPosition.tsx +6 -3
- package/dist/mdx/react/text-input/examples/Placeholder.tsx +9 -7
- package/dist/mdx/react/text-input/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/text-input/examples/Required.tsx +4 -2
- package/dist/mdx/react/toast/toast.mdx +5 -6
- package/dist/mdx/react/tokens/Tokens.mdx +1 -2
- package/dist/mdx/react/tooltip/Tooltip.mdx +1 -5
- package/dist/mdx/style-props/STYLE_PROPS.mdx +25 -25
- package/dist/mdx/style-props/examples/Background.tsx +15 -22
- package/dist/mdx/style-props/examples/Border.tsx +3 -18
- package/dist/mdx/style-props/examples/Color.tsx +9 -21
- package/dist/mdx/style-props/examples/Flex.tsx +27 -9
- package/dist/mdx/style-props/examples/FlexItem.tsx +24 -8
- package/dist/mdx/style-props/examples/Position.tsx +1 -1
- package/dist/mdx/style-props/examples/Space.tsx +9 -3
- package/dist/mdx/welcome.mdx +48 -0
- package/index.ts +1 -0
- package/lib/ExampleCodeBlock.tsx +134 -0
- package/lib/MDXElements.tsx +2 -1
- package/lib/Value.tsx +5 -3
- package/package.json +9 -8
- package/dist/mdx/changelog.stories.mdx +0 -14
- package/dist/mdx/preview-react/_examples/SelectWithFormik.mdx +0 -8
- package/dist/mdx/preview-react/_examples/TextInputWithFormik.mdx +0 -8
- package/dist/mdx/preview-react/_examples/TextInputWithReactHookForm.mdx +0 -8
- package/dist/mdx/preview-react/form-field/FormField.mdx +0 -149
- package/dist/mdx/preview-react/form-field/examples/Alert.tsx +0 -24
- package/dist/mdx/preview-react/form-field/examples/Basic.tsx +0 -21
- package/dist/mdx/preview-react/form-field/examples/Error.tsx +0 -25
- package/dist/mdx/preview-react/form-field/examples/FieldSet.tsx +0 -29
- package/dist/mdx/preview-react/form-field/examples/Grow.tsx +0 -21
- package/dist/mdx/preview-react/form-field/examples/Hint.tsx +0 -25
- package/dist/mdx/preview-react/form-field/examples/LabelPositionHorizontal.tsx +0 -18
- package/dist/mdx/preview-react/form-field/examples/Required.tsx +0 -23
- package/dist/mdx/react/_examples/CookieBanner.mdx +0 -8
- package/dist/mdx/react/_examples/GlobalHeader.mdx +0 -12
- package/dist/mdx/react/_examples/PageHeader.mdx +0 -8
- package/dist/mdx/react/form-field/examples/AlertLabel.tsx +0 -23
- package/dist/mdx/react/form-field/examples/CustomInputId.tsx +0 -17
- package/dist/mdx/react/form-field/examples/ErrorLabel.tsx +0 -23
- package/dist/mdx/react/form-field/examples/GroupingInputs.tsx +0 -22
- package/dist/mdx/react/form-field/examples/LabelPosition.tsx +0 -17
- package/dist/mdx/welcome.stories.mdx +0 -35
- /package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/TextInputWithFormik.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/IconButtonsWithLiveBadges.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/CookieBanner.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/GlobalHeader.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/MediaModal.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/PageHeader.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/SearchFormBasic.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/SegmentControlWithText.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/SidePanelWithOverlay.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithSelectableRows.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithSortableColumnHeaders.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/compoundComponent/CustomCard.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/AreaColumnPositioning.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/CustomColumnPositioning.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/CustomColumnWidth.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/FullWidthWith3Columns.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/FullWidthWith3Columns2Rows.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Masonry.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/ResponsiveColumns.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Tiled2and3Columns.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Tiled4and2Columns.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/Basic.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/BasicGrid.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/BasicVirtual.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/DataLoader.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/DynamicItemsObjects.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/DynamicItemsStrings.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/IdentifiedItems.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/MultiSelection.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/RovingFocus.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/Selection.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/StringChildren.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/Virtualization.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/WrappingGrid.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateComponent.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateContainer.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateElemPropsHook.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateModelHook.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateSubcomponent.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/ResponsiveViewport.tsx +0 -0
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
<Meta
|
|
2
|
-
title="Guides/Documentation Guidelines"
|
|
3
|
-
parameters={{
|
|
4
|
-
viewMode: 'docs',
|
|
5
|
-
previewTabs: {
|
|
6
|
-
canvas: {hidden: true},
|
|
7
|
-
},
|
|
8
|
-
}}
|
|
9
|
-
/>
|
|
10
|
-
|
|
11
1
|
# Documentation Guidelines
|
|
12
2
|
|
|
13
3
|
## Introduction
|
|
@@ -44,18 +34,21 @@ Import components which will be used to render documentation in the MDX file.
|
|
|
44
34
|
The Specifications import is optional; only include it if the Specifications
|
|
45
35
|
section exists (see below).
|
|
46
36
|
-->
|
|
37
|
+
|
|
47
38
|
import {Specifications, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
48
39
|
|
|
49
40
|
<!--
|
|
50
41
|
Import the component so we can pass it into the Storybook Meta tag (see
|
|
51
42
|
below).
|
|
52
43
|
-->
|
|
44
|
+
|
|
53
45
|
import {[Component]} from '@workday/canvas-kit-[preview-|labs-]react/[component]';
|
|
54
46
|
|
|
55
|
-
<!--
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
47
|
+
<!--
|
|
48
|
+
MDX file should refer to *.stories.ts/js file with CSF stories
|
|
49
|
+
-->
|
|
50
|
+
|
|
51
|
+
import \* as ComponentStories from './Component.stories'
|
|
59
52
|
|
|
60
53
|
<!--
|
|
61
54
|
Use the Storybook Meta tag to designate where to display the component in the
|
|
@@ -81,12 +74,14 @@ to include for a given component. Try to include enough examples to illustrate
|
|
|
81
74
|
all common use cases and anything which may not be obvious based on the
|
|
82
75
|
component API.
|
|
83
76
|
-->
|
|
77
|
+
|
|
84
78
|
## Usage
|
|
85
79
|
|
|
86
80
|
<!--
|
|
87
81
|
Every component should have a basic example as its first example in the Usage
|
|
88
82
|
section. Title the section "Basic Example" for consistency.
|
|
89
83
|
-->
|
|
84
|
+
|
|
90
85
|
### Basic Example
|
|
91
86
|
|
|
92
87
|
Description of the Basic Example.
|
|
@@ -101,6 +96,7 @@ along with its associated code.
|
|
|
101
96
|
Feel free to include supplemental or follow-up information about the example
|
|
102
97
|
underneath the ExampleCodeBlock (if necessary).
|
|
103
98
|
-->
|
|
99
|
+
|
|
104
100
|
More information about the Basic Example.
|
|
105
101
|
|
|
106
102
|
### Another Example
|
|
@@ -117,6 +113,7 @@ the component's JSDocs. This includes descriptions and props tables for the
|
|
|
117
113
|
component, as well as its subcomponents if it's a compound component.
|
|
118
114
|
Documentation for the model will also be included if the component has a model.
|
|
119
115
|
-->
|
|
116
|
+
|
|
120
117
|
## Component API
|
|
121
118
|
|
|
122
119
|
<!--
|
|
@@ -130,6 +127,7 @@ The Specifications section is optional. Only include it if the component has
|
|
|
130
127
|
Cypress integration tests (i.e., a spec.ts file in the cypress/integration
|
|
131
128
|
folder).
|
|
132
129
|
-->
|
|
130
|
+
|
|
133
131
|
## Specifications
|
|
134
132
|
|
|
135
133
|
<Specifications file="[Component].spec.ts" name="[Component]" />
|
|
@@ -150,17 +148,11 @@ you'll then follow the same document structure defined above with slight modific
|
|
|
150
148
|
|
|
151
149
|
````md
|
|
152
150
|
<!-- Only import SymbolDescription if necessary (see below) -->
|
|
151
|
+
|
|
153
152
|
import {Specifications, SymbolDoc, SymbolDescription} from '@workday/canvas-kit-docs';
|
|
154
153
|
|
|
155
|
-
|
|
156
|
-
import Component1Example from './examples/Component1Example';
|
|
157
|
-
import Component2Example from './examples/Component2Example';
|
|
158
|
-
import ...
|
|
154
|
+
import \* as ComponentFamilyStories from './Component.stories'
|
|
159
155
|
|
|
160
|
-
<!--
|
|
161
|
-
We are unable to use the component prop here since a component family
|
|
162
|
-
represents multiple components.
|
|
163
|
-
-->
|
|
164
156
|
|
|
165
157
|
# Canvas Kit [ComponentFamily]
|
|
166
158
|
|
|
@@ -178,11 +170,13 @@ component family will not have a Basic Example. Instead, it will have one
|
|
|
178
170
|
section for each component in the family; each section will contain one or
|
|
179
171
|
more examples for that particular component.
|
|
180
172
|
-->
|
|
173
|
+
|
|
181
174
|
## Usage
|
|
182
175
|
|
|
183
176
|
<!--
|
|
184
177
|
Each section is named after the component.
|
|
185
178
|
-->
|
|
179
|
+
|
|
186
180
|
### Component1
|
|
187
181
|
|
|
188
182
|
<!--
|
|
@@ -204,6 +198,7 @@ More information about Component1Example.
|
|
|
204
198
|
If necessary, you may add more examples for a single component within that
|
|
205
199
|
component's Usage section.
|
|
206
200
|
-->
|
|
201
|
+
|
|
207
202
|
#### Another Component1 Example
|
|
208
203
|
|
|
209
204
|
### Component2
|
|
@@ -218,6 +213,7 @@ Description of Component2Example.
|
|
|
218
213
|
You may include more examples at the end of the Usage section for examples
|
|
219
214
|
which are not comopnent-specific and apply to every component in the family.
|
|
220
215
|
-->
|
|
216
|
+
|
|
221
217
|
### More Examples...
|
|
222
218
|
|
|
223
219
|
<!--
|
|
@@ -225,6 +221,7 @@ Unlike the Component API section for a single component, the Component API
|
|
|
225
221
|
section for a component family will include multiple SymbolDocs, one for each
|
|
226
222
|
component in the family.
|
|
227
223
|
-->
|
|
224
|
+
|
|
228
225
|
## Component API
|
|
229
226
|
|
|
230
227
|
<SymbolDoc name="[Component1]" fileName="/[preview-|labs-]react/" />
|
|
@@ -235,6 +232,7 @@ component in the family.
|
|
|
235
232
|
Typically, all components within a family will share the same specifications
|
|
236
233
|
file.
|
|
237
234
|
-->
|
|
235
|
+
|
|
238
236
|
## Specifications
|
|
239
237
|
|
|
240
238
|
<Specifications file="[ComponentFamily].spec.ts" name="[ComponentFamily]" />
|
|
@@ -1,14 +1,5 @@
|
|
|
1
1
|
import Readme from '../../../README.md';
|
|
2
2
|
import Markdown from '../../../utils/storybook/Markdown.tsx';
|
|
3
3
|
|
|
4
|
-
<Meta
|
|
5
|
-
title="Guides/Getting Started"
|
|
6
|
-
parameters={{
|
|
7
|
-
viewMode: 'docs',
|
|
8
|
-
previewTabs: {
|
|
9
|
-
canvas: {hidden: true},
|
|
10
|
-
},
|
|
11
|
-
}}
|
|
12
|
-
/>
|
|
13
4
|
|
|
14
5
|
<Markdown content={Readme} />
|
package/dist/mdx/MAINTAINING.mdx
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
<Meta
|
|
2
|
-
title="Guides/Maintaining"
|
|
3
|
-
parameters={{
|
|
4
|
-
viewMode: 'docs',
|
|
5
|
-
previewTabs: {
|
|
6
|
-
canvas: {hidden: true},
|
|
7
|
-
},
|
|
8
|
-
}}
|
|
9
|
-
/>
|
|
10
|
-
|
|
11
1
|
# Maintaining Canvas Kit
|
|
12
2
|
|
|
13
3
|
If you're a Canvas Kit core maintainer, this doc is for you! Consider this a field guide to help you
|
|
@@ -274,6 +264,10 @@ We use codemods to reduce friction for consumers as they make changes and do upg
|
|
|
274
264
|
accompany major version releases since v5, and can also be released in minor releases if users want
|
|
275
265
|
to apply some changes sooner.
|
|
276
266
|
|
|
267
|
+
> **Note: In v12, we have done some infrastructure updates with moving to Webpack 5 and Storybook 7. With
|
|
268
|
+
these updates has come some formatting issues after running our codemods. We recommend running a
|
|
269
|
+
formatter to address the format issues that have been introduced in v12.**
|
|
270
|
+
|
|
277
271
|
### Add a New Codemod
|
|
278
272
|
|
|
279
273
|
Adding a new codemod is pretty straightforward, but this guide will make sure you don't miss any
|
|
@@ -356,13 +350,10 @@ write.
|
|
|
356
350
|
// modules/codemod/v10/spec/expectTransformFactory.spec.ts
|
|
357
351
|
import {runInlineTest} from 'jscodeshift/dist/testUtils';
|
|
358
352
|
|
|
359
|
-
export const expectTransformFactory =
|
|
360
|
-
input: string,
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
) => {
|
|
364
|
-
return runInlineTest(fn, options, {source: input}, expected, {parser: 'tsx'});
|
|
365
|
-
};
|
|
353
|
+
export const expectTransformFactory =
|
|
354
|
+
(fn: Function) => (input: string, expected: string, options?: Record<string, any>) => {
|
|
355
|
+
return runInlineTest(fn, options, {source: input}, expected, {parser: 'tsx'});
|
|
356
|
+
};
|
|
366
357
|
```
|
|
367
358
|
|
|
368
359
|
```ts
|
|
@@ -454,8 +445,9 @@ Finally, be sure to notify users of the deprecation in the corresponding
|
|
|
454
445
|
|
|
455
446
|
### ${Deprecated Name}
|
|
456
447
|
|
|
457
|
-
**PR:** [#${PR number where the deprecation took
|
|
448
|
+
**PR:** [#${PR number where the deprecation took
|
|
449
|
+
place}](https://github.com/Workday/canvas-kit/pull/${PR number})
|
|
458
450
|
|
|
459
|
-
We've deprecated ${Deprecated Name} ${Optional: Include package name to disambiguate (e.g., "from
|
|
460
|
-
migration strategy}
|
|
451
|
+
We've deprecated ${Deprecated Name} ${Optional: Include package name to disambiguate (e.g., "from
|
|
452
|
+
Labs")} ${Provide a migration strategy}
|
|
461
453
|
```
|
package/dist/mdx/TESTING.mdx
CHANGED
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
<Meta
|
|
2
|
-
title="Guides/Testing"
|
|
3
|
-
parameters={{
|
|
4
|
-
viewMode: 'docs',
|
|
5
|
-
previewTabs: {
|
|
6
|
-
canvas: {hidden: true},
|
|
7
|
-
},
|
|
8
|
-
}}
|
|
9
|
-
/>
|
|
10
|
-
|
|
11
1
|
# Testing
|
|
12
2
|
|
|
13
3
|
`canvas-kit` has 3 levels of testing: unit, functional and visual. Each area has special use-cases
|
|
@@ -234,9 +224,7 @@ out. This is most confusing to those who approach Cypress commands as Promises.
|
|
|
234
224
|
For example, imagine the following Cypress code:
|
|
235
225
|
|
|
236
226
|
```ts
|
|
237
|
-
cy.get('body')
|
|
238
|
-
.contains('button', 'Delete Item')
|
|
239
|
-
.click();
|
|
227
|
+
cy.get('body').contains('button', 'Delete Item').click();
|
|
240
228
|
|
|
241
229
|
cy.get('[data-testid="MyResult"]').should('contain', 'Success!');
|
|
242
230
|
```
|
|
@@ -309,19 +297,6 @@ solutions like [knobs](https://github.com/storybookjs/storybook/tree/next/addons
|
|
|
309
297
|
To make a story runnable in Chromatic for visual testing, add the following to the story's parameter
|
|
310
298
|
list:
|
|
311
299
|
|
|
312
|
-
```tsx
|
|
313
|
-
// default Storybook API
|
|
314
|
-
storiesOf('Some Category', module)
|
|
315
|
-
.add('My Visual Story', () => {
|
|
316
|
-
/** story contents */
|
|
317
|
-
})
|
|
318
|
-
.addParameter({
|
|
319
|
-
chromatic: {
|
|
320
|
-
disable: false,
|
|
321
|
-
},
|
|
322
|
-
});
|
|
323
|
-
```
|
|
324
|
-
|
|
325
300
|
```tsx
|
|
326
301
|
// CSF - All stories in file
|
|
327
302
|
export default withSnapshotsEnabled({
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
2
|
+
|
|
3
|
+
import Basic from './examples/Basic';
|
|
4
|
+
import DisabledItem from './examples/DisabledItem';
|
|
5
|
+
import GroupOfResult from './examples/GroupOfResult';
|
|
6
|
+
import Grow from './examples/Grow';
|
|
7
|
+
import NoClearButton from './examples/NoClearButton';
|
|
8
|
+
import RTL from './examples/RTL';
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
# Combobox
|
|
12
|
+
|
|
13
|
+
The term "Combobox" is based on the
|
|
14
|
+
[Combobox Pattern](https://www.w3.org/WAI/ARIA/apg/patterns/combobox/) as defined in the ARIA
|
|
15
|
+
Authoring Practices Guide (APG):
|
|
16
|
+
|
|
17
|
+
> A [combobox](https://w3c.github.io/aria/#combobox) is an input widget with an associated popup
|
|
18
|
+
> that enables users to select a value for the combobox from a collection of possible values.
|
|
19
|
+
|
|
20
|
+
Examples of a "combobox" would be date pickers, autocomplete, and select components.
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
yarn add @workday/canvas-kit-react
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
### Autocomplete
|
|
31
|
+
|
|
32
|
+
<ExampleCodeBlock code={Basic} />
|
|
33
|
+
|
|
34
|
+
### Grow
|
|
35
|
+
|
|
36
|
+
<ExampleCodeBlock code={Grow} />
|
|
37
|
+
|
|
38
|
+
### No Clear Button
|
|
39
|
+
|
|
40
|
+
<ExampleCodeBlock code={NoClearButton} />
|
|
41
|
+
|
|
42
|
+
### Group Of Result
|
|
43
|
+
|
|
44
|
+
<ExampleCodeBlock code={GroupOfResult} />
|
|
45
|
+
|
|
46
|
+
### Disabled Item
|
|
47
|
+
|
|
48
|
+
<ExampleCodeBlock code={DisabledItem} />
|
|
49
|
+
|
|
50
|
+
### RTL
|
|
51
|
+
|
|
52
|
+
<ExampleCodeBlock code={RTL} />
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, {ReactNode, ReactElement, FC, ChangeEvent} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Combobox,
|
|
4
|
+
ComboboxProps,
|
|
5
|
+
ComboBoxMenuItemGroup,
|
|
6
|
+
} from '@workday/canvas-kit-labs-react/combobox';
|
|
7
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
8
|
+
import {StyledMenuItem, MenuItemProps} from '@workday/canvas-kit-react/menu';
|
|
9
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
10
|
+
|
|
11
|
+
const autocompleteResult = (
|
|
12
|
+
textModifier: number,
|
|
13
|
+
disabled: boolean
|
|
14
|
+
): ReactElement<MenuItemProps> => (
|
|
15
|
+
<StyledMenuItem isDisabled={disabled}>
|
|
16
|
+
Result
|
|
17
|
+
<span>
|
|
18
|
+
num<span>ber</span>
|
|
19
|
+
</span>
|
|
20
|
+
{textModifier}
|
|
21
|
+
</StyledMenuItem>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const simpleAutoComplete = (count: number, showDisabledItems, total = 5) =>
|
|
25
|
+
Array.apply(null, Array(count))
|
|
26
|
+
.map((_, i) => autocompleteResult(i, showDisabledItems && i === 0))
|
|
27
|
+
.splice(0, total);
|
|
28
|
+
|
|
29
|
+
const groupOfResults = (
|
|
30
|
+
count: number,
|
|
31
|
+
showDisabledItems: boolean,
|
|
32
|
+
groupHeading: ReactNode = 'Group'
|
|
33
|
+
): ComboBoxMenuItemGroup => ({
|
|
34
|
+
header: (
|
|
35
|
+
<StyledMenuItem>
|
|
36
|
+
<strong>{groupHeading}</strong>
|
|
37
|
+
</StyledMenuItem>
|
|
38
|
+
),
|
|
39
|
+
items: simpleAutoComplete(count, showDisabledItems, 10),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const Autocomplete: FC<
|
|
43
|
+
Omit<ComboboxProps, 'children'> & {
|
|
44
|
+
group?: boolean;
|
|
45
|
+
showDisabledItems?: boolean;
|
|
46
|
+
}
|
|
47
|
+
> = ({showClearButton, group, showDisabledItems = false, ...props}) => {
|
|
48
|
+
const [currentText, setCurrentText] = React.useState('');
|
|
49
|
+
|
|
50
|
+
const autocompleteCallback = (event: ChangeEvent<HTMLInputElement>): void => {
|
|
51
|
+
setCurrentText(event.target.value);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const textLength = currentText.length;
|
|
55
|
+
const groupLength = Math.floor(textLength / 2);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Combobox
|
|
59
|
+
autocompleteItems={
|
|
60
|
+
group
|
|
61
|
+
? [
|
|
62
|
+
groupOfResults(groupLength, showDisabledItems, <em>Animals</em>),
|
|
63
|
+
groupOfResults(Math.min(1, groupLength), showDisabledItems, 'Cars'),
|
|
64
|
+
]
|
|
65
|
+
: simpleAutoComplete(textLength, showDisabledItems, 10)
|
|
66
|
+
}
|
|
67
|
+
onChange={autocompleteCallback}
|
|
68
|
+
showClearButton={showClearButton == null ? true : showClearButton}
|
|
69
|
+
labelId="autocomplete-123"
|
|
70
|
+
initialValue="Test"
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
<TextInput placeholder="Autocomplete" />
|
|
74
|
+
</Combobox>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default () => {
|
|
79
|
+
return (
|
|
80
|
+
<FormField id="autocomplete-123">
|
|
81
|
+
<FormField.Label>Autocomplete example</FormField.Label>
|
|
82
|
+
<FormField.Field>
|
|
83
|
+
<FormField.Input as={Autocomplete} />
|
|
84
|
+
</FormField.Field>
|
|
85
|
+
</FormField>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, {ReactNode, ReactElement, FC, ChangeEvent} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Combobox,
|
|
4
|
+
ComboboxProps,
|
|
5
|
+
ComboBoxMenuItemGroup,
|
|
6
|
+
} from '@workday/canvas-kit-labs-react/combobox';
|
|
7
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
8
|
+
import {StyledMenuItem, MenuItemProps} from '@workday/canvas-kit-react/menu';
|
|
9
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
10
|
+
|
|
11
|
+
const autocompleteResult = (
|
|
12
|
+
textModifier: number,
|
|
13
|
+
disabled: boolean
|
|
14
|
+
): ReactElement<MenuItemProps> => (
|
|
15
|
+
<StyledMenuItem isDisabled={disabled}>
|
|
16
|
+
Result
|
|
17
|
+
<span>
|
|
18
|
+
num<span>ber</span>
|
|
19
|
+
</span>
|
|
20
|
+
{textModifier}
|
|
21
|
+
</StyledMenuItem>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const simpleAutoComplete = (count: number, showDisabledItems, total = 5) =>
|
|
25
|
+
Array.apply(null, Array(count))
|
|
26
|
+
.map((_, i) => autocompleteResult(i, showDisabledItems && i === 0))
|
|
27
|
+
.splice(0, total);
|
|
28
|
+
|
|
29
|
+
const groupOfResults = (
|
|
30
|
+
count: number,
|
|
31
|
+
showDisabledItems: boolean,
|
|
32
|
+
groupHeading: ReactNode = 'Group'
|
|
33
|
+
): ComboBoxMenuItemGroup => ({
|
|
34
|
+
header: (
|
|
35
|
+
<StyledMenuItem>
|
|
36
|
+
<strong>{groupHeading}</strong>
|
|
37
|
+
</StyledMenuItem>
|
|
38
|
+
),
|
|
39
|
+
items: simpleAutoComplete(count, showDisabledItems, 10),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const Autocomplete: FC<
|
|
43
|
+
Omit<ComboboxProps, 'children'> & {
|
|
44
|
+
group?: boolean;
|
|
45
|
+
showDisabledItems?: boolean;
|
|
46
|
+
}
|
|
47
|
+
> = ({showClearButton, group, showDisabledItems = false, ...props}) => {
|
|
48
|
+
const [currentText, setCurrentText] = React.useState('');
|
|
49
|
+
|
|
50
|
+
const autocompleteCallback = (event: ChangeEvent<HTMLInputElement>): void => {
|
|
51
|
+
setCurrentText(event.target.value);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const textLength = currentText.length;
|
|
55
|
+
const groupLength = Math.floor(textLength / 2);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Combobox
|
|
59
|
+
autocompleteItems={
|
|
60
|
+
group
|
|
61
|
+
? [
|
|
62
|
+
groupOfResults(groupLength, showDisabledItems, <em>Animals</em>),
|
|
63
|
+
groupOfResults(Math.min(1, groupLength), showDisabledItems, 'Cars'),
|
|
64
|
+
]
|
|
65
|
+
: simpleAutoComplete(textLength, showDisabledItems, 10)
|
|
66
|
+
}
|
|
67
|
+
onChange={autocompleteCallback}
|
|
68
|
+
showClearButton={showClearButton == null ? true : showClearButton}
|
|
69
|
+
labelId="autocomplete-123"
|
|
70
|
+
initialValue="Test"
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
<TextInput placeholder="Autocomplete" />
|
|
74
|
+
</Combobox>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default () => {
|
|
79
|
+
return (
|
|
80
|
+
<FormField id="autocomplete-123">
|
|
81
|
+
<FormField.Label>Group of results</FormField.Label>
|
|
82
|
+
<FormField.Field>
|
|
83
|
+
<FormField.Input as={Autocomplete} showDisabledItems={true} />
|
|
84
|
+
</FormField.Field>
|
|
85
|
+
</FormField>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, {ReactNode, ReactElement, FC, ChangeEvent} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Combobox,
|
|
4
|
+
ComboboxProps,
|
|
5
|
+
ComboBoxMenuItemGroup,
|
|
6
|
+
} from '@workday/canvas-kit-labs-react/combobox';
|
|
7
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
8
|
+
import {StyledMenuItem, MenuItemProps} from '@workday/canvas-kit-react/menu';
|
|
9
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
10
|
+
|
|
11
|
+
const autocompleteResult = (
|
|
12
|
+
textModifier: number,
|
|
13
|
+
disabled: boolean
|
|
14
|
+
): ReactElement<MenuItemProps> => (
|
|
15
|
+
<StyledMenuItem isDisabled={disabled}>
|
|
16
|
+
Result{' '}
|
|
17
|
+
<span>
|
|
18
|
+
num<span>ber</span>
|
|
19
|
+
</span>{' '}
|
|
20
|
+
{textModifier}
|
|
21
|
+
</StyledMenuItem>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const simpleAutoComplete = (count: number, showDisabledItems, total = 5) =>
|
|
25
|
+
Array.apply(null, Array(count))
|
|
26
|
+
.map((_, i) => autocompleteResult(i, showDisabledItems && i === 0))
|
|
27
|
+
.splice(0, total);
|
|
28
|
+
|
|
29
|
+
const groupOfResults = (
|
|
30
|
+
count: number,
|
|
31
|
+
showDisabledItems: boolean,
|
|
32
|
+
groupHeading: ReactNode = 'Group'
|
|
33
|
+
): ComboBoxMenuItemGroup => ({
|
|
34
|
+
header: (
|
|
35
|
+
<StyledMenuItem>
|
|
36
|
+
<strong>{groupHeading}</strong>
|
|
37
|
+
</StyledMenuItem>
|
|
38
|
+
),
|
|
39
|
+
items: simpleAutoComplete(count, showDisabledItems, 10),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const Autocomplete: FC<
|
|
43
|
+
Omit<ComboboxProps, 'children'> & {
|
|
44
|
+
group?: boolean;
|
|
45
|
+
showDisabledItems?: boolean;
|
|
46
|
+
}
|
|
47
|
+
> = ({showClearButton, group, showDisabledItems = false, ...props}) => {
|
|
48
|
+
const [currentText, setCurrentText] = React.useState('');
|
|
49
|
+
|
|
50
|
+
const autocompleteCallback = (event: ChangeEvent<HTMLInputElement>): void => {
|
|
51
|
+
setCurrentText(event.target.value);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const textLength = currentText.length;
|
|
55
|
+
const groupLength = Math.floor(textLength / 2);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Combobox
|
|
59
|
+
autocompleteItems={
|
|
60
|
+
group
|
|
61
|
+
? [
|
|
62
|
+
groupOfResults(groupLength, showDisabledItems, <em>Animals</em>),
|
|
63
|
+
groupOfResults(Math.min(1, groupLength), showDisabledItems, 'Cars'),
|
|
64
|
+
]
|
|
65
|
+
: simpleAutoComplete(textLength, showDisabledItems, 10)
|
|
66
|
+
}
|
|
67
|
+
onChange={autocompleteCallback}
|
|
68
|
+
showClearButton={showClearButton == null ? true : showClearButton}
|
|
69
|
+
labelId="autocomplete-123"
|
|
70
|
+
initialValue="Test"
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
<TextInput placeholder="Autocomplete" />
|
|
74
|
+
</Combobox>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default () => {
|
|
79
|
+
return (
|
|
80
|
+
<FormField id="autocomplete-123">
|
|
81
|
+
<FormField.Label>Group of results</FormField.Label>
|
|
82
|
+
<FormField.Field>
|
|
83
|
+
<FormField.Input as={Autocomplete} group={true} />
|
|
84
|
+
</FormField.Field>
|
|
85
|
+
</FormField>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React, {ReactNode, ReactElement, FC, ChangeEvent} from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Combobox,
|
|
4
|
+
ComboboxProps,
|
|
5
|
+
ComboBoxMenuItemGroup,
|
|
6
|
+
} from '@workday/canvas-kit-labs-react/combobox';
|
|
7
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
8
|
+
import {StyledMenuItem, MenuItemProps} from '@workday/canvas-kit-react/menu';
|
|
9
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
10
|
+
|
|
11
|
+
const autocompleteResult = (
|
|
12
|
+
textModifier: number,
|
|
13
|
+
disabled: boolean
|
|
14
|
+
): ReactElement<MenuItemProps> => (
|
|
15
|
+
<StyledMenuItem isDisabled={disabled}>
|
|
16
|
+
Result
|
|
17
|
+
<span>
|
|
18
|
+
num<span>ber</span>
|
|
19
|
+
</span>
|
|
20
|
+
{textModifier}
|
|
21
|
+
</StyledMenuItem>
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
const simpleAutoComplete = (count: number, showDisabledItems, total = 5) =>
|
|
25
|
+
Array.apply(null, Array(count))
|
|
26
|
+
.map((_, i) => autocompleteResult(i, showDisabledItems && i === 0))
|
|
27
|
+
.splice(0, total);
|
|
28
|
+
|
|
29
|
+
const groupOfResults = (
|
|
30
|
+
count: number,
|
|
31
|
+
showDisabledItems: boolean,
|
|
32
|
+
groupHeading: ReactNode = 'Group'
|
|
33
|
+
): ComboBoxMenuItemGroup => ({
|
|
34
|
+
header: (
|
|
35
|
+
<StyledMenuItem>
|
|
36
|
+
<strong>{groupHeading}</strong>
|
|
37
|
+
</StyledMenuItem>
|
|
38
|
+
),
|
|
39
|
+
items: simpleAutoComplete(count, showDisabledItems, 10),
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const Autocomplete: FC<
|
|
43
|
+
Omit<ComboboxProps, 'children'> & {
|
|
44
|
+
group?: boolean;
|
|
45
|
+
showDisabledItems?: boolean;
|
|
46
|
+
}
|
|
47
|
+
> = ({showClearButton, group, showDisabledItems = false, ...props}) => {
|
|
48
|
+
const [currentText, setCurrentText] = React.useState('');
|
|
49
|
+
|
|
50
|
+
const autocompleteCallback = (event: ChangeEvent<HTMLInputElement>): void => {
|
|
51
|
+
setCurrentText(event.target.value);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const textLength = currentText.length;
|
|
55
|
+
const groupLength = Math.floor(textLength / 2);
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<Combobox
|
|
59
|
+
autocompleteItems={
|
|
60
|
+
group
|
|
61
|
+
? [
|
|
62
|
+
groupOfResults(groupLength, showDisabledItems, <em>Animals</em>),
|
|
63
|
+
groupOfResults(Math.min(1, groupLength), showDisabledItems, 'Cars'),
|
|
64
|
+
]
|
|
65
|
+
: simpleAutoComplete(textLength, showDisabledItems, 10)
|
|
66
|
+
}
|
|
67
|
+
onChange={autocompleteCallback}
|
|
68
|
+
showClearButton={showClearButton == null ? true : showClearButton}
|
|
69
|
+
labelId="autocomplete-123"
|
|
70
|
+
initialValue="Test"
|
|
71
|
+
{...props}
|
|
72
|
+
>
|
|
73
|
+
<TextInput data-width="ck-formfield-width" placeholder="Autocomplete" />
|
|
74
|
+
</Combobox>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
export default () => {
|
|
79
|
+
return (
|
|
80
|
+
<FormField grow={true} id="autocomplete-123">
|
|
81
|
+
<FormField.Label>Grow example</FormField.Label>
|
|
82
|
+
<FormField.Field>
|
|
83
|
+
<FormField.Input as={Autocomplete} />
|
|
84
|
+
</FormField.Field>
|
|
85
|
+
</FormField>
|
|
86
|
+
);
|
|
87
|
+
};
|