@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
|
@@ -13,7 +13,7 @@ any questions.
|
|
|
13
13
|
|
|
14
14
|
## Why You Should Upgrade
|
|
15
15
|
|
|
16
|
-
Canvas Kit
|
|
16
|
+
Canvas Kit is transitioning into a
|
|
17
17
|
[new way of styling](https://github.com/Workday/canvas-kit/discussions/2265). Theming and building
|
|
18
18
|
an in sync Canvas Kit CSS has been at the top of our minds. We've started using our new
|
|
19
19
|
[Canvas Tokens Web](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs)
|
|
@@ -23,27 +23,29 @@ provide semantic tokens that can translate to theming components.
|
|
|
23
23
|
|
|
24
24
|
A note to the reader:
|
|
25
25
|
|
|
26
|
-
- While we still support our old tokens from `@workday/canvas-kit-react/tokens
|
|
26
|
+
- While we still support our old tokens from `@workday/canvas-kit-react/tokens`, **you must**
|
|
27
27
|
install our new tokens from `@workday/canvas-tokens-web`. You can find more info in our
|
|
28
28
|
[docs](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs).
|
|
29
|
-
- In this release, we've introduced a
|
|
30
|
-
[new styling API](https://workday.github.io/canvas-kit/?path=/docs/styling-basics--create-stencil).
|
|
31
|
-
This shouldn't effect the way you currently style your components. Because we're moving away from
|
|
32
|
-
Emotion, support for style props will eventually be removed, however, this API provide backwards
|
|
33
|
-
compatability. If you want to slowly move off of Emotion as well, you can start styling components
|
|
34
|
-
via the `cs` prop or our new styling utilities.
|
|
35
29
|
|
|
36
30
|
## Table of contents
|
|
37
31
|
|
|
38
32
|
- [Canvas Tokens](#canvas-tokens)
|
|
39
33
|
- [Codemod](#codemod)
|
|
34
|
+
- [Instructions](#instructions)
|
|
35
|
+
- [Styling Updates](#styling-updates)
|
|
36
|
+
- [Compatibility Mode](#compatibility-mode)
|
|
40
37
|
- [Deprecations](#deprecations)
|
|
38
|
+
- [Form Field Container](#form-field-container)
|
|
41
39
|
- [Removals](#removals)
|
|
42
|
-
- [
|
|
43
|
-
- [Select (Preview)](#select-preview)
|
|
40
|
+
- [Input Icon Container](#input-icon-container)
|
|
44
41
|
- [Component Updates](#component-updates)
|
|
45
42
|
- [Styling API and CSS Tokens](#styling-api-and-css-tokens)
|
|
46
43
|
- [Avatar](#avatar)
|
|
44
|
+
- [Form Field](#form-field)
|
|
45
|
+
- [Form Field Group](#form-field-group)
|
|
46
|
+
- [Form Field Field](#form-field-field)
|
|
47
|
+
- [Search Form](#search-form)
|
|
48
|
+
- [Select](#select)
|
|
47
49
|
- [Text Area](#text-area)
|
|
48
50
|
- [Troubleshooting](#troubleshooting)
|
|
49
51
|
- [Glossary](#glossary)
|
|
@@ -55,30 +57,124 @@ A note to the reader:
|
|
|
55
57
|
|
|
56
58
|
In v12, all the components listed in this guide have started using our new
|
|
57
59
|
[Canvas Tokens Web](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs).
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
the variables are defined. For more information on installing and using, please reference our tokens
|
|
60
|
+
**You must** add `@workday/canvas-tokens-web` to ensure our components are properly styled and the
|
|
61
|
+
variables are defined. For more information on installing and using, please reference our tokens
|
|
61
62
|
[docs](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs).
|
|
62
63
|
|
|
64
|
+
## Codemod
|
|
65
|
+
|
|
66
|
+
We've provided a [codemod](https://github.com/Workday/canvas-kit/tree/master/modules/codemod) to
|
|
67
|
+
automatically update your code to work with most of the breaking changes in v12. **Breaking changes
|
|
68
|
+
handled by the codemod are marked with 🤖 in the Upgrade Guide.**
|
|
69
|
+
|
|
70
|
+
> **Note: In v12, we have done some infrastructure updates with moving to Storybook 7, Webpack 5,
|
|
71
|
+
> Typescript 4.9 and Cypress 13 . With these updates has come some formatting issues after running
|
|
72
|
+
> our codemods. We recommend running a formatter to address the format issues that have been
|
|
73
|
+
> introduced in v12.**
|
|
74
|
+
|
|
75
|
+
A codemod is a script that makes programmatic transformations on your codebase by traversing the
|
|
76
|
+
[AST](https://www.codeshiftcommunity.com/docs/understanding-asts), identifying patterns, and making
|
|
77
|
+
prescribed changes. This greatly decreases opportunities for error and reduces the number of manual
|
|
78
|
+
updates, which allows you to focus on changes that need your attention. **We highly recommend you
|
|
79
|
+
use the codemod for these reasons.**
|
|
80
|
+
|
|
81
|
+
If you're new to running codemods or if it's been a minute since you've used one, there are a few
|
|
82
|
+
things you'll want to keep in mind.
|
|
83
|
+
|
|
84
|
+
- Our codemods are meant to be run sequentially. For example, if you're using v8 of Canvas Kit,
|
|
85
|
+
you'll need to run the v9 codemod before you run v10 and so on.
|
|
86
|
+
- The codemod will update your code to be compatible with the specified version, but it will **not**
|
|
87
|
+
remove outdated dependencies or upgrade dependencies to the latest version. You'll need to upgrade
|
|
88
|
+
dependencies on your own.
|
|
89
|
+
- We recommend upgrading dependencies before running the codemod.
|
|
90
|
+
- Always review your `package.json` files to make sure your dependency versions look correct.
|
|
91
|
+
- The codemod will not handle every breaking change in v12. You will likely need to make some manual
|
|
92
|
+
changes to be compatible. Use our Upgrade Guide as a checklist.
|
|
93
|
+
- Codemods are not bulletproof.
|
|
94
|
+
- Conduct a thorough PR and QA review of all changes to ensure no regressions were introduced.
|
|
95
|
+
- As a safety precaution, we recommend committing the changes from the codemod as a single
|
|
96
|
+
isolated commit (separate from other changes) so you can roll back more easily if necessary.
|
|
97
|
+
|
|
98
|
+
We're here to help! Automatic changes to your codebase can feel scary. You can always reach out to
|
|
99
|
+
our team. We'd be very happy to walk you through the process to set you up for success.
|
|
100
|
+
|
|
101
|
+
### Instructions
|
|
102
|
+
|
|
103
|
+
The easiest way to run our codemod is to use `npx` in your terminal.
|
|
104
|
+
|
|
105
|
+
```sh
|
|
106
|
+
npx @workday/canvas-kit-codemod v12 [path]
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Be sure to provide specific directories that need to be updated via the `[path]` argument. This
|
|
110
|
+
decreases the amount of AST the codemod needs to traverse and reduces the chances of the script
|
|
111
|
+
having an error. For example, if your source code lives in `src/`, use `src/` as your `[path]`. Or,
|
|
112
|
+
if you have a monorepo with three packages using Canvas Kit, provide those specific packages as your
|
|
113
|
+
`[path]`.
|
|
114
|
+
|
|
115
|
+
Alternatively, if you're unable to run the codemod successfully using `npx`, you can install the
|
|
116
|
+
codemod package as a dev dependency, run it with `yarn`, and then remove the package after you're
|
|
117
|
+
finished.
|
|
118
|
+
|
|
119
|
+
```sh
|
|
120
|
+
yarn add @workday/canvas-kit-codemod --dev
|
|
121
|
+
yarn canvas-kit-codemod v12 [path]
|
|
122
|
+
yarn remove @workday/canvas-kit-codemod
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
> **Note**: The codemod only works on `.js`, `.jsx`, `.ts`, and `.tsx` files. You'll need to
|
|
126
|
+
> manually edit other file types (`.json`, `.mdx`, `.md`, etc.). You may need to run your linter
|
|
127
|
+
> after executing the codemod, as its resulting formatting (spacing, quotes, etc.) may not match
|
|
128
|
+
> your project conventions.
|
|
129
|
+
|
|
130
|
+
## Styling Updates
|
|
131
|
+
|
|
132
|
+
### Compatibility Mode
|
|
133
|
+
|
|
134
|
+
In v12, we have addressed a style merge issue with removing forced compatibility mode. For more
|
|
135
|
+
information on this change, please read our
|
|
136
|
+
[discussion](https://github.com/Workday/canvas-kit/discussions/2893).
|
|
137
|
+
|
|
63
138
|
## Deprecations
|
|
64
139
|
|
|
65
140
|
We add the [@deprecated](https://jsdoc.app/tags-deprecated.html) JSDoc tag to code we plan to remove
|
|
66
141
|
in a future major release. This signals consumers to migrate to a more stable alternative before the
|
|
67
142
|
deprecated code is removed.
|
|
68
143
|
|
|
69
|
-
|
|
144
|
+
### Form Field Container
|
|
70
145
|
|
|
71
|
-
|
|
72
|
-
promoted or replaced a component or utility.
|
|
146
|
+
**PR:** [#2865](https://github.com/Workday/canvas-kit/pull/2865)
|
|
73
147
|
|
|
74
|
-
|
|
148
|
+
We've deprecated `FormField.Container` in v12. Please use `FormField.Field` or
|
|
149
|
+
`FormFieldGroup.Field` for grouped inputs as this ensures proper label alignment and spacing of
|
|
150
|
+
inputs and hint text, regardless of the orientation.
|
|
75
151
|
|
|
76
|
-
|
|
152
|
+
```tsx
|
|
153
|
+
// v11
|
|
154
|
+
<FormField>
|
|
155
|
+
<FormField.Label>Email</FormField.Label>
|
|
156
|
+
<FormField.Container>
|
|
157
|
+
<FormField.Input as={TextInput} />
|
|
158
|
+
<FormField.Hint>You must provide an email</FormField.Hint>
|
|
159
|
+
</FormField.Container>
|
|
160
|
+
</FormField>
|
|
161
|
+
|
|
162
|
+
// v12
|
|
163
|
+
<FormField>
|
|
164
|
+
<FormField.Label>Email</FormField.Label>
|
|
165
|
+
<FormField.Field>
|
|
166
|
+
<FormField.Input as={TextInput} />
|
|
167
|
+
<FormField.Hint>You must provide an email</FormField.Hint>
|
|
168
|
+
</FormField.Field>
|
|
169
|
+
</FormField>
|
|
170
|
+
```
|
|
77
171
|
|
|
78
|
-
|
|
79
|
-
[Select component from Main](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-select--basic).
|
|
172
|
+
## Removals
|
|
80
173
|
|
|
81
|
-
|
|
174
|
+
Removals are deletions from our codebase and you can no longer consume this component. We've either
|
|
175
|
+
promoted or replaced a component or utility.
|
|
176
|
+
|
|
177
|
+
### Input Icon Container
|
|
82
178
|
|
|
83
179
|
**PR:** [#2838](https://github.com/Workday/canvas-kit/pull/2838)
|
|
84
180
|
|
|
@@ -92,15 +188,21 @@ from Main instead.
|
|
|
92
188
|
|
|
93
189
|
### Styling API and CSS Tokens
|
|
94
190
|
|
|
95
|
-
**PRs:** [#
|
|
191
|
+
**PRs:** [#2793](https://github.com/Workday/canvas-kit/pull/2793),
|
|
192
|
+
[#2865](https://github.com/Workday/canvas-kit/pull/2865),
|
|
193
|
+
[#2881](https://github.com/Workday/canvas-kit/pull/2881),
|
|
194
|
+
[#2825](https://github.com/Workday/canvas-kit/pull/2825),
|
|
96
195
|
[#2795](https://github.com/Workday/canvas-kit/pull/2795),
|
|
97
|
-
[#2793](https://github.com/Workday/canvas-kit/pull/2793)
|
|
98
196
|
|
|
99
197
|
Several components have been refactored to use our new
|
|
100
198
|
[Canvas Tokens](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs) and
|
|
101
199
|
[styling API](https://workday.github.io/canvas-kit/?path=/docs/styling-basics--create-modifiers#createstyles-api).
|
|
102
200
|
The React interface **has not changed**, but CSS variables are now used for dynamic properties.
|
|
103
201
|
|
|
202
|
+
> **Note:** These components also support our new `cs` prop for styling. Learn more about styling
|
|
203
|
+
> with `cs` in our
|
|
204
|
+
> [documentation](https://workday.github.io/canvas-kit/?path=/docs/styling-basics--cs-prop).
|
|
205
|
+
|
|
104
206
|
The following components are affected:
|
|
105
207
|
|
|
106
208
|
- `Avatar`
|
|
@@ -111,18 +213,222 @@ The following components are affected:
|
|
|
111
213
|
- `TextInput`
|
|
112
214
|
- `Toast`
|
|
113
215
|
|
|
114
|
-
> **Note:** These components also support our new `cs` prop for styling. Learn more about styling
|
|
115
|
-
> with `cs` in our
|
|
116
|
-
> [documentation](https://workday.github.io/canvas-kit/?path=/docs/styling-basics--cs-prop).
|
|
117
|
-
|
|
118
216
|
### Avatar
|
|
119
217
|
|
|
120
|
-
|
|
121
|
-
|
|
218
|
+
**PR** [#2793](https://github.com/Workday/canvas-kit/pull/2793)
|
|
219
|
+
|
|
220
|
+
Avatar has been updated to use our new
|
|
221
|
+
[styling utilities](https://workday.github.io/canvas-kit/?path=/docs/styling-basics--create-stencil).
|
|
222
|
+
The following changes have been made to the API:
|
|
223
|
+
|
|
224
|
+
- `Avatar.Size` has been deprecated. The `size` prop still accepts `Avatar.Size` in addition to the
|
|
225
|
+
following values:
|
|
122
226
|
`"extraExtraLarge" | "extraLarge" | "large" | "medium" | "small" | "extraSmall" | (string{})`
|
|
123
|
-
- `Avatar.Variant`
|
|
124
|
-
|
|
125
|
-
- The `as` prop now accepts any element, not just `div`.
|
|
227
|
+
- `Avatar.Variant` has been deprecated. The `variant` prop still accepts `Avatar.Variant` in
|
|
228
|
+
addition to the following values: `"dark" | "light"`
|
|
229
|
+
- The `as` prop now accepts any element, not just a `div`.
|
|
230
|
+
|
|
231
|
+
> **Note:** Both `Avatar.Size` and `Avatar.Variant` have been deprecated in favor of the new string
|
|
232
|
+
> union types. You will see a console warn message while in development if you're still using this.
|
|
233
|
+
> Please update your types and usage before v13.
|
|
234
|
+
|
|
235
|
+
### Form Field
|
|
236
|
+
|
|
237
|
+
<div style={{display: 'inline-flex', gap: '.5rem'}}>
|
|
238
|
+
<StatusIndicator variant="red" emphasis="low">
|
|
239
|
+
<StatusIndicator.Label>Breaking Change</StatusIndicator.Label>
|
|
240
|
+
</StatusIndicator>
|
|
241
|
+
<StatusIndicator variant="green" emphasis="low">
|
|
242
|
+
<StatusIndicator.Label>🤖 Codemod Available</StatusIndicator.Label>
|
|
243
|
+
</StatusIndicator>
|
|
244
|
+
</div>
|
|
245
|
+
|
|
246
|
+
**PRs:** [#2865](https://github.com/Workday/canvas-kit/pull/2865),
|
|
247
|
+
[#2881](https://github.com/Workday/canvas-kit/pull/2881),
|
|
248
|
+
[#2934](https://github.com/Workday/canvas-kit/pull/2934)
|
|
249
|
+
|
|
250
|
+
We've promoted FormField from [Preview](#preview) to [Main](#main). The following changes has been
|
|
251
|
+
made to provide more flexibility and better explicit components when using inputs.
|
|
252
|
+
|
|
253
|
+
- The orientation prop on the `FormField` component will be updated to accept the following values:
|
|
254
|
+
`"vertical"`, `"horizontalStart"`, and `"horizontalEnd"`. `"horizontal"` will still be accepted as
|
|
255
|
+
a value in v12, but it will be deprecated and slated for removal in a future major release. These
|
|
256
|
+
changes are intended to provide more flexibility with label alignments on `FormField` elements.
|
|
257
|
+
|
|
258
|
+
> **Note**: The horizontal alignment of start and end are relative to its container, meaning start
|
|
259
|
+
> and end match the flex property of `flex-start` and `flex-end`. This is especially applicable for
|
|
260
|
+
> moving between RTL (right-to-left) and LTR (left-to-right) languages.
|
|
261
|
+
|
|
262
|
+
> **Note:** Orientation `"horizontal"` has been deprecated. You will see a console warn message
|
|
263
|
+
> suggesting to update your types and usage to `"horizontalStart"`, `"horizontalEnd"` or
|
|
264
|
+
> `"vertical"`.
|
|
265
|
+
|
|
266
|
+
- `useFormFieldModel`: `orientation` has been added back into `useFormFieldModel`. While we still
|
|
267
|
+
support compat mode due to
|
|
268
|
+
[style merging issues](https://github.com/Workday/canvas-kit/discussions/2893), having orientation
|
|
269
|
+
on the model allows for proper styling of sub components.
|
|
270
|
+
|
|
271
|
+
- Styles clean up: `FormField.Hint` and `FormField.Label` where using `margin` for spacing. We've
|
|
272
|
+
updated styles so that the containing element uses `gap` for proper spacing.
|
|
273
|
+
|
|
274
|
+
- We've added a new
|
|
275
|
+
[example](https://workday.github.io/canvas-kit/?path=/docs/examples-forms-density-and-alignment--docs)
|
|
276
|
+
to our docs to showcase how our inputs can be styled in different environments like density and
|
|
277
|
+
container alignment.
|
|
278
|
+
|
|
279
|
+
> **Note:** If spacing seems off between the input and hint text, ensure you're using
|
|
280
|
+
> `FormField.Field` wrapping your input and hint text.
|
|
281
|
+
|
|
282
|
+
##### Breaking API Change
|
|
283
|
+
|
|
284
|
+
The newly promoted `FormField` is a
|
|
285
|
+
[compound component](https://workday.github.io/canvas-kit/?path=/docs/guides-compound-components--page).
|
|
286
|
+
Due to the different APIs of the component, this change is **not codemodable**. The following shows
|
|
287
|
+
an example of how to **update** your code to match the new compound component API.
|
|
288
|
+
|
|
289
|
+
```tsx
|
|
290
|
+
// v11 FormField in Main
|
|
291
|
+
<FormField
|
|
292
|
+
error={FormField.ErrorType.Alert}
|
|
293
|
+
labelPosition={FormField.LabelPosition.Left}
|
|
294
|
+
useFieldSet={true}
|
|
295
|
+
required={true}
|
|
296
|
+
hintId="hint-alert"
|
|
297
|
+
hintText="Please enter a valid email."
|
|
298
|
+
label="Email"
|
|
299
|
+
>
|
|
300
|
+
<TextInput onChange={handleChange} value={value} />
|
|
301
|
+
</FormField>
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
// v12 Newly promoted FormField from Preview to Main
|
|
305
|
+
<FormField
|
|
306
|
+
error="error"
|
|
307
|
+
orientation="horizontalStart"
|
|
308
|
+
isRequired={true}
|
|
309
|
+
>
|
|
310
|
+
<FormField.Label>Email</FormField.Label>
|
|
311
|
+
<FormField.Field>
|
|
312
|
+
<FormField.Input as={TextInput} onChange={handleChange} value={value} />
|
|
313
|
+
<FormField.Hint>Please enter a valid email.</FormField.Hint>
|
|
314
|
+
</FormField.Field>
|
|
315
|
+
</FormField>
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
**Noticeable changes:**
|
|
319
|
+
|
|
320
|
+
- `error` prop takes in the following values: `"error" | "alert"`.
|
|
321
|
+
- `labelPosition` becomes `orientation` with the following values:
|
|
322
|
+
`"horizontal" | "horizontalStart" | "horizontalEnd" | "vertical"`.
|
|
323
|
+
- `useFieldSet` is no longer valid. If you want to group inputs, use
|
|
324
|
+
[`FormFieldGroup`](#form-field-group) component.
|
|
325
|
+
- `required` becomes `isRequired`.
|
|
326
|
+
- `hintId` is no longer needed. The component handles associating the hint text, label and input
|
|
327
|
+
automatically. If you wish to have a unique `id`, you can add one onto the `FormField` element.
|
|
328
|
+
- `hintText` is no longer a valid prop. Use `FormField.Hint` sub-component.
|
|
329
|
+
- `errorLabel` and `alertLabel` are no longer valid props. Customize your hint text inside of
|
|
330
|
+
`FormField.Hint`.
|
|
331
|
+
- `label` is no longer a valid prop. Use `FormField.Label` sub component to render your label text.
|
|
332
|
+
- Instead of rendering an input, ensure you use `FormField.Input` with the `as` prop. This ensures
|
|
333
|
+
proper error handling and aria attributes for accessibility.
|
|
334
|
+
|
|
335
|
+
🤖 The codemod will handle the change of `orientation="horizontal"` to
|
|
336
|
+
`orientation="horizontalStart"` if you're using the string literal values. It will also handle
|
|
337
|
+
updating your imports from `@workday/canvas-kit-preview-react/form-field` to
|
|
338
|
+
`@workday/canvas-kit-react/form-field`.
|
|
339
|
+
|
|
340
|
+
#### Form Field Group
|
|
341
|
+
|
|
342
|
+
We've added a new component to the `FormField` package to allow users to group inputs without
|
|
343
|
+
worrying about setting the `as` prop on the `FormField` component.
|
|
344
|
+
|
|
345
|
+
Use `FormFieldGroup` when you have a group of inputs that need to be associated to one another, like
|
|
346
|
+
`RadioGroup` or a group of `Checkbox`'s.
|
|
347
|
+
|
|
348
|
+
`FormFieldGroup` supports the same props of `FormField`:
|
|
349
|
+
|
|
350
|
+
- `error`: `"alert" | "error"` Defines the error around the whole group of inputs.
|
|
351
|
+
- `orientation`: `"horizontalStart" | "horizontalEnd" | "vertical" | "horizontal" `. Defines the
|
|
352
|
+
label placement.
|
|
353
|
+
- `isRequired`: `true` Defines if a group like `RadioGroup` is required.
|
|
354
|
+
|
|
355
|
+
#### Form Field Field
|
|
356
|
+
|
|
357
|
+
We've added a new sub-component to `FormField` and `FormFieldGroup`, `FormField.Field` and
|
|
358
|
+
`FormFieldGroup.Field`. This sub-component is meant to ensure that the label is always aligned with
|
|
359
|
+
the input regardless of the `orientation`prop's value on`FormField` or `FormFieldGroup`. This
|
|
360
|
+
component should replace `FormField.Container` and always be used to ensure proper alignment of the
|
|
361
|
+
label and hint text. Our examples have been updated to reflect this.
|
|
362
|
+
|
|
363
|
+
Although there is no codemod for this change and it's non-breaking, we suggest moving towards adding
|
|
364
|
+
this sub-component when using `FormField`. This component also exists on `FormFieldGroup`.
|
|
365
|
+
|
|
366
|
+
```tsx
|
|
367
|
+
<FormField orientation="horizontal">
|
|
368
|
+
<FormField.Label>Email</FormField.Label>
|
|
369
|
+
<FormField.Field>
|
|
370
|
+
<FormField.Input as={TextInput} />
|
|
371
|
+
<FormField.Hint>You must provide an email</FormField.Hint>
|
|
372
|
+
</FormField.Field>
|
|
373
|
+
</FormField>
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
### Search Form (Labs)
|
|
377
|
+
|
|
378
|
+
**PRs:** [#2934](https://github.com/Workday/canvas-kit/pull/2934),
|
|
379
|
+
|
|
380
|
+
`SearchForm` is now using the newly promoted `FormField` component. `SearchForm` now uses `labelId`
|
|
381
|
+
to set the appropiate aria attributes and `id` on the underlying input element. There should be no
|
|
382
|
+
visual breaking changes and the API remains the same.
|
|
383
|
+
|
|
384
|
+
### Select
|
|
385
|
+
|
|
386
|
+
**PR:** [#2865](https://github.com/Workday/canvas-kit/pull/2865)
|
|
387
|
+
|
|
388
|
+
As we transition to use our CSS tokens to provide better theming capabilities and our new styling
|
|
389
|
+
methods, we're moving away from components extending `Themeable`. `Themeable` has been removed from
|
|
390
|
+
`SelectProps.`
|
|
391
|
+
|
|
392
|
+
If you wish to theme `Select` we suggest using the `CanvasProvider` to do so.
|
|
393
|
+
|
|
394
|
+
```tsx
|
|
395
|
+
const theme: PartialEmotionCanvasTheme = {
|
|
396
|
+
canvas: {
|
|
397
|
+
palette: {
|
|
398
|
+
common: {
|
|
399
|
+
focusOutline: 'pink',
|
|
400
|
+
},
|
|
401
|
+
primary: {
|
|
402
|
+
main: 'green',
|
|
403
|
+
light: 'lightgreen',
|
|
404
|
+
},
|
|
405
|
+
},
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
|
|
409
|
+
//...
|
|
410
|
+
|
|
411
|
+
<CanvasProvider theme={theme}>
|
|
412
|
+
<Flex cs={parentContainerStyles}>
|
|
413
|
+
<Select items={options}>
|
|
414
|
+
<FormField>
|
|
415
|
+
<FormField.Label>Contact</FormField.Label>
|
|
416
|
+
<FormField.Input as={Select.Input} onChange={handleChange} />
|
|
417
|
+
<Select.Popper>
|
|
418
|
+
<Select.Card>
|
|
419
|
+
<Select.List>
|
|
420
|
+
{item => {
|
|
421
|
+
return <Select.Item>{item}</Select.Item>;
|
|
422
|
+
}}
|
|
423
|
+
</Select.List>
|
|
424
|
+
</Select.Card>
|
|
425
|
+
</Select.Popper>
|
|
426
|
+
</FormField>
|
|
427
|
+
</Select>
|
|
428
|
+
Selected Value: {value}
|
|
429
|
+
</Flex>
|
|
430
|
+
</CanvasProvider>;
|
|
431
|
+
```
|
|
126
432
|
|
|
127
433
|
### Text Area
|
|
128
434
|
|
|
@@ -134,17 +440,22 @@ type.
|
|
|
134
440
|
|
|
135
441
|
```tsx
|
|
136
442
|
// v11
|
|
137
|
-
interface MyProps {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
443
|
+
interface MyProps {
|
|
444
|
+
resize?: TextAreaResizeDirection;
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
// v12
|
|
448
|
+
type ValueOf<T> = T[keyof T];
|
|
449
|
+
interface MyProps {
|
|
450
|
+
resize?: ValueOf<typeof TextAreaResizeDirection>;
|
|
451
|
+
}
|
|
141
452
|
```
|
|
142
453
|
|
|
143
454
|
## Troubleshooting
|
|
144
455
|
|
|
145
456
|
### My Styles Seem Broken?
|
|
146
457
|
|
|
147
|
-
Our components are reliant on our new Canvas Tokens Web package. Be sure
|
|
458
|
+
Our components are reliant on our new Canvas Tokens Web package. Be sure to install
|
|
148
459
|
`@workday/canvas-tokens-web`. For more information, reference our
|
|
149
460
|
[Getting Started docs](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs)
|
|
150
461
|
for this package.
|
|
@@ -201,5 +512,5 @@ experimental code and is analagous to code in alpha.
|
|
|
201
512
|
|
|
202
513
|
Breaking changes can be deployed to Labs at any time without triggering a major version update and
|
|
203
514
|
may not be subject to the same rigor in communcation and migration strategies reserved for breaking
|
|
204
|
-
changes in [Preview](#preview) and [Main](#main).
|
|
205
|
-
"@workday/canvas-tokens-web/dist/es6/system"
|
|
515
|
+
changes in [Preview](#preview) and [Main](#main).
|
|
516
|
+
`import { opacity } from "@workday/canvas-tokens-web/dist/es6/system"`
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
<Meta
|
|
2
|
-
title="Guides/Upgrade Guides/v4.0"
|
|
3
|
-
parameters={{
|
|
4
|
-
viewMode: 'docs',
|
|
5
|
-
previewTabs: {
|
|
6
|
-
canvas: {hidden: true},
|
|
7
|
-
},
|
|
8
|
-
}}
|
|
9
|
-
/>
|
|
10
|
-
|
|
11
1
|
# Canvas Kit 4.0 Upgrade Guide
|
|
12
2
|
|
|
13
3
|
Below are the breaking changes made in Canvas Kit v4. Please reach out if you have any questions
|
|
@@ -40,7 +30,7 @@ our React infrastructure and components.
|
|
|
40
30
|
Breaking:
|
|
41
31
|
|
|
42
32
|
- React & ReactDOM upgraded to 16.12 (https://github.com/Workday/canvas-kit/pull/533)
|
|
43
|
-
- We are now fully adopting hooks, so
|
|
33
|
+
- We are now fully adopting hooks, so version 16.7 and below are no longer supported
|
|
44
34
|
|
|
45
35
|
Non-breaking:
|
|
46
36
|
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
<Meta
|
|
2
|
-
title="Guides/API & Pattern Guidelines"
|
|
3
|
-
parameters={{
|
|
4
|
-
viewMode: 'docs',
|
|
5
|
-
previewTabs: {
|
|
6
|
-
canvas: { hidden: true }
|
|
7
|
-
},
|
|
8
|
-
}}
|
|
9
|
-
/>
|
|
10
|
-
|
|
11
1
|
# API & Pattern Guidelines
|
|
12
2
|
|
|
13
3
|
Note: This repo hasn't seen a full audit, so you may find examples that contradict these guidelines.
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
<Meta
|
|
2
|
-
title="Guides/Contributing"
|
|
3
|
-
parameters={{
|
|
4
|
-
viewMode: 'docs',
|
|
5
|
-
previewTabs: {
|
|
6
|
-
canvas: {hidden: true},
|
|
7
|
-
},
|
|
8
|
-
}}
|
|
9
|
-
/>
|
|
10
|
-
|
|
11
1
|
# Contributing to Canvas
|
|
12
2
|
|
|
13
3
|
On behalf of the Canvas team, thank you so much for your contribution to this project and being a
|