@workday/canvas-kit-docs 14.0.0-alpha.1251-next.0 → 14.0.0-alpha.1253-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 +198 -21
- package/dist/es6/mdx/welcomePage.d.ts.map +1 -1
- package/dist/es6/mdx/welcomePage.js +10 -5
- package/dist/mdx/14.0-UPGRADE-GUIDE.mdx +169 -100
- package/dist/mdx/14.0-VISUAL-CHANGES.mdx +44 -0
- package/dist/mdx/react/common/mdx/Theming.mdx +417 -0
- package/dist/mdx/react/common/mdx/examples/RTL.tsx +54 -0
- package/dist/mdx/react/common/mdx/examples/Theming.tsx +34 -0
- package/dist/mdx/welcome.mdx +2 -13
- package/package.json +6 -6
|
@@ -4,6 +4,15 @@ This guide contains an overview of the changes in Canvas Kit v14. Please
|
|
|
4
4
|
[reach out](https://github.com/Workday/canvas-kit/issues/new?labels=bug&template=bug.md) if you have
|
|
5
5
|
any questions.
|
|
6
6
|
|
|
7
|
+
## Why You Should Upgrade
|
|
8
|
+
|
|
9
|
+
v14.0 Introduces Workday's new brand direction which includes a new color palette and with it, some
|
|
10
|
+
styling updates to our components.
|
|
11
|
+
|
|
12
|
+
- For a list of visual changes, please view our v14 visual changes doc [here](https://workday.github.io/canvas-kit/?path=/docs/guides-upgrade-guides-v14-0-visual-changes--docs).
|
|
13
|
+
|
|
14
|
+
> **Note:** While v14 does not require an upgrade to our v3 tokens, we strongly advise to upgrade to the latest to ensure proper branding.
|
|
15
|
+
|
|
7
16
|
## Table of contents
|
|
8
17
|
|
|
9
18
|
- [Codemod](#codemod)
|
|
@@ -13,32 +22,32 @@ any questions.
|
|
|
13
22
|
- [Theming](#theming)
|
|
14
23
|
- [Canvas Provider](#canvas-provider-)
|
|
15
24
|
- [Component Updates](#component-updates)
|
|
16
|
-
- [Avatar
|
|
17
|
-
- [Branding Changes](#branding-changes)
|
|
25
|
+
- [Avatar (Preview)](#avatar-preview)
|
|
26
|
+
- [Branding Changes](#branding-changes-)
|
|
18
27
|
- [Buttons](#buttons)
|
|
19
|
-
- [Card](#card)
|
|
28
|
+
- [Card](#card-)
|
|
20
29
|
- [Count Badge](#count-badge)
|
|
21
30
|
- [Expandable](#expandable)
|
|
22
|
-
- [Hyperlink
|
|
31
|
+
- [Hyperlink and ExternalHyperlink](#hyperlink-and-external-hyperlink)
|
|
23
32
|
- [Loading Dots](#loading-dots)
|
|
24
|
-
- [Pill](#pill)
|
|
25
|
-
- [
|
|
26
|
-
- [Status Indicator (Preview)](#status-indicator-preview)
|
|
33
|
+
- [Pill (Preview)](#pill-preview)
|
|
34
|
+
- [Search Form (Labs)](#searchform-)
|
|
35
|
+
- [Status Indicator (Preview)](#status-indicator-preview-)
|
|
27
36
|
- [Deprecations](#deprecations)
|
|
28
|
-
- [Avatar
|
|
37
|
+
- [Avatar (Main)](#avatar-in-main)
|
|
29
38
|
- [Combobox (Labs)](#combobox-labs)
|
|
30
39
|
- [Radio (Main)](#radio-main)
|
|
31
|
-
- [
|
|
40
|
+
- [Search Form (Labs)](#searchform-labs)
|
|
32
41
|
- [Segmented Control (Main)](#segmented-control-main)
|
|
33
42
|
- [Side Panel (Main)](#side-panel-main)
|
|
34
43
|
- [Tokens](#tokens)
|
|
35
44
|
- [Removals](#removals)
|
|
36
45
|
- [Deprecated Buttons](#deprecated-buttons)
|
|
37
46
|
- [Input Provider](#input-provider)
|
|
38
|
-
- [Menu (
|
|
39
|
-
- [readyOnlyPillStencil and removeablePillStencil](
|
|
40
|
-
- [Text Area](#text-area)
|
|
41
|
-
- [Text Input](#text-input)
|
|
47
|
+
- [Menu (Preview)](#menu-preview)
|
|
48
|
+
- [readyOnlyPillStencil and removeablePillStencil](#readonlypillstencil-and-removeablepillstencil)
|
|
49
|
+
- [Text Area (Labs)](#text-area)
|
|
50
|
+
- [Text Input (Labs)](#text-input)
|
|
42
51
|
- [Troubleshooting](#troubleshooting)
|
|
43
52
|
- [Glossary](#glossary)
|
|
44
53
|
- [Main](#main)
|
|
@@ -109,7 +118,7 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
109
118
|
## Tokens
|
|
110
119
|
|
|
111
120
|
Canvas Kit v14 now uses `@workday/canvas-tokens-web` v3, which introduces new color palettes and
|
|
112
|
-
|
|
121
|
+
deprecates the old "fruity" color names (for example, use `red` instead of `cinnamon`, `blue` instead
|
|
113
122
|
of `blueberry`, and `green` instead of `greenApple`). We strongly recommend upgrading to
|
|
114
123
|
`@workday/canvas-tokens-web` v3, as using older versions will not match the new brand guidelines or
|
|
115
124
|
color system. Although this dependency upgrade is not required, we've offered migration guides and
|
|
@@ -135,8 +144,7 @@ Follow these guides to migrate:
|
|
|
135
144
|
To better align with the brand refresh, Alert and Warning states are being renamed to Caution for
|
|
136
145
|
better semantics.
|
|
137
146
|
|
|
138
|
-
This change mostly affects how you pass an error state to our input components. In most cases, our
|
|
139
|
-
inputs components should be used with our `FormField` component to ensure correct accessiblity.
|
|
147
|
+
This change mostly affects how you pass an error state to our input components. In most cases, our input components should be used with our `FormField` component to ensure correct accessibility.
|
|
140
148
|
|
|
141
149
|
**Before in v13**
|
|
142
150
|
|
|
@@ -162,8 +170,7 @@ inputs components should be used with our `FormField` component to ensure correc
|
|
|
162
170
|
</FormField>
|
|
163
171
|
```
|
|
164
172
|
|
|
165
|
-
If you are using the error type either from our `Common` package or the one exposed from the
|
|
166
|
-
component, the naming as also changed.
|
|
173
|
+
If you are using the error type either from our `Common` package or the one exposed from the component, the naming has also changed.
|
|
167
174
|
|
|
168
175
|
**Before in v13**
|
|
169
176
|
|
|
@@ -188,7 +195,6 @@ import {TextInput} from '@workday/canvas-kit-react/text-input';
|
|
|
188
195
|
import {Switch} from '@workday/canvas-kit-react/switch';
|
|
189
196
|
import {TextArea} from '@workday/canvas-kit-react/text-area';
|
|
190
197
|
|
|
191
|
-
|
|
192
198
|
someFunction(ErrorType.Caution);
|
|
193
199
|
|
|
194
200
|
<TextInput error={TextInput.ErrorType.Caution} />
|
|
@@ -215,7 +221,11 @@ Canvas Provider has been updated to **remove** default branding colors to ensure
|
|
|
215
221
|
our CSS variables. Instead of generating a palette and shifting the brightness and darkness with
|
|
216
222
|
`chroma.js`, we use `oklch` to generate the palette colors.
|
|
217
223
|
|
|
218
|
-
|
|
224
|
+
Prior to v14, the `CanvasProvider` created a cascade barrier, re definding brand CSS variables under a class, creating a higher specificity. This made it difficult to override brand tokens in certain scenarios. v14 Removes that barrier.
|
|
225
|
+
For more information on what is a cascade barrier, please [view our theming docs here](https://github.com/Workday/canvas-kit/issues). For a mode detailed overview of the changes in v14, please view our [v14 Upgrade Guide](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs#what-is-a-cascade-barrier).
|
|
226
|
+
|
|
227
|
+
**Before in v13**
|
|
228
|
+
In v13, the `useTheme` hook would call `createCanvasTheme` which generated a
|
|
219
229
|
palette given a `main` color via `chroma.js`.
|
|
220
230
|
|
|
221
231
|
```tsx
|
|
@@ -251,7 +261,7 @@ different. If you want more control over the colors, we suggest providing the fu
|
|
|
251
261
|
**Or**
|
|
252
262
|
|
|
253
263
|
```tsx
|
|
254
|
-
<CanvasProvider theme={{canvas: {palette: {primary: {main:
|
|
264
|
+
<CanvasProvider theme={{canvas: {palette: {primary: {main: base.blue600}}}}}>
|
|
255
265
|
<App />
|
|
256
266
|
</CanvasProvider>
|
|
257
267
|
```
|
|
@@ -273,16 +283,18 @@ The reason for this change is to ensure that the CSS variables properly cascade
|
|
|
273
283
|
Before in v13, the `CanvasProvider` would add the brand tokens under a class name, creating a higher
|
|
274
284
|
specificity.
|
|
275
285
|
|
|
286
|
+
For a thorough guide on theming, please view our theming docs [here](https://workday.github.io/canvas-kit/?path=/docs/features-theming-overview--docs).
|
|
287
|
+
|
|
276
288
|
## Component Updates
|
|
277
289
|
|
|
278
|
-
### Avatar
|
|
290
|
+
### Avatar (Preview)
|
|
279
291
|
|
|
280
292
|
**PR:** [#3430](https://github.com/Workday/canvas-kit/pull/3430)
|
|
281
293
|
|
|
282
294
|
A new `Avatar` component has been added to the `@workday/canvas-kit-preview-react` package that
|
|
283
295
|
matches our brand refresh.
|
|
284
296
|
|
|
285
|
-
#### API Changes from
|
|
297
|
+
#### API Changes from Avatar in Main
|
|
286
298
|
|
|
287
299
|
- `Avatar` has a `name` prop. This is required to ensure a fallback if a `url` is not provided. The
|
|
288
300
|
`name` prop also determines the initials and the `alt` text for the image if a `url` is provided.
|
|
@@ -311,7 +323,7 @@ import { Avatar } from '@workday/canvas-kit-react/avatar';
|
|
|
311
323
|
|
|
312
324
|
<Avatar altText="John Doe" size="extraExtraLarge" variant="light" as="div" url={yourImageUrl} />
|
|
313
325
|
|
|
314
|
-
// For Avatars that
|
|
326
|
+
// For Avatars that were buttons
|
|
315
327
|
<Avatar altText="John Doe" size="extraExtraLarge" variant="dark" url={yourImageUrl} />
|
|
316
328
|
```
|
|
317
329
|
|
|
@@ -329,13 +341,15 @@ import { Avatar } from '@workday/canvas-kit-preview-react/avatar';
|
|
|
329
341
|
### Branding Changes 💅
|
|
330
342
|
|
|
331
343
|
Several components have been refactored to reflect our new brand direction. Most of these changes
|
|
332
|
-
revolve around the use of our new brand colors.
|
|
344
|
+
revolve around the use of our new brand colors. For a better guide on what has changed in our v3.0.0
|
|
345
|
+
tokens, please view the Tokens v3.0.0
|
|
346
|
+
[Upgrade Guide](https://workday.github.io/canvas-tokens/?path=/docs/guides-upgrade-guides-v3-overview--docs).
|
|
347
|
+
|
|
348
|
+
> **Note:** If you want a visual diff of the changes, please view the [Visual Changes](https://workday.github.io/canvas-kit/?path=/docs/guides-upgrade-guides-v14-0-visual-changes--docs) guide.
|
|
333
349
|
|
|
334
350
|
The following components have been updated:
|
|
335
351
|
|
|
336
|
-
- `Breadcrumbs`
|
|
337
|
-
- [#3270](https://github.com/Workday/canvas-kit/pull/3270)
|
|
338
|
-
- [#3447](https://github.com/Workday/canvas-kit/pull/3447)
|
|
352
|
+
- `Breadcrumbs` [#3270](https://github.com/Workday/canvas-kit/pull/3270),[#3447](https://github.com/Workday/canvas-kit/pull/3447)
|
|
339
353
|
- `Buttons` [#3394](https://github.com/Workday/canvas-kit/pull/3394)
|
|
340
354
|
- `ColorPicker` (Main) [#3307](https://github.com/Workday/canvas-kit/pull/3307)
|
|
341
355
|
- `ColorPicker` (preview) [#3307](https://github.com/Workday/canvas-kit/pull/3307)
|
|
@@ -351,17 +365,32 @@ The following components have been updated:
|
|
|
351
365
|
|
|
352
366
|
### Buttons
|
|
353
367
|
|
|
354
|
-
#### TertiaryButton
|
|
368
|
+
#### TertiaryButton 🚨
|
|
369
|
+
|
|
370
|
+
**Breaking Changes**
|
|
355
371
|
|
|
356
|
-
The `TertiaryButton` component no longer supports the `isThemable` prop. To customize the appearance
|
|
357
|
-
of `TertiaryButton`, use the `cs` prop for custom styles or the `colors` prop for palette-based
|
|
358
|
-
color overrides.
|
|
372
|
+
- The `TertiaryButton` component no longer supports the `isThemable` prop. To customize the appearance
|
|
373
|
+
of `TertiaryButton`, use the `cs` prop for custom styles or the `colors` prop for palette-based
|
|
374
|
+
color overrides.
|
|
375
|
+
- The shape of `TertiaryButton` has changed to have rounded corners, aligning with other buttons and
|
|
376
|
+
our new brand direction.
|
|
359
377
|
|
|
360
|
-
|
|
361
|
-
|
|
378
|
+
**Before in v13**
|
|
379
|
+
|
|
380
|
+
```tsx
|
|
381
|
+
<TertiaryButton isThemable>Themable Button</TertiaryButton>
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**After in v14**
|
|
385
|
+
|
|
386
|
+
```tsx
|
|
387
|
+
<TertiaryButton cs={{/* custom styles */}}>Custom Button</TertiaryButton>
|
|
388
|
+
// OR
|
|
389
|
+
<TertiaryButton colors={{/* palette colors */}}>Custom Button</TertiaryButton>
|
|
390
|
+
```
|
|
362
391
|
|
|
363
392
|
If you need to override default styles, follow
|
|
364
|
-
[this guide](https://workday.github.io/canvas-kit/?path=/docs/components-buttons--docs#custom-styles)
|
|
393
|
+
[this guide](https://workday.github.io/canvas-kit/?path=/docs/components-buttons--docs#custom-styles).
|
|
365
394
|
|
|
366
395
|
### Card 🚨
|
|
367
396
|
|
|
@@ -370,12 +399,12 @@ If you need to override default styles, follow
|
|
|
370
399
|
We've rebranded the `Card` component to align with our new brand directions and provide better
|
|
371
400
|
visual hierarchy and more flexible styling options. The following changes have been made:
|
|
372
401
|
|
|
373
|
-
#### Default Card No Longer Has Shadow
|
|
402
|
+
#### Default Card No Longer Has a Box Shadow
|
|
374
403
|
|
|
375
|
-
The default `Card` variant no longer includes a shadow, creating a cleaner, flatter appearance that
|
|
404
|
+
The default `Card` variant no longer includes a box shadow, creating a cleaner, flatter appearance that
|
|
376
405
|
aligns with our new brand's emphasis on simplicity and clarity. This is a **visual breaking change**
|
|
377
|
-
that may affect your application's visual hierarchy. If your design requires shadow you can
|
|
378
|
-
through `cs` prop.
|
|
406
|
+
that may affect your application's visual hierarchy. If your design requires shadow you can add it
|
|
407
|
+
through the `cs` prop.
|
|
379
408
|
|
|
380
409
|
**Before in v13**
|
|
381
410
|
|
|
@@ -387,12 +416,15 @@ through `cs` prop.
|
|
|
387
416
|
```
|
|
388
417
|
|
|
389
418
|
**After in v14**
|
|
419
|
+
Only do this if you need a shadow. Otherwise, adhere to the default styling.
|
|
390
420
|
|
|
391
421
|
```tsx
|
|
422
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
423
|
+
|
|
392
424
|
<Card cs={{boxShadow: system.depth[1]}}>
|
|
393
425
|
<Card.Heading>Card Title</Card.Heading>
|
|
394
426
|
<Card.Body>Card content with shadow</Card.Body>
|
|
395
|
-
</Card
|
|
427
|
+
</Card>;
|
|
396
428
|
```
|
|
397
429
|
|
|
398
430
|
#### New Card Variants
|
|
@@ -407,7 +439,7 @@ We've added two new variants to provide more styling flexibility:
|
|
|
407
439
|
The `variant` prop is optional - if no variant is specified, the card will use the default styling.
|
|
408
440
|
|
|
409
441
|
```tsx
|
|
410
|
-
// Default card (no variant prop needed)
|
|
442
|
+
// Default card (no variant prop needed) with a border and no box shadow
|
|
411
443
|
<Card>
|
|
412
444
|
<Card.Heading>Default Card</Card.Heading>
|
|
413
445
|
<Card.Body>Default styling with borders, no shadow</Card.Body>
|
|
@@ -428,11 +460,11 @@ The `variant` prop is optional - if no variant is specified, the card will use t
|
|
|
428
460
|
|
|
429
461
|
#### Gap Instead of Margins
|
|
430
462
|
|
|
431
|
-
We've replaced the individual margins on `Card.Heading` and `Card.Body` with
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
463
|
+
We've replaced the individual margins on `Card.Heading` and `Card.Body` with `gap`. The card now
|
|
464
|
+
uses `display: flex` with `flex-direction: column` by default, and the `gap` prop provides
|
|
465
|
+
consistent spacing between all direct children. This provides more consistent spacing and better
|
|
466
|
+
control over the layout. This is a **visual breaking change** that may affect the spacing between
|
|
467
|
+
card elements.
|
|
436
468
|
|
|
437
469
|
**Before in v13**
|
|
438
470
|
|
|
@@ -466,7 +498,7 @@ emphasis for the badge.
|
|
|
466
498
|
```tsx
|
|
467
499
|
<CountBadge /> // Default count badge with high emphasis
|
|
468
500
|
<CountBadge variant="inverse" /> // Inverse default count badge
|
|
469
|
-
//
|
|
501
|
+
// New emphasis prop
|
|
470
502
|
<CountBadge emphasis="low" /> // Default count badge with low emphasis
|
|
471
503
|
<CountBadge variant="inverse" emphasis="low" /> // Inverse count badge with low emphasis
|
|
472
504
|
```
|
|
@@ -476,9 +508,9 @@ emphasis for the badge.
|
|
|
476
508
|
**PRs:** [#3389](https://github.com/Workday/canvas-kit/pull/3389),
|
|
477
509
|
[#3430](https://github.com/Workday/canvas-kit/pull/3430)
|
|
478
510
|
|
|
479
|
-
- `<Expandable.Target>` hover state has been
|
|
511
|
+
- `<Expandable.Target>` hover state has been updated to use `system.color.bg.alt.soft` instead of
|
|
480
512
|
`system.color.bg.alt.default` to match our new brand directions.
|
|
481
|
-
- The `focus` state has been
|
|
513
|
+
- The `focus` state has been updated to use `system.color.border.primary.default` to ensure the same
|
|
482
514
|
focus state color across all components.
|
|
483
515
|
- `Expandable.Avatar` has been updated to use the `Avatar` component from Preview. This change
|
|
484
516
|
requires that you update the `altText` prop to `name`.
|
|
@@ -487,14 +519,14 @@ emphasis for the badge.
|
|
|
487
519
|
|
|
488
520
|
These changes are only **visual** and should not affect the functionality of the component.
|
|
489
521
|
|
|
490
|
-
### Hyperlink and
|
|
522
|
+
### Hyperlink and ExternalHyperlink
|
|
491
523
|
|
|
492
524
|
**PR:** [#3390](https://github.com/Workday/canvas-kit/pull/3390)
|
|
493
525
|
|
|
494
526
|
- `Hyperlink` and `ExternalHyperlink` now have a `standalone` and `standaloneInverse` variant. This
|
|
495
527
|
removes the underline text decoration for use outside the context of body text.
|
|
496
528
|
|
|
497
|
-
**
|
|
529
|
+
**Hyperlink and ExternalHyperlink in v14**
|
|
498
530
|
|
|
499
531
|
```tsx
|
|
500
532
|
<Hyperlink variant="standalone" href="#hyperlink">Hyperlink</Hyperlink>
|
|
@@ -510,16 +542,19 @@ These changes are only **visual** and should not affect the functionality of the
|
|
|
510
542
|
|
|
511
543
|
**PR:** [#3393](https://github.com/Workday/canvas-kit/pull/3393)
|
|
512
544
|
|
|
513
|
-
- We've updated the colors to match brand refresh. The default color changes from
|
|
545
|
+
- We've updated the colors to match our brand refresh. The default color changes from
|
|
514
546
|
`system.color.bg.alt.strong` to `system.color.bg.muted.strong`.
|
|
515
|
-
- `LoadingDots` now has
|
|
547
|
+
- `LoadingDots` now has an `inverse` variant. Use this variant when the Loading Dots are on a dark
|
|
516
548
|
background or image.
|
|
517
549
|
|
|
550
|
+
**After in v14**
|
|
551
|
+
|
|
518
552
|
```tsx
|
|
553
|
+
// Use inverse variant when the Loading Dots are on a dark background or image
|
|
519
554
|
<LoadingDots variant="inverse" />
|
|
520
555
|
```
|
|
521
556
|
|
|
522
|
-
### Pill
|
|
557
|
+
### Pill (Preview)
|
|
523
558
|
|
|
524
559
|
**PRs:** [#3430](https://github.com/Workday/canvas-kit/pull/3430),
|
|
525
560
|
[#3446](https://github.com/Workday/canvas-kit/pull/3446)
|
|
@@ -532,7 +567,7 @@ These changes are only **visual** and should not affect the functionality of the
|
|
|
532
567
|
- The `Pill` component no longer supports `'default'` as a value for the `variant` prop. If the
|
|
533
568
|
`variant` prop is not provided, the component will use its default styling.
|
|
534
569
|
|
|
535
|
-
- `readyOnlyPillStencil` and `removeablePillStencil` have been removed due to some styling
|
|
570
|
+
- `readyOnlyPillStencil` and `removeablePillStencil` have been removed due to some styling cleanup.
|
|
536
571
|
Please use `pillStencil` instead.
|
|
537
572
|
|
|
538
573
|
**Before in v13**
|
|
@@ -553,7 +588,7 @@ These changes are only **visual** and should not affect the functionality of the
|
|
|
553
588
|
</Pill>
|
|
554
589
|
```
|
|
555
590
|
|
|
556
|
-
###
|
|
591
|
+
### SearchForm 🚨
|
|
557
592
|
|
|
558
593
|
**PR:** [#3303](https://github.com/Workday/canvas-kit/pull/3303)
|
|
559
594
|
|
|
@@ -564,20 +599,19 @@ These changes are only **visual** and should not affect the functionality of the
|
|
|
564
599
|
|
|
565
600
|
```tsx
|
|
566
601
|
const customTheme = {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
602
|
+
background: colors.cinnamon600,
|
|
603
|
+
backgroundFocus: colors.frenchVanilla100,
|
|
604
|
+
placeholderColor: colors.frenchVanilla100,
|
|
605
|
+
placeholderColorFocus: colors.blackPepper400,
|
|
606
|
+
boxShadow: ['10px 5px 5px red', '60px -16px teal'],
|
|
607
|
+
boxShadowFocus: ['10px 5px 5px red', '60px -16px teal']
|
|
573
608
|
} as SearchThemeAttributes;
|
|
574
|
-
//...
|
|
575
609
|
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
610
|
+
<SearchForm
|
|
611
|
+
searchTheme={customTheme}
|
|
612
|
+
autocompleteItems={menuItems}
|
|
613
|
+
onInputChange={filterMenuItems}
|
|
614
|
+
onSubmit={handleSubmit}
|
|
581
615
|
/>
|
|
582
616
|
```
|
|
583
617
|
|
|
@@ -592,14 +626,13 @@ const customTheme = {
|
|
|
592
626
|
boxShadow: '10px 5px 5px red',
|
|
593
627
|
boxShadowFocus: '10px 5px 5px red',
|
|
594
628
|
} as SearchThemeAttributes;
|
|
595
|
-
//...
|
|
596
629
|
|
|
597
630
|
<SearchForm
|
|
598
631
|
searchTheme={customTheme}
|
|
599
632
|
autocompleteItems={menuItems}
|
|
600
633
|
onInputChange={filterMenuItems}
|
|
601
634
|
onSubmit={handleSubmit}
|
|
602
|
-
|
|
635
|
+
/>
|
|
603
636
|
```
|
|
604
637
|
|
|
605
638
|
- `SearchTheme` enum type has been updated to have string values `light`, `dark` and `transparent`.
|
|
@@ -610,20 +643,40 @@ const customTheme = {
|
|
|
610
643
|
|
|
611
644
|
**PR:** [#3287](https://github.com/Workday/canvas-kit/pull/3287)
|
|
612
645
|
|
|
613
|
-
Preview `StatusIndicator` is
|
|
646
|
+
Preview `StatusIndicator` is rounder and more vibrant with base emphasis (`low`).
|
|
614
647
|
|
|
615
648
|
Variant names of the preview `StatusIndicator` have been updated by the following mapping:
|
|
616
649
|
|
|
617
|
-
- `blue`
|
|
618
|
-
- `green`
|
|
619
|
-
- `orange`
|
|
620
|
-
- `red`
|
|
621
|
-
- `gray`
|
|
650
|
+
- `blue` → `primary`
|
|
651
|
+
- `green` → `success`
|
|
652
|
+
- `orange` → `caution`
|
|
653
|
+
- `red` → `critical`
|
|
654
|
+
- `gray` → `neutral`
|
|
622
655
|
|
|
623
656
|
The `StatusIndicatorVariant` type has been updated to contain the new variant names listed above. If
|
|
624
657
|
you use the old variant values, update to use the new ones mapped above. It has also been
|
|
625
658
|
deprecated. Use `StatusIndicatorProps['variant']` instead.
|
|
626
659
|
|
|
660
|
+
**Before in v13**
|
|
661
|
+
|
|
662
|
+
```tsx
|
|
663
|
+
<StatusIndicator variant="blue" />
|
|
664
|
+
<StatusIndicator variant="green" />
|
|
665
|
+
<StatusIndicator variant="orange" />
|
|
666
|
+
<StatusIndicator variant="red" />
|
|
667
|
+
<StatusIndicator variant="gray" />
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
**After in v14**
|
|
671
|
+
|
|
672
|
+
```tsx
|
|
673
|
+
<StatusIndicator variant="primary" />
|
|
674
|
+
<StatusIndicator variant="success" />
|
|
675
|
+
<StatusIndicator variant="caution" />
|
|
676
|
+
<StatusIndicator variant="critical" />
|
|
677
|
+
<StatusIndicator variant="neutral" />
|
|
678
|
+
```
|
|
679
|
+
|
|
627
680
|
## Deprecations
|
|
628
681
|
|
|
629
682
|
We add the [@deprecated](https://jsdoc.app/tags-deprecated.html) JSDoc tag to code we plan to remove
|
|
@@ -642,10 +695,10 @@ We've deprecated the `Avatar` component in `@workday/canvas-kit-react` Main pack
|
|
|
642
695
|
```tsx
|
|
643
696
|
import { Avatar } from '@workday/canvas-kit-react/avatar';
|
|
644
697
|
|
|
645
|
-
// For Avatars that
|
|
698
|
+
// For Avatars that were divs
|
|
646
699
|
<Avatar altText="John Doe" size="extraExtraLarge" as="div" url={yourImageUrl} />
|
|
647
700
|
|
|
648
|
-
// For Avatars that
|
|
701
|
+
// For Avatars that were buttons
|
|
649
702
|
<Avatar altText="John Doe" onClick={() => console.log('Avatar clicked')} />
|
|
650
703
|
```
|
|
651
704
|
|
|
@@ -654,8 +707,8 @@ import { Avatar } from '@workday/canvas-kit-react/avatar';
|
|
|
654
707
|
```tsx
|
|
655
708
|
import {Avatar} from '@workday/canvas-kit-preview-react/avatar';
|
|
656
709
|
// name is used as a fallback if the image url is broken or still loading
|
|
657
|
-
// variant
|
|
658
|
-
<Avatar name="John Doe" size="extraExtraLarge" variant="teal" url={yourImageUrl}
|
|
710
|
+
// variant defines the color of the Avatar
|
|
711
|
+
<Avatar name="John Doe" size="extraExtraLarge" variant="teal" url={yourImageUrl} />
|
|
659
712
|
```
|
|
660
713
|
|
|
661
714
|
If you need to render a `button` element use the `BaseAvatar` component.
|
|
@@ -671,7 +724,7 @@ import {BaseAvatar} from '@workday/canvas-kit-preview-react/avatar';
|
|
|
671
724
|
onClick={() => console.log('Avatar clicked')}
|
|
672
725
|
>
|
|
673
726
|
<BaseAvatar.Name name="John Doe" />
|
|
674
|
-
</BaseAvatar
|
|
727
|
+
</BaseAvatar>
|
|
675
728
|
```
|
|
676
729
|
|
|
677
730
|
### Combobox (Labs)
|
|
@@ -687,7 +740,7 @@ The Radio component in `@workday/canvas-kit-react/radio` has been deprecated. Pl
|
|
|
687
740
|
[Radio](https://workday.github.io/canvas-kit/?path=/docs/components-inputs-radio--docs) component
|
|
688
741
|
from the same package, which offers improved accessibility and API consistency.
|
|
689
742
|
|
|
690
|
-
###
|
|
743
|
+
### SearchForm (Labs)
|
|
691
744
|
|
|
692
745
|
**PR:** [#3469](https://github.com/Workday/canvas-kit/pull/3469)
|
|
693
746
|
|
|
@@ -714,9 +767,9 @@ functionality.
|
|
|
714
767
|
|
|
715
768
|
The legacy tokens from `@workday/canvas-kit-react/tokens` are now deprecated. Please use the new
|
|
716
769
|
[Canvas Tokens Web](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs)
|
|
717
|
-
package (`@workday/canvas-tokens-web`) for all token usage. Follow
|
|
718
|
-
[
|
|
719
|
-
for
|
|
770
|
+
package (`@workday/canvas-tokens-web`) for all token usage. Follow the
|
|
771
|
+
[migration guide](https://workday.github.io/canvas-kit?path=/docs/guides-tokens-migration-overview--docs)
|
|
772
|
+
for a smoother upgrade.
|
|
720
773
|
|
|
721
774
|
## Removals
|
|
722
775
|
|
|
@@ -730,10 +783,10 @@ promoted or replaced a component or utility.
|
|
|
730
783
|
Long overdue, but a sign of moving forward, we are removing our `DeprecatedButton`. Our design
|
|
731
784
|
system supported this for quite some time, but with the advancement in theming, our components API
|
|
732
785
|
and our flexibility, it is time for us to finally remove this component. This component has served
|
|
733
|
-
as a reminder of how far we've come and
|
|
786
|
+
as a reminder of how far we've come and we're thankful for this change.
|
|
734
787
|
|
|
735
|
-
|
|
736
|
-
and themable buttons like `PrimaryButton`, `
|
|
788
|
+
Although unlikely, if you were using `DeprecatedButton` please use our flexible
|
|
789
|
+
and themable buttons like `PrimaryButton`, `SecondaryButton` or `TertiaryButton`.
|
|
737
790
|
|
|
738
791
|
### Input Provider
|
|
739
792
|
|
|
@@ -745,7 +798,7 @@ browser heuristics to determine when an element should receive visual focus styl
|
|
|
745
798
|
information, please view the
|
|
746
799
|
[MDN docs on `:focus-visible`](https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible).
|
|
747
800
|
|
|
748
|
-
If you are trying to apply focus styles to our components, we strongly
|
|
801
|
+
If you are trying to apply focus styles to our components, we strongly advise using the `:focus-visible`
|
|
749
802
|
pseudo selector.
|
|
750
803
|
|
|
751
804
|
```tsx
|
|
@@ -759,11 +812,11 @@ const buttonStyles = createStyles({
|
|
|
759
812
|
})
|
|
760
813
|
|
|
761
814
|
<PrimaryButton cs={buttonStyles}>
|
|
762
|
-
|
|
815
|
+
Click Me
|
|
763
816
|
</PrimaryButton>
|
|
764
817
|
```
|
|
765
818
|
|
|
766
|
-
### Menu (
|
|
819
|
+
### Menu (Preview)
|
|
767
820
|
|
|
768
821
|
**PR:** [#3353](https://github.com/Workday/canvas-kit/pull/3353)
|
|
769
822
|
|
|
@@ -776,7 +829,7 @@ We've removed `Menu` from `@workday/canvas-kit-preview-react` package. Please us
|
|
|
776
829
|
The `readyOnlyPillStencil` and `removeablePillStencil` utilities have been removed from the Pill
|
|
777
830
|
package. Please use `pillStencil` instead.
|
|
778
831
|
|
|
779
|
-
### Text Area (
|
|
832
|
+
### Text Area (Preview)
|
|
780
833
|
|
|
781
834
|
**PR:** [#3471](https://github.com/Workday/canvas-kit/pull/3471)
|
|
782
835
|
|
|
@@ -846,19 +899,35 @@ import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
|
846
899
|
|
|
847
900
|
## Troubleshooting
|
|
848
901
|
|
|
849
|
-
|
|
902
|
+
### Common Issues
|
|
903
|
+
|
|
904
|
+
- **Dependency Conflicts**: When upgrading to the latest major version of Canvas Kit, all related Canvas Kit packages should
|
|
850
905
|
be updated at the same time:
|
|
851
|
-
- `"@workday/canvas-kit-react": "^13.5.6"`
|
|
852
|
-
- `"@workday/canvas-kit-styling": "^13.5.6"`
|
|
853
|
-
- `"@workday/canvas-kit-preview-react": "^13.5.6"`
|
|
906
|
+
- `"@workday/canvas-kit-react": "^13.5.6"` → `"@workday/canvas-kit-react": "^14.0.0"`
|
|
907
|
+
- `"@workday/canvas-kit-styling": "^13.5.6"` → `"@workday/canvas-kit-styling": "^14.0.0"`
|
|
908
|
+
- `"@workday/canvas-kit-preview-react": "^13.5.6"` →
|
|
854
909
|
`"@workday/canvas-kit-preview-react": "^14.0.0"`
|
|
855
|
-
- `"@workday/canvas-kit-labs-react": "^13.5.6"`
|
|
856
|
-
|
|
910
|
+
- `"@workday/canvas-kit-labs-react": "^13.5.6"` → `"@workday/canvas-kit-labs-react": "^14.0.0"`
|
|
911
|
+
|
|
912
|
+
- **Token Issues**: Our components rely on the `@workday/canvas-tokens-web` package which provides our CSS variables
|
|
857
913
|
and ensures the correct styling of our components. Make sure to upgrade to the latest version of
|
|
858
914
|
Canvas Tokens Web and install it correctly. For more information,
|
|
859
915
|
[view our docs](https://workday.github.io/canvas-tokens/?path=/docs/docs-getting-started--docs).
|
|
860
916
|
|
|
917
|
+
- **Color Discrepancies**: If you notice visual differences after upgrading, this may be due to the change from `chroma.js` to `oklch` color generation. Consider providing explicit color values in your theme configuration.
|
|
918
|
+
|
|
919
|
+
- **Build Errors**: If you encounter build errors after running the codemod, ensure your linter is run as the codemod's formatting may not match your project conventions.
|
|
920
|
+
|
|
861
921
|
## Glossary
|
|
862
922
|
|
|
863
|
-
For an overview of the different packages we provide,
|
|
864
|
-
[here](https://workday.github.io/canvas-kit/?path=/docs/guides-packages--docs).
|
|
923
|
+
For an overview of the different packages we provide, please view our docs
|
|
924
|
+
[here](https://workday.github.io/canvas-kit/?path=/docs/guides-packages--docs).
|
|
925
|
+
|
|
926
|
+
### Main
|
|
927
|
+
Components in the Main package are stable and ready for production use.
|
|
928
|
+
|
|
929
|
+
### Preview
|
|
930
|
+
Components in the Preview package are mostly stable but may still receive breaking changes before being promoted to Main.
|
|
931
|
+
|
|
932
|
+
### Labs
|
|
933
|
+
Components in the Labs package are experimental and may receive significant changes or be removed entirely.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {Graphic} from '@workday/canvas-kit-react/icon';
|
|
2
|
+
|
|
3
|
+
import avatarImage from './images/v14-avatar.png';
|
|
4
|
+
import breadcrumbsImage from './images/v14-breadcrumbs.png';
|
|
5
|
+
import cardImage from './images/v14-card.png';
|
|
6
|
+
import checkboxImage from './images/v14-checkbox.png';
|
|
7
|
+
import countBadgeImage from './images/v14-count-badge.png';
|
|
8
|
+
import expandableImage from './images/v14-expandable.png';
|
|
9
|
+
import infoHighlightImage from './images/v14-info-highlight.png';
|
|
10
|
+
import loadingDotsImage from './images/v14-loading-dots.png';
|
|
11
|
+
import pillImage from './images/v14-pill.png';
|
|
12
|
+
import primaryButtonImage from './images/v14-primary-button.png';
|
|
13
|
+
import radioImage from './images/v14-radio.png';
|
|
14
|
+
import secondaryButtonImage from './images/v14-secondary-button.png';
|
|
15
|
+
import selectImage from './images/v14-select.png';
|
|
16
|
+
import statusIndicatorImage from './images/v14-status-indicator-preview.png';
|
|
17
|
+
import tabsImage from './images/v14-tabs.png';
|
|
18
|
+
import tertiaryButtonImage from './images/v14-tertiary-button.png';
|
|
19
|
+
import textAreaImage from './images/v14-text-area.png';
|
|
20
|
+
import textInputImage from './images/v14-text-input.png';
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# Canvas Kit 14.0 Visual Changes
|
|
24
|
+
|
|
25
|
+
This guide contains an overview of the changes in Canvas Kit v14. If you have any issues, feel free to report them [here](https://github.com/Workday/canvas-kit/issues). For a mode detailed overview of the changes in v14, please view our [v14 Upgrade Guide](https://workday.github.io/canvas-kit/?path=/docs/guides-upgrade-guides-v14-0-overview--docs).
|
|
26
|
+
|
|
27
|
+
<Graphic src={{url: avatarImage}} />
|
|
28
|
+
<Graphic src={{url: breadcrumbsImage}} />
|
|
29
|
+
<Graphic src={{url: cardImage}} />
|
|
30
|
+
<Graphic src={{url: checkboxImage}} />
|
|
31
|
+
<Graphic src={{url: countBadgeImage}} />
|
|
32
|
+
<Graphic src={{url: expandableImage}} />
|
|
33
|
+
<Graphic src={{url: infoHighlightImage}} />
|
|
34
|
+
<Graphic src={{url: loadingDotsImage}} />
|
|
35
|
+
<Graphic src={{url: pillImage}} />
|
|
36
|
+
<Graphic src={{url: primaryButtonImage}} />
|
|
37
|
+
<Graphic src={{url: radioImage}} />
|
|
38
|
+
<Graphic src={{url: secondaryButtonImage}} />
|
|
39
|
+
<Graphic src={{url: selectImage}} />
|
|
40
|
+
<Graphic src={{url: statusIndicatorImage}} />
|
|
41
|
+
<Graphic src={{url: tabsImage}} />
|
|
42
|
+
<Graphic src={{url: tertiaryButtonImage}} />
|
|
43
|
+
<Graphic src={{url: textAreaImage}} />
|
|
44
|
+
<Graphic src={{url: textInputImage}} />
|