@workday/canvas-kit-docs 12.6.9 → 12.6.11
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 +91 -2
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +5 -5
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +5 -5
- package/dist/mdx/preview-react/multi-select/MultiSelect.mdx +15 -1
- package/dist/mdx/preview-react/multi-select/examples/Disabled.tsx +35 -0
- package/dist/mdx/preview-react/multi-select/examples/Error.tsx +55 -0
- package/package.json +6 -6
package/dist/es6/lib/docs.js
CHANGED
|
@@ -9772,6 +9772,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
9772
9772
|
"componentType": "subcomponent",
|
|
9773
9773
|
"elemPropsHook": "useMultiSelectedItem",
|
|
9774
9774
|
"props": [
|
|
9775
|
+
{
|
|
9776
|
+
"kind": "property",
|
|
9777
|
+
"name": "disabled",
|
|
9778
|
+
"required": false,
|
|
9779
|
+
"type": {
|
|
9780
|
+
"kind": "primitive",
|
|
9781
|
+
"value": "boolean"
|
|
9782
|
+
},
|
|
9783
|
+
"description": "Disabled on the `Pill` component.",
|
|
9784
|
+
"declarations": [
|
|
9785
|
+
{
|
|
9786
|
+
"name": "disabled",
|
|
9787
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectedItem.tsx"
|
|
9788
|
+
}
|
|
9789
|
+
],
|
|
9790
|
+
"tags": {}
|
|
9791
|
+
},
|
|
9775
9792
|
{
|
|
9776
9793
|
"kind": "property",
|
|
9777
9794
|
"name": "removeLabel",
|
|
@@ -9939,6 +9956,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
9939
9956
|
"kind": "enhancedComponent",
|
|
9940
9957
|
"componentType": "subcomponent",
|
|
9941
9958
|
"props": [
|
|
9959
|
+
{
|
|
9960
|
+
"kind": "property",
|
|
9961
|
+
"name": "disabled",
|
|
9962
|
+
"required": false,
|
|
9963
|
+
"type": {
|
|
9964
|
+
"kind": "primitive",
|
|
9965
|
+
"value": "boolean"
|
|
9966
|
+
},
|
|
9967
|
+
"description": "Disabled is forwarded to the MultiSelectedItem component to make sure each item is also\ndisabled.",
|
|
9968
|
+
"declarations": [
|
|
9969
|
+
{
|
|
9970
|
+
"name": "disabled",
|
|
9971
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectedList.tsx"
|
|
9972
|
+
}
|
|
9973
|
+
],
|
|
9974
|
+
"tags": {}
|
|
9975
|
+
},
|
|
9942
9976
|
{
|
|
9943
9977
|
"kind": "property",
|
|
9944
9978
|
"name": "removeLabel",
|
|
@@ -10076,12 +10110,12 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
10076
10110
|
}
|
|
10077
10111
|
},
|
|
10078
10112
|
{
|
|
10079
|
-
"name": "
|
|
10113
|
+
"name": "multiSelectInputStencil",
|
|
10080
10114
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx",
|
|
10081
10115
|
"description": "",
|
|
10082
10116
|
"declarations": [
|
|
10083
10117
|
{
|
|
10084
|
-
"name": "
|
|
10118
|
+
"name": "multiSelectInputStencil",
|
|
10085
10119
|
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
|
|
10086
10120
|
}
|
|
10087
10121
|
],
|
|
@@ -10764,6 +10798,25 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
10764
10798
|
}
|
|
10765
10799
|
}
|
|
10766
10800
|
},
|
|
10801
|
+
{
|
|
10802
|
+
"name": "multiSelectStencil",
|
|
10803
|
+
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx",
|
|
10804
|
+
"description": "",
|
|
10805
|
+
"declarations": [
|
|
10806
|
+
{
|
|
10807
|
+
"name": "multiSelectStencil",
|
|
10808
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
|
|
10809
|
+
}
|
|
10810
|
+
],
|
|
10811
|
+
"tags": {
|
|
10812
|
+
"deprecated": "use `multiSelectInputStencil` instead. This will be removed in a future version."
|
|
10813
|
+
},
|
|
10814
|
+
"type": {
|
|
10815
|
+
"kind": "symbol",
|
|
10816
|
+
"name": "multiSelectInputStencil",
|
|
10817
|
+
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
|
|
10818
|
+
}
|
|
10819
|
+
},
|
|
10767
10820
|
{
|
|
10768
10821
|
"name": "useMultiSelectInput",
|
|
10769
10822
|
"fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx",
|
|
@@ -10917,6 +10970,24 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
10917
10970
|
"componentType": "subcomponent",
|
|
10918
10971
|
"elemPropsHook": "useMultiSelectInput",
|
|
10919
10972
|
"props": [
|
|
10973
|
+
{
|
|
10974
|
+
"kind": "property",
|
|
10975
|
+
"name": "error",
|
|
10976
|
+
"required": false,
|
|
10977
|
+
"type": {
|
|
10978
|
+
"kind": "symbol",
|
|
10979
|
+
"name": "ErrorType",
|
|
10980
|
+
"value": "ErrorType"
|
|
10981
|
+
},
|
|
10982
|
+
"description": "",
|
|
10983
|
+
"declarations": [
|
|
10984
|
+
{
|
|
10985
|
+
"name": "error",
|
|
10986
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
|
|
10987
|
+
}
|
|
10988
|
+
],
|
|
10989
|
+
"tags": {}
|
|
10990
|
+
},
|
|
10920
10991
|
{
|
|
10921
10992
|
"kind": "property",
|
|
10922
10993
|
"name": "cs",
|
|
@@ -11084,6 +11155,24 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
11084
11155
|
"componentType": "subcomponent",
|
|
11085
11156
|
"elemPropsHook": "useMultiSelectInput",
|
|
11086
11157
|
"props": [
|
|
11158
|
+
{
|
|
11159
|
+
"kind": "property",
|
|
11160
|
+
"name": "error",
|
|
11161
|
+
"required": false,
|
|
11162
|
+
"type": {
|
|
11163
|
+
"kind": "symbol",
|
|
11164
|
+
"name": "ErrorType",
|
|
11165
|
+
"value": "ErrorType"
|
|
11166
|
+
},
|
|
11167
|
+
"description": "",
|
|
11168
|
+
"declarations": [
|
|
11169
|
+
{
|
|
11170
|
+
"name": "error",
|
|
11171
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
|
|
11172
|
+
}
|
|
11173
|
+
],
|
|
11174
|
+
"tags": {}
|
|
11175
|
+
},
|
|
11087
11176
|
{
|
|
11088
11177
|
"kind": "property",
|
|
11089
11178
|
"name": "cs",
|
|
@@ -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": "12.6.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "12.6.
|
|
23
|
-
"@workday/canvas-kit-react": "12.6.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^12.6.
|
|
25
|
-
"@workday/canvas-kit-styling": "12.6.
|
|
21
|
+
"@workday/canvas-kit-labs-react": "12.6.11",
|
|
22
|
+
"@workday/canvas-kit-preview-react": "12.6.11",
|
|
23
|
+
"@workday/canvas-kit-react": "12.6.11",
|
|
24
|
+
"@workday/canvas-kit-react-fonts": "^12.6.11",
|
|
25
|
+
"@workday/canvas-kit-styling": "12.6.11",
|
|
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": "12.6.
|
|
22
|
-
"@workday/canvas-kit-preview-react": "12.6.
|
|
23
|
-
"@workday/canvas-kit-react": "12.6.
|
|
24
|
-
"@workday/canvas-kit-react-fonts": "^12.6.
|
|
25
|
-
"@workday/canvas-kit-styling": "12.6.
|
|
21
|
+
"@workday/canvas-kit-labs-react": "12.6.11",
|
|
22
|
+
"@workday/canvas-kit-preview-react": "12.6.11",
|
|
23
|
+
"@workday/canvas-kit-react": "12.6.11",
|
|
24
|
+
"@workday/canvas-kit-react-fonts": "^12.6.11",
|
|
25
|
+
"@workday/canvas-kit-styling": "12.6.11",
|
|
26
26
|
"@workday/canvas-system-icons-web": "3.0.22",
|
|
27
27
|
"@workday/canvas-tokens-web": "2.0.0"
|
|
28
28
|
},
|
|
@@ -6,6 +6,8 @@ import {
|
|
|
6
6
|
} from '@workday/canvas-kit-docs';
|
|
7
7
|
|
|
8
8
|
import Basic from './examples/Basic';
|
|
9
|
+
import Disabled from './examples/Disabled';
|
|
10
|
+
import Error from './examples/Error';
|
|
9
11
|
import Complex from './examples/Complex';
|
|
10
12
|
import Icons from './examples/Icons';
|
|
11
13
|
import Controlled from './examples/Controlled';
|
|
@@ -53,7 +55,19 @@ attached to the `MultiSelect.Input` and read out as a group for voiceover.
|
|
|
53
55
|
</MultiSelect>
|
|
54
56
|
```
|
|
55
57
|
|
|
56
|
-
|
|
58
|
+
### Disabled Example
|
|
59
|
+
|
|
60
|
+
Disabling `MultiSelect` involves passing the `disabled` prop to the `MultiSelect.Input` component.
|
|
61
|
+
|
|
62
|
+
<ExampleCodeBlock code={Disabled} />
|
|
63
|
+
|
|
64
|
+
### Error States
|
|
65
|
+
|
|
66
|
+
The `MultiSelect.Input` and `MultiSelect.SearchInput` support the `ErrorType` from the Common
|
|
67
|
+
package. The error styling is identical to the `TextInput` error styling. The `error` prop is
|
|
68
|
+
typically passed from the `FormField` component.
|
|
69
|
+
|
|
70
|
+
<ExampleCodeBlock code={Error} />
|
|
57
71
|
|
|
58
72
|
### Complex
|
|
59
73
|
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
4
|
+
import {MultiSelect} from '@workday/canvas-kit-preview-react/multi-select';
|
|
5
|
+
|
|
6
|
+
const items = ['Cheese', 'Olives', 'Onions', 'Pepperoni', 'Peppers'];
|
|
7
|
+
|
|
8
|
+
export default () => {
|
|
9
|
+
return (
|
|
10
|
+
<>
|
|
11
|
+
<MultiSelect items={items} initialSelectedIds={['Olives', 'Onions', 'Pepperoni']}>
|
|
12
|
+
<FormField orientation="horizontal">
|
|
13
|
+
<FormField.Label>Toppings</FormField.Label>
|
|
14
|
+
<FormField.Input
|
|
15
|
+
as={MultiSelect.Input}
|
|
16
|
+
placeholder="Select Multiple"
|
|
17
|
+
removeLabel="Remove"
|
|
18
|
+
disabled
|
|
19
|
+
/>
|
|
20
|
+
<MultiSelect.Popper>
|
|
21
|
+
<MultiSelect.Card>
|
|
22
|
+
<MultiSelect.List>
|
|
23
|
+
{item => (
|
|
24
|
+
<MultiSelect.Item data-id={item}>
|
|
25
|
+
<MultiSelect.Item.Text>{item}</MultiSelect.Item.Text>
|
|
26
|
+
</MultiSelect.Item>
|
|
27
|
+
)}
|
|
28
|
+
</MultiSelect.List>
|
|
29
|
+
</MultiSelect.Card>
|
|
30
|
+
</MultiSelect.Popper>
|
|
31
|
+
</FormField>
|
|
32
|
+
</MultiSelect>
|
|
33
|
+
</>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
4
|
+
import {MultiSelect, useMultiSelectModel} from '@workday/canvas-kit-preview-react/multi-select';
|
|
5
|
+
|
|
6
|
+
const items = ['Cheese', 'Olives', 'Onions', 'Pepperoni', 'Peppers'];
|
|
7
|
+
|
|
8
|
+
export default () => {
|
|
9
|
+
const model = useMultiSelectModel({
|
|
10
|
+
items,
|
|
11
|
+
initialSelectedIds: [],
|
|
12
|
+
});
|
|
13
|
+
return (
|
|
14
|
+
<>
|
|
15
|
+
<MultiSelect model={model}>
|
|
16
|
+
<FormField
|
|
17
|
+
orientation="horizontal"
|
|
18
|
+
error={
|
|
19
|
+
model.state.selectedIds.length < 1
|
|
20
|
+
? 'error'
|
|
21
|
+
: model.state.selectedIds.length > 3
|
|
22
|
+
? 'alert'
|
|
23
|
+
: undefined
|
|
24
|
+
}
|
|
25
|
+
>
|
|
26
|
+
<FormField.Label>Toppings</FormField.Label>
|
|
27
|
+
<FormField.Input
|
|
28
|
+
as={MultiSelect.Input}
|
|
29
|
+
placeholder="Select Multiple"
|
|
30
|
+
removeLabel="Remove"
|
|
31
|
+
/>
|
|
32
|
+
<MultiSelect.Popper>
|
|
33
|
+
<MultiSelect.Card>
|
|
34
|
+
<MultiSelect.List>
|
|
35
|
+
{item => (
|
|
36
|
+
<MultiSelect.Item data-id={item}>
|
|
37
|
+
<MultiSelect.Item.Text>{item}</MultiSelect.Item.Text>
|
|
38
|
+
</MultiSelect.Item>
|
|
39
|
+
)}
|
|
40
|
+
</MultiSelect.List>
|
|
41
|
+
</MultiSelect.Card>
|
|
42
|
+
</MultiSelect.Popper>
|
|
43
|
+
|
|
44
|
+
<FormField.Hint>
|
|
45
|
+
{model.state.selectedIds.length < 1
|
|
46
|
+
? 'Select at least one topping.'
|
|
47
|
+
: model.state.selectedIds.length > 3
|
|
48
|
+
? 'More than 3 toppings cost extra.'
|
|
49
|
+
: undefined}
|
|
50
|
+
</FormField.Hint>
|
|
51
|
+
</FormField>
|
|
52
|
+
</MultiSelect>
|
|
53
|
+
</>
|
|
54
|
+
);
|
|
55
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "12.6.
|
|
3
|
+
"version": "12.6.11",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -45,10 +45,10 @@
|
|
|
45
45
|
"@emotion/styled": "^11.6.0",
|
|
46
46
|
"@stackblitz/sdk": "^1.11.0",
|
|
47
47
|
"@storybook/csf": "0.0.1",
|
|
48
|
-
"@workday/canvas-kit-labs-react": "^12.6.
|
|
49
|
-
"@workday/canvas-kit-preview-react": "^12.6.
|
|
50
|
-
"@workday/canvas-kit-react": "^12.6.
|
|
51
|
-
"@workday/canvas-kit-styling": "^12.6.
|
|
48
|
+
"@workday/canvas-kit-labs-react": "^12.6.11",
|
|
49
|
+
"@workday/canvas-kit-preview-react": "^12.6.11",
|
|
50
|
+
"@workday/canvas-kit-react": "^12.6.11",
|
|
51
|
+
"@workday/canvas-kit-styling": "^12.6.11",
|
|
52
52
|
"@workday/canvas-system-icons-web": "^3.0.0",
|
|
53
53
|
"@workday/canvas-tokens-web": "^2.1.1",
|
|
54
54
|
"markdown-to-jsx": "^7.2.0",
|
|
@@ -61,5 +61,5 @@
|
|
|
61
61
|
"mkdirp": "^1.0.3",
|
|
62
62
|
"typescript": "5.0"
|
|
63
63
|
},
|
|
64
|
-
"gitHead": "
|
|
64
|
+
"gitHead": "67c9a9e99936c8c7acf0e3a8e2679f5d0d6b0bac"
|
|
65
65
|
}
|