@workday/canvas-kit-docs 14.0.0-alpha.1237-next.0 → 14.0.0-alpha.1238-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.
- package/dist/es6/lib/docs.js +18 -18
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +93 -0
- package/dist/mdx/7.0-UPGRADE-GUIDE.mdx +1 -1
- package/dist/mdx/preview-react/multi-select/examples/Error.tsx +1 -1
- package/dist/mdx/preview-react/radio/Radio.mdx +5 -5
- package/dist/mdx/preview-react/radio/examples/{Alert.tsx → Caution.tsx} +1 -1
- package/dist/mdx/preview-react/select/Select.mdx +3 -3
- package/dist/mdx/preview-react/select/examples/Left Label/AlertLeft.tsx +1 -1
- package/dist/mdx/preview-react/select/examples/Top Label/{Alert.tsx → Caution.tsx } +1 -1
- package/dist/mdx/preview-react/select/examples/Top Label/index.ts +1 -1
- package/dist/mdx/react/checkbox/Checkbox.mdx +7 -7
- package/dist/mdx/react/checkbox/examples/{Alert.tsx → Caution.tsx} +1 -1
- package/dist/mdx/react/color-picker/color-input/ColorInput.mdx +5 -5
- package/dist/mdx/react/color-picker/color-input/examples/{Alert.tsx → Caution.tsx} +1 -1
- package/dist/mdx/react/form-field/FormField.mdx +6 -6
- package/dist/mdx/react/form-field/examples/AllFields.tsx +1 -1
- package/dist/mdx/react/form-field/examples/{Alert.tsx → Caution.tsx} +1 -1
- package/dist/mdx/react/radio/Radio.mdx +5 -5
- package/dist/mdx/react/radio/examples/{Alert.tsx → Caution.tsx} +1 -1
- package/dist/mdx/react/select/Select.mdx +6 -6
- package/dist/mdx/react/select/examples/{Alert.tsx → Caution.tsx} +1 -1
- package/dist/mdx/react/switch/Switch.mdx +6 -6
- package/dist/mdx/react/switch/examples/{Alert.tsx → Caution.tsx} +1 -1
- package/dist/mdx/react/text-area/TextArea.mdx +6 -6
- package/dist/mdx/react/text-area/examples/{Alert.tsx → Caution.tsx} +1 -1
- package/dist/mdx/react/text-input/TextInput.mdx +6 -6
- package/dist/mdx/react/text-input/examples/{Alert.tsx → Caution.tsx} +1 -1
- package/package.json +6 -6
package/dist/es6/lib/docs.js
CHANGED
|
@@ -44318,7 +44318,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
44318
44318
|
]
|
|
44319
44319
|
},
|
|
44320
44320
|
"required": false,
|
|
44321
|
-
"description": "Use this attribute when you have a `FormField` that is in an `Alert` | `Error` or `Required` state. This will add attach an `aria-describedby` to each radio input so that screen readers can read out the message attached to the form field.\nThe value of this attribute needs to match the value passed to `hintId` on the `FormField`.\n\n```tsx\n<FormField\n error
|
|
44321
|
+
"description": "Use this attribute when you have a `FormField` that is in an `Alert` | `Error` or `Required` state. This will add attach an `aria-describedby` to each radio input so that screen readers can read out the message attached to the form field.\nThe value of this attribute needs to match the value passed to `hintId` on the `FormField`.\n\n```tsx\n<FormField\n error=\"caution\"\n hintId=\"hint-alert\"\n hintText=\"Deep dish is an extra $2.99\"\n label=\"Choose Your Pizza Crust\"\n useFieldset={true}\n >\n <RadioGroup\n name=\"crust\"\n onChange={handleChange}\n initialValue={value}\n aria-describedby=\"hint-alert\"\n >\n <RadioGroup.RadioButton value=\"deep-dish\">Deep dish</RadioGroup.RadioButton>\n <RadioGroup.RadioButton value=\"thin\">Thin</RadioGroup.RadioButton>\n <RadioGroup.RadioButton value=\"gluten-free\">Gluten free</RadioGroup.RadioButton>\n <RadioGroup.RadioButton value=\"cauliflower\">Cauliflower</RadioGroup.RadioButton>\n </RadioGroup>\n</FormField>\n```",
|
|
44322
44322
|
"declarations": [
|
|
44323
44323
|
{
|
|
44324
44324
|
"name": "aria-describedby",
|
|
@@ -44669,7 +44669,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
44669
44669
|
]
|
|
44670
44670
|
},
|
|
44671
44671
|
"required": false,
|
|
44672
|
-
"description": "Use this attribute when you have a `FormField` that is in an `Alert` | `Error` or `Required` state. This will add attach an `aria-describedby` to each radio input so that screen readers can read out the message attached to the form field.\nThe value of this attribute needs to match the value passed to `hintId` on the `FormField`.\n\n```tsx\n<FormField\n error
|
|
44672
|
+
"description": "Use this attribute when you have a `FormField` that is in an `Alert` | `Error` or `Required` state. This will add attach an `aria-describedby` to each radio input so that screen readers can read out the message attached to the form field.\nThe value of this attribute needs to match the value passed to `hintId` on the `FormField`.\n\n```tsx\n<FormField\n error=\"caution\"\n hintId=\"hint-alert\"\n hintText=\"Deep dish is an extra $2.99\"\n label=\"Choose Your Pizza Crust\"\n useFieldset={true}\n >\n <RadioGroup\n name=\"crust\"\n onChange={handleChange}\n initialValue={value}\n aria-describedby=\"hint-alert\"\n >\n <RadioGroup.RadioButton value=\"deep-dish\">Deep dish</RadioGroup.RadioButton>\n <RadioGroup.RadioButton value=\"thin\">Thin</RadioGroup.RadioButton>\n <RadioGroup.RadioButton value=\"gluten-free\">Gluten free</RadioGroup.RadioButton>\n <RadioGroup.RadioButton value=\"cauliflower\">Cauliflower</RadioGroup.RadioButton>\n </RadioGroup>\n</FormField>\n```",
|
|
44673
44673
|
"declarations": [
|
|
44674
44674
|
{
|
|
44675
44675
|
"name": "aria-describedby",
|
|
@@ -195888,10 +195888,10 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
195888
195888
|
},
|
|
195889
195889
|
{
|
|
195890
195890
|
"kind": "property",
|
|
195891
|
-
"name": "
|
|
195891
|
+
"name": "Caution",
|
|
195892
195892
|
"type": {
|
|
195893
195893
|
"kind": "string",
|
|
195894
|
-
"value": "
|
|
195894
|
+
"value": "caution"
|
|
195895
195895
|
}
|
|
195896
195896
|
}
|
|
195897
195897
|
],
|
|
@@ -221388,11 +221388,11 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
221388
221388
|
"value": [
|
|
221389
221389
|
{
|
|
221390
221390
|
"kind": "string",
|
|
221391
|
-
"value": "
|
|
221391
|
+
"value": "caution"
|
|
221392
221392
|
},
|
|
221393
221393
|
{
|
|
221394
221394
|
"kind": "string",
|
|
221395
|
-
"value": "
|
|
221395
|
+
"value": "error"
|
|
221396
221396
|
},
|
|
221397
221397
|
{
|
|
221398
221398
|
"kind": "primitive",
|
|
@@ -221522,11 +221522,11 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
221522
221522
|
"value": [
|
|
221523
221523
|
{
|
|
221524
221524
|
"kind": "string",
|
|
221525
|
-
"value": "
|
|
221525
|
+
"value": "caution"
|
|
221526
221526
|
},
|
|
221527
221527
|
{
|
|
221528
221528
|
"kind": "string",
|
|
221529
|
-
"value": "
|
|
221529
|
+
"value": "error"
|
|
221530
221530
|
},
|
|
221531
221531
|
{
|
|
221532
221532
|
"kind": "primitive",
|
|
@@ -221535,7 +221535,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
221535
221535
|
]
|
|
221536
221536
|
},
|
|
221537
221537
|
"required": false,
|
|
221538
|
-
"description": "Optional flag to denote if this field has an error or warning to display.\nIf value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added.\nIf value is `
|
|
221538
|
+
"description": "Optional flag to denote if this field has an error or warning to display.\nIf value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added.\nIf value is `cautiion`: A visual orange warning ring is added to the `FormField.Input`.",
|
|
221539
221539
|
"declarations": [
|
|
221540
221540
|
{
|
|
221541
221541
|
"name": "error",
|
|
@@ -221664,11 +221664,11 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
221664
221664
|
"value": [
|
|
221665
221665
|
{
|
|
221666
221666
|
"kind": "string",
|
|
221667
|
-
"value": "
|
|
221667
|
+
"value": "caution"
|
|
221668
221668
|
},
|
|
221669
221669
|
{
|
|
221670
221670
|
"kind": "string",
|
|
221671
|
-
"value": "
|
|
221671
|
+
"value": "error"
|
|
221672
221672
|
},
|
|
221673
221673
|
{
|
|
221674
221674
|
"kind": "primitive",
|
|
@@ -221677,7 +221677,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
221677
221677
|
]
|
|
221678
221678
|
},
|
|
221679
221679
|
"required": false,
|
|
221680
|
-
"description": "Optional flag to denote if this field has an error or warning to display.\nIf value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added.\nIf value is `
|
|
221680
|
+
"description": "Optional flag to denote if this field has an error or warning to display.\nIf value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added.\nIf value is `cautiion`: A visual orange warning ring is added to the `FormField.Input`.",
|
|
221681
221681
|
"declarations": [
|
|
221682
221682
|
{
|
|
221683
221683
|
"name": "error",
|
|
@@ -221764,11 +221764,11 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
221764
221764
|
"value": [
|
|
221765
221765
|
{
|
|
221766
221766
|
"kind": "string",
|
|
221767
|
-
"value": "
|
|
221767
|
+
"value": "caution"
|
|
221768
221768
|
},
|
|
221769
221769
|
{
|
|
221770
221770
|
"kind": "string",
|
|
221771
|
-
"value": "
|
|
221771
|
+
"value": "error"
|
|
221772
221772
|
},
|
|
221773
221773
|
{
|
|
221774
221774
|
"kind": "primitive",
|
|
@@ -221777,7 +221777,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
221777
221777
|
]
|
|
221778
221778
|
},
|
|
221779
221779
|
"required": false,
|
|
221780
|
-
"description": "Optional flag to denote if this field has an error or warning to display.\nIf value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added.\nIf value is `
|
|
221780
|
+
"description": "Optional flag to denote if this field has an error or warning to display.\nIf value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added.\nIf value is `cautiion`: A visual orange warning ring is added to the `FormField.Input`.",
|
|
221781
221781
|
"declarations": [
|
|
221782
221782
|
{
|
|
221783
221783
|
"name": "error",
|
|
@@ -221901,11 +221901,11 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
221901
221901
|
"value": [
|
|
221902
221902
|
{
|
|
221903
221903
|
"kind": "string",
|
|
221904
|
-
"value": "
|
|
221904
|
+
"value": "caution"
|
|
221905
221905
|
},
|
|
221906
221906
|
{
|
|
221907
221907
|
"kind": "string",
|
|
221908
|
-
"value": "
|
|
221908
|
+
"value": "error"
|
|
221909
221909
|
},
|
|
221910
221910
|
{
|
|
221911
221911
|
"kind": "primitive",
|
|
@@ -221914,7 +221914,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
221914
221914
|
]
|
|
221915
221915
|
},
|
|
221916
221916
|
"required": false,
|
|
221917
|
-
"description": "Optional flag to denote if this field has an error or warning to display.\nIf value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added.\nIf value is `
|
|
221917
|
+
"description": "Optional flag to denote if this field has an error or warning to display.\nIf value is `error`: `aria-invalid` is added to the `FormField.Input` and the red error ring is added.\nIf value is `cautiion`: A visual orange warning ring is added to the `FormField.Input`.",
|
|
221918
221918
|
"declarations": [
|
|
221919
221919
|
{
|
|
221920
221920
|
"name": "error",
|
|
@@ -8,6 +8,7 @@ any questions.
|
|
|
8
8
|
|
|
9
9
|
- [Codemod](#codemod)
|
|
10
10
|
- [Instructions](#instructions)
|
|
11
|
+
- [Caution Naming](#caution-naming)
|
|
11
12
|
- [Theming](#theming)
|
|
12
13
|
- [Canvas Provider](#canvas-provider-)
|
|
13
14
|
- [Component Updates](#component-updates)
|
|
@@ -104,6 +105,74 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
104
105
|
> after executing the codemod, as its resulting formatting (spacing, quotes, etc.) may not match
|
|
105
106
|
> your project conventions.
|
|
106
107
|
|
|
108
|
+
## Caution Naming
|
|
109
|
+
|
|
110
|
+
**PR:** [#3462](https://github.com/Workday/canvas-kit/pull/3462)
|
|
111
|
+
|
|
112
|
+
To better align with the brand refresh, Alert and Warning states are being renamed to Caution for better semantics.
|
|
113
|
+
|
|
114
|
+
This change mostly affects how you pass an error state to our input components. In most cases, our inputs components should be used with our `FormField` component to
|
|
115
|
+
ensure correct accessiblity.
|
|
116
|
+
|
|
117
|
+
**Before in v13**
|
|
118
|
+
|
|
119
|
+
```tsx
|
|
120
|
+
<FormField error="alert">
|
|
121
|
+
<FormField.Label>First Name</FormField.Label>
|
|
122
|
+
<FormField.Field>
|
|
123
|
+
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
124
|
+
<FormField.Hint>Cannot contain numbers</FormField.Hint>
|
|
125
|
+
</FormField.Field>
|
|
126
|
+
</FormField>
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
**After in v14**
|
|
130
|
+
|
|
131
|
+
```tsx
|
|
132
|
+
<FormField error="caution">
|
|
133
|
+
<FormField.Label>First Name</FormField.Label>
|
|
134
|
+
<FormField.Field>
|
|
135
|
+
<FormField.Input as={TextInput} value={value} onChange={handleChange} />
|
|
136
|
+
<FormField.Hint>Cannot contain numbers</FormField.Hint>
|
|
137
|
+
</FormField.Field>
|
|
138
|
+
</FormField>
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
If you are using the error type either from our `Common` package or the one exposed from the component, the naming as also changed.
|
|
142
|
+
|
|
143
|
+
**Before in v13**
|
|
144
|
+
|
|
145
|
+
```tsx
|
|
146
|
+
import {ErrorType} from '@workday/canvas-kit-react/common';
|
|
147
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
148
|
+
import {Switch} from '@workday/canvas-kit-react/switch';
|
|
149
|
+
import {TextArea} from '@workday/canvas-kit-react/text-area';
|
|
150
|
+
|
|
151
|
+
someFunction(ErrorType.Alert);
|
|
152
|
+
|
|
153
|
+
<TextInput error={TextInput.ErrorType.Alert} />
|
|
154
|
+
<Switch error={Switch.ErrorType.Alert} />
|
|
155
|
+
<TextArea error={TextArea.ErrorType.Alert} />
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
**After in v14**
|
|
159
|
+
|
|
160
|
+
```tsx
|
|
161
|
+
import {ErrorType} from '@workday/canvas-kit-react/common';
|
|
162
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
163
|
+
import {Switch} from '@workday/canvas-kit-react/switch';
|
|
164
|
+
import {TextArea} from '@workday/canvas-kit-react/text-area';
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
someFunction(ErrorType.Caution);
|
|
168
|
+
|
|
169
|
+
<TextInput error={TextInput.ErrorType.Caution} />
|
|
170
|
+
<Switch error={Switch.ErrorType.Caution} />
|
|
171
|
+
<TextArea error={TextArea.ErrorType.Caution} />
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
> 🤖 The codemod will handle the change of `ErrorType.Alert` to `ErrorType.Caution` and `error="alert"` to `error="caution"`.
|
|
175
|
+
|
|
107
176
|
## Theming
|
|
108
177
|
|
|
109
178
|
### Canvas Provider 🚨
|
|
@@ -209,6 +278,28 @@ matches our brand refresh.
|
|
|
209
278
|
- `extraSmall`
|
|
210
279
|
- `extraExtraSmall`
|
|
211
280
|
|
|
281
|
+
**Avatar in Main**
|
|
282
|
+
|
|
283
|
+
```tsx
|
|
284
|
+
import { Avatar } from '@workday/canvas-kit-react/avatar';
|
|
285
|
+
|
|
286
|
+
<Avatar altText="John Doe" size="extraExtraLarge" variant="light" as="div" url={yourImageUrl} />
|
|
287
|
+
|
|
288
|
+
// For Avatars that where buttons
|
|
289
|
+
<Avatar altText="John Doe" size="extraExtraLarge" variant="dark" url={yourImageUrl} />
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**Avatar in Preview**
|
|
293
|
+
|
|
294
|
+
```tsx
|
|
295
|
+
import { Avatar } from '@workday/canvas-kit-preview-react/avatar';
|
|
296
|
+
|
|
297
|
+
<Avatar name="John Doe" size="extraExtraLarge" variant="blue" />
|
|
298
|
+
|
|
299
|
+
// Preferred Initials
|
|
300
|
+
<Avatar name="Julian Doe Smith" size="extraExtraLarge" variant="blue" preferredInitials="JS" />
|
|
301
|
+
```
|
|
302
|
+
|
|
212
303
|
### Branding Changes 💅
|
|
213
304
|
|
|
214
305
|
Several components have been refactored to reflect our new brand direction. Most of these changes
|
|
@@ -240,6 +331,8 @@ The `TertiaryButton` component no longer supports the `isThemable` prop. To cust
|
|
|
240
331
|
of `TertiaryButton`, use the `cs` prop for custom styles or the `colors` prop for palette-based
|
|
241
332
|
color overrides.
|
|
242
333
|
|
|
334
|
+
|
|
335
|
+
|
|
243
336
|
The shape of `TertiaryButton` has changed to have rounded corners, aligning with other buttons and
|
|
244
337
|
our new brand direction.
|
|
245
338
|
|
|
@@ -541,7 +541,7 @@ module; it supports [ref forwarding](https://reactjs.org/docs/forwarding-refs.ht
|
|
|
541
541
|
The `variant` prop (which previously accepted `Banner.Variant.Full` or `Banner.Variant.Sticky`) has
|
|
542
542
|
been converted to the boolean `isSticky` prop on the container `Banner` component.
|
|
543
543
|
|
|
544
|
-
Similarly, the `error` prop (which previously accepted `Banner.ErrorType.
|
|
544
|
+
Similarly, the `error` prop (which previously accepted `Banner.ErrorType.Caution` or
|
|
545
545
|
`Banner.ErrorType.Error`) has been converted to the boolean `hasError` prop on `Banner`. `Banner`
|
|
546
546
|
now uses the `useThemedPalette` hook which allows you to override its colors using the Canvas theme.
|
|
547
547
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
2
|
|
|
3
3
|
import Basic from './examples/Basic';
|
|
4
|
-
import
|
|
4
|
+
import Caution from './examples/Caution';
|
|
5
5
|
import Error from './examples/Error';
|
|
6
6
|
import Inverse from './examples/Inverse';
|
|
7
7
|
import LabelPosition from './examples/LabelPosition';
|
|
@@ -110,18 +110,18 @@ some behavior handled for you.
|
|
|
110
110
|
|
|
111
111
|
### Error States
|
|
112
112
|
|
|
113
|
-
Set the error prop of the wrapping `FormField` to `
|
|
114
|
-
`
|
|
113
|
+
Set the `error` prop of the wrapping `FormField` to `"caution"` or
|
|
114
|
+
`"error"` to set the `RadioGroup` to the alert or error state, respectively. You
|
|
115
115
|
will also need to set the `hintId` and `hintText` props on the `FormField` to meet accessibility
|
|
116
116
|
standards. You must set an `aria-describedby` attribute on the `RadioGroup` element that matches the
|
|
117
117
|
value of `hintId` set on the `FormField` element. These attributes ensure that the alert message is
|
|
118
118
|
associated to the `RadioGroup` and read out by voiceover.
|
|
119
119
|
|
|
120
|
-
####
|
|
120
|
+
#### Caution
|
|
121
121
|
|
|
122
122
|
Use the alert state when a selection is valid but there is additional information.
|
|
123
123
|
|
|
124
|
-
<ExampleCodeBlock code={
|
|
124
|
+
<ExampleCodeBlock code={Caution} />
|
|
125
125
|
|
|
126
126
|
#### Error
|
|
127
127
|
|
|
@@ -13,7 +13,7 @@ export default () => {
|
|
|
13
13
|
};
|
|
14
14
|
|
|
15
15
|
return (
|
|
16
|
-
<FormFieldGroup error="
|
|
16
|
+
<FormFieldGroup error="caution" id="hint-alert">
|
|
17
17
|
<FormFieldGroup.Label>Choose Your Pizza Crust</FormFieldGroup.Label>
|
|
18
18
|
<FormFieldGroup.Field>
|
|
19
19
|
<FormFieldGroup.List
|
|
@@ -10,7 +10,7 @@ import DefaultWithCustomOptions from './examples/Top Label/DefaultWithCustomOpti
|
|
|
10
10
|
import DefaultWithSimpleOptions from './examples/Top Label/DefaultWithSimpleOptions';
|
|
11
11
|
import Scrollable from './examples/Top Label/Scrollable';
|
|
12
12
|
import Disabled from './examples/Top Label/Disabled';
|
|
13
|
-
import
|
|
13
|
+
import Caution from './examples/Top Label/Caution';
|
|
14
14
|
import Error from './examples/Top Label/Error';
|
|
15
15
|
import Grow from './examples/Top Label/Grow';
|
|
16
16
|
import DefaultLeft from './examples/Left Label/DefaultLeft';
|
|
@@ -62,7 +62,7 @@ import GrowLeft from './examples/Left Label/GrowLeft';
|
|
|
62
62
|
|
|
63
63
|
### Alert
|
|
64
64
|
|
|
65
|
-
<ExampleCodeBlock code={
|
|
65
|
+
<ExampleCodeBlock code={Caution} />
|
|
66
66
|
|
|
67
67
|
### Error
|
|
68
68
|
|
|
@@ -96,7 +96,7 @@ import GrowLeft from './examples/Left Label/GrowLeft';
|
|
|
96
96
|
|
|
97
97
|
### Alert
|
|
98
98
|
|
|
99
|
-
<ExampleCodeBlock code={
|
|
99
|
+
<ExampleCodeBlock code={CautionLeft} />
|
|
100
100
|
|
|
101
101
|
### Error
|
|
102
102
|
|
|
@@ -7,7 +7,7 @@ import {controlComponent} from '../../../../../../utils/storybook';
|
|
|
7
7
|
|
|
8
8
|
export default () => {
|
|
9
9
|
return (
|
|
10
|
-
<FormField orientation="horizontalStart" id="select-alert" error="
|
|
10
|
+
<FormField orientation="horizontalStart" id="select-alert" error="caution">
|
|
11
11
|
<FormField.Label>Label</FormField.Label>
|
|
12
12
|
<FormField.Field>
|
|
13
13
|
{controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
|
|
@@ -5,7 +5,7 @@ import {controlComponent} from '../../../../../../utils/storybook';
|
|
|
5
5
|
|
|
6
6
|
export default () => {
|
|
7
7
|
return (
|
|
8
|
-
<FormField id="select-alert" error="
|
|
8
|
+
<FormField id="select-alert" error="caution">
|
|
9
9
|
<FormField.Label>Label</FormField.Label>
|
|
10
10
|
<FormField.Field>
|
|
11
11
|
{controlComponent(<FormField.Input as={Select} name="contact" options={options} />)}
|
|
@@ -3,6 +3,6 @@ export {DefaultWithCustomOptions} from './DefaultWithCustomOptions';
|
|
|
3
3
|
export {DefaultWithSimpleOptions} from './DefaultWithSimpleOptions';
|
|
4
4
|
export {Scrollable} from './Scrollable';
|
|
5
5
|
export {Disabled} from './Disabled';
|
|
6
|
-
export {
|
|
6
|
+
export {Caution} from './Caution';
|
|
7
7
|
export {Error} from './Error';
|
|
8
8
|
export {Grow} from './Grow';
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
Specifications,
|
|
5
5
|
InformationHighlight,
|
|
6
6
|
} from '@workday/canvas-kit-docs';
|
|
7
|
-
import
|
|
7
|
+
import Caution from './examples/Caution';
|
|
8
8
|
import Basic from './examples/Basic';
|
|
9
9
|
import Inverse from './examples/Inverse';
|
|
10
10
|
import Disabled from './examples/Disabled';
|
|
@@ -84,18 +84,18 @@ Labels for required fields are suffixed by a red asterisk.
|
|
|
84
84
|
|
|
85
85
|
### Error States
|
|
86
86
|
|
|
87
|
-
Set the `error` prop of the wrapping Form Field to `
|
|
88
|
-
`
|
|
87
|
+
Set the `error` prop of the wrapping Form Field to `"caution"` or
|
|
88
|
+
`"error"` to set the Checkbox to the Alert or Error state, respectively. You will
|
|
89
89
|
also need to set the `hintId` and `hintText` props on the Form Field to meet accessibility
|
|
90
90
|
standards. You may wish to omit the `label` prop on the Form Field given that Checkbox already
|
|
91
91
|
includes a label.
|
|
92
92
|
|
|
93
|
-
The `error` prop may be applied directly to the Checkbox with a value of `
|
|
94
|
-
or `
|
|
93
|
+
The `error` prop may be applied directly to the Checkbox with a value of `"caution"`
|
|
94
|
+
or `"error"` if Form Field is not being used.
|
|
95
95
|
|
|
96
|
-
####
|
|
96
|
+
#### Caution
|
|
97
97
|
|
|
98
|
-
<ExampleCodeBlock code={
|
|
98
|
+
<ExampleCodeBlock code={Caution} />
|
|
99
99
|
|
|
100
100
|
#### Error
|
|
101
101
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
SymbolDoc,
|
|
5
5
|
Specifications,
|
|
6
6
|
} from '@workday/canvas-kit-docs';
|
|
7
|
-
import
|
|
7
|
+
import Caution from './examples/Caution';
|
|
8
8
|
import Basic from './examples/Basic';
|
|
9
9
|
import Checked from './examples/Checked';
|
|
10
10
|
import Disabled from './examples/Disabled';
|
|
@@ -90,14 +90,14 @@ Labels for required fields are suffixed by a red asterisk.
|
|
|
90
90
|
|
|
91
91
|
### Error States
|
|
92
92
|
|
|
93
|
-
Set the `error` prop of the wrapping Form Field to `
|
|
94
|
-
`
|
|
93
|
+
Set the `error` prop of the wrapping Form Field to `"caution"` or
|
|
94
|
+
`"error"` to set the Color Input to the Caution or Error state, respectively. You
|
|
95
95
|
will also need to set the `hintId` and `hintText` props on the Form Field to meet accessibility
|
|
96
96
|
standards.
|
|
97
97
|
|
|
98
|
-
####
|
|
98
|
+
#### Caution
|
|
99
99
|
|
|
100
|
-
<ExampleCodeBlock code={
|
|
100
|
+
<ExampleCodeBlock code={Caution} />
|
|
101
101
|
|
|
102
102
|
#### Error
|
|
103
103
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ExampleCodeBlock, Specifications, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/Basic';
|
|
3
|
-
import
|
|
3
|
+
import Caution from './examples/Caution';
|
|
4
4
|
import Error from './examples/Error';
|
|
5
5
|
import Disabled from './examples/Disabled';
|
|
6
6
|
import HiddenLabel from './examples/HiddenLabel';
|
|
@@ -79,13 +79,13 @@ accessibility standards. The orientation of the label by default is `vertical`.
|
|
|
79
79
|
Set the `error` prop of the Form Field or define it in the model to indicate it has an error.
|
|
80
80
|
`error` accepts the following values:
|
|
81
81
|
|
|
82
|
-
`"error" | "
|
|
82
|
+
`"error" | "caution" | undefined`
|
|
83
83
|
|
|
84
|
-
###
|
|
84
|
+
### Caution
|
|
85
85
|
|
|
86
|
-
Use the
|
|
86
|
+
Use the caution state when a value is valid but there is additional information.
|
|
87
87
|
|
|
88
|
-
<ExampleCodeBlock code={
|
|
88
|
+
<ExampleCodeBlock code={Caution} />
|
|
89
89
|
|
|
90
90
|
### Error
|
|
91
91
|
|
|
@@ -155,7 +155,7 @@ accessibility of grouped inputs.
|
|
|
155
155
|
|
|
156
156
|
`FormFieldGroup` supports the same props of `FormField`:
|
|
157
157
|
|
|
158
|
-
- `error`: `"
|
|
158
|
+
- `error`: `"caution" | "error"` Defines the error around the whole group of inputs.
|
|
159
159
|
- `orientation`: `"horizontal" | "vertical"` Defines the legend placement.
|
|
160
160
|
- `isRequired`: `true` Defines if a group like RadioGroup is required.
|
|
161
161
|
|
|
@@ -27,7 +27,7 @@ export default () => {
|
|
|
27
27
|
</FormField.Field>
|
|
28
28
|
</FormField>
|
|
29
29
|
|
|
30
|
-
<FormField isRequired={true} error="
|
|
30
|
+
<FormField isRequired={true} error="caution" grow>
|
|
31
31
|
<FormField.Label>Email</FormField.Label>
|
|
32
32
|
<FormField.Field>
|
|
33
33
|
<FormField.Input as={TextInput} />
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
|
|
8
8
|
import {InformationHighlight} from '@workday/canvas-kit-preview-react/information-highlight';
|
|
9
9
|
|
|
10
|
-
import
|
|
10
|
+
import Caution from './examples/Caution';
|
|
11
11
|
import Basic from './examples/Basic';
|
|
12
12
|
import Disabled from './examples/Disabled';
|
|
13
13
|
import Inverse from './examples/Inverse';
|
|
@@ -96,14 +96,14 @@ Labels for required fields are suffixed by a red asterisk.
|
|
|
96
96
|
|
|
97
97
|
### Error States
|
|
98
98
|
|
|
99
|
-
Set the `error` prop of the wrapping Form Field to `
|
|
100
|
-
`
|
|
99
|
+
Set the `error` prop of the wrapping Form Field to `"caution"` or
|
|
100
|
+
`"error"` to set the Radio Group to the Caution or Error state, respectively. You
|
|
101
101
|
will also need to set the `hintId` and `hintText` props on the Form Field to meet accessibility
|
|
102
102
|
standards.
|
|
103
103
|
|
|
104
|
-
####
|
|
104
|
+
#### Caution
|
|
105
105
|
|
|
106
|
-
<ExampleCodeBlock code={
|
|
106
|
+
<ExampleCodeBlock code={Caution} />
|
|
107
107
|
|
|
108
108
|
#### Error
|
|
109
109
|
|
|
@@ -11,7 +11,7 @@ export default () => {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
return (
|
|
14
|
-
<FormField error="
|
|
14
|
+
<FormField error="caution" as="fieldset">
|
|
15
15
|
<FormField.Label as="legend">Choose Your Pizza Crust</FormField.Label>
|
|
16
16
|
<FormField.Input as={RadioGroup} name={useUniqueId()} onChange={handleChange} value={value}>
|
|
17
17
|
<Radio label="Deep dish" value="deep-dish" />
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
SymbolDoc,
|
|
5
5
|
Specifications,
|
|
6
6
|
} from '@workday/canvas-kit-docs';
|
|
7
|
-
import
|
|
7
|
+
import Caution from './examples/Caution';
|
|
8
8
|
import Basic from './examples/Basic';
|
|
9
9
|
import Complex from './examples/Complex';
|
|
10
10
|
import Controlled from './examples/Controlled';
|
|
@@ -166,11 +166,11 @@ forward `ref` to its underlying `<input type="text" role="combobox">` element.
|
|
|
166
166
|
|
|
167
167
|
### Error States
|
|
168
168
|
|
|
169
|
-
Set the `error` prop of the wrapping `FormField` to `
|
|
170
|
-
`
|
|
169
|
+
Set the `error` prop of the wrapping `FormField` to `"caution"` or
|
|
170
|
+
`"error"` to set the `Select` to the caution or error state, respectively. You will
|
|
171
171
|
also need to set the `hintId` and `hintText` props on the `FormField` to meet accessibility
|
|
172
172
|
standards. You must set an `id` attribute on the `Select.Input` element that matches the value of
|
|
173
|
-
`inputId` set on the `FormField` element. These attributes ensure that the
|
|
173
|
+
`inputId` set on the `FormField` element. These attributes ensure that the caution message is
|
|
174
174
|
associated to the `Select` and read out by voiceover.
|
|
175
175
|
|
|
176
176
|
**Note: The Select container component, `Select`, must wrap `FormField` to ensure `Select.Input` is
|
|
@@ -185,11 +185,11 @@ styled correctly.**
|
|
|
185
185
|
</Select>
|
|
186
186
|
```
|
|
187
187
|
|
|
188
|
-
####
|
|
188
|
+
#### Caution
|
|
189
189
|
|
|
190
190
|
Use the alert state when a selection is valid but there is additional information.
|
|
191
191
|
|
|
192
|
-
<ExampleCodeBlock code={
|
|
192
|
+
<ExampleCodeBlock code={Caution} />
|
|
193
193
|
|
|
194
194
|
#### Error
|
|
195
195
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
Specifications,
|
|
5
5
|
InformationHighlight,
|
|
6
6
|
} from '@workday/canvas-kit-docs';
|
|
7
|
-
import
|
|
7
|
+
import Caution from './examples/Caution';
|
|
8
8
|
import Basic from './examples/Basic';
|
|
9
9
|
import Disabled from './examples/Disabled';
|
|
10
10
|
import Error from './examples/Error';
|
|
@@ -54,17 +54,17 @@ input component. By default, the orientation will be set to `vertical`.
|
|
|
54
54
|
|
|
55
55
|
### Error States
|
|
56
56
|
|
|
57
|
-
Set the `error` prop of the wrapping Form Field to `
|
|
58
|
-
`
|
|
57
|
+
Set the `error` prop of the wrapping Form Field to `"caution"` or
|
|
58
|
+
`"error"` to set the Switch to the Caution or Error state, respectively. You will
|
|
59
59
|
also need to set the `hintId` and `hintText` props on the Form Field to meet accessibility
|
|
60
60
|
standards.
|
|
61
61
|
|
|
62
|
-
The `error` prop may be applied directly to the Switch with a value of `Switch.ErrorType.
|
|
62
|
+
The `error` prop may be applied directly to the Switch with a value of `Switch.ErrorType.Caution` or
|
|
63
63
|
`Switch.ErrorType.Error` if Form Field is not being used.
|
|
64
64
|
|
|
65
|
-
####
|
|
65
|
+
#### Caution
|
|
66
66
|
|
|
67
|
-
<ExampleCodeBlock code={
|
|
67
|
+
<ExampleCodeBlock code={Caution} />
|
|
68
68
|
|
|
69
69
|
#### Error
|
|
70
70
|
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
Specifications,
|
|
5
5
|
InformationHighlight,
|
|
6
6
|
} from '@workday/canvas-kit-docs';
|
|
7
|
-
import
|
|
7
|
+
import Caution from './examples/Caution';
|
|
8
8
|
import Basic from './examples/Basic';
|
|
9
9
|
import Disabled from './examples/Disabled';
|
|
10
10
|
import Error from './examples/Error';
|
|
@@ -91,17 +91,17 @@ Labels for required fields are suffixed by a red asterisk.
|
|
|
91
91
|
|
|
92
92
|
### Error States
|
|
93
93
|
|
|
94
|
-
Set the `error` prop of the wrapping Form Field to `
|
|
95
|
-
`
|
|
94
|
+
Set the `error` prop of the wrapping Form Field to `"caution"` or
|
|
95
|
+
`"error"` to set the Text Area to the Caution or Error state, respectively. You will
|
|
96
96
|
also need to set the `hintId` and `hintText` props on the Form Field to meet accessibility
|
|
97
97
|
standards.
|
|
98
98
|
|
|
99
|
-
The `error` prop may be applied directly to the Text Area with a value of `TextArea.ErrorType.
|
|
99
|
+
The `error` prop may be applied directly to the Text Area with a value of `"TextArea.ErrorType.Caution"`
|
|
100
100
|
or `TextArea.ErrorType.Error` if Form Field is not being used.
|
|
101
101
|
|
|
102
|
-
####
|
|
102
|
+
#### Caution
|
|
103
103
|
|
|
104
|
-
<ExampleCodeBlock code={
|
|
104
|
+
<ExampleCodeBlock code={Caution} />
|
|
105
105
|
|
|
106
106
|
#### Error
|
|
107
107
|
|
|
@@ -10,7 +10,7 @@ export default () => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
return (
|
|
13
|
-
<FormField error="
|
|
13
|
+
<FormField error="caution">
|
|
14
14
|
<FormField.Label>Please enter your review.</FormField.Label>
|
|
15
15
|
<FormField.Field>
|
|
16
16
|
<FormField.Input as={TextArea} onChange={handleChange} value={value} />
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
SymbolDoc,
|
|
5
5
|
Specifications,
|
|
6
6
|
} from '@workday/canvas-kit-docs';
|
|
7
|
-
import
|
|
7
|
+
import Caution from './examples/Caution';
|
|
8
8
|
import Basic from './examples/Basic';
|
|
9
9
|
import Disabled from './examples/Disabled';
|
|
10
10
|
import Error from './examples/Error';
|
|
@@ -99,17 +99,17 @@ method to change width. The `width` prop is used to correctly position other inn
|
|
|
99
99
|
|
|
100
100
|
### Error States
|
|
101
101
|
|
|
102
|
-
Set the `error` prop of the wrapping Form Field to `
|
|
103
|
-
`
|
|
102
|
+
Set the `error` prop of the wrapping Form Field to `"caution"` or
|
|
103
|
+
`"error"` to set the Text Input to the Caution or Error state, respectively. You
|
|
104
104
|
will also need to set the `hintId` and `hintText` props on the Form Field to meet accessibility
|
|
105
105
|
standards.
|
|
106
106
|
|
|
107
107
|
The `error` prop may be applied directly to the Text Input with a value of
|
|
108
|
-
`TextInput.ErrorType.
|
|
108
|
+
`TextInput.ErrorType.Caution` or `TextInput.ErrorType.Error` if Form Field is not being used.
|
|
109
109
|
|
|
110
|
-
####
|
|
110
|
+
#### Caution
|
|
111
111
|
|
|
112
|
-
<ExampleCodeBlock code={
|
|
112
|
+
<ExampleCodeBlock code={Caution} />
|
|
113
113
|
|
|
114
114
|
#### Error
|
|
115
115
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.1238-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.
|
|
49
|
-
"@workday/canvas-kit-preview-react": "^14.0.0-alpha.
|
|
50
|
-
"@workday/canvas-kit-react": "^14.0.0-alpha.
|
|
51
|
-
"@workday/canvas-kit-styling": "^14.0.0-alpha.
|
|
48
|
+
"@workday/canvas-kit-labs-react": "^14.0.0-alpha.1238-next.0",
|
|
49
|
+
"@workday/canvas-kit-preview-react": "^14.0.0-alpha.1238-next.0",
|
|
50
|
+
"@workday/canvas-kit-react": "^14.0.0-alpha.1238-next.0",
|
|
51
|
+
"@workday/canvas-kit-styling": "^14.0.0-alpha.1238-next.0",
|
|
52
52
|
"@workday/canvas-system-icons-web": "^3.0.35",
|
|
53
53
|
"@workday/canvas-tokens-web": "3.0.0-alpha.12",
|
|
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": "ddfa0ae8c1be2e17cd6133b84fa8a76825267f5b"
|
|
65
65
|
}
|