@workday/canvas-kit-docs 14.0.1 → 14.0.2

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.
Files changed (79) hide show
  1. package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
  2. package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
  3. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.d.ts +2 -0
  4. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.d.ts.map +1 -0
  5. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.js +43 -0
  6. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/HiddenLiveRegion.d.ts +2 -0
  7. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/HiddenLiveRegion.d.ts.map +1 -0
  8. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/HiddenLiveRegion.js +27 -0
  9. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.d.ts +2 -0
  10. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.d.ts.map +1 -0
  11. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.js +51 -0
  12. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/TextInputWithLiveError.d.ts +2 -0
  13. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/TextInputWithLiveError.d.ts.map +1 -0
  14. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/TextInputWithLiveError.js +19 -0
  15. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/VisibleLiveRegion.d.ts +2 -0
  16. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/VisibleLiveRegion.d.ts.map +1 -0
  17. package/dist/es6/mdx/accessibility/examples/AriaLiveRegions/VisibleLiveRegion.js +36 -0
  18. package/dist/es6/mdx/accessibility/examples/GlobalHeader.d.ts +8 -0
  19. package/dist/es6/mdx/accessibility/examples/GlobalHeader.d.ts.map +1 -0
  20. package/dist/es6/mdx/accessibility/examples/GlobalHeader.js +149 -0
  21. package/dist/es6/mdx/accessibility/examples/PageStructure/BreadcrumbNavRegion.d.ts +2 -0
  22. package/dist/es6/mdx/accessibility/examples/PageStructure/BreadcrumbNavRegion.d.ts.map +1 -0
  23. package/dist/es6/mdx/accessibility/examples/PageStructure/BreadcrumbNavRegion.js +12 -0
  24. package/dist/es6/mdx/accessibility/examples/PageStructure/FullPageDemo.d.ts +2 -0
  25. package/dist/es6/mdx/accessibility/examples/PageStructure/FullPageDemo.d.ts.map +1 -0
  26. package/dist/es6/mdx/accessibility/examples/PageStructure/FullPageDemo.js +40 -0
  27. package/dist/es6/mdx/accessibility/examples/PageStructure/LandmarkRegions.d.ts +2 -0
  28. package/dist/es6/mdx/accessibility/examples/PageStructure/LandmarkRegions.d.ts.map +1 -0
  29. package/dist/es6/mdx/accessibility/examples/PageStructure/LandmarkRegions.js +22 -0
  30. package/dist/es6/mdx/accessibility/examples/SidePanelWithNavigation.d.ts +3 -0
  31. package/dist/es6/mdx/accessibility/examples/SidePanelWithNavigation.d.ts.map +1 -0
  32. package/dist/es6/mdx/accessibility/examples/SidePanelWithNavigation.js +100 -0
  33. package/dist/es6/mdx/accessibility/examples/SidePanelWithOverlay.d.ts +2 -0
  34. package/dist/es6/mdx/accessibility/examples/SidePanelWithOverlay.d.ts.map +1 -0
  35. package/dist/es6/mdx/accessibility/examples/SidePanelWithOverlay.js +31 -0
  36. package/dist/es6/mdx/accessibility/examples/Table/WithColumnHeaderFilters.d.ts +2 -0
  37. package/dist/es6/mdx/accessibility/examples/Table/WithColumnHeaderFilters.d.ts.map +1 -0
  38. package/dist/es6/mdx/accessibility/examples/Table/WithColumnHeaderFilters.js +101 -0
  39. package/dist/es6/mdx/accessibility/examples/Table/WithExpandableRows.d.ts +2 -0
  40. package/dist/es6/mdx/accessibility/examples/Table/WithExpandableRows.d.ts.map +1 -0
  41. package/dist/es6/mdx/accessibility/examples/Table/WithExpandableRows.js +115 -0
  42. package/dist/es6/mdx/accessibility/examples/Table/WithFormFields.d.ts +2 -0
  43. package/dist/es6/mdx/accessibility/examples/Table/WithFormFields.d.ts.map +1 -0
  44. package/dist/es6/mdx/accessibility/examples/Table/WithFormFields.js +79 -0
  45. package/dist/es6/mdx/accessibility/examples/Table/WithSelectableRows.d.ts +2 -0
  46. package/dist/es6/mdx/accessibility/examples/Table/WithSelectableRows.d.ts.map +1 -0
  47. package/dist/es6/mdx/accessibility/examples/Table/WithSelectableRows.js +89 -0
  48. package/dist/es6/mdx/accessibility/examples/Table/WithSortableColumnHeaders.d.ts +2 -0
  49. package/dist/es6/mdx/accessibility/examples/Table/WithSortableColumnHeaders.d.ts.map +1 -0
  50. package/dist/es6/mdx/accessibility/examples/Table/WithSortableColumnHeaders.js +114 -0
  51. package/dist/mdx/accessibility/AccessibilityOverview.mdx +167 -0
  52. package/dist/mdx/accessibility/AccessibilityTesting.mdx +10 -0
  53. package/dist/mdx/{react/_examples/mdx → accessibility}/Headers.mdx +0 -1
  54. package/dist/mdx/accessibility/PageStructure.mdx +58 -0
  55. package/dist/mdx/{react/_examples/mdx → accessibility}/SidePanel.mdx +1 -6
  56. package/dist/mdx/{react/_examples/mdx → accessibility}/TablesAdvanced.mdx +11 -0
  57. package/dist/mdx/accessibility/WindowsHighContrastThemes.mdx +97 -0
  58. package/dist/mdx/react/layout/examples/Grid/Basic.tsx +41 -60
  59. package/package.json +6 -6
  60. package/dist/mdx/react/_examples/mdx/AccessibilityOverview.mdx +0 -18
  61. package/dist/mdx/react/_examples/mdx/examples/AriaLiveRegions/FilterListWithLiveStatus.tsx +0 -73
  62. package/dist/mdx/react/_examples/mdx/examples/AriaLiveRegions/HiddenLiveRegion.tsx +0 -46
  63. package/dist/mdx/react/_examples/mdx/examples/AriaLiveRegions/IconButtonsWithLiveBadges.tsx +0 -98
  64. package/dist/mdx/react/_examples/mdx/examples/AriaLiveRegions/TextInputWithLiveError.tsx +0 -31
  65. package/dist/mdx/react/_examples/mdx/examples/AriaLiveRegions/VisibleLiveRegion.tsx +0 -61
  66. package/dist/mdx/react/_examples/mdx/examples/GlobalHeader.tsx +0 -295
  67. package/dist/mdx/react/_examples/mdx/examples/SidePanelWithNavigation.tsx +0 -168
  68. package/dist/mdx/react/_examples/mdx/examples/SidePanelWithOverlay.tsx +0 -46
  69. package/dist/mdx/react/_examples/mdx/examples/Table/WithColumnHeaderFilters.tsx +0 -202
  70. package/dist/mdx/react/_examples/mdx/examples/Table/WithExpandableRows.tsx +0 -216
  71. package/dist/mdx/react/_examples/mdx/examples/Table/WithSelectableRows.tsx +0 -156
  72. package/dist/mdx/react/_examples/mdx/examples/Table/WithSortableColumnHeaders.tsx +0 -213
  73. package/dist/mdx/react/_examples/mdx/examples/common/FilterListWithLiveStatus.tsx +0 -68
  74. package/dist/mdx/react/_examples/mdx/examples/common/HiddenLiveRegion.tsx +0 -33
  75. package/dist/mdx/react/_examples/mdx/examples/common/IconButtonsWithLiveBadges.tsx +0 -98
  76. package/dist/mdx/react/_examples/mdx/examples/common/TextInputWithLiveError.tsx +0 -28
  77. package/dist/mdx/react/_examples/mdx/examples/common/VisibleLiveRegion.tsx +0 -44
  78. /package/dist/mdx/{react/_examples/mdx → accessibility}/AriaLiveRegions.mdx +0 -0
  79. /package/dist/mdx/react/_examples/{examples/Tooltips → mdx/examples}/ListOfUploadedFiles.tsx +0 -0
@@ -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": "14.0.1",
22
- "@workday/canvas-kit-preview-react": "14.0.1",
23
- "@workday/canvas-kit-react": "14.0.1",
24
- "@workday/canvas-kit-react-fonts": "^14.0.1",
25
- "@workday/canvas-kit-styling": "14.0.1",
21
+ "@workday/canvas-kit-labs-react": "14.0.2",
22
+ "@workday/canvas-kit-preview-react": "14.0.2",
23
+ "@workday/canvas-kit-react": "14.0.2",
24
+ "@workday/canvas-kit-react-fonts": "^14.0.2",
25
+ "@workday/canvas-kit-styling": "14.0.2",
26
26
  "@workday/canvas-system-icons-web": "3.0.22",
27
27
  "@workday/canvas-tokens-web": "2.0.0"
28
28
  },
@@ -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": "14.0.1",
22
- "@workday/canvas-kit-preview-react": "14.0.1",
23
- "@workday/canvas-kit-react": "14.0.1",
24
- "@workday/canvas-kit-react-fonts": "^14.0.1",
25
- "@workday/canvas-kit-styling": "14.0.1",
21
+ "@workday/canvas-kit-labs-react": "14.0.2",
22
+ "@workday/canvas-kit-preview-react": "14.0.2",
23
+ "@workday/canvas-kit-react": "14.0.2",
24
+ "@workday/canvas-kit-react-fonts": "^14.0.2",
25
+ "@workday/canvas-kit-styling": "14.0.2",
26
26
  "@workday/canvas-system-icons-web": "3.0.22",
27
27
  "@workday/canvas-tokens-web": "2.0.0"
28
28
  },
@@ -0,0 +1,2 @@
1
+ export declare const FilterListWithLiveStatus: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=FilterListWithLiveStatus.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FilterListWithLiveStatus.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/AriaLiveRegions/FilterListWithLiveStatus.tsx"],"names":[],"mappings":"AA0CA,eAAO,MAAM,wBAAwB,+CA8BpC,CAAC"}
@@ -0,0 +1,43 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { AriaLiveRegion } from '@workday/canvas-kit-react/common';
4
+ import { BodyText, Heading } from '@workday/canvas-kit-react/text';
5
+ import { Flex } from '@workday/canvas-kit-react/layout';
6
+ import { FormField } from '@workday/canvas-kit-react/form-field';
7
+ import { TextInput } from '@workday/canvas-kit-react/text-input';
8
+ import { system } from '@workday/canvas-tokens-web';
9
+ import { createStyles, px2rem } from '@workday/canvas-kit-styling';
10
+ const fruits = [
11
+ 'Apples',
12
+ 'Oranges',
13
+ 'Bananas',
14
+ 'Lemons',
15
+ 'Limes',
16
+ 'Strawberries',
17
+ 'Raspberries',
18
+ 'Blackberries',
19
+ ];
20
+ const liveRegionStyle = createStyles({
21
+ border: `${px2rem(1)} solid ${system.color.border.caution.strong}`,
22
+ backgroundColor: system.color.bg.caution.softer,
23
+ padding: system.space.x2,
24
+ });
25
+ const listStyles = createStyles({
26
+ paddingLeft: system.space.zero,
27
+ });
28
+ const listItemStyles = createStyles({
29
+ listStyle: 'none',
30
+ paddingLeft: system.space.zero,
31
+ });
32
+ const flexStyles = createStyles({
33
+ gap: system.space.x4,
34
+ });
35
+ let filteredFruits = fruits;
36
+ export const FilterListWithLiveStatus = () => {
37
+ const [filter, setFilter] = React.useState('');
38
+ function handleFilter(e) {
39
+ filteredFruits = fruits.filter(i => i.toUpperCase().indexOf(e.target.value.toUpperCase()) >= 0);
40
+ setFilter(e.target.value);
41
+ }
42
+ return (_jsxs(_Fragment, { children: [_jsxs(Flex, { cs: flexStyles, children: [_jsx(Heading, { size: "small", children: "Fruits" }), _jsx(AriaLiveRegion, { children: _jsx(BodyText, { size: "small", cs: liveRegionStyle, children: `Showing ${filteredFruits.length} of ${fruits.length}` }) })] }), _jsxs(FormField, { children: [_jsx(FormField.Label, { children: "Filter Items:" }), _jsx(FormField.Input, { as: TextInput, value: filter, onChange: handleFilter })] }), _jsx("ul", { className: listStyles, children: filteredFruits.map(i => (_jsx(BodyText, { size: "small", as: "li", cs: listItemStyles, children: i }, i))) })] }));
43
+ };
@@ -0,0 +1,2 @@
1
+ export declare const HiddenLiveRegion: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=HiddenLiveRegion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HiddenLiveRegion.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/AriaLiveRegions/HiddenLiveRegion.tsx"],"names":[],"mappings":"AAkBA,eAAO,MAAM,gBAAgB,+CA2B5B,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { AccessibleHide, AriaLiveRegion } from '@workday/canvas-kit-react/common';
4
+ import { PrimaryButton } from '@workday/canvas-kit-react/button';
5
+ import { FormField } from '@workday/canvas-kit-react/form-field';
6
+ import { Flex } from '@workday/canvas-kit-react/layout';
7
+ import { Text } from '@workday/canvas-kit-react/text';
8
+ import { TextInput } from '@workday/canvas-kit-react/text-input';
9
+ import { createStyles } from '@workday/canvas-kit-styling';
10
+ import { system } from '@workday/canvas-tokens-web';
11
+ let liveRegionStr = '';
12
+ const flexStyles = createStyles({
13
+ gap: system.space.x4,
14
+ alignItems: 'center',
15
+ });
16
+ export const HiddenLiveRegion = () => {
17
+ const [message, setMessage] = React.useState('');
18
+ function handleChange(e) {
19
+ setMessage(e.target.value);
20
+ }
21
+ function handleSendMessage(e) {
22
+ e.preventDefault();
23
+ liveRegionStr = message;
24
+ setMessage('');
25
+ }
26
+ return (_jsxs(_Fragment, { children: [_jsxs(Flex, { as: "form", "aria-label": "Hidden Live Region", onSubmit: handleSendMessage, cs: flexStyles, children: [_jsxs(FormField, { children: [_jsx(FormField.Label, { children: "Type your message:" }), _jsx(FormField.Input, { as: TextInput, onChange: handleChange, value: message })] }), _jsx(PrimaryButton, { type: "submit", children: "Send Message" })] }), _jsx(AriaLiveRegion, { children: _jsx(Text, { as: AccessibleHide, children: liveRegionStr }) })] }));
27
+ };
@@ -0,0 +1,2 @@
1
+ export declare const IconButtonsWithLiveBadges: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=IconButtonsWithLiveBadges.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButtonsWithLiveBadges.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/AriaLiveRegions/IconButtonsWithLiveBadges.tsx"],"names":[],"mappings":"AA0EA,eAAO,MAAM,yBAAyB,+CAuBrC,CAAC"}
@@ -0,0 +1,51 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { AccessibleHide, AriaLiveRegion, useUniqueId } from '@workday/canvas-kit-react/common';
4
+ import { notificationsIcon, inboxIcon, assistantIcon } from '@workday/canvas-system-icons-web';
5
+ import { space } from '@workday/canvas-kit-react/tokens';
6
+ import { SecondaryButton, TertiaryButton } from '@workday/canvas-kit-react/button';
7
+ import { Flex } from '@workday/canvas-kit-react/layout';
8
+ import { Tooltip } from '@workday/canvas-kit-react/tooltip';
9
+ import { CountBadge } from '@workday/canvas-kit-react/badge';
10
+ const MyTasksLiveBadge = ({ cnt }) => {
11
+ // use tooltip to assign name,
12
+ // use AriaLiveRegion inside button,
13
+ // assign name to live region referencing the button,
14
+ // use BadgeCount inside live region,
15
+ // use AccessibleHide to create invisible word "new" after badge
16
+ // use aria-describedby on button, referencing live region container to set description
17
+ // Safari + VO => not working at all
18
+ // JAWS 2024 + Chrome / Edge => works as expected :)
19
+ // NVDA + Chrome / Edge => works as expected :)
20
+ // Firefox => isn't announcing description on focus, only announces "X New" live (missing button name)
21
+ const badgeID = useUniqueId();
22
+ const myTasksID = useUniqueId();
23
+ return (_jsx(Tooltip, { title: "My Tasks", children: _jsx(TertiaryButton, { icon: inboxIcon, id: myTasksID, "aria-describedby": badgeID, children: _jsxs(AriaLiveRegion, { id: badgeID, "aria-labelledby": myTasksID, children: [_jsx(CountBadge, { count: cnt }), _jsx(AccessibleHide, { children: "New" })] }) }) }));
24
+ };
25
+ // use AriaLiveRegion around the button,
26
+ // use Tooltip to assign the name of the button,
27
+ // make sure Tooltip title string includes count value
28
+ // Chrome + VO => Announces name "notifications X new" and innerText 'X'
29
+ // Safari + VO => Works as expected :)
30
+ // JAWS 2024 => Announces full button name twice (previous state, then new state)
31
+ // JAWS 2024 + Firefox => Works as expected :)
32
+ // NVDA (All Browsers) => Atomic property isn't working, only announcing number change, announces twice
33
+ const NotificationsLiveBadge = ({ cnt }) => (_jsx(AriaLiveRegion, { children: _jsx(Tooltip, { title: `Notifications ${cnt} new`, children: _jsx(TertiaryButton, { icon: notificationsIcon, children: _jsx(CountBadge, { count: cnt }) }) }) }));
34
+ const AssistantLiveBadge = ({ cnt }) => {
35
+ // use AriaLiveRegion around the button
36
+ // use muted type Tooltip (avoid using aria-label to name button)
37
+ // use AccessibleHide inside of button to compose name
38
+ // Chrome + VO => announces twice
39
+ // Safari + VO => works as expected :)
40
+ const lbl = 'Workday Assistant';
41
+ 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
+ export const IconButtonsWithLiveBadges = () => {
44
+ const [counter, setCounter] = React.useState(0);
45
+ const [notifications, setNotifications] = React.useState(0);
46
+ const [assistant, setAssistant] = React.useState(0);
47
+ const handleAddTask = () => setCounter(prev => prev + 1);
48
+ const handleAddNotification = () => setNotifications(prev => prev + 1);
49
+ const handleAssistant = () => setAssistant(prev => prev + 1);
50
+ return (_jsxs(_Fragment, { children: [_jsxs(Flex, { padding: space.s, gap: space.s, as: "header", children: [_jsx(AssistantLiveBadge, { cnt: assistant }), _jsx(NotificationsLiveBadge, { cnt: notifications }), _jsx(MyTasksLiveBadge, { cnt: counter })] }), _jsxs(Flex, { padding: space.s, gap: space.s, as: "main", 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
+ };
@@ -0,0 +1,2 @@
1
+ export declare const TextInputWithLiveError: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=TextInputWithLiveError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInputWithLiveError.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/AriaLiveRegions/TextInputWithLiveError.tsx"],"names":[],"mappings":"AAWA,eAAO,MAAM,sBAAsB,+CAoBlC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { AriaLiveRegion, changeFocus } from '@workday/canvas-kit-react/common';
4
+ import { FormField } from '@workday/canvas-kit-react/form-field';
5
+ import { PrimaryButton } from '@workday/canvas-kit-react/button';
6
+ import { TextInput } from '@workday/canvas-kit-react/text-input';
7
+ import { system } from '@workday/canvas-tokens-web';
8
+ import { createStyles } from '@workday/canvas-kit-styling';
9
+ const hintStyles = createStyles({
10
+ height: system.space.x6,
11
+ });
12
+ export const TextInputWithLiveError = () => {
13
+ const errMsg = 'Error: First name is required.';
14
+ const [hasError, setHasError] = React.useState('no');
15
+ const inputRef = React.useRef(null);
16
+ const handleBlur = (e) => setHasError(e.target.value.trim().length === 0 ? 'error' : 'no');
17
+ const handleSubmit = () => hasError && changeFocus(inputRef.current);
18
+ return (_jsxs(_Fragment, { children: [_jsxs(FormField, { error: hasError === 'error' ? 'error' : undefined, isRequired: true, children: [_jsx(FormField.Label, { children: "First Name:" }), _jsx(FormField.Input, { as: TextInput, onBlur: handleBlur, ref: inputRef }), _jsx(FormField.Hint, { cs: hintStyles, children: _jsx(AriaLiveRegion, { children: hasError === 'error' && errMsg }) })] }), _jsx(PrimaryButton, { onClick: handleSubmit, children: "Continue" })] }));
19
+ };
@@ -0,0 +1,2 @@
1
+ export declare const VisibleLiveRegion: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=VisibleLiveRegion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VisibleLiveRegion.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/AriaLiveRegions/VisibleLiveRegion.tsx"],"names":[],"mappings":"AA4BA,eAAO,MAAM,iBAAiB,+CAgC7B,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { AriaLiveRegion } from '@workday/canvas-kit-react/common';
4
+ import { PrimaryButton } from '@workday/canvas-kit-react/button';
5
+ import { FormField } from '@workday/canvas-kit-react/form-field';
6
+ import { Flex } from '@workday/canvas-kit-react/layout';
7
+ import { Text } from '@workday/canvas-kit-react/text';
8
+ import { TextInput } from '@workday/canvas-kit-react/text-input';
9
+ import { system } from '@workday/canvas-tokens-web';
10
+ import { createStyles, px2rem, calc } from '@workday/canvas-kit-styling';
11
+ const liveRegionStyle = createStyles({
12
+ border: `${px2rem(1)} solid ${system.color.border.caution.strong}`,
13
+ backgroundColor: system.color.bg.caution.softer,
14
+ padding: system.space.x4,
15
+ display: 'block',
16
+ marginBlockStart: system.space.x4,
17
+ marginBlockEnd: system.space.x4,
18
+ width: calc.multiply(system.space.x16, 7),
19
+ });
20
+ const flexGapStyles = createStyles({
21
+ gap: system.space.x4,
22
+ alignItems: 'center',
23
+ });
24
+ let liveRegionStr = 'This is an ARIA Live Region!';
25
+ export const VisibleLiveRegion = () => {
26
+ const [message, setMessage] = React.useState('');
27
+ function handleChange(e) {
28
+ setMessage(e.target.value);
29
+ }
30
+ function handleSendMessage(e) {
31
+ e.preventDefault();
32
+ liveRegionStr = message;
33
+ setMessage('');
34
+ }
35
+ return (_jsxs(_Fragment, { children: [_jsx(AriaLiveRegion, { children: _jsx(Text, { cs: liveRegionStyle, children: liveRegionStr }) }), _jsxs(Flex, { as: "form", "aria-label": "Visible Live Region", onSubmit: handleSendMessage, cs: flexGapStyles, children: [_jsxs(FormField, { children: [_jsx(FormField.Label, { children: "Type your message:" }), _jsx(FormField.Input, { as: TextInput, onChange: handleChange, value: message })] }), _jsx(PrimaryButton, { type: "submit", children: "Send Message" })] })] }));
36
+ };
@@ -0,0 +1,8 @@
1
+ import { FlexProps } from '@workday/canvas-kit-react/layout';
2
+ interface GlobalHeaderProps extends FlexProps {
3
+ notifications: number;
4
+ }
5
+ export declare const Basic: () => import("react/jsx-runtime").JSX.Element;
6
+ export declare const GlobalHeader: import("@workday/canvas-kit-react/common").ElementComponent<"div", GlobalHeaderProps>;
7
+ export {};
8
+ //# sourceMappingURL=GlobalHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalHeader.d.ts","sourceRoot":"","sources":["../../../../../mdx/accessibility/examples/GlobalHeader.tsx"],"names":[],"mappings":"AAuBA,OAAO,EAAO,SAAS,EAAC,MAAM,kCAAkC,CAAC;AAcjE,UAAU,iBAAkB,SAAQ,SAAS;IAC3C,aAAa,EAAE,MAAM,CAAC;CACvB;AA+ED,eAAO,MAAM,KAAK,+CAoBjB,CAAC;AAEF,eAAO,MAAM,YAAY,uFAmCvB,CAAC"}
@@ -0,0 +1,149 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import * as React from 'react';
3
+ import { AccessibleHide, AriaLiveRegion, composeHooks, createComponent, createElemPropsHook, createSubcomponent, useUniqueId, } from '@workday/canvas-kit-react/common';
4
+ import { system } from '@workday/canvas-tokens-web';
5
+ import { calc, createStyles, px2rem } from '@workday/canvas-kit-styling';
6
+ import { notificationsIcon, inboxIcon, justifyIcon, assistantIcon, searchIcon, } from '@workday/canvas-system-icons-web';
7
+ import { SecondaryButton, TertiaryButton } from '@workday/canvas-kit-react/button';
8
+ import { Avatar } from '@workday/canvas-kit-preview-react/avatar';
9
+ import { Flex } from '@workday/canvas-kit-react/layout';
10
+ import { Tooltip } from '@workday/canvas-kit-react/tooltip';
11
+ import { Combobox, useComboboxModel, useComboboxInput, useComboboxLoader, } from '@workday/canvas-kit-react/combobox';
12
+ import { InputGroup, TextInput } from '@workday/canvas-kit-react/text-input';
13
+ import { StyledMenuItem } from '@workday/canvas-kit-react/menu';
14
+ import { SystemIcon } from '@workday/canvas-kit-react/icon';
15
+ import { CountBadge } from '@workday/canvas-kit-react/badge';
16
+ const tasks = ['Request Time Off', 'Create Expense Report', 'Change Benefits'];
17
+ const styleOverrides = {
18
+ headerWrapper: createStyles({
19
+ display: 'flex',
20
+ alignItems: 'center',
21
+ justifyContent: 'space-between',
22
+ boxSizing: 'border-box',
23
+ ...system.type.subtext.large,
24
+ WebkitFontSmoothing: 'antialiased',
25
+ MozOsxFontSmoothing: 'grayscale',
26
+ backgroundColor: system.color.bg.default,
27
+ padding: system.space.x1,
28
+ }),
29
+ flexItems: createStyles({
30
+ gap: system.space.x4,
31
+ alignItems: 'center',
32
+ marginX: system.space.x3,
33
+ }),
34
+ inputGroupInner: createStyles({
35
+ marginLeft: '1rem',
36
+ width: px2rem(20),
37
+ transition: 'opacity 100ms ease',
38
+ }),
39
+ comboboxContainer: createStyles({
40
+ margin: 'auto',
41
+ width: '100%',
42
+ maxWidth: calc.multiply(system.space.x20, 6),
43
+ }),
44
+ comboboxInput: createStyles({
45
+ borderRadius: px2rem(1000),
46
+ width: '20rem',
47
+ }),
48
+ comboboxMenuList: createStyles({
49
+ maxHeight: px2rem(200),
50
+ }),
51
+ menuButtonStyles: createStyles({
52
+ textDecoration: 'none',
53
+ color: system.color.fg.strong,
54
+ }),
55
+ notificationContainerStyles: createStyles({
56
+ boxSizing: 'border-box',
57
+ position: 'relative',
58
+ }),
59
+ countBadgeStyles: createStyles({
60
+ boxSizing: 'border-box',
61
+ position: 'absolute',
62
+ top: calc.negate(system.space.x1),
63
+ insetInlineEnd: calc.negate(system.space.x1),
64
+ }),
65
+ actionButtonStyles: createStyles({
66
+ gap: system.space.x4,
67
+ margin: system.space.x4,
68
+ }),
69
+ };
70
+ const useAutocompleteInput = composeHooks(createElemPropsHook(useComboboxModel)(model => {
71
+ return {
72
+ onKeyPress(event) {
73
+ model.events.show(event);
74
+ },
75
+ };
76
+ }), useComboboxInput);
77
+ const AutoCompleteInput = createSubcomponent(TextInput)({
78
+ modelHook: useComboboxModel,
79
+ elemPropsHook: useAutocompleteInput,
80
+ })((elemProps, Element) => {
81
+ return _jsx(Combobox.Input, { as: Element, ...elemProps });
82
+ });
83
+ export const Basic = () => {
84
+ const [notifications, setNotifications] = React.useState(0);
85
+ function handleAdd() {
86
+ setNotifications(prev => prev + 1);
87
+ }
88
+ function handleClear() {
89
+ setNotifications(0);
90
+ }
91
+ return (_jsxs("header", { children: [_jsx(GlobalHeader, { notifications: notifications }), _jsxs(Flex, { cs: styleOverrides.actionButtonStyles, children: [_jsx(SecondaryButton, { onClick: handleAdd, children: "Add notification" }), _jsx(TertiaryButton, { onClick: handleClear, children: "Clear" })] })] }));
92
+ };
93
+ export const GlobalHeader = createComponent('div')({
94
+ displayName: 'GlobalHeader',
95
+ Component: ({ notifications, ...props }) => (_jsxs("div", { className: styleOverrides.headerWrapper, children: [_jsxs(Flex, { cs: styleOverrides.flexItems, children: [_jsx(Tooltip, { title: "Global Navigation", type: "describe", children: _jsx(TertiaryButton, { icon: justifyIcon, cs: styleOverrides.menuButtonStyles, children: "MENU" }) }), _jsx(Tooltip, { title: "Workday Home", children: _jsx(TertiaryButton, { children: _jsx("img", { src: "https://design.workday.com/images/ck-dub-logo-blue.svg", alt: "" }) }) })] }), _jsx(Flex, { cs: styleOverrides.flexItems, children: _jsx(Autocomplete, { "aria-label": "Search Workday" }) }), _jsxs(Flex, { cs: styleOverrides.flexItems, children: [_jsx(Tooltip, { title: "Assistant", children: _jsx(TertiaryButton, { icon: assistantIcon }) }), _jsx(NotificationLiveBadge, { cnt: notifications }), _jsx(Tooltip, { title: "My Tasks", children: _jsx(TertiaryButton, { icon: inboxIcon }) }), _jsx(Tooltip, { title: "Profile", children: _jsx(Avatar, { name: "Logan McNeil", isDecorative: true }) })] })] })),
96
+ });
97
+ const Autocomplete = createComponent('div')({
98
+ displayName: 'Autocomplete',
99
+ Component: props => {
100
+ const [searchText, setSearchText] = React.useState('');
101
+ function handleChange(e) {
102
+ setSearchText(e.target.value);
103
+ }
104
+ const { model, loader } = useComboboxLoader({
105
+ // You can start with any number that makes sense.
106
+ total: 0,
107
+ // Pick whatever number makes sense for your API
108
+ pageSize: 20,
109
+ // A load function that will be called by the loader. You must return a promise that returns
110
+ // an object like `{items: [], total: 0}`. The `items` will be merged into the loader's cache
111
+ async load({ pageNumber, pageSize, filter }) {
112
+ return new Promise(resolve => {
113
+ // simulate a server response by resolving after a period of time
114
+ setTimeout(() => {
115
+ // simulate paging and filtering based on pre-computed items
116
+ const start = (pageNumber - 1) * pageSize;
117
+ const end = start + pageSize;
118
+ const filteredTasks = tasks.filter(i => {
119
+ if (searchText.trim() === '' || typeof searchText !== 'string') {
120
+ return true;
121
+ }
122
+ return i.toLowerCase().includes(searchText.trim().toLowerCase());
123
+ });
124
+ const total = filteredTasks.length;
125
+ const items = filteredTasks.slice(start, end);
126
+ resolve({
127
+ items,
128
+ total,
129
+ });
130
+ }, 300);
131
+ });
132
+ },
133
+ onShow() {
134
+ // The `shouldLoad` cancels while the combobox menu is hidden, so let's load when it is
135
+ // visible
136
+ loader.load();
137
+ },
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 }) }))) }) })] }));
140
+ },
141
+ });
142
+ const NotificationLiveBadge = createComponent('span')({
143
+ displayName: 'NotificationLiveBadge',
144
+ Component: ({ cnt = 0, ...props }) => {
145
+ const btnId = useUniqueId();
146
+ const badgeId = useUniqueId();
147
+ return (_jsxs(Flex, { cs: styleOverrides.notificationContainerStyles, children: [_jsx(Tooltip, { title: "Notifications", children: _jsx(TertiaryButton, { id: btnId, icon: notificationsIcon, "aria-describedby": cnt > 0 ? badgeId : undefined, ...props }) }), _jsx(AriaLiveRegion, { "aria-labelledby": btnId, children: cnt > 0 && (_jsxs(_Fragment, { children: [_jsx(CountBadge, { id: badgeId, count: cnt, limit: 100, cs: styleOverrides.countBadgeStyles }), _jsx(AccessibleHide, { children: "New" })] })) })] }));
148
+ },
149
+ });
@@ -0,0 +1,2 @@
1
+ export declare const BreadcrumbNavRegion: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=BreadcrumbNavRegion.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BreadcrumbNavRegion.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/PageStructure/BreadcrumbNavRegion.tsx"],"names":[],"mappings":"AAUA,eAAO,MAAM,mBAAmB,+CAe/B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Breadcrumbs } from '@workday/canvas-kit-react/breadcrumbs';
3
+ import { createStyles, px2rem } from '@workday/canvas-kit-styling';
4
+ import { system } from '@workday/canvas-tokens-web';
5
+ const regionStyles = createStyles({
6
+ border: `${px2rem(1)} solid ${system.color.border.contrast.default}`,
7
+ borderRadius: system.shape.x2,
8
+ paddingLeft: system.space.x4,
9
+ });
10
+ export const BreadcrumbNavRegion = () => {
11
+ return (_jsx(Breadcrumbs, { className: regionStyles, "aria-label": "Breadcrumbs", children: _jsxs(Breadcrumbs.List, { children: [_jsx(Breadcrumbs.Item, { children: _jsx(Breadcrumbs.Link, { href: "#", children: "Home" }) }), _jsx(Breadcrumbs.Item, { children: _jsx(Breadcrumbs.Link, { href: "#", children: "Menus" }) }), _jsx(Breadcrumbs.CurrentItem, { children: "Dinner" })] }) }));
12
+ };
@@ -0,0 +1,2 @@
1
+ export declare const FullPageDemo: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=FullPageDemo.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FullPageDemo.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/PageStructure/FullPageDemo.tsx"],"names":[],"mappings":"AAmCA,eAAO,MAAM,YAAY,+CA8CxB,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { Flex, Grid } from '@workday/canvas-kit-react/layout';
4
+ import { Heading } from '@workday/canvas-kit-react/text';
5
+ import { SecondaryButton, TertiaryButton } from '@workday/canvas-kit-react/button';
6
+ import { createStyles, px2rem } from '@workday/canvas-kit-styling';
7
+ import { system } from '@workday/canvas-tokens-web';
8
+ import { GlobalHeader } from '../GlobalHeader';
9
+ import { SideBarContent } from '../SidePanelWithNavigation';
10
+ import { BreadcrumbNavRegion } from './BreadcrumbNavRegion';
11
+ const gridLayoutStyles = createStyles({
12
+ gridTemplateAreas: `'Header Header Header Header'
13
+ 'SideBar BodyContent BodyContent BodyContent'
14
+ 'Footer Footer Footer Footer'`,
15
+ gridGap: system.space.x4,
16
+ gridTemplateColumns: '1fr 9fr',
17
+ gridTemplateRows: `auto ${px2rem(800)} auto`,
18
+ });
19
+ const regionStyles = createStyles({
20
+ border: `${px2rem(1)} solid ${system.color.border.contrast.default}`,
21
+ borderRadius: system.shape.x2,
22
+ padding: system.space.x4,
23
+ });
24
+ const verticalFlexStyles = createStyles({
25
+ flexDirection: 'column',
26
+ gap: system.space.x4,
27
+ });
28
+ const headingStyles = createStyles({
29
+ margin: system.space.zero,
30
+ });
31
+ export const FullPageDemo = () => {
32
+ const [notifications, setNotifications] = React.useState(0);
33
+ function handleAdd() {
34
+ setNotifications(prev => prev + 1);
35
+ }
36
+ function handleClear() {
37
+ setNotifications(0);
38
+ }
39
+ return (_jsxs(Grid, { cs: gridLayoutStyles, children: [_jsx(Grid, { as: "header", gridArea: "Header", cs: regionStyles, children: _jsx(GlobalHeader, { notifications: notifications }) }), _jsx(Grid, { as: "nav", gridArea: "SideBar", cs: regionStyles, children: _jsx(Flex, { cs: verticalFlexStyles, children: _jsx(SideBarContent, {}) }) }), _jsx(Grid, { as: "main", gridArea: "BodyContent", cs: regionStyles, children: _jsxs(Flex, { cs: verticalFlexStyles, children: [_jsx(BreadcrumbNavRegion, {}), _jsxs(Flex, { gap: system.space.x4, children: [_jsx(SecondaryButton, { onClick: handleAdd, children: "Add notification" }), _jsx(TertiaryButton, { onClick: handleClear, children: "Clear" })] }), _jsx(Heading, { as: "h1", size: "large", cs: headingStyles, children: "Heading Level 1" }), _jsx(Heading, { size: "medium", cs: headingStyles, children: "Heading Level 2" }), _jsx(Heading, { as: "h3", size: "small", cs: headingStyles, children: "Heading Level 3" })] }) }), _jsx(Grid, { as: "footer", gridArea: "Footer", cs: regionStyles, children: _jsx(Heading, { size: "small", cs: headingStyles, children: "Page Footer" }) })] }));
40
+ };
@@ -0,0 +1,2 @@
1
+ export declare const LandmarkRegaions: () => import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=LandmarkRegions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LandmarkRegions.d.ts","sourceRoot":"","sources":["../../../../../../mdx/accessibility/examples/PageStructure/LandmarkRegions.tsx"],"names":[],"mappings":"AAuBA,eAAO,MAAM,gBAAgB,+CAyB5B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Grid } from '@workday/canvas-kit-react/layout';
3
+ import { Heading } from '@workday/canvas-kit-react/text';
4
+ import { createStyles, px2rem } from '@workday/canvas-kit-styling';
5
+ import { system } from '@workday/canvas-tokens-web';
6
+ const gridLayoutStyles = createStyles({
7
+ gridTemplateAreas: "'Header Header Header Header' 'SideBar BodyContent BodyContent BodyContent' 'Footer Footer Footer Footer'",
8
+ gridGap: system.space.x4,
9
+ gridTemplateColumns: '3fr 9fr',
10
+ gridTemplateRows: `auto ${px2rem(300)} auto`,
11
+ });
12
+ const regionStyles = createStyles({
13
+ border: `${px2rem(1)} solid ${system.color.border.contrast.default}`,
14
+ borderRadius: system.shape.x2,
15
+ padding: system.space.x4,
16
+ });
17
+ const headingStyles = createStyles({
18
+ margin: system.space.zero,
19
+ });
20
+ export const LandmarkRegaions = () => {
21
+ return (_jsxs(Grid, { cs: gridLayoutStyles, children: [_jsx(Grid, { as: "header", gridArea: "Header", cs: regionStyles, children: _jsx(Heading, { size: "small", cs: headingStyles, children: "Page Header" }) }), _jsx(Grid, { as: "nav", gridArea: "SideBar", cs: regionStyles, children: _jsx(Heading, { size: "small", cs: headingStyles, children: "Navigation" }) }), _jsx(Grid, { as: "main", gridArea: "BodyContent", cs: regionStyles, children: _jsx(Heading, { size: "small", cs: headingStyles, children: "Main Content" }) }), _jsx(Grid, { as: "footer", gridArea: "Footer", cs: regionStyles, children: _jsx(Heading, { size: "small", cs: headingStyles, children: "Page Footer" }) })] }));
22
+ };
@@ -0,0 +1,3 @@
1
+ export declare const SideBarContent: () => import("react/jsx-runtime").JSX.Element;
2
+ export declare const WithNavigation: () => import("react/jsx-runtime").JSX.Element;
3
+ //# sourceMappingURL=SidePanelWithNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidePanelWithNavigation.d.ts","sourceRoot":"","sources":["../../../../../mdx/accessibility/examples/SidePanelWithNavigation.tsx"],"names":[],"mappings":"AA6KA,eAAO,MAAM,cAAc,+CAiB1B,CAAC;AAEF,eAAO,MAAM,cAAc,+CAM1B,CAAC"}