@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
|
@@ -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>No clear button</FormField.Label>
|
|
82
|
+
<FormField.Field>
|
|
83
|
+
<FormField.Input as={Autocomplete} showClearButton={false} />
|
|
84
|
+
</FormField.Field>
|
|
85
|
+
</FormField>
|
|
86
|
+
);
|
|
87
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
|
|
11
|
+
|
|
12
|
+
const autocompleteResult = (
|
|
13
|
+
textModifier: number,
|
|
14
|
+
disabled: boolean
|
|
15
|
+
): ReactElement<MenuItemProps> => (
|
|
16
|
+
<StyledMenuItem isDisabled={disabled}>
|
|
17
|
+
Result
|
|
18
|
+
<span>
|
|
19
|
+
num<span>ber</span>
|
|
20
|
+
</span>
|
|
21
|
+
{textModifier}
|
|
22
|
+
</StyledMenuItem>
|
|
23
|
+
);
|
|
24
|
+
|
|
25
|
+
const simpleAutoComplete = (count: number, showDisabledItems, total = 5) =>
|
|
26
|
+
Array.apply(null, Array(count))
|
|
27
|
+
.map((_, i) => autocompleteResult(i, showDisabledItems && i === 0))
|
|
28
|
+
.splice(0, total);
|
|
29
|
+
|
|
30
|
+
const groupOfResults = (
|
|
31
|
+
count: number,
|
|
32
|
+
showDisabledItems: boolean,
|
|
33
|
+
groupHeading: ReactNode = 'Group'
|
|
34
|
+
): ComboBoxMenuItemGroup => ({
|
|
35
|
+
header: (
|
|
36
|
+
<StyledMenuItem>
|
|
37
|
+
<strong>{groupHeading}</strong>
|
|
38
|
+
</StyledMenuItem>
|
|
39
|
+
),
|
|
40
|
+
items: simpleAutoComplete(count, showDisabledItems, 10),
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const Autocomplete: FC<
|
|
44
|
+
Omit<ComboboxProps, 'children'> & {
|
|
45
|
+
group?: boolean;
|
|
46
|
+
showDisabledItems?: boolean;
|
|
47
|
+
}
|
|
48
|
+
> = ({showClearButton, group, showDisabledItems = false, ...props}) => {
|
|
49
|
+
const [currentText, setCurrentText] = React.useState('');
|
|
50
|
+
|
|
51
|
+
const autocompleteCallback = (event: ChangeEvent<HTMLInputElement>): void => {
|
|
52
|
+
setCurrentText(event.target.value);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const textLength = currentText.length;
|
|
56
|
+
const groupLength = Math.floor(textLength / 2);
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<Combobox
|
|
60
|
+
autocompleteItems={
|
|
61
|
+
group
|
|
62
|
+
? [
|
|
63
|
+
groupOfResults(groupLength, showDisabledItems, <em>Animals</em>),
|
|
64
|
+
groupOfResults(Math.min(1, groupLength), showDisabledItems, 'Cars'),
|
|
65
|
+
]
|
|
66
|
+
: simpleAutoComplete(textLength, showDisabledItems, 10)
|
|
67
|
+
}
|
|
68
|
+
onChange={autocompleteCallback}
|
|
69
|
+
showClearButton={showClearButton == null ? true : showClearButton}
|
|
70
|
+
labelId="autocomplete-123"
|
|
71
|
+
initialValue="Test"
|
|
72
|
+
{...props}
|
|
73
|
+
>
|
|
74
|
+
<TextInput placeholder="Autocomplete" />
|
|
75
|
+
</Combobox>
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export default () => {
|
|
80
|
+
return (
|
|
81
|
+
<CanvasProvider theme={{canvas: {direction: ContentDirection.RTL}}}>
|
|
82
|
+
<FormField id="rtl-autocomplete-123">
|
|
83
|
+
<FormField.Label>RTL Autocomplete example</FormField.Label>
|
|
84
|
+
<FormField.Field>
|
|
85
|
+
<FormField.Input as={Autocomplete} />
|
|
86
|
+
</FormField.Field>
|
|
87
|
+
</FormField>
|
|
88
|
+
</CanvasProvider>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {Expandable} from '@workday/canvas-kit-labs-react/expandable';
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
4
2
|
|
|
5
3
|
import StartIcon from './examples/StartIcon';
|
|
6
4
|
import EndIcon from './examples/EndIcon';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
|
-
import {SearchForm} from '@workday/canvas-kit-labs-react/search-form';
|
|
3
|
-
// examples
|
|
4
|
-
import Basic from './examples/Basic';
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';import Basic from './examples/Basic';
|
|
5
2
|
import CustomTheme from './examples/CustomTheme';
|
|
6
3
|
import Grow from './examples/Grow';
|
|
7
4
|
import RTL from './examples/RTL';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import {ExampleCodeBlock} from '@workday/canvas-kit-docs';
|
|
2
|
+
import TextInputWithReactHookForm from './examples/TextInputWithReactHookForm';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
# Canvas Kit Forms Examples
|
|
6
|
+
|
|
7
|
+
## Uncontrolled Text Inputs Using React Hook Form
|
|
8
|
+
|
|
9
|
+
<ExampleCodeBlock code={TextInputWithReactHookForm} />
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {ExampleCodeBlock} from '@workday/canvas-kit-docs';
|
|
2
|
+
import SelectWithFormik from './examples/SelectWithFormik';
|
|
3
|
+
import TextInputWithFormik from './examples/TextInputWithFormik';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
# Canvas Kit Examples
|
|
7
|
+
|
|
8
|
+
## Select Using Formik
|
|
9
|
+
|
|
10
|
+
<ExampleCodeBlock code={SelectWithFormik} />
|
|
11
|
+
|
|
12
|
+
## Controlled Text Inputs Using Formik
|
|
13
|
+
|
|
14
|
+
<ExampleCodeBlock code={TextInputWithFormik} />
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {useFormik} from 'formik';
|
|
3
3
|
import {Select, useSelectModel} from '@workday/canvas-kit-react/select';
|
|
4
|
-
import {
|
|
5
|
-
FormField,
|
|
6
|
-
useFormFieldInput,
|
|
7
|
-
useFormFieldModel,
|
|
8
|
-
} from '@workday/canvas-kit-preview-react/form-field';
|
|
4
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
9
5
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
10
6
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
11
7
|
import {
|
package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/TextInputWithReactHookForm.tsx
RENAMED
|
@@ -7,7 +7,7 @@ import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
|
7
7
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
8
8
|
import {TertiaryButton, PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
9
9
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
10
|
-
import {FormField} from '@workday/canvas-kit-
|
|
10
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
11
11
|
import {visibleIcon, invisibleIcon} from '@workday/canvas-system-icons-web';
|
|
12
12
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
13
13
|
|
|
@@ -24,6 +24,7 @@ const useYupValidationResolver: YupValidationResolver = validationSchema => {
|
|
|
24
24
|
} catch (errors) {
|
|
25
25
|
return {
|
|
26
26
|
values: {},
|
|
27
|
+
//@ts-ignore
|
|
27
28
|
errors: errors.inner.reduce(
|
|
28
29
|
(allErrors, currentError) => ({
|
|
29
30
|
...allErrors,
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
2
|
+
|
|
3
|
+
import {Divider} from '@workday/canvas-kit-preview-react/divider';
|
|
4
|
+
import Basic from './examples/Basic';
|
|
5
|
+
import CustomSpace from './examples/CustomSpace';
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
# Divider
|
|
9
|
+
|
|
10
|
+
A `Divider` segments and visually organizes content.
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
yarn add @workday/canvas-kit-preview-react
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Usage
|
|
19
|
+
|
|
20
|
+
Use a `Divider` to separate content and create visual hierarchy. Typically they are used between paragraph sections to indicate a break or shift in content. However, they can also be used as decorative elements to provide greater emphasis and visual hierarchy.
|
|
21
|
+
|
|
22
|
+
### Basic Example
|
|
23
|
+
|
|
24
|
+
By default, `Divider` renders a `<hr>` (horizontal rule) element with `0.5rem` of margin on top and bottom. The `space` prop allows you to adjust the vertical margin evenly. In the example below, the `Divider`s provide a subtle deliniation between each profile card without being as visually prominent as a `Card`. The `space` is adjusted to `0.25rem` which applied `0.125rem` to the top and bottom margin.
|
|
25
|
+
|
|
26
|
+
<ExampleCodeBlock code={Basic} />
|
|
27
|
+
|
|
28
|
+
### Custom Space
|
|
29
|
+
|
|
30
|
+
You might also want to apply custom space to `Divider` where the top and bottom margin are not equal. The best way to achieve this is with `createStyles` and the `cs` property. In the example below, the `Divider` is applied as a decorative element to add emphasis to the section heading. Custom styles are defined in the `createStyles` function outside the component and are passed to `Divider`'s `cs` prop. These styles remove the top margin and set the bottom margin to `1rem`.
|
|
31
|
+
|
|
32
|
+
<ExampleCodeBlock code={CustomSpace} />
|
|
33
|
+
|
|
34
|
+
## Component API
|
|
35
|
+
|
|
36
|
+
<SymbolDoc name="Divider" hideDescription />
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Divider} from '@workday/canvas-kit-preview-react/divider';
|
|
3
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
6
|
+
|
|
7
|
+
const sectionStyles = createStyles({
|
|
8
|
+
display: 'flex',
|
|
9
|
+
flexDirection: 'column',
|
|
10
|
+
gap: system.space.x4,
|
|
11
|
+
maxWidth: '40rem',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export default () => {
|
|
15
|
+
const lastIndex = maintainerList.length - 1;
|
|
16
|
+
return (
|
|
17
|
+
<section className={sectionStyles}>
|
|
18
|
+
{maintainerList.map((maintainerData, index) => (
|
|
19
|
+
<>
|
|
20
|
+
<ProfileCard {...maintainerData} />
|
|
21
|
+
{index !== lastIndex && <Divider space={system.space.x1} />}
|
|
22
|
+
</>
|
|
23
|
+
))}
|
|
24
|
+
</section>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const maintainerList = [
|
|
29
|
+
{
|
|
30
|
+
id: '44883293',
|
|
31
|
+
name: 'Josh Bagwell',
|
|
32
|
+
bio: 'Software Development Engineer',
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
id: '338257',
|
|
36
|
+
name: 'Nicholas Boll',
|
|
37
|
+
bio: 'Principal Software Development Engineer',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
id: '7966550',
|
|
41
|
+
name: 'Manuel Carrera',
|
|
42
|
+
bio: 'Sr. Software Development Engineer',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: '146020',
|
|
46
|
+
name: 'James Fan',
|
|
47
|
+
bio: 'Sr. Software Development Engineer',
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
id: '48605821',
|
|
51
|
+
name: 'Raisa Primerova',
|
|
52
|
+
bio: 'Software Development Engineer',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
id: '4818182',
|
|
56
|
+
name: 'Alan Smith',
|
|
57
|
+
bio: 'Principal Software Development Engineer',
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
const profileCardStyles = createStyles({
|
|
62
|
+
display: 'grid',
|
|
63
|
+
gridGap: '0.5rem',
|
|
64
|
+
gridTemplateColumns: '5rem 1fr',
|
|
65
|
+
gridTemplateRows: '1fr 1fr',
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
const profileCardAvatarStyles = createStyles({
|
|
69
|
+
gridColumn: '1',
|
|
70
|
+
gridRow: '1 / 3',
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const profileCardHeadingStyles = createStyles({
|
|
74
|
+
...system.type.body.large,
|
|
75
|
+
fontWeight: system.fontWeight.bold,
|
|
76
|
+
gridColumn: '2/3',
|
|
77
|
+
gridRow: '1',
|
|
78
|
+
margin: 0,
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const profileCardBodyStyles = createStyles({
|
|
82
|
+
...system.type.body.small,
|
|
83
|
+
gridColumn: '2',
|
|
84
|
+
gridRow: '2',
|
|
85
|
+
margin: 0,
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
interface ProfileCardProps {
|
|
89
|
+
id: string;
|
|
90
|
+
name: string;
|
|
91
|
+
bio: string;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
const ProfileCard = ({id, name, bio}: ProfileCardProps) => (
|
|
95
|
+
<div className={profileCardStyles}>
|
|
96
|
+
<Avatar
|
|
97
|
+
size="extraLarge"
|
|
98
|
+
url={`https://avatars.githubusercontent.com/u/${id}?v=4`}
|
|
99
|
+
altText={`${name}'s avatar`}
|
|
100
|
+
className={profileCardAvatarStyles}
|
|
101
|
+
/>
|
|
102
|
+
<h3 className={profileCardHeadingStyles}>{name}</h3>
|
|
103
|
+
<p className={profileCardBodyStyles}>{bio}</p>
|
|
104
|
+
</div>
|
|
105
|
+
);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Divider} from '@workday/canvas-kit-preview-react/divider';
|
|
3
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
|
|
6
|
+
const headingStyles = createStyles({
|
|
7
|
+
...system.type.body.large,
|
|
8
|
+
fontWeight: system.fontWeight.bold,
|
|
9
|
+
margin: 0,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
const bodyStyles = createStyles({
|
|
13
|
+
...system.type.body.small,
|
|
14
|
+
margin: 0,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const customDividerSpace = createStyles({
|
|
18
|
+
margin: `0 0 ${system.space.x4}`,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export default () => {
|
|
22
|
+
return (
|
|
23
|
+
<section>
|
|
24
|
+
<h3 className={headingStyles}>Quote of the Day</h3>
|
|
25
|
+
<Divider cs={customDividerSpace} />
|
|
26
|
+
<p className={bodyStyles}>
|
|
27
|
+
"It is not our differences that divide us. It is our inability to recognize, accept, and
|
|
28
|
+
celebrate those differences." – Audre Lorde
|
|
29
|
+
</p>
|
|
30
|
+
</section>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
2
|
import {LoadingSparkles} from '@workday/canvas-kit-preview-react/loading-sparkles';
|
|
3
|
-
|
|
4
3
|
import Basic from './examples/Basic';
|
|
5
4
|
import RTL from './examples/RTL';
|
|
6
5
|
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {DeprecatedMenu, DeprecatedMenuItem} from '@workday/canvas-kit-preview-react/menu';
|
|
3
|
-
import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
|
|
4
|
-
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
5
2
|
import Basic from './examples/Basic';
|
|
6
3
|
import ContextMenu from './examples/ContextMenu';
|
|
7
4
|
import CustomMenuItem from './examples/CustomMenuItem';
|
|
@@ -104,8 +101,4 @@ your new items screen reader friendly add an `aria-label` around each grouped it
|
|
|
104
101
|
|
|
105
102
|
### DeprecatedMenuItem
|
|
106
103
|
|
|
107
|
-
<SymbolDoc name="DeprecatedMenuItem" fileName="/preview-react/" />
|
|
108
|
-
|
|
109
|
-
## Specifications
|
|
110
|
-
|
|
111
|
-
<Specifications file="MenuPreview.spec.ts" name="Menu" />
|
|
104
|
+
<SymbolDoc name="DeprecatedMenuItem" fileName="/preview-react/" />
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {Pill} from '@workday/canvas-kit-preview-react/pill';
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
4
2
|
|
|
5
3
|
import WithReadOnly from './examples/WithReadOnly';
|
|
6
4
|
import WithAvatar from './examples/WithAvatar';
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {RadioGroup} from '@workday/canvas-kit-preview-react/radio';
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
4
2
|
|
|
5
3
|
import Basic from './examples/Basic';
|
|
6
4
|
import Alert from './examples/Alert';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {FormFieldGroup} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {RadioGroup} from '@workday/canvas-kit-preview-react/radio';
|
|
4
4
|
|
|
5
5
|
export default () => {
|
|
@@ -13,15 +13,30 @@ export default () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
<
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
16
|
+
<FormFieldGroup error="alert" id="hint-alert">
|
|
17
|
+
<FormFieldGroup.Label>Choose Your Pizza Crust</FormFieldGroup.Label>
|
|
18
|
+
<FormFieldGroup.Field>
|
|
19
|
+
<FormFieldGroup.List
|
|
20
|
+
as={RadioGroup}
|
|
21
|
+
name="crust-alert"
|
|
22
|
+
onChange={handleChange}
|
|
23
|
+
value={value}
|
|
24
|
+
>
|
|
25
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="deep-dish">
|
|
26
|
+
Deep dish
|
|
27
|
+
</FormFieldGroup.Input>
|
|
28
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="thin">
|
|
29
|
+
Thin
|
|
30
|
+
</FormFieldGroup.Input>
|
|
31
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="gluten-free">
|
|
32
|
+
Gluten free
|
|
33
|
+
</FormFieldGroup.Input>
|
|
34
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="cauliflower">
|
|
35
|
+
Cauliflower
|
|
36
|
+
</FormFieldGroup.Input>
|
|
37
|
+
</FormFieldGroup.List>
|
|
38
|
+
<FormFieldGroup.Hint>Deep dish is an extra $2.99.</FormFieldGroup.Hint>
|
|
39
|
+
</FormFieldGroup.Field>
|
|
40
|
+
</FormFieldGroup>
|
|
26
41
|
);
|
|
27
42
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {FormFieldGroup} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {RadioGroup} from '@workday/canvas-kit-preview-react/radio';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
5
|
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
@@ -20,24 +20,34 @@ export default () => {
|
|
|
20
20
|
|
|
21
21
|
return (
|
|
22
22
|
<Flex flexDirection="column">
|
|
23
|
-
<
|
|
24
|
-
<
|
|
25
|
-
<
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
23
|
+
<FormFieldGroup>
|
|
24
|
+
<FormFieldGroup.Label>Choose Your Pizza Crust</FormFieldGroup.Label>
|
|
25
|
+
<FormFieldGroup.Field>
|
|
26
|
+
<FormFieldGroup.List
|
|
27
|
+
cs={formfieldInputStyles}
|
|
28
|
+
as={RadioGroup}
|
|
29
|
+
name="pizza-crust"
|
|
30
|
+
onChange={handleChange}
|
|
31
|
+
value={value}
|
|
32
|
+
>
|
|
33
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="deep-dish">
|
|
34
|
+
Deep dish
|
|
35
|
+
</FormFieldGroup.Input>
|
|
36
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="thin">
|
|
37
|
+
Thin
|
|
38
|
+
</FormFieldGroup.Input>
|
|
39
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="gluten-free">
|
|
40
|
+
Gluten free
|
|
41
|
+
</FormFieldGroup.Input>
|
|
42
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="cauliflower">
|
|
43
|
+
Cauliflower
|
|
44
|
+
</FormFieldGroup.Input>
|
|
45
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="custom">
|
|
46
|
+
Butter - the best thing to put on bread
|
|
47
|
+
</FormFieldGroup.Input>
|
|
48
|
+
</FormFieldGroup.List>
|
|
49
|
+
</FormFieldGroup.Field>
|
|
50
|
+
</FormFieldGroup>
|
|
41
51
|
Value selected: {value}
|
|
42
52
|
</Flex>
|
|
43
53
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import {FormFieldGroup} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {RadioGroup} from '@workday/canvas-kit-preview-react/radio';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
5
|
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
@@ -26,35 +26,37 @@ export default () => {
|
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<Flex flexDirection="column">
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
<RadioGroup.Label
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
<RadioGroup.Label
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<RadioGroup.Label
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
29
|
+
<FormFieldGroup>
|
|
30
|
+
<FormFieldGroup.Label>Choose Your Pizza Crust</FormFieldGroup.Label>
|
|
31
|
+
<FormFieldGroup.Field>
|
|
32
|
+
<FormFieldGroup.List
|
|
33
|
+
as={RadioGroup}
|
|
34
|
+
name="pizza-crust-custom"
|
|
35
|
+
onChange={handleChange}
|
|
36
|
+
cs={styleOverrides.formfieldInputStyles}
|
|
37
|
+
value={value}
|
|
38
|
+
>
|
|
39
|
+
<RadioGroup.Label>
|
|
40
|
+
<FormFieldGroup.Input as={RadioGroup.Label.Input} value="deep-dish" />
|
|
41
|
+
<RadioGroup.Label.Text cs={styleOverrides.radioGroupLabelTextStyles}>
|
|
42
|
+
Deep dish
|
|
43
|
+
</RadioGroup.Label.Text>
|
|
44
|
+
</RadioGroup.Label>
|
|
45
|
+
<RadioGroup.Label>
|
|
46
|
+
<FormFieldGroup.Input as={RadioGroup.Label.Input} value="gluten-free" />
|
|
47
|
+
<RadioGroup.Label.Text cs={styleOverrides.radioGroupLabelTextStyles}>
|
|
48
|
+
Gluten free
|
|
49
|
+
</RadioGroup.Label.Text>
|
|
50
|
+
</RadioGroup.Label>
|
|
51
|
+
<RadioGroup.Label>
|
|
52
|
+
<FormFieldGroup.Input as={RadioGroup.Label.Input} value="cauliflower" />
|
|
53
|
+
<RadioGroup.Label.Text cs={styleOverrides.radioGroupLabelTextStyles}>
|
|
54
|
+
Cauliflower
|
|
55
|
+
</RadioGroup.Label.Text>
|
|
56
|
+
</RadioGroup.Label>
|
|
57
|
+
</FormFieldGroup.List>
|
|
58
|
+
</FormFieldGroup.Field>
|
|
59
|
+
</FormFieldGroup>
|
|
58
60
|
Value selected: {value}
|
|
59
61
|
</Flex>
|
|
60
62
|
);
|