@workday/canvas-kit-docs 12.0.0-alpha.855-next.0 → 12.0.0-alpha.898-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es6/docgen/docParser.d.ts +1 -1
- package/dist/es6/docgen/docParser.d.ts.map +1 -1
- package/dist/es6/docgen/docParser.js +12 -2
- package/dist/es6/docgen/docTypes.d.ts +1 -1
- package/dist/es6/docgen/docTypes.d.ts.map +1 -1
- package/dist/es6/docgen/plugins/enhancedComponentParser.d.ts +1 -1
- package/dist/es6/docgen/plugins/enhancedComponentParser.d.ts.map +1 -1
- package/dist/es6/docgen/traverse.d.ts +2 -2
- package/dist/es6/docgen/traverse.d.ts.map +1 -1
- package/dist/es6/index.d.ts +1 -0
- package/dist/es6/index.d.ts.map +1 -1
- package/dist/es6/index.js +1 -0
- package/dist/es6/lib/ExampleCodeBlock.d.ts +3 -0
- package/dist/es6/lib/ExampleCodeBlock.d.ts.map +1 -0
- package/dist/es6/lib/ExampleCodeBlock.js +56 -0
- package/dist/es6/lib/InformationHighlight/Base.js +1 -1
- package/dist/es6/lib/InformationHighlight/Body.js +1 -1
- package/dist/es6/lib/InformationHighlight/Heading.js +1 -1
- package/dist/es6/lib/InformationHighlight/Icon.d.ts +1 -1
- package/dist/es6/lib/InformationHighlight/Icon.d.ts.map +1 -1
- package/dist/es6/lib/InformationHighlight/Icon.js +1 -1
- package/dist/es6/lib/InformationHighlight/Link.js +1 -1
- package/dist/es6/lib/InformationHighlight/index.d.ts +1 -1
- package/dist/es6/lib/InformationHighlight/index.d.ts.map +1 -1
- package/dist/es6/lib/InformationHighlight/index.js +1 -1
- package/dist/es6/lib/InformationHighlight/modelHook.d.ts +1 -1
- package/dist/es6/lib/InformationHighlight/modelHook.d.ts.map +1 -1
- package/dist/es6/lib/MDXElements.d.ts +2 -1
- package/dist/es6/lib/MDXElements.d.ts.map +1 -1
- package/dist/es6/lib/MDXElements.js +1 -1
- package/dist/es6/lib/MoreTooltip.d.ts +1 -1
- package/dist/es6/lib/MoreTooltip.d.ts.map +1 -1
- package/dist/es6/lib/MoreTooltip.js +2 -2
- package/dist/es6/lib/Specifications.d.ts +2 -1
- package/dist/es6/lib/Specifications.d.ts.map +1 -1
- package/dist/es6/lib/StylePropsTable.d.ts +3 -2
- package/dist/es6/lib/StylePropsTable.d.ts.map +1 -1
- package/dist/es6/lib/Table.js +6 -6
- package/dist/es6/lib/Value.d.ts +3 -3
- package/dist/es6/lib/Value.d.ts.map +1 -1
- package/dist/es6/lib/Value.js +4 -2
- package/dist/es6/lib/docs.d.ts +3 -3
- package/dist/es6/lib/docs.d.ts.map +1 -1
- package/dist/es6/lib/docs.js +45199 -40010
- package/dist/es6/lib/specs.js +1 -7130
- package/dist/es6/lib/widgetUtils.d.ts +5 -5
- package/dist/es6/lib/widgetUtils.d.ts.map +1 -1
- package/dist/es6/lib/widgetUtils.js +2 -2
- package/dist/es6/mdx/installBlock.d.ts +2 -1
- package/dist/es6/mdx/installBlock.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Background.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Background.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Background.js +6 -4
- package/dist/es6/mdx/style-props/examples/Border.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Border.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Border.js +4 -4
- package/dist/es6/mdx/style-props/examples/Color.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Color.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Color.js +4 -4
- package/dist/es6/mdx/style-props/examples/Depth.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Depth.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Depth.js +4 -4
- package/dist/es6/mdx/style-props/examples/Flex.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Flex.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Flex.js +9 -9
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/FlexItem.js +9 -9
- package/dist/es6/mdx/style-props/examples/Grid.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Grid.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Grid.js +4 -4
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/GridItem.js +5 -5
- package/dist/es6/mdx/style-props/examples/Layout.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Layout.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Layout.js +4 -4
- package/dist/es6/mdx/style-props/examples/Other.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Other.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Other.js +4 -4
- package/dist/es6/mdx/style-props/examples/Position.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Position.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Position.js +4 -4
- package/dist/es6/mdx/style-props/examples/Space.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Space.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Space.js +4 -4
- package/dist/es6/mdx/style-props/examples/Text.d.ts +2 -1
- package/dist/es6/mdx/style-props/examples/Text.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Text.js +1 -1
- package/dist/es6/mdx/versionsTable.d.ts +2 -1
- package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.d.ts +2 -1
- package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.js +5 -3
- package/dist/mdx/11.0-UPGRADE-GUIDE.mdx +8 -8
- package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +356 -35
- package/dist/mdx/4.0-UPGRADE-GUIDE.mdx +1 -11
- package/dist/mdx/5.0-UPGRADE-GUIDE.mdx +0 -10
- package/dist/mdx/6.0-UPGRADE-GUIDE.mdx +0 -10
- package/dist/mdx/7.0-UPGRADE-GUIDE.mdx +0 -10
- package/dist/mdx/8.0-UPGRADE-GUIDE.mdx +0 -10
- package/dist/mdx/API_PATTERN_GUIDELINES.mdx +0 -10
- package/dist/mdx/COMPOUND_COMPONENTS.mdx +0 -10
- package/dist/mdx/CONTRIBUTING.mdx +0 -10
- package/dist/mdx/CREATING_COMPOUND_COMPONENTS.mdx +0 -10
- package/dist/mdx/DOCUMENTATION_GUIDELINES.mdx +20 -22
- package/dist/mdx/GETTING_STARTED.mdx +0 -9
- package/dist/mdx/MAINTAINING.mdx +12 -20
- package/dist/mdx/TESTING.mdx +1 -26
- package/dist/mdx/changelog.mdx +5 -0
- package/dist/mdx/labs-react/combobox/Combobox.mdx +52 -0
- package/dist/mdx/labs-react/combobox/examples/Basic.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/DisabledItem.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/GroupOfResult.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/Grow.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/NoClearButton.tsx +87 -0
- package/dist/mdx/labs-react/combobox/examples/RTL.tsx +90 -0
- package/dist/mdx/labs-react/expandable/Expandable.mdx +1 -3
- package/dist/mdx/labs-react/search-form/SearchForm.mdx +1 -4
- package/dist/mdx/preview-react/_examples/mdx/Forms.mdx +9 -0
- package/dist/mdx/preview-react/_examples/mdx/FormsWithFormik.mdx +14 -0
- package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/SelectWithFormik.tsx +1 -5
- package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/TextInputWithReactHookForm.tsx +2 -1
- package/dist/mdx/preview-react/divider/Divider.mdx +36 -0
- package/dist/mdx/preview-react/divider/examples/Basic.tsx +105 -0
- package/dist/mdx/preview-react/divider/examples/CustomSpace.tsx +32 -0
- package/dist/mdx/preview-react/loading-sparkles/LoadingSparkles.mdx +1 -2
- package/dist/mdx/preview-react/menu/Menu.mdx +2 -9
- package/dist/mdx/preview-react/pill/Pill.mdx +1 -3
- package/dist/mdx/preview-react/radio/Radio.mdx +1 -3
- package/dist/mdx/preview-react/radio/examples/Alert.tsx +26 -11
- package/dist/mdx/preview-react/radio/examples/Basic.tsx +29 -19
- package/dist/mdx/preview-react/radio/examples/Custom.tsx +32 -30
- package/dist/mdx/preview-react/radio/examples/Disabled.tsx +25 -12
- package/dist/mdx/preview-react/radio/examples/Error.tsx +26 -11
- package/dist/mdx/preview-react/radio/examples/Inverse.tsx +14 -18
- package/dist/mdx/preview-react/radio/examples/LabelPosition.tsx +25 -10
- package/dist/mdx/preview-react/radio/examples/NoValue.tsx +23 -10
- package/dist/mdx/preview-react/radio/examples/RefForwarding.tsx +17 -11
- package/dist/mdx/preview-react/radio/examples/Required.tsx +19 -11
- package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +6 -6
- package/dist/mdx/preview-react/segmented-control/SegmentedControl.mdx +1 -4
- package/dist/mdx/preview-react/select/Select.mdx +89 -0
- package/dist/mdx/preview-react/select/examples/Left Label/AlertLeft.tsx +18 -0
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultLeft.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithCustomOptionsLeft.tsx +25 -0
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithSimpleOptionsLeft.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Left Label/DisabledLeft.tsx +19 -0
- package/dist/mdx/preview-react/select/examples/Left Label/ErrorLeft.tsx +18 -0
- package/dist/mdx/preview-react/select/examples/Left Label/GrowLeft.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Left Label/ScrollableLeft.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Left Label/index.ts +8 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +18 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Default.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithCustomOptions.tsx +25 -0
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithSimpleOptions.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Disabled.tsx +19 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Error.tsx +18 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Grow.tsx +17 -0
- package/dist/mdx/preview-react/select/examples/Top Label/Scrollable.tsx +15 -0
- package/dist/mdx/preview-react/select/examples/Top Label/index.ts +8 -0
- package/dist/mdx/preview-react/select/examples/storiesData.tsx +93 -0
- package/dist/mdx/preview-react/side-panel/SidePanel.mdx +1 -4
- package/dist/mdx/preview-react/status-indicator/StatusIndicator.mdx +1 -2
- package/dist/mdx/preview-react/text-area/TextArea.mdx +1 -4
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -1
- package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +1 -1
- package/dist/mdx/preview-react/text-input/TextInput.mdx +4 -7
- package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +1 -1
- package/dist/mdx/react/_examples/{AriaLiveRegions.mdx → mdx/AriaLiveRegions.mdx} +1 -0
- package/dist/mdx/react/_examples/{CompoundComponent.mdx → mdx/CompoundComponent.mdx} +2 -0
- package/dist/mdx/react/_examples/mdx/CookieBanner.mdx +9 -0
- package/dist/mdx/react/_examples/mdx/Density.mdx +11 -0
- package/dist/mdx/react/_examples/mdx/Headers.mdx +19 -0
- package/dist/mdx/react/_examples/{Layouts.mdx → mdx/Layouts.mdx} +1 -0
- package/dist/mdx/react/_examples/{MediaModal.mdx → mdx/MediaModal.mdx} +3 -2
- package/dist/mdx/react/_examples/{SearchForm.mdx → mdx/SearchForm.mdx} +1 -0
- package/dist/mdx/react/_examples/{SidePanel.mdx → mdx/SidePanel.mdx} +2 -1
- package/dist/mdx/react/_examples/{TablesAdvanced.mdx → mdx/TablesAdvanced.mdx} +5 -5
- package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/FilterListWithLiveStatus.tsx +1 -1
- package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/HiddenLiveRegion.tsx +1 -1
- package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/TextInputWithLiveError.tsx +1 -1
- package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/VisibleLiveRegion.tsx +1 -1
- package/dist/mdx/react/_examples/mdx/examples/Density.tsx +370 -0
- package/dist/mdx/react/_examples/{examples → mdx/examples}/GlobalHeader.tsx +1 -1
- package/dist/mdx/react/_examples/{examples → mdx/examples}/SidePanelWithNavigation.tsx +0 -1
- package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithExpandableRows.tsx +26 -29
- package/dist/mdx/react/_examples/mdx/examples/common/FilterListWithLiveStatus.tsx +65 -0
- package/dist/mdx/react/_examples/mdx/examples/common/HiddenLiveRegion.tsx +30 -0
- package/dist/mdx/react/_examples/mdx/examples/common/IconButtonsWithLiveBadges.tsx +98 -0
- package/dist/mdx/react/_examples/mdx/examples/common/TextInputWithLiveError.tsx +25 -0
- package/dist/mdx/react/_examples/mdx/examples/common/VisibleLiveRegion.tsx +40 -0
- package/dist/mdx/react/action-bar/ActionBar.mdx +1 -5
- package/dist/mdx/react/action-bar/examples/Basic.tsx +12 -10
- package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +13 -10
- package/dist/mdx/react/action-bar/examples/index.ts +5 -0
- package/dist/mdx/react/avatar/avatar/Avatar.mdx +95 -0
- package/dist/mdx/react/avatar/avatar/examples/Basic.tsx +18 -0
- package/dist/mdx/react/avatar/avatar/examples/Button.tsx +21 -0
- package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +35 -0
- package/dist/mdx/react/avatar/avatar/examples/Image.tsx +26 -0
- package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +15 -0
- package/dist/mdx/react/avatar/avatar/examples/ObjectFit.tsx +25 -0
- package/dist/mdx/react/avatar/avatar/examples/Size.tsx +28 -0
- package/dist/mdx/react/avatar/avatar/examples/Variant.tsx +11 -0
- package/dist/mdx/react/avatar/avatar/examples/test-avatar.png +0 -0
- package/dist/mdx/react/badge/CountBadge.mdx +15 -18
- package/dist/mdx/react/badge/examples/NotificationBadge.tsx +30 -25
- package/dist/mdx/react/banner/Banner.mdx +3 -5
- package/dist/mdx/react/breadcrumbs/Breadcrumbs.mdx +1 -5
- package/dist/mdx/react/button/button/Button.mdx +6 -1
- package/dist/mdx/react/button/button/Hyperlink.mdx +1 -4
- package/dist/mdx/react/button/button/examples/CustomStyles.tsx +21 -7
- package/dist/mdx/react/button/button/examples/Delete.tsx +1 -1
- package/dist/mdx/react/button/button/examples/Primary.tsx +1 -1
- package/dist/mdx/react/card/card.mdx +3 -4
- package/dist/mdx/react/checkbox/Checkbox.mdx +6 -17
- package/dist/mdx/react/checkbox/examples/Alert.tsx +5 -4
- package/dist/mdx/react/checkbox/examples/Basic.tsx +14 -1
- package/dist/mdx/react/checkbox/examples/Disabled.tsx +13 -6
- package/dist/mdx/react/checkbox/examples/Error.tsx +5 -4
- package/dist/mdx/react/checkbox/examples/Inverse.tsx +0 -1
- package/dist/mdx/react/checkbox/examples/LabelPosition.tsx +11 -9
- package/dist/mdx/react/checkbox/examples/RefForwarding.tsx +21 -7
- package/dist/mdx/react/checkbox/examples/Required.tsx +10 -8
- package/dist/mdx/react/collection/{Collection.mdx → mdx/Collection.mdx} +1 -3
- package/dist/mdx/react/color-picker/color-input/ColorInput.mdx +6 -18
- package/dist/mdx/react/color-picker/color-input/examples/Alert.tsx +5 -3
- package/dist/mdx/react/color-picker/color-input/examples/Basic.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/Checked.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/Error.tsx +5 -3
- package/dist/mdx/react/color-picker/color-input/examples/Grow.tsx +9 -2
- package/dist/mdx/react/color-picker/color-input/examples/LabelPosition.tsx +5 -3
- package/dist/mdx/react/color-picker/color-input/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/Required.tsx +4 -2
- package/dist/mdx/react/color-picker/color-input/examples/ValidColorChange.tsx +9 -7
- package/dist/mdx/react/color-picker/color-preview/ColorPreview.mdx +6 -17
- package/dist/mdx/react/color-picker/color-preview/examples/Basic.tsx +9 -1
- package/dist/mdx/react/color-picker/color-preview/examples/LabelPosition.tsx +5 -3
- package/dist/mdx/react/color-picker/color-preview/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/combobox/Combobox.mdx +1 -4
- package/dist/mdx/react/combobox/examples/Autocomplete.tsx +32 -30
- package/dist/mdx/react/common/{CompoundComponentUtilities.mdx → mdx/CompoundComponentUtilities.mdx} +2 -1
- package/dist/mdx/react/common/{Responsive.mdx → mdx/Responsive.mdx} +2 -2
- package/dist/mdx/react/common/{examples → mdx/examples}/ResponsiveStyles.tsx +1 -1
- package/dist/mdx/react/dialog/Dialog.mdx +1 -4
- package/dist/mdx/react/dialog/examples/Basic.tsx +1 -1
- package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +110 -0
- package/dist/mdx/react/dialog/examples/Focus.tsx +1 -1
- package/dist/mdx/react/form-field/FormField.mdx +104 -78
- package/dist/mdx/react/form-field/examples/Alert.tsx +11 -9
- package/dist/mdx/{preview-react → react}/form-field/examples/AllFields.tsx +43 -8
- package/dist/mdx/react/form-field/examples/Basic.tsx +9 -4
- package/dist/mdx/{preview-react → react}/form-field/examples/Custom.tsx +2 -2
- package/dist/mdx/{preview-react → react}/form-field/examples/CustomId.tsx +4 -2
- package/dist/mdx/{preview-react → react}/form-field/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/form-field/examples/Error.tsx +12 -9
- package/dist/mdx/react/form-field/examples/GroupedInputs.tsx +207 -0
- package/dist/mdx/react/form-field/examples/Grow.tsx +7 -3
- package/dist/mdx/react/form-field/examples/Hint.tsx +11 -8
- package/dist/mdx/react/form-field/examples/LabelPositionHorizontalEnd.tsx +32 -0
- package/dist/mdx/react/form-field/examples/LabelPositionHorizontalStart.tsx +32 -0
- package/dist/mdx/{preview-react → react}/form-field/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/form-field/examples/Required.tsx +11 -3
- package/dist/mdx/{preview-react → react}/form-field/examples/ThemedErrors.tsx +7 -5
- package/dist/mdx/react/icon/Assets.mdx +13 -6
- package/dist/mdx/react/icon/examples/AccentIconList.tsx +1 -1
- package/dist/mdx/react/layout/Box.mdx +1 -3
- package/dist/mdx/react/layout/Flex.mdx +8 -7
- package/dist/mdx/react/layout/Grid.mdx +2 -4
- package/dist/mdx/react/loading-dots/LoadingDots.mdx +1 -3
- package/dist/mdx/react/menu/Menu.mdx +1 -4
- package/dist/mdx/react/menu/examples/MenuWithFallbackPlacements.tsx +66 -0
- package/dist/mdx/react/modal/Modal.mdx +1 -4
- package/dist/mdx/react/modal/examples/CustomFocus.tsx +1 -1
- package/dist/mdx/react/modal/examples/FormModal.tsx +1 -1
- package/dist/mdx/react/modal/examples/IframeTest.tsx +26 -0
- package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +66 -0
- package/dist/mdx/react/modal/examples/ReturnFocus.tsx +1 -1
- package/dist/mdx/react/modal/examples/StackedModals.tsx +56 -0
- package/dist/mdx/react/modal/examples/WithRadioButtons.tsx +30 -0
- package/dist/mdx/react/modal/examples/WithTooltips.tsx +74 -0
- package/dist/mdx/react/pagination/pagination.mdx +1 -5
- package/dist/mdx/react/popup/Popup.mdx +30 -6
- package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +54 -0
- package/dist/mdx/react/popup/examples/ComboboxWithinPopup.tsx +48 -0
- package/dist/mdx/react/popup/examples/MixedPopupTypes.tsx +143 -0
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +82 -0
- package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +42 -0
- package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +68 -0
- package/dist/mdx/react/popup/examples/TooltipReturnFocus.tsx +36 -0
- package/dist/mdx/react/radio/Radio.mdx +6 -16
- package/dist/mdx/react/radio/examples/Alert.tsx +1 -1
- package/dist/mdx/react/radio/examples/Basic.tsx +1 -1
- package/dist/mdx/react/radio/examples/Disabled.tsx +1 -1
- package/dist/mdx/react/radio/examples/Error.tsx +1 -1
- package/dist/mdx/react/radio/examples/LabelPosition.tsx +2 -2
- package/dist/mdx/react/radio/examples/NoValue.tsx +2 -2
- package/dist/mdx/react/radio/examples/RefForwarding.tsx +1 -1
- package/dist/mdx/react/radio/examples/Required.tsx +1 -1
- package/dist/mdx/react/segmented-control/SegmentedControl.mdx +1 -5
- package/dist/mdx/react/select/Select.mdx +18 -28
- package/dist/mdx/react/select/examples/Alert.tsx +15 -13
- package/dist/mdx/react/select/examples/Basic.tsx +18 -16
- package/dist/mdx/react/select/examples/Complex.tsx +14 -12
- package/dist/mdx/react/select/examples/Disabled.tsx +21 -19
- package/dist/mdx/react/select/examples/DisabledOption.tsx +24 -22
- package/dist/mdx/react/select/examples/Error.tsx +21 -19
- package/dist/mdx/react/select/examples/FetchingDynamicItems.tsx +23 -19
- package/dist/mdx/react/select/examples/Grow.tsx +14 -12
- package/dist/mdx/react/select/examples/HoistedModel.tsx +14 -12
- package/dist/mdx/react/select/examples/InitialSelectedItem.tsx +18 -15
- package/dist/mdx/react/select/examples/LabelPosition.tsx +15 -12
- package/dist/mdx/react/select/examples/MenuHeight.tsx +11 -9
- package/dist/mdx/react/select/examples/Placeholder.tsx +17 -14
- package/dist/mdx/react/select/examples/RefForwarding.tsx +13 -10
- package/dist/mdx/react/select/examples/Required.tsx +12 -10
- package/dist/mdx/react/select/examples/WithIcons.tsx +25 -23
- package/dist/mdx/react/skeleton/Skeleton.mdx +1 -5
- package/dist/mdx/react/skeleton/examples/Simulation.tsx +3 -3
- package/dist/mdx/react/status-indicator/StatusIndicator.mdx +5 -8
- package/dist/mdx/react/switch/Switch.mdx +6 -17
- package/dist/mdx/react/switch/examples/Alert.tsx +5 -3
- package/dist/mdx/react/switch/examples/Basic.tsx +4 -2
- package/dist/mdx/react/switch/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/switch/examples/Error.tsx +5 -3
- package/dist/mdx/react/switch/examples/LabelPosition.tsx +5 -3
- package/dist/mdx/react/switch/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/table/Table.mdx +1 -4
- package/dist/mdx/react/tabs/Tabs.mdx +1 -4
- package/dist/mdx/react/testing/Testing.mdx +1 -4
- package/dist/mdx/react/text/BodyText.mdx +1 -3
- package/dist/mdx/react/text/Heading.mdx +1 -3
- package/dist/mdx/react/text/LabelText.mdx +1 -3
- package/dist/mdx/react/text/Subtext.mdx +1 -3
- package/dist/mdx/react/text/Text.mdx +1 -3
- package/dist/mdx/react/text/Title.mdx +1 -3
- package/dist/mdx/react/text-area/TextArea.mdx +6 -17
- package/dist/mdx/react/text-area/examples/Alert.tsx +5 -3
- package/dist/mdx/react/text-area/examples/Basic.tsx +4 -2
- package/dist/mdx/react/text-area/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/text-area/examples/Error.tsx +5 -3
- package/dist/mdx/react/text-area/examples/Grow.tsx +6 -4
- package/dist/mdx/react/text-area/examples/LabelPosition.tsx +6 -3
- package/dist/mdx/react/text-area/examples/Placeholder.tsx +9 -7
- package/dist/mdx/react/text-area/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/text-area/examples/Required.tsx +4 -2
- package/dist/mdx/react/text-area/examples/ResizeConstraints.tsx +9 -7
- package/dist/mdx/react/text-input/TextInput.mdx +7 -16
- package/dist/mdx/react/text-input/examples/Alert.tsx +5 -3
- package/dist/mdx/react/text-input/examples/Basic.tsx +5 -3
- package/dist/mdx/react/text-input/examples/Disabled.tsx +4 -2
- package/dist/mdx/react/text-input/examples/Error.tsx +5 -3
- package/dist/mdx/react/text-input/examples/Grow.tsx +5 -3
- package/dist/mdx/react/text-input/examples/Icons.tsx +4 -2
- package/dist/mdx/react/text-input/examples/LabelPosition.tsx +6 -3
- package/dist/mdx/react/text-input/examples/Placeholder.tsx +9 -7
- package/dist/mdx/react/text-input/examples/RefForwarding.tsx +4 -2
- package/dist/mdx/react/text-input/examples/Required.tsx +4 -2
- package/dist/mdx/react/toast/toast.mdx +5 -6
- package/dist/mdx/react/tokens/Tokens.mdx +1 -2
- package/dist/mdx/react/tooltip/Tooltip.mdx +1 -5
- package/dist/mdx/style-props/STYLE_PROPS.mdx +25 -25
- package/dist/mdx/style-props/examples/Background.tsx +15 -22
- package/dist/mdx/style-props/examples/Border.tsx +3 -18
- package/dist/mdx/style-props/examples/Color.tsx +9 -21
- package/dist/mdx/style-props/examples/Flex.tsx +27 -9
- package/dist/mdx/style-props/examples/FlexItem.tsx +24 -8
- package/dist/mdx/style-props/examples/Position.tsx +1 -1
- package/dist/mdx/style-props/examples/Space.tsx +9 -3
- package/dist/mdx/welcome.mdx +48 -0
- package/index.ts +1 -0
- package/lib/ExampleCodeBlock.tsx +83 -0
- package/lib/MDXElements.tsx +2 -1
- package/lib/Value.tsx +5 -3
- package/package.json +9 -8
- package/dist/mdx/changelog.stories.mdx +0 -14
- package/dist/mdx/preview-react/_examples/SelectWithFormik.mdx +0 -8
- package/dist/mdx/preview-react/_examples/TextInputWithFormik.mdx +0 -8
- package/dist/mdx/preview-react/_examples/TextInputWithReactHookForm.mdx +0 -8
- package/dist/mdx/preview-react/form-field/FormField.mdx +0 -149
- package/dist/mdx/preview-react/form-field/examples/Alert.tsx +0 -24
- package/dist/mdx/preview-react/form-field/examples/Basic.tsx +0 -21
- package/dist/mdx/preview-react/form-field/examples/Error.tsx +0 -25
- package/dist/mdx/preview-react/form-field/examples/FieldSet.tsx +0 -29
- package/dist/mdx/preview-react/form-field/examples/Grow.tsx +0 -21
- package/dist/mdx/preview-react/form-field/examples/Hint.tsx +0 -25
- package/dist/mdx/preview-react/form-field/examples/LabelPositionHorizontal.tsx +0 -18
- package/dist/mdx/preview-react/form-field/examples/Required.tsx +0 -23
- package/dist/mdx/react/_examples/CookieBanner.mdx +0 -8
- package/dist/mdx/react/_examples/GlobalHeader.mdx +0 -12
- package/dist/mdx/react/_examples/PageHeader.mdx +0 -8
- package/dist/mdx/react/form-field/examples/AlertLabel.tsx +0 -23
- package/dist/mdx/react/form-field/examples/CustomInputId.tsx +0 -17
- package/dist/mdx/react/form-field/examples/ErrorLabel.tsx +0 -23
- package/dist/mdx/react/form-field/examples/GroupingInputs.tsx +0 -22
- package/dist/mdx/react/form-field/examples/LabelPosition.tsx +0 -17
- package/dist/mdx/welcome.stories.mdx +0 -35
- /package/dist/mdx/preview-react/_examples/{examples → mdx/examples}/TextInputWithFormik.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/AriaLiveRegions/IconButtonsWithLiveBadges.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/CookieBanner.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/MediaModal.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/PageHeader.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/SearchFormBasic.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/SegmentControlWithText.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/SidePanelWithOverlay.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithSelectableRows.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/Table/WithSortableColumnHeaders.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/compoundComponent/CustomCard.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/AreaColumnPositioning.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/CustomColumnPositioning.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/CustomColumnWidth.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/FullWidthWith3Columns.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/FullWidthWith3Columns2Rows.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Masonry.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/ResponsiveColumns.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Tiled2and3Columns.tsx +0 -0
- /package/dist/mdx/react/_examples/{examples → mdx/examples}/layout/Tiled4and2Columns.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/Basic.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/BasicGrid.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/BasicVirtual.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/DataLoader.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/DynamicItemsObjects.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/DynamicItemsStrings.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/IdentifiedItems.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/MultiSelection.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/RovingFocus.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/Selection.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/StringChildren.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/Virtualization.tsx +0 -0
- /package/dist/mdx/react/collection/{examples → mdx/examples}/WrappingGrid.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateComponent.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateContainer.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateElemPropsHook.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateModelHook.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/CreateSubcomponent.tsx +0 -0
- /package/dist/mdx/react/common/{examples → mdx/examples}/ResponsiveViewport.tsx +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import React, {useState, useRef} from 'react';
|
|
2
|
+
import {AriaLiveRegion} from '@workday/canvas-kit-react/common';
|
|
3
|
+
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {TextInput} from '@workday/canvas-kit-preview-react/text-input';
|
|
5
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
|
+
import {Text} from '@workday/canvas-kit-react/text';
|
|
7
|
+
import {system, base} from '@workday/canvas-tokens-web';
|
|
8
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
9
|
+
|
|
10
|
+
const liveRegionStyle = createStyles({
|
|
11
|
+
border: `${px2rem(1)} solid ${base.cantaloupe400}`,
|
|
12
|
+
backgroundColor: base.cantaloupe100,
|
|
13
|
+
padding: system.space.x4,
|
|
14
|
+
display: 'block',
|
|
15
|
+
margin: system.space.x4 + ' 0',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default () => {
|
|
19
|
+
const [message, setMessage] = useState('This is an ARIA Live Region!');
|
|
20
|
+
const inputRef = useRef();
|
|
21
|
+
function handleSendMessage() {
|
|
22
|
+
setMessage(inputRef.current.value);
|
|
23
|
+
inputRef.current.value = '';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<>
|
|
28
|
+
<AriaLiveRegion>
|
|
29
|
+
<Text cs={liveRegionStyle}>{message}</Text>
|
|
30
|
+
</AriaLiveRegion>
|
|
31
|
+
<Flex gap={`var(${system.space.x4})`} alignItems="flex-end">
|
|
32
|
+
<TextInput orientation="vertical">
|
|
33
|
+
<TextInput.Label>Type your message:</TextInput.Label>
|
|
34
|
+
<TextInput.Field ref={inputRef} />
|
|
35
|
+
</TextInput>
|
|
36
|
+
<PrimaryButton onClick={handleSendMessage}>Send Message</PrimaryButton>
|
|
37
|
+
</Flex>
|
|
38
|
+
</>
|
|
39
|
+
);
|
|
40
|
+
};
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {ActionBar} from '@workday/canvas-kit-react/action-bar';
|
|
4
|
-
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
5
2
|
import Basic from './examples/Basic';
|
|
6
3
|
import Icons from './examples/Icons';
|
|
7
4
|
import DeleteAction from './examples/DeleteAction';
|
|
8
5
|
import OverflowActionBar from './examples/OverflowActionBar';
|
|
9
6
|
import OverflowActionBarCustomButtonCount from './examples/OverflowActionBarCustomButtonCount';
|
|
10
7
|
|
|
11
|
-
|
|
12
8
|
# Canvas Kit Action Bar
|
|
13
9
|
|
|
14
10
|
Action Bar is a [compound component](/getting-started/for-developers/resources/compound-components/)
|
|
@@ -2,13 +2,15 @@ import React from 'react';
|
|
|
2
2
|
import {ActionBar} from '@workday/canvas-kit-react/action-bar';
|
|
3
3
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
4
4
|
|
|
5
|
-
export default () =>
|
|
6
|
-
|
|
7
|
-
<ActionBar
|
|
8
|
-
<ActionBar.
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
5
|
+
export default () => {
|
|
6
|
+
return (
|
|
7
|
+
<ActionBar>
|
|
8
|
+
<ActionBar.List position="relative" as="section" aria-label="Basic example actions">
|
|
9
|
+
<ActionBar.Item as={PrimaryButton} onClick={() => console.log('first action')}>
|
|
10
|
+
First Action
|
|
11
|
+
</ActionBar.Item>
|
|
12
|
+
<ActionBar.Item>Second Action</ActionBar.Item>
|
|
13
|
+
</ActionBar.List>
|
|
14
|
+
</ActionBar>
|
|
15
|
+
);
|
|
16
|
+
};
|
|
@@ -54,16 +54,19 @@ export default () => {
|
|
|
54
54
|
</ActionBar.Menu.Popper>
|
|
55
55
|
</ActionBar>
|
|
56
56
|
</Box>
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
57
|
+
<footer>
|
|
58
|
+
<h4>Change Action Bar container size</h4>
|
|
59
|
+
<SegmentedControl onSelect={data => setContainerWidth(data.id)}>
|
|
60
|
+
<SegmentedControl.List role="group" aria-label="container width control" marginBottom="m">
|
|
61
|
+
<SegmentedControl.Item data-id="100%">100%</SegmentedControl.Item>
|
|
62
|
+
<SegmentedControl.Item data-id={`${breakpoints.m}px`}>Small</SegmentedControl.Item>
|
|
63
|
+
<SegmentedControl.Item data-id="420px">420px</SegmentedControl.Item>
|
|
64
|
+
<SegmentedControl.Item data-id={`${breakpoints.s}px`}>
|
|
65
|
+
Extra Small
|
|
66
|
+
</SegmentedControl.Item>
|
|
67
|
+
</SegmentedControl.List>
|
|
68
|
+
</SegmentedControl>
|
|
69
|
+
</footer>
|
|
67
70
|
</div>
|
|
68
71
|
);
|
|
69
72
|
};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import {Specifications, SymbolDoc, SymbolDescription, ExampleCodeBlock} from '@workday/canvas-kit-docs';
|
|
2
|
+
|
|
3
|
+
import Basic from './examples/Basic';
|
|
4
|
+
import Button from './examples/Button';
|
|
5
|
+
import Image from './examples/Image';
|
|
6
|
+
import LazyLoad from './examples/LazyLoad';
|
|
7
|
+
import ObjectFit from './examples/ObjectFit';
|
|
8
|
+
import Size from './examples/Size';
|
|
9
|
+
import Variant from './examples/Variant';
|
|
10
|
+
import CustomStyles from './examples/CustomStyles';
|
|
11
|
+
|
|
12
|
+
import * as AvatarStories from './Avatar.stories'
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# Canvas Kit Avatar
|
|
16
|
+
|
|
17
|
+
Represents a person's profile.
|
|
18
|
+
|
|
19
|
+
[> Workday Design Reference](https://canvas.workdaydesign.com/components/indicators/avatar)
|
|
20
|
+
|
|
21
|
+
## Installation
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
yarn add @workday/canvas-kit-react
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
<SymbolDescription name="Avatar" fileName="/react/" />
|
|
30
|
+
|
|
31
|
+
The example below shows multiple instances of a `Avatar` with various configurations.
|
|
32
|
+
|
|
33
|
+
### Basic
|
|
34
|
+
|
|
35
|
+
By default, the Avatar renders a `button` element. If yo'd like to change the default element, use
|
|
36
|
+
the `as` prop.
|
|
37
|
+
|
|
38
|
+
<ExampleCodeBlock code={Basic} />
|
|
39
|
+
|
|
40
|
+
### Button
|
|
41
|
+
|
|
42
|
+
Like many of our components, Avatar accepts an `as` prop, which lets you change the underlying
|
|
43
|
+
semantic element to a `div`. This should be done with caution to ensure the best accessibility.
|
|
44
|
+
Generally, `<button>` elements should be used for actions.
|
|
45
|
+
|
|
46
|
+
<ExampleCodeBlock code={Button} />
|
|
47
|
+
|
|
48
|
+
### Variant
|
|
49
|
+
|
|
50
|
+
Avatar defaults to using a `"light"` `variant` property. You can change the `variant` prop to "dark"
|
|
51
|
+
by including `variant="dark"`.
|
|
52
|
+
|
|
53
|
+
<ExampleCodeBlock code={Variant} />
|
|
54
|
+
|
|
55
|
+
### Size
|
|
56
|
+
|
|
57
|
+
Avatar defaults to using a `"medium"` `size` property. You can change the `size` prop to various
|
|
58
|
+
sizing options. See Component API for more details.
|
|
59
|
+
|
|
60
|
+
Additionally, you can explicitly specify the size you want for the Avatar in pixels or rems.
|
|
61
|
+
|
|
62
|
+
<ExampleCodeBlock code={Size} />
|
|
63
|
+
|
|
64
|
+
### Image
|
|
65
|
+
|
|
66
|
+
Avatar renders an image when the `url` prop is defined.
|
|
67
|
+
|
|
68
|
+
<ExampleCodeBlock code={Image} />
|
|
69
|
+
|
|
70
|
+
### Object Fit
|
|
71
|
+
|
|
72
|
+
Avatar defaults to using `contain` for object-fit. You can change this property to any other
|
|
73
|
+
acceptable `object-fit` properties. For best fit, try to use square images.
|
|
74
|
+
|
|
75
|
+
<ExampleCodeBlock code={ObjectFit} />
|
|
76
|
+
|
|
77
|
+
### Lazy Load
|
|
78
|
+
|
|
79
|
+
Example of implementing lazy load behavior with Avatar.
|
|
80
|
+
|
|
81
|
+
<ExampleCodeBlock code={LazyLoad} />
|
|
82
|
+
|
|
83
|
+
### Custom Styling
|
|
84
|
+
|
|
85
|
+
To change the background color of the Avatar, you can use our `createStencil` functionality.
|
|
86
|
+
|
|
87
|
+
<ExampleCodeBlock code={CustomStyles} />
|
|
88
|
+
|
|
89
|
+
## Component API
|
|
90
|
+
|
|
91
|
+
<SymbolDoc name="Avatar" fileName="/react/" />
|
|
92
|
+
|
|
93
|
+
## Specifications
|
|
94
|
+
|
|
95
|
+
<Specifications file="Avatar.spec.ts" name="Avatar" />
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
|
|
6
|
+
const handleAvatarButtonClick = () => console.log('AvatarButton clicked');
|
|
7
|
+
|
|
8
|
+
const containerStyles = createStyles({
|
|
9
|
+
display: 'inline-flex',
|
|
10
|
+
gap: system.space.x2,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export default () => (
|
|
14
|
+
<div className={containerStyles}>
|
|
15
|
+
<Avatar onClick={handleAvatarButtonClick} />
|
|
16
|
+
<Avatar as="div" />
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
// @ts-ignore: Cannot find module error
|
|
6
|
+
import testAvatar from './test-avatar.png';
|
|
7
|
+
|
|
8
|
+
const handleAvatarButtonClick = () => console.log('AvatarButton clicked');
|
|
9
|
+
|
|
10
|
+
const containerStyles = createStyles({
|
|
11
|
+
display: 'inline-flex',
|
|
12
|
+
gap: system.space.x2,
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default () => (
|
|
16
|
+
<div className={containerStyles}>
|
|
17
|
+
<Avatar variant="dark" onClick={handleAvatarButtonClick} />
|
|
18
|
+
<Avatar onClick={handleAvatarButtonClick} />
|
|
19
|
+
<Avatar url={testAvatar} onClick={handleAvatarButtonClick} />
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
|
+
import {createStencil, createStyles} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {base, system} from '@workday/canvas-tokens-web';
|
|
5
|
+
import {systemIconStencil} from '../../../../icon';
|
|
6
|
+
|
|
7
|
+
const customBlueAvatarStencil = createStencil({
|
|
8
|
+
base: {
|
|
9
|
+
backgroundColor: base.berrySmoothie400,
|
|
10
|
+
['[data-part="avatar-icon"]']: {
|
|
11
|
+
[systemIconStencil.vars.color]: base.berrySmoothie100,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const customGreenAvatarStencil = createStencil({
|
|
17
|
+
base: {
|
|
18
|
+
backgroundColor: base.watermelon400,
|
|
19
|
+
['[data-part="avatar-icon"]']: {
|
|
20
|
+
[systemIconStencil.vars.color]: base.watermelon100,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
const containerStyles = createStyles({
|
|
26
|
+
display: 'inline-flex',
|
|
27
|
+
gap: system.space.x2,
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
export default () => (
|
|
31
|
+
<div className={containerStyles}>
|
|
32
|
+
<Avatar as="div" {...customBlueAvatarStencil()} />
|
|
33
|
+
<Avatar as="div" {...customGreenAvatarStencil()} />
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
|
+
// @ts-ignore: Cannot find module error
|
|
4
|
+
import testAvatar from './test-avatar.png';
|
|
5
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
6
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
7
|
+
|
|
8
|
+
const containerStyles = createStyles({
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
gap: system.space.x2,
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export default () => (
|
|
15
|
+
<div className={containerStyles}>
|
|
16
|
+
<h3>Working Images</h3>
|
|
17
|
+
<Avatar size="extraExtraLarge" as="div" url={testAvatar} />
|
|
18
|
+
<Avatar size="extraLarge" as="div" url={testAvatar} />
|
|
19
|
+
<Avatar size="large" as="div" url={testAvatar} />
|
|
20
|
+
<Avatar size="medium" as="div" url={testAvatar} />
|
|
21
|
+
<Avatar size="small" as="div" url={testAvatar} />
|
|
22
|
+
<Avatar size="extraSmall" as="div" url={testAvatar} />
|
|
23
|
+
<h3>Broken Image</h3>
|
|
24
|
+
<Avatar url="/fake/path/to/image.png" as="div" />
|
|
25
|
+
</div>
|
|
26
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
|
+
// @ts-ignore: Cannot find module error
|
|
4
|
+
import testAvatar from './test-avatar.png';
|
|
5
|
+
|
|
6
|
+
export default () => (
|
|
7
|
+
<div className="story">
|
|
8
|
+
{Array.from({length: 5}, (v, index) => (
|
|
9
|
+
<>
|
|
10
|
+
<Avatar key={index} as="div" size="medium" url={testAvatar + '?v=' + index} />
|
|
11
|
+
<br />
|
|
12
|
+
</>
|
|
13
|
+
))}
|
|
14
|
+
</div>
|
|
15
|
+
);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
|
+
import {px2rem} from '@workday/canvas-kit-styling';
|
|
4
|
+
|
|
5
|
+
export default () => (
|
|
6
|
+
<div className="story">
|
|
7
|
+
<h3>Original Rectangle Image</h3>
|
|
8
|
+
<img alt="" src="https://picsum.photos/id/237/300/200" />
|
|
9
|
+
<h3>Object fit on a Rectangle Image</h3>
|
|
10
|
+
<Avatar as="div" url="https://picsum.photos/id/237/300/200" />
|
|
11
|
+
<h3>Object fit on a Rectangle Image using Dynamic Size</h3>
|
|
12
|
+
<Avatar
|
|
13
|
+
as="div"
|
|
14
|
+
size={px2rem(200)}
|
|
15
|
+
url="https://picsum.photos/id/237/300/200"
|
|
16
|
+
objectFit="contain"
|
|
17
|
+
/>
|
|
18
|
+
<h3>Original Square Image</h3>
|
|
19
|
+
<img alt="" src="https://picsum.photos/id/237/300/300" />
|
|
20
|
+
<h3>Object fit on a Square Image</h3>
|
|
21
|
+
<Avatar as="div" url="https://picsum.photos/id/237/300/300" />
|
|
22
|
+
<h3>Object fit on a Square Image using Dynamic Size</h3>
|
|
23
|
+
<Avatar as="div" size={px2rem(200)} url="https://picsum.photos/id/237/300/300" />
|
|
24
|
+
</div>
|
|
25
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
|
+
import {px2rem} from '@workday/canvas-kit-styling';
|
|
4
|
+
|
|
5
|
+
export default () => (
|
|
6
|
+
<div className="story">
|
|
7
|
+
<h3>Extra-Extra Large</h3>
|
|
8
|
+
<Avatar as="div" size="extraExtraLarge" />
|
|
9
|
+
<h3>Extra Large</h3>
|
|
10
|
+
<Avatar as="div" size="extraLarge" />
|
|
11
|
+
<h3>Large</h3>
|
|
12
|
+
<Avatar as="div" size="large" />
|
|
13
|
+
<h3>Medium</h3>
|
|
14
|
+
<Avatar as="div" size="medium" />
|
|
15
|
+
<h3>Small</h3>
|
|
16
|
+
<Avatar as="div" size="small" />
|
|
17
|
+
<h3>Extra Small</h3>
|
|
18
|
+
<Avatar as="div" size="extraSmall" />
|
|
19
|
+
<h3>30px</h3>
|
|
20
|
+
<Avatar as="div" size={px2rem(30)} />
|
|
21
|
+
<h3>40px</h3>
|
|
22
|
+
<Avatar as="div" size={px2rem(40)} />
|
|
23
|
+
<h3>3rem</h3>
|
|
24
|
+
<Avatar as="div" size="3rem" />
|
|
25
|
+
<h3>4rem</h3>
|
|
26
|
+
<Avatar as="div" size="4rem" />
|
|
27
|
+
</div>
|
|
28
|
+
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
3
|
+
|
|
4
|
+
export default () => (
|
|
5
|
+
<div className="story">
|
|
6
|
+
<h3>Light</h3>
|
|
7
|
+
<Avatar as="div" size="medium" />
|
|
8
|
+
<h3>Dark</h3>
|
|
9
|
+
<Avatar as="div" size="medium" variant="dark" />
|
|
10
|
+
</div>
|
|
11
|
+
);
|
|
Binary file
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import {SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
|
-
|
|
3
|
-
import {CountBadge} from '@workday/canvas-kit-react/badge';
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
4
2
|
|
|
5
3
|
import Basic from './examples/Basic';
|
|
6
4
|
import CustomLimit from './examples/CustomLimit';
|
|
@@ -42,10 +40,20 @@ messages on their first day back.
|
|
|
42
40
|
|
|
43
41
|
### Notification Badge
|
|
44
42
|
|
|
45
|
-
Notifications are a major use case for `CountBadge`.
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
43
|
+
Notifications are a major use case for `CountBadge`. When the `CountBadge` value is updated in
|
|
44
|
+
real-time, screen readers must be supported with an `AriaLiveRegion` that will automatically
|
|
45
|
+
describe the change in the number of notifications. If the web app only updates `CountBadge` as part
|
|
46
|
+
of another screen update, then this use of `AriaLiveRegion` is unnecessary and not recommended.
|
|
47
|
+
|
|
48
|
+
#### Notes on accessibility for the example below
|
|
49
|
+
|
|
50
|
+
- `Tooltip` is set on the `SecondaryButton` automatically applying the `aria-label` to the button.
|
|
51
|
+
- `aria-describedby` property is conditionally set on the `SecondaryButton` when greater than zero
|
|
52
|
+
referencing a unique `id` for the `CountBadge` value .
|
|
53
|
+
- `AriaLiveRegion` is used around the `CountBadge`, enabling screen readers to monitor changes in
|
|
54
|
+
value.
|
|
55
|
+
- `aria-label` string is conditionally set on `AriaLiveRegion` when greater than zero, describing
|
|
56
|
+
"New notification"
|
|
49
57
|
|
|
50
58
|
<ExampleCodeBlock code={NotificationBadge} />
|
|
51
59
|
|
|
@@ -54,17 +62,6 @@ the Accessibility guidance below this example for aditional information.
|
|
|
54
62
|
Count Badge supports custom styling via the `cs` prop. For more information, check our
|
|
55
63
|
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--page).
|
|
56
64
|
|
|
57
|
-
## Accessibility
|
|
58
|
-
|
|
59
|
-
A common use case for `CountBadge` is displaying notifications, but there are other situations where
|
|
60
|
-
they will have live-updated values. There are several accessibility concerns you'll want to keep in
|
|
61
|
-
mind:
|
|
62
|
-
|
|
63
|
-
- The button should have an aria-label that updates with the count
|
|
64
|
-
- The elements inside the button should have `aria-hidden`
|
|
65
|
-
- The live region should be outside the button
|
|
66
|
-
- The live region should be visually hidden and only contain text
|
|
67
|
-
|
|
68
65
|
## Component API
|
|
69
66
|
|
|
70
67
|
<SymbolDoc name="CountBadge" fileName="/react/" />
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import {CountBadge} from '@workday/canvas-kit-react/badge';
|
|
3
3
|
import {SecondaryButton, TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {
|
|
4
|
+
import {AriaLiveRegion, useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
5
|
import {createStyles, cssVar} from '@workday/canvas-kit-styling';
|
|
6
6
|
import {notificationsIcon} from '@workday/canvas-system-icons-web';
|
|
7
7
|
import {base, system} from '@workday/canvas-tokens-web';
|
|
8
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
9
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
8
10
|
|
|
9
11
|
function negate(value: string, fallback?: string) {
|
|
10
12
|
return `calc(${cssVar(value, fallback)} * -1)`;
|
|
@@ -12,16 +14,13 @@ function negate(value: string, fallback?: string) {
|
|
|
12
14
|
|
|
13
15
|
const container = createStyles({
|
|
14
16
|
boxSizing: 'border-box',
|
|
15
|
-
display: 'flex',
|
|
16
17
|
flexDirection: 'column',
|
|
17
18
|
gap: system.space.x4,
|
|
18
19
|
});
|
|
19
20
|
|
|
20
21
|
const controls = createStyles({
|
|
21
22
|
boxSizing: 'border-box',
|
|
22
|
-
|
|
23
|
-
display: 'flex',
|
|
24
|
-
gap: system.space.x1,
|
|
23
|
+
gap: system.space.x2,
|
|
25
24
|
padding: system.space.x1,
|
|
26
25
|
});
|
|
27
26
|
|
|
@@ -33,40 +32,46 @@ const notificationContainerStyles = createStyles({
|
|
|
33
32
|
const countBadgeStyles = createStyles({
|
|
34
33
|
boxSizing: 'border-box',
|
|
35
34
|
position: 'absolute',
|
|
36
|
-
top: negate(system.space.
|
|
35
|
+
top: negate(system.space.x1),
|
|
37
36
|
insetInlineEnd: negate(system.space.x1),
|
|
38
37
|
});
|
|
39
38
|
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
// Testing notes (Aug. 30, 2024):
|
|
40
|
+
// Windows 11
|
|
41
|
+
// JAWS 2024 + Chrome / Edge: "New notifications" once, then only the count change "2"
|
|
42
|
+
// JAWS 2024 + FF: "New notifications" once, then describes nothing
|
|
43
|
+
// NVDA + Chrome / Edge: Consistently describes "{X} New notifications"
|
|
44
|
+
// NVDA + FF: Consistently describes count value only "{X}"
|
|
45
|
+
// macOS v14.6.1
|
|
46
|
+
// VoiceOver + Chrome / Safari: Consistently describes "New notifications {X}"
|
|
42
47
|
export function NotificationBadge() {
|
|
43
48
|
const [count, setCount] = React.useState(4);
|
|
49
|
+
const badgeID = useUniqueId();
|
|
44
50
|
|
|
45
51
|
return (
|
|
46
|
-
<
|
|
47
|
-
<
|
|
52
|
+
<Flex cs={container}>
|
|
53
|
+
<Flex cs={controls}>
|
|
48
54
|
<TertiaryButton size="small" onClick={() => setCount(count + 1)}>
|
|
49
55
|
Add Notification
|
|
50
56
|
</TertiaryButton>
|
|
51
57
|
<TertiaryButton size="small" onClick={() => setCount(0)}>
|
|
52
58
|
Clear
|
|
53
59
|
</TertiaryButton>
|
|
54
|
-
</
|
|
55
|
-
<
|
|
60
|
+
</Flex>
|
|
61
|
+
<Flex>
|
|
56
62
|
<span className={notificationContainerStyles}>
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
</div>
|
|
63
|
+
<Tooltip title="Notifications">
|
|
64
|
+
<SecondaryButton
|
|
65
|
+
size="medium"
|
|
66
|
+
icon={notificationsIcon}
|
|
67
|
+
aria-describedby={!!count ? badgeID : undefined}
|
|
68
|
+
/>
|
|
69
|
+
</Tooltip>
|
|
70
|
+
<AriaLiveRegion aria-label={!!count ? 'New notifications' : undefined}>
|
|
71
|
+
{!!count && <CountBadge id={badgeID} count={count} limit={100} cs={countBadgeStyles} />}
|
|
72
|
+
</AriaLiveRegion>
|
|
68
73
|
</span>
|
|
69
|
-
</
|
|
70
|
-
</
|
|
74
|
+
</Flex>
|
|
75
|
+
</Flex>
|
|
71
76
|
);
|
|
72
77
|
}
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
|
-
|
|
3
|
-
import {Banner} from '@workday/canvas-kit-react/banner';
|
|
4
|
-
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
5
2
|
import ActionText from './examples/ActionText';
|
|
6
3
|
import Basic from './examples/Basic';
|
|
7
4
|
import Error from './examples/Error';
|
|
@@ -51,7 +48,8 @@ banner. This will change the defualt icon to `exclamationCircleIcon`.
|
|
|
51
48
|
|
|
52
49
|
### Icon Banner
|
|
53
50
|
|
|
54
|
-
When only using an icon in the `Banner`, use our `Tooltip` component to both show a visible text
|
|
51
|
+
When only using an icon in the `Banner`, use our `Tooltip` component to both show a visible text
|
|
52
|
+
alternative, and assign an `aria-label` string to the child `Banner`.
|
|
55
53
|
|
|
56
54
|
<ExampleCodeBlock code={IconBanner} />
|
|
57
55
|
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
2
|
-
|
|
3
|
-
import {Breadcrumbs} from '@workday/canvas-kit-react/breadcrumbs';
|
|
4
|
-
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
5
2
|
import Basic from './examples/Basic';
|
|
6
3
|
import OverflowBreadcrumbs from './examples/Overflow';
|
|
7
4
|
import RTLOverflowList from './examples/RTL';
|
|
8
5
|
import CurrentItemTruncation from './examples/CurrentItemTruncation';
|
|
9
6
|
import LinkTruncation from './examples/LinkTruncation';
|
|
10
7
|
|
|
11
|
-
|
|
12
8
|
# Canvas Kit Breadcrumbs
|
|
13
9
|
|
|
14
10
|
Breadcrumbs is a
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
ExampleCodeBlock,
|
|
3
|
+
Specifications,
|
|
4
|
+
SymbolDoc,
|
|
5
|
+
SymbolDescription,
|
|
6
|
+
} from '@workday/canvas-kit-docs';
|
|
2
7
|
|
|
3
8
|
import Primary from './examples/Primary';
|
|
4
9
|
import PrimaryInverse from './examples/PrimaryInverse';
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import {Hyperlink, ExternalHyperlink} from '@workday/canvas-kit-react/button';
|
|
4
|
-
|
|
1
|
+
import {ExampleCodeBlock, Specifications, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
5
2
|
import Link from './examples/Hyperlink';
|
|
6
3
|
import LinkInverse from './examples/HyperlinkInverse';
|
|
7
4
|
import ExternalLink from './examples/ExternalHyperlink';
|