@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,370 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {FormField, FormFieldGroup} from '@workday/canvas-kit-react/form-field';
|
|
3
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
4
|
+
import {Select} from '@workday/canvas-kit-react/select';
|
|
5
|
+
import {Switch} from '@workday/canvas-kit-react/switch';
|
|
6
|
+
import {Heading, Text} from '@workday/canvas-kit-react/text';
|
|
7
|
+
import {SegmentedControl} from '@workday/canvas-kit-preview-react/segmented-control';
|
|
8
|
+
import {calc, createStencil, createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
9
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
10
|
+
|
|
11
|
+
const formStyles = createStyles({
|
|
12
|
+
margin: `${system.space.x3} ${system.space.zero}`,
|
|
13
|
+
maxWidth: px2rem(600),
|
|
14
|
+
minWidth: system.space.zero,
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const formFieldGroupListStyles = createStyles({
|
|
18
|
+
display: 'inline-flex',
|
|
19
|
+
flexDirection: 'row',
|
|
20
|
+
padding: system.space.zero,
|
|
21
|
+
flexWrap: 'wrap',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const sideBySideInputs = createStencil({
|
|
25
|
+
base: {
|
|
26
|
+
display: 'inline-flex',
|
|
27
|
+
gap: system.space.x2,
|
|
28
|
+
justifyContent: 'space-between',
|
|
29
|
+
},
|
|
30
|
+
modifiers: {
|
|
31
|
+
labelOrientation: {
|
|
32
|
+
horizontalStart: {
|
|
33
|
+
display: 'flex',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
},
|
|
36
|
+
horizontalEnd: {
|
|
37
|
+
display: 'flex',
|
|
38
|
+
flexDirection: 'column',
|
|
39
|
+
},
|
|
40
|
+
vertical: {
|
|
41
|
+
display: 'inline-flex',
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
density: {
|
|
45
|
+
high: {},
|
|
46
|
+
medium: {},
|
|
47
|
+
low: {},
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
compound: [
|
|
51
|
+
{
|
|
52
|
+
modifiers: {labelOrientation: 'horizontalStart', density: 'high'},
|
|
53
|
+
styles: {
|
|
54
|
+
gap: system.space.x4,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
modifiers: {labelOrientation: 'horizontalStart', density: 'medium'},
|
|
59
|
+
styles: {
|
|
60
|
+
gap: system.space.x6,
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
modifiers: {labelOrientation: 'horizontalStart', density: 'low'},
|
|
65
|
+
styles: {
|
|
66
|
+
gap: system.space.x8,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
modifiers: {labelOrientation: 'horizontalEnd', density: 'high'},
|
|
71
|
+
styles: {
|
|
72
|
+
gap: system.space.x4,
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
modifiers: {labelOrientation: 'horizontalEnd', density: 'medium'},
|
|
77
|
+
styles: {
|
|
78
|
+
gap: system.space.x6,
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
modifiers: {labelOrientation: 'horizontalEnd', density: 'low'},
|
|
83
|
+
styles: {
|
|
84
|
+
gap: system.space.x8,
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
],
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
const zipCodeInput = createStyles({
|
|
91
|
+
minWidth: px2rem(90),
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
const zipCodeContainerStyles = createStyles({
|
|
95
|
+
minWidth: system.space.zero,
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
const formFieldStencil = createStencil({
|
|
99
|
+
base: {},
|
|
100
|
+
modifiers: {
|
|
101
|
+
density: {
|
|
102
|
+
high: {
|
|
103
|
+
gap: px2rem(2),
|
|
104
|
+
},
|
|
105
|
+
medium: {
|
|
106
|
+
gap: system.space.x1,
|
|
107
|
+
},
|
|
108
|
+
low: {
|
|
109
|
+
gap: system.space.x2,
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const creditCardInputStyles = createStyles({
|
|
116
|
+
width: calc.add(system.space.x10, system.space.x10),
|
|
117
|
+
minWidth: calc.add(system.space.x10, system.space.x10),
|
|
118
|
+
textAlign: 'center',
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
const selectStencil = createStencil({
|
|
122
|
+
base: {},
|
|
123
|
+
modifiers: {
|
|
124
|
+
density: {
|
|
125
|
+
high: {
|
|
126
|
+
height: system.space.x8,
|
|
127
|
+
padding: `${system.space.x1} ${system.space.x2}`,
|
|
128
|
+
'& + div': {
|
|
129
|
+
height: system.space.x8,
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
medium: {
|
|
133
|
+
height: system.space.x10,
|
|
134
|
+
padding: `${system.space.x2}`,
|
|
135
|
+
},
|
|
136
|
+
low: {
|
|
137
|
+
height: calc.add(system.space.x10, system.space.x2),
|
|
138
|
+
padding: `${system.space.x3} ${system.space.x2}`,
|
|
139
|
+
'& + div': {
|
|
140
|
+
height: calc.add(system.space.x10, system.space.x2),
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
const inputStencil = createStencil({
|
|
148
|
+
base: {
|
|
149
|
+
minWidth: px2rem(200),
|
|
150
|
+
},
|
|
151
|
+
modifiers: {
|
|
152
|
+
density: {
|
|
153
|
+
high: {
|
|
154
|
+
height: system.space.x8,
|
|
155
|
+
padding: `${system.space.x1} ${system.space.x2}`,
|
|
156
|
+
},
|
|
157
|
+
medium: {
|
|
158
|
+
height: system.space.x10,
|
|
159
|
+
padding: `${system.space.x2}`,
|
|
160
|
+
},
|
|
161
|
+
|
|
162
|
+
low: {
|
|
163
|
+
height: calc.add(system.space.x10, system.space.x2),
|
|
164
|
+
padding: `${system.space.x3} ${system.space.x2}`,
|
|
165
|
+
},
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
const flexContainerStencil = createStencil({
|
|
171
|
+
base: {
|
|
172
|
+
display: 'flex',
|
|
173
|
+
flexDirection: 'column',
|
|
174
|
+
minWidth: 0,
|
|
175
|
+
},
|
|
176
|
+
modifiers: {
|
|
177
|
+
density: {
|
|
178
|
+
high: {
|
|
179
|
+
gap: system.space.x4,
|
|
180
|
+
},
|
|
181
|
+
medium: {
|
|
182
|
+
gap: system.space.x6,
|
|
183
|
+
},
|
|
184
|
+
low: {
|
|
185
|
+
gap: system.space.x8,
|
|
186
|
+
},
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
|
|
191
|
+
const containerAlignmentStencil = createStencil({
|
|
192
|
+
base: {
|
|
193
|
+
display: 'flex',
|
|
194
|
+
},
|
|
195
|
+
modifiers: {
|
|
196
|
+
alignment: {
|
|
197
|
+
left: {
|
|
198
|
+
justifyContent: 'flex-start',
|
|
199
|
+
},
|
|
200
|
+
center: {
|
|
201
|
+
justifyContent: 'center',
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
const optionStyles = createStyles({
|
|
208
|
+
display: 'flex',
|
|
209
|
+
gap: system.space.x3,
|
|
210
|
+
flexDirection: 'column',
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
const optionItemStyles = createStyles({
|
|
214
|
+
display: 'flex',
|
|
215
|
+
flexDirection: 'column',
|
|
216
|
+
gap: system.space.x3,
|
|
217
|
+
maxWidth: 'fit-content',
|
|
218
|
+
});
|
|
219
|
+
|
|
220
|
+
// high = 32px height on inputs, space between inputs is 16px
|
|
221
|
+
// medium 40px height on inputs, space between inputs is 24px
|
|
222
|
+
// low = 48px height on inputs, space between inputs is 32px
|
|
223
|
+
|
|
224
|
+
export default () => {
|
|
225
|
+
const [density, setDensity] = React.useState<'high' | 'medium' | 'low'>('medium');
|
|
226
|
+
const [containerAlignment, setContainerAlignment] = React.useState<'left' | 'center'>('left');
|
|
227
|
+
const [labelOrientation, setLabelOrientation] = React.useState<
|
|
228
|
+
'vertical' | 'horizontalStart' | 'horizontalEnd'
|
|
229
|
+
>('vertical');
|
|
230
|
+
|
|
231
|
+
const handleDensity = data => {
|
|
232
|
+
setDensity(data.id);
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
const handleContainerAlignment = data => {
|
|
236
|
+
setContainerAlignment(data.id);
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
const handleLabelOrientation = data => {
|
|
240
|
+
setLabelOrientation(data.id);
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
return (
|
|
244
|
+
<div>
|
|
245
|
+
<Heading size="small">Choose Your Density and Alignment</Heading>
|
|
246
|
+
<div className={optionStyles}>
|
|
247
|
+
<div className={optionItemStyles}>
|
|
248
|
+
<Text>Density</Text>
|
|
249
|
+
<SegmentedControl onSelect={data => handleDensity(data)} size="small">
|
|
250
|
+
<SegmentedControl.List aria-label="choose a density">
|
|
251
|
+
<SegmentedControl.Item data-id="high">High</SegmentedControl.Item>
|
|
252
|
+
<SegmentedControl.Item data-id="medium">Medium</SegmentedControl.Item>
|
|
253
|
+
<SegmentedControl.Item data-id="low">Low</SegmentedControl.Item>
|
|
254
|
+
</SegmentedControl.List>
|
|
255
|
+
</SegmentedControl>
|
|
256
|
+
</div>
|
|
257
|
+
<div className={optionItemStyles}>
|
|
258
|
+
<Text>Label Orientation</Text>
|
|
259
|
+
<SegmentedControl onSelect={data => handleLabelOrientation(data)} size="small">
|
|
260
|
+
<SegmentedControl.List aria-label="choose a label orientation">
|
|
261
|
+
<SegmentedControl.Item data-id="vertical">Vertical</SegmentedControl.Item>
|
|
262
|
+
<SegmentedControl.Item data-id="horizontalStart">
|
|
263
|
+
Horizontal Start
|
|
264
|
+
</SegmentedControl.Item>
|
|
265
|
+
<SegmentedControl.Item data-id="horizontalEnd">Horizontal End</SegmentedControl.Item>
|
|
266
|
+
</SegmentedControl.List>
|
|
267
|
+
</SegmentedControl>
|
|
268
|
+
</div>
|
|
269
|
+
<div className={optionItemStyles}>
|
|
270
|
+
<Text>Container Alignment</Text>
|
|
271
|
+
<SegmentedControl onSelect={data => handleContainerAlignment(data)} size="small">
|
|
272
|
+
<SegmentedControl.List aria-label="choose a density">
|
|
273
|
+
<SegmentedControl.Item data-id="left">Left</SegmentedControl.Item>
|
|
274
|
+
<SegmentedControl.Item data-id="center">Center</SegmentedControl.Item>
|
|
275
|
+
</SegmentedControl.List>
|
|
276
|
+
</SegmentedControl>
|
|
277
|
+
</div>
|
|
278
|
+
</div>
|
|
279
|
+
|
|
280
|
+
<div {...containerAlignmentStencil({alignment: containerAlignment})}>
|
|
281
|
+
<form action="#" className={formStyles}>
|
|
282
|
+
<div {...flexContainerStencil({density})}>
|
|
283
|
+
<FormField
|
|
284
|
+
orientation={labelOrientation}
|
|
285
|
+
grow
|
|
286
|
+
cs={formFieldStencil({density})}
|
|
287
|
+
id="foo"
|
|
288
|
+
>
|
|
289
|
+
<FormField.Label>Choose Country</FormField.Label>
|
|
290
|
+
<Select items={['Dominican Republic', 'Spain', 'United States']}>
|
|
291
|
+
<FormField.Input
|
|
292
|
+
cs={selectStencil({density})}
|
|
293
|
+
placeholder="Choose a country"
|
|
294
|
+
as={Select.Input}
|
|
295
|
+
/>
|
|
296
|
+
<Select.Popper>
|
|
297
|
+
<Select.Card>
|
|
298
|
+
<Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
|
|
299
|
+
</Select.Card>
|
|
300
|
+
</Select.Popper>
|
|
301
|
+
</Select>
|
|
302
|
+
</FormField>
|
|
303
|
+
<FormField grow orientation={labelOrientation} cs={formFieldStencil({density})}>
|
|
304
|
+
<FormField.Label>Full Name</FormField.Label>
|
|
305
|
+
<FormField.Input as={TextInput} cs={inputStencil({density})} />
|
|
306
|
+
</FormField>
|
|
307
|
+
<FormField grow orientation={labelOrientation} cs={formFieldStencil({density})}>
|
|
308
|
+
<FormField.Label>Phone Number</FormField.Label>
|
|
309
|
+
<FormField.Input as={TextInput} cs={inputStencil({density})} />
|
|
310
|
+
</FormField>
|
|
311
|
+
<FormField grow orientation={labelOrientation} cs={formFieldStencil({density})}>
|
|
312
|
+
<FormField.Label>Street Address</FormField.Label>
|
|
313
|
+
<FormField.Input as={TextInput} cs={inputStencil({density})} />
|
|
314
|
+
</FormField>
|
|
315
|
+
<FormField grow orientation={labelOrientation} cs={formFieldStencil({density})}>
|
|
316
|
+
<FormField.Label>City</FormField.Label>
|
|
317
|
+
<FormField.Input as={TextInput} cs={inputStencil({density})} />
|
|
318
|
+
</FormField>
|
|
319
|
+
<div {...sideBySideInputs({labelOrientation: labelOrientation, density})}>
|
|
320
|
+
<FormField grow orientation={labelOrientation} cs={formFieldStencil({density})}>
|
|
321
|
+
<FormField.Label>State</FormField.Label>
|
|
322
|
+
<FormField.Input as={TextInput} cs={inputStencil({density})} />
|
|
323
|
+
</FormField>
|
|
324
|
+
<FormField
|
|
325
|
+
grow
|
|
326
|
+
orientation={labelOrientation}
|
|
327
|
+
cs={[formFieldStencil({density}), zipCodeContainerStyles]}
|
|
328
|
+
>
|
|
329
|
+
<FormField.Label>Zip Code</FormField.Label>
|
|
330
|
+
<FormField.Input cs={[inputStencil({density}), zipCodeInput]} as={TextInput} />
|
|
331
|
+
</FormField>
|
|
332
|
+
</div>
|
|
333
|
+
<FormField orientation={labelOrientation} cs={formFieldStencil({density})}>
|
|
334
|
+
<FormField.Label>Enable Fast Shipping</FormField.Label>
|
|
335
|
+
<FormField.Field>
|
|
336
|
+
<FormField.Input as={Switch} />
|
|
337
|
+
</FormField.Field>
|
|
338
|
+
</FormField>
|
|
339
|
+
<FormFieldGroup cs={formFieldStencil({density})} orientation={labelOrientation}>
|
|
340
|
+
<FormFieldGroup.Label>Credit Card</FormFieldGroup.Label>
|
|
341
|
+
|
|
342
|
+
<FormFieldGroup.List cs={formFieldGroupListStyles}>
|
|
343
|
+
<FormFieldGroup.Input
|
|
344
|
+
as={TextInput}
|
|
345
|
+
placeholder="XXXX"
|
|
346
|
+
cs={[inputStencil({density}), creditCardInputStyles]}
|
|
347
|
+
/>
|
|
348
|
+
<FormFieldGroup.Input
|
|
349
|
+
as={TextInput}
|
|
350
|
+
placeholder="XXXX"
|
|
351
|
+
cs={[inputStencil({density}), creditCardInputStyles]}
|
|
352
|
+
/>
|
|
353
|
+
<FormFieldGroup.Input
|
|
354
|
+
as={TextInput}
|
|
355
|
+
placeholder="XXXX"
|
|
356
|
+
cs={[inputStencil({density}), creditCardInputStyles]}
|
|
357
|
+
/>
|
|
358
|
+
<FormFieldGroup.Input
|
|
359
|
+
cs={[inputStencil({density}), creditCardInputStyles]}
|
|
360
|
+
placeholder="XXXX"
|
|
361
|
+
as={TextInput}
|
|
362
|
+
/>
|
|
363
|
+
</FormFieldGroup.List>
|
|
364
|
+
</FormFieldGroup>
|
|
365
|
+
</div>
|
|
366
|
+
</form>
|
|
367
|
+
</div>
|
|
368
|
+
</div>
|
|
369
|
+
);
|
|
370
|
+
};
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import {StatusIndicator} from '@workday/canvas-kit-preview-react/status-indicator';
|
|
4
4
|
import {Table} from '@workday/canvas-kit-react/table';
|
|
5
5
|
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
6
|
-
import {
|
|
6
|
+
import {generateUniqueId} from '@workday/canvas-kit-react/common';
|
|
7
7
|
import {Heading, Subtext} from '@workday/canvas-kit-react/text';
|
|
8
8
|
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
9
9
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
@@ -189,31 +189,28 @@ function ExpandableRow({data}: RowProps) {
|
|
|
189
189
|
);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
|
-
export default
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
<Table.
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
);
|
|
218
|
-
},
|
|
219
|
-
});
|
|
192
|
+
export default () => {
|
|
193
|
+
return (
|
|
194
|
+
<>
|
|
195
|
+
<Heading as="h3" id={headingID} size="small">
|
|
196
|
+
Showroom Inventory
|
|
197
|
+
</Heading>
|
|
198
|
+
<Table aria-labelledby={headingID}>
|
|
199
|
+
<Table.Head>
|
|
200
|
+
<Table.Row gridTemplateColumns="4rem repeat(4, 1fr)">
|
|
201
|
+
<Table.Cell></Table.Cell>
|
|
202
|
+
<Table.Header scope="col">Make</Table.Header>
|
|
203
|
+
<Table.Header scope="col">Model</Table.Header>
|
|
204
|
+
<Table.Header scope="col">Year</Table.Header>
|
|
205
|
+
<Table.Header scope="col">Price</Table.Header>
|
|
206
|
+
</Table.Row>
|
|
207
|
+
</Table.Head>
|
|
208
|
+
<Table.Body>
|
|
209
|
+
{autoData.map(item => (
|
|
210
|
+
<ExpandableRow key={item.id} data={item} />
|
|
211
|
+
))}
|
|
212
|
+
</Table.Body>
|
|
213
|
+
</Table>
|
|
214
|
+
</>
|
|
215
|
+
);
|
|
216
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
3
|
+
import {BodyText, Heading} from '@workday/canvas-kit-react/text';
|
|
4
|
+
import {AriaLiveRegion} from '@workday/canvas-kit-react/common';
|
|
5
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
|
+
import {system, base} from '@workday/canvas-tokens-web';
|
|
7
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
8
|
+
|
|
9
|
+
const fruits = [
|
|
10
|
+
'Apples',
|
|
11
|
+
'Oranges',
|
|
12
|
+
'Bananas',
|
|
13
|
+
'Lemons',
|
|
14
|
+
'Limes',
|
|
15
|
+
'Strawberries',
|
|
16
|
+
'Raspberries',
|
|
17
|
+
'Blackberries',
|
|
18
|
+
];
|
|
19
|
+
|
|
20
|
+
const liveRegionStyle = createStyles({
|
|
21
|
+
border: `${px2rem(1)} solid ${base.cantaloupe400}`,
|
|
22
|
+
backgroundColor: base.cantaloupe100,
|
|
23
|
+
padding: system.space.x2,
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
const listStyles = {paddingLeft: '0px'};
|
|
27
|
+
|
|
28
|
+
const listItemStyles = createStyles({
|
|
29
|
+
listStyle: 'none',
|
|
30
|
+
paddingLeft: system.space.zero,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
let filteredFruits = fruits;
|
|
34
|
+
|
|
35
|
+
export default () => {
|
|
36
|
+
const [filter, setFilter] = useState('');
|
|
37
|
+
function handleFilter(e) {
|
|
38
|
+
filteredFruits = fruits.filter(i => i.toUpperCase().indexOf(e.target.value.toUpperCase()) >= 0);
|
|
39
|
+
setFilter(e.target.value);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
<Flex gap="1rem">
|
|
45
|
+
<Heading size="small">Fruits</Heading>
|
|
46
|
+
<AriaLiveRegion>
|
|
47
|
+
<BodyText size="small" cs={liveRegionStyle}>
|
|
48
|
+
{`Showing ${filteredFruits.length} of ${fruits.length}`}
|
|
49
|
+
</BodyText>
|
|
50
|
+
</AriaLiveRegion>
|
|
51
|
+
</Flex>
|
|
52
|
+
<TextInput orientation="vertical">
|
|
53
|
+
<TextInput.Label>Filter Items:</TextInput.Label>
|
|
54
|
+
<TextInput.Field value={filter} onChange={handleFilter} />
|
|
55
|
+
</TextInput>
|
|
56
|
+
<ul style={listStyles}>
|
|
57
|
+
{filteredFruits.map(i => (
|
|
58
|
+
<BodyText size="small" as="li" cs={listItemStyles} key={i}>
|
|
59
|
+
{i}
|
|
60
|
+
</BodyText>
|
|
61
|
+
))}
|
|
62
|
+
</ul>
|
|
63
|
+
</>
|
|
64
|
+
);
|
|
65
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React, {useState, useRef} from 'react';
|
|
2
|
+
import {AriaLiveRegion, AccessibleHide} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
5
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
7
|
+
|
|
8
|
+
export default () => {
|
|
9
|
+
const [message, setMessage] = useState('This is an ARIA Live Region!');
|
|
10
|
+
const inputRef = useRef();
|
|
11
|
+
function handleSendMessage() {
|
|
12
|
+
setMessage(inputRef.current.value);
|
|
13
|
+
inputRef.current.value = '';
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return (
|
|
17
|
+
<>
|
|
18
|
+
<Flex gap={`var(${system.space.x4})`} alignItems="flex-end">
|
|
19
|
+
<TextInput orientation="vertical">
|
|
20
|
+
<TextInput.Label>Type your message:</TextInput.Label>
|
|
21
|
+
<TextInput.Field ref={inputRef} />
|
|
22
|
+
</TextInput>
|
|
23
|
+
<PrimaryButton onClick={handleSendMessage}>Send Message</PrimaryButton>
|
|
24
|
+
</Flex>
|
|
25
|
+
<AriaLiveRegion>
|
|
26
|
+
<AccessibleHide>{message}</AccessibleHide>
|
|
27
|
+
</AriaLiveRegion>
|
|
28
|
+
</>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import React, {useState} from 'react';
|
|
2
|
+
import {AccessibleHide, AriaLiveRegion, useUniqueId} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {notificationsIcon, inboxIcon, assistantIcon} from '@workday/canvas-system-icons-web';
|
|
4
|
+
import {space} from '@workday/canvas-kit-react/tokens';
|
|
5
|
+
import {SecondaryButton, TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
6
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
7
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
8
|
+
import {CountBadge} from '@workday/canvas-kit-react/badge';
|
|
9
|
+
|
|
10
|
+
const MyTasksLiveBadge = ({cnt}) => {
|
|
11
|
+
// use tooltip to assign name,
|
|
12
|
+
// use AriaLiveRegion inside button,
|
|
13
|
+
// assign name to live region referencing the button,
|
|
14
|
+
// use BadgeCount inside live region,
|
|
15
|
+
// use AccessibleHide to create invisible word "new" after badge
|
|
16
|
+
// use aria-describedby on button, referencing live region container to set description
|
|
17
|
+
// Safari + VO => not working at all
|
|
18
|
+
// JAWS 2024 + Chrome / Edge => works as expected :)
|
|
19
|
+
// NVDA + Chrome / Edge => works as expected :)
|
|
20
|
+
// Firefox => isn't announcing description on focus, only announces "X New" live (missing button name)
|
|
21
|
+
const badgeID = useUniqueId();
|
|
22
|
+
const myTasksID = useUniqueId();
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<Tooltip title="My Tasks">
|
|
26
|
+
<TertiaryButton icon={inboxIcon} id={myTasksID} aria-describedby={badgeID}>
|
|
27
|
+
<AriaLiveRegion id={badgeID} aria-labelledby={myTasksID}>
|
|
28
|
+
<CountBadge count={cnt} />
|
|
29
|
+
<AccessibleHide>New</AccessibleHide>
|
|
30
|
+
</AriaLiveRegion>
|
|
31
|
+
</TertiaryButton>
|
|
32
|
+
</Tooltip>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// use AriaLiveRegion around the button,
|
|
37
|
+
// use Tooltip to assign the name of the button,
|
|
38
|
+
// make sure Tooltip title string includes count value
|
|
39
|
+
// Chrome + VO => Announces name "notifications X new" and innerText 'X'
|
|
40
|
+
// Safari + VO => Works as expected :)
|
|
41
|
+
// JAWS 2024 => Announces full button name twice (previous state, then new state)
|
|
42
|
+
// JAWS 2024 + Firefox => Works as expected :)
|
|
43
|
+
// NVDA (All Browsers) => Atomic property isn't working, only announcing number change, announces twice
|
|
44
|
+
const NotificationsLiveBadge = ({cnt}) => (
|
|
45
|
+
<AriaLiveRegion>
|
|
46
|
+
<Tooltip title={`Notifications ${cnt} new`}>
|
|
47
|
+
<TertiaryButton icon={notificationsIcon}>
|
|
48
|
+
<CountBadge count={cnt} />
|
|
49
|
+
</TertiaryButton>
|
|
50
|
+
</Tooltip>
|
|
51
|
+
</AriaLiveRegion>
|
|
52
|
+
);
|
|
53
|
+
|
|
54
|
+
const AssistantLiveBadge = ({cnt}) => {
|
|
55
|
+
// use AriaLiveRegion around the button
|
|
56
|
+
// use muted type Tooltip (avoid using aria-label to name button)
|
|
57
|
+
// use AccessibleHide inside of button to compose name
|
|
58
|
+
// Chrome + VO => announces twice
|
|
59
|
+
// Safari + VO => works as expected :)
|
|
60
|
+
const lbl = 'Workday Assistant';
|
|
61
|
+
|
|
62
|
+
return (
|
|
63
|
+
<AriaLiveRegion>
|
|
64
|
+
<Tooltip title={lbl} type="muted">
|
|
65
|
+
<TertiaryButton icon={assistantIcon}>
|
|
66
|
+
<AccessibleHide>{lbl}</AccessibleHide>
|
|
67
|
+
<CountBadge count={cnt} />
|
|
68
|
+
<AccessibleHide>New</AccessibleHide>
|
|
69
|
+
</TertiaryButton>
|
|
70
|
+
</Tooltip>
|
|
71
|
+
</AriaLiveRegion>
|
|
72
|
+
);
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export default () => {
|
|
76
|
+
const [counter, setCounter] = useState(0);
|
|
77
|
+
const [notifications, setNotifications] = useState(0);
|
|
78
|
+
const [assistant, setAssistant] = useState(0);
|
|
79
|
+
|
|
80
|
+
const handleAddTask = () => setCounter(prev => prev + 1);
|
|
81
|
+
const handleAddNotification = () => setNotifications(prev => prev + 1);
|
|
82
|
+
const handleAssistant = () => setAssistant(prev => prev + 1);
|
|
83
|
+
|
|
84
|
+
return (
|
|
85
|
+
<>
|
|
86
|
+
<Flex padding={space.s} gap={space.s} as="header">
|
|
87
|
+
<AssistantLiveBadge cnt={assistant} />
|
|
88
|
+
<NotificationsLiveBadge cnt={notifications} />
|
|
89
|
+
<MyTasksLiveBadge cnt={counter} />
|
|
90
|
+
</Flex>
|
|
91
|
+
<Flex padding={space.s} gap={space.s} as="main">
|
|
92
|
+
<SecondaryButton onClick={handleAssistant}>Add a Message</SecondaryButton>
|
|
93
|
+
<SecondaryButton onClick={handleAddNotification}>Add a Notification</SecondaryButton>
|
|
94
|
+
<SecondaryButton onClick={handleAddTask}>Add an item to My Tasks</SecondaryButton>
|
|
95
|
+
</Flex>
|
|
96
|
+
</>
|
|
97
|
+
);
|
|
98
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, {useState, useRef} from 'react';
|
|
2
|
+
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
3
|
+
import {AriaLiveRegion, changeFocus} from '@workday/canvas-kit-react/common';
|
|
4
|
+
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
const errMsg = 'Error: First name is required.';
|
|
8
|
+
const [hasError, setHasError] = useState(false);
|
|
9
|
+
const inputRef = useRef();
|
|
10
|
+
const handleBlur = e => setHasError(e.target.value.trim().length === 0);
|
|
11
|
+
const handleSubmit = () => hasError && changeFocus(inputRef.current);
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<TextInput orientation="vertical" hasError={hasError} isRequired={true}>
|
|
16
|
+
<TextInput.Label>First Name:</TextInput.Label>
|
|
17
|
+
<TextInput.Field onBlur={handleBlur} ref={inputRef} />
|
|
18
|
+
<TextInput.Hint height={'16px'}>
|
|
19
|
+
<AriaLiveRegion>{hasError && errMsg}</AriaLiveRegion>
|
|
20
|
+
</TextInput.Hint>
|
|
21
|
+
</TextInput>
|
|
22
|
+
<PrimaryButton onClick={handleSubmit}>Continue</PrimaryButton>
|
|
23
|
+
</>
|
|
24
|
+
);
|
|
25
|
+
};
|