@workday/canvas-kit-docs 12.0.0-alpha.834-next.0 → 12.0.0-alpha.841-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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Canvas Kit 12.0 Upgrade Guide
|
|
2
|
+
|
|
3
|
+
This guide contains an overview of the changes in Canvas Kit v12. 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
|
+
## Why You Should Upgrade
|
|
8
|
+
|
|
9
|
+
## Table of contents
|
|
10
|
+
|
|
11
|
+
- [Removals](#removals)
|
|
12
|
+
- [Select (Preview)](#select-preview)
|
|
13
|
+
|
|
14
|
+
## Removals
|
|
15
|
+
Removals are deletions from our codebase and you can no longer consume this component. We've either promoted or replaced a component or utility.
|
|
16
|
+
|
|
17
|
+
### Select (Preview)
|
|
18
|
+
|
|
19
|
+
**PR:** [#2796](https://github.com/Workday/canvas-kit/pull/2796)
|
|
20
|
+
|
|
21
|
+
We've removed the `Select` component that was in Preview. Please use the compound [`Select` component from Main](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-select--basic).
|
|
@@ -41,9 +41,24 @@ const myCustomStyles = createStyles({
|
|
|
41
41
|
textTransform: 'uppercase',
|
|
42
42
|
});
|
|
43
43
|
|
|
44
|
+
const customColors = {
|
|
45
|
+
default: {
|
|
46
|
+
background: system.color.static.green.soft,
|
|
47
|
+
icon: system.color.static.green.strong,
|
|
48
|
+
label: system.color.static.green.strong,
|
|
49
|
+
},
|
|
50
|
+
hover: {
|
|
51
|
+
background: system.color.static.green.default,
|
|
52
|
+
icon: system.color.static.green.strong,
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
44
56
|
export default () => (
|
|
45
57
|
<Grid cs={{gap: px2rem(4), gridTemplateColumns: 'repeat(3, 1fr)', alignItems: 'center'}}>
|
|
46
58
|
<MyCustomButton icon={plusIcon}>Styling Override Via Stencil Variables</MyCustomButton>
|
|
47
59
|
<PrimaryButton cs={myCustomStyles}>Style Override Via Create Styles</PrimaryButton>
|
|
60
|
+
<PrimaryButton icon={plusIcon} colors={customColors}>
|
|
61
|
+
Styling Override Via Colors Prop
|
|
62
|
+
</PrimaryButton>
|
|
48
63
|
</Grid>
|
|
49
64
|
);
|
|
@@ -3,10 +3,10 @@ import {Modal, useModalModel} from '@workday/canvas-kit-react/modal';
|
|
|
3
3
|
import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
4
4
|
import {FormField} from '@workday/canvas-kit-preview-react/form-field';
|
|
5
5
|
import {Flex, Box} from '@workday/canvas-kit-react/layout';
|
|
6
|
-
import {Select} from '@workday/canvas-kit-
|
|
6
|
+
import {Select} from '@workday/canvas-kit-react/select';
|
|
7
7
|
|
|
8
8
|
export default () => {
|
|
9
|
-
const ref = React.useRef
|
|
9
|
+
const ref = React.useRef(null);
|
|
10
10
|
const [value, setValue] = React.useState('');
|
|
11
11
|
const model = useModalModel({
|
|
12
12
|
returnFocusRef: ref,
|
|
@@ -18,24 +18,29 @@ export default () => {
|
|
|
18
18
|
|
|
19
19
|
return (
|
|
20
20
|
<Modal model={model}>
|
|
21
|
-
<
|
|
22
|
-
<FormField
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
21
|
+
<Select items={['', 'Delete', 'Two']}>
|
|
22
|
+
<FormField>
|
|
23
|
+
<FormField.Label>Choose an option</FormField.Label>
|
|
24
|
+
<FormField.Input
|
|
25
|
+
as={Select.Input}
|
|
26
|
+
ref={ref}
|
|
27
|
+
onChange={e => {
|
|
28
|
+
const option = e.currentTarget.value;
|
|
29
|
+
if (option === 'Delete') {
|
|
30
|
+
model.events.show();
|
|
31
|
+
setValue('');
|
|
32
|
+
} else {
|
|
33
|
+
setValue(e.currentTarget.value);
|
|
34
|
+
}
|
|
35
|
+
}}
|
|
36
|
+
/>
|
|
37
|
+
<Select.Popper>
|
|
38
|
+
<Select.Card>
|
|
39
|
+
<Select.List>{item => <Select.Item>{item}</Select.Item>}</Select.List>
|
|
40
|
+
</Select.Card>
|
|
41
|
+
</Select.Popper>
|
|
42
|
+
</FormField>
|
|
43
|
+
</Select>
|
|
39
44
|
<Modal.Overlay>
|
|
40
45
|
<Modal.Card>
|
|
41
46
|
<Modal.CloseIcon aria-label="Close" />
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.841-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,10 +44,10 @@
|
|
|
44
44
|
"dependencies": {
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@storybook/csf": "0.0.1",
|
|
47
|
-
"@workday/canvas-kit-labs-react": "^12.0.0-alpha.
|
|
48
|
-
"@workday/canvas-kit-preview-react": "^12.0.0-alpha.
|
|
49
|
-
"@workday/canvas-kit-react": "^12.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-styling": "^12.0.0-alpha.
|
|
47
|
+
"@workday/canvas-kit-labs-react": "^12.0.0-alpha.841-next.0",
|
|
48
|
+
"@workday/canvas-kit-preview-react": "^12.0.0-alpha.841-next.0",
|
|
49
|
+
"@workday/canvas-kit-react": "^12.0.0-alpha.841-next.0",
|
|
50
|
+
"@workday/canvas-kit-styling": "^12.0.0-alpha.841-next.0",
|
|
51
51
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
52
52
|
"@workday/canvas-tokens-web": "^2.0.0",
|
|
53
53
|
"markdown-to-jsx": "^6.10.3",
|
|
@@ -59,5 +59,5 @@
|
|
|
59
59
|
"mkdirp": "^1.0.3",
|
|
60
60
|
"typescript": "4.2"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "066c4b170850949586bf9f89370f5302a6c8f9a4"
|
|
63
63
|
}
|