@workday/canvas-kit-docs 13.0.0-alpha.998-next.0 → 13.0.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/lib/ExampleCodeBlock.d.ts +1 -2
- package/dist/es6/lib/ExampleCodeBlock.d.ts.map +1 -1
- package/dist/es6/lib/ExampleCodeBlock.js +53 -28
- package/dist/es6/lib/MDXElements.d.ts +1 -2
- package/dist/es6/lib/MDXElements.d.ts.map +1 -1
- package/dist/es6/lib/MDXElements.js +6 -6
- 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 +11 -12
- package/dist/es6/lib/Specifications.d.ts +1 -2
- package/dist/es6/lib/Specifications.d.ts.map +1 -1
- package/dist/es6/lib/Specifications.js +3 -20
- package/dist/es6/lib/StylePropsTable.d.ts +1 -2
- package/dist/es6/lib/StylePropsTable.d.ts.map +1 -1
- package/dist/es6/lib/StylePropsTable.js +6 -16
- package/dist/es6/lib/Table.d.ts.map +1 -1
- package/dist/es6/lib/Table.js +7 -7
- 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 +16 -51
- package/dist/es6/lib/docs.js +270155 -169429
- package/dist/es6/lib/stackblitzFiles/.eslintrc.cjs.txt +15 -0
- package/dist/es6/lib/stackblitzFiles/App.d.ts +2 -0
- package/dist/es6/lib/stackblitzFiles/App.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/App.js +17 -0
- package/dist/es6/lib/stackblitzFiles/App.tsx +33 -0
- package/dist/es6/lib/stackblitzFiles/Demo.d.ts +2 -0
- package/dist/es6/lib/stackblitzFiles/Demo.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/Demo.js +2 -0
- package/dist/es6/lib/stackblitzFiles/Demo.tsx +1 -0
- package/dist/es6/lib/stackblitzFiles/index.html +13 -0
- package/dist/es6/lib/stackblitzFiles/main.d.ts +4 -0
- package/dist/es6/lib/stackblitzFiles/main.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/main.js +25 -0
- package/dist/es6/lib/stackblitzFiles/main.tsx +27 -0
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.d.ts +2 -0
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +42 -0
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +42 -0
- package/dist/es6/lib/stackblitzFiles/tsconfig.json +26 -0
- package/dist/es6/lib/stackblitzFiles/tsconfig.node.json +12 -0
- package/dist/es6/lib/stackblitzFiles/vite-env.d.ts +1 -0
- package/dist/es6/lib/stackblitzFiles/vite.config.d.ts +4 -0
- package/dist/es6/lib/stackblitzFiles/vite.config.d.ts.map +1 -0
- package/dist/es6/lib/stackblitzFiles/vite.config.js +7 -0
- package/dist/es6/lib/stackblitzFiles/vite.config.ts +10 -0
- 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 +25 -54
- package/dist/es6/lib/widgets/array.js +2 -4
- package/dist/es6/lib/widgets/callExpression.js +2 -14
- package/dist/es6/lib/widgets/canvasColor.js +2 -2
- package/dist/es6/lib/widgets/component.js +2 -4
- package/dist/es6/lib/widgets/conditional.js +2 -12
- package/dist/es6/lib/widgets/enhancedComponent.js +15 -67
- package/dist/es6/lib/widgets/external.js +2 -4
- package/dist/es6/lib/widgets/function.js +7 -26
- package/dist/es6/lib/widgets/intersection.js +2 -3
- package/dist/es6/lib/widgets/model.js +3 -19
- package/dist/es6/lib/widgets/object.js +2 -2
- package/dist/es6/lib/widgets/parenthesis.js +2 -5
- package/dist/es6/lib/widgets/primitives.js +9 -27
- package/dist/es6/lib/widgets/qualifiedName.js +2 -5
- package/dist/es6/lib/widgets/symbol.js +2 -2
- package/dist/es6/lib/widgets/tuple.js +2 -5
- package/dist/es6/lib/widgets/typeParameter.js +2 -13
- package/dist/es6/lib/widgets/union.js +4 -10
- package/dist/es6/mdx/installBlock.d.ts +1 -2
- package/dist/es6/mdx/installBlock.d.ts.map +1 -1
- package/dist/es6/mdx/installBlock.js +2 -6
- package/dist/es6/mdx/style-props/examples/Background.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Background.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Background.js +2 -5
- package/dist/es6/mdx/style-props/examples/Border.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Border.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Border.js +2 -5
- package/dist/es6/mdx/style-props/examples/Color.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Color.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Color.js +2 -5
- package/dist/es6/mdx/style-props/examples/Depth.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Depth.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Depth.js +2 -5
- package/dist/es6/mdx/style-props/examples/Flex.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Flex.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Flex.js +2 -14
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/FlexItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/FlexItem.js +2 -13
- package/dist/es6/mdx/style-props/examples/Grid.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Grid.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Grid.js +2 -6
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/GridItem.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/GridItem.js +2 -6
- package/dist/es6/mdx/style-props/examples/Layout.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Layout.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Layout.js +2 -5
- package/dist/es6/mdx/style-props/examples/Other.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Other.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Other.js +2 -5
- package/dist/es6/mdx/style-props/examples/Position.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Position.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Position.js +2 -5
- package/dist/es6/mdx/style-props/examples/Space.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Space.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Space.js +2 -8
- package/dist/es6/mdx/style-props/examples/Text.d.ts +1 -2
- package/dist/es6/mdx/style-props/examples/Text.d.ts.map +1 -1
- package/dist/es6/mdx/style-props/examples/Text.js +2 -5
- package/dist/es6/mdx/versionsTable.d.ts +1 -2
- package/dist/es6/mdx/versionsTable.d.ts.map +1 -1
- package/dist/es6/mdx/versionsTable.js +23 -49
- package/dist/es6/mdx/welcomePage.d.ts +1 -2
- package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.js +37 -49
- package/dist/mdx/12.0-UPGRADE-GUIDE.mdx +1 -1
- package/dist/mdx/13.0-UPGRADE-GUIDE.mdx +454 -0
- package/dist/mdx/CODEMODS.mdx +58 -0
- package/dist/mdx/CONTRIBUTING.mdx +8 -0
- package/dist/mdx/TESTING.mdx +34 -0
- package/dist/mdx/preview-react/_examples/mdx/{Forms.mdx → FormLibraryExample.mdx} +0 -2
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Basic.tsx +1 -1
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Body.tsx +1 -1
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Caution.tsx +1 -2
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Critical.tsx +5 -12
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/CustomIconCritical.tsx +1 -1
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/Heading.tsx +1 -1
- package/dist/mdx/preview-react/information-highlight/examples/Informational.tsx +55 -0
- package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/RTL.tsx +1 -1
- package/dist/mdx/preview-react/loading-sparkles/examples/Basic.tsx +2 -2
- package/dist/mdx/preview-react/multi-select/examples/Basic.tsx +1 -1
- package/dist/mdx/preview-react/multi-select/examples/Complex.tsx +1 -1
- package/dist/mdx/preview-react/multi-select/examples/Controlled.tsx +1 -1
- package/dist/mdx/preview-react/multi-select/examples/Icons.tsx +1 -1
- package/dist/mdx/preview-react/multi-select/examples/Searching.tsx +1 -1
- package/dist/mdx/preview-react/pill/Pill.mdx +18 -9
- package/dist/mdx/preview-react/pill/examples/Basic.tsx +14 -8
- package/dist/mdx/preview-react/pill/examples/CustomStyles.tsx +45 -0
- package/dist/mdx/preview-react/pill/examples/WithAvatar.tsx +16 -10
- package/dist/mdx/preview-react/pill/examples/WithCount.tsx +12 -6
- package/dist/mdx/preview-react/pill/examples/WithList.tsx +15 -5
- package/dist/mdx/preview-react/pill/examples/WithReadOnly.tsx +8 -5
- package/dist/mdx/preview-react/pill/examples/WithRemovable.tsx +23 -11
- package/dist/mdx/preview-react/segmented-control/examples/Disabled.tsx +0 -1
- package/dist/mdx/preview-react/segmented-control/examples/RTL.tsx +0 -1
- package/dist/mdx/preview-react/segmented-control/examples/Vertical.tsx +0 -1
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithCustomOptionsLeft.tsx +1 -1
- package/dist/mdx/preview-react/select/examples/Left Label/DefaultWithSimpleOptionsLeft.tsx +1 -1
- package/dist/mdx/preview-react/select/examples/Top Label/Alert.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Default.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithCustomOptions.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/DefaultWithSimpleOptions.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Disabled.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Error.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Grow.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/Top Label/Scrollable.tsx +0 -2
- package/dist/mdx/preview-react/select/examples/storiesData.tsx +0 -1
- package/dist/mdx/preview-react/side-panel/SidePanel.mdx +28 -3
- package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +36 -17
- package/dist/mdx/preview-react/side-panel/examples/Basic.tsx +40 -34
- package/dist/mdx/preview-react/side-panel/examples/ExternalControl.tsx +47 -23
- package/dist/mdx/preview-react/side-panel/examples/HiddenName.tsx +24 -5
- package/dist/mdx/preview-react/side-panel/examples/OnExpandedChange.tsx +22 -6
- package/dist/mdx/preview-react/side-panel/examples/OnStateTransition.tsx +24 -9
- package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +39 -40
- package/dist/mdx/preview-react/side-panel/examples/Variant.tsx +36 -36
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +1 -4
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +1 -4
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +1 -4
- package/dist/mdx/react/_examples/Tooltips.mdx +15 -0
- package/dist/mdx/react/_examples/examples/Tooltips/ListOfUploadedFiles.tsx +38 -0
- package/dist/mdx/react/_examples/mdx/SidePanel.mdx +18 -1
- package/dist/mdx/react/_examples/mdx/examples/GlobalHeader.tsx +1 -1
- package/dist/mdx/react/_examples/mdx/examples/SidePanelWithNavigation.tsx +154 -116
- package/dist/mdx/react/_examples/mdx/examples/SidePanelWithOverlay.tsx +33 -15
- package/dist/mdx/react/_examples/mdx/examples/Table/WithSelectableRows.tsx +1 -1
- package/dist/mdx/react/action-bar/examples/Basic.tsx +0 -1
- package/dist/mdx/react/action-bar/examples/DeleteAction.tsx +0 -2
- package/dist/mdx/react/action-bar/examples/Icons.tsx +0 -2
- package/dist/mdx/react/avatar/avatar/examples/Basic.tsx +2 -3
- package/dist/mdx/react/avatar/avatar/examples/Button.tsx +3 -4
- package/dist/mdx/react/avatar/avatar/examples/CustomStyles.tsx +2 -3
- package/dist/mdx/react/avatar/avatar/examples/Image.tsx +7 -8
- package/dist/mdx/react/avatar/avatar/examples/LazyLoad.tsx +7 -2
- package/dist/mdx/react/avatar/avatar/examples/ObjectFit.tsx +9 -4
- package/dist/mdx/react/avatar/avatar/examples/Size.tsx +10 -11
- package/dist/mdx/react/avatar/avatar/examples/Variant.tsx +2 -3
- package/dist/mdx/react/banner/examples/Error.tsx +0 -2
- package/dist/mdx/react/banner/examples/Sticky.tsx +0 -1
- package/dist/mdx/react/banner/examples/StickyAnimation.tsx +42 -26
- package/dist/mdx/react/breadcrumbs/examples/Basic.tsx +0 -1
- package/dist/mdx/react/button/button/Button.mdx +5 -1
- package/dist/mdx/react/button/button/examples/CustomStyles.tsx +1 -3
- package/dist/mdx/react/button/button/examples/Delete.tsx +0 -2
- package/dist/mdx/react/button/button/examples/ExternalHyperlink.tsx +3 -3
- package/dist/mdx/react/button/button/examples/ExternalHyperlinkInverse.tsx +5 -1
- package/dist/mdx/react/button/button/examples/Hyperlink.tsx +0 -2
- package/dist/mdx/react/button/button/examples/Primary.tsx +0 -2
- package/dist/mdx/react/button/button/examples/ThemeOverrides.tsx +14 -17
- package/dist/mdx/react/collection/mdx/examples/MultiSelection.tsx +2 -1
- package/dist/mdx/react/collection/mdx/examples/Selection.tsx +2 -1
- package/dist/mdx/react/color-picker/color-preview/examples/Basic.tsx +0 -1
- package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +0 -1
- package/dist/mdx/{labs-react → react}/expandable/Expandable.mdx +2 -2
- package/dist/mdx/{labs-react → react}/expandable/examples/Avatar.tsx +5 -7
- package/dist/mdx/{labs-react → react}/expandable/examples/Depth.tsx +1 -4
- package/dist/mdx/{labs-react → react}/expandable/examples/EndIcon.tsx +1 -3
- package/dist/mdx/{labs-react → react}/expandable/examples/HoistedModel.tsx +1 -1
- package/dist/mdx/{labs-react → react}/expandable/examples/LongTitle.tsx +2 -4
- package/dist/mdx/{labs-react → react}/expandable/examples/RTL.tsx +1 -3
- package/dist/mdx/{labs-react → react}/expandable/examples/StartIcon.tsx +1 -3
- package/dist/mdx/react/menu/Menu.mdx +34 -0
- package/dist/mdx/react/menu/examples/Grouping.tsx +32 -0
- package/dist/mdx/react/menu/examples/Icons.tsx +1 -1
- package/dist/mdx/react/menu/examples/Nested.tsx +49 -0
- package/dist/mdx/react/menu/examples/NestedDynamic.tsx +105 -0
- package/dist/mdx/react/modal/examples/Basic.tsx +0 -2
- package/dist/mdx/react/modal/examples/IframeTest.tsx +0 -1
- package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +0 -1
- package/dist/mdx/react/modal/examples/StackedModals.tsx +0 -1
- package/dist/mdx/react/pagination/examples/CustomRange.tsx +0 -1
- package/dist/mdx/react/pagination/examples/GoToForm.tsx +0 -1
- package/dist/mdx/react/pagination/examples/JumpControls.tsx +0 -1
- package/dist/mdx/react/popup/examples/Basic.tsx +0 -2
- package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +0 -1
- package/dist/mdx/react/popup/examples/ComboboxWithinPopup.tsx +0 -1
- package/dist/mdx/react/popup/examples/MultiplePopups.tsx +0 -2
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +0 -1
- package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +0 -1
- package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +8 -6
- package/dist/mdx/react/popup/examples/TooltipReturnFocus.tsx +0 -1
- package/dist/mdx/react/select/examples/Basic.tsx +1 -0
- package/dist/mdx/react/select/examples/MenuHeight.tsx +0 -1
- package/dist/mdx/react/table/Table.mdx +14 -1
- package/dist/mdx/react/table/examples/BaseHtmlTable.tsx +46 -0
- package/dist/mdx/react/tabs/examples/Basic.tsx +0 -1
- package/dist/mdx/react/tabs/examples/DisabledTab.tsx +0 -1
- package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +3 -2
- package/dist/mdx/react/tabs/examples/NamedTabs.tsx +0 -1
- package/dist/mdx/react/tabs/examples/RightToLeft.tsx +0 -1
- package/dist/mdx/react/text-input/examples/Basic.tsx +0 -3
- package/dist/mdx/react/toast/examples/Basic.tsx +0 -2
- package/dist/mdx/react/toast/examples/ToastAlert.tsx +0 -2
- package/dist/mdx/react/toast/examples/ToastDialog.tsx +0 -2
- package/dist/mdx/react/tokens/Tokens.mdx +1 -1
- package/dist/mdx/react/tooltip/Tooltip.mdx +31 -1
- package/dist/mdx/react/tooltip/examples/Default.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/DescribeType.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/DescriptionType.tsx +20 -0
- package/dist/mdx/react/tooltip/examples/Muted.tsx +0 -2
- package/dist/mdx/react/tooltip/examples/Placements.tsx +14 -11
- package/dist/mdx/style-props/examples/Background.tsx +2 -3
- package/dist/mdx/style-props/examples/Border.tsx +2 -3
- package/dist/mdx/style-props/examples/Color.tsx +2 -3
- package/dist/mdx/style-props/examples/Depth.tsx +2 -3
- package/dist/mdx/style-props/examples/Flex.tsx +0 -1
- package/dist/mdx/style-props/examples/FlexItem.tsx +0 -1
- package/dist/mdx/style-props/examples/Grid.tsx +0 -1
- package/dist/mdx/style-props/examples/GridItem.tsx +0 -1
- package/dist/mdx/style-props/examples/Layout.tsx +0 -1
- package/dist/mdx/style-props/examples/Other.tsx +0 -1
- package/dist/mdx/style-props/examples/Position.tsx +2 -3
- package/dist/mdx/style-props/examples/Space.tsx +2 -3
- package/dist/mdx/style-props/examples/Text.tsx +0 -1
- package/lib/ExampleCodeBlock.tsx +57 -19
- package/lib/MDXElements.tsx +3 -3
- package/lib/StylePropsTable.tsx +1 -2
- package/lib/Table.tsx +0 -1
- package/lib/stackblitzFiles/.eslintrc.cjs.txt +15 -0
- package/lib/stackblitzFiles/App.tsx +33 -0
- package/lib/stackblitzFiles/Demo.tsx +1 -0
- package/lib/stackblitzFiles/index.html +13 -0
- package/lib/stackblitzFiles/main.tsx +27 -0
- package/lib/stackblitzFiles/packageJSONFile.ts +42 -0
- package/lib/stackblitzFiles/tsconfig.json +26 -0
- package/lib/stackblitzFiles/tsconfig.node.json +12 -0
- package/lib/stackblitzFiles/types/custom-imports.d.ts +13 -0
- package/lib/stackblitzFiles/vite-env.d.ts +1 -0
- package/lib/stackblitzFiles/vite.config.ts +10 -0
- package/lib/widgets/array.tsx +0 -2
- package/lib/widgets/canvasColor.tsx +0 -2
- package/lib/widgets/component.tsx +0 -2
- package/lib/widgets/conditional.tsx +0 -2
- package/lib/widgets/enhancedComponent.tsx +1 -1
- package/lib/widgets/external.tsx +3 -2
- package/lib/widgets/model.tsx +0 -2
- package/lib/widgets/parenthesis.tsx +0 -2
- package/lib/widgets/primitives.tsx +1 -5
- package/lib/widgets/qualifiedName.tsx +0 -2
- package/lib/widgets/symbol.tsx +0 -2
- package/lib/widgets/tuple.tsx +0 -2
- package/lib/widgets/typeParameter.tsx +0 -2
- package/package.json +8 -7
- package/dist/mdx/preview-react/InformationHighlight/examples/Informational.tsx +0 -27
- /package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/InformationHighlight.mdx +0 -0
- /package/dist/mdx/{labs-react → react}/expandable/examples/test-avatar.png +0 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
2
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/information-highlight';
|
|
3
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
4
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
5
|
+
|
|
6
|
+
const contentTextStyles = createStyles({
|
|
7
|
+
margin: 0,
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
const contentListStyles = createStyles({
|
|
11
|
+
listStyle: 'inside',
|
|
12
|
+
marginInlineStart: 0,
|
|
13
|
+
marginBlockStart: system.space.x2,
|
|
14
|
+
marginBlockEnd: 0,
|
|
15
|
+
padding: 0,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default () => {
|
|
19
|
+
return (
|
|
20
|
+
<Flex flexDirection={'column'} gap={system.space.x2}>
|
|
21
|
+
<InformationHighlight variant={'informational'}>
|
|
22
|
+
<InformationHighlight.Icon />
|
|
23
|
+
<InformationHighlight.Heading> Informational Highlight </InformationHighlight.Heading>
|
|
24
|
+
<InformationHighlight.Body>
|
|
25
|
+
<p className={contentTextStyles}>
|
|
26
|
+
This is a low-emphasis, informational callout. You should use this for nice-to-have
|
|
27
|
+
information, such as:
|
|
28
|
+
</p>
|
|
29
|
+
<ul className={contentListStyles}>
|
|
30
|
+
<li>tangential information or context</li>
|
|
31
|
+
<li>related features</li>
|
|
32
|
+
<li>additional opportunities</li>
|
|
33
|
+
</ul>
|
|
34
|
+
</InformationHighlight.Body>
|
|
35
|
+
<InformationHighlight.Link href="#hyperlink">Learn More</InformationHighlight.Link>
|
|
36
|
+
</InformationHighlight>
|
|
37
|
+
<InformationHighlight variant={'informational'} emphasis={'high'}>
|
|
38
|
+
<InformationHighlight.Icon />
|
|
39
|
+
<InformationHighlight.Heading> Informational Highlight </InformationHighlight.Heading>
|
|
40
|
+
<InformationHighlight.Body>
|
|
41
|
+
<p className={contentTextStyles}>
|
|
42
|
+
This is a high-emphasis, informational callout. You should use this for nice-to-have
|
|
43
|
+
information, such as:
|
|
44
|
+
</p>
|
|
45
|
+
<ul className={contentListStyles}>
|
|
46
|
+
<li>tangential information or context</li>
|
|
47
|
+
<li>related features</li>
|
|
48
|
+
<li>additional opportunities</li>
|
|
49
|
+
</ul>
|
|
50
|
+
</InformationHighlight.Body>
|
|
51
|
+
<InformationHighlight.Link href="#hyperlink">Learn More</InformationHighlight.Link>
|
|
52
|
+
</InformationHighlight>
|
|
53
|
+
</Flex>
|
|
54
|
+
);
|
|
55
|
+
};
|
package/dist/mdx/preview-react/{InformationHighlight → information-highlight}/examples/RTL.tsx
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
3
|
-
import {InformationHighlight} from '@workday/canvas-kit-preview-react/
|
|
3
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/information-highlight';
|
|
4
4
|
import {CanvasProvider, ContentDirection} from '@workday/canvas-kit-react/common';
|
|
5
5
|
import {system} from '@workday/canvas-tokens-web';
|
|
6
6
|
export default () => {
|
|
@@ -35,7 +35,7 @@ export default () => {
|
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
return (
|
|
38
|
-
|
|
38
|
+
<div>
|
|
39
39
|
<div className={containerStyles}>
|
|
40
40
|
{quote && <Text cs={{maxWidth: '60ch'}}>{quote}</Text>}
|
|
41
41
|
<AriaLiveRegion>
|
|
@@ -46,7 +46,7 @@ export default () => {
|
|
|
46
46
|
</AriaLiveRegion>
|
|
47
47
|
</div>
|
|
48
48
|
<SecondaryButton onClick={handleClick}>Generate Quote</SecondaryButton>
|
|
49
|
-
|
|
49
|
+
</div>
|
|
50
50
|
);
|
|
51
51
|
};
|
|
52
52
|
|
|
@@ -9,7 +9,7 @@ export default () => {
|
|
|
9
9
|
return (
|
|
10
10
|
<>
|
|
11
11
|
<MultiSelect items={items} initialSelectedIds={['Olives', 'Onions', 'Pepperoni']}>
|
|
12
|
-
<FormField orientation="
|
|
12
|
+
<FormField orientation="horizontalStart">
|
|
13
13
|
<FormField.Label>Toppings</FormField.Label>
|
|
14
14
|
<FormField.Input
|
|
15
15
|
as={MultiSelect.Input}
|
|
@@ -34,7 +34,7 @@ export default () => {
|
|
|
34
34
|
>
|
|
35
35
|
<main className={mainContentStyles}>
|
|
36
36
|
<MultiSelect items={items} getId={i => i.id} getTextValue={i => i.text}>
|
|
37
|
-
<FormField orientation="
|
|
37
|
+
<FormField orientation="horizontalStart">
|
|
38
38
|
<FormField.Label>Toppings</FormField.Label>
|
|
39
39
|
<FormField.Input
|
|
40
40
|
as={MultiSelect.Input}
|
|
@@ -41,7 +41,7 @@ export default () => {
|
|
|
41
41
|
>
|
|
42
42
|
<Flex gap="s" flexDirection="column">
|
|
43
43
|
<MultiSelect items={items}>
|
|
44
|
-
<FormField orientation="
|
|
44
|
+
<FormField orientation="horizontalStart">
|
|
45
45
|
<FormField.Label>Toppings</FormField.Label>
|
|
46
46
|
<FormField.Input
|
|
47
47
|
as={MultiSelect.Input}
|
|
@@ -21,7 +21,7 @@ const items = [
|
|
|
21
21
|
export default () => {
|
|
22
22
|
return (
|
|
23
23
|
<MultiSelect items={items}>
|
|
24
|
-
<FormField orientation="
|
|
24
|
+
<FormField orientation="horizontalStart">
|
|
25
25
|
<FormField.Label>Controls</FormField.Label>
|
|
26
26
|
<FormField.Input
|
|
27
27
|
as={MultiSelect.Input}
|
|
@@ -83,7 +83,7 @@ export default () => {
|
|
|
83
83
|
>
|
|
84
84
|
<main className={mainContentStyles}>
|
|
85
85
|
<MultiSelect model={model}>
|
|
86
|
-
<FormField orientation="
|
|
86
|
+
<FormField orientation="horizontalStart">
|
|
87
87
|
<FormField.Label>Fruits</FormField.Label>
|
|
88
88
|
<FormField.Input
|
|
89
89
|
as={MultiSelect.SearchInput}
|
|
@@ -6,6 +6,7 @@ import Basic from './examples/Basic';
|
|
|
6
6
|
import WithCount from './examples/WithCount';
|
|
7
7
|
import WithRemovable from './examples/WithRemovable';
|
|
8
8
|
import WithList from './examples/WithList';
|
|
9
|
+
import CustomStyles from './examples/CustomStyles';
|
|
9
10
|
|
|
10
11
|
|
|
11
12
|
# Canvas Kit Pill
|
|
@@ -27,7 +28,7 @@ information to help with scanning and organization.
|
|
|
27
28
|
|
|
28
29
|
### Basic Pills
|
|
29
30
|
|
|
30
|
-
By default a Pill is considered interactive, therefore it's default variant is `default`.All leading
|
|
31
|
+
By default a Pill is considered interactive, therefore it's default variant is `default`. All leading
|
|
31
32
|
elements (icons or avatars) are intended to be descriptive, helping support the label. Do not rely
|
|
32
33
|
on the leading element to indicate the interaction behavior.
|
|
33
34
|
|
|
@@ -35,7 +36,11 @@ on the leading element to indicate the interaction behavior.
|
|
|
35
36
|
|
|
36
37
|
You can render an icon inside the `Pill` with `Pill.Icon`. It will render a `plusIcon` by default,
|
|
37
38
|
but it can be customized by providing an icon to the `icon` prop. Because it uses `SystemIcon` under
|
|
38
|
-
the hood, you also have to all `SystemIconProps`.
|
|
39
|
+
the hood, you also have access to all `SystemIconProps`.
|
|
40
|
+
|
|
41
|
+
#### Accessibility
|
|
42
|
+
|
|
43
|
+
You must provide an `aria-label` to the `Pill.Icon` for proper accessibility.
|
|
39
44
|
|
|
40
45
|
<ExampleCodeBlock code={Basic} />
|
|
41
46
|
|
|
@@ -49,19 +54,15 @@ You can render an avatar image inside the `Pill` with `Pill.Avatar`. It should a
|
|
|
49
54
|
#### Count
|
|
50
55
|
|
|
51
56
|
The count appears after the label. It is usually associated with the label. If you have a category,
|
|
52
|
-
the count will
|
|
57
|
+
the count will directly correlate to that category.
|
|
53
58
|
|
|
54
59
|
<ExampleCodeBlock code={WithCount} />
|
|
55
60
|
|
|
56
61
|
### Read Only
|
|
57
62
|
|
|
58
|
-
|
|
59
|
-
non-interactive element that is used to display information.
|
|
63
|
+
The `readOnly` variant is a non-interactive element that is used to display information.
|
|
60
64
|
|
|
61
|
-
|
|
62
|
-
> entire `Pill`. By default, this `maxWidth` is set to `200px` and the text will be truncated with
|
|
63
|
-
> an ellipsis and render an OverflowTooltip on hover and focus. This max width can be changed by
|
|
64
|
-
> providing a `maxWidth` prop on the Pill.
|
|
65
|
+
You can define a read only `Pill` by providing a `variant='readOnly'` prop.
|
|
65
66
|
|
|
66
67
|
<ExampleCodeBlock code={WithReadOnly} />
|
|
67
68
|
|
|
@@ -97,6 +98,14 @@ accordingly.
|
|
|
97
98
|
|
|
98
99
|
<ExampleCodeBlock code={WithList} />
|
|
99
100
|
|
|
101
|
+
### Custom Styles
|
|
102
|
+
|
|
103
|
+
`Pill` supports custom styling via the `cs` prop. For more information, check our
|
|
104
|
+
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-how-to-customize-styles--docs)
|
|
105
|
+
or view the example below.
|
|
106
|
+
|
|
107
|
+
<ExampleCodeBlock code={CustomStyles} />
|
|
108
|
+
|
|
100
109
|
## Component API
|
|
101
110
|
|
|
102
111
|
<SymbolDoc name="Pill" fileName="/preview-react/" />
|
|
@@ -2,24 +2,30 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
import {Pill} from '@workday/canvas-kit-preview-react/pill';
|
|
4
4
|
|
|
5
|
-
import {Box, Flex} from '@workday/canvas-kit-react/layout';
|
|
6
5
|
import {BodyText} from '@workday/canvas-kit-react/text';
|
|
6
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
8
|
+
|
|
9
|
+
const flexStyles = createStyles({
|
|
10
|
+
display: 'flex',
|
|
11
|
+
gap: system.space.x2,
|
|
12
|
+
});
|
|
7
13
|
|
|
8
14
|
export default () => {
|
|
9
15
|
const [text, setText] = React.useState('');
|
|
10
16
|
return (
|
|
11
|
-
<
|
|
12
|
-
<
|
|
17
|
+
<div>
|
|
18
|
+
<div className={flexStyles}>
|
|
13
19
|
<Pill onClick={() => setText('The first pill is clicked!')}>
|
|
14
|
-
<Pill.Icon />
|
|
20
|
+
<Pill.Icon aria-label="Add user" />
|
|
15
21
|
<Pill.Label>Regina Skeltor</Pill.Label>
|
|
16
22
|
</Pill>
|
|
17
|
-
<Pill
|
|
18
|
-
<Pill.Icon />
|
|
23
|
+
<Pill disabled>
|
|
24
|
+
<Pill.Icon aria-label="Add user" />
|
|
19
25
|
<Pill.Label>Regina Skeltor</Pill.Label>
|
|
20
26
|
</Pill>
|
|
21
|
-
</
|
|
27
|
+
</div>
|
|
22
28
|
<BodyText size="medium">{text}</BodyText>
|
|
23
|
-
</
|
|
29
|
+
</div>
|
|
24
30
|
);
|
|
25
31
|
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import {Pill, pillCountStencil, pillStencil} from '@workday/canvas-kit-preview-react/pill';
|
|
2
|
+
|
|
3
|
+
import {createStencil} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {base} from '@workday/canvas-tokens-web';
|
|
5
|
+
import {systemIconStencil} from '@workday/canvas-kit-react/icon';
|
|
6
|
+
|
|
7
|
+
const customPillStencil = createStencil({
|
|
8
|
+
base: {
|
|
9
|
+
[pillStencil.vars.background]: base.berrySmoothie300,
|
|
10
|
+
[pillStencil.vars.border]: base.berrySmoothie500,
|
|
11
|
+
[pillStencil.vars.label]: base.frenchVanilla100,
|
|
12
|
+
[systemIconStencil.vars.color]: base.frenchVanilla100,
|
|
13
|
+
[pillCountStencil.vars.backgroundColor]: base.berrySmoothie400,
|
|
14
|
+
|
|
15
|
+
'&:hover, &.hover': {
|
|
16
|
+
[pillStencil.vars.background]: base.berrySmoothie400,
|
|
17
|
+
[pillStencil.vars.label]: base.frenchVanilla100,
|
|
18
|
+
[pillCountStencil.vars.backgroundColor]: base.berrySmoothie500,
|
|
19
|
+
[systemIconStencil.vars.color]: base.frenchVanilla100,
|
|
20
|
+
},
|
|
21
|
+
'&:active, &.active': {
|
|
22
|
+
[pillStencil.vars.background]: base.berrySmoothie400,
|
|
23
|
+
[pillStencil.vars.label]: base.frenchVanilla100,
|
|
24
|
+
[systemIconStencil.vars.color]: base.frenchVanilla100,
|
|
25
|
+
[pillCountStencil.vars.backgroundColor]: base.berrySmoothie500,
|
|
26
|
+
},
|
|
27
|
+
'&:disabled, &.disabled': {
|
|
28
|
+
[pillStencil.vars.background]: base.berrySmoothie400,
|
|
29
|
+
[pillStencil.vars.label]: base.frenchVanilla100,
|
|
30
|
+
[systemIconStencil.vars.color]: base.frenchVanilla100,
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export default () => {
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<Pill cs={customPillStencil()}>
|
|
39
|
+
<Pill.Icon aria-label="Add user" />
|
|
40
|
+
<Pill.Label>Custom Pill Color</Pill.Label>
|
|
41
|
+
<Pill.Count>10</Pill.Count>
|
|
42
|
+
</Pill>
|
|
43
|
+
</div>
|
|
44
|
+
);
|
|
45
|
+
};
|
|
@@ -3,24 +3,30 @@ import React from 'react';
|
|
|
3
3
|
import {Pill} from '@workday/canvas-kit-preview-react/pill';
|
|
4
4
|
// @ts-ignore: Cannot find module error
|
|
5
5
|
import testAvatar from './test-avatar.png';
|
|
6
|
-
import {Flex, Box} from '@workday/canvas-kit-react/layout';
|
|
7
6
|
import {BodyText} from '@workday/canvas-kit-react/text';
|
|
7
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
8
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
9
|
+
|
|
10
|
+
const flexStyles = createStyles({
|
|
11
|
+
display: 'flex',
|
|
12
|
+
gap: system.space.x2,
|
|
13
|
+
});
|
|
8
14
|
|
|
9
15
|
export default () => {
|
|
10
16
|
const [text, setText] = React.useState('');
|
|
11
17
|
return (
|
|
12
|
-
<
|
|
13
|
-
<
|
|
18
|
+
<div>
|
|
19
|
+
<div className={flexStyles}>
|
|
14
20
|
<Pill onClick={() => setText('The first pill is clicked!')}>
|
|
15
|
-
<Pill.Avatar url={testAvatar} />
|
|
16
|
-
Regina Skeltor
|
|
21
|
+
<Pill.Avatar altText="Avatar" url={testAvatar} />
|
|
22
|
+
<Pill.Label>Regina Skeltor</Pill.Label>
|
|
17
23
|
</Pill>
|
|
18
|
-
<Pill
|
|
19
|
-
<Pill.Avatar
|
|
20
|
-
Regina Skeltor
|
|
24
|
+
<Pill disabled>
|
|
25
|
+
<Pill.Avatar altText="Avatar" />
|
|
26
|
+
<Pill.Label>Regina Skeltor</Pill.Label>
|
|
21
27
|
</Pill>
|
|
22
|
-
</
|
|
28
|
+
</div>
|
|
23
29
|
<BodyText size="medium">{text}</BodyText>
|
|
24
|
-
</
|
|
30
|
+
</div>
|
|
25
31
|
);
|
|
26
32
|
};
|
|
@@ -1,23 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {Pill} from '@workday/canvas-kit-preview-react/pill';
|
|
3
|
-
import {Flex, Box} from '@workday/canvas-kit-react/layout';
|
|
4
3
|
import {BodyText} from '@workday/canvas-kit-react/text';
|
|
4
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
5
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
|
+
|
|
7
|
+
const flexStyles = createStyles({
|
|
8
|
+
display: 'flex',
|
|
9
|
+
gap: system.space.x2,
|
|
10
|
+
});
|
|
5
11
|
|
|
6
12
|
export default () => {
|
|
7
13
|
const [text, setText] = React.useState('');
|
|
8
14
|
return (
|
|
9
|
-
<
|
|
10
|
-
<
|
|
15
|
+
<div>
|
|
16
|
+
<div className={flexStyles}>
|
|
11
17
|
<Pill onClick={() => setText('The first pill is clicked!')}>
|
|
12
18
|
Shoes
|
|
13
19
|
<Pill.Count>30</Pill.Count>
|
|
14
20
|
</Pill>
|
|
15
|
-
<Pill
|
|
21
|
+
<Pill disabled>
|
|
16
22
|
Shoes
|
|
17
23
|
<Pill.Count>30</Pill.Count>
|
|
18
24
|
</Pill>
|
|
19
|
-
</
|
|
25
|
+
</div>
|
|
20
26
|
<BodyText size="medium">{text}</BodyText>
|
|
21
|
-
</
|
|
27
|
+
</div>
|
|
22
28
|
);
|
|
23
29
|
};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
|
|
3
3
|
import {Pill} from '@workday/canvas-kit-preview-react/pill';
|
|
4
|
-
import {
|
|
4
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
5
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
6
|
|
|
6
7
|
const data = [
|
|
7
8
|
'Shoes',
|
|
@@ -17,19 +18,28 @@ const data = [
|
|
|
17
18
|
'Jewelry',
|
|
18
19
|
];
|
|
19
20
|
|
|
21
|
+
const flexWrapStyles = createStyles({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexWrap: 'wrap',
|
|
24
|
+
gap: system.space.x2,
|
|
25
|
+
});
|
|
26
|
+
|
|
20
27
|
export default () => {
|
|
21
28
|
const [items, setItems] = React.useState(data);
|
|
22
29
|
|
|
23
30
|
return (
|
|
24
|
-
<
|
|
31
|
+
<div className={flexWrapStyles}>
|
|
25
32
|
{items.map((cat, index) => {
|
|
26
33
|
return (
|
|
27
|
-
<Pill key={index} variant="removable"
|
|
34
|
+
<Pill key={index} variant="removable">
|
|
28
35
|
<Pill.Label>{cat}</Pill.Label>
|
|
29
|
-
<Pill.IconButton
|
|
36
|
+
<Pill.IconButton
|
|
37
|
+
aria-label="Remove"
|
|
38
|
+
onClick={() => setItems(items.filter(i => i !== cat))}
|
|
39
|
+
/>
|
|
30
40
|
</Pill>
|
|
31
41
|
);
|
|
32
42
|
})}
|
|
33
|
-
</
|
|
43
|
+
</div>
|
|
34
44
|
);
|
|
35
45
|
};
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
|
|
3
1
|
import {Pill} from '@workday/canvas-kit-preview-react/pill';
|
|
2
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
3
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
const flexStyles = createStyles({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
gap: system.space.x2,
|
|
8
|
+
});
|
|
6
9
|
|
|
7
10
|
export default () => (
|
|
8
|
-
<
|
|
11
|
+
<div className={flexStyles} id="read-only-list">
|
|
9
12
|
<Pill variant="readOnly">Read-only</Pill>
|
|
10
13
|
<Pill variant="readOnly" maxWidth={250}>
|
|
11
14
|
Read-only but with super long text in case you want to read a paragraph in a Pill which we
|
|
12
15
|
don't recommend
|
|
13
16
|
</Pill>
|
|
14
|
-
</
|
|
17
|
+
</div>
|
|
15
18
|
);
|
|
@@ -3,29 +3,41 @@ import React from 'react';
|
|
|
3
3
|
import {Pill} from '@workday/canvas-kit-preview-react/pill';
|
|
4
4
|
// @ts-ignore: Cannot find module error
|
|
5
5
|
import testAvatar from './test-avatar.png';
|
|
6
|
-
import {Box, Flex} from '@workday/canvas-kit-react/layout';
|
|
7
6
|
import {BodyText} from '@workday/canvas-kit-react/text';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
8
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
9
|
+
|
|
10
|
+
const flexStyles = createStyles({
|
|
11
|
+
display: 'flex',
|
|
12
|
+
gap: system.space.x2,
|
|
13
|
+
});
|
|
8
14
|
|
|
9
15
|
export default () => {
|
|
10
16
|
const [text, setText] = React.useState('');
|
|
11
17
|
return (
|
|
12
|
-
<
|
|
13
|
-
<
|
|
18
|
+
<div>
|
|
19
|
+
<div className={flexStyles}>
|
|
14
20
|
<Pill variant="removable">
|
|
15
|
-
Pink Shirts
|
|
16
|
-
<Pill.IconButton
|
|
21
|
+
<Pill.Label>Pink Shirts</Pill.Label>
|
|
22
|
+
<Pill.IconButton
|
|
23
|
+
aria-label="Remove"
|
|
24
|
+
onClick={() => setText('The first pill is clicked!')}
|
|
25
|
+
/>
|
|
17
26
|
</Pill>
|
|
18
27
|
<Pill variant="removable">
|
|
19
|
-
<Pill.Avatar url={testAvatar} />
|
|
20
|
-
Carolyn Grimaldi
|
|
21
|
-
<Pill.IconButton
|
|
28
|
+
<Pill.Avatar altText="Avatar" url={testAvatar} />
|
|
29
|
+
<Pill.Label>Carolyn Grimaldi</Pill.Label>
|
|
30
|
+
<Pill.IconButton
|
|
31
|
+
aria-label="Remove"
|
|
32
|
+
onClick={() => setText('The second pill is clicked!')}
|
|
33
|
+
/>
|
|
22
34
|
</Pill>
|
|
23
35
|
<Pill variant="removable" disabled>
|
|
24
36
|
<Pill.Label>This is a category that should not exist because it is too long</Pill.Label>
|
|
25
|
-
<Pill.IconButton />
|
|
37
|
+
<Pill.IconButton aria-label="Remove" />
|
|
26
38
|
</Pill>
|
|
27
|
-
</
|
|
39
|
+
</div>
|
|
28
40
|
<BodyText size="medium">{text}</BodyText>
|
|
29
|
-
</
|
|
41
|
+
</div>
|
|
30
42
|
);
|
|
31
43
|
};
|
|
@@ -7,7 +7,7 @@ import {controlComponent} from '../../../../../../utils/storybook';
|
|
|
7
7
|
|
|
8
8
|
export default () => {
|
|
9
9
|
return (
|
|
10
|
-
<FormField orientation="
|
|
10
|
+
<FormField orientation="horizontalStart" id="select-default-custom">
|
|
11
11
|
<FormField.Label>Label</FormField.Label>
|
|
12
12
|
<FormField.Field>
|
|
13
13
|
{controlComponent(
|
|
@@ -7,7 +7,7 @@ import {controlComponent} from '../../../../../../utils/storybook';
|
|
|
7
7
|
|
|
8
8
|
export default () => {
|
|
9
9
|
return (
|
|
10
|
-
<FormField orientation="
|
|
10
|
+
<FormField orientation="horizontalStart" id="select-default-simple">
|
|
11
11
|
<FormField.Label>Label</FormField.Label>
|
|
12
12
|
<FormField.Field>
|
|
13
13
|
{controlComponent(<FormField.Input as={Select} name="state" options={simpleOptions} />)}
|
|
@@ -41,9 +41,12 @@ logic or styling for bidirecitonal support.
|
|
|
41
41
|
|
|
42
42
|
### Hidden Name
|
|
43
43
|
|
|
44
|
-
`SidePanel`
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
`SidePanel` must always have an accessible label for both the HTML `<section>` container and the
|
|
45
|
+
`ToggleButton`. The `labelProps` component must always be present in the DOM in order for the
|
|
46
|
+
`panelProps` and `controlProps` component labels to be assigned properly. A `hidden` attribute can
|
|
47
|
+
be applied to the `labelProps` component. In the example below, we are demonstrating the
|
|
48
|
+
`AccessibleHide` component that relies on CSS properties to visually hide text for screen readers
|
|
49
|
+
only.
|
|
47
50
|
|
|
48
51
|
<ExampleCodeBlock code={HiddenName} />
|
|
49
52
|
|
|
@@ -60,6 +63,28 @@ used (this case is covered in the Examples section).
|
|
|
60
63
|
Sometimes you'll want to control `SidePanel`'s' expand / collapse behavior from outside the
|
|
61
64
|
component. In that case, you can use the `controlProps` supplied by the `useSidePanel` hook.
|
|
62
65
|
|
|
66
|
+
#### Notes about accessibility
|
|
67
|
+
|
|
68
|
+
The `controlProps` object delivers ARIA attributes to a component under the following assumptions:
|
|
69
|
+
|
|
70
|
+
1. The control is an icon button that does not already have an accessible name
|
|
71
|
+
2. The control appears at (or near) the top of the expandable content in the `SidePanel`
|
|
72
|
+
|
|
73
|
+
Spreading the `controlProps` onto an external control can introduce serious accessibility issues:
|
|
74
|
+
|
|
75
|
+
- `aria-labelledby` HTML `id` reference may become invalid when the SidePanel is collapsed, or when
|
|
76
|
+
the `labelProps` component isn't present in the DOM.
|
|
77
|
+
- `aria-labelledby` will change the name of `controlProps` component to the title of the
|
|
78
|
+
`SidePanel`. (This may be undesirable. For example, the "Show Side Panel" button will be
|
|
79
|
+
overwritten with the "Tasks Panel" heading.)
|
|
80
|
+
- `aria-expanded` won't make sense to screen reader users when the expanded `SidePanel` content
|
|
81
|
+
isn't logically following the control.
|
|
82
|
+
- `aria-controls` is unsupported by screen readers and will not allow users to navigate to the
|
|
83
|
+
controlled content.
|
|
84
|
+
|
|
85
|
+
In the following example, the `controlProps` click handler function is passed down to the
|
|
86
|
+
`SecondaryButton` and a toggle state was added to the button using the `aria-pressed` property.
|
|
87
|
+
|
|
63
88
|
<ExampleCodeBlock code={ExternalControl} />
|
|
64
89
|
|
|
65
90
|
### Right Origin
|