@workday/canvas-kit-docs 9.0.0-alpha.301-next.2 → 9.0.0-alpha.305-next.1
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/mdx/9.0-UPGRADE-GUIDE.mdx +76 -0
- package/dist/mdx/react/layout/Stack.mdx +9 -0
- package/dist/mdx/react/radio/examples/Alert.tsx +2 -1
- package/dist/mdx/react/radio/examples/Basic.tsx +2 -1
- package/dist/mdx/react/radio/examples/Disabled.tsx +2 -1
- package/dist/mdx/react/radio/examples/Error.tsx +2 -1
- package/dist/mdx/react/radio/examples/Inverse.tsx +2 -2
- package/dist/mdx/react/radio/examples/LabelPosition.tsx +2 -1
- package/dist/mdx/react/radio/examples/NoValue.tsx +2 -1
- package/dist/mdx/react/radio/examples/RefForwarding.tsx +2 -1
- package/dist/mdx/react/radio/examples/Required.tsx +3 -2
- package/package.json +3 -3
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# Canvas Kit 9.0 Upgrade Guide
|
|
2
|
+
|
|
3
|
+
This guide contains an overview of the changes in Canvas Kit v9. Please
|
|
4
|
+
[reach out](https://github.com/Workday/canvas-kit/issues/new?labels=bug&template=bug.md) if you have
|
|
5
|
+
any questions.
|
|
6
|
+
|
|
7
|
+
- [Codemod](#codemod)
|
|
8
|
+
- [Component Deprecations](#component-deprecations)
|
|
9
|
+
- [Drawer](#drawer)
|
|
10
|
+
|
|
11
|
+
## Codemod
|
|
12
|
+
|
|
13
|
+
Please use our [codemod package](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
14
|
+
to automatically update your code to work with most of the breaking changes in v9.
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
> npx @workday/canvas-kit-codemod v9 [path]
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
Alternatively, if you're unable to run the codemod successfully using `npx`, you can install the
|
|
21
|
+
codemod package as a dev dependency, run it with `yarn`, and then remove the package after you're
|
|
22
|
+
finished.
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
> yarn add @workday/canvas-kit-codemod --dev
|
|
26
|
+
> yarn canvas-kit-codemod v9 [path]
|
|
27
|
+
> yarn remove @workday/canvas-kit-codemod
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
> The codemod only works on `.js`, `.jsx`, `.ts`, and `.tsx` files. You'll need to manually edit
|
|
31
|
+
> other file types (`.json`, `.mdx`, `.md`, etc.). You may need to run your linter after executing
|
|
32
|
+
> the codemod, as its resulting formatting (spacing, quotes, etc.) may not match your project
|
|
33
|
+
> conventions.
|
|
34
|
+
|
|
35
|
+
The codemod will handle _most_ but _not all_ of the breaking changes in v9. **Breaking changes
|
|
36
|
+
handled by the codemod are marked with 🤖 in the Upgrade Guide.**
|
|
37
|
+
|
|
38
|
+
**Please verify all changes made by the codemod.** As a safety precaution, we recommend committing
|
|
39
|
+
the changes from the codemod as a single isolated commit (separate from other changes) so you can
|
|
40
|
+
roll back more easily if necessary.
|
|
41
|
+
|
|
42
|
+
## Component Deprecations
|
|
43
|
+
|
|
44
|
+
### Deprecation Types
|
|
45
|
+
|
|
46
|
+
#### Soft Deprecation
|
|
47
|
+
|
|
48
|
+
A soft-deprecated component is still available with its full functionality, but it will have been
|
|
49
|
+
renamed with a prefix to indicate its soft-deprecated status. It will also include a console warning
|
|
50
|
+
announcing its deprecation. This warning will only be triggered on the component's initial render.
|
|
51
|
+
|
|
52
|
+
Soft-deprecated types and utilities will also have been renamed but generally will not trigger a
|
|
53
|
+
console warning.
|
|
54
|
+
|
|
55
|
+
#### Hard Deprecation
|
|
56
|
+
|
|
57
|
+
A hard-deprecated component or package is no longer available. You will need to follow the method
|
|
58
|
+
prescribed in our Upgrade Guide to update your application. Please
|
|
59
|
+
[reach out](https://github.com/Workday/canvas-kit/issues/new?labels=bug&template=bug.md) to our team
|
|
60
|
+
directly if you need additional help.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
### Drawer
|
|
65
|
+
|
|
66
|
+
<!---
|
|
67
|
+
TODO: Please review this section with documenting SidePanel deprication
|
|
68
|
+
-->
|
|
69
|
+
|
|
70
|
+
We've [hard-deprecated](#hard-deprecation) `Drawer` and this component has been fully removed from Canvas
|
|
71
|
+
Kit. Consider using the
|
|
72
|
+
[Side Panel](https://workday.github.io/canvas-kit/?path=/story/preview-side-panel--basic). Be Aware
|
|
73
|
+
that `SidePanel` from the Main package is planned to be replaced by the one from Preview.
|
|
74
|
+
We suggest you use the Preview version of `SidePanel` until the one in Main is replaced with it.
|
|
75
|
+
|
|
76
|
+
---
|
|
@@ -9,6 +9,15 @@ import HStackCards from './examples/Stack/HStackCards';
|
|
|
9
9
|
import VStackCards from './examples/Stack/VStackCards';
|
|
10
10
|
|
|
11
11
|
|
|
12
|
+
### ⚠️ Stack has been soft-deprecated in v8 and will be removed in v9 ⚠️
|
|
13
|
+
|
|
14
|
+
- If you would like resolve this now, run this codemod:
|
|
15
|
+
`npx @workday/canvas-kit-codemod softDeprecate/Stack [path]`
|
|
16
|
+
- You can learn more about the codemod package
|
|
17
|
+
[here](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
|
|
18
|
+
- There is more context [here](https://github.com/Workday/canvas-kit/issues/1830) as to why this
|
|
19
|
+
decision was made
|
|
20
|
+
|
|
12
21
|
# Canvas Kit Stack
|
|
13
22
|
|
|
14
23
|
`Stack`, `HStack`, and `VStack` are higher-level layout components that provide an ergonomic API for
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
|
+
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
4
5
|
|
|
5
6
|
export default () => {
|
|
6
7
|
const [value, setValue] = React.useState<string | number>('deep-dish');
|
|
@@ -17,7 +18,7 @@ export default () => {
|
|
|
17
18
|
label="Choose Your Pizza Crust"
|
|
18
19
|
useFieldset={true}
|
|
19
20
|
>
|
|
20
|
-
<RadioGroup name=
|
|
21
|
+
<RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
|
|
21
22
|
<Radio disabled={true} label="Deep dish (sold out)" value="deep-dish" />
|
|
22
23
|
<Radio label="Thin" value="thin" />
|
|
23
24
|
<Radio label="Gluten free" value="gluten-free" />
|
|
@@ -3,6 +3,7 @@ import styled from '@emotion/styled';
|
|
|
3
3
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
4
4
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
5
5
|
import {space} from '@workday/canvas-kit-react/tokens';
|
|
6
|
+
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
6
7
|
|
|
7
8
|
export default () => {
|
|
8
9
|
const [value, setValue] = React.useState<string | number>('deep-dish');
|
|
@@ -17,7 +18,7 @@ export default () => {
|
|
|
17
18
|
|
|
18
19
|
return (
|
|
19
20
|
<StyledFormField label="Choose Your Pizza Crust" useFieldset={true}>
|
|
20
|
-
<RadioGroup name=
|
|
21
|
+
<RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
|
|
21
22
|
<Radio label="Deep dish" value="deep-dish" />
|
|
22
23
|
<Radio label="Thin" value="thin" />
|
|
23
24
|
<Radio label="Gluten free" value="gluten-free" />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
|
+
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
4
5
|
|
|
5
6
|
export default () => {
|
|
6
7
|
const [value, setValue] = React.useState<string | number>('deep-dish');
|
|
@@ -11,7 +12,7 @@ export default () => {
|
|
|
11
12
|
|
|
12
13
|
return (
|
|
13
14
|
<FormField label="Choose Your Pizza Crust" useFieldset={true}>
|
|
14
|
-
<RadioGroup name=
|
|
15
|
+
<RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
|
|
15
16
|
<Radio label="Deep dish" value="deep-dish" />
|
|
16
17
|
<Radio label="Thin" value="thin" />
|
|
17
18
|
<Radio disabled={true} label="Gluten free (sold out)" value="gluten-free" />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
|
+
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
4
5
|
|
|
5
6
|
export default () => {
|
|
6
7
|
const [value, setValue] = React.useState<string | number>('deep-dish');
|
|
@@ -17,7 +18,7 @@ export default () => {
|
|
|
17
18
|
label="Choose Your Pizza Crust"
|
|
18
19
|
useFieldset={true}
|
|
19
20
|
>
|
|
20
|
-
<RadioGroup name=
|
|
21
|
+
<RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
|
|
21
22
|
<Radio disabled={true} label="Deep dish (sold out)" value="deep-dish" />
|
|
22
23
|
<Radio label="Thin" value="thin" />
|
|
23
24
|
<Radio label="Gluten free" value="gluten-free" />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
2
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
3
|
import {Box} from '@workday/canvas-kit-react/layout';
|
|
4
|
+
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
5
|
|
|
6
6
|
export default () => {
|
|
7
7
|
const [value, setValue] = React.useState<string | number>('deep-dish');
|
|
@@ -12,7 +12,7 @@ export default () => {
|
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
14
|
<Box backgroundColor="blueberry400" padding="s">
|
|
15
|
-
<RadioGroup name=
|
|
15
|
+
<RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
|
|
16
16
|
<Radio variant="inverse" label="Deep dish" value="deep-dish" />
|
|
17
17
|
<Radio variant="inverse" label="Thin" value="thin" />
|
|
18
18
|
<Radio variant="inverse" label="Gluten free" value="gluten-free" />
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
|
+
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
4
5
|
|
|
5
6
|
export default () => {
|
|
6
7
|
const [value, setValue] = React.useState<string | number>('deep-dish');
|
|
@@ -15,7 +16,7 @@ export default () => {
|
|
|
15
16
|
labelPosition={FormField.LabelPosition.Left}
|
|
16
17
|
useFieldset={true}
|
|
17
18
|
>
|
|
18
|
-
<RadioGroup name=
|
|
19
|
+
<RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
|
|
19
20
|
<Radio label="Deep dish" value="deep-dish" />
|
|
20
21
|
<Radio label="Thin" value="thin" />
|
|
21
22
|
<Radio label="Gluten free" value="gluten-free" />
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
4
|
import {Subtext} from '@workday/canvas-kit-react/text';
|
|
5
|
+
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
6
|
|
|
6
7
|
export default () => {
|
|
7
8
|
const [value, setValue] = React.useState<string | number>(0);
|
|
@@ -13,7 +14,7 @@ export default () => {
|
|
|
13
14
|
return (
|
|
14
15
|
<>
|
|
15
16
|
<FormField label="Choose Your Pizza Crust" useFieldset={true}>
|
|
16
|
-
<RadioGroup name=
|
|
17
|
+
<RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
|
|
17
18
|
<Radio label="Deep dish" />
|
|
18
19
|
<Radio label="Thin" />
|
|
19
20
|
<Radio label="Gluten free" />
|
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
3
3
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
4
4
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
5
|
+
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
5
6
|
|
|
6
7
|
export default () => {
|
|
7
8
|
const [value, setValue] = React.useState<string | number>('deep-dish');
|
|
@@ -18,7 +19,7 @@ export default () => {
|
|
|
18
19
|
return (
|
|
19
20
|
<>
|
|
20
21
|
<FormField label="Choose Your Pizza Crust" useFieldset={true}>
|
|
21
|
-
<RadioGroup name=
|
|
22
|
+
<RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
|
|
22
23
|
<Radio label="Deep dish" value="deep-dish" />
|
|
23
24
|
<Radio label="Thin" value="thin" />
|
|
24
25
|
<Radio label="Gluten free" ref={glutenFreeRef} value="gluten-free" />
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
3
3
|
import {Radio, RadioGroup} from '@workday/canvas-kit-react/radio';
|
|
4
|
+
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
4
5
|
|
|
5
6
|
export default () => {
|
|
6
|
-
const [value, setValue] = React.useState(
|
|
7
|
+
const [value, setValue] = React.useState<string | number>();
|
|
7
8
|
|
|
8
9
|
const handleChange = (value: string | number) => {
|
|
9
10
|
setValue(value);
|
|
@@ -11,7 +12,7 @@ export default () => {
|
|
|
11
12
|
|
|
12
13
|
return (
|
|
13
14
|
<FormField label="Choose Your Pizza Crust" required={true} useFieldset={true}>
|
|
14
|
-
<RadioGroup name=
|
|
15
|
+
<RadioGroup name={useUniqueId()} onChange={handleChange} value={value}>
|
|
15
16
|
<Radio label="Deep dish" value="deep-dish" />
|
|
16
17
|
<Radio label="Thin" value="thin" />
|
|
17
18
|
<Radio label="Gluten free" value="gluten-free" />
|
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.305-next.1+a4c0b8fe",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
],
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@storybook/csf": "0.0.1",
|
|
45
|
-
"@workday/canvas-kit-react": "^9.0.0-alpha.
|
|
45
|
+
"@workday/canvas-kit-react": "^9.0.0-alpha.305-next.1+a4c0b8fe",
|
|
46
46
|
"@workday/canvas-system-icons-web": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -51,5 +51,5 @@
|
|
|
51
51
|
"mkdirp": "^1.0.3",
|
|
52
52
|
"typescript": "4.1"
|
|
53
53
|
},
|
|
54
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "a4c0b8fe72bab89c5fd5be3cd5faf067b6a7b94c"
|
|
55
55
|
}
|