@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,134 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Prism as SyntaxHighlighter} from 'react-syntax-highlighter';
|
|
3
|
+
|
|
4
|
+
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
5
|
+
import {Card} from '@workday/canvas-kit-react/card';
|
|
6
|
+
import {calc, createStencil, cssVar, px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
8
|
+
import {vscDarkPlus} from 'react-syntax-highlighter/dist/cjs/styles/prism';
|
|
9
|
+
import {checkCircleIcon, copyIcon} from '@workday/canvas-system-icons-web';
|
|
10
|
+
import {Tooltip} from '@workday/canvas-kit-react';
|
|
11
|
+
|
|
12
|
+
const cardStencil = createStencil({
|
|
13
|
+
base: {
|
|
14
|
+
'[data-part="example-block"]': {
|
|
15
|
+
boxShadow: system.depth[1],
|
|
16
|
+
borderRadius: system.shape.x1,
|
|
17
|
+
position: 'relative',
|
|
18
|
+
},
|
|
19
|
+
'[data-part="code-block"]': {
|
|
20
|
+
display: 'none',
|
|
21
|
+
boxShadow: system.depth[1],
|
|
22
|
+
borderRadius: system.shape.x1,
|
|
23
|
+
},
|
|
24
|
+
'[data-part="code-toggle-btn"]': {
|
|
25
|
+
position: 'absolute',
|
|
26
|
+
right: calc.negate(px2rem(1)),
|
|
27
|
+
bottom: calc.negate(px2rem(1)),
|
|
28
|
+
},
|
|
29
|
+
'[data-part="copy-btn"]': {
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
bottom: system.space.zero,
|
|
32
|
+
right: system.space.zero,
|
|
33
|
+
borderRadius: system.shape.zero,
|
|
34
|
+
borderTopLeftRadius: system.shape.x1,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
modifiers: {
|
|
38
|
+
opened: {
|
|
39
|
+
true: {
|
|
40
|
+
'[data-part="code-block"]': {
|
|
41
|
+
display: 'block',
|
|
42
|
+
borderTopLeftRadius: system.shape.zero,
|
|
43
|
+
borderTopRightRadius: system.shape.zero,
|
|
44
|
+
},
|
|
45
|
+
'[data-part="example-block"]': {
|
|
46
|
+
borderBottomLeftRadius: system.shape.zero,
|
|
47
|
+
borderBottomRightRadius: system.shape.zero,
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
export const ExampleCodeBlock = ({code}: any) => {
|
|
55
|
+
const [isCodeDisplayed, setCodeDisplayed] = React.useState(false);
|
|
56
|
+
const textInput = React.useRef(null);
|
|
57
|
+
const [copied, setCopied] = React.useState(false);
|
|
58
|
+
const timer = React.useRef<ReturnType<typeof setTimeout>>();
|
|
59
|
+
|
|
60
|
+
const onCopy = () => {
|
|
61
|
+
if (timer.current) {
|
|
62
|
+
clearTimeout(timer.current);
|
|
63
|
+
}
|
|
64
|
+
timer.current = setTimeout(() => {
|
|
65
|
+
setCopied(false);
|
|
66
|
+
}, 2000);
|
|
67
|
+
|
|
68
|
+
setCopied(true);
|
|
69
|
+
// @ts-ignore
|
|
70
|
+
navigator.clipboard.writeText(textInput.current.textContent);
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// React.useEffect(() => {
|
|
74
|
+
// if (copied) {
|
|
75
|
+
// const copyCodeTimeout = setTimeout(() => {
|
|
76
|
+
// setCopied(false);
|
|
77
|
+
// }, 2000);
|
|
78
|
+
|
|
79
|
+
// return () => {
|
|
80
|
+
// clearTimeout(copyCodeTimeout);
|
|
81
|
+
// };
|
|
82
|
+
// }
|
|
83
|
+
// }, [copied]);
|
|
84
|
+
|
|
85
|
+
return (
|
|
86
|
+
<div {...cardStencil({opened: isCodeDisplayed})}>
|
|
87
|
+
<Card data-part="example-block" className="sb-unstyled">
|
|
88
|
+
<Card.Body>
|
|
89
|
+
{React.createElement(code)}
|
|
90
|
+
{code && (
|
|
91
|
+
<TertiaryButton
|
|
92
|
+
size="extraSmall"
|
|
93
|
+
onClick={() => setCodeDisplayed(!isCodeDisplayed)}
|
|
94
|
+
data-part="code-toggle-btn"
|
|
95
|
+
>
|
|
96
|
+
{!isCodeDisplayed ? 'Show Code' : 'Hide Code'}
|
|
97
|
+
</TertiaryButton>
|
|
98
|
+
)}
|
|
99
|
+
</Card.Body>
|
|
100
|
+
</Card>
|
|
101
|
+
<Card data-part="code-block" padding={0}>
|
|
102
|
+
<Card.Body cs={{position: 'relative'}}>
|
|
103
|
+
{code && (
|
|
104
|
+
<div ref={textInput}>
|
|
105
|
+
<SyntaxHighlighter
|
|
106
|
+
className="sb-unstyled"
|
|
107
|
+
language="jsx"
|
|
108
|
+
style={vscDarkPlus}
|
|
109
|
+
customStyle={{
|
|
110
|
+
fontSize: cssVar(system.fontSize.subtext.large),
|
|
111
|
+
lineHeight: cssVar(system.lineHeight.subtext.large),
|
|
112
|
+
margin: '0',
|
|
113
|
+
padding: `${cssVar(system.space.x8)} ${cssVar(system.space.x10)}`,
|
|
114
|
+
}}
|
|
115
|
+
children={code.__RAW__}
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
)}
|
|
119
|
+
<Tooltip title={copied ? 'Copied!' : 'Copy Source Code'}>
|
|
120
|
+
<TertiaryButton
|
|
121
|
+
aria-label="Copy Code"
|
|
122
|
+
size="large"
|
|
123
|
+
data-part="copy-btn"
|
|
124
|
+
variant="inverse"
|
|
125
|
+
iconPosition="end"
|
|
126
|
+
icon={copied ? checkCircleIcon : copyIcon}
|
|
127
|
+
onClick={onCopy}
|
|
128
|
+
/>
|
|
129
|
+
</Tooltip>
|
|
130
|
+
</Card.Body>
|
|
131
|
+
</Card>
|
|
132
|
+
</div>
|
|
133
|
+
);
|
|
134
|
+
};
|
package/lib/MDXElements.tsx
CHANGED
|
@@ -14,7 +14,8 @@ import {HeadingLevelContext, SymbolDialog} from './widgetUtils';
|
|
|
14
14
|
export const MDX = createComponent('div')({
|
|
15
15
|
Component({children, ...elemProps}, _ref, Element) {
|
|
16
16
|
const components = useMDXComponents();
|
|
17
|
-
|
|
17
|
+
|
|
18
|
+
return React.createElement(components[Element] || Element, elemProps, children);
|
|
18
19
|
},
|
|
19
20
|
});
|
|
20
21
|
|
package/lib/Value.tsx
CHANGED
|
@@ -8,6 +8,7 @@ import {MdxJSToJSX} from './MDXElements';
|
|
|
8
8
|
import {Table} from './Table';
|
|
9
9
|
import {capitalize, IndentLevelContext, RenderContext, indent} from './widgetUtils';
|
|
10
10
|
import {DescriptionTooltip} from './DescriptionTooltip';
|
|
11
|
+
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
11
12
|
|
|
12
13
|
const widgets: Record<string, React.FC<ValueProps>> = {};
|
|
13
14
|
|
|
@@ -52,18 +53,19 @@ export const PropertiesInline = ({properties}: {properties: types.ObjectProperty
|
|
|
52
53
|
<React.Fragment key={index}>
|
|
53
54
|
<br />
|
|
54
55
|
{indent(level + 1)}
|
|
55
|
-
{p.description ? (
|
|
56
|
+
{p.description || p.tags.deprecated ? (
|
|
56
57
|
<DescriptionTooltip
|
|
57
58
|
type="describe"
|
|
58
59
|
style={{maxWidth: '50em'}}
|
|
59
|
-
title={<MdxJSToJSX>{p.description}</MdxJSToJSX>}
|
|
60
|
+
title={<MdxJSToJSX>{p.description || p.tags.deprecated}</MdxJSToJSX>}
|
|
60
61
|
>
|
|
61
62
|
<span
|
|
62
63
|
className="token property"
|
|
63
64
|
style={{
|
|
64
65
|
cursor: 'pointer',
|
|
65
|
-
textDecoration: 'underline',
|
|
66
|
+
textDecoration: p.tags.deprecated ? 'line-through' : 'underline',
|
|
66
67
|
textDecorationStyle: 'dotted',
|
|
68
|
+
color: p.tags.deprecated ? colors.cinnamon600 : colors.plum600,
|
|
67
69
|
}}
|
|
68
70
|
>
|
|
69
71
|
{p.name}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.899-next.0",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,20 +44,21 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^12.0.0-alpha.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^12.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-react": "^12.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-styling": "^12.0.0-alpha.
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^12.0.0-alpha.899-next.0",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^12.0.0-alpha.899-next.0",
|
|
49
|
+
"@workday/canvas-kit-react": "^12.0.0-alpha.899-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^12.0.0-alpha.899-next.0",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
|
-
"@workday/canvas-tokens-web": "^2.0.
|
|
52
|
+
"@workday/canvas-tokens-web": "^2.0.1",
|
|
53
53
|
"markdown-to-jsx": "^7.2.0",
|
|
54
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
54
55
|
"ts-node": "^10.9.1"
|
|
55
56
|
},
|
|
56
57
|
"devDependencies": {
|
|
57
58
|
"fs-extra": "^10.0.0",
|
|
58
59
|
"glob": "^7.1.6",
|
|
59
60
|
"mkdirp": "^1.0.3",
|
|
60
|
-
"typescript": "4.
|
|
61
|
+
"typescript": "4.9"
|
|
61
62
|
},
|
|
62
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "56e4e94bdc7da128285ebfc3092bf95140792f9c"
|
|
63
64
|
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import Changelog from '../../../CHANGELOG.md';
|
|
2
|
-
import Markdown from '../../../utils/storybook/Markdown.tsx';
|
|
3
|
-
|
|
4
|
-
<Meta
|
|
5
|
-
title="Changelog"
|
|
6
|
-
parameters={{
|
|
7
|
-
viewMode: 'docs',
|
|
8
|
-
previewTabs: {
|
|
9
|
-
canvas: {hidden: true},
|
|
10
|
-
},
|
|
11
|
-
}}
|
|
12
|
-
/>
|
|
13
|
-
|
|
14
|
-
<Markdown content={Changelog} />
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import {Specifications, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
|
-
|
|
3
|
-
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
4
|
-
|
|
5
|
-
import Basic from './examples/Basic';
|
|
6
|
-
import Alert from './examples/Alert';
|
|
7
|
-
import Error from './examples/Error';
|
|
8
|
-
import Disabled from './examples/Disabled';
|
|
9
|
-
import LabelPositionHorizontal from './examples/LabelPositionHorizontal';
|
|
10
|
-
import RefForwarding from './examples/RefForwarding';
|
|
11
|
-
import Required from './examples/Required';
|
|
12
|
-
import Custom from './examples/Custom';
|
|
13
|
-
import CustomId from './examples/CustomId';
|
|
14
|
-
import AllFields from './examples/AllFields';
|
|
15
|
-
import Hint from './examples/Hint';
|
|
16
|
-
import FieldSet from './examples/FieldSet';
|
|
17
|
-
import Grow from './examples/Grow';
|
|
18
|
-
import ThemedError from './examples/ThemedErrors';
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
# Canvas Kit Form Field
|
|
22
|
-
|
|
23
|
-
FormField allows users to wrap input components to make them accessible. You can customize the field
|
|
24
|
-
by passing in `TextInput`, `Select`, `RadioGroup` and other form elements to `FormField.Input`.
|
|
25
|
-
|
|
26
|
-
## Installation
|
|
27
|
-
|
|
28
|
-
```sh
|
|
29
|
-
yarn add @workday/canvas-kit-preview-react
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Usage
|
|
33
|
-
|
|
34
|
-
### Basic
|
|
35
|
-
|
|
36
|
-
Form Field should be used in tandem with most Canvas Kit input components to ensure they meet
|
|
37
|
-
accessibility standards. The orientation of the label by default is `vertical`.
|
|
38
|
-
|
|
39
|
-
<ExampleCodeBlock code={Basic} />
|
|
40
|
-
|
|
41
|
-
### Error States
|
|
42
|
-
|
|
43
|
-
Set the `error` prop of the Form Field or define it in the model to indicate it has an error.
|
|
44
|
-
`error` accepts the following values:
|
|
45
|
-
|
|
46
|
-
`"error" | "alert" | undefined`
|
|
47
|
-
|
|
48
|
-
### Alert
|
|
49
|
-
|
|
50
|
-
Use the alert state when a value is valid but there is additional information.
|
|
51
|
-
|
|
52
|
-
<ExampleCodeBlock code={Alert} />
|
|
53
|
-
|
|
54
|
-
### Error
|
|
55
|
-
|
|
56
|
-
Use the error state when the value is no longer valid.
|
|
57
|
-
|
|
58
|
-
<ExampleCodeBlock code={Error} />
|
|
59
|
-
|
|
60
|
-
### Disabled
|
|
61
|
-
|
|
62
|
-
Set the `disabled` prop of `FormField.Input` to prevent users from interacting with it.
|
|
63
|
-
|
|
64
|
-
<ExampleCodeBlock code={Disabled} />
|
|
65
|
-
|
|
66
|
-
### Hint
|
|
67
|
-
|
|
68
|
-
Use `FormField.Hint` to display a short message below the input component and `FormField.Container`
|
|
69
|
-
to ensure proper alignment.
|
|
70
|
-
|
|
71
|
-
<ExampleCodeBlock code={Hint} />
|
|
72
|
-
|
|
73
|
-
### Label Position Horizontal
|
|
74
|
-
|
|
75
|
-
Set the `orientation` prop of the Form Field to designate the position of the label relative to the
|
|
76
|
-
input component. By default, the orientation will be set to `vertical`.
|
|
77
|
-
|
|
78
|
-
<ExampleCodeBlock code={LabelPositionHorizontal} />
|
|
79
|
-
|
|
80
|
-
### Grow
|
|
81
|
-
|
|
82
|
-
Set the `grow` prop of the Form Field to `true` to configure it (including the wrapped input
|
|
83
|
-
component) to expand to the width of its container.
|
|
84
|
-
|
|
85
|
-
**Note: This Prop is deprecated and will be removed in a future major version.**
|
|
86
|
-
|
|
87
|
-
<ExampleCodeBlock code={Grow} />
|
|
88
|
-
|
|
89
|
-
### Ref Forwarding
|
|
90
|
-
|
|
91
|
-
If you need full customization you can use the `FormField` behavior hooks to build your own
|
|
92
|
-
solution. It is also easy it work with custom components or third party libraries and get the CKR
|
|
93
|
-
accessibility guarantees by using the `as` prop.
|
|
94
|
-
|
|
95
|
-
<ExampleCodeBlock code={RefForwarding} />
|
|
96
|
-
|
|
97
|
-
### Required
|
|
98
|
-
|
|
99
|
-
Set the `isRequired` prop of the Form Field to `true` to indicate that the field is required. Labels
|
|
100
|
-
for required fields are suffixed by a red asterisk.
|
|
101
|
-
|
|
102
|
-
<ExampleCodeBlock code={Required} />
|
|
103
|
-
|
|
104
|
-
### Field Set
|
|
105
|
-
|
|
106
|
-
Set the `as` prop of the `FormField` to `fieldset` and the `as` prop of the `FormField.Label` to
|
|
107
|
-
`legend` when using `RadioGroup` to ensure proper accessbility.
|
|
108
|
-
|
|
109
|
-
<ExampleCodeBlock code={FieldSet} />
|
|
110
|
-
|
|
111
|
-
### Custom
|
|
112
|
-
|
|
113
|
-
If you need full customization you can use the `FormField` behavior hooks to build your own
|
|
114
|
-
solution. It is also easy it work with custom components or third party libraries and get the CKR
|
|
115
|
-
accessibility guarantees by using the `as` prop.
|
|
116
|
-
|
|
117
|
-
<ExampleCodeBlock code={Custom} />
|
|
118
|
-
|
|
119
|
-
### Custom id
|
|
120
|
-
|
|
121
|
-
Form Field will automatically generate an HTML `id` for its input element to link it to the
|
|
122
|
-
correponding label. Alternatively, you may set the `id` prop of the Form Field to specify a custom
|
|
123
|
-
`id` for the input element. The `id` will be appended by `input-${your-unique-id}`.
|
|
124
|
-
|
|
125
|
-
<ExampleCodeBlock code={CustomId} />
|
|
126
|
-
|
|
127
|
-
### All Fields
|
|
128
|
-
|
|
129
|
-
Form Field should allow you to use it with all `inputs` including `Select`, `TextInput`, `Checkbox`,
|
|
130
|
-
`TextArea`, `Switch`, and `RadioGroup`.
|
|
131
|
-
|
|
132
|
-
<ExampleCodeBlock code={AllFields} />
|
|
133
|
-
|
|
134
|
-
### Themed Errors
|
|
135
|
-
|
|
136
|
-
You can theme your error rings by wrapping an input in a `CanvasProvider` and defining
|
|
137
|
-
`focusOutline` and `error` properties on the `theme`.
|
|
138
|
-
|
|
139
|
-
<ExampleCodeBlock code={ThemedError} />
|
|
140
|
-
|
|
141
|
-
### Custom Styles
|
|
142
|
-
|
|
143
|
-
Form Field and its subcomponents support custom styling via the `cs` prop. For more information,
|
|
144
|
-
check our
|
|
145
|
-
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--page).
|
|
146
|
-
|
|
147
|
-
## Component API
|
|
148
|
-
|
|
149
|
-
<SymbolDoc name="FormField" fileName="/preview-react/" />
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
|
-
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
4
|
-
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
-
|
|
6
|
-
export default () => {
|
|
7
|
-
const [value, setValue] = React.useState('');
|
|
8
|
-
|
|
9
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
10
|
-
setValue(event.target.value);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Flex>
|
|
15
|
-
<FormField error="alert">
|
|
16
|
-
<FormField.Label>First Name</FormField.Label>
|
|
17
|
-
<FormField.Container>
|
|
18
|
-
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
19
|
-
<FormField.Hint>Cannot contain numbers</FormField.Hint>
|
|
20
|
-
</FormField.Container>
|
|
21
|
-
</FormField>
|
|
22
|
-
</Flex>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
|
-
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
4
|
-
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
|
-
|
|
6
|
-
export default () => {
|
|
7
|
-
const [value, setValue] = React.useState('');
|
|
8
|
-
|
|
9
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
10
|
-
setValue(event.target.value);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Flex>
|
|
15
|
-
<FormField>
|
|
16
|
-
<FormField.Label>First Name</FormField.Label>
|
|
17
|
-
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
18
|
-
</FormField>
|
|
19
|
-
</Flex>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
|
-
|
|
4
|
-
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
|
-
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
|
-
|
|
7
|
-
export default () => {
|
|
8
|
-
const [value, setValue] = React.useState('');
|
|
9
|
-
|
|
10
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
11
|
-
setValue(event.target.value);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Flex>
|
|
16
|
-
<FormField error="error">
|
|
17
|
-
<FormField.Label>Password</FormField.Label>
|
|
18
|
-
<FormField.Container>
|
|
19
|
-
<FormField.Input as={TextInput} type="password" value={value} onChange={handleChange} />
|
|
20
|
-
<FormField.Hint>Must Contain a number and a capital letter</FormField.Hint>
|
|
21
|
-
</FormField.Container>
|
|
22
|
-
</FormField>
|
|
23
|
-
</Flex>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
|
-
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
4
|
-
import {RadioGroup} from '@workday/canvas-kit-preview-react/radio';
|
|
5
|
-
|
|
6
|
-
export default () => {
|
|
7
|
-
const [value, setValue] = React.useState('');
|
|
8
|
-
|
|
9
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
10
|
-
setValue(event.target.value);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Flex>
|
|
15
|
-
<FormField as="fieldset">
|
|
16
|
-
<FormField.Label as="legend">Radio Group Legend</FormField.Label>
|
|
17
|
-
<FormField.Input as={RadioGroup} onChange={handleChange} value={value}>
|
|
18
|
-
<RadioGroup.RadioButton value="deep-dish">Deep dish</RadioGroup.RadioButton>
|
|
19
|
-
<RadioGroup.RadioButton value="thin">Thin</RadioGroup.RadioButton>
|
|
20
|
-
<RadioGroup.RadioButton value="gluten-free">Gluten free</RadioGroup.RadioButton>
|
|
21
|
-
<RadioGroup.RadioButton value="cauliflower">Cauliflower</RadioGroup.RadioButton>
|
|
22
|
-
<RadioGroup.RadioButton value="butter">
|
|
23
|
-
Butter - the best thing to put on bread
|
|
24
|
-
</RadioGroup.RadioButton>
|
|
25
|
-
</FormField.Input>
|
|
26
|
-
</FormField>
|
|
27
|
-
</Flex>
|
|
28
|
-
);
|
|
29
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
|
-
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
4
|
-
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
|
-
|
|
6
|
-
export default () => {
|
|
7
|
-
const [value, setValue] = React.useState('');
|
|
8
|
-
|
|
9
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
10
|
-
setValue(event.target.value);
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<Flex>
|
|
15
|
-
<FormField grow>
|
|
16
|
-
<FormField.Label>First Name</FormField.Label>
|
|
17
|
-
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
18
|
-
</FormField>
|
|
19
|
-
</Flex>
|
|
20
|
-
);
|
|
21
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
3
|
-
|
|
4
|
-
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
|
-
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
|
-
|
|
7
|
-
export default () => {
|
|
8
|
-
const [value, setValue] = React.useState('');
|
|
9
|
-
|
|
10
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
11
|
-
setValue(event.target.value);
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
return (
|
|
15
|
-
<Flex>
|
|
16
|
-
<FormField orientation="horizontal">
|
|
17
|
-
<FormField.Label>First Name</FormField.Label>
|
|
18
|
-
<FormField.Container>
|
|
19
|
-
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
20
|
-
<FormField.Hint>Cannot contain numbers</FormField.Hint>
|
|
21
|
-
</FormField.Container>
|
|
22
|
-
</FormField>
|
|
23
|
-
</Flex>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
3
|
-
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
4
|
-
|
|
5
|
-
export default () => {
|
|
6
|
-
const [value, setValue] = React.useState('');
|
|
7
|
-
|
|
8
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
9
|
-
setValue(event.target.value);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<FormField orientation="horizontal">
|
|
14
|
-
<FormField.Label>Email</FormField.Label>
|
|
15
|
-
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
16
|
-
</FormField>
|
|
17
|
-
);
|
|
18
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
3
|
-
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
4
|
-
|
|
5
|
-
export default () => {
|
|
6
|
-
const [value, setValue] = React.useState('');
|
|
7
|
-
|
|
8
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
9
|
-
setValue(event.target.value);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<FormField isRequired={true}>
|
|
14
|
-
<FormField.Label>Email</FormField.Label>
|
|
15
|
-
<FormField.Input
|
|
16
|
-
as={TextInput}
|
|
17
|
-
placeholder="your@gmail.com"
|
|
18
|
-
onChange={handleChange}
|
|
19
|
-
value={value}
|
|
20
|
-
/>
|
|
21
|
-
</FormField>
|
|
22
|
-
);
|
|
23
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import Basic from './examples/GlobalHeader';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
# Canvas Kit Examples
|
|
5
|
-
|
|
6
|
-
## GlobalHeader
|
|
7
|
-
|
|
8
|
-
Developers building internal Workday applications will likely not need to create this component.
|
|
9
|
-
However, if you're building components to be used outside of Workday, this is a helpful reference
|
|
10
|
-
for building a global navigation header that looks like our internal `GlobalHeader`.
|
|
11
|
-
|
|
12
|
-
<ExampleCodeBlock code={Basic} />
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
|
-
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
4
|
-
|
|
5
|
-
export default () => {
|
|
6
|
-
const [value, setValue] = React.useState('invalid@email');
|
|
7
|
-
|
|
8
|
-
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
9
|
-
setValue(event.target.value);
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<FormField
|
|
14
|
-
alertLabel="Warning"
|
|
15
|
-
error={FormField.ErrorType.Alert}
|
|
16
|
-
hintId="hint-alert"
|
|
17
|
-
hintText="Please enter a valid email."
|
|
18
|
-
label="Email"
|
|
19
|
-
>
|
|
20
|
-
<TextInput onChange={handleChange} value={value} />
|
|
21
|
-
</FormField>
|
|
22
|
-
);
|
|
23
|
-
};
|