@workday/canvas-kit-docs 14.0.0-alpha.1126-next.0 → 14.0.0-alpha.1129-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.
@@ -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.4",
22
- "@workday/canvas-kit-preview-react": "13.0.4",
23
- "@workday/canvas-kit-react": "13.0.4",
24
- "@workday/canvas-kit-react-fonts": "^13.0.4",
25
- "@workday/canvas-kit-styling": "13.0.4",
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.4",
22
- "@workday/canvas-kit-preview-react": "13.0.4",
23
- "@workday/canvas-kit-react": "13.0.4",
24
- "@workday/canvas-kit-react-fonts": "^13.0.4",
25
- "@workday/canvas-kit-styling": "13.0.4",
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
  },
@@ -4,13 +4,12 @@ This guide contains an overview of the changes in Canvas Kit v14. Please
4
4
  [reach out](https://github.com/Workday/canvas-kit/issues/new?labels=bug&template=bug.md) if you have
5
5
  any questions.
6
6
 
7
-
8
7
  ## Table of contents
9
8
 
10
9
  - [Codemod](#codemod)
11
10
  - [Instructions](#instructions)
12
11
  - [Component Updates](#component-updates)
13
- - [Styling API and CSS Tokens](#styling-api-and-css-tokens)
12
+ - [Styling API and CSS Tokens](#styling-api-and-css-tokens)
14
13
  - [Troubleshooting](#troubleshooting)
15
14
  - [Glossary](#glossary)
16
15
  - [Main](#main)
@@ -79,15 +78,20 @@ yarn remove @workday/canvas-kit-codemod
79
78
  > your project conventions.
80
79
 
81
80
  ## Styling API and Canvas Tokens 💅
82
- Several components have been refactored to use our Canvas tokens and styling API. The React interface has not changed, but Canvas Tokens are now used for dynamic properties.
83
81
 
84
- > **Note:** These components also support our cs prop for styling. Learn more about styling with cs in our documentation.
82
+ Several components have been refactored to use our Canvas tokens and styling API. The React
83
+ interface has not changed, but Canvas Tokens are now used for dynamic properties.
84
+
85
+ > **Note:** These components also support our cs prop for styling. Learn more about styling with cs
86
+ > in our documentation.
85
87
 
86
88
  The following components have been updated:
87
89
 
88
90
  - `Breadcrumbs` [#3270](https://github.com/Workday/canvas-kit/pull/3270)
89
91
  - `SegmentedControl` (main) [#3278](https://github.com/Workday/canvas-kit/pull/3278)
90
92
  - `SegmentedControl` (preview) [#3278](https://github.com/Workday/canvas-kit/pull/3278)
93
+ - `ToolbarDropdownButton` [#3293](https://github.com/Workday/canvas-kit/pull/3293)
94
+ - `ToolbarIconButton` [#3293](https://github.com/Workday/canvas-kit/pull/3293)
91
95
 
92
96
  ## Troubleshooting
93
97
 
@@ -105,4 +109,5 @@ The following components have been updated:
105
109
 
106
110
  ## Glossary
107
111
 
108
- For an overview of the different packages we provide, plase view our docs [here](https://workday.github.io/canvas-kit/?path=/docs/guides-packages--docs).
112
+ For an overview of the different packages we provide, plase view our docs
113
+ [here](https://workday.github.io/canvas-kit/?path=/docs/guides-packages--docs).
@@ -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="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": "14.0.0-alpha.1126-next.0",
3
+ "version": "14.0.0-alpha.1129-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",
@@ -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": "^14.0.0-alpha.1126-next.0",
49
- "@workday/canvas-kit-preview-react": "^14.0.0-alpha.1126-next.0",
50
- "@workday/canvas-kit-react": "^14.0.0-alpha.1126-next.0",
51
- "@workday/canvas-kit-styling": "^14.0.0-alpha.1126-next.0",
48
+ "@workday/canvas-kit-labs-react": "^14.0.0-alpha.1129-next.0",
49
+ "@workday/canvas-kit-preview-react": "^14.0.0-alpha.1129-next.0",
50
+ "@workday/canvas-kit-react": "^14.0.0-alpha.1129-next.0",
51
+ "@workday/canvas-kit-styling": "^14.0.0-alpha.1129-next.0",
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": "5420bd738ba9800e4443d4ec6103df51634529e9"
64
+ "gitHead": "27f7b4b0b968875921295a1640e043018e8a0716"
65
65
  }