@workday/canvas-kit-docs 14.0.0-alpha.1230-next.0 → 14.0.0-alpha.1234-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 +138 -980
- package/dist/es6/mdx/installBlock.d.ts.map +1 -1
- package/dist/es6/mdx/installBlock.js +4 -1
- package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.js +1 -1
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +84 -36
- package/dist/mdx/MAINTAINING.mdx +4 -4
- package/dist/mdx/PACKAGES.mdx +9 -10
- package/dist/mdx/labs-react/combobox/Combobox.mdx +1 -1
- package/dist/mdx/labs-react/search-form/SearchForm.mdx +21 -4
- 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/preview-react/divider/Divider.mdx +15 -5
- package/dist/mdx/preview-react/pill/Pill.mdx +4 -4
- package/dist/mdx/preview-react/radio/Radio.mdx +2 -2
- package/dist/mdx/preview-react/select/Select.mdx +1 -1
- package/dist/mdx/preview-react/status-indicator/StatusIndicator.mdx +2 -2
- package/dist/mdx/react/_examples/mdx/Layouts.mdx +1 -1
- 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/dist/mdx/react/avatar/avatar/Avatar.mdx +10 -4
- package/dist/mdx/react/button/button/Button.mdx +21 -16
- package/dist/mdx/react/card/card.mdx +1 -1
- package/dist/mdx/react/checkbox/Checkbox.mdx +5 -5
- package/dist/mdx/react/combobox/Combobox.mdx +2 -2
- package/dist/mdx/react/form-field/FormField.mdx +2 -2
- package/dist/mdx/react/select/Select.mdx +6 -6
- package/dist/mdx/react/status-indicator/StatusIndicator.mdx +1 -1
- package/dist/mdx/react/switch/Switch.mdx +5 -5
- package/dist/mdx/react/table/Table.mdx +26 -13
- package/dist/mdx/react/text/BodyText.mdx +2 -2
- package/dist/mdx/react/text/Heading.mdx +2 -2
- package/dist/mdx/react/text/Subtext.mdx +2 -2
- package/dist/mdx/react/text/Text.mdx +2 -2
- package/dist/mdx/react/text/Title.mdx +2 -2
- package/dist/mdx/style-props/STYLE_PROPS.mdx +1 -1
- package/dist/mdx/styling/mdx/CustomizingStyles.mdx +8 -8
- package/dist/mdx/styling/mdx/Overview.mdx +7 -3
- package/dist/mdx/tokens/TokenMigrationFinal.mdx +1 -1
- 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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installBlock.d.ts","sourceRoot":"","sources":["../../../mdx/installBlock.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,6BAA4B,iBAAiB,
|
|
1
|
+
{"version":3,"file":"installBlock.d.ts","sourceRoot":"","sources":["../../../mdx/installBlock.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,YAAY,6BAA4B,iBAAiB,4CAqCrE,CAAC"}
|
|
@@ -16,5 +16,8 @@ export const InstallBlock = ({ command, packageName }) => {
|
|
|
16
16
|
navigator.clipboard.writeText(commandRef.current.innerText);
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
return (_jsxs(Flex, { padding: "xs", backgroundColor: system.color.bg.contrast.default, borderRadius: "m", justifyContent: "space-between", alignItems: "center", flexWrap: "wrap", children: [_jsxs("pre", { ref: commandRef, children: [_jsx("span", { style: {
|
|
19
|
+
return (_jsxs(Flex, { padding: "xs", backgroundColor: system.color.bg.contrast.default, borderRadius: "m", justifyContent: "space-between", alignItems: "center", flexWrap: "wrap", children: [_jsxs("pre", { ref: commandRef, children: [_jsx("span", { style: {
|
|
20
|
+
color: cssVar(system.color.fg.primary.soft),
|
|
21
|
+
marginInlineEnd: cssVar(system.space.x2),
|
|
22
|
+
}, children: command }), _jsx("span", { style: { color: cssVar(system.color.fg.inverse) }, children: packageName })] }), _jsx(PrimaryButton, { variant: "inverse", onClick: handleCopy, size: "small", children: copied ? 'Copied' : 'Copy' })] }));
|
|
20
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"welcomePage.d.ts","sourceRoot":"","sources":["../../../mdx/welcomePage.tsx"],"names":[],"mappings":"AAgDA,eAAO,MAAM,WAAW,+
|
|
1
|
+
{"version":3,"file":"welcomePage.d.ts","sourceRoot":"","sources":["../../../mdx/welcomePage.tsx"],"names":[],"mappings":"AAgDA,eAAO,MAAM,WAAW,+CAmGvB,CAAC"}
|
|
@@ -41,5 +41,5 @@ const linkStyles = createStyles({
|
|
|
41
41
|
marginTop: system.space.x3,
|
|
42
42
|
});
|
|
43
43
|
export const WelcomePage = () => {
|
|
44
|
-
return (_jsx("div", { className: "sb-unstyled", children: _jsxs("div", { className: parentFlexStyles, children: [_jsxs(Box, { cs: { overflow: 'hidden', position: 'relative' }, children: [_jsx("img", { src: headerImage, alt: "banner with canvas kit logo and version", className: imageStyles }), _jsx(Flex, { cs: { flexDirection: 'row', position: 'absolute', top: '45%', right: '5%' }, children: _jsxs(Text, { typeLevel: "title.medium", cs: [bannerTextStyles, versionStyles], children: ["v", version] }) })] }), _jsxs(Text, { typeLevel: "body.medium", children: ["This project provides a set of components for the Workday Canvas Design System that can be used to implement user experiences consistent with
|
|
44
|
+
return (_jsx("div", { className: "sb-unstyled", children: _jsxs("div", { className: parentFlexStyles, children: [_jsxs(Box, { cs: { overflow: 'hidden', position: 'relative' }, children: [_jsx("img", { src: headerImage, alt: "banner with canvas kit logo and version", className: imageStyles }), _jsx(Flex, { cs: { flexDirection: 'row', position: 'absolute', top: '45%', right: '5%' }, children: _jsxs(Text, { typeLevel: "title.medium", cs: [bannerTextStyles, versionStyles], children: ["v", version] }) })] }), _jsxs(Text, { typeLevel: "body.medium", children: ["This project provides a set of components for the Workday Canvas Design System that can be used to implement user experiences consistent with", _jsx(ExternalHyperlink, { href: "https://canvas.workdaydesign.com/", iconLabel: "Open docs in new window", cs: { marginInlineStart: system.space.x1 }, children: "Workday Design Principles." })] }), _jsx(Heading, { size: "medium", children: "Quick Links" }), _jsxs(Grid, { gridAutoColumns: "auto", gridTemplateColumns: "repeat(auto-fill, minmax(250px, 1fr))", gridGap: "s", children: [_jsxs(Grid, { as: Card, className: gridStyles, children: [_jsx(SystemIcon, { color: base.magenta600, icon: rocketIcon, size: 60 }), _jsx(Card.Heading, { children: "Getting Started" }), _jsx(Card.Body, { children: _jsx(Text, { children: "For all things getting started including helpful guides and docs." }) }), _jsx(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/guides-getting-started--docs", children: "Getting Started Guide" })] }), _jsxs(Grid, { as: Card, className: gridStyles, children: [_jsx(SystemIcon, { color: base.red300, icon: tokensIcon, size: 60 }), _jsx(Card.Heading, { children: "Tokens" }), _jsx(Card.Body, { children: _jsx(Text, { children: "Tokens are the smallest pieces of our Design System with the primary function of storing UI information." }) }), _jsx(Grid.Item, { as: ExternalHyperlink, className: linkStyles, href: "https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs", children: "View Our Tokens" })] }), _jsxs(Grid, { as: Card, className: gridStyles, children: [_jsx(SystemIcon, { color: base.teal500, icon: shapesIcon, size: 60 }), _jsx(Card.Heading, { children: "Styling" }), _jsx(Card.Body, { children: _jsx(Text, { children: "Learn how to style Canvas components using tokens, theming, and custom CSS approaches." }) }), _jsx(Grid.Item, { as: Hyperlink, className: linkStyles, href: "https://workday.github.io/canvas-kit/?path=/docs/styling-getting-started-overview--docs", children: "Get Started" })] })] }), _jsx(Heading, { size: "medium", children: "Installation" }), _jsx(Text, { children: "To get started using Canvas Kit React first add or install the module to your existing React project" }), _jsx(InstallBlock, { command: "yarn add", packageName: "@workday/canvas-kit-react @workday/canvas-tokens-web" }), "or", _jsx(InstallBlock, { command: "npm install", packageName: "@workday/canvas-kit-react @workday/canvas-tokens-web" })] }) }));
|
|
45
45
|
};
|
|
@@ -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)
|
|
@@ -544,7 +561,7 @@ import {BaseAvatar} from '@workday/canvas-kit-preview-react/avatar';
|
|
|
544
561
|
|
|
545
562
|
The Combobox component in `@workday/canvas-kit-labs-react/combobox` has been deprecated and will be
|
|
546
563
|
removed in a future major release. Please migrate to the
|
|
547
|
-
[Combobox](https://workday.github.io/canvas-kit/?path=/docs/
|
|
564
|
+
[Combobox](https://workday.github.io/canvas-kit/?path=/docs/features-combobox--docs) in
|
|
548
565
|
`@workday/canvas-kit-react`.
|
|
549
566
|
|
|
550
567
|
### Radio (Main)
|
|
@@ -553,19 +570,28 @@ 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
|
|
578
|
+
removed in a future major release. Please migrate to the new
|
|
579
|
+
[Combobox](https://workday.github.io/canvas-kit/?path=/docs/features-combobox--docs#usage) in
|
|
580
|
+
`@workday/canvas-kit-react`.
|
|
581
|
+
|
|
556
582
|
### Segmented Control (Main)
|
|
557
583
|
|
|
558
584
|
The Segmented Control component in `@workday/canvas-kit-react/segmented-control` has been
|
|
559
585
|
deprecated. Please migrate to the new
|
|
560
|
-
[Segmented Control](https://workday.github.io/canvas-kit/?path=/docs/components-
|
|
586
|
+
[Segmented Control](https://workday.github.io/canvas-kit/?path=/docs/components-buttons-segmented-control--docs)
|
|
561
587
|
for improved features and support.
|
|
562
588
|
|
|
563
589
|
### Side Panel (Main)
|
|
564
590
|
|
|
565
591
|
The Side Panel component in `@workday/canvas-kit-react/side-panel` is now deprecated and will be
|
|
566
592
|
removed in a future release. Please use the new
|
|
567
|
-
[Side Panel](https://workday.github.io/canvas-kit/?path=/docs/
|
|
568
|
-
|
|
593
|
+
[Side Panel](https://workday.github.io/canvas-kit/?path=/docs/preview-side-panel--docs) for enhanced
|
|
594
|
+
functionality.
|
|
569
595
|
|
|
570
596
|
### Tokens
|
|
571
597
|
|
|
@@ -594,10 +620,16 @@ and themable buttons like `PrimaryButton`, `ScondaryButton` or `TertiaryButton`.
|
|
|
594
620
|
|
|
595
621
|
### Input Provider
|
|
596
622
|
|
|
597
|
-
We've removed `InputProvider` from our codebase and the `CanvasProvider`. The intent of the provider
|
|
598
|
-
|
|
623
|
+
We've removed `InputProvider` from our codebase and the `CanvasProvider`. The intent of the provider
|
|
624
|
+
was to check the users input and apply focus styles accordingly to our components. This was needed
|
|
625
|
+
when we still supported IE11 to ensure we could be consistent on styling based on user input events.
|
|
626
|
+
Since dropping support and moving to `:focus-visible`, we no longer need this provider. We now allow
|
|
627
|
+
browser heuristics to determine when an element should receive visual focus styles. For more
|
|
628
|
+
information, please view the
|
|
629
|
+
[MDN docs on `:focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible).
|
|
599
630
|
|
|
600
|
-
If you are trying to apply focus styles to our components, we strongly avise to use `:focus-visible`
|
|
631
|
+
If you are trying to apply focus styles to our components, we strongly avise to use `:focus-visible`
|
|
632
|
+
pseudo selector.
|
|
601
633
|
|
|
602
634
|
```tsx
|
|
603
635
|
import {createStyles} from '@workday/canvas-kit-styling'
|
|
@@ -627,6 +659,22 @@ We've removed `Menu` from `@workday/canvas-kit-preview-react` package. Please us
|
|
|
627
659
|
The `readyOnlyPillStencil` and `removeablePillStencil` utilities have been removed from the Pill
|
|
628
660
|
package. Please use `pillStencil` instead.
|
|
629
661
|
|
|
662
|
+
### Text Area (preview)
|
|
663
|
+
|
|
664
|
+
**PR:** [#3471](https://github.com/Workday/canvas-kit/pull/3471)
|
|
665
|
+
|
|
666
|
+
We've removed `TextArea` from `@workday/canvas-kit-preview-react` package. Please use
|
|
667
|
+
[TextArea](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-textarea--docs) from
|
|
668
|
+
`@workday/canvas-kit-react` instead.
|
|
669
|
+
|
|
670
|
+
### Text Input (preview)
|
|
671
|
+
|
|
672
|
+
**PR:** [#3471](https://github.com/Workday/canvas-kit/pull/3471)
|
|
673
|
+
|
|
674
|
+
We've removed `TextInput` from `@workday/canvas-kit-preview-react` package. Please use
|
|
675
|
+
[TextInput](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-text-input--docs)
|
|
676
|
+
from `@workday/canvas-kit-react` instead.
|
|
677
|
+
|
|
630
678
|
---
|
|
631
679
|
|
|
632
680
|
## Troubleshooting
|
package/dist/mdx/MAINTAINING.mdx
CHANGED
|
@@ -402,7 +402,7 @@ component.
|
|
|
402
402
|
|
|
403
403
|
```tsx
|
|
404
404
|
/**
|
|
405
|
-
* @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--
|
|
405
|
+
* @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--docs) instead.
|
|
406
406
|
*/
|
|
407
407
|
export class StatusIndicator...
|
|
408
408
|
```
|
|
@@ -420,17 +420,17 @@ You may share the same `@deprecation` note for multiple deprecations related to
|
|
|
420
420
|
|
|
421
421
|
```tsx
|
|
422
422
|
/**
|
|
423
|
-
* @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--
|
|
423
|
+
* @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--docs) instead.
|
|
424
424
|
*/
|
|
425
425
|
export enum StatusIndicatorType...
|
|
426
426
|
|
|
427
427
|
/**
|
|
428
|
-
* @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--
|
|
428
|
+
* @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--docs) instead.
|
|
429
429
|
*/
|
|
430
430
|
export interface StatusIndicatorProps...
|
|
431
431
|
|
|
432
432
|
/**
|
|
433
|
-
* @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--
|
|
433
|
+
* @deprecated ⚠️ Status Indicator in Main has been deprecated and will be removed in a future major release. Please use [Status Indicator in Preview](https://workday.github.io/canvas-kit/?path=/docs/preview-status-indicator--docs) instead.
|
|
434
434
|
*/
|
|
435
435
|
export class StatusIndicator...
|
|
436
436
|
```
|
package/dist/mdx/PACKAGES.mdx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
### Main
|
|
2
2
|
|
|
3
|
-
Our Main package of Canvas Kit components and utilities at `@workday/canvas-kit-react` has
|
|
4
|
-
|
|
3
|
+
Our Main package of Canvas Kit components and utilities at `@workday/canvas-kit-react` has undergone
|
|
4
|
+
a full design and a11y review and is approved for use in product.
|
|
5
5
|
|
|
6
6
|
Breaking changes to code in Main will only occur during major version updates and will always be
|
|
7
7
|
communicated in advance and accompanied by migration strategies.
|
|
@@ -10,10 +10,9 @@ communicated in advance and accompanied by migration strategies.
|
|
|
10
10
|
|
|
11
11
|
### Preview
|
|
12
12
|
|
|
13
|
-
Our Preview package of Canvas Kit components and utilities at
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
Preview is analagous to code in beta.
|
|
13
|
+
Our Preview package of Canvas Kit components and utilities at `@workday/canvas-kit-preview-react`
|
|
14
|
+
has undergone a full design and a11y review and is approved for use in product, but may not be up to
|
|
15
|
+
the high code standards upheld in the [Main](#main) package. Preview is analagous to code in beta.
|
|
17
16
|
|
|
18
17
|
Breaking changes are unlikely, but possible, and can be deployed to Preview at any time without
|
|
19
18
|
triggering a major version update, though such changes will be communicated in advance and
|
|
@@ -22,7 +21,7 @@ accompanied by migration strategies.
|
|
|
22
21
|
Generally speaking, our goal is to eventually promote code from Preview to [Main](#main).
|
|
23
22
|
Occasionally, a component with the same name will exist in both [Main](#main) and Preview (for
|
|
24
23
|
example, see Segmented Control in [Preview](/components/buttons/segmented-control/) and
|
|
25
|
-
[Main](https://
|
|
24
|
+
[Main](https://workday.github.io/canvas-kit//?path=/docs/components-buttons-segmented-control--docs)).
|
|
26
25
|
In these cases, Preview serves as a staging ground for an improved version of the component with a
|
|
27
26
|
different API. The component in [Main](#main) will eventually be replaced with the one in Preview.
|
|
28
27
|
|
|
@@ -30,8 +29,8 @@ different API. The component in [Main](#main) will eventually be replaced with t
|
|
|
30
29
|
|
|
31
30
|
### Labs
|
|
32
31
|
|
|
33
|
-
Our Labs package of Canvas Kit components and utilities at `@workday/canvas-kit-labs-react`
|
|
34
|
-
|
|
32
|
+
Our Labs package of Canvas Kit components and utilities at `@workday/canvas-kit-labs-react` has
|
|
33
|
+
**not** undergone a full design and a11y review. Labs serves as an incubator space for new and
|
|
35
34
|
experimental code and is analagous to code in alpha.
|
|
36
35
|
|
|
37
36
|
Breaking changes can be deployed to Labs at any time without triggering a major version update and
|
|
@@ -43,4 +42,4 @@ changes in [Preview](#preview) and [Main](#main).
|
|
|
43
42
|
|
|
44
43
|
This package contains everything needed to create CSS styling. This styling package contains a
|
|
45
44
|
runtime for development and a static parsing process for build time. For more information, visit
|
|
46
|
-
https://workday.github.io/canvas-kit/?path=/docs/styling-why-canvas-styling--docs
|
|
45
|
+
https://workday.github.io/canvas-kit/?path=/docs/styling-guides-why-canvas-styling--docs
|
|
@@ -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`.
|
|
@@ -62,11 +74,16 @@ additional configuration.
|
|
|
62
74
|
|
|
63
75
|
### Custom Styles
|
|
64
76
|
|
|
65
|
-
You can apply custom styles to the component via the `cs` prop. The example below uses CSS Variables
|
|
77
|
+
You can apply custom styles to the component via the `cs` prop. The example below uses CSS Variables
|
|
78
|
+
and
|
|
79
|
+
[createStencil](https://workday.github.io/canvas-kit/?path=/docs/styling-guides-customizing-styles--docs#stencils)
|
|
80
|
+
to create a custom style for the `SearchForm` component.
|
|
66
81
|
|
|
67
82
|
<ExampleCodeBlock code={CustomStyles} />
|
|
68
83
|
|
|
69
|
-
Learn more in our
|
|
84
|
+
Learn more in our
|
|
85
|
+
[Styling](https://workday.github.io/canvas-kit/?path=/docs/styling-guides-customizing-styles--docs)
|
|
86
|
+
docs.
|
|
70
87
|
|
|
71
88
|
## Component API
|
|
72
89
|
|
|
@@ -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,6 +1,6 @@
|
|
|
1
|
-
import {SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
1
|
+
import {ExampleCodeBlock, SymbolDoc, Specifications} from '@workday/canvas-kit-docs';
|
|
2
2
|
|
|
3
|
-
import
|
|
3
|
+
import * as Divider from './Divider.stories.ts';
|
|
4
4
|
import Basic from './examples/Basic';
|
|
5
5
|
import CustomSpace from './examples/CustomSpace';
|
|
6
6
|
|
|
@@ -17,17 +17,27 @@ yarn add @workday/canvas-kit-preview-react
|
|
|
17
17
|
|
|
18
18
|
## Usage
|
|
19
19
|
|
|
20
|
-
Use a `Divider` to separate content and create visual hierarchy. Typically they are used between
|
|
20
|
+
Use a `Divider` to separate content and create visual hierarchy. Typically they are used between
|
|
21
|
+
paragraph sections to indicate a break or shift in content. However, they can also be used as
|
|
22
|
+
decorative elements to provide greater emphasis and visual hierarchy.
|
|
21
23
|
|
|
22
24
|
### Basic Example
|
|
23
25
|
|
|
24
|
-
By default, `Divider` renders a `<hr>` (horizontal rule) element with `0.5rem` of margin on top and
|
|
26
|
+
By default, `Divider` renders a `<hr>` (horizontal rule) element with `0.5rem` of margin on top and
|
|
27
|
+
bottom. The `space` prop allows you to adjust the vertical margin evenly. In the example below, the
|
|
28
|
+
`Divider`s provide a subtle deliniation between each profile card without being as visually
|
|
29
|
+
prominent as a `Card`. The `space` is adjusted to `0.25rem` which applied `0.125rem` to the top and
|
|
30
|
+
bottom margin.
|
|
25
31
|
|
|
26
32
|
<ExampleCodeBlock code={Basic} />
|
|
27
33
|
|
|
28
34
|
### Custom Space
|
|
29
35
|
|
|
30
|
-
You might also want to apply custom space to `Divider` where the top and bottom margin are not
|
|
36
|
+
You might also want to apply custom space to `Divider` where the top and bottom margin are not
|
|
37
|
+
equal. The best way to achieve this is with `createStyles` and the `cs` property. In the example
|
|
38
|
+
below, the `Divider` is applied as a decorative element to add emphasis to the section heading.
|
|
39
|
+
Custom styles are defined in the `createStyles` function outside the component and are passed to
|
|
40
|
+
`Divider`'s `cs` prop. These styles remove the top margin and set the bottom margin to `1rem`.
|
|
31
41
|
|
|
32
42
|
<ExampleCodeBlock code={CustomSpace} />
|
|
33
43
|
|