@workday/canvas-kit-docs 12.4.0-1015-next.0 → 12.4.0-1019-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/es6/lib/docs.js
CHANGED
|
@@ -138158,7 +138158,9 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
138158
138158
|
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/styles/hideMouseFocus.ts"
|
|
138159
138159
|
}
|
|
138160
138160
|
],
|
|
138161
|
-
"tags": {
|
|
138161
|
+
"tags": {
|
|
138162
|
+
"deprecated": "`hideMouseFocus` is deprecated and will be removed in a future major version. Please use [`focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible) when applying focus styles to elements."
|
|
138163
|
+
},
|
|
138162
138164
|
"type": {
|
|
138163
138165
|
"kind": "symbol",
|
|
138164
138166
|
"name": "CSSProperties",
|
|
@@ -138168,14 +138170,16 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
138168
138170
|
{
|
|
138169
138171
|
"name": "mouseFocusBehavior",
|
|
138170
138172
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/styles/hideMouseFocus.ts",
|
|
138171
|
-
"description": "",
|
|
138173
|
+
"description": "A utility that simplifies focus selectors since you can't use nested syntax for some reason. Example:\n[`[data-whatinput=\"mouse\"],\n [data-whatinput=\"touch\"],\n [data-whatinput=\"pointer\"]: {\n '& .my-selector': {\n ...\n }\n},",
|
|
138172
138174
|
"declarations": [
|
|
138173
138175
|
{
|
|
138174
138176
|
"name": "mouseFocusBehavior",
|
|
138175
138177
|
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/styles/hideMouseFocus.ts"
|
|
138176
138178
|
}
|
|
138177
138179
|
],
|
|
138178
|
-
"tags": {
|
|
138180
|
+
"tags": {
|
|
138181
|
+
"deprecated": "`mouseFocusBehavior` is deprecated and will be removed in a future major version. Please use [`focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible) when applying focus styles to elements."
|
|
138182
|
+
},
|
|
138179
138183
|
"type": {
|
|
138180
138184
|
"kind": "function",
|
|
138181
138185
|
"parameters": [
|
|
@@ -139368,24 +139372,6 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
139368
139372
|
}
|
|
139369
139373
|
],
|
|
139370
139374
|
"tags": {}
|
|
139371
|
-
},
|
|
139372
|
-
{
|
|
139373
|
-
"kind": "property",
|
|
139374
|
-
"name": "action",
|
|
139375
|
-
"required": true,
|
|
139376
|
-
"type": {
|
|
139377
|
-
"kind": "symbol",
|
|
139378
|
-
"name": "CanvasThemePalette",
|
|
139379
|
-
"value": "CanvasThemePalette"
|
|
139380
|
-
},
|
|
139381
|
-
"description": "",
|
|
139382
|
-
"declarations": [
|
|
139383
|
-
{
|
|
139384
|
-
"name": "action",
|
|
139385
|
-
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/common/lib/theming/types.ts"
|
|
139386
|
-
}
|
|
139387
|
-
],
|
|
139388
|
-
"tags": {}
|
|
139389
139375
|
}
|
|
139390
139376
|
]
|
|
139391
139377
|
},
|
|
@@ -94,7 +94,11 @@ or view the example below.
|
|
|
94
94
|
|
|
95
95
|
### Theme Overrides
|
|
96
96
|
|
|
97
|
-
The most common way to theme our buttons is to pass a `theme` object at the root level of the application via the `CanvasProvider`. In the example below, our buttons use our `brand.action.**` tokens with the fallback being `brand.primary.**`.
|
|
97
|
+
The most common way to theme our buttons is to pass a `theme` object at the root level of the application via the `CanvasProvider`. In the example below, our buttons use our `brand.action.**` tokens with the fallback being `brand.primary.**`.
|
|
98
|
+
|
|
99
|
+
> **Caution:** Setting `--cnvs-brand-action**` tokens at the `:root` CSS will override all `PrimaryButton` theme colors set at the `CanvasProvider` level.
|
|
100
|
+
|
|
101
|
+
> **Note:** You should **not** individually theme components wrapping them with the `CanvasProvider`, but rather theme at the root level of the application.
|
|
98
102
|
|
|
99
103
|
<ExampleCodeBlock code={ThemeOverrides} />
|
|
100
104
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
caretDownIcon,
|
|
9
9
|
} from '@workday/canvas-system-icons-web';
|
|
10
10
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
11
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
11
|
+
import {brand, system} from '@workday/canvas-tokens-web';
|
|
12
12
|
import {CanvasProvider} from '@workday/canvas-kit-react/common';
|
|
13
13
|
import {Heading} from '@workday/canvas-kit-react/text';
|
|
14
14
|
|
|
@@ -17,17 +17,24 @@ const parentContainerStyles = createStyles({
|
|
|
17
17
|
padding: system.space.x4,
|
|
18
18
|
});
|
|
19
19
|
|
|
20
|
+
const customActionTheme = createStyles({
|
|
21
|
+
[brand.action.base]: 'teal',
|
|
22
|
+
[brand.action.accent]: 'white',
|
|
23
|
+
[brand.action.dark]: 'hsla(180, 100%, 20%)',
|
|
24
|
+
[brand.action.darkest]: 'hsla(180, 100%, 16%)',
|
|
25
|
+
});
|
|
26
|
+
|
|
20
27
|
export default () => (
|
|
21
28
|
<div>
|
|
22
29
|
<Heading size="medium" as="h3">
|
|
23
|
-
Override Primary Color
|
|
30
|
+
Override Primary Color Via Canvas Provider
|
|
24
31
|
</Heading>
|
|
25
32
|
<CanvasProvider
|
|
26
33
|
theme={{
|
|
27
34
|
canvas: {
|
|
28
35
|
palette: {
|
|
29
|
-
|
|
30
|
-
main: '
|
|
36
|
+
primary: {
|
|
37
|
+
main: 'navy',
|
|
31
38
|
},
|
|
32
39
|
},
|
|
33
40
|
},
|
|
@@ -45,19 +52,9 @@ export default () => (
|
|
|
45
52
|
</Flex>
|
|
46
53
|
</CanvasProvider>
|
|
47
54
|
<Heading size="medium" as="h3">
|
|
48
|
-
Override Action Color
|
|
55
|
+
Override Action Color Via CSS Action Token
|
|
49
56
|
</Heading>
|
|
50
|
-
<
|
|
51
|
-
theme={{
|
|
52
|
-
canvas: {
|
|
53
|
-
palette: {
|
|
54
|
-
primary: {
|
|
55
|
-
main: 'navy',
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
}}
|
|
60
|
-
>
|
|
57
|
+
<div className={customActionTheme}>
|
|
61
58
|
<Flex cs={parentContainerStyles}>
|
|
62
59
|
<PrimaryButton>Primary</PrimaryButton>
|
|
63
60
|
<PrimaryButton icon={plusIcon} iconPosition="start">
|
|
@@ -68,6 +65,6 @@ export default () => (
|
|
|
68
65
|
</PrimaryButton>
|
|
69
66
|
<PrimaryButton aria-label="Related Actions" icon={relatedActionsVerticalIcon} />
|
|
70
67
|
</Flex>
|
|
71
|
-
</
|
|
68
|
+
</div>
|
|
72
69
|
</div>
|
|
73
70
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "12.4.0-
|
|
3
|
+
"version": "12.4.0-1019-next.0",
|
|
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,12 +44,12 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^12.4.0-
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^12.4.0-
|
|
49
|
-
"@workday/canvas-kit-react": "^12.4.0-
|
|
50
|
-
"@workday/canvas-kit-styling": "^12.4.0-
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^12.4.0-1019-next.0",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^12.4.0-1019-next.0",
|
|
49
|
+
"@workday/canvas-kit-react": "^12.4.0-1019-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^12.4.0-1019-next.0",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
|
-
"@workday/canvas-tokens-web": "^2.1.
|
|
52
|
+
"@workday/canvas-tokens-web": "^2.1.1",
|
|
53
53
|
"markdown-to-jsx": "^7.2.0",
|
|
54
54
|
"react-syntax-highlighter": "^15.5.0",
|
|
55
55
|
"ts-node": "^10.9.1"
|
|
@@ -60,5 +60,5 @@
|
|
|
60
60
|
"mkdirp": "^1.0.3",
|
|
61
61
|
"typescript": "5.0"
|
|
62
62
|
},
|
|
63
|
-
"gitHead": "
|
|
63
|
+
"gitHead": "76614cb77b6d16bd953592bc7d288a2a71c8f732"
|
|
64
64
|
}
|