@workday/canvas-kit-docs 9.0.0-alpha.362-next.2 → 9.0.0-alpha.368-next.6
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/docs.js +12 -12
- package/dist/es6/lib/specs.js +2 -2
- package/dist/mdx/9.0-UPGRADE-GUIDE.mdx +13 -1
- package/dist/mdx/react/button/button/Button.mdx +1 -1
- package/dist/mdx/react/toast/examples/RTL.tsx +1 -1
- package/dist/mdx/react/toast/examples/WithActionLinkAndCloseIcon.tsx +1 -1
- package/dist/mdx/react/toast/examples/WithPopper.tsx +1 -1
- package/dist/mdx/react/toast/toast.mdx +4 -14
- package/dist/mdx/react/tokens/examples/Tokens.tsx +37 -18
- package/package.json +5 -5
- package/dist/mdx/react/toast/examples/WithCloseButton.tsx +0 -19
package/dist/es6/lib/docs.js
CHANGED
|
@@ -208738,7 +208738,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
208738
208738
|
"required": true,
|
|
208739
208739
|
"type": {
|
|
208740
208740
|
"kind": "string",
|
|
208741
|
-
"value": "0px 1px 4px rgba(
|
|
208741
|
+
"value": "0px 1px 4px rgba(31, 38, 46, 0.12), 0px 2px 8px rgba(31, 38, 46, 0.08)"
|
|
208742
208742
|
},
|
|
208743
208743
|
"description": "",
|
|
208744
208744
|
"declarations": [
|
|
@@ -208775,7 +208775,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
208775
208775
|
"required": true,
|
|
208776
208776
|
"type": {
|
|
208777
208777
|
"kind": "string",
|
|
208778
|
-
"value": "0px 2px 8px rgba(
|
|
208778
|
+
"value": "0px 2px 8px rgba(31, 38, 46, 0.12), 0px 4px 16px rgba(31, 38, 46, 0.08)"
|
|
208779
208779
|
},
|
|
208780
208780
|
"description": "",
|
|
208781
208781
|
"declarations": [
|
|
@@ -208812,7 +208812,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
208812
208812
|
"required": true,
|
|
208813
208813
|
"type": {
|
|
208814
208814
|
"kind": "string",
|
|
208815
|
-
"value": "0px 3px 12px rgba(
|
|
208815
|
+
"value": "0px 3px 12px rgba(31, 38, 46, 0.12), 0px 6px 24px rgba(31, 38, 46, 0.08)"
|
|
208816
208816
|
},
|
|
208817
208817
|
"description": "",
|
|
208818
208818
|
"declarations": [
|
|
@@ -208849,7 +208849,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
208849
208849
|
"required": true,
|
|
208850
208850
|
"type": {
|
|
208851
208851
|
"kind": "string",
|
|
208852
|
-
"value": "0px 4px 16px rgba(
|
|
208852
|
+
"value": "0px 4px 16px rgba(31, 38, 46, 0.12), 0px 8px 32px rgba(31, 38, 46, 0.08)"
|
|
208853
208853
|
},
|
|
208854
208854
|
"description": "",
|
|
208855
208855
|
"declarations": [
|
|
@@ -208886,7 +208886,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
208886
208886
|
"required": true,
|
|
208887
208887
|
"type": {
|
|
208888
208888
|
"kind": "string",
|
|
208889
|
-
"value": "0px 5px 20px rgba(
|
|
208889
|
+
"value": "0px 5px 20px rgba(31, 38, 46, 0.12), 0px 10px 40px rgba(31, 38, 46, 0.08)"
|
|
208890
208890
|
},
|
|
208891
208891
|
"description": "",
|
|
208892
208892
|
"declarations": [
|
|
@@ -208923,7 +208923,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
208923
208923
|
"required": true,
|
|
208924
208924
|
"type": {
|
|
208925
208925
|
"kind": "string",
|
|
208926
|
-
"value": "0px 6px 24px rgba(
|
|
208926
|
+
"value": "0px 6px 24px rgba(31, 38, 46, 0.12), 0px 12px 48px rgba(31, 38, 46, 0.08)"
|
|
208927
208927
|
},
|
|
208928
208928
|
"description": "",
|
|
208929
208929
|
"declarations": [
|
|
@@ -208998,7 +208998,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
208998
208998
|
"required": true,
|
|
208999
208999
|
"type": {
|
|
209000
209000
|
"kind": "string",
|
|
209001
|
-
"value": "0px 1px 4px rgba(
|
|
209001
|
+
"value": "0px 1px 4px rgba(31, 38, 46, 0.12), 0px 2px 8px rgba(31, 38, 46, 0.08)"
|
|
209002
209002
|
},
|
|
209003
209003
|
"description": "",
|
|
209004
209004
|
"declarations": [
|
|
@@ -209020,7 +209020,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
209020
209020
|
"required": true,
|
|
209021
209021
|
"type": {
|
|
209022
209022
|
"kind": "string",
|
|
209023
|
-
"value": "0px 2px 8px rgba(
|
|
209023
|
+
"value": "0px 2px 8px rgba(31, 38, 46, 0.12), 0px 4px 16px rgba(31, 38, 46, 0.08)"
|
|
209024
209024
|
},
|
|
209025
209025
|
"description": "",
|
|
209026
209026
|
"declarations": [
|
|
@@ -209042,7 +209042,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
209042
209042
|
"required": true,
|
|
209043
209043
|
"type": {
|
|
209044
209044
|
"kind": "string",
|
|
209045
|
-
"value": "0px 3px 12px rgba(
|
|
209045
|
+
"value": "0px 3px 12px rgba(31, 38, 46, 0.12), 0px 6px 24px rgba(31, 38, 46, 0.08)"
|
|
209046
209046
|
},
|
|
209047
209047
|
"description": "",
|
|
209048
209048
|
"declarations": [
|
|
@@ -209064,7 +209064,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
209064
209064
|
"required": true,
|
|
209065
209065
|
"type": {
|
|
209066
209066
|
"kind": "string",
|
|
209067
|
-
"value": "0px 4px 16px rgba(
|
|
209067
|
+
"value": "0px 4px 16px rgba(31, 38, 46, 0.12), 0px 8px 32px rgba(31, 38, 46, 0.08)"
|
|
209068
209068
|
},
|
|
209069
209069
|
"description": "",
|
|
209070
209070
|
"declarations": [
|
|
@@ -209086,7 +209086,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
209086
209086
|
"required": true,
|
|
209087
209087
|
"type": {
|
|
209088
209088
|
"kind": "string",
|
|
209089
|
-
"value": "0px 5px 20px rgba(
|
|
209089
|
+
"value": "0px 5px 20px rgba(31, 38, 46, 0.12), 0px 10px 40px rgba(31, 38, 46, 0.08)"
|
|
209090
209090
|
},
|
|
209091
209091
|
"description": "",
|
|
209092
209092
|
"declarations": [
|
|
@@ -209108,7 +209108,7 @@ export var docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
209108
209108
|
"required": true,
|
|
209109
209109
|
"type": {
|
|
209110
209110
|
"kind": "string",
|
|
209111
|
-
"value": "0px 6px 24px rgba(
|
|
209111
|
+
"value": "0px 6px 24px rgba(31, 38, 46, 0.12), 0px 12px 48px rgba(31, 38, 46, 0.08)"
|
|
209112
209112
|
},
|
|
209113
209113
|
"description": "",
|
|
209114
209114
|
"declarations": [
|
package/dist/es6/lib/specs.js
CHANGED
|
@@ -6940,7 +6940,7 @@ module.exports = {specifications: [
|
|
|
6940
6940
|
},
|
|
6941
6941
|
{
|
|
6942
6942
|
"type": "describe",
|
|
6943
|
-
"name": "given the toast
|
|
6943
|
+
"name": "given the toast set to the default mode of \"status\"",
|
|
6944
6944
|
"children": [
|
|
6945
6945
|
{
|
|
6946
6946
|
"type": "it",
|
|
@@ -6976,7 +6976,7 @@ module.exports = {specifications: [
|
|
|
6976
6976
|
},
|
|
6977
6977
|
{
|
|
6978
6978
|
"type": "describe",
|
|
6979
|
-
"name": "given the toast with a close button and action
|
|
6979
|
+
"name": "given the toast with a close button and action link",
|
|
6980
6980
|
"children": [
|
|
6981
6981
|
{
|
|
6982
6982
|
"type": "it",
|
|
@@ -14,6 +14,8 @@ any questions.
|
|
|
14
14
|
- [Toast](#toast)
|
|
15
15
|
- [Utility Updates](#utility-updates)
|
|
16
16
|
- [focusRing](#focusring)
|
|
17
|
+
- [Token Updates](#token-updates)
|
|
18
|
+
- [Depth](#depth)
|
|
17
19
|
|
|
18
20
|
## Codemod
|
|
19
21
|
|
|
@@ -165,4 +167,14 @@ the correct props.
|
|
|
165
167
|
|
|
166
168
|
We're removing memoization from focus ring. The `memoize` argument passed to `focusRing` is no
|
|
167
169
|
longer valid and we've removed the exported `memoizedFocusRing`. There is no codemod for this
|
|
168
|
-
change. We couldn't find any example of `memoize` or `memoizedFocusRing` being used.
|
|
170
|
+
change. We couldn't find any example of `memoize` or `memoizedFocusRing` being used.
|
|
171
|
+
|
|
172
|
+
## Token Updates
|
|
173
|
+
|
|
174
|
+
### Depth
|
|
175
|
+
|
|
176
|
+
In v7, we released an update to our depth tokens that was too bold and harsh for web applications.
|
|
177
|
+
We've modified the depth token styles to be more subtle and improve visual design. This change
|
|
178
|
+
affects all components which use depth tokens including `Card`, `Toast`, `Dialog`, `Popup`, `Modal`,
|
|
179
|
+
and `Menu`. We have not changed which depth values each component references (i.e., `Card` remains
|
|
180
|
+
at `depth[1]`).
|
|
@@ -10,7 +10,7 @@ export default () => {
|
|
|
10
10
|
|
|
11
11
|
return (
|
|
12
12
|
<CanvasProvider theme={{canvas: {direction: ContentDirection.RTL}}}>
|
|
13
|
-
<Toast
|
|
13
|
+
<Toast>
|
|
14
14
|
<Toast.Icon icon={checkIcon} color="greenApple400" />
|
|
15
15
|
<Toast.Body>
|
|
16
16
|
<Toast.Message>Your workbook was successfully processed.</Toast.Message>
|
|
@@ -14,7 +14,7 @@ export default () => {
|
|
|
14
14
|
<Toast.Message>Your workbook was successfully</Toast.Message>
|
|
15
15
|
<Toast.Link href="#hyperlink">Custom Link</Toast.Link>
|
|
16
16
|
</Toast.Body>
|
|
17
|
-
<Toast.CloseIcon aria-label="Close" onClick={handleClose} />
|
|
17
|
+
<Toast.CloseIcon aria-label="Close notification" onClick={handleClose} />
|
|
18
18
|
</Toast>
|
|
19
19
|
);
|
|
20
20
|
};
|
|
@@ -27,7 +27,7 @@ export default () => {
|
|
|
27
27
|
<Toast.Body>
|
|
28
28
|
<Toast.Message>Your workbook was successfully processed.</Toast.Message>
|
|
29
29
|
</Toast.Body>
|
|
30
|
-
<Toast.CloseIcon aria-label="Close" onClick={handleClose} />
|
|
30
|
+
<Toast.CloseIcon aria-label="Close notification" onClick={handleClose} />
|
|
31
31
|
</Toast>
|
|
32
32
|
</Popper>
|
|
33
33
|
</div>
|
|
@@ -3,7 +3,6 @@ import {SymbolDoc} from '@workday/canvas-kit-docs';
|
|
|
3
3
|
import {Toast} from '@workday/canvas-kit-react/toast';
|
|
4
4
|
import Basic from './examples/Basic';
|
|
5
5
|
import ToastAlert from './examples/ToastAlert';
|
|
6
|
-
import WithCloseButton from './examples/WithCloseButton';
|
|
7
6
|
import ToastDialog from './examples/ToastDialog';
|
|
8
7
|
import WithActionLinkAndCloseIcon from './examples/WithActionLinkAndCloseIcon';
|
|
9
8
|
import WithPopper from './examples/WithPopper';
|
|
@@ -57,22 +56,19 @@ An `alert` `Toast` will wrap the message within an `assertive` ARIA live region
|
|
|
57
56
|
### Dialog
|
|
58
57
|
|
|
59
58
|
Set the `mode` prop to `dialog` to convey the presence of a follow-up action. If you use this
|
|
60
|
-
`mode`, you need to add an `aria-label`. This `aria-label` should be
|
|
61
|
-
`Toast`. The `Toast` will also add an `aria-describedby` that links the `Toast` to `Toast.Message`
|
|
59
|
+
`mode`, you need to add an `aria-label`. This `aria-label` should be additional information for the
|
|
60
|
+
`Toast` such as `notification`. The `Toast` will also add an `aria-describedby` that links the `Toast` to `Toast.Message`
|
|
62
61
|
so that it is read out to screen readers. The `aria-label` should be different that the contents of
|
|
63
62
|
the `Toast` so there is no duplication being read out by screen readers.
|
|
64
63
|
|
|
65
64
|
<ExampleCodeBlock code={ToastDialog} />
|
|
66
65
|
|
|
67
|
-
|
|
68
|
-
additional information regarding the contents.
|
|
69
|
-
|
|
70
|
-
Screen readers will read it out in the following order: `"Notifcation: Your workbook was
|
|
66
|
+
Screen readers will read the `Toast` out in the following order: "Notification: Your workbook was
|
|
71
67
|
successfully processed."
|
|
72
68
|
|
|
73
69
|
> **Note**: You must use the `Toast.Message` subcomponent when the `mode` is `dialog` so that `id`
|
|
74
70
|
> is tied to the message for accessibility. You can also pass in a `model` with `useToastModel` to
|
|
75
|
-
> provide a specific `id` for the `Toast.Message
|
|
71
|
+
> provide a specific `id` for the `Toast.Message`
|
|
76
72
|
|
|
77
73
|
```tsx
|
|
78
74
|
export const CustomIDToast = () => {
|
|
@@ -92,12 +88,6 @@ export const CustomIDToast = () => {
|
|
|
92
88
|
};
|
|
93
89
|
```
|
|
94
90
|
|
|
95
|
-
### Close Icon Button
|
|
96
|
-
|
|
97
|
-
Include the `Toast.CloseIcon` subcomponent to display a close button within the Toast.
|
|
98
|
-
|
|
99
|
-
<ExampleCodeBlock code={WithCloseButton} />
|
|
100
|
-
|
|
101
91
|
`Toast.CloseIcon` may be included within a `dialog` `Toast` to create a `Toast` with both an action
|
|
102
92
|
link and a close button.
|
|
103
93
|
|
|
@@ -1,29 +1,48 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import styled from '@emotion/styled';
|
|
3
|
-
import {pickForegroundColor
|
|
3
|
+
import {pickForegroundColor} from '@workday/canvas-kit-react/common';
|
|
4
4
|
|
|
5
5
|
import {colors, type, depth, space, borderRadius} from '@workday/canvas-kit-react/tokens';
|
|
6
|
+
import {Text} from '@workday/canvas-kit-react/text';
|
|
6
7
|
import {Box, Flex} from '@workday/canvas-kit-react/layout';
|
|
7
8
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
const DepthCard = ({depth, children}) => {
|
|
10
|
+
return (
|
|
11
|
+
<Flex
|
|
12
|
+
depth={depth}
|
|
13
|
+
width={200}
|
|
14
|
+
height={200}
|
|
15
|
+
borderRadius="s"
|
|
16
|
+
alignItems="center"
|
|
17
|
+
justifyContent="center"
|
|
18
|
+
backgroundColor="frenchVanilla100"
|
|
19
|
+
>
|
|
20
|
+
{children}
|
|
21
|
+
</Flex>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
17
24
|
|
|
18
25
|
export default () => (
|
|
19
|
-
<Flex>
|
|
20
|
-
<
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
<Flex gap="m" flexDirection="column">
|
|
27
|
+
<Flex gap="m" flexWrap="wrap">
|
|
28
|
+
<DepthCard depth="none">Depth None</DepthCard>
|
|
29
|
+
<DepthCard depth={1}>Depth 1</DepthCard>
|
|
30
|
+
<DepthCard depth={2}>Depth 2</DepthCard>
|
|
31
|
+
<DepthCard depth={3}>Depth 3</DepthCard>
|
|
32
|
+
<DepthCard depth={4}>Depth 4</DepthCard>
|
|
33
|
+
<DepthCard depth={5}>Depth 5</DepthCard>
|
|
34
|
+
<DepthCard depth={6}>Depth 6</DepthCard>
|
|
35
|
+
</Flex>
|
|
36
|
+
<Text>Depth on a colored background</Text>
|
|
37
|
+
<Flex backgroundColor="soap400" gap="m" padding="m" flexWrap="wrap">
|
|
38
|
+
<DepthCard depth="none">Depth None</DepthCard>
|
|
39
|
+
<DepthCard depth={1}>Depth 1</DepthCard>
|
|
40
|
+
<DepthCard depth={2}>Depth 2</DepthCard>
|
|
41
|
+
<DepthCard depth={3}>Depth 3</DepthCard>
|
|
42
|
+
<DepthCard depth={4}>Depth 4</DepthCard>
|
|
43
|
+
<DepthCard depth={5}>Depth 5</DepthCard>
|
|
44
|
+
<DepthCard depth={6}>Depth 6</DepthCard>
|
|
45
|
+
</Flex>
|
|
27
46
|
</Flex>
|
|
28
47
|
);
|
|
29
48
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "9.0.0-alpha.
|
|
3
|
+
"version": "9.0.0-alpha.368-next.6+63a2bafb",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^9.0.0-alpha.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^9.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-react": "^9.0.0-alpha.
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^9.0.0-alpha.368-next.6+63a2bafb",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^9.0.0-alpha.368-next.6+63a2bafb",
|
|
49
|
+
"@workday/canvas-kit-react": "^9.0.0-alpha.368-next.6+63a2bafb",
|
|
50
50
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
51
51
|
"markdown-to-jsx": "^6.10.3",
|
|
52
52
|
"ts-node": "^10.9.1"
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
"mkdirp": "^1.0.3",
|
|
58
58
|
"typescript": "4.2"
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "63a2bafbfbf34c1f98b6db4128c4079a358af453"
|
|
61
61
|
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
|
-
import {Toast} from '@workday/canvas-kit-react/toast';
|
|
4
|
-
import {checkIcon} from '@workday/canvas-system-icons-web';
|
|
5
|
-
import {colors} from '@workday/canvas-kit-react/tokens';
|
|
6
|
-
|
|
7
|
-
export default () => {
|
|
8
|
-
const handleClose = () => console.log('close button clicked');
|
|
9
|
-
|
|
10
|
-
return (
|
|
11
|
-
<Toast>
|
|
12
|
-
<Toast.Icon icon={checkIcon} color="greenApple400" />
|
|
13
|
-
<Toast.Body>
|
|
14
|
-
<Toast.Message>Your workbook was successfully processed.</Toast.Message>
|
|
15
|
-
</Toast.Body>
|
|
16
|
-
<Toast.CloseIcon aria-label="Close" onClick={handleClose} />
|
|
17
|
-
</Toast>
|
|
18
|
-
);
|
|
19
|
-
};
|