@workday/canvas-kit-docs 12.0.0-alpha.855-next.0 → 12.0.0-alpha.898-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 +56 -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 +45199 -40010
- 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 +356 -35
- 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}/GlobalHeader.tsx +1 -1
- 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 +95 -0
- package/dist/mdx/react/avatar/avatar/examples/Basic.tsx +18 -0
- package/dist/mdx/react/avatar/avatar/examples/Button.tsx +21 -0
- package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +35 -0
- package/dist/mdx/react/avatar/avatar/examples/Image.tsx +26 -0
- package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +15 -0
- package/dist/mdx/react/avatar/avatar/examples/ObjectFit.tsx +25 -0
- package/dist/mdx/react/avatar/avatar/examples/Size.tsx +28 -0
- package/dist/mdx/react/avatar/avatar/examples/Variant.tsx +11 -0
- 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 +83 -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}/MediaModal.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/PageHeader.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/SearchFormBasic.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/SegmentControlWithText.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/SidePanelWithOverlay.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithSelectableRows.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithSortableColumnHeaders.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/compoundComponent/CustomCard.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/AreaColumnPositioning.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/CustomColumnPositioning.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/CustomColumnWidth.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/FullWidthWith3Columns.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/FullWidthWith3Columns2Rows.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Masonry.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/ResponsiveColumns.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Tiled2and3Columns.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Tiled4and2Columns.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/Basic.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/BasicGrid.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/BasicVirtual.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/DataLoader.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/DynamicItemsObjects.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/DynamicItemsStrings.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/IdentifiedItems.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/MultiSelection.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/RovingFocus.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/Selection.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/StringChildren.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/Virtualization.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/WrappingGrid.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateComponent.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateContainer.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateElemPropsHook.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateModelHook.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateSubcomponent.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/ResponsiveViewport.tsx +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-
|
|
2
|
+
import {FormField, FormFieldGroup} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
5
|
import {RadioGroup} from '@workday/canvas-kit-preview-react/radio';
|
|
@@ -22,19 +22,23 @@ export default () => {
|
|
|
22
22
|
<Flex cs={parentContainerStyles}>
|
|
23
23
|
<FormField grow>
|
|
24
24
|
<FormField.Label>First Name</FormField.Label>
|
|
25
|
-
<FormField.
|
|
25
|
+
<FormField.Field>
|
|
26
|
+
<FormField.Input as={TextInput} />
|
|
27
|
+
</FormField.Field>
|
|
26
28
|
</FormField>
|
|
27
29
|
|
|
28
30
|
<FormField isRequired={true} error="alert" grow>
|
|
29
31
|
<FormField.Label>Email</FormField.Label>
|
|
30
|
-
<FormField.
|
|
32
|
+
<FormField.Field>
|
|
31
33
|
<FormField.Input as={TextInput} />
|
|
32
34
|
<FormField.Hint>Hint text for your input</FormField.Hint>
|
|
33
|
-
</FormField.
|
|
35
|
+
</FormField.Field>
|
|
34
36
|
</FormField>
|
|
35
37
|
<FormField grow>
|
|
36
38
|
<FormField.Label>Text Area Label</FormField.Label>
|
|
37
|
-
<FormField.
|
|
39
|
+
<FormField.Field>
|
|
40
|
+
<FormField.Input as={TextArea} />
|
|
41
|
+
</FormField.Field>
|
|
38
42
|
</FormField>
|
|
39
43
|
<FormField error="error" grow>
|
|
40
44
|
<FormField.Label>Choose a Crust</FormField.Label>
|
|
@@ -47,7 +51,7 @@ export default () => {
|
|
|
47
51
|
</Select.Popper>
|
|
48
52
|
</Select>
|
|
49
53
|
</FormField>
|
|
50
|
-
<FormField as="fieldset" isRequired={true} error={'error'} orientation="
|
|
54
|
+
<FormField as="fieldset" isRequired={true} error={'error'} orientation="horizontalStart" grow>
|
|
51
55
|
<FormField.Label as="legend">Radio Group Legend</FormField.Label>
|
|
52
56
|
<FormField.Container>
|
|
53
57
|
<FormField.Input as={RadioGroup}>
|
|
@@ -68,10 +72,41 @@ export default () => {
|
|
|
68
72
|
<FormField.Input checked={false} as={Checkbox} label="Thin Crust" />
|
|
69
73
|
<FormField.Input checked={false} as={Checkbox} label="Extra Cheese" />
|
|
70
74
|
</FormField>
|
|
75
|
+
<FormFieldGroup error="error" orientation="horizontalStart" grow>
|
|
76
|
+
<FormFieldGroup.Label>Choose Your Crust</FormFieldGroup.Label>
|
|
77
|
+
<FormFieldGroup.Field>
|
|
78
|
+
<FormFieldGroup.List as={RadioGroup}>
|
|
79
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="thin-crust">
|
|
80
|
+
Thin Crust
|
|
81
|
+
</FormFieldGroup.Input>
|
|
82
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="hand-tossed">
|
|
83
|
+
Hand Tossed
|
|
84
|
+
</FormFieldGroup.Input>
|
|
85
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="deep-dish">
|
|
86
|
+
Deep Dish
|
|
87
|
+
</FormFieldGroup.Input>
|
|
88
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="cauliflower">
|
|
89
|
+
Cauliflower
|
|
90
|
+
</FormFieldGroup.Input>
|
|
91
|
+
</FormFieldGroup.List>
|
|
92
|
+
</FormFieldGroup.Field>
|
|
93
|
+
</FormFieldGroup>
|
|
94
|
+
<FormFieldGroup grow>
|
|
95
|
+
<FormFieldGroup.Label>Checkbox Legend</FormFieldGroup.Label>
|
|
96
|
+
<FormField.Field>
|
|
97
|
+
<FormFieldGroup.List>
|
|
98
|
+
<FormFieldGroup.Input checked={true} as={Checkbox} label="Checkbox Label" />
|
|
99
|
+
<FormFieldGroup.Input checked={false} as={Checkbox} label="Thin Crust" />
|
|
100
|
+
<FormFieldGroup.Input checked={false} as={Checkbox} label="Extra Cheese" />
|
|
101
|
+
</FormFieldGroup.List>
|
|
102
|
+
</FormField.Field>
|
|
103
|
+
</FormFieldGroup>
|
|
71
104
|
|
|
72
|
-
<FormField orientation="
|
|
105
|
+
<FormField orientation="horizontalStart" grow>
|
|
73
106
|
<FormField.Label>Switch Label</FormField.Label>
|
|
74
|
-
<FormField.
|
|
107
|
+
<FormField.Field>
|
|
108
|
+
<FormField.Input as={Switch} />
|
|
109
|
+
</FormField.Field>
|
|
75
110
|
</FormField>
|
|
76
111
|
</Flex>
|
|
77
112
|
);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
3
4
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
4
|
-
import {FormFieldLabelPosition} from '../../lib/types';
|
|
5
5
|
|
|
6
6
|
export default () => {
|
|
7
7
|
const [value, setValue] = React.useState('');
|
|
@@ -11,8 +11,13 @@ export default () => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
14
|
+
<Flex>
|
|
15
|
+
<FormField>
|
|
16
|
+
<FormField.Label>First Name</FormField.Label>
|
|
17
|
+
<FormField.Field>
|
|
18
|
+
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
19
|
+
</FormField.Field>
|
|
20
|
+
</FormField>
|
|
21
|
+
</Flex>
|
|
17
22
|
);
|
|
18
23
|
};
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
useFormFieldLabel,
|
|
6
6
|
useFormFieldModel,
|
|
7
7
|
formFieldStencil,
|
|
8
|
-
} from '@workday/canvas-kit-
|
|
8
|
+
} from '@workday/canvas-kit-react/form-field';
|
|
9
9
|
import {useModelContext} from '@workday/canvas-kit-react/common';
|
|
10
10
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
11
11
|
|
|
@@ -45,7 +45,7 @@ export default () => {
|
|
|
45
45
|
const model = useFormFieldModel({isRequired: true});
|
|
46
46
|
|
|
47
47
|
return (
|
|
48
|
-
<Flex cs={formFieldStencil({orientation: '
|
|
48
|
+
<Flex cs={formFieldStencil({orientation: 'horizontalStart'})}>
|
|
49
49
|
<Label model={model}>My Custom Field</Label>
|
|
50
50
|
<Input model={model} value={value} onChange={handleChange} />
|
|
51
51
|
<Hint model={model}>You can be anything</Hint>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-
|
|
2
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
5
|
|
|
@@ -14,7 +14,9 @@ export default () => {
|
|
|
14
14
|
<Flex>
|
|
15
15
|
<FormField id="first-name">
|
|
16
16
|
<FormField.Label>First Name</FormField.Label>
|
|
17
|
-
<FormField.
|
|
17
|
+
<FormField.Field>
|
|
18
|
+
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
19
|
+
</FormField.Field>
|
|
18
20
|
</FormField>
|
|
19
21
|
</Flex>
|
|
20
22
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-
|
|
2
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
|
|
4
4
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
5
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
@@ -15,7 +15,9 @@ export default () => {
|
|
|
15
15
|
<Flex>
|
|
16
16
|
<FormField>
|
|
17
17
|
<FormField.Label>Email</FormField.Label>
|
|
18
|
-
<FormField.
|
|
18
|
+
<FormField.Field>
|
|
19
|
+
<FormField.Input as={TextInput} value={value} disabled onChange={handleChange} />
|
|
20
|
+
</FormField.Field>
|
|
19
21
|
</FormField>
|
|
20
22
|
</Flex>
|
|
21
23
|
);
|
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
|
+
|
|
3
4
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
4
6
|
|
|
5
7
|
export default () => {
|
|
6
|
-
const [value, setValue] = React.useState('
|
|
8
|
+
const [value, setValue] = React.useState('');
|
|
7
9
|
|
|
8
10
|
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
9
11
|
setValue(event.target.value);
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
return (
|
|
13
|
-
<
|
|
14
|
-
error=
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
<Flex>
|
|
16
|
+
<FormField error="error">
|
|
17
|
+
<FormField.Label>Password</FormField.Label>
|
|
18
|
+
<FormField.Field>
|
|
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.Field>
|
|
22
|
+
</FormField>
|
|
23
|
+
</Flex>
|
|
21
24
|
);
|
|
22
25
|
};
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {FormFieldGroup} from '@workday/canvas-kit-react/form-field';
|
|
3
|
+
import {PrimaryButton, SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
import {Banner} from '@workday/canvas-kit-react/banner';
|
|
6
|
+
|
|
7
|
+
import {Checkbox} from '@workday/canvas-kit-react/checkbox';
|
|
8
|
+
import {RadioGroup} from '@workday/canvas-kit-preview-react/radio';
|
|
9
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
10
|
+
import {AriaLiveRegion} from '@workday/canvas-kit-react/common';
|
|
11
|
+
|
|
12
|
+
const formStyles = createStyles({
|
|
13
|
+
margin: `${system.space.zero} ${system.space.x3}`,
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const formButtonStyles = createStyles({
|
|
17
|
+
display: 'inline-flex',
|
|
18
|
+
gap: system.space.x2,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
const toppings = [
|
|
22
|
+
{
|
|
23
|
+
id: 1,
|
|
24
|
+
label: 'Pepperoni',
|
|
25
|
+
checked: false,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
id: 2,
|
|
29
|
+
label: 'Cheese',
|
|
30
|
+
checked: false,
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 3,
|
|
34
|
+
label: 'Pineapple',
|
|
35
|
+
checked: false,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: 4,
|
|
39
|
+
label: 'Mushrooms',
|
|
40
|
+
checked: false,
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
|
|
44
|
+
const bannerStyles = createStyles({
|
|
45
|
+
position: 'absolute',
|
|
46
|
+
right: 0,
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export default () => {
|
|
50
|
+
const [toppingsState, setToppingsState] = React.useState(toppings);
|
|
51
|
+
const [error, setError] = React.useState(undefined);
|
|
52
|
+
const [radioError, setRadioError] = React.useState(undefined);
|
|
53
|
+
const [showSuccess, setShowSuccess] = React.useState(false);
|
|
54
|
+
|
|
55
|
+
const [value, setValue] = React.useState<string>('');
|
|
56
|
+
const [formData, setFormData] = React.useState({
|
|
57
|
+
toppings: [],
|
|
58
|
+
crust: '',
|
|
59
|
+
});
|
|
60
|
+
const handleCheckboxCheck = id => {
|
|
61
|
+
if (error) {
|
|
62
|
+
setError(undefined);
|
|
63
|
+
}
|
|
64
|
+
setToppingsState(
|
|
65
|
+
toppingsState.map(item => (item.id === id ? {...item, checked: !item.checked} : item))
|
|
66
|
+
);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const handleRadioChange = (e: React.ChangeEvent) => {
|
|
70
|
+
if (radioError) {
|
|
71
|
+
setRadioError(undefined);
|
|
72
|
+
}
|
|
73
|
+
const target = e.currentTarget;
|
|
74
|
+
if (target instanceof HTMLInputElement) {
|
|
75
|
+
setValue(target.value);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const handleSubmit = e => {
|
|
80
|
+
e.preventDefault();
|
|
81
|
+
const radioError = !value && toppingsState.some(item => !item.checked) ? 'error' : undefined;
|
|
82
|
+
const error = toppingsState.every(item => !item.checked) ? 'error' : undefined;
|
|
83
|
+
|
|
84
|
+
setRadioError(radioError);
|
|
85
|
+
setError(error);
|
|
86
|
+
if (!error && !radioError && toppingsState.some(item => item.checked) && value) {
|
|
87
|
+
setShowSuccess(true);
|
|
88
|
+
}
|
|
89
|
+
setFormData({
|
|
90
|
+
toppings: toppingsState,
|
|
91
|
+
crust: value,
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
React.useEffect(() => {
|
|
96
|
+
const timeout = setTimeout(() => {
|
|
97
|
+
if (showSuccess) {
|
|
98
|
+
setShowSuccess(false);
|
|
99
|
+
}
|
|
100
|
+
}, 3000);
|
|
101
|
+
|
|
102
|
+
return () => clearTimeout(timeout);
|
|
103
|
+
}, [showSuccess]);
|
|
104
|
+
|
|
105
|
+
const handleReset = () => {
|
|
106
|
+
setFormData({toppings: [], crust: ''});
|
|
107
|
+
setError(undefined);
|
|
108
|
+
setValue('');
|
|
109
|
+
setRadioError('');
|
|
110
|
+
setShowSuccess(false);
|
|
111
|
+
setToppingsState(
|
|
112
|
+
toppingsState.map(item => {
|
|
113
|
+
return {...item, checked: false};
|
|
114
|
+
})
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
|
|
118
|
+
return (
|
|
119
|
+
<div>
|
|
120
|
+
<h3>Choose your pizza options</h3>
|
|
121
|
+
<AriaLiveRegion role="alert">
|
|
122
|
+
<div style={{display: 'flex', gap: '40px'}}>
|
|
123
|
+
{error || radioError ? (
|
|
124
|
+
<Banner isSticky hasError className={bannerStyles}>
|
|
125
|
+
<Banner.Label>
|
|
126
|
+
{error && radioError
|
|
127
|
+
? 'At least one topping and crust selection is required'
|
|
128
|
+
: error
|
|
129
|
+
? 'You must choose at least one topping'
|
|
130
|
+
: radioError
|
|
131
|
+
? 'You must choose a crust'
|
|
132
|
+
: ''}
|
|
133
|
+
</Banner.Label>
|
|
134
|
+
</Banner>
|
|
135
|
+
) : null}
|
|
136
|
+
{showSuccess && (
|
|
137
|
+
<Banner isSticky className={bannerStyles}>
|
|
138
|
+
<Banner.Label>You've successfully submitted your pizza options.</Banner.Label>
|
|
139
|
+
</Banner>
|
|
140
|
+
)}
|
|
141
|
+
</div>
|
|
142
|
+
</AriaLiveRegion>
|
|
143
|
+
|
|
144
|
+
<form className={formStyles} onSubmit={handleSubmit}>
|
|
145
|
+
<FormFieldGroup error={error} isRequired>
|
|
146
|
+
<FormFieldGroup.Label>Choose Your Toppings</FormFieldGroup.Label>
|
|
147
|
+
<FormFieldGroup.List>
|
|
148
|
+
{toppingsState.map(item => {
|
|
149
|
+
return (
|
|
150
|
+
<FormFieldGroup.Input
|
|
151
|
+
key={item.id}
|
|
152
|
+
onChange={() => handleCheckboxCheck(item.id)}
|
|
153
|
+
checked={item.checked}
|
|
154
|
+
value={item.label}
|
|
155
|
+
as={Checkbox}
|
|
156
|
+
disabled={item.label === 'Pineapple' ? true : undefined}
|
|
157
|
+
label={item.label}
|
|
158
|
+
/>
|
|
159
|
+
);
|
|
160
|
+
})}
|
|
161
|
+
</FormFieldGroup.List>
|
|
162
|
+
<FormFieldGroup.Hint>
|
|
163
|
+
{error === 'error' && 'You must choose one topping'}
|
|
164
|
+
</FormFieldGroup.Hint>
|
|
165
|
+
</FormFieldGroup>
|
|
166
|
+
<FormFieldGroup error={radioError} isRequired>
|
|
167
|
+
<FormFieldGroup.Label>Choose Your Crust</FormFieldGroup.Label>
|
|
168
|
+
<FormFieldGroup.Field>
|
|
169
|
+
<FormFieldGroup.List
|
|
170
|
+
as={RadioGroup}
|
|
171
|
+
onChange={handleRadioChange}
|
|
172
|
+
value={value}
|
|
173
|
+
name="crust"
|
|
174
|
+
>
|
|
175
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="thin-crust">
|
|
176
|
+
Thin Crust
|
|
177
|
+
</FormFieldGroup.Input>
|
|
178
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="hand-tossed">
|
|
179
|
+
Hand Tossed
|
|
180
|
+
</FormFieldGroup.Input>
|
|
181
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="deep-dish">
|
|
182
|
+
Deep Dish
|
|
183
|
+
</FormFieldGroup.Input>
|
|
184
|
+
<FormFieldGroup.Input as={RadioGroup.RadioButton} value="cauliflower">
|
|
185
|
+
Cauliflower
|
|
186
|
+
</FormFieldGroup.Input>
|
|
187
|
+
</FormFieldGroup.List>
|
|
188
|
+
<FormFieldGroup.Hint>
|
|
189
|
+
{radioError === 'error' ? 'You must choose a crust' : null}
|
|
190
|
+
</FormFieldGroup.Hint>
|
|
191
|
+
</FormFieldGroup.Field>
|
|
192
|
+
</FormFieldGroup>
|
|
193
|
+
<div className={formButtonStyles}>
|
|
194
|
+
<PrimaryButton type="submit">Submit Your Choices</PrimaryButton>
|
|
195
|
+
<SecondaryButton onClick={() => handleReset()}>Reset Form</SecondaryButton>
|
|
196
|
+
</div>
|
|
197
|
+
</form>
|
|
198
|
+
<div>
|
|
199
|
+
<div>
|
|
200
|
+
Selected Toppings:{' '}
|
|
201
|
+
{!error && formData.toppings.map(item => (item.checked ? `${item.label} ` : null))}
|
|
202
|
+
</div>
|
|
203
|
+
<div>Selected Crust: {formData.crust}</div>
|
|
204
|
+
</div>
|
|
205
|
+
</div>
|
|
206
|
+
);
|
|
207
|
+
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
3
4
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
4
5
|
|
|
5
6
|
export default () => {
|
|
@@ -10,8 +11,11 @@ export default () => {
|
|
|
10
11
|
};
|
|
11
12
|
|
|
12
13
|
return (
|
|
13
|
-
<
|
|
14
|
-
<
|
|
15
|
-
|
|
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>
|
|
16
20
|
);
|
|
17
21
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
|
+
|
|
3
4
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
4
|
-
import {
|
|
5
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
6
|
|
|
6
7
|
export default () => {
|
|
7
8
|
const [value, setValue] = React.useState('');
|
|
@@ -11,12 +12,14 @@ export default () => {
|
|
|
11
12
|
};
|
|
12
13
|
|
|
13
14
|
return (
|
|
14
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
<Flex>
|
|
16
|
+
<FormField orientation="horizontalStart">
|
|
17
|
+
<FormField.Label>First Name</FormField.Label>
|
|
18
|
+
<FormField.Field>
|
|
19
|
+
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
20
|
+
<FormField.Hint>Cannot contain numbers</FormField.Hint>
|
|
21
|
+
</FormField.Field>
|
|
22
|
+
</FormField>
|
|
23
|
+
</Flex>
|
|
21
24
|
);
|
|
22
25
|
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
3
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
4
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
5
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
|
+
|
|
7
|
+
const formStyles = createStyles({
|
|
8
|
+
display: 'flex',
|
|
9
|
+
gap: system.space.x2,
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default () => {
|
|
14
|
+
const [value, setValue] = React.useState('');
|
|
15
|
+
|
|
16
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
17
|
+
setValue(event.target.value);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<form className={formStyles}>
|
|
22
|
+
<FormField orientation="horizontalEnd">
|
|
23
|
+
<FormField.Label>Email</FormField.Label>
|
|
24
|
+
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
25
|
+
</FormField>
|
|
26
|
+
<FormField orientation="horizontalEnd">
|
|
27
|
+
<FormField.Label>Password</FormField.Label>
|
|
28
|
+
<FormField.Input as={TextInput} type="password" />
|
|
29
|
+
</FormField>
|
|
30
|
+
</form>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
3
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
4
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
5
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
|
+
|
|
7
|
+
const formStyles = createStyles({
|
|
8
|
+
display: 'flex',
|
|
9
|
+
gap: system.space.x2,
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default () => {
|
|
14
|
+
const [value, setValue] = React.useState('');
|
|
15
|
+
|
|
16
|
+
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
17
|
+
setValue(event.target.value);
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<form className={formStyles}>
|
|
22
|
+
<FormField orientation="horizontalStart">
|
|
23
|
+
<FormField.Label>Email</FormField.Label>
|
|
24
|
+
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
25
|
+
</FormField>
|
|
26
|
+
<FormField orientation="horizontalStart">
|
|
27
|
+
<FormField.Label>Password</FormField.Label>
|
|
28
|
+
<FormField.Input as={TextInput} type="password" />
|
|
29
|
+
</FormField>
|
|
30
|
+
</form>
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -3,7 +3,7 @@ import {changeFocus} from '@workday/canvas-kit-react/common';
|
|
|
3
3
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
4
4
|
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
5
5
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
6
|
-
import {FormField} from '@workday/canvas-kit-
|
|
6
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
7
7
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
8
8
|
import {system} from '@workday/canvas-tokens-web';
|
|
9
9
|
|
|
@@ -29,7 +29,9 @@ export default () => {
|
|
|
29
29
|
<Flex cs={parentContainerStyles}>
|
|
30
30
|
<FormField>
|
|
31
31
|
<FormField.Label>Email</FormField.Label>
|
|
32
|
-
<FormField.
|
|
32
|
+
<FormField.Field>
|
|
33
|
+
<FormField.Input as={TextInput} onChange={handleChange} value={value} ref={ref} />
|
|
34
|
+
</FormField.Field>
|
|
33
35
|
</FormField>
|
|
34
36
|
<SecondaryButton onClick={handleClick}>Focus Text Input</SecondaryButton>
|
|
35
37
|
</Flex>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
2
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
3
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
4
4
|
|
|
5
5
|
export default () => {
|
|
6
6
|
const [value, setValue] = React.useState('');
|
|
@@ -10,8 +10,16 @@ export default () => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
|
-
<FormField
|
|
14
|
-
<
|
|
13
|
+
<FormField isRequired={true}>
|
|
14
|
+
<FormField.Label>Email</FormField.Label>
|
|
15
|
+
<FormField.Field>
|
|
16
|
+
<FormField.Input
|
|
17
|
+
as={TextInput}
|
|
18
|
+
placeholder="your@gmail.com"
|
|
19
|
+
onChange={handleChange}
|
|
20
|
+
value={value}
|
|
21
|
+
/>
|
|
22
|
+
</FormField.Field>
|
|
15
23
|
</FormField>
|
|
16
24
|
);
|
|
17
25
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
3
|
-
import {FormField} from '@workday/canvas-kit-
|
|
3
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
4
4
|
import {CanvasProvider, PartialEmotionCanvasTheme} from '@workday/canvas-kit-react/common';
|
|
5
5
|
import {colors, space} from '@workday/canvas-kit-react/tokens';
|
|
6
6
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
@@ -34,10 +34,12 @@ export default () => {
|
|
|
34
34
|
<CanvasProvider theme={theme}>
|
|
35
35
|
<FormField error={!value ? 'error' : undefined} isRequired={true} orientation="vertical">
|
|
36
36
|
<FormField.Label>Email</FormField.Label>
|
|
37
|
-
<FormField.
|
|
38
|
-
|
|
39
|
-
{
|
|
40
|
-
|
|
37
|
+
<FormField.Field>
|
|
38
|
+
<FormField.Input as={TextInput} onChange={handleChange} value={value} />
|
|
39
|
+
<FormField.Hint cs={formFieldHintStyles}>
|
|
40
|
+
{!value && 'Please enter an email.'}
|
|
41
|
+
</FormField.Hint>
|
|
42
|
+
</FormField.Field>
|
|
41
43
|
</FormField>
|
|
42
44
|
</CanvasProvider>
|
|
43
45
|
);
|
|
@@ -1,28 +1,35 @@
|
|
|
1
|
+
import {ExampleCodeBlock} from '@workday/canvas-kit-docs';
|
|
1
2
|
import SystemIconList from './examples/IconList';
|
|
2
3
|
import AppletIconList from './examples/AppletIconList';
|
|
3
|
-
import
|
|
4
|
-
import Overview from './examples/Overview'
|
|
4
|
+
import AccentIconList from './examples/AccentIconList';
|
|
5
|
+
import Overview from './examples/Overview';
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
# Assets
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
Assets are graphics which help communicate meaning or highlight areas of interaction to our users.
|
|
11
|
+
These may be presented individually or as part of a group with related information in components and
|
|
12
|
+
patterns.
|
|
9
13
|
|
|
10
14
|
<ExampleCodeBlock code={Overview} />
|
|
11
15
|
|
|
12
16
|
## Accent Icon List
|
|
13
17
|
|
|
14
|
-
Accent Icons add clarity, and visual interest, they bring delight to the experience by communicating
|
|
18
|
+
Accent Icons add clarity, and visual interest, they bring delight to the experience by communicating
|
|
19
|
+
the overall tone and meaning of a page.
|
|
15
20
|
|
|
16
21
|
<ExampleCodeBlock code={AccentIconList} />
|
|
17
22
|
|
|
18
23
|
## Applet Icon List
|
|
19
24
|
|
|
20
|
-
Applet Icons convey entry points, categories of actions, or information sources on the Workday
|
|
25
|
+
Applet Icons convey entry points, categories of actions, or information sources on the Workday
|
|
26
|
+
homepage.
|
|
21
27
|
|
|
22
28
|
<ExampleCodeBlock code={AppletIconList} />
|
|
23
29
|
|
|
24
30
|
## System Icon List
|
|
25
31
|
|
|
26
|
-
System Icons are symbols used to convey simple actions and functions, they are the most common icons
|
|
32
|
+
System Icons are symbols used to convey simple actions and functions, they are the most common icons
|
|
33
|
+
encountered in products and help communicate metaphors at a glance.
|
|
27
34
|
|
|
28
35
|
<ExampleCodeBlock code={SystemIconList} />
|
|
@@ -8,7 +8,7 @@ import {system} from '@workday/canvas-tokens-web';
|
|
|
8
8
|
|
|
9
9
|
const ImportedIcons = Object.keys(CanvasAccenttIcons);
|
|
10
10
|
|
|
11
|
-
const allIcons = ImportedIcons.filter(icon => icon !== '
|
|
11
|
+
const allIcons = ImportedIcons.filter(icon => icon !== 'CanvasAccentIcons');
|
|
12
12
|
|
|
13
13
|
const styleOverrides = {
|
|
14
14
|
parentContainer: createStyles({
|