@workday/canvas-kit-docs 14.0.0-alpha.1230-next.0 → 14.0.0-alpha.1233-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 +25 -911
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +78 -32
- package/dist/mdx/labs-react/combobox/Combobox.mdx +1 -1
- package/dist/mdx/labs-react/search-form/SearchForm.mdx +14 -2
- package/dist/mdx/preview-react/_examples/mdx/examples/TextInputWithFormik.tsx +35 -28
- package/dist/mdx/preview-react/_examples/mdx/examples/TextInputWithReactHookForm.tsx +27 -21
- package/dist/mdx/react/_examples/mdx/examples/common/FilterListWithLiveStatus.tsx +8 -5
- package/dist/mdx/react/_examples/mdx/examples/common/HiddenLiveRegion.tsx +8 -5
- package/dist/mdx/react/_examples/mdx/examples/common/TextInputWithLiveError.tsx +11 -8
- package/dist/mdx/react/_examples/mdx/examples/common/VisibleLiveRegion.tsx +9 -5
- package/package.json +6 -6
- package/dist/mdx/preview-react/text-area/TextArea.mdx +0 -136
- package/dist/mdx/preview-react/text-area/examples/Alert.tsx +0 -35
- package/dist/mdx/preview-react/text-area/examples/Basic.tsx +0 -17
- package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +0 -17
- package/dist/mdx/preview-react/text-area/examples/Error.tsx +0 -40
- package/dist/mdx/preview-react/text-area/examples/Grow.tsx +0 -17
- package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +0 -22
- package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +0 -17
- package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +0 -17
- package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +0 -17
- package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +0 -28
- package/dist/mdx/preview-react/text-area/examples/Required.tsx +0 -17
- package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +0 -22
- package/dist/mdx/preview-react/text-input/TextInput.mdx +0 -170
- package/dist/mdx/preview-react/text-input/examples/Alert.tsx +0 -33
- package/dist/mdx/preview-react/text-input/examples/Basic.tsx +0 -17
- package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +0 -17
- package/dist/mdx/preview-react/text-input/examples/Error.tsx +0 -40
- package/dist/mdx/preview-react/text-input/examples/Grow.tsx +0 -17
- package/dist/mdx/preview-react/text-input/examples/Hidden.tsx +0 -11
- package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +0 -22
- package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +0 -17
- package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +0 -17
- package/dist/mdx/preview-react/text-input/examples/Password.tsx +0 -17
- package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +0 -17
- package/dist/mdx/preview-react/text-input/examples/ReadOnly.tsx +0 -17
- package/dist/mdx/preview-react/text-input/examples/RefForwarding.tsx +0 -28
- package/dist/mdx/preview-react/text-input/examples/Required.tsx +0 -17
- package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +0 -51
- package/dist/mdx/preview-react/text-input/examples/ThemedError.tsx +0 -40
- package/dist/mdx/react/_examples/mdx/SearchForm.mdx +0 -19
- package/dist/mdx/react/_examples/mdx/examples/SearchFormBasic.tsx +0 -35
|
@@ -26,6 +26,7 @@ any questions.
|
|
|
26
26
|
- [Avatar in Main](#avatar-in-main)
|
|
27
27
|
- [Combobox (Labs)](#combobox-labs)
|
|
28
28
|
- [Radio (Main)](#radio-main)
|
|
29
|
+
- [SearchForm (Labs)](#search-form-labs)
|
|
29
30
|
- [Segmented Control (Main)](#segmented-control-main)
|
|
30
31
|
- [Side Panel (Main)](#side-panel-main)
|
|
31
32
|
- [Tokens](#tokens)
|
|
@@ -34,6 +35,8 @@ any questions.
|
|
|
34
35
|
- [Input Provider](#input-provider)
|
|
35
36
|
- [Menu (preview)](#menu-preview)
|
|
36
37
|
- [readyOnlyPillStencil and removeablePillStencil](readyOnlyPillStencil-and-removeablePillStencil)
|
|
38
|
+
- [Text Area](#text-area)
|
|
39
|
+
- [Text Input](#text-input)
|
|
37
40
|
- [Troubleshooting](#troubleshooting)
|
|
38
41
|
- [Glossary](#glossary)
|
|
39
42
|
- [Main](#main)
|
|
@@ -105,42 +108,48 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
105
108
|
|
|
106
109
|
### Canvas Provider 🚨
|
|
107
110
|
|
|
108
|
-
**PRs:** [#3407](https://github.com/Workday/canvas-kit/pull/3407),
|
|
111
|
+
**PRs:** [#3407](https://github.com/Workday/canvas-kit/pull/3407),
|
|
112
|
+
[#3394](https://github.com/Workday/canvas-kit/pull/3394)
|
|
109
113
|
|
|
110
114
|
- `CanvasThemePalette` and `CanvasTheme` type have been updated to include a `lighter` property.
|
|
111
115
|
- `CanvasProvider` `theme` prop has been updated to include a `lighter` color for each palette.
|
|
112
116
|
|
|
113
117
|
#### Breaking Changes
|
|
114
118
|
|
|
115
|
-
Canvas Provider has been updated to **remove** default branding colors to ensure proper cascading of
|
|
119
|
+
Canvas Provider has been updated to **remove** default branding colors to ensure proper cascading of
|
|
120
|
+
our CSS variables. Instead of generating a palette and shifting the brightness and darkness with
|
|
121
|
+
`chroma.js`, we use `oklch` to generate the palette colors.
|
|
116
122
|
|
|
117
|
-
**Before in v13**
|
|
118
|
-
|
|
123
|
+
**Before in v13** In v13, the `useTheme` hook would call `createCanvasTheme` which generated a
|
|
124
|
+
palette given a `main` color via `chroma.js`.
|
|
119
125
|
|
|
120
126
|
```tsx
|
|
121
127
|
<CanvasProvider theme={{canvas: {palette: {primary: {main: 'purple'}}}}}>
|
|
122
|
-
<App/>
|
|
128
|
+
<App />
|
|
123
129
|
</CanvasProvider>
|
|
124
130
|
```
|
|
125
131
|
|
|
126
|
-
**After in v14**
|
|
127
|
-
|
|
132
|
+
**After in v14** We use `oklch` to generate the palette colors. The color shifting will be
|
|
133
|
+
different. If you want more control over the colors, we suggest providing the full palette object.
|
|
128
134
|
|
|
129
135
|
```tsx
|
|
130
|
-
<CanvasProvider
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
136
|
+
<CanvasProvider
|
|
137
|
+
theme={{
|
|
138
|
+
canvas: {
|
|
139
|
+
palette: {
|
|
140
|
+
primary: {
|
|
141
|
+
lightest: base.blue25,
|
|
142
|
+
light: base.blue200,
|
|
143
|
+
main: base.blue600,
|
|
144
|
+
dark: base.blue700,
|
|
145
|
+
darkest: base.blue800,
|
|
146
|
+
contrast: base.neutral0,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
<App />
|
|
144
153
|
</CanvasProvider>
|
|
145
154
|
```
|
|
146
155
|
|
|
@@ -148,19 +157,26 @@ We use `oklch` to generate the palette colors. The color shifting will be differ
|
|
|
148
157
|
|
|
149
158
|
```tsx
|
|
150
159
|
<CanvasProvider theme={{canvas: {palette: {primary: {main: cssVar(base.blue600)}}}}}>
|
|
151
|
-
<App/>
|
|
160
|
+
<App />
|
|
152
161
|
</CanvasProvider>
|
|
153
162
|
```
|
|
154
163
|
|
|
155
|
-
> **Note:** The way `chroma.js` and `oklch` generate colors **is different**. While we work on a
|
|
164
|
+
> **Note:** The way `chroma.js` and `oklch` generate colors **is different**. While we work on a
|
|
165
|
+
> better algorithm to determine hue, chroma and lightness and color shifting that best represents an
|
|
166
|
+
> accessible palette, **you may see color discrepancies**. If you want to continue using the old way
|
|
167
|
+
> of generating a color palette with `chroma.js`, you can use `createCanvasTheme`.
|
|
156
168
|
|
|
157
169
|
```tsx
|
|
158
|
-
<CanvasProvider
|
|
159
|
-
|
|
170
|
+
<CanvasProvider
|
|
171
|
+
theme={{canvas: createCanvasTheme({palette: {primary: {main: cssVar(base.blue600)}}})}}
|
|
172
|
+
>
|
|
173
|
+
<App />
|
|
160
174
|
</CanvasProvider>
|
|
161
175
|
```
|
|
162
176
|
|
|
163
|
-
The reason for this change is to ensure that the CSS variables properly cascade to all components.
|
|
177
|
+
The reason for this change is to ensure that the CSS variables properly cascade to all components.
|
|
178
|
+
Before in v13, the `CanvasProvider` would add the brand tokens under a class name, creating a higher
|
|
179
|
+
specificity.
|
|
164
180
|
|
|
165
181
|
## Component Updates
|
|
166
182
|
|
|
@@ -388,7 +404,8 @@ These changes are only **visual** and should not affect the functionality of the
|
|
|
388
404
|
|
|
389
405
|
### Pill
|
|
390
406
|
|
|
391
|
-
**PRs:** [#3430](https://github.com/Workday/canvas-kit/pull/3430),
|
|
407
|
+
**PRs:** [#3430](https://github.com/Workday/canvas-kit/pull/3430),
|
|
408
|
+
[#3446](https://github.com/Workday/canvas-kit/pull/3446)
|
|
392
409
|
|
|
393
410
|
- `Pill` has been updated to use the `Avatar` component from Preview. This change requires that you
|
|
394
411
|
provide a value for the `name` prop.
|
|
@@ -398,7 +415,8 @@ These changes are only **visual** and should not affect the functionality of the
|
|
|
398
415
|
- The `Pill` component no longer supports `'default'` as a value for the `variant` prop. If the
|
|
399
416
|
`variant` prop is not provided, the component will use its default styling.
|
|
400
417
|
|
|
401
|
-
- `readyOnlyPillStencil` and `removeablePillStencil` have been removed due to some styling clean up.
|
|
418
|
+
- `readyOnlyPillStencil` and `removeablePillStencil` have been removed due to some styling clean up.
|
|
419
|
+
Please use `pillStencil` instead.
|
|
402
420
|
|
|
403
421
|
**Before in v13**
|
|
404
422
|
|
|
@@ -418,7 +436,6 @@ These changes are only **visual** and should not affect the functionality of the
|
|
|
418
436
|
</Pill>
|
|
419
437
|
```
|
|
420
438
|
|
|
421
|
-
|
|
422
439
|
### Search Form 🚨
|
|
423
440
|
|
|
424
441
|
**PR:** [#3303](https://github.com/Workday/canvas-kit/pull/3303)
|
|
@@ -553,6 +570,13 @@ The Radio component in `@workday/canvas-kit-react/radio` has been deprecated. Pl
|
|
|
553
570
|
[Radio](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-radio--docs) component
|
|
554
571
|
from the same package, which offers improved accessibility and API consistency.
|
|
555
572
|
|
|
573
|
+
### Search Form (Labs)
|
|
574
|
+
|
|
575
|
+
**PR:** [#3469](https://github.com/Workday/canvas-kit/pull/3469)
|
|
576
|
+
|
|
577
|
+
The `SearchForm` in `@workday/canvas-kit-labs-react/search-form` has been deprecated and will be removed in a future major release. Please migrate to the new
|
|
578
|
+
[Combobox](https://workday.github.io/canvas-kit/?path=/docs/features-combobox--docs#usage) in `@workday/canvas-kit-react`.
|
|
579
|
+
|
|
556
580
|
### Segmented Control (Main)
|
|
557
581
|
|
|
558
582
|
The Segmented Control component in `@workday/canvas-kit-react/segmented-control` has been
|
|
@@ -594,10 +618,16 @@ and themable buttons like `PrimaryButton`, `ScondaryButton` or `TertiaryButton`.
|
|
|
594
618
|
|
|
595
619
|
### Input Provider
|
|
596
620
|
|
|
597
|
-
We've removed `InputProvider` from our codebase and the `CanvasProvider`. The intent of the provider
|
|
598
|
-
|
|
621
|
+
We've removed `InputProvider` from our codebase and the `CanvasProvider`. The intent of the provider
|
|
622
|
+
was to check the users input and apply focus styles accordingly to our components. This was needed
|
|
623
|
+
when we still supported IE11 to ensure we could be consistent on styling based on user input events.
|
|
624
|
+
Since dropping support and moving to `:focus-visible`, we no longer need this provider. We now allow
|
|
625
|
+
browser heuristics to determine when an element should receive visual focus styles. For more
|
|
626
|
+
information, please view the
|
|
627
|
+
[MDN docs on `:focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible).
|
|
599
628
|
|
|
600
|
-
If you are trying to apply focus styles to our components, we strongly avise to use `:focus-visible`
|
|
629
|
+
If you are trying to apply focus styles to our components, we strongly avise to use `:focus-visible`
|
|
630
|
+
pseudo selector.
|
|
601
631
|
|
|
602
632
|
```tsx
|
|
603
633
|
import {createStyles} from '@workday/canvas-kit-styling'
|
|
@@ -627,6 +657,22 @@ We've removed `Menu` from `@workday/canvas-kit-preview-react` package. Please us
|
|
|
627
657
|
The `readyOnlyPillStencil` and `removeablePillStencil` utilities have been removed from the Pill
|
|
628
658
|
package. Please use `pillStencil` instead.
|
|
629
659
|
|
|
660
|
+
### Text Area (preview)
|
|
661
|
+
|
|
662
|
+
**PR:** [#3471](https://github.com/Workday/canvas-kit/pull/3471)
|
|
663
|
+
|
|
664
|
+
We've removed `TextArea` from `@workday/canvas-kit-preview-react` package. Please use
|
|
665
|
+
[TextArea](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-textarea--docs) from
|
|
666
|
+
`@workday/canvas-kit-react` instead.
|
|
667
|
+
|
|
668
|
+
### Text Input (preview)
|
|
669
|
+
|
|
670
|
+
**PR:** [#3471](https://github.com/Workday/canvas-kit/pull/3471)
|
|
671
|
+
|
|
672
|
+
We've removed `TextInput` from `@workday/canvas-kit-preview-react` package. Please use
|
|
673
|
+
[TextInput](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-text-input--docs)
|
|
674
|
+
from `@workday/canvas-kit-react` instead. =======
|
|
675
|
+
|
|
630
676
|
---
|
|
631
677
|
|
|
632
678
|
## Troubleshooting
|
|
@@ -18,7 +18,7 @@ import RTL from './examples/RTL';
|
|
|
18
18
|
<InformationHighlight className="sb-unstyled" variant="caution" cs={{p: {marginBlock: 0}}}>
|
|
19
19
|
<InformationHighlight.Icon />
|
|
20
20
|
<InformationHighlight.Body>
|
|
21
|
-
`Combobox` in
|
|
21
|
+
`Combobox` in Labs has been deprecated and will be removed in a future major version. Please
|
|
22
22
|
use `Combobox` in Main instead.
|
|
23
23
|
</InformationHighlight.Body>
|
|
24
24
|
<InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/docs/features-combobox--docs">
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc, StorybookStatusIndicator,} from '@workday/canvas-kit-docs';
|
|
2
|
+
import {InformationHighlight} from '@workday/canvas-kit-preview-react/information-highlight';import Basic from './examples/Basic';
|
|
2
3
|
import Collapsed from './examples/Collapsed';
|
|
3
4
|
import CustomTheme from './examples/CustomTheme';
|
|
4
5
|
import Grow from './examples/Grow';
|
|
@@ -7,7 +8,18 @@ import Theming from './examples/Theming';
|
|
|
7
8
|
import CustomStyles from './examples/CustomStyles';
|
|
8
9
|
|
|
9
10
|
|
|
10
|
-
# Canvas Kit Search Form
|
|
11
|
+
# Canvas Kit Search Form <StorybookStatusIndicator type="deprecated" />
|
|
12
|
+
|
|
13
|
+
<InformationHighlight className="sb-unstyled" variant="caution" cs={{p: {marginBlock: 0}}}>
|
|
14
|
+
<InformationHighlight.Icon />
|
|
15
|
+
<InformationHighlight.Body>
|
|
16
|
+
`SearchForm` in Labs has been deprecated and will be removed in a future major version. Please
|
|
17
|
+
use `Combobox` in Main instead.
|
|
18
|
+
</InformationHighlight.Body>
|
|
19
|
+
<InformationHighlight.Link href="https://workday.github.io/canvas-kit/?path=/docs/features-combobox--docs#usage">
|
|
20
|
+
View Autocomplete Example
|
|
21
|
+
</InformationHighlight.Link>
|
|
22
|
+
</InformationHighlight>
|
|
11
23
|
|
|
12
24
|
`SearchForm` is a search form that contains a `Combobox` for rendering search results. It's
|
|
13
25
|
primarily intended to be used within a `Header`.
|
|
@@ -3,11 +3,12 @@ import React from 'react';
|
|
|
3
3
|
import {useFormik} from 'formik';
|
|
4
4
|
import {object, SchemaOf, string} from 'yup';
|
|
5
5
|
|
|
6
|
-
import {TextInput} from '@workday/canvas-kit-
|
|
6
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
7
7
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
8
8
|
import {TertiaryButton, PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
9
9
|
import {visibleIcon, invisibleIcon} from '@workday/canvas-system-icons-web';
|
|
10
10
|
import {useUniqueId} from '@workday/canvas-kit-react/common';
|
|
11
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
11
12
|
|
|
12
13
|
interface LoginSchema {
|
|
13
14
|
email: string;
|
|
@@ -47,40 +48,46 @@ export default () => {
|
|
|
47
48
|
return (
|
|
48
49
|
<form onSubmit={formik.handleSubmit} action=".">
|
|
49
50
|
<Flex gap="xs" flexDirection="column" alignItems="flex-start">
|
|
50
|
-
<
|
|
51
|
+
<FormField
|
|
51
52
|
orientation="vertical"
|
|
52
53
|
isRequired={true}
|
|
53
54
|
error={formik.touched.email && !!formik.errors.email ? 'error' : undefined}
|
|
54
55
|
>
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
56
|
+
<FormField.Label>Email</FormField.Label>
|
|
57
|
+
<FormField.Field>
|
|
58
|
+
<FormField.Input
|
|
59
|
+
as={TextInput}
|
|
60
|
+
name="email"
|
|
61
|
+
autoComplete="username"
|
|
62
|
+
placeholder="yourName@example.com"
|
|
63
|
+
onChange={formik.handleChange}
|
|
64
|
+
onBlur={formik.handleBlur}
|
|
65
|
+
value={formik.values.email}
|
|
66
|
+
/>
|
|
67
|
+
</FormField.Field>
|
|
68
|
+
<FormField.Hint>{formik.touched.email && formik.errors.email}</FormField.Hint>
|
|
69
|
+
</FormField>
|
|
70
|
+
<FormField
|
|
67
71
|
orientation="vertical"
|
|
68
72
|
id={passwordId}
|
|
69
73
|
error={formik.touched.password && !!formik.errors.password ? 'error' : undefined}
|
|
70
74
|
isRequired={true}
|
|
71
75
|
>
|
|
72
|
-
<
|
|
76
|
+
<FormField.Label>Password</FormField.Label>
|
|
73
77
|
<Flex gap="xxs">
|
|
74
|
-
<
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
<FormField.Field>
|
|
79
|
+
<FormField.Input
|
|
80
|
+
as={TextInput}
|
|
81
|
+
type={showPassword ? 'text' : 'password'}
|
|
82
|
+
name="password"
|
|
83
|
+
autoComplete="current-password"
|
|
84
|
+
spellCheck={false}
|
|
85
|
+
ref={passwordRef}
|
|
86
|
+
onChange={formik.handleChange}
|
|
87
|
+
onBlur={formik.handleBlur}
|
|
88
|
+
value={formik.values.password}
|
|
89
|
+
/>
|
|
90
|
+
</FormField.Field>
|
|
84
91
|
<TertiaryButton
|
|
85
92
|
type="button"
|
|
86
93
|
icon={showPassword ? invisibleIcon : visibleIcon}
|
|
@@ -92,10 +99,10 @@ export default () => {
|
|
|
92
99
|
}}
|
|
93
100
|
/>
|
|
94
101
|
</Flex>
|
|
95
|
-
<
|
|
102
|
+
<FormField.Hint>
|
|
96
103
|
{(formik.touched.password && formik.errors.password) || passwordHint}
|
|
97
|
-
</
|
|
98
|
-
</
|
|
104
|
+
</FormField.Hint>
|
|
105
|
+
</FormField>
|
|
99
106
|
|
|
100
107
|
<PrimaryButton type="submit">Submit</PrimaryButton>
|
|
101
108
|
</Flex>
|
|
@@ -3,7 +3,7 @@ import React from 'react';
|
|
|
3
3
|
import {useForm, FieldErrorsImpl} from 'react-hook-form';
|
|
4
4
|
import {object, SchemaOf, string} from 'yup';
|
|
5
5
|
|
|
6
|
-
import {TextInput} from '@workday/canvas-kit-
|
|
6
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
7
7
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
8
8
|
import {TertiaryButton, PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
9
9
|
import {Select} from '@workday/canvas-kit-react/select';
|
|
@@ -120,34 +120,40 @@ export default () => {
|
|
|
120
120
|
<FormField.Hint>{errors.role?.message}</FormField.Hint>
|
|
121
121
|
</Select>
|
|
122
122
|
</FormField>
|
|
123
|
-
<
|
|
123
|
+
<FormField
|
|
124
124
|
orientation="vertical"
|
|
125
125
|
isRequired={true}
|
|
126
126
|
error={!!errors.email ? 'error' : undefined}
|
|
127
127
|
>
|
|
128
|
-
<
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
128
|
+
<FormField.Label>Email</FormField.Label>
|
|
129
|
+
<FormField.Field>
|
|
130
|
+
<FormField.Input
|
|
131
|
+
as={TextInput}
|
|
132
|
+
{...register('email')}
|
|
133
|
+
autoComplete="username"
|
|
134
|
+
placeholder="yourName@example.com"
|
|
135
|
+
/>
|
|
136
|
+
</FormField.Field>
|
|
137
|
+
<FormField.Hint>{errors.email?.message}</FormField.Hint>
|
|
138
|
+
</FormField>
|
|
139
|
+
<FormField
|
|
137
140
|
orientation="vertical"
|
|
138
141
|
id={passwordId}
|
|
139
142
|
isRequired={true}
|
|
140
143
|
error={!!errors.password ? 'error' : undefined}
|
|
141
144
|
>
|
|
142
|
-
<
|
|
145
|
+
<FormField.Label>Password</FormField.Label>
|
|
143
146
|
<Flex gap="xxs">
|
|
144
|
-
<
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
147
|
+
<FormField.Field>
|
|
148
|
+
<FormField.Input
|
|
149
|
+
as={TextInput}
|
|
150
|
+
{...passwordRegistration}
|
|
151
|
+
type={showPassword ? 'text' : 'password'}
|
|
152
|
+
autoComplete="current-password"
|
|
153
|
+
spellCheck={false}
|
|
154
|
+
ref={combinePasswordRef}
|
|
155
|
+
/>
|
|
156
|
+
</FormField.Field>
|
|
151
157
|
<TertiaryButton
|
|
152
158
|
type="button"
|
|
153
159
|
icon={showPassword ? invisibleIcon : visibleIcon}
|
|
@@ -159,8 +165,8 @@ export default () => {
|
|
|
159
165
|
}}
|
|
160
166
|
/>
|
|
161
167
|
</Flex>
|
|
162
|
-
<
|
|
163
|
-
</
|
|
168
|
+
<FormField.Hint>{errors.password?.message || passwordHint}</FormField.Hint>
|
|
169
|
+
</FormField>
|
|
164
170
|
|
|
165
171
|
<PrimaryButton type="submit">Submit</PrimaryButton>
|
|
166
172
|
</Flex>
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, {useState} from 'react';
|
|
2
|
-
import {TextInput} from '@workday/canvas-kit-
|
|
2
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
3
3
|
import {BodyText, Heading} from '@workday/canvas-kit-react/text';
|
|
4
4
|
import {AriaLiveRegion} from '@workday/canvas-kit-react/common';
|
|
5
5
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
6
|
import {system} from '@workday/canvas-tokens-web';
|
|
7
7
|
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
8
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
8
9
|
|
|
9
10
|
const fruits = [
|
|
10
11
|
'Apples',
|
|
@@ -49,10 +50,12 @@ export default () => {
|
|
|
49
50
|
</BodyText>
|
|
50
51
|
</AriaLiveRegion>
|
|
51
52
|
</Flex>
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
|
|
53
|
+
<FormField>
|
|
54
|
+
<FormField.Label>Filter Items:</FormField.Label>
|
|
55
|
+
<FormField.Field>
|
|
56
|
+
<FormField.Input as={TextInput} value={filter} onChange={handleFilter} />
|
|
57
|
+
</FormField.Field>
|
|
58
|
+
</FormField>
|
|
56
59
|
<ul style={listStyles}>
|
|
57
60
|
{filteredFruits.map(i => (
|
|
58
61
|
<BodyText size="small" as="li" cs={listItemStyles} key={i}>
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, {useState, useRef} from 'react';
|
|
2
2
|
import {AriaLiveRegion, AccessibleHide} from '@workday/canvas-kit-react/common';
|
|
3
3
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {TextInput} from '@workday/canvas-kit-
|
|
4
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
5
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
6
|
import {system} from '@workday/canvas-tokens-web';
|
|
7
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
7
8
|
|
|
8
9
|
export default () => {
|
|
9
10
|
const [message, setMessage] = useState('This is an ARIA Live Region!');
|
|
@@ -16,10 +17,12 @@ export default () => {
|
|
|
16
17
|
return (
|
|
17
18
|
<>
|
|
18
19
|
<Flex gap={`var(${system.space.x4})`} alignItems="flex-end">
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
|
|
20
|
+
<FormField>
|
|
21
|
+
<FormField.Label>Type your message:</FormField.Label>
|
|
22
|
+
<FormField.Field>
|
|
23
|
+
<FormField.Input as={TextInput} ref={inputRef} />
|
|
24
|
+
</FormField.Field>
|
|
25
|
+
</FormField>
|
|
23
26
|
<PrimaryButton onClick={handleSendMessage}>Send Message</PrimaryButton>
|
|
24
27
|
</Flex>
|
|
25
28
|
<AriaLiveRegion>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, {useState, useRef} from 'react';
|
|
2
|
-
import {TextInput} from '@workday/canvas-kit-
|
|
2
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
3
3
|
import {AriaLiveRegion, changeFocus} from '@workday/canvas-kit-react/common';
|
|
4
4
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
5
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
5
6
|
|
|
6
7
|
export default () => {
|
|
7
8
|
const errMsg = 'Error: First name is required.';
|
|
@@ -12,13 +13,15 @@ export default () => {
|
|
|
12
13
|
|
|
13
14
|
return (
|
|
14
15
|
<>
|
|
15
|
-
<
|
|
16
|
-
<
|
|
17
|
-
<
|
|
18
|
-
|
|
19
|
-
<
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
<FormField error={hasError ? 'error' : undefined} isRequired={true}>
|
|
17
|
+
<FormField.Label>First Name:</FormField.Label>
|
|
18
|
+
<FormField.Field>
|
|
19
|
+
<FormField.Input onBlur={handleBlur} as={TextInput} ref={inputRef} />
|
|
20
|
+
<FormField.Hint>
|
|
21
|
+
<AriaLiveRegion>{hasError && errMsg}</AriaLiveRegion>
|
|
22
|
+
</FormField.Hint>
|
|
23
|
+
</FormField.Field>
|
|
24
|
+
</FormField>
|
|
22
25
|
<PrimaryButton onClick={handleSubmit}>Continue</PrimaryButton>
|
|
23
26
|
</>
|
|
24
27
|
);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, {useState, useRef} from 'react';
|
|
2
2
|
import {AriaLiveRegion} from '@workday/canvas-kit-react/common';
|
|
3
3
|
import {PrimaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
-
import {
|
|
4
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
5
|
+
import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
5
6
|
import {Flex} from '@workday/canvas-kit-react/layout';
|
|
6
7
|
import {Text} from '@workday/canvas-kit-react/text';
|
|
7
8
|
import {system} from '@workday/canvas-tokens-web';
|
|
@@ -18,6 +19,7 @@ const liveRegionStyle = createStyles({
|
|
|
18
19
|
export default () => {
|
|
19
20
|
const [message, setMessage] = useState('This is an ARIA Live Region!');
|
|
20
21
|
const inputRef = useRef();
|
|
22
|
+
|
|
21
23
|
function handleSendMessage() {
|
|
22
24
|
setMessage(inputRef.current.value);
|
|
23
25
|
inputRef.current.value = '';
|
|
@@ -29,10 +31,12 @@ export default () => {
|
|
|
29
31
|
<Text cs={liveRegionStyle}>{message}</Text>
|
|
30
32
|
</AriaLiveRegion>
|
|
31
33
|
<Flex gap={`var(${system.space.x4})`} alignItems="flex-end">
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
<
|
|
35
|
-
|
|
34
|
+
<FormField>
|
|
35
|
+
<FormField.Label>Type your message:</FormField.Label>
|
|
36
|
+
<FormField.Field>
|
|
37
|
+
<FormField.Input as={TextInput} ref={inputRef} />
|
|
38
|
+
</FormField.Field>
|
|
39
|
+
</FormField>
|
|
36
40
|
<PrimaryButton onClick={handleSendMessage}>Send Message</PrimaryButton>
|
|
37
41
|
</Flex>
|
|
38
42
|
</>
|
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.1233-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.1233-next.0",
|
|
49
|
+
"@workday/canvas-kit-preview-react": "^14.0.0-alpha.1233-next.0",
|
|
50
|
+
"@workday/canvas-kit-react": "^14.0.0-alpha.1233-next.0",
|
|
51
|
+
"@workday/canvas-kit-styling": "^14.0.0-alpha.1233-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": "7ed1570b966cb8473b3db07695fb2bc86af7739c"
|
|
65
65
|
}
|