@workday/canvas-kit-docs 12.6.10 → 12.6.12

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.
@@ -10110,12 +10110,12 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
10110
10110
  }
10111
10111
  },
10112
10112
  {
10113
- "name": "multiSelectStencil",
10113
+ "name": "multiSelectInputStencil",
10114
10114
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx",
10115
10115
  "description": "",
10116
10116
  "declarations": [
10117
10117
  {
10118
- "name": "multiSelectStencil",
10118
+ "name": "multiSelectInputStencil",
10119
10119
  "filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx"
10120
10120
  }
10121
10121
  ],
@@ -10798,6 +10798,25 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
10798
10798
  }
10799
10799
  }
10800
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
+ },
10801
10820
  {
10802
10821
  "name": "useMultiSelectInput",
10803
10822
  "fileName": "/home/runner/work/canvas-kit/canvas-kit/modules/preview-react/multi-select/lib/MultiSelectInput.tsx",
@@ -10951,6 +10970,24 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
10951
10970
  "componentType": "subcomponent",
10952
10971
  "elemPropsHook": "useMultiSelectInput",
10953
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
+ },
10954
10991
  {
10955
10992
  "kind": "property",
10956
10993
  "name": "cs",
@@ -11118,6 +11155,24 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
11118
11155
  "componentType": "subcomponent",
11119
11156
  "elemPropsHook": "useMultiSelectInput",
11120
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
+ },
11121
11176
  {
11122
11177
  "kind": "property",
11123
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.10",
22
- "@workday/canvas-kit-preview-react": "12.6.10",
23
- "@workday/canvas-kit-react": "12.6.10",
24
- "@workday/canvas-kit-react-fonts": "^12.6.10",
25
- "@workday/canvas-kit-styling": "12.6.10",
21
+ "@workday/canvas-kit-labs-react": "12.6.12",
22
+ "@workday/canvas-kit-preview-react": "12.6.12",
23
+ "@workday/canvas-kit-react": "12.6.12",
24
+ "@workday/canvas-kit-react-fonts": "^12.6.12",
25
+ "@workday/canvas-kit-styling": "12.6.12",
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.10",
22
- "@workday/canvas-kit-preview-react": "12.6.10",
23
- "@workday/canvas-kit-react": "12.6.10",
24
- "@workday/canvas-kit-react-fonts": "^12.6.10",
25
- "@workday/canvas-kit-styling": "12.6.10",
21
+ "@workday/canvas-kit-labs-react": "12.6.12",
22
+ "@workday/canvas-kit-preview-react": "12.6.12",
23
+ "@workday/canvas-kit-react": "12.6.12",
24
+ "@workday/canvas-kit-react-fonts": "^12.6.12",
25
+ "@workday/canvas-kit-styling": "12.6.12",
26
26
  "@workday/canvas-system-icons-web": "3.0.22",
27
27
  "@workday/canvas-tokens-web": "2.0.0"
28
28
  },
@@ -7,6 +7,7 @@ import {
7
7
 
8
8
  import Basic from './examples/Basic';
9
9
  import Disabled from './examples/Disabled';
10
+ import Error from './examples/Error';
10
11
  import Complex from './examples/Complex';
11
12
  import Icons from './examples/Icons';
12
13
  import Controlled from './examples/Controlled';
@@ -60,6 +61,14 @@ Disabling `MultiSelect` involves passing the `disabled` prop to the `MultiSelect
60
61
 
61
62
  <ExampleCodeBlock code={Disabled} />
62
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} />
71
+
63
72
  ### Complex
64
73
 
65
74
  When registering items in an array of objects, it's common to have the text that is displayed to the
@@ -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.10",
3
+ "version": "12.6.12",
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.10",
49
- "@workday/canvas-kit-preview-react": "^12.6.10",
50
- "@workday/canvas-kit-react": "^12.6.10",
51
- "@workday/canvas-kit-styling": "^12.6.10",
48
+ "@workday/canvas-kit-labs-react": "^12.6.12",
49
+ "@workday/canvas-kit-preview-react": "^12.6.12",
50
+ "@workday/canvas-kit-react": "^12.6.12",
51
+ "@workday/canvas-kit-styling": "^12.6.12",
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": "e1242b1bb4b857e2132a89485c5dbc45f463690f"
64
+ "gitHead": "a8eaa7da896186d3ed4c093dccff6b2237b17b4b"
65
65
  }