@workday/canvas-kit-docs 13.0.3 → 13.0.5

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.
@@ -7782,6 +7782,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
7782
7782
  "componentType": "subcomponent",
7783
7783
  "elemPropsHook": "useMultiSelectedItem",
7784
7784
  "props": [
7785
+ {
7786
+ "kind": "property",
7787
+ "name": "disabled",
7788
+ "required": false,
7789
+ "type": {
7790
+ "kind": "primitive",
7791
+ "value": "boolean"
7792
+ },
7793
+ "description": "Disabled on the `Pill` component.",
7794
+ "declarations": [
7795
+ {
7796
+ "name": "disabled",
7797
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectedItem.tsx"
7798
+ }
7799
+ ],
7800
+ "tags": {}
7801
+ },
7785
7802
  {
7786
7803
  "kind": "property",
7787
7804
  "name": "removeLabel",
@@ -7949,6 +7966,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
7949
7966
  "kind": "enhancedComponent",
7950
7967
  "componentType": "subcomponent",
7951
7968
  "props": [
7969
+ {
7970
+ "kind": "property",
7971
+ "name": "disabled",
7972
+ "required": false,
7973
+ "type": {
7974
+ "kind": "primitive",
7975
+ "value": "boolean"
7976
+ },
7977
+ "description": "Disabled is forwarded to the MultiSelectedItem component to make sure each item is also\ndisabled.",
7978
+ "declarations": [
7979
+ {
7980
+ "name": "disabled",
7981
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectedList.tsx"
7982
+ }
7983
+ ],
7984
+ "tags": {}
7985
+ },
7952
7986
  {
7953
7987
  "kind": "property",
7954
7988
  "name": "removeLabel",
@@ -8086,12 +8120,12 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
8086
8120
  }
8087
8121
  },
8088
8122
  {
8089
- "name": "multiSelectStencil",
8123
+ "name": "multiSelectInputStencil",
8090
8124
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx",
8091
8125
  "description": "",
8092
8126
  "declarations": [
8093
8127
  {
8094
- "name": "multiSelectStencil",
8128
+ "name": "multiSelectInputStencil",
8095
8129
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
8096
8130
  }
8097
8131
  ],
@@ -8774,6 +8808,25 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
8774
8808
  }
8775
8809
  }
8776
8810
  },
8811
+ {
8812
+ "name": "multiSelectStencil",
8813
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx",
8814
+ "description": "",
8815
+ "declarations": [
8816
+ {
8817
+ "name": "multiSelectStencil",
8818
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
8819
+ }
8820
+ ],
8821
+ "tags": {
8822
+ "deprecated": "use `multiSelectInputStencil` instead. This will be removed in a future version."
8823
+ },
8824
+ "type": {
8825
+ "kind": "symbol",
8826
+ "name": "multiSelectInputStencil",
8827
+ "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
8828
+ }
8829
+ },
8777
8830
  {
8778
8831
  "name": "useMultiSelectInput",
8779
8832
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx",
@@ -8927,6 +8980,24 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
8927
8980
  "componentType": "subcomponent",
8928
8981
  "elemPropsHook": "useMultiSelectInput",
8929
8982
  "props": [
8983
+ {
8984
+ "kind": "property",
8985
+ "name": "error",
8986
+ "required": false,
8987
+ "type": {
8988
+ "kind": "symbol",
8989
+ "name": "ErrorType",
8990
+ "value": "ErrorType"
8991
+ },
8992
+ "description": "",
8993
+ "declarations": [
8994
+ {
8995
+ "name": "error",
8996
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
8997
+ }
8998
+ ],
8999
+ "tags": {}
9000
+ },
8930
9001
  {
8931
9002
  "kind": "property",
8932
9003
  "name": "cs",
@@ -9094,6 +9165,24 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
9094
9165
  "componentType": "subcomponent",
9095
9166
  "elemPropsHook": "useMultiSelectInput",
9096
9167
  "props": [
9168
+ {
9169
+ "kind": "property",
9170
+ "name": "error",
9171
+ "required": false,
9172
+ "type": {
9173
+ "kind": "symbol",
9174
+ "name": "ErrorType",
9175
+ "value": "ErrorType"
9176
+ },
9177
+ "description": "",
9178
+ "declarations": [
9179
+ {
9180
+ "name": "error",
9181
+ "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
9182
+ }
9183
+ ],
9184
+ "tags": {}
9185
+ },
9097
9186
  {
9098
9187
  "kind": "property",
9099
9188
  "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": "13.0.3",
22
- "@workday/canvas-kit-preview-react": "13.0.3",
23
- "@workday/canvas-kit-react": "13.0.3",
24
- "@workday/canvas-kit-react-fonts": "^13.0.3",
25
- "@workday/canvas-kit-styling": "13.0.3",
21
+ "@workday/canvas-kit-labs-react": "13.0.5",
22
+ "@workday/canvas-kit-preview-react": "13.0.5",
23
+ "@workday/canvas-kit-react": "13.0.5",
24
+ "@workday/canvas-kit-react-fonts": "^13.0.5",
25
+ "@workday/canvas-kit-styling": "13.0.5",
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": "13.0.3",
22
- "@workday/canvas-kit-preview-react": "13.0.3",
23
- "@workday/canvas-kit-react": "13.0.3",
24
- "@workday/canvas-kit-react-fonts": "^13.0.3",
25
- "@workday/canvas-kit-styling": "13.0.3",
21
+ "@workday/canvas-kit-labs-react": "13.0.5",
22
+ "@workday/canvas-kit-preview-react": "13.0.5",
23
+ "@workday/canvas-kit-react": "13.0.5",
24
+ "@workday/canvas-kit-react-fonts": "^13.0.5",
25
+ "@workday/canvas-kit-styling": "13.0.5",
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
- <ExampleCodeBlock code={Basic} />
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="horizontalStart">
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="horizontalStart"
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": "13.0.3",
3
+ "version": "13.0.5",
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": "^13.0.3",
49
- "@workday/canvas-kit-preview-react": "^13.0.3",
50
- "@workday/canvas-kit-react": "^13.0.3",
51
- "@workday/canvas-kit-styling": "^13.0.3",
48
+ "@workday/canvas-kit-labs-react": "^13.0.5",
49
+ "@workday/canvas-kit-preview-react": "^13.0.5",
50
+ "@workday/canvas-kit-react": "^13.0.5",
51
+ "@workday/canvas-kit-styling": "^13.0.5",
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": "da1975c7b695c8d2424687319f6491aece3e0042"
64
+ "gitHead": "ab6af4b56e5da8a029108d119d86aab19645e6c8"
65
65
  }