@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,26 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {Modal} from '@workday/canvas-kit-react/modal';
|
|
3
|
+
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
return (
|
|
8
|
+
<Modal>
|
|
9
|
+
<Modal.Target as={DeleteButton}>Delete Item</Modal.Target>
|
|
10
|
+
<Modal.Overlay>
|
|
11
|
+
<Modal.Card>
|
|
12
|
+
<Modal.CloseIcon aria-label="Close" />
|
|
13
|
+
<Modal.Heading>Delete Item</Modal.Heading>
|
|
14
|
+
<Modal.Body>
|
|
15
|
+
<p>Are you sure you want to delete the item?</p>
|
|
16
|
+
<Flex gap="s">
|
|
17
|
+
<Modal.CloseButton as={DeleteButton}>Delete</Modal.CloseButton>
|
|
18
|
+
<Modal.CloseButton>Cancel</Modal.CloseButton>
|
|
19
|
+
</Flex>
|
|
20
|
+
<iframe srcDoc="<html><body>Hello, <b>world</b>.<button>iframe button 1</button><button>iframe button 2</button></body></html>" />
|
|
21
|
+
</Modal.Body>
|
|
22
|
+
</Modal.Card>
|
|
23
|
+
</Modal.Overlay>
|
|
24
|
+
</Modal>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {Modal, useModalModel} from '@workday/canvas-kit-react/modal';
|
|
3
|
+
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {
|
|
5
|
+
Popup,
|
|
6
|
+
useCloseOnOutsideClick,
|
|
7
|
+
useCloseOnEscape,
|
|
8
|
+
usePopupModel,
|
|
9
|
+
} from '@workday/canvas-kit-react/popup';
|
|
10
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
11
|
+
|
|
12
|
+
export default () => {
|
|
13
|
+
const modal = useModalModel();
|
|
14
|
+
const popup = usePopupModel();
|
|
15
|
+
|
|
16
|
+
const handleDelete = () => {
|
|
17
|
+
console.log('Delete Item');
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
useCloseOnOutsideClick(popup);
|
|
21
|
+
useCloseOnEscape(popup);
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<Modal model={modal}>
|
|
26
|
+
<Modal.Target as={DeleteButton}>Delete Item</Modal.Target>
|
|
27
|
+
<Modal.Overlay>
|
|
28
|
+
<Modal.Card>
|
|
29
|
+
<Modal.CloseIcon aria-label="Close" />
|
|
30
|
+
<Modal.Heading>Delete Item</Modal.Heading>
|
|
31
|
+
<Modal.Body>
|
|
32
|
+
<p>Are you sure you want to delete the item?</p>
|
|
33
|
+
<Popup model={popup}>
|
|
34
|
+
<Flex gap="s">
|
|
35
|
+
<Popup.Target as={DeleteButton}>Yes, Delete</Popup.Target>
|
|
36
|
+
<Popup.CloseButton>Cancel</Popup.CloseButton>
|
|
37
|
+
</Flex>
|
|
38
|
+
<Popup.Popper>
|
|
39
|
+
<Popup.Card>
|
|
40
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
41
|
+
<Popup.Heading>Really Delete Item</Popup.Heading>
|
|
42
|
+
<Popup.Body>
|
|
43
|
+
<p>Are you sure you'd like to delete the item titled 'My Item'?</p>
|
|
44
|
+
<Flex gap="s">
|
|
45
|
+
<Popup.CloseButton
|
|
46
|
+
as={DeleteButton}
|
|
47
|
+
onClick={event => {
|
|
48
|
+
modal.events.hide(event);
|
|
49
|
+
handleDelete();
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
Yes, Really Delete
|
|
53
|
+
</Popup.CloseButton>
|
|
54
|
+
<Popup.CloseButton>Cancel</Popup.CloseButton>
|
|
55
|
+
</Flex>
|
|
56
|
+
</Popup.Body>
|
|
57
|
+
</Popup.Card>
|
|
58
|
+
</Popup.Popper>
|
|
59
|
+
</Popup>
|
|
60
|
+
</Modal.Body>
|
|
61
|
+
</Modal.Card>
|
|
62
|
+
</Modal.Overlay>
|
|
63
|
+
</Modal>
|
|
64
|
+
</>
|
|
65
|
+
);
|
|
66
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Modal, useModalModel} from '@workday/canvas-kit-react/modal';
|
|
3
3
|
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {FormField} from '@workday/canvas-kit-
|
|
4
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
5
5
|
import {Flex, Box} from '@workday/canvas-kit-react/layout';
|
|
6
6
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
7
7
|
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {Modal, useModalModel} from '@workday/canvas-kit-react/modal';
|
|
3
|
+
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
|
|
6
|
+
export default () => {
|
|
7
|
+
const model = useModalModel();
|
|
8
|
+
|
|
9
|
+
const handleDelete = () => {
|
|
10
|
+
console.log('Delete Item');
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<Modal model={model}>
|
|
15
|
+
<Modal.Target as={DeleteButton}>Delete Item</Modal.Target>
|
|
16
|
+
<Modal.Overlay>
|
|
17
|
+
<Modal.Card>
|
|
18
|
+
<Modal.CloseIcon aria-label="Close" />
|
|
19
|
+
<Modal.Heading>Delete Item</Modal.Heading>
|
|
20
|
+
<Modal.Body>
|
|
21
|
+
<p>Are you sure you want to delete the item?</p>
|
|
22
|
+
<Flex gap="s">
|
|
23
|
+
<Modal>
|
|
24
|
+
<Modal.Target as={DeleteButton}>Yes, Delete</Modal.Target>
|
|
25
|
+
<Modal.Overlay>
|
|
26
|
+
<Modal.Card>
|
|
27
|
+
<Modal.CloseIcon aria-label="Close" />
|
|
28
|
+
<Modal.Heading>Really Delete Item</Modal.Heading>
|
|
29
|
+
<Modal.Body>
|
|
30
|
+
<p>
|
|
31
|
+
Are you <em>really</em> sure you want to delete the item?
|
|
32
|
+
</p>
|
|
33
|
+
<Flex gap="s">
|
|
34
|
+
<Modal.CloseButton
|
|
35
|
+
as={DeleteButton}
|
|
36
|
+
onClick={event => {
|
|
37
|
+
model.events.hide(event);
|
|
38
|
+
handleDelete();
|
|
39
|
+
}}
|
|
40
|
+
>
|
|
41
|
+
Yes, Really Delete
|
|
42
|
+
</Modal.CloseButton>
|
|
43
|
+
<Modal.CloseButton>Cancel</Modal.CloseButton>
|
|
44
|
+
</Flex>
|
|
45
|
+
</Modal.Body>
|
|
46
|
+
</Modal.Card>
|
|
47
|
+
</Modal.Overlay>
|
|
48
|
+
</Modal>
|
|
49
|
+
<Modal.CloseButton>Cancel</Modal.CloseButton>
|
|
50
|
+
</Flex>
|
|
51
|
+
</Modal.Body>
|
|
52
|
+
</Modal.Card>
|
|
53
|
+
</Modal.Overlay>
|
|
54
|
+
</Modal>
|
|
55
|
+
);
|
|
56
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {Modal} from '@workday/canvas-kit-react/modal';
|
|
3
|
+
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
|
+
|
|
5
|
+
export default () => {
|
|
6
|
+
const [value, setValue] = React.useState('');
|
|
7
|
+
|
|
8
|
+
return (
|
|
9
|
+
<Modal>
|
|
10
|
+
<Modal.Target>With Radio Buttons</Modal.Target>
|
|
11
|
+
<Modal.Overlay>
|
|
12
|
+
<Modal.Card>
|
|
13
|
+
<Modal.CloseIcon aria-label="Close" />
|
|
14
|
+
<Modal.Heading>Select Item</Modal.Heading>
|
|
15
|
+
<Modal.Body>
|
|
16
|
+
<RadioGroup
|
|
17
|
+
name="contact"
|
|
18
|
+
data-testid="radiogroup"
|
|
19
|
+
value={value}
|
|
20
|
+
onChange={value => setValue(String(value))}
|
|
21
|
+
>
|
|
22
|
+
<Radio id="1" value="email" label="E-mail" />
|
|
23
|
+
<Radio id="2" value="phone" label="Phone" />
|
|
24
|
+
</RadioGroup>
|
|
25
|
+
</Modal.Body>
|
|
26
|
+
</Modal.Card>
|
|
27
|
+
</Modal.Overlay>
|
|
28
|
+
</Modal>
|
|
29
|
+
);
|
|
30
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import {Modal, useModalModel} from '@workday/canvas-kit-react/modal';
|
|
3
|
+
import {Popup, useCloseOnOutsideClick, usePopupModel} from '@workday/canvas-kit-react/popup';
|
|
4
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
5
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
6
|
+
|
|
7
|
+
export default () => {
|
|
8
|
+
const modal = useModalModel();
|
|
9
|
+
const popup1 = usePopupModel();
|
|
10
|
+
const popup2 = usePopupModel();
|
|
11
|
+
const closeModal = (event: React.MouseEvent) => modal.events.hide(event);
|
|
12
|
+
|
|
13
|
+
useCloseOnOutsideClick(popup1);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<Modal model={modal}>
|
|
18
|
+
<Modal.Target>Open Modal</Modal.Target>
|
|
19
|
+
<Modal.Overlay>
|
|
20
|
+
<Modal.Card width={'auto'}>
|
|
21
|
+
<Modal.CloseIcon aria-label="Close" />
|
|
22
|
+
<Modal.Heading>Open Modal</Modal.Heading>
|
|
23
|
+
<Modal.Body>
|
|
24
|
+
<p>Open a hidable and non-hidable popups</p>
|
|
25
|
+
<Flex gap="s">
|
|
26
|
+
<Popup.Target model={popup1}>Hidable Popup</Popup.Target>
|
|
27
|
+
<Popup.Target model={popup2}>Non-hidable Popup</Popup.Target>
|
|
28
|
+
<Tooltip title="Not so sure" type="muted">
|
|
29
|
+
<Popup.CloseButton onClick={closeModal}>Cancel</Popup.CloseButton>
|
|
30
|
+
</Tooltip>
|
|
31
|
+
</Flex>
|
|
32
|
+
</Modal.Body>
|
|
33
|
+
</Modal.Card>
|
|
34
|
+
</Modal.Overlay>
|
|
35
|
+
</Modal>
|
|
36
|
+
<Popup model={popup1}>
|
|
37
|
+
<Popup.Popper>
|
|
38
|
+
<Popup.Card>
|
|
39
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
40
|
+
<Popup.Heading>Hidable Popup</Popup.Heading>
|
|
41
|
+
<Popup.Body>
|
|
42
|
+
<p>Pressing 'OK' will close the modal</p>
|
|
43
|
+
<Tooltip
|
|
44
|
+
placement="left"
|
|
45
|
+
title="Really, Really, Really, Really, Really sure"
|
|
46
|
+
type="muted"
|
|
47
|
+
>
|
|
48
|
+
<Popup.CloseButton onClick={closeModal}>OK</Popup.CloseButton>
|
|
49
|
+
</Tooltip>
|
|
50
|
+
</Popup.Body>
|
|
51
|
+
</Popup.Card>
|
|
52
|
+
</Popup.Popper>
|
|
53
|
+
</Popup>
|
|
54
|
+
<Popup model={popup2}>
|
|
55
|
+
<Popup.Popper>
|
|
56
|
+
<Popup.Card>
|
|
57
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
58
|
+
<Popup.Heading>Non-hidable Popup</Popup.Heading>
|
|
59
|
+
<Popup.Body>
|
|
60
|
+
<p>Pressing 'OK' will close the modal</p>
|
|
61
|
+
<Tooltip
|
|
62
|
+
placement="left"
|
|
63
|
+
title="Really, Really, Really, Really, Really sure"
|
|
64
|
+
type="muted"
|
|
65
|
+
>
|
|
66
|
+
<Popup.CloseButton onClick={closeModal}>OK</Popup.CloseButton>
|
|
67
|
+
</Tooltip>
|
|
68
|
+
</Popup.Body>
|
|
69
|
+
</Popup.Card>
|
|
70
|
+
</Popup.Popper>
|
|
71
|
+
</Popup>
|
|
72
|
+
</>
|
|
73
|
+
);
|
|
74
|
+
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
|
-
|
|
3
|
-
import {Pagination} from '@workday/canvas-kit-react/pagination';
|
|
4
|
-
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
5
2
|
import Basic from './examples/Basic';
|
|
6
3
|
import CustomRange from './examples/CustomRange';
|
|
7
4
|
import JumpControls from './examples/JumpControls';
|
|
@@ -10,7 +7,6 @@ import HoistedModel from './examples/HoistedModel';
|
|
|
10
7
|
import ResponsiveRange from './examples/ResponsiveRange';
|
|
11
8
|
import RTL from './examples/RTL';
|
|
12
9
|
|
|
13
|
-
|
|
14
10
|
# Canvas Kit Pagination
|
|
15
11
|
|
|
16
12
|
`Pagination` is a
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
2
|
-
|
|
3
|
-
import {Popup} from '@workday/canvas-kit-react/popup';
|
|
4
|
-
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
5
2
|
import Basic from './examples/Basic';
|
|
6
3
|
import InitialFocus from './examples/InitialFocus';
|
|
7
4
|
import MultiplePopups from './examples/MultiplePopups';
|
|
@@ -182,41 +179,68 @@ The Popup component automatically handles right-to-left rendering.
|
|
|
182
179
|
|
|
183
180
|
<>
|
|
184
181
|
<SymbolDoc name="Popper" fileName="/react/" />
|
|
182
|
+
|
|
185
183
|
<SymbolDoc name="Popup" fileName="/react/" />
|
|
186
184
|
</>
|
|
187
185
|
|
|
188
186
|
## Hooks
|
|
189
187
|
|
|
190
188
|
<>
|
|
191
|
-
<SymbolDoc name="usePopupStack" fileName="/react/" />
|
|
189
|
+
<SymbolDoc name="usePopupStack" fileName="/react/" />
|
|
190
|
+
|
|
191
|
+
{' '}
|
|
192
192
|
|
|
193
193
|
<SymbolDoc name="useAssistiveHideSiblings" fileName="/react/" />
|
|
194
194
|
|
|
195
|
+
{' '}
|
|
196
|
+
|
|
195
197
|
<SymbolDoc name="useBringToTopOnClick" fileName="/react/" />
|
|
196
198
|
|
|
199
|
+
{' '}
|
|
200
|
+
|
|
197
201
|
<SymbolDoc name="useCloseOnEscape" fileName="/react/" />
|
|
198
202
|
|
|
203
|
+
{' '}
|
|
204
|
+
|
|
199
205
|
<SymbolDoc name="useCloseOnOutsideClick" fileName="/react/" />
|
|
200
206
|
|
|
207
|
+
{' '}
|
|
208
|
+
|
|
201
209
|
<SymbolDoc name="useAlwaysCloseOnOutsideClick" fileName="/react/" />
|
|
202
210
|
|
|
211
|
+
{' '}
|
|
212
|
+
|
|
203
213
|
<SymbolDoc name="useAlwaysCloseOnOutsideClick" fileName="/react/" />
|
|
204
214
|
|
|
215
|
+
{' '}
|
|
216
|
+
|
|
205
217
|
<SymbolDoc name="useCloseOnTargetHidden" fileName="/react/" />
|
|
206
218
|
|
|
219
|
+
{' '}
|
|
220
|
+
|
|
207
221
|
<SymbolDoc name="useDisableBodyScroll" fileName="/react/" />
|
|
208
222
|
|
|
223
|
+
{' '}
|
|
224
|
+
|
|
209
225
|
<SymbolDoc name="useFocusRedirect" fileName="/react/" />
|
|
210
226
|
|
|
227
|
+
{' '}
|
|
228
|
+
|
|
211
229
|
<SymbolDoc name="useFocusTrap" fileName="/react/" />
|
|
212
230
|
|
|
231
|
+
{' '}
|
|
232
|
+
|
|
213
233
|
<SymbolDoc name="useInitialFocus" fileName="/react/" />
|
|
214
234
|
|
|
235
|
+
{' '}
|
|
236
|
+
|
|
215
237
|
<SymbolDoc name="useReturnFocus" fileName="/react/" />
|
|
216
238
|
|
|
239
|
+
{' '}
|
|
240
|
+
|
|
217
241
|
<SymbolDoc name="useTransferOnFullscreenEnter" fileName="/react/" />
|
|
218
242
|
|
|
219
|
-
<SymbolDoc name="useTransferOnFullscreenExit" fileName="/react/" />
|
|
243
|
+
<SymbolDoc name="useTransferOnFullscreenExit" fileName="/react/" />
|
|
220
244
|
</>
|
|
221
245
|
|
|
222
246
|
## Specifications
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {
|
|
3
|
+
Popup,
|
|
4
|
+
useCloseOnEscape,
|
|
5
|
+
useCloseOnTargetHidden,
|
|
6
|
+
usePopupModel,
|
|
7
|
+
} from '@workday/canvas-kit-react/popup';
|
|
8
|
+
|
|
9
|
+
export default () => {
|
|
10
|
+
const model = usePopupModel();
|
|
11
|
+
|
|
12
|
+
useCloseOnEscape(model);
|
|
13
|
+
useCloseOnTargetHidden(model);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<div
|
|
17
|
+
style={{width: 400, height: 400, overflow: 'scroll', padding: 4, position: 'relative'}}
|
|
18
|
+
data-testid="scroll-area"
|
|
19
|
+
>
|
|
20
|
+
<div style={{width: 950, height: 950}}>
|
|
21
|
+
<p style={{marginBottom: 400}}>Scroll down</p>
|
|
22
|
+
<p>Scroll right and click on the button</p>
|
|
23
|
+
<Popup model={model}>
|
|
24
|
+
<div
|
|
25
|
+
style={{
|
|
26
|
+
position: 'absolute',
|
|
27
|
+
width: 950,
|
|
28
|
+
height: 950,
|
|
29
|
+
display: 'flex',
|
|
30
|
+
top: 0,
|
|
31
|
+
left: 0,
|
|
32
|
+
justifyContent: 'center',
|
|
33
|
+
}}
|
|
34
|
+
>
|
|
35
|
+
<Popup.Target data-testid="target" style={{alignSelf: 'center'}}>
|
|
36
|
+
Open Popup
|
|
37
|
+
</Popup.Target>
|
|
38
|
+
</div>
|
|
39
|
+
<Popup.Popper>
|
|
40
|
+
<Popup.Card>
|
|
41
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
42
|
+
<Popup.Body>
|
|
43
|
+
<p>
|
|
44
|
+
Scroll in any direction. The popup should close when at least 50% of the target
|
|
45
|
+
button is hidden from view
|
|
46
|
+
</p>
|
|
47
|
+
</Popup.Body>
|
|
48
|
+
</Popup.Card>
|
|
49
|
+
</Popup.Popper>
|
|
50
|
+
</Popup>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
);
|
|
54
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
|
+
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Combobox} from '@workday/canvas-kit-react/combobox';
|
|
5
|
+
import {
|
|
6
|
+
Popup,
|
|
7
|
+
useCloseOnOutsideClick,
|
|
8
|
+
useCloseOnEscape,
|
|
9
|
+
usePopupModel,
|
|
10
|
+
useInitialFocus,
|
|
11
|
+
useReturnFocus,
|
|
12
|
+
} from '@workday/canvas-kit-react/popup';
|
|
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
|
+
<Popup.Target as={SecondaryButton}>Open Popup</Popup.Target>
|
|
25
|
+
<Popup.Popper>
|
|
26
|
+
<Popup.Card>
|
|
27
|
+
<Popup.CloseIcon aria-label="Close" />
|
|
28
|
+
<Popup.Heading>Popup With Combobox</Popup.Heading>
|
|
29
|
+
<Popup.Body>
|
|
30
|
+
<FormField orientation="vertical">
|
|
31
|
+
<FormField.Label>Choose Your Food</FormField.Label>
|
|
32
|
+
<Combobox items={['Pizza', 'Cheeseburger', 'Fries', 'Hot Dog']}>
|
|
33
|
+
<FormField.Input as={Combobox.Input} />
|
|
34
|
+
<Combobox.Menu.Popper>
|
|
35
|
+
<Combobox.Menu.Card>
|
|
36
|
+
<Combobox.Menu.List>
|
|
37
|
+
{item => <Combobox.Menu.Item>{item}</Combobox.Menu.Item>}
|
|
38
|
+
</Combobox.Menu.List>
|
|
39
|
+
</Combobox.Menu.Card>
|
|
40
|
+
</Combobox.Menu.Popper>
|
|
41
|
+
</Combobox>
|
|
42
|
+
</FormField>
|
|
43
|
+
</Popup.Body>
|
|
44
|
+
</Popup.Card>
|
|
45
|
+
</Popup.Popper>
|
|
46
|
+
</Popup>
|
|
47
|
+
);
|
|
48
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ReactDOM from 'react-dom';
|
|
3
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
4
|
+
import {DeleteButton, SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
5
|
+
import {useMount} from '@workday/canvas-kit-react/common';
|
|
6
|
+
import {
|
|
7
|
+
Popup,
|
|
8
|
+
useCloseOnOutsideClick,
|
|
9
|
+
useCloseOnEscape,
|
|
10
|
+
usePopupModel,
|
|
11
|
+
usePopupStack,
|
|
12
|
+
useBringToTopOnClick,
|
|
13
|
+
useInitialFocus,
|
|
14
|
+
useReturnFocus,
|
|
15
|
+
} from '@workday/canvas-kit-react/popup';
|
|
16
|
+
|
|
17
|
+
interface WindowProps {
|
|
18
|
+
top: number;
|
|
19
|
+
left: number;
|
|
20
|
+
heading: string;
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
relativeNode: React.RefObject<HTMLDivElement>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const Window = ({children, heading, relativeNode, top, left}: WindowProps) => {
|
|
26
|
+
const model = usePopupModel({
|
|
27
|
+
initialVisibility: 'visible',
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
usePopupStack(model.state.stackRef);
|
|
31
|
+
useBringToTopOnClick(model);
|
|
32
|
+
|
|
33
|
+
// position Window relative to a container
|
|
34
|
+
useMount(() => {
|
|
35
|
+
const element = model.state.stackRef.current;
|
|
36
|
+
const rect = relativeNode.current.getBoundingClientRect();
|
|
37
|
+
element.style.position = 'absolute';
|
|
38
|
+
element.style.top = `${top + rect.top}px`;
|
|
39
|
+
element.style.left = `${left + rect.left}px`;
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
return ReactDOM.createPortal(
|
|
43
|
+
<Popup model={model}>
|
|
44
|
+
<Popup.Card width={500}>
|
|
45
|
+
<Popup.Heading>{heading}</Popup.Heading>
|
|
46
|
+
<Popup.Body>{children}</Popup.Body>
|
|
47
|
+
</Popup.Card>
|
|
48
|
+
</Popup>,
|
|
49
|
+
model.state.stackRef.current
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const TempPopup = ({
|
|
54
|
+
heading,
|
|
55
|
+
deleteText,
|
|
56
|
+
children,
|
|
57
|
+
}: {
|
|
58
|
+
heading: string;
|
|
59
|
+
deleteText: string;
|
|
60
|
+
children: ({onClose}: {onClose: () => void}) => React.ReactNode;
|
|
61
|
+
}) => {
|
|
62
|
+
const model = usePopupModel();
|
|
63
|
+
|
|
64
|
+
useInitialFocus(model);
|
|
65
|
+
useReturnFocus(model);
|
|
66
|
+
useCloseOnOutsideClick(model);
|
|
67
|
+
useCloseOnEscape(model);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<Popup model={model}>
|
|
71
|
+
<Popup.Target as={DeleteButton} style={{marginRight: '16px'}}>
|
|
72
|
+
{deleteText}
|
|
73
|
+
</Popup.Target>
|
|
74
|
+
<Popup.Popper>
|
|
75
|
+
<Popup.Card width={400} padding="s">
|
|
76
|
+
<Popup.Heading>{heading}</Popup.Heading>
|
|
77
|
+
<Popup.Body>{children({onClose: model.events.hide})}</Popup.Body>
|
|
78
|
+
</Popup.Card>
|
|
79
|
+
</Popup.Popper>
|
|
80
|
+
</Popup>
|
|
81
|
+
);
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
export default () => {
|
|
85
|
+
const ref = React.useRef<HTMLDivElement>(null);
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div ref={ref} style={{height: 420}}>
|
|
89
|
+
<Window heading="Window 1" top={50} left={50} relativeNode={ref}>
|
|
90
|
+
<Tooltip title="Really long tooltip showing how popup stacks overlap 1">
|
|
91
|
+
<span tabIndex={0}>Contents of Window 1</span>
|
|
92
|
+
</Tooltip>
|
|
93
|
+
</Window>
|
|
94
|
+
<Window heading="Window 2" top={100} left={250} relativeNode={ref}>
|
|
95
|
+
<Tooltip title="Really long tooltip showing how popup stacks overlap 2">
|
|
96
|
+
<span tabIndex={0}>Contents of Window 2</span>
|
|
97
|
+
</Tooltip>
|
|
98
|
+
</Window>
|
|
99
|
+
<Window heading="Window 4" top={300} left={250} relativeNode={ref}>
|
|
100
|
+
<div>
|
|
101
|
+
<Tooltip title="Really long tooltip showing how popup stacks overlap 3">
|
|
102
|
+
<span tabIndex={0}>Contents of Window 4</span>
|
|
103
|
+
</Tooltip>
|
|
104
|
+
</div>
|
|
105
|
+
</Window>
|
|
106
|
+
<Window heading="Window 3" top={200} left={75} relativeNode={ref}>
|
|
107
|
+
<div>
|
|
108
|
+
<Tooltip title="Really long tooltip showing how popup stacks overlap 4">
|
|
109
|
+
<span tabIndex={0} onClick={() => console.log('clicked')}>
|
|
110
|
+
Contents of Window 3
|
|
111
|
+
</span>
|
|
112
|
+
</Tooltip>
|
|
113
|
+
<div>
|
|
114
|
+
<TempPopup heading="Delete Item" deleteText="Delete Item">
|
|
115
|
+
{({onClose}) => (
|
|
116
|
+
<>
|
|
117
|
+
<div style={{marginBottom: '24px'}}>
|
|
118
|
+
Are you sure you'd like to delete the item titled 'My Item'?
|
|
119
|
+
</div>
|
|
120
|
+
<TempPopup heading="Really Delete Item" deleteText="Delete">
|
|
121
|
+
{({onClose}) => (
|
|
122
|
+
<>
|
|
123
|
+
<div style={{marginBottom: '24px'}}>
|
|
124
|
+
Are you REALLY sure you'd like to delete the item titled 'My Item'?
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
|
+
<DeleteButton style={{marginRight: '16px'}} onClick={onClose}>
|
|
128
|
+
Really Delete
|
|
129
|
+
</DeleteButton>
|
|
130
|
+
<SecondaryButton onClick={onClose}>Cancel</SecondaryButton>
|
|
131
|
+
</>
|
|
132
|
+
)}
|
|
133
|
+
</TempPopup>
|
|
134
|
+
<SecondaryButton onClick={onClose}>Cancel</SecondaryButton>
|
|
135
|
+
</>
|
|
136
|
+
)}
|
|
137
|
+
</TempPopup>
|
|
138
|
+
</div>
|
|
139
|
+
</div>
|
|
140
|
+
</Window>
|
|
141
|
+
</div>
|
|
142
|
+
);
|
|
143
|
+
};
|