@workday/canvas-kit-docs 15.0.3 → 15.0.5
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.js +1 -1
- package/dist/es6/lib/Table.js +2 -2
- package/dist/es6/lib/docs.js +34 -11
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/es6/lib/widgetUtils.js +1 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.js +2 -2
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.d.ts.map +1 -1
- package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.js +7 -2
- package/dist/es6/mdx/accessibility/examples/GlobalHeader.js +1 -1
- package/dist/es6/mdx/accessibility/examples/Popups/InlinePopupNoPortal.js +2 -2
- package/dist/es6/mdx/accessibility/examples/SidePanelWithNavigation.js +3 -3
- package/dist/es6/mdx/welcomePage.js +2 -2
- package/dist/mdx/accessibility/InlinePortals.mdx +3 -2
- package/dist/mdx/accessibility/PageStructure.mdx +0 -1
- package/dist/mdx/accessibility/Popups.mdx +1 -0
- package/dist/mdx/accessibility/WindowsHighContrastThemes.mdx +2 -2
- package/dist/mdx/preview-react/_examples/mdx/examples/TextInputWithReactHookForm.tsx +2 -2
- package/dist/mdx/preview-react/multi-select/examples/Controlled.tsx +56 -57
- package/dist/mdx/preview-react/radio/examples/Basic.tsx +1 -1
- package/dist/mdx/preview-react/radio/examples/Custom.tsx +1 -1
- package/dist/mdx/preview-react/radio/examples/StandaloneRadio.tsx +6 -4
- package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +1 -1
- package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +1 -1
- package/dist/mdx/react/_examples/mdx/ContextualHelp.mdx +28 -18
- package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusRedirect.tsx +8 -2
- package/dist/mdx/react/_examples/mdx/examples/ContextualHelp/ContextualHelpDialogFocusTrap.tsx +10 -2
- package/dist/mdx/react/_examples/mdx/examples/CookieBanner.tsx +75 -58
- package/dist/mdx/react/_examples/mdx/examples/ListOfUploadedFiles.tsx +10 -10
- package/dist/mdx/react/_examples/mdx/examples/MediaModal.tsx +31 -19
- package/dist/mdx/react/_examples/mdx/examples/SelectWithFormik.tsx +5 -4
- package/dist/mdx/react/_examples/mdx/examples/layout/AreaColumnPositioning.tsx +32 -13
- package/dist/mdx/react/_examples/mdx/examples/layout/CustomColumnPositioning.tsx +37 -25
- package/dist/mdx/react/_examples/mdx/examples/layout/CustomColumnWidth.tsx +29 -13
- package/dist/mdx/react/_examples/mdx/examples/layout/FullWidthWith3Columns.tsx +6 -7
- package/dist/mdx/react/_examples/mdx/examples/layout/FullWidthWith3Columns2Rows.tsx +43 -14
- package/dist/mdx/react/_examples/mdx/examples/layout/Masonry.tsx +33 -32
- package/dist/mdx/react/_examples/mdx/examples/layout/ResponsiveColumns.tsx +16 -7
- package/dist/mdx/react/_examples/mdx/examples/layout/Tiled2and3Columns.tsx +60 -25
- package/dist/mdx/react/_examples/mdx/examples/layout/Tiled4and2Columns.tsx +60 -23
- package/dist/mdx/react/action-bar/examples/OverflowActionBar.tsx +4 -2
- package/dist/mdx/react/avatar/Avatar.mdx +5 -7
- package/dist/mdx/react/badge/examples/CustomLimit.tsx +1 -1
- package/dist/mdx/react/banner/examples/RefForwarding.tsx +2 -1
- package/dist/mdx/react/banner/examples/Sticky.tsx +6 -5
- package/dist/mdx/react/banner/examples/StickyRTL.tsx +7 -7
- package/dist/mdx/react/breadcrumbs/examples/Overflow.tsx +5 -2
- package/dist/mdx/react/button/button/examples/Grow.tsx +10 -3
- package/dist/mdx/react/checkbox/examples/Indeterminate.tsx +1 -1
- package/dist/mdx/react/collection/mdx/examples/BasicGrid.tsx +25 -12
- package/dist/mdx/react/collection/mdx/examples/DataLoader.tsx +8 -6
- package/dist/mdx/react/collection/mdx/examples/MultiSelection.tsx +18 -6
- package/dist/mdx/react/collection/mdx/examples/OverflowVerticalList.tsx +14 -11
- package/dist/mdx/react/collection/mdx/examples/Selection.tsx +5 -1
- package/dist/mdx/react/collection/mdx/examples/WrappingGrid.tsx +25 -12
- package/dist/mdx/react/combobox/examples/Autocomplete.tsx +3 -4
- package/dist/mdx/react/common/mdx/Responsive.mdx +7 -0
- package/dist/mdx/react/common/mdx/examples/ResponsiveStyles.tsx +1 -0
- package/dist/mdx/react/common/mdx/examples/ResponsiveViewport.tsx +5 -5
- package/dist/mdx/react/dialog/examples/Basic.tsx +8 -2
- package/dist/mdx/react/dialog/examples/DialogWithFallbackPlacements.tsx +32 -8
- package/dist/mdx/react/dialog/examples/Focus.tsx +13 -3
- package/dist/mdx/react/form-field/examples/ThemedErrors.tsx +1 -1
- package/dist/mdx/react/layout/Box.mdx +7 -1
- package/dist/mdx/react/layout/Flex.mdx +6 -0
- package/dist/mdx/react/layout/Grid.mdx +6 -0
- package/dist/mdx/react/layout/examples/Flex/Basic.tsx +28 -39
- package/dist/mdx/react/layout/examples/Grid/GridCard.tsx +1 -1
- package/dist/mdx/react/layout/examples/Grid/GridLayout.tsx +46 -36
- package/dist/mdx/react/layout/examples/Grid/GridLayoutInteractive.tsx +34 -35
- package/dist/mdx/react/menu/examples/Basic.tsx +2 -1
- package/dist/mdx/react/menu/examples/ContextMenu.tsx +2 -1
- package/dist/mdx/react/menu/examples/Grouping.tsx +2 -1
- package/dist/mdx/react/menu/examples/Icons.tsx +2 -1
- package/dist/mdx/react/menu/examples/MenuWithFallbackPlacements.tsx +14 -7
- package/dist/mdx/react/menu/examples/Nested.tsx +2 -1
- package/dist/mdx/react/menu/examples/NestedDynamic.tsx +1 -1
- package/dist/mdx/react/menu/examples/SelectableMenu.tsx +2 -1
- package/dist/mdx/react/modal/examples/Basic.tsx +1 -1
- package/dist/mdx/react/modal/examples/BodyOverflow.tsx +4 -5
- package/dist/mdx/react/modal/examples/CustomFocus.tsx +4 -3
- package/dist/mdx/react/modal/examples/FullOverflow.tsx +5 -6
- package/dist/mdx/react/modal/examples/IframeTest.tsx +2 -1
- package/dist/mdx/react/modal/examples/ModalWithPopup.tsx +3 -2
- package/dist/mdx/react/modal/examples/ModalWithPopupRTL.tsx +3 -2
- package/dist/mdx/react/modal/examples/NoTargetRTL.tsx +1 -1
- package/dist/mdx/react/modal/examples/StackedModals.tsx +3 -2
- package/dist/mdx/react/modal/examples/WithRadioButtons.tsx +1 -0
- package/dist/mdx/react/modal/examples/WithTooltips.tsx +3 -2
- package/dist/mdx/react/modal/examples/WithoutCloseIcon.tsx +1 -1
- package/dist/mdx/react/popup/examples/CloseOnTargetHiddenTest.tsx +31 -17
- package/dist/mdx/react/popup/examples/FullScreen.tsx +6 -6
- package/dist/mdx/react/popup/examples/InlinePopup.tsx +2 -2
- package/dist/mdx/react/popup/examples/MixedPopupTypes.tsx +8 -6
- package/dist/mdx/react/popup/examples/NestedPopups.tsx +5 -6
- package/dist/mdx/react/popup/examples/PopupWithFallbackPlacements.tsx +6 -6
- package/dist/mdx/react/popup/examples/PopupWithNonHidablePopup.tsx +2 -1
- package/dist/mdx/react/popup/examples/ReturnFocusTest.tsx +20 -8
- package/dist/mdx/react/radio/examples/Inverse.tsx +2 -1
- package/dist/mdx/react/segmented-control/examples/Basic.tsx +2 -1
- package/dist/mdx/react/segmented-control/examples/Sizes.tsx +2 -3
- package/dist/mdx/react/select/examples/Controlled.tsx +2 -1
- package/dist/mdx/react/skeleton/examples/Basic.tsx +1 -1
- package/dist/mdx/react/skeleton/examples/Color.tsx +1 -1
- package/dist/mdx/react/skeleton/examples/Simulation.tsx +3 -3
- package/dist/mdx/react/table/examples/BasicWithHeading.tsx +1 -1
- package/dist/mdx/react/table/examples/FixedColumn.tsx +2 -2
- package/dist/mdx/react/tabs/examples/AlternativeTabStop.tsx +1 -1
- package/dist/mdx/react/tabs/examples/Basic.tsx +1 -1
- package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
- package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +6 -2
- package/dist/mdx/react/tabs/examples/HoistedModel.tsx +1 -1
- package/dist/mdx/react/tabs/examples/Icons.tsx +1 -1
- package/dist/mdx/react/tabs/examples/NamedTabs.tsx +1 -1
- package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +7 -3
- package/dist/mdx/react/tabs/examples/RightToLeft.tsx +1 -1
- package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
- package/dist/mdx/react/text/examples/LabelText/Disabled.tsx +1 -1
- package/dist/mdx/react/tokens/examples/Overview.tsx +9 -11
- package/dist/mdx/react/tokens/examples/Tokens.tsx +3 -2
- package/dist/mdx/react/tooltip/examples/DescriptionType.tsx +2 -1
- package/dist/mdx/react/tooltip/examples/Ellipsis.tsx +2 -2
- package/dist/mdx/styling/mdx/MergingStyles.mdx +1 -0
- package/dist/mdx/styling/mdx/examples/EmotionButton.tsx +1 -0
- package/dist/mdx/styling/mdx/examples/StylingOverrides.tsx +5 -5
- package/dist/mdx/tokens/TokenMigrationFinal.mdx +1 -1
- package/lib/ExampleCodeBlock.tsx +1 -1
- package/lib/Table.tsx +2 -2
- package/lib/widgetUtils.tsx +1 -1
- package/package.json +8 -8
|
@@ -121,7 +121,7 @@ export const ExampleCodeBlock = ({ code }) => {
|
|
|
121
121
|
openFile: 'src/Demo.tsx',
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
|
-
return (_jsxs("div", { ...cardStencil({ opened: isCodeDisplayed }), children: [_jsx(Card, { "data-part": "example-block", className: "sb-unstyled", children: _jsx(Card.Body, { "data-part": "example-block-container", children: _jsxs(CanvasProvider, { className: defaultBranding, children: [React.createElement(code), code && (_jsxs("div", { "data-part": "code-toggle-stackblitz-btn-container", children: [_jsx(TertiaryButton, { size: "extraSmall", onClick: () => openProjectInStackblitz(), children: "\u26A1\uFE0F Edit in Stackblitz" }), _jsx(TertiaryButton, { size: "extraSmall", onClick: () => setCodeDisplayed(!isCodeDisplayed), children: !isCodeDisplayed ? 'Show Code' : 'Hide Code' })] }))] }) }) }), _jsx(Card, { "data-part": "code-block", padding: 0, children: _jsx(Card.Body, { cs: { position: 'relative' }, children: _jsxs(CanvasProvider, { className: defaultBranding, children: [code && (_jsx("div", { ref: textInput, children: _jsx(SyntaxHighlighter, { className: "sb-unstyled", language: "jsx", style: vscDarkPlus, customStyle: {
|
|
124
|
+
return (_jsxs("div", { ...cardStencil({ opened: isCodeDisplayed }), children: [_jsx(Card, { "data-part": "example-block", className: "sb-unstyled", children: _jsx(Card.Body, { "data-part": "example-block-container", children: _jsxs(CanvasProvider, { className: defaultBranding, children: [React.createElement(code), code && (_jsxs("div", { "data-part": "code-toggle-stackblitz-btn-container", children: [_jsx(TertiaryButton, { size: "extraSmall", onClick: () => openProjectInStackblitz(), children: "\u26A1\uFE0F Edit in Stackblitz" }), _jsx(TertiaryButton, { size: "extraSmall", onClick: () => setCodeDisplayed(!isCodeDisplayed), children: !isCodeDisplayed ? 'Show Code' : 'Hide Code' })] }))] }) }) }), _jsx(Card, { "data-part": "code-block", cs: { padding: 0 }, children: _jsx(Card.Body, { cs: { position: 'relative' }, children: _jsxs(CanvasProvider, { className: defaultBranding, children: [code && (_jsx("div", { ref: textInput, children: _jsx(SyntaxHighlighter, { className: "sb-unstyled", language: "jsx", style: vscDarkPlus, customStyle: {
|
|
125
125
|
fontSize: cssVar(system.fontSize.subtext.lg),
|
|
126
126
|
lineHeight: cssVar(system.lineHeight.subtext.lg),
|
|
127
127
|
margin: '0',
|
package/dist/es6/lib/Table.js
CHANGED
|
@@ -16,7 +16,7 @@ const TableBody = createComponent('tbody')({
|
|
|
16
16
|
});
|
|
17
17
|
const tableRowStencil = createStencil({
|
|
18
18
|
base: {
|
|
19
|
-
|
|
19
|
+
borderBlockEnd: `${px2rem(1)} solid ${system.color.border.strong}`,
|
|
20
20
|
},
|
|
21
21
|
});
|
|
22
22
|
const TableRow = createComponent('tr')({
|
|
@@ -53,7 +53,7 @@ const TableData = createComponent('td')({
|
|
|
53
53
|
const tableCaptionStencil = createStencil({
|
|
54
54
|
base: {
|
|
55
55
|
borderCollapse: 'collapse',
|
|
56
|
-
|
|
56
|
+
marginBlockEnd: system.gap.md,
|
|
57
57
|
width: '100%',
|
|
58
58
|
},
|
|
59
59
|
});
|
package/dist/es6/lib/docs.js
CHANGED
|
@@ -118188,7 +118188,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
118188
118188
|
{
|
|
118189
118189
|
"name": "ExternalHyperlink",
|
|
118190
118190
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/button/lib/ExternalHyperlink.tsx",
|
|
118191
|
-
"description": "`ExternalHyperlink`s also have an `inverse` variant. Use this variant when you need to place the\nlink on a dark or colorful background such as `
|
|
118191
|
+
"description": "`ExternalHyperlink`s also have an `inverse` variant. Use this variant when you need to place the\nlink on a dark or colorful background such as `system.color.accent.info`.",
|
|
118192
118192
|
"declarations": [
|
|
118193
118193
|
{
|
|
118194
118194
|
"name": "ExternalHyperlink",
|
|
@@ -196715,20 +196715,19 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
196715
196715
|
}
|
|
196716
196716
|
},
|
|
196717
196717
|
{
|
|
196718
|
-
"name": "
|
|
196718
|
+
"name": "EllipsisTextProps",
|
|
196719
196719
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/EllipsisText.tsx",
|
|
196720
196720
|
"description": "",
|
|
196721
196721
|
"declarations": [
|
|
196722
196722
|
{
|
|
196723
|
-
"name": "
|
|
196723
|
+
"name": "EllipsisTextProps",
|
|
196724
196724
|
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/EllipsisText.tsx"
|
|
196725
196725
|
}
|
|
196726
196726
|
],
|
|
196727
196727
|
"tags": {},
|
|
196728
196728
|
"type": {
|
|
196729
|
-
"kind": "
|
|
196730
|
-
"name": "
|
|
196731
|
-
"value": "CSSObject"
|
|
196729
|
+
"kind": "alias",
|
|
196730
|
+
"name": "EllipsisText"
|
|
196732
196731
|
}
|
|
196733
196732
|
},
|
|
196734
196733
|
{
|
|
@@ -196750,14 +196749,38 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
196750
196749
|
{
|
|
196751
196750
|
"kind": "property",
|
|
196752
196751
|
"name": "children",
|
|
196753
|
-
"
|
|
196754
|
-
"tags": {},
|
|
196755
|
-
"declarations": [],
|
|
196752
|
+
"required": true,
|
|
196756
196753
|
"type": {
|
|
196757
196754
|
"kind": "external",
|
|
196758
|
-
"name": "
|
|
196755
|
+
"name": "ReactNode",
|
|
196759
196756
|
"url": "https://reactjs.org/docs/rendering-elements.html"
|
|
196760
|
-
}
|
|
196757
|
+
},
|
|
196758
|
+
"description": "",
|
|
196759
|
+
"declarations": [
|
|
196760
|
+
{
|
|
196761
|
+
"name": "children",
|
|
196762
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/EllipsisText.tsx"
|
|
196763
|
+
}
|
|
196764
|
+
],
|
|
196765
|
+
"tags": {}
|
|
196766
|
+
},
|
|
196767
|
+
{
|
|
196768
|
+
"kind": "property",
|
|
196769
|
+
"name": "cs",
|
|
196770
|
+
"required": false,
|
|
196771
|
+
"type": {
|
|
196772
|
+
"kind": "symbol",
|
|
196773
|
+
"name": "CSToPropsInput",
|
|
196774
|
+
"value": "CSToPropsInput"
|
|
196775
|
+
},
|
|
196776
|
+
"description": "The `cs` prop takes in a single value or an array of values. You can pass the CSS class name\nreturned by {@link createStyles }, or the result of {@link createVars } and\n{@link createModifiers }. If you're extending a component already using `cs`, you can merge that\nprop in as well. Any style that is passed to the `cs` prop will override style props. If you\nwish to have styles that are overridden by the `css` prop, or styles added via the `styled`\nAPI, use {@link handleCsProp } wherever `elemProps` is used. If your component needs to also\nhandle style props, use {@link mergeStyles} instead.\n\n\n```tsx\nimport {handleCsProp} from '@workday/canvas-kit-styling';\nimport {mergeStyles} from '@workday/canvas-kit-react/layout';\n\n// ...\n\n// `handleCsProp` handles compat mode with Emotion's runtime APIs. `mergeStyles` has the same\n// function signature, but adds support for style props.\n\nreturn (\n <Element\n {...handleCsProp(elemProps, [\n myStyles,\n myModifiers({ size: 'medium' }),\n myVars({ backgroundColor: 'red' })\n ])}\n >\n {children}\n </Element>\n)\n```",
|
|
196777
|
+
"declarations": [
|
|
196778
|
+
{
|
|
196779
|
+
"name": "cs",
|
|
196780
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/styling/dist/es6/lib/cs.d.ts"
|
|
196781
|
+
}
|
|
196782
|
+
],
|
|
196783
|
+
"tags": {}
|
|
196761
196784
|
},
|
|
196762
196785
|
{
|
|
196763
196786
|
"kind": "property",
|
|
@@ -18,11 +18,11 @@ export const packageJSONFile = `{
|
|
|
18
18
|
"@emotion/react": "11.11.4",
|
|
19
19
|
"@types/react": "18.2.60",
|
|
20
20
|
"@types/react-dom": "18.2.19",
|
|
21
|
-
"@workday/canvas-kit-labs-react": "15.0.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "15.0.
|
|
23
|
-
"@workday/canvas-kit-react": "15.0.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^15.0.
|
|
25
|
-
"@workday/canvas-kit-styling": "15.0.
|
|
21
|
+
"@workday/canvas-kit-labs-react": "15.0.5",
|
|
22
|
+
"@workday/canvas-kit-preview-react": "15.0.5",
|
|
23
|
+
"@workday/canvas-kit-react": "15.0.5",
|
|
24
|
+
"@workday/canvas-kit-react-fonts": "^15.0.5",
|
|
25
|
+
"@workday/canvas-kit-styling": "15.0.5",
|
|
26
26
|
"@workday/canvas-system-icons-web": "4.0.2",
|
|
27
27
|
"@workday/canvas-expressive-icons-web": "1.0.1",
|
|
28
28
|
"@workday/canvas-tokens-web": "4.2.0"
|
|
@@ -19,11 +19,11 @@ export const packageJSONFile = `{
|
|
|
19
19
|
"@emotion/react": "11.11.4",
|
|
20
20
|
"@types/react": "18.2.60",
|
|
21
21
|
"@types/react-dom": "18.2.19",
|
|
22
|
-
"@workday/canvas-kit-labs-react": "15.0.
|
|
23
|
-
"@workday/canvas-kit-preview-react": "15.0.
|
|
24
|
-
"@workday/canvas-kit-react": "15.0.
|
|
25
|
-
"@workday/canvas-kit-react-fonts": "^15.0.
|
|
26
|
-
"@workday/canvas-kit-styling": "15.0.
|
|
22
|
+
"@workday/canvas-kit-labs-react": "15.0.5",
|
|
23
|
+
"@workday/canvas-kit-preview-react": "15.0.5",
|
|
24
|
+
"@workday/canvas-kit-react": "15.0.5",
|
|
25
|
+
"@workday/canvas-kit-react-fonts": "^15.0.5",
|
|
26
|
+
"@workday/canvas-kit-styling": "15.0.5",
|
|
27
27
|
"@workday/canvas-system-icons-web": "4.0.2",
|
|
28
28
|
"@workday/canvas-expressive-icons-web": "1.0.1",
|
|
29
29
|
"@workday/canvas-tokens-web": "4.2.0"
|
|
@@ -105,7 +105,7 @@ export const SymbolDialog = ({ value }) => {
|
|
|
105
105
|
};
|
|
106
106
|
const symbolDocStencil = createStencil({
|
|
107
107
|
base: {
|
|
108
|
-
|
|
108
|
+
marginBlockEnd: system.gap.lg,
|
|
109
109
|
'button[data-symbol]': {
|
|
110
110
|
border: 'none',
|
|
111
111
|
background: 'transparent',
|
|
@@ -23,11 +23,11 @@ const liveRegionStyle = createStyles({
|
|
|
23
23
|
padding: system.padding.xs,
|
|
24
24
|
});
|
|
25
25
|
const listStyles = createStyles({
|
|
26
|
-
|
|
26
|
+
paddingInlineStart: '0',
|
|
27
27
|
});
|
|
28
28
|
const listItemStyles = createStyles({
|
|
29
29
|
listStyle: 'none',
|
|
30
|
-
|
|
30
|
+
paddingInlineStart: '0',
|
|
31
31
|
});
|
|
32
32
|
const flexStyles = createStyles({
|
|
33
33
|
gap: system.gap.md,
|
package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconButtonsWithLiveBadges.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconButtonsWithLiveBadges.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.tsx"],"names":[],"mappings":"AAiFA,eAAO,MAAM,yBAAyB,+CAuBrC,CAAC"}
|
|
@@ -4,9 +4,10 @@ import { CountBadge } from '@workday/canvas-kit-react/badge';
|
|
|
4
4
|
import { SecondaryButton, TertiaryButton } from '@workday/canvas-kit-react/button';
|
|
5
5
|
import { AccessibleHide, AriaLiveRegion, useUniqueId } from '@workday/canvas-kit-react/common';
|
|
6
6
|
import { Flex } from '@workday/canvas-kit-react/layout';
|
|
7
|
-
import { space } from '@workday/canvas-kit-react/tokens';
|
|
8
7
|
import { Tooltip } from '@workday/canvas-kit-react/tooltip';
|
|
8
|
+
import { createStyles } from '@workday/canvas-kit-styling';
|
|
9
9
|
import { assistantIcon, inboxIcon, notificationsIcon } from '@workday/canvas-system-icons-web';
|
|
10
|
+
import { system } from '@workday/canvas-tokens-web';
|
|
10
11
|
const MyTasksLiveBadge = ({ cnt }) => {
|
|
11
12
|
// use tooltip to assign name,
|
|
12
13
|
// use AriaLiveRegion inside button,
|
|
@@ -40,6 +41,10 @@ const AssistantLiveBadge = ({ cnt }) => {
|
|
|
40
41
|
const lbl = 'Workday Assistant';
|
|
41
42
|
return (_jsx(AriaLiveRegion, { children: _jsx(Tooltip, { title: lbl, type: "muted", children: _jsxs(TertiaryButton, { icon: assistantIcon, children: [_jsx(AccessibleHide, { children: lbl }), _jsx(CountBadge, { count: cnt }), _jsx(AccessibleHide, { children: "New" })] }) }) }));
|
|
42
43
|
};
|
|
44
|
+
const containerStyles = createStyles({
|
|
45
|
+
padding: system.padding.md,
|
|
46
|
+
gap: system.gap.md,
|
|
47
|
+
});
|
|
43
48
|
export const IconButtonsWithLiveBadges = () => {
|
|
44
49
|
const [counter, setCounter] = React.useState(0);
|
|
45
50
|
const [notifications, setNotifications] = React.useState(0);
|
|
@@ -47,5 +52,5 @@ export const IconButtonsWithLiveBadges = () => {
|
|
|
47
52
|
const handleAddTask = () => setCounter(prev => prev + 1);
|
|
48
53
|
const handleAddNotification = () => setNotifications(prev => prev + 1);
|
|
49
54
|
const handleAssistant = () => setAssistant(prev => prev + 1);
|
|
50
|
-
return (_jsxs(_Fragment, { children: [_jsxs(Flex, {
|
|
55
|
+
return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: "header", cs: containerStyles, children: [_jsx(AssistantLiveBadge, { cnt: assistant }), _jsx(NotificationsLiveBadge, { cnt: notifications }), _jsx(MyTasksLiveBadge, { cnt: counter })] }), _jsxs(Flex, { as: "main", cs: containerStyles, children: [_jsx(SecondaryButton, { onClick: handleAssistant, children: "Add a Message" }), _jsx(SecondaryButton, { onClick: handleAddNotification, children: "Add a Notification" }), _jsx(SecondaryButton, { onClick: handleAddTask, children: "Add an item to My Tasks" })] })] }));
|
|
51
56
|
};
|
|
@@ -136,7 +136,7 @@ const Autocomplete = createComponent('div')({
|
|
|
136
136
|
loader.load();
|
|
137
137
|
},
|
|
138
138
|
}, useComboboxModel);
|
|
139
|
-
return (_jsxs(Combobox, { model: model, children: [_jsxs(InputGroup, { children: [_jsx(InputGroup.InnerStart, { cs: styleOverrides.inputGroupInner, children: _jsx(SystemIcon, { icon: searchIcon }) }), _jsx(InputGroup.Input, { as: AutoCompleteInput, cs: styleOverrides.comboboxInput, onChange: handleChange, value: searchText, ...props })] }), _jsx(Combobox.Menu.Popper, { children: _jsx(Combobox.Menu.Card, { children: model.state.items.length === 0 ? (_jsx(StyledMenuItem, { as: "span", children: "No Results Found" })) : (model.state.items.length > 0 && (_jsx(Combobox.Menu.List, { maxHeight: px2rem(200), children: item => _jsx(Combobox.Menu.Item, { children: item }) }))) }) })] }));
|
|
139
|
+
return (_jsxs(Combobox, { model: model, children: [_jsxs(InputGroup, { children: [_jsx(InputGroup.InnerStart, { cs: styleOverrides.inputGroupInner, children: _jsx(SystemIcon, { icon: searchIcon }) }), _jsx(InputGroup.Input, { as: AutoCompleteInput, cs: styleOverrides.comboboxInput, onChange: handleChange, value: searchText, ...props })] }), _jsx(Combobox.Menu.Popper, { children: _jsx(Combobox.Menu.Card, { children: model.state.items.length === 0 ? (_jsx(StyledMenuItem, { as: "span", children: "No Results Found" })) : (model.state.items.length > 0 && (_jsx(Combobox.Menu.List, { cs: { maxHeight: px2rem(200) }, children: item => _jsx(Combobox.Menu.Item, { children: item }) }))) }) })] }));
|
|
140
140
|
},
|
|
141
141
|
});
|
|
142
142
|
const NotificationLiveBadge = createComponent('span')({
|
|
@@ -8,7 +8,7 @@ import { Heading } from '@workday/canvas-kit-react/text';
|
|
|
8
8
|
import { createStyles, px2rem } from '@workday/canvas-kit-styling';
|
|
9
9
|
import { system } from '@workday/canvas-tokens-web';
|
|
10
10
|
const headingStyles = createStyles({
|
|
11
|
-
|
|
11
|
+
marginBlockStart: '0',
|
|
12
12
|
});
|
|
13
13
|
const cardStyles = createStyles({
|
|
14
14
|
width: px2rem(320),
|
|
@@ -45,7 +45,7 @@ const comparisonLayoutStyles = createStyles({
|
|
|
45
45
|
display: 'grid',
|
|
46
46
|
gridTemplateColumns: 'repeat(3, minmax(0, 1fr))',
|
|
47
47
|
gap: system.gap.lg,
|
|
48
|
-
|
|
48
|
+
marginBlockEnd: system.gap.md,
|
|
49
49
|
});
|
|
50
50
|
function SingleInlinePopup({ overflowLabel, containerStyles, }) {
|
|
51
51
|
const messageId = useUniqueId();
|
|
@@ -58,17 +58,17 @@ const stylesOverride = {
|
|
|
58
58
|
listStyle: 'none',
|
|
59
59
|
padding: system.padding.md,
|
|
60
60
|
flexDirection: 'column',
|
|
61
|
-
|
|
61
|
+
marginBlockStart: system.gap.xl,
|
|
62
62
|
}),
|
|
63
63
|
links: createStyles({
|
|
64
64
|
textDecoration: 'none',
|
|
65
65
|
padding: system.padding.md,
|
|
66
66
|
}),
|
|
67
67
|
linkCheck: createStyles({
|
|
68
|
-
|
|
68
|
+
marginInlineStart: 'auto',
|
|
69
69
|
}),
|
|
70
70
|
flyOut: createStyles({
|
|
71
|
-
|
|
71
|
+
marginBlockStart: '8rem',
|
|
72
72
|
}),
|
|
73
73
|
};
|
|
74
74
|
const Accordion = ({ config }) => {
|
|
@@ -21,7 +21,7 @@ const parentFlexStyles = createStyles({
|
|
|
21
21
|
display: 'flex',
|
|
22
22
|
flexDirection: 'column',
|
|
23
23
|
gap: system.gap.md,
|
|
24
|
-
|
|
24
|
+
marginBlockEnd: system.gap.lg,
|
|
25
25
|
});
|
|
26
26
|
const bannerTextStyles = createStyles({
|
|
27
27
|
color: system.color.fg.inverse,
|
|
@@ -43,7 +43,7 @@ const gridStyles = createStyles({
|
|
|
43
43
|
});
|
|
44
44
|
const linkStyles = createStyles({
|
|
45
45
|
alignSelf: 'end',
|
|
46
|
-
|
|
46
|
+
marginBlockStart: px2rem(12),
|
|
47
47
|
});
|
|
48
48
|
export const WelcomePage = () => {
|
|
49
49
|
return (_jsx("div", { className: "sb-unstyled", children: _jsxs("div", { className: parentFlexStyles, children: [_jsxs(Box, { cs: { overflow: 'hidden', position: 'relative' }, children: [_jsx("img", { src: headerImage, alt: "banner with canvas kit logo and version", className: imageStyles }), _jsx(Flex, { cs: { flexDirection: 'row', position: 'absolute', top: '45%', right: '5%' }, children: _jsxs(Text, { typeLevel: "title.medium", cs: [bannerTextStyles, versionStyles], children: ["v", version] }) })] }), _jsxs(Text, { typeLevel: "body.medium", children: ["This project provides a set of components for the Workday Canvas Design System that can be used to implement user experiences consistent with", _jsx(ExternalHyperlink, { href: "https://canvas.workdaydesign.com/", iconLabel: "Open docs in new window", cs: { marginInlineStart: system.gap.xs }, children: "Workday Design Principles." })] }), _jsx(Heading, { size: "medium", children: "Quick Links" }), _jsxs(Grid, { cs: {
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import {ExampleCodeBlock} from '@workday/canvas-kit-docs';
|
|
2
|
+
|
|
2
3
|
import InlinePortalPopup from './examples/Popups/InlinePortalPopup';
|
|
3
4
|
|
|
4
5
|
|
|
5
6
|
## Inline portal with `PopupStack`
|
|
6
7
|
|
|
7
8
|
This example builds on the patterns described in
|
|
8
|
-
[Guides > Accessibility > Inline Popups](?path=/docs/guides-accessibility-inline-popups--docs).
|
|
9
|
-
|
|
9
|
+
[Guides > Accessibility > Inline Popups](?path=/docs/guides-accessibility-inline-popups--docs). It
|
|
10
|
+
does **not** use a focus trap. For modal dialogs with overlay and focus trap, use the
|
|
10
11
|
[**Modal**](?path=/docs/components-popups-modal--docs) component instead.
|
|
11
12
|
|
|
12
13
|
Keep using a portal (default stacking and positioning) but mount the portal **into a sentinel
|
|
@@ -33,7 +33,7 @@ focusable components inside popup containers like the `<Menu>` component to ensu
|
|
|
33
33
|
indicator isn’t clipped off the edge. (For example:
|
|
34
34
|
[MenuItem](https://github.com/Workday/canvas-kit/blob/master/modules/react/menu/lib/MenuItem.tsx).)
|
|
35
35
|
|
|
36
|
-
<Flex cs={{justifyContent: 'space-evenly',
|
|
36
|
+
<Flex cs={{justifyContent: 'space-evenly', paddingBlockEnd: system.padding.md}}>
|
|
37
37
|
<img src={buttonFocus} alt="Primary button with outline offset 2 pixels" />
|
|
38
38
|
<img src={menuFocus} alt="Menu item with outline offset -2 pixels" />
|
|
39
39
|
</Flex>
|
|
@@ -63,7 +63,7 @@ If you use a meaningful image with a transparent background, it could become dif
|
|
|
63
63
|
against some background colors. Be careful when using such images for conveying information to
|
|
64
64
|
users.
|
|
65
65
|
|
|
66
|
-
<Flex cs={{justifyContent: 'space-evenly',
|
|
66
|
+
<Flex cs={{justifyContent: 'space-evenly', paddingBlockEnd: system.padding.md}}>
|
|
67
67
|
<img src={checkMark} alt="Check mark images highly visible on white background" />
|
|
68
68
|
<img src={checkMarkWhcm} alt="Check mark images have poor contrast on dark background" />
|
|
69
69
|
</Flex>
|
|
@@ -8,7 +8,7 @@ import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
|
8
8
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
9
9
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
10
10
|
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
11
|
-
import {createStyles} from '@workday/canvas-kit-styling';
|
|
11
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
12
12
|
import {visibleIcon, visibleStrikethroughIcon} from '@workday/canvas-system-icons-web';
|
|
13
13
|
import {system} from '@workday/canvas-tokens-web';
|
|
14
14
|
|
|
@@ -114,7 +114,7 @@ export default () => {
|
|
|
114
114
|
>
|
|
115
115
|
<Select items={options} getTextValue={item => item.label}>
|
|
116
116
|
<FormField.Label>What is your role?</FormField.Label>
|
|
117
|
-
<FormField.Input as={Select.Input} {...register('role')} width
|
|
117
|
+
<FormField.Input as={Select.Input} {...register('role')} cs={{width: px2rem(280)}} />
|
|
118
118
|
<Select.Popper>
|
|
119
119
|
<Select.Card>
|
|
120
120
|
<Select.List maxHeight={200}>
|
|
@@ -4,6 +4,7 @@ import {MultiSelect} from '@workday/canvas-kit-preview-react/multi-select';
|
|
|
4
4
|
import {PrimaryButton, SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
5
5
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
6
6
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
7
8
|
|
|
8
9
|
const items = [
|
|
9
10
|
{id: '1', text: 'Cheese'},
|
|
@@ -30,63 +31,61 @@ export default () => {
|
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
>
|
|
41
|
-
<
|
|
42
|
-
<
|
|
43
|
-
<FormField
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<MultiSelect.
|
|
54
|
-
<MultiSelect.
|
|
55
|
-
|
|
56
|
-
{item
|
|
57
|
-
<MultiSelect.Item
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
<
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
</SecondaryButton>
|
|
82
|
-
</Flex>
|
|
83
|
-
<div>
|
|
84
|
-
<PrimaryButton type="submit">Submit</PrimaryButton>
|
|
85
|
-
</div>
|
|
86
|
-
<div>Selected ID: {value}</div>
|
|
87
|
-
<div>Selected Label: {label}</div>
|
|
34
|
+
<form
|
|
35
|
+
onSubmit={e => {
|
|
36
|
+
console.log('form submitted');
|
|
37
|
+
e.preventDefault();
|
|
38
|
+
}}
|
|
39
|
+
ref={formRef}
|
|
40
|
+
>
|
|
41
|
+
<Flex cs={{gap: system.gap.md, flexDirection: 'column'}}>
|
|
42
|
+
<MultiSelect items={items}>
|
|
43
|
+
<FormField orientation="horizontalStart">
|
|
44
|
+
<FormField.Label>Toppings</FormField.Label>
|
|
45
|
+
<FormField.Input
|
|
46
|
+
as={MultiSelect.Input}
|
|
47
|
+
placeholder="Select Multiple"
|
|
48
|
+
removeLabel="Remove"
|
|
49
|
+
name="toppings"
|
|
50
|
+
onChange={handleOnChange}
|
|
51
|
+
value={value}
|
|
52
|
+
/>
|
|
53
|
+
<MultiSelect.Popper>
|
|
54
|
+
<MultiSelect.Card>
|
|
55
|
+
<MultiSelect.List>
|
|
56
|
+
{item => (
|
|
57
|
+
<MultiSelect.Item data-id={item.id}>
|
|
58
|
+
<MultiSelect.Item.Text>{item.text}</MultiSelect.Item.Text>
|
|
59
|
+
</MultiSelect.Item>
|
|
60
|
+
)}
|
|
61
|
+
</MultiSelect.List>
|
|
62
|
+
</MultiSelect.Card>
|
|
63
|
+
</MultiSelect.Popper>
|
|
64
|
+
</FormField>
|
|
65
|
+
</MultiSelect>
|
|
66
|
+
<Flex cs={{gap: system.gap.md}}>
|
|
67
|
+
<SecondaryButton
|
|
68
|
+
onClick={e => {
|
|
69
|
+
setValue('1, 2, 3');
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
Set to "Cheese, Olives, Onions" via React `value`
|
|
73
|
+
</SecondaryButton>
|
|
74
|
+
<SecondaryButton
|
|
75
|
+
onClick={e => {
|
|
76
|
+
const input = formRef.current.querySelector('[name=toppings]') as HTMLInputElement;
|
|
77
|
+
input.value = '1, 2';
|
|
78
|
+
}}
|
|
79
|
+
>
|
|
80
|
+
Set to "Cheese, Olives" via DOM `value`
|
|
81
|
+
</SecondaryButton>
|
|
88
82
|
</Flex>
|
|
89
|
-
|
|
90
|
-
|
|
83
|
+
<div>
|
|
84
|
+
<PrimaryButton type="submit">Submit</PrimaryButton>
|
|
85
|
+
</div>
|
|
86
|
+
<div>Selected ID: {value}</div>
|
|
87
|
+
<div>Selected Label: {label}</div>
|
|
88
|
+
</Flex>
|
|
89
|
+
</form>
|
|
91
90
|
);
|
|
92
91
|
};
|
|
@@ -3,6 +3,8 @@ import React from 'react';
|
|
|
3
3
|
import {StyledRadioButton} from '@workday/canvas-kit-preview-react/radio';
|
|
4
4
|
import {FormFieldGroup} from '@workday/canvas-kit-react/form-field';
|
|
5
5
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
|
+
import {px2rem} from '@workday/canvas-kit-styling';
|
|
7
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
8
|
|
|
7
9
|
export default () => {
|
|
8
10
|
const [value, setValue] = React.useState<string | number>('deep-dish');
|
|
@@ -15,11 +17,11 @@ export default () => {
|
|
|
15
17
|
};
|
|
16
18
|
|
|
17
19
|
return (
|
|
18
|
-
<Flex flexDirection
|
|
20
|
+
<Flex cs={{flexDirection: 'column'}}>
|
|
19
21
|
<FormFieldGroup as="fieldset">
|
|
20
22
|
<FormFieldGroup.Label as="legend">Choose Your Pizza Crust</FormFieldGroup.Label>
|
|
21
|
-
<Flex gap
|
|
22
|
-
<Flex as="label" gap
|
|
23
|
+
<Flex cs={{gap: system.gap.xl}}>
|
|
24
|
+
<Flex as="label" cs={{gap: px2rem(12)}}>
|
|
23
25
|
<FormFieldGroup.Input
|
|
24
26
|
as={StyledRadioButton}
|
|
25
27
|
onChange={handleChange}
|
|
@@ -29,7 +31,7 @@ export default () => {
|
|
|
29
31
|
/>
|
|
30
32
|
Deep dish
|
|
31
33
|
</Flex>
|
|
32
|
-
<Flex as="label" gap
|
|
34
|
+
<Flex as="label" cs={{gap: px2rem(12)}}>
|
|
33
35
|
<FormFieldGroup.Input
|
|
34
36
|
as={StyledRadioButton}
|
|
35
37
|
onChange={handleChange}
|
|
@@ -1,36 +1,46 @@
|
|
|
1
1
|
import {ExampleCodeBlock} from '@workday/canvas-kit-docs';
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
import ContextualHelpDialogFocusRedirect from './examples/ContextualHelp/ContextualHelpDialogFocusRedirect';
|
|
4
4
|
import ContextualHelpDialogFocusTrap from './examples/ContextualHelp/ContextualHelpDialogFocusTrap';
|
|
5
|
-
|
|
5
|
+
import ContextualHelpTooltip from './examples/ContextualHelp/ContextualHelpTooltip';
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
## Contextual Help
|
|
9
9
|
|
|
10
10
|
### Tooltip
|
|
11
|
-
A Canvas Kit `Tooltip` can be used to provide additional information about why an element is disabled.
|
|
12
|
-
We should not, however, put one directly onto a disabled element because disabled elements do not receive focus
|
|
13
|
-
(meaning the tooltip content is not accessible to keyboard users). Instead, we should provide a button next to the disabled
|
|
14
|
-
element and apply the `Tooltip` to the button.
|
|
15
11
|
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
A Canvas Kit `Tooltip` can be used to provide additional information about why an element is
|
|
13
|
+
disabled. We should not, however, put one directly onto a disabled element because disabled elements
|
|
14
|
+
do not receive focus (meaning the tooltip content is not accessible to keyboard users). Instead, we
|
|
15
|
+
should provide a button next to the disabled element and apply the `Tooltip` to the button.
|
|
16
|
+
|
|
17
|
+
**Note: We should avoid passing the `type` prop to the `Tooltip`. The default behavior is to assign
|
|
18
|
+
an `aria-label` to the button (which is what we want)**
|
|
19
|
+
|
|
18
20
|
<ExampleCodeBlock code={ContextualHelpTooltip} />
|
|
19
21
|
|
|
20
22
|
### Contextual Help Popup Without Focus Trap
|
|
21
|
-
If one would like to provide a bit more content than a `Tooltip` will allow (such as buttons or links) a popup should be used.
|
|
22
|
-
In this example, a `Dialog` is used in conjunction with the `useFocusRedirect` hook to display some text and a link. It will
|
|
23
|
-
not trap focus; instead, it will close and focus the next element if the user tabs out or clicks away. A `Tooltip` is still
|
|
24
|
-
used on the `Dialog.Target` component so that it remains accessible for screen readers.
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
If one would like to provide a bit more content than a `Tooltip` will allow (such as buttons or
|
|
25
|
+
links) a popup should be used. In this example, a `Dialog` is used in conjunction with the
|
|
26
|
+
`useFocusRedirect` hook to display some text and a link. It will not trap focus; instead, it will
|
|
27
|
+
close and focus the next element if the user tabs out or clicks away. A `Tooltip` is still used on
|
|
28
|
+
the `Dialog.Target` component so that it remains accessible for screen readers.
|
|
29
|
+
|
|
30
|
+
`Dialog` inserts an invisible `<div>` element right after the button with an `aria-owns` attribute
|
|
31
|
+
pointing to the `Dialog.Card`. This allows screen readers to read the popup contents in a logical
|
|
32
|
+
order with the target. In other words, the screen reader will announce the `Dialog` right after the
|
|
33
|
+
open button instead of out of order.
|
|
34
|
+
|
|
35
|
+
Additionally, we apply `aria-describedby` to our `Dialog.Target` to associate it with the
|
|
36
|
+
`FormField.Label`.
|
|
29
37
|
|
|
30
|
-
Additionally, we apply `aria-describedby` to our `Dialog.Target` to associate it with the `FormField.Label`.
|
|
31
38
|
<ExampleCodeBlock code={ContextualHelpDialogFocusRedirect} />
|
|
32
39
|
|
|
33
40
|
### Contextual Help Dialog With Focus Trap
|
|
34
|
-
|
|
35
|
-
|
|
41
|
+
|
|
42
|
+
The `useFocusTrap` hook can be used in contextual help where trapping focus within the `Dialog` is
|
|
43
|
+
the goal. In this case, focus will remain in the `Dialog` until it is closed. This example is
|
|
44
|
+
otherwise identical to the one above.
|
|
45
|
+
|
|
36
46
|
<ExampleCodeBlock code={ContextualHelpDialogFocusTrap} />
|