@workday/canvas-kit-docs 12.0.0-alpha.862-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 +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 +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}/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,82 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {PopperController} from '../../../../../utils/storybook';
|
|
3
|
+
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {
|
|
5
|
+
Popup,
|
|
6
|
+
usePopupModel,
|
|
7
|
+
useCloseOnEscape,
|
|
8
|
+
useCloseOnOutsideClick,
|
|
9
|
+
useInitialFocus,
|
|
10
|
+
useReturnFocus,
|
|
11
|
+
Placement,
|
|
12
|
+
} from '@workday/canvas-kit-react/popup';
|
|
13
|
+
import {Box, Flex} from '@workday/canvas-kit-react/layout';
|
|
14
|
+
|
|
15
|
+
export default () => {
|
|
16
|
+
const [placement, setPlacement] = React.useState<Placement>('top');
|
|
17
|
+
const [marginLeftBtn, setMarginLeftBtn] = React.useState(0);
|
|
18
|
+
const [marginRightBtn, setMarginRightBtn] = React.useState(0);
|
|
19
|
+
const model = usePopupModel();
|
|
20
|
+
|
|
21
|
+
useCloseOnOutsideClick(model);
|
|
22
|
+
useCloseOnEscape(model);
|
|
23
|
+
useInitialFocus(model);
|
|
24
|
+
useReturnFocus(model);
|
|
25
|
+
|
|
26
|
+
const handleDelete = () => {
|
|
27
|
+
console.log('Delete Item');
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const handlePlacement = (placement: Placement) => {
|
|
31
|
+
setPlacement(placement);
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
const handleMarginLeftBtn = (marginLeftBtn: number) => {
|
|
35
|
+
setMarginLeftBtn(marginLeftBtn);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const handleMarginRightBtn = (marginLeftBtn: number) => {
|
|
39
|
+
setMarginRightBtn(marginLeftBtn);
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div style={{height: 1200}} data-testid="scroll-area-fallback-placement">
|
|
44
|
+
<PopperController
|
|
45
|
+
marginLeftBtn={marginLeftBtn}
|
|
46
|
+
marginRightBtn={marginRightBtn}
|
|
47
|
+
placement={placement}
|
|
48
|
+
onSetPlacement={handlePlacement}
|
|
49
|
+
onSetMarginLeftBtn={handleMarginLeftBtn}
|
|
50
|
+
onSetMarginRightBtn={handleMarginRightBtn}
|
|
51
|
+
>
|
|
52
|
+
<Flex width="100%" marginTop={240} justifyContent="center" alignItems="start">
|
|
53
|
+
<Popup model={model}>
|
|
54
|
+
<Popup.Target
|
|
55
|
+
as={DeleteButton}
|
|
56
|
+
style={{marginLeft: marginLeftBtn, marginRight: marginRightBtn}}
|
|
57
|
+
>
|
|
58
|
+
Delete Item
|
|
59
|
+
</Popup.Target>
|
|
60
|
+
<Popup.Popper placement={placement}>
|
|
61
|
+
<Popup.Card width={400}>
|
|
62
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
63
|
+
<Popup.Heading>Delete Item</Popup.Heading>
|
|
64
|
+
<Popup.Body>
|
|
65
|
+
<Box as="p" marginY="zero">
|
|
66
|
+
Are you sure you'd like to delete the item titled 'My Item'?
|
|
67
|
+
</Box>
|
|
68
|
+
</Popup.Body>
|
|
69
|
+
<Flex gap="s" padding="xxs" marginTop="xxs">
|
|
70
|
+
<Popup.CloseButton as={DeleteButton} onClick={handleDelete}>
|
|
71
|
+
Delete
|
|
72
|
+
</Popup.CloseButton>
|
|
73
|
+
<Popup.CloseButton>Cancel</Popup.CloseButton>
|
|
74
|
+
</Flex>
|
|
75
|
+
</Popup.Card>
|
|
76
|
+
</Popup.Popper>
|
|
77
|
+
</Popup>
|
|
78
|
+
</Flex>
|
|
79
|
+
</PopperController>
|
|
80
|
+
</div>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
3
|
+
import {
|
|
4
|
+
Popup,
|
|
5
|
+
useCloseOnOutsideClick,
|
|
6
|
+
useCloseOnEscape,
|
|
7
|
+
usePopupModel,
|
|
8
|
+
} from '@workday/canvas-kit-react/popup';
|
|
9
|
+
|
|
10
|
+
export default () => {
|
|
11
|
+
const popup1 = usePopupModel();
|
|
12
|
+
const popup2 = usePopupModel();
|
|
13
|
+
|
|
14
|
+
useCloseOnOutsideClick(popup1);
|
|
15
|
+
useCloseOnEscape(popup1);
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<Flex gap="s">
|
|
19
|
+
<Popup model={popup1}>
|
|
20
|
+
<Popup.Target>Open Popup 1</Popup.Target>
|
|
21
|
+
<Popup.Popper>
|
|
22
|
+
<Popup.Card aria-label="Popup 1">
|
|
23
|
+
<Popup.CloseIcon aria-label="Close" size="small" />
|
|
24
|
+
<Popup.Body>
|
|
25
|
+
<p>Contents of Popup 1</p>
|
|
26
|
+
<Popup.Target model={popup2}>Open Popup 2</Popup.Target>
|
|
27
|
+
</Popup.Body>
|
|
28
|
+
</Popup.Card>
|
|
29
|
+
</Popup.Popper>
|
|
30
|
+
</Popup>
|
|
31
|
+
<Popup model={popup2}>
|
|
32
|
+
<Popup.Popper>
|
|
33
|
+
<Popup.Card aria-label="Popup 1">
|
|
34
|
+
<Popup.CloseIcon aria-label="Close" size="small" />
|
|
35
|
+
<Popup.Heading>Popup 2 (Not hidable on outside click)</Popup.Heading>
|
|
36
|
+
<Popup.Body>Contents of Popup 2</Popup.Body>
|
|
37
|
+
</Popup.Card>
|
|
38
|
+
</Popup.Popper>
|
|
39
|
+
</Popup>
|
|
40
|
+
</Flex>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
4
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
5
|
+
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
6
|
+
import {
|
|
7
|
+
Popup,
|
|
8
|
+
useCloseOnOutsideClick,
|
|
9
|
+
useCloseOnEscape,
|
|
10
|
+
usePopupModel,
|
|
11
|
+
useInitialFocus,
|
|
12
|
+
useReturnFocus,
|
|
13
|
+
} from '@workday/canvas-kit-react/popup';
|
|
14
|
+
|
|
15
|
+
export default () => {
|
|
16
|
+
const model = usePopupModel();
|
|
17
|
+
|
|
18
|
+
useCloseOnOutsideClick(model);
|
|
19
|
+
useCloseOnEscape(model);
|
|
20
|
+
useInitialFocus(model);
|
|
21
|
+
useReturnFocus(model);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
style={{width: 400, height: 400, overflow: 'scroll', padding: 4}}
|
|
26
|
+
data-testid="scroll-area"
|
|
27
|
+
>
|
|
28
|
+
<div style={{width: 950}}>
|
|
29
|
+
<p style={{marginBottom: 400}}>Scroll down</p>
|
|
30
|
+
<p>Scroll right and click on the button</p>
|
|
31
|
+
<Popup model={model}>
|
|
32
|
+
<FormField id="return-focus-text-input" cs={{marginLeft: 400}}>
|
|
33
|
+
<FormField.Label>Name</FormField.Label>
|
|
34
|
+
<FormField.Input as={TextInput} />
|
|
35
|
+
</FormField>
|
|
36
|
+
<Popup.Target style={{marginBottom: 400, marginLeft: 410}} data-testid="target">
|
|
37
|
+
Open Popup
|
|
38
|
+
</Popup.Target>
|
|
39
|
+
<Popup.Popper>
|
|
40
|
+
<Popup.Card>
|
|
41
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
42
|
+
<Popup.Body>
|
|
43
|
+
<p>The "Open Popup" button should not receive focus if:</p>
|
|
44
|
+
<ul>
|
|
45
|
+
<li>You click on the input</li>
|
|
46
|
+
<li>
|
|
47
|
+
You scroll the container so that less than half of the "Open Popup" is showing
|
|
48
|
+
</li>
|
|
49
|
+
<li>
|
|
50
|
+
<TertiaryButton
|
|
51
|
+
data-testid="focus-text-input-link"
|
|
52
|
+
onClick={() => {
|
|
53
|
+
model.events.hide();
|
|
54
|
+
document.getElementById('input-return-focus-text-input').focus();
|
|
55
|
+
}}
|
|
56
|
+
>
|
|
57
|
+
You click this link
|
|
58
|
+
</TertiaryButton>
|
|
59
|
+
</li>
|
|
60
|
+
</ul>
|
|
61
|
+
</Popup.Body>
|
|
62
|
+
</Popup.Card>
|
|
63
|
+
</Popup.Popper>
|
|
64
|
+
</Popup>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
3
|
+
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {
|
|
5
|
+
Popup,
|
|
6
|
+
useCloseOnOutsideClick,
|
|
7
|
+
useCloseOnEscape,
|
|
8
|
+
usePopupModel,
|
|
9
|
+
useInitialFocus,
|
|
10
|
+
useReturnFocus,
|
|
11
|
+
} from '@workday/canvas-kit-react/popup';
|
|
12
|
+
import {menuGroupIcon} from '@workday/canvas-system-icons-web';
|
|
13
|
+
|
|
14
|
+
export default () => {
|
|
15
|
+
const model = usePopupModel();
|
|
16
|
+
|
|
17
|
+
useCloseOnOutsideClick(model);
|
|
18
|
+
useCloseOnEscape(model);
|
|
19
|
+
useInitialFocus(model);
|
|
20
|
+
useReturnFocus(model);
|
|
21
|
+
|
|
22
|
+
return (
|
|
23
|
+
<Popup model={model}>
|
|
24
|
+
<Tooltip title="Open Popup">
|
|
25
|
+
<Popup.Target as={TertiaryButton} icon={menuGroupIcon} />
|
|
26
|
+
</Tooltip>
|
|
27
|
+
<Popup.Popper>
|
|
28
|
+
<Popup.Card>
|
|
29
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
30
|
+
<Popup.Heading>Popup</Popup.Heading>
|
|
31
|
+
<Popup.Body>Contents</Popup.Body>
|
|
32
|
+
</Popup.Card>
|
|
33
|
+
</Popup.Popper>
|
|
34
|
+
</Popup>
|
|
35
|
+
);
|
|
36
|
+
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
ExampleCodeBlock,
|
|
3
|
+
InformationHighlight,
|
|
4
|
+
SymbolDoc,
|
|
5
|
+
Specifications,
|
|
6
|
+
} from '@workday/canvas-kit-docs';
|
|
5
7
|
import Alert from './examples/Alert';
|
|
6
8
|
import Basic from './examples/Basic';
|
|
7
9
|
import Disabled from './examples/Disabled';
|
|
@@ -27,18 +29,6 @@ yarn add @workday/canvas-kit-react
|
|
|
27
29
|
|
|
28
30
|
## Usage
|
|
29
31
|
|
|
30
|
-
<InformationHighlight style={{margin: '1.5rem 0'}}>
|
|
31
|
-
<InformationHighlight.Icon />
|
|
32
|
-
<InformationHighlight.Heading>Note</InformationHighlight.Heading>
|
|
33
|
-
<InformationHighlight.Body>
|
|
34
|
-
These examples are using FormField from Preview. We can plan to promote this component to the
|
|
35
|
-
Main package in a future major version.
|
|
36
|
-
</InformationHighlight.Body>
|
|
37
|
-
<InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-form-field--basic">
|
|
38
|
-
View Form Field (Preview) Documentation
|
|
39
|
-
</InformationHighlight.Link>
|
|
40
|
-
</InformationHighlight>
|
|
41
|
-
|
|
42
32
|
### Basic Example
|
|
43
33
|
|
|
44
34
|
Radio Buttons are intended to be grouped together using a Radio Group.
|
|
@@ -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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
4
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
5
|
|
|
@@ -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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
4
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
5
|
import {space} from '@workday/canvas-kit-react/tokens';
|
|
@@ -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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
4
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
5
|
|
|
@@ -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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
4
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
5
|
|
|
@@ -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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
4
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
5
|
|
|
@@ -11,7 +11,7 @@ export default () => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<FormField orientation="
|
|
14
|
+
<FormField orientation="horizontalStart" as="fieldset">
|
|
15
15
|
<FormField.Label as="legend">Choose Your Pizza Crust</FormField.Label>
|
|
16
16
|
<FormField.Input as={RadioGroup} name={useUniqueId()} onChange={handleChange} value={value}>
|
|
17
17
|
<Radio label="Deep dish" value="deep-dish" />
|
|
@@ -1,11 +1,11 @@
|
|
|
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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
4
|
import {Subtext} from '@workday/canvas-kit-react/text';
|
|
5
5
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
6
6
|
|
|
7
7
|
export default () => {
|
|
8
|
-
const [value, setValue] = React.useState<string | number>(
|
|
8
|
+
const [value, setValue] = React.useState<string | number>('');
|
|
9
9
|
|
|
10
10
|
const handleChange = (value: string | number) => {
|
|
11
11
|
setValue(value);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
3
|
-
import {FormField} from '@workday/canvas-kit-
|
|
3
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
4
4
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
5
5
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
6
6
|
|
|
@@ -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 {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
4
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
5
|
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
2
|
-
|
|
3
|
-
import {SegmentedControl} from '@workday/canvas-kit-react/segmented-control';
|
|
4
|
-
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
5
2
|
import Basic from './examples/Basic';
|
|
6
3
|
|
|
7
|
-
|
|
8
4
|
# Canvas Kit Segmented Control
|
|
9
5
|
|
|
10
6
|
A linear set of two or more segments, each of which functions as a mutually exclusive button. This
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import {
|
|
2
|
+
ExampleCodeBlock,
|
|
3
|
+
InformationHighlight,
|
|
4
|
+
SymbolDoc,
|
|
5
|
+
Specifications,
|
|
6
|
+
} from '@workday/canvas-kit-docs';
|
|
5
7
|
import Alert from './examples/Alert';
|
|
6
8
|
import Basic from './examples/Basic';
|
|
7
9
|
import Complex from './examples/Complex';
|
|
@@ -17,7 +19,7 @@ import HoistedModel from './examples/HoistedModel';
|
|
|
17
19
|
import RefForwarding from './examples/RefForwarding';
|
|
18
20
|
import FetchingDynamicItems from './examples/FetchingDynamicItems';
|
|
19
21
|
import Placeholder from './examples/Placeholder';
|
|
20
|
-
import InitialSelectedItem from './examples/InitialSelectedItem';
|
|
22
|
+
import InitialSelectedItem from './examples/InitialSelectedItem';import {Table} from '@workday/canvas-kit-react/table';
|
|
21
23
|
|
|
22
24
|
|
|
23
25
|
# Canvas Kit Select
|
|
@@ -34,18 +36,6 @@ yarn add @workday/canvas-kit-react
|
|
|
34
36
|
|
|
35
37
|
## Usage
|
|
36
38
|
|
|
37
|
-
<InformationHighlight style={{margin: '1.5rem 0'}}>
|
|
38
|
-
<InformationHighlight.Icon />
|
|
39
|
-
<InformationHighlight.Heading>Note</InformationHighlight.Heading>
|
|
40
|
-
<InformationHighlight.Body>
|
|
41
|
-
These examples are using FormField from Preview. We can plan to promote this component to the
|
|
42
|
-
Main package in a future major version.
|
|
43
|
-
</InformationHighlight.Body>
|
|
44
|
-
<InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/docs/preview-inputs-form-field--basic">
|
|
45
|
-
View Form Field (Preview) Documentation
|
|
46
|
-
</InformationHighlight.Link>
|
|
47
|
-
</InformationHighlight>
|
|
48
|
-
|
|
49
39
|
### Basic Example
|
|
50
40
|
|
|
51
41
|
`Select` supports a
|
|
@@ -119,13 +109,13 @@ Set the `disabled` prop of `Select.Input` to prevent users from interacting with
|
|
|
119
109
|
|
|
120
110
|
In order to disable items and prevent users from interacting with them:
|
|
121
111
|
|
|
122
|
-
1.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
112
|
+
1. Set the `nonInteractiveIds` prop of `Select` to an array of disabled item `id`s. If your items
|
|
113
|
+
are an array of `strings` this will be just the text value. If your items are an array of
|
|
114
|
+
`objects`, this will be that value of the `id` property. This will disable interaction for those
|
|
115
|
+
items and exclude them from type-ahead.
|
|
126
116
|
|
|
127
|
-
2.
|
|
128
|
-
|
|
117
|
+
2. Set the `aria-disabled` attribute of all disabled `Select.Item`s to `true`. This ensures the
|
|
118
|
+
items are styled as disabled.
|
|
129
119
|
|
|
130
120
|
The following example adds the string value of the items we want disable to `nonInteractiveIds` and
|
|
131
121
|
sets `aria-disabled` for the disabled items.
|
|
@@ -139,11 +129,11 @@ accepts [system icons](/assets/system-icons/) from `@workday/canvas-system-icons
|
|
|
139
129
|
|
|
140
130
|
In order to render the icon for the selected item in the `Select.Input`:
|
|
141
131
|
|
|
142
|
-
1.
|
|
143
|
-
2.
|
|
144
|
-
|
|
145
|
-
3.
|
|
146
|
-
|
|
132
|
+
1. Obtain a reference to the `model` by registering your `items` with `useSelectModel`.
|
|
133
|
+
2. Get the selected item:
|
|
134
|
+
`const selectedItem = model.navigation.getItem(model.state.selectedIds[0], model)`
|
|
135
|
+
3. Pass the icon for the selected item to the input:
|
|
136
|
+
`<Select.Input inputStartIcon={selectedItem.value.icon}>`
|
|
147
137
|
|
|
148
138
|
> **Note: `data-id` on `Select.Item` must match the `id` property in your array of objects. This
|
|
149
139
|
> ensures proper keyboard handling and type-ahead.**
|
|
@@ -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 {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
5
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
@@ -25,18 +25,20 @@ export default () => {
|
|
|
25
25
|
};
|
|
26
26
|
return (
|
|
27
27
|
<Flex cs={parentContainerStyles}>
|
|
28
|
-
<
|
|
29
|
-
<FormField
|
|
30
|
-
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
<Select.
|
|
34
|
-
<Select.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
28
|
+
<FormField error="alert">
|
|
29
|
+
<FormField.Label>Contact</FormField.Label>
|
|
30
|
+
<FormField.Field>
|
|
31
|
+
<Select items={options}>
|
|
32
|
+
<FormField.Input as={Select.Input} onChange={e => handleChange(e)} id="alert-select" />
|
|
33
|
+
<Select.Popper>
|
|
34
|
+
<Select.Card>
|
|
35
|
+
<Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
|
|
36
|
+
</Select.Card>
|
|
37
|
+
</Select.Popper>
|
|
38
|
+
<FormField.Hint>Please choose a form of contact.</FormField.Hint>
|
|
39
|
+
</Select>
|
|
40
|
+
</FormField.Field>
|
|
41
|
+
</FormField>
|
|
40
42
|
Selected value: {value}
|
|
41
43
|
</Flex>
|
|
42
44
|
);
|
|
@@ -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 {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
5
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
@@ -26,21 +26,23 @@ export default () => {
|
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<Flex cs={parentContainerStyles}>
|
|
29
|
-
<
|
|
30
|
-
<FormField>
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
<Select.
|
|
35
|
-
<Select.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
29
|
+
<FormField>
|
|
30
|
+
<FormField.Label>Contact</FormField.Label>
|
|
31
|
+
<FormField.Field>
|
|
32
|
+
<Select items={options}>
|
|
33
|
+
<FormField.Input as={Select.Input} onChange={handleChange} />
|
|
34
|
+
<Select.Popper>
|
|
35
|
+
<Select.Card>
|
|
36
|
+
<Select.List>
|
|
37
|
+
{item => {
|
|
38
|
+
return <Select.Item>{item}</Select.Item>;
|
|
39
|
+
}}
|
|
40
|
+
</Select.List>
|
|
41
|
+
</Select.Card>
|
|
42
|
+
</Select.Popper>
|
|
43
|
+
</Select>
|
|
44
|
+
</FormField.Field>
|
|
45
|
+
</FormField>
|
|
44
46
|
Selected Value: {value}
|
|
45
47
|
</Flex>
|
|
46
48
|
);
|
|
@@ -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 {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
5
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
@@ -31,17 +31,19 @@ export default () => {
|
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<Flex cs={parentContainerStyles}>
|
|
34
|
-
<
|
|
35
|
-
<FormField>
|
|
36
|
-
|
|
37
|
-
<
|
|
38
|
-
|
|
39
|
-
<Select.
|
|
40
|
-
<Select.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
34
|
+
<FormField>
|
|
35
|
+
<FormField.Label>Contact</FormField.Label>
|
|
36
|
+
<FormField.Field>
|
|
37
|
+
<Select items={options} getId={item => item.serverId} getTextValue={item => item.label}>
|
|
38
|
+
<FormField.Input as={Select.Input} onChange={e => handleChange(e)} />
|
|
39
|
+
<Select.Popper>
|
|
40
|
+
<Select.Card>
|
|
41
|
+
<Select.List>{item => <Select.Item>{item.label}</Select.Item>}</Select.List>
|
|
42
|
+
</Select.Card>
|
|
43
|
+
</Select.Popper>
|
|
44
|
+
</Select>
|
|
45
|
+
</FormField.Field>
|
|
46
|
+
</FormField>
|
|
45
47
|
<p>Id: {id}</p>
|
|
46
48
|
<p>Value: {value}</p>
|
|
47
49
|
</Flex>
|
|
@@ -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 {Select} from '@workday/canvas-kit-react/select';
|
|
4
4
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
5
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
@@ -18,7 +18,7 @@ const options = [
|
|
|
18
18
|
];
|
|
19
19
|
|
|
20
20
|
export default () => {
|
|
21
|
-
const [
|
|
21
|
+
const [_, setValue] = React.useState('');
|
|
22
22
|
|
|
23
23
|
const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
24
24
|
setValue(event.target.value);
|
|
@@ -26,23 +26,25 @@ export default () => {
|
|
|
26
26
|
|
|
27
27
|
return (
|
|
28
28
|
<Flex cs={parentContainerStyles}>
|
|
29
|
-
<
|
|
30
|
-
<FormField>
|
|
31
|
-
|
|
32
|
-
<
|
|
33
|
-
|
|
34
|
-
<Select.
|
|
35
|
-
<Select.
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{item}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
29
|
+
<FormField>
|
|
30
|
+
<FormField.Label>Contact</FormField.Label>
|
|
31
|
+
<FormField.Field>
|
|
32
|
+
<Select items={options} nonInteractiveIds={['Fax (disabled)']}>
|
|
33
|
+
<FormField.Input as={Select.Input} disabled onChange={e => handleChange(e)} />
|
|
34
|
+
<Select.Popper>
|
|
35
|
+
<Select.Card>
|
|
36
|
+
<Select.List>
|
|
37
|
+
{item => (
|
|
38
|
+
<Select.Item aria-disabled={item === 'Fax (disabled)' ? true : undefined}>
|
|
39
|
+
{item}
|
|
40
|
+
</Select.Item>
|
|
41
|
+
)}
|
|
42
|
+
</Select.List>
|
|
43
|
+
</Select.Card>
|
|
44
|
+
</Select.Popper>
|
|
45
|
+
</Select>
|
|
46
|
+
</FormField.Field>
|
|
47
|
+
</FormField>
|
|
46
48
|
</Flex>
|
|
47
49
|
);
|
|
48
50
|
};
|