@workday/canvas-kit-docs 5.3.0-next.2 → 5.3.0-next.24

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.
Files changed (100) hide show
  1. package/LICENSE +1 -1
  2. package/dist/commonjs/lib/specs.js +428 -32
  3. package/dist/es6/lib/specs.js +428 -32
  4. package/dist/mdx/6.0-MIGRATION-GUIDE.mdx +560 -0
  5. package/dist/mdx/COMPOUND_COMPONENTS.mdx +31 -30
  6. package/dist/mdx/CONTRIBUTING.mdx +90 -63
  7. package/dist/mdx/labs-react/search-form/SearchForm.mdx +64 -0
  8. package/dist/mdx/labs-react/search-form/examples/Basic.tsx +61 -0
  9. package/dist/mdx/labs-react/search-form/examples/CustomTheme.tsx +72 -0
  10. package/dist/mdx/labs-react/search-form/examples/Grow.tsx +62 -0
  11. package/dist/mdx/labs-react/search-form/examples/PropTables.splitProps.tsx +4 -0
  12. package/dist/mdx/labs-react/search-form/examples/RTL.tsx +70 -0
  13. package/dist/mdx/labs-react/search-form/examples/Theming.tsx +64 -0
  14. package/dist/mdx/preview-react/breadcrumbs/Breadcrumbs.mdx +1 -1
  15. package/dist/mdx/preview-react/form-field/FormField.mdx +27 -0
  16. package/dist/mdx/preview-react/form-field/examples/Custom.tsx +57 -0
  17. package/dist/mdx/preview-react/menu/Menu.mdx +17 -9
  18. package/dist/mdx/preview-react/menu/examples/Basic.tsx +65 -10
  19. package/dist/mdx/preview-react/menu/examples/ContextMenu.tsx +45 -29
  20. package/dist/mdx/preview-react/menu/examples/CustomMenuItem.tsx +2 -2
  21. package/dist/mdx/preview-react/menu/examples/Icons.tsx +1 -1
  22. package/dist/mdx/preview-react/menu/examples/ManyItems.tsx +2 -2
  23. package/dist/mdx/preview-react/text-area/TextArea.mdx +122 -0
  24. package/dist/mdx/preview-react/text-area/examples/Alert.tsx +31 -0
  25. package/dist/mdx/preview-react/text-area/examples/Basic.tsx +17 -0
  26. package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +17 -0
  27. package/dist/mdx/preview-react/text-area/examples/Error.tsx +40 -0
  28. package/dist/mdx/preview-react/text-area/examples/Grow.tsx +17 -0
  29. package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +20 -0
  30. package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +17 -0
  31. package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +17 -0
  32. package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +21 -0
  33. package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +28 -0
  34. package/dist/mdx/preview-react/text-area/examples/Required.tsx +17 -0
  35. package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +22 -0
  36. package/dist/mdx/preview-react/text-input/TextInput.mdx +145 -0
  37. package/dist/mdx/preview-react/text-input/examples/Alert.tsx +40 -0
  38. package/dist/mdx/preview-react/text-input/examples/Basic.tsx +17 -0
  39. package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +17 -0
  40. package/dist/mdx/preview-react/text-input/examples/Error.tsx +40 -0
  41. package/dist/mdx/preview-react/text-input/examples/Grow.tsx +17 -0
  42. package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +20 -0
  43. package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +17 -0
  44. package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +17 -0
  45. package/dist/mdx/preview-react/text-input/examples/LoginForm.tsx +105 -0
  46. package/dist/mdx/preview-react/text-input/examples/Password.tsx +17 -0
  47. package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +17 -0
  48. package/dist/mdx/preview-react/text-input/examples/RefForwarding.tsx +28 -0
  49. package/dist/mdx/preview-react/text-input/examples/Required.tsx +17 -0
  50. package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +46 -0
  51. package/dist/mdx/preview-react/text-input/examples/ThemedError.tsx +37 -0
  52. package/dist/mdx/react/_examples/GlobalHeader.mdx +9 -0
  53. package/dist/mdx/react/_examples/PageHeader.mdx +8 -0
  54. package/dist/mdx/react/_examples/examples/GlobalHeader.tsx +66 -0
  55. package/dist/mdx/react/_examples/examples/PageHeader.tsx +63 -0
  56. package/dist/mdx/react/action-bar/ActionBar.mdx +1 -1
  57. package/dist/mdx/react/button/button/Button.mdx +34 -9
  58. package/dist/mdx/react/button/button/examples/Primary.tsx +10 -1
  59. package/dist/mdx/react/button/button/examples/PrimaryInverse.tsx +14 -0
  60. package/dist/mdx/react/button/button/examples/Secondary.tsx +10 -1
  61. package/dist/mdx/react/button/button/examples/SecondaryInverse.tsx +14 -0
  62. package/dist/mdx/react/button/button/examples/Tertiary.tsx +10 -1
  63. package/dist/mdx/react/button/button/examples/TertiaryInverse.tsx +14 -0
  64. package/dist/mdx/react/button/icon-button/IconButton.mdx +1 -1
  65. package/dist/mdx/react/loading-animation/LoadingAnimation.mdx +5 -0
  66. package/dist/mdx/react/loading-animation/examples/RTL.tsx +16 -0
  67. package/dist/mdx/react/pagination/PropTables.splitprops.tsx +47 -0
  68. package/dist/mdx/react/pagination/examples/{StepControls.tsx → Basic.tsx} +1 -1
  69. package/dist/mdx/react/pagination/examples/GoToForm.tsx +1 -1
  70. package/dist/mdx/react/pagination/examples/HoistedModel.tsx +36 -22
  71. package/dist/mdx/react/pagination/examples/RTL.tsx +1 -1
  72. package/dist/mdx/react/pagination/pagination.mdx +225 -474
  73. package/dist/mdx/react/popup/Popup.mdx +34 -36
  74. package/dist/mdx/react/radio/examples/Alert.tsx +3 -3
  75. package/dist/mdx/react/radio/examples/Basic.tsx +3 -3
  76. package/dist/mdx/react/radio/examples/Disabled.tsx +3 -3
  77. package/dist/mdx/react/radio/examples/Error.tsx +3 -3
  78. package/dist/mdx/react/radio/examples/LabelPosition.tsx +3 -3
  79. package/dist/mdx/react/radio/examples/NoValue.tsx +3 -3
  80. package/dist/mdx/react/radio/examples/RefForwarding.tsx +3 -3
  81. package/dist/mdx/react/radio/examples/Required.tsx +3 -3
  82. package/dist/mdx/react/segmented-control/SegmentedControl.mdx +1 -1
  83. package/dist/mdx/react/tabs/Tabs.mdx +67 -36
  84. package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
  85. package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +41 -13
  86. package/dist/mdx/react/tabs/examples/HoistedModel.tsx +4 -4
  87. package/dist/mdx/react/tabs/examples/Icons.tsx +36 -0
  88. package/dist/mdx/react/tabs/examples/{NamedKeys.tsx → NamedTabs.tsx} +0 -0
  89. package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +58 -0
  90. package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
  91. package/dist/mdx/react/text-area/TextArea.mdx +1 -1
  92. package/dist/mdx/react/toast/toast.mdx +1 -17
  93. package/dist/mdx/react/tooltip/Tooltip.mdx +9 -1
  94. package/dist/mdx/react/tooltip/examples/DelayedTooltip.tsx +16 -0
  95. package/dist/mdx/react/tooltip/examples/Ellipsis.tsx +6 -0
  96. package/package.json +5 -4
  97. package/dist/mdx/CODE_OF_CONDUCT.md +0 -68
  98. package/dist/mdx/preview-react/menu/examples/ContextMenuTarget.tsx +0 -33
  99. package/dist/mdx/preview-react/menu/examples/ControlButton.tsx +0 -84
  100. package/dist/mdx/react/pagination/examples/ShowAdditionalDetails.tsx +0 -52
@@ -0,0 +1,560 @@
1
+ # Canvas Kit 6.0 Migration Guide
2
+
3
+ Below are the breaking changes made in Canvas Kit v6. Please
4
+ [reach out](https://github.com/Workday/canvas-kit/issues/new?labels=bug&template=bug.md) if you have
5
+ any questions about the update.
6
+
7
+ - [Codemod](#codemod)
8
+ - [Component Deprecations](#component-deprecations)
9
+ - [Cookie Banner](#cookie-banner)
10
+ - [Header & Global Header](#header--global-header)
11
+ - [Page Header](#page-header)
12
+ - [Component Migrations](#component-migrations)
13
+ - [Search Bar](#search-bar)
14
+ - [Name Updates](#name-updates)
15
+ - [Depth Tokens](#depth-tokens)
16
+ - [Theme Breakpoint Updates](#theme-breakpoint-updates)
17
+ - [Action Bar](#action-bar)
18
+ - [Tabs Component](#tabs-component)
19
+ - [Button Updates](#button-updates)
20
+ - [Primary Button](#primary-button)
21
+ - [Primary Disabled](#primary-disabled)
22
+ - [Primary Large](#primary-large)
23
+ - [Primary Medium](#primary-medium)
24
+ - [Primary Small](#primary-small)
25
+ - [Primary Extra Small](#primary-extra-small)
26
+ - [Secondary Button](#secondary-button)
27
+ - [Secondary Disabled](#secondary-disabled)
28
+ - [Secondary Large](#secondary-large)
29
+ - [Secondary Medium](#secondary-medium)
30
+ - [Secondary Small](#secondary-small)
31
+ - [Secondary Extra Small](#secondary-extra-small)
32
+ - [Tertiary Button](#tertiary-button)
33
+ - [Tertiary Default](#tertiary-default)
34
+ - [Tertiary Disabled](#tertiary-disabled)
35
+ - [Tertiary Medium](#tertiary-medium)
36
+ - [Tertiary Small](#tertiary-small)
37
+ - [Tertiary Extra Small](#tertiary-extra-small)
38
+
39
+ ## Codemod
40
+
41
+ Please use our [codemod package](https://github.com/Workday/canvas-kit/tree/master/modules/codemod)
42
+ to automatically update your code to work with a majority of the breaking changes in the migration
43
+ from Canvas Kit v5 to v6:
44
+
45
+ ```sh
46
+ > npx @workday/canvas-kit-codemod v6 [path]
47
+ ```
48
+
49
+ > Note: This codemod only works on `.js`, `.jsx`, `.ts`, and `.tsx` extensions. You may need to make
50
+ > some manual changes in other file types (`.json`, `.mdx`, `.md`, etc.).
51
+
52
+ > Note: You may need to run your linter after executing the codemod, as it's resulting formatting
53
+ > (spacing, quotes, etc.) may not match your project's styling.
54
+
55
+ **Breaking changes accounted for by this codemod will be marked with a 🤖.**
56
+
57
+ **Please verify all changes made by the codemod. As a safety precaution, we recommend committing the
58
+ changes from the codemod as a single isolated commit (separate from other changes) so you can
59
+ rollback more easily if necessary.**
60
+
61
+ [Let us know](https://github.com/Workday/canvas-kit/issues/new?labels=bug&template=bug.md) if you
62
+ encounter any issues or use cases that we've missed. The `@workday/canvas-kit-codemod` package will
63
+ help us maintain additional codemod transforms to make future migrations easier.
64
+
65
+ ## Component Deprecations
66
+
67
+ ### Deprecation Types
68
+
69
+ There are two types of deprecations: soft and hard.
70
+
71
+ #### Soft Deprecation
72
+
73
+ A soft-deprecated component is still available with its full functionality, but it will have been
74
+ renamed with a prefix to indicate its soft-deprecated status. It will also include a console warning
75
+ to announce its deprecation. This warning will only be triggered on the component's initial render.
76
+
77
+ Soft-deprecated types and utilities will also be renamed but generally will not trigger a console
78
+ warning.
79
+
80
+ #### Hard Deprecation
81
+
82
+ A hard-deprecated component or package is no longer available. You will need to follow the method
83
+ prescribed in our migration guide to update your application. Please reach out to our team directly
84
+ if you need additional help.
85
+
86
+ ### Cookie Banner
87
+
88
+ We are [soft deprecating](#soft-deprecation) `CookieBanner`. It has been renamed to
89
+ `DeprecatedCookieBanner`. Similarly, `CookieBannerProps` has been renamed to
90
+ `DeprecatedCookieBannerProps`. You may continue to use this component exactly as you did in v5, but
91
+ note that we plan to [hard-deprecate](#hard-deprecation) it in Canvas Kit v7.
92
+
93
+ 🤖 The codemod will rename `CookieBanner` and `CookieBannerProps` to their deprecated names:
94
+
95
+ ```tsx
96
+ // v5
97
+ import CookieBanner, {CookieBannerProps} from '@workday/canvas-kit-react/cookie-banner';
98
+
99
+ export const CustomCookieBanner = (props: CookieBannerProps) => {
100
+ return <CookieBanner notice={CookieBanner.DefaultNotice} {...props} />;
101
+ };
102
+
103
+ // v6
104
+ import DeprecatedCookieBanner, {
105
+ DeprecatedCookieBannerProps,
106
+ } from '@workday/canvas-kit-react/cookie-banner';
107
+
108
+ export const CustomCookieBanner = (props: DeprecatedCookieBannerProps) => {
109
+ return <DeprecatedCookieBanner notice={DeprecatedCookieBanner.DefaultNotice} {...props} />;
110
+ };
111
+ ```
112
+
113
+ ```tsx
114
+ // v5
115
+ import {CookieBanner, CookieBannerProps} from '@workday/canvas-kit-react';
116
+
117
+ interface CustomCookieBannerProps extends CookieBannerProps {
118
+ // custom page header props
119
+ }
120
+
121
+ export const CustomCookieBanner = (props: CustomCookieBannerProps) => {
122
+ return <CookieBanner notice={CookieBanner.DefaultNotice} {...props} />;
123
+ };
124
+
125
+ // v6
126
+ import {DeprecatedCookieBanner, DeprecatedCookieBannerProps} from '@workday/canvas-kit-react';
127
+
128
+ interface CustomCookieBannerProps extends DeprecatedCookieBannerProps {
129
+ // custom page header props
130
+ }
131
+
132
+ export const CustomCookieBanner = (props: CustomCookieBannerProps) => {
133
+ return <DeprecatedCookieBanner notice={DeprecatedCookieBanner.DefaultNotice} {...props} />;
134
+ };
135
+ ```
136
+
137
+ ### Header & Global Header
138
+
139
+ We are [soft deprecating](#soft-deprecation) `Header` and `GlobalHeader` and their related exports.
140
+ They has been renamed to `DeprecatedHeader` and `DeprecatedGlobalHeader`, respectively. You may
141
+ continue to use these components exactly as you did in v5, but note that we plan to
142
+ [hard-deprecate](#hard-deprecation) this package in Canvas Kit v7.
143
+
144
+ > Note: `SearchBar` is not being deprecated but will instead move to its own dedictated package. You
145
+ > can read more [here](#search-bar).
146
+
147
+ 🤖 The codemod will handle all these changes automatically:
148
+
149
+ - Rename import specifiers
150
+ - `DubLogoTitle` becomes `DeprecatedDubLogoTitle`
151
+ - `GlobalHeader` becomes `DeprecatedGlobalHeader`
152
+ - `Header` becomes `DeprecatedHeader`
153
+ - `HeaderHeight` becomes `DeprecatedHeaderHeight`
154
+ - `HeaderTheme` becomes `DeprecatedHeaderTheme`
155
+ - `HeaderVariant` becomes `DeprecatedHeaderVariant`
156
+ - `ThemeAttributes` becomes `DeprecatedHeaderThemeAttributes`
157
+ - `Themes` becomes `DeprecatedHeaderThemes`
158
+ - `WorkdayLogoTitle` becomes `DeprecatedWorkdayLogoTitle`
159
+ - `themes` becomes `deprecatedHeaderThemes`
160
+ - Rename JSX identifiers
161
+ - `<DubLogoTitle>` becomes `<DeprecatedDubLogoTitle>`
162
+ - `<GlobalHeader>` becomes `<DeprecatedGlobalHeader>`
163
+ - `<Header>` becomes `<DeprecatedHeader>`
164
+ - `<WorkdayLogoTitle>` becomes `<DeprecatedWorkdayLogoTitle>`
165
+ - Rename type references and interface declarations
166
+ - `type CustomHeaderHeight = HeaderHeight;` becomes
167
+ `type CustomHeaderHeight = DeprecatedHeaderHeight;`
168
+ - `type CustomHeaderTheme = HeaderTheme;` becomes
169
+ `type CustomHeaderTheme = DeprecatedHeaderTheme;`
170
+ - `type CustomHeaderVariant = HeaderVariant;` becomes
171
+ `type CustomHeaderVariant = DeprecatedHeaderVariant;`
172
+ - `type CustomThemeAttributes = ThemeAttributes;` becomes
173
+ `type CustomThemeAttributes = DeprecatedHeaderThemeAttributes;`
174
+ - `type CustomThemes = Themes;` becomes `type CustomThemes = DeprecatedHeaderThemes;`
175
+ - Rename member expressions
176
+ - `HeaderHeight.Small` becomes `DeprecatedHeaderHeight.Small`
177
+ - `HeaderTheme.White` becomes `DeprecatedHeaderTheme.White`
178
+ - `HeaderVariant.Full` becomes `DeprecatedHeaderVariant.Full`
179
+ - `themes.Blue` becomes `deprecatedHeaderThemes.Blue`
180
+ - `Header.Variant.Global` becomes `DeprecatedHeader.Variant.Global`
181
+
182
+ ```tsx
183
+ // v5
184
+ import Header, {DubLogoTitle, GlobalHeader} from '@workday/canvas-kit-labs-react/header';
185
+
186
+ const CustomGlobalHeader = props => {
187
+ return (
188
+ <GlobalHeader
189
+ brand={
190
+ <a href="#">
191
+ <DubLogoTitle themeColor={Header.Theme.White} />
192
+ </a>
193
+ }
194
+ {...props}
195
+ />
196
+ );
197
+ };
198
+
199
+ // v6
200
+ import DeprecatedHeader, {
201
+ DeprecatedDubLogoTitle,
202
+ DeprecatedGlobalHeader,
203
+ } from '@workday/canvas-kit-labs-react/header';
204
+
205
+ const CustomGlobalHeader = props => {
206
+ return (
207
+ <DeprecatedGlobalHeader
208
+ brand={
209
+ <a href="#">
210
+ <DeprecatedDubLogoTitle themeColor={DeprecatedHeader.Theme.White} />
211
+ </a>
212
+ }
213
+ {...props}
214
+ />
215
+ );
216
+ };
217
+ ```
218
+
219
+ You may continue to use this component exactly as you did in v5, but note that we plan to hard-deprecate it in Canvas Kit v7.
220
+ If you would like to migrate away from this deprecated component now, you can reference [this example](https://workday.github.io/canvas-kit/?path=/story/examples-global-header-react--basic) instead.
221
+
222
+ ### Page Header
223
+
224
+ We are [soft-deprecating](#soft-deprecation) `PageHeader`. It has been renamed to
225
+ `DeprecatedPageHeader`. Similarly, `PageHeaderProps` has been renamed to
226
+ `DeprecatedPageHeaderProps`. You may continue to use this component exactly as you did in v5, but
227
+ note that we plan to [hard-deprecate](#hard-deprecation) it in Canvas Kit v7.
228
+
229
+ 🤖 The codemod will rename `PageHeader` and `PageHeaderProps` to their deprecated names:
230
+
231
+ ```tsx
232
+ // v5
233
+ import PageHeader, {PageHeaderProps} from '@workday/canvas-kit-react/page-header';
234
+
235
+ export const CustomPageHeader = (props: PageHeaderProps) => {
236
+ return <PageHeader {...props} />;
237
+ };
238
+
239
+ // v6
240
+ import DeprecatedPageHeader, {
241
+ DeprecatedPageHeaderProps,
242
+ } from '@workday/canvas-kit-react/page-header';
243
+
244
+ export const CustomPageHeader = (props: DeprecatedPageHeaderProps) => {
245
+ return <DeprecatedPageHeader {...props} />;
246
+ };
247
+ ```
248
+
249
+ ```tsx
250
+ // v5
251
+ import {PageHeader, PageHeaderProps} from '@workday/canvas-kit-react';
252
+
253
+ interface CustomPageHeaderProps extends PageHeaderProps {
254
+ // custom page header props
255
+ }
256
+
257
+ export const CustomPageHeader = (props: CustomPageHeaderProps) => {
258
+ return <PageHeader {...props} />;
259
+ };
260
+
261
+ // v6
262
+ import {DeprecatedPageHeader, DeprecatedPageHeaderProps} from '@workday/canvas-kit-react';
263
+
264
+ interface CustomPageHeaderProps extends DeprecatedPageHeaderProps {
265
+ // custom page header props
266
+ }
267
+
268
+ export const CustomPageHeader = (props: CustomPageHeaderProps) => {
269
+ return <DeprecatedPageHeader {...props} />;
270
+ };
271
+ ```
272
+
273
+ You may continue to use this component exactly as you did in v5, but note that we plan to hard-deprecate it in Canvas Kit v7.
274
+ If you would like to migrate away from this deprecated component now, you can reference [this example](https://workday.github.io/canvas-kit/?path=/story/examples-page-header-react--basic) instead.
275
+
276
+ ## Component Migrations
277
+
278
+ ### Search Bar
279
+
280
+ `SeachBar` is being renamed to `SearchForm` and is moving out of
281
+ `@workday/canvas-kit-labs-react/header` into its own dedicated package,
282
+ `@workday/canvas-kit-labs-react/search-form`. The component has not been modified and you may
283
+ continue to use this component exactly as you did in v5.
284
+
285
+ 🤖 The codemod will handle all these changes automatically:
286
+
287
+ - Rename import sources
288
+ - `@workday/canvas-kit-labs-react/header` becomes `@workday/canvas-kit-labs-react/search-form`
289
+ - Rename import specifiers
290
+ - `SearchBar` becomes `SearchForm`
291
+ - `SearchBarProps` becomes `SearchFormProps`
292
+ - `SearchBarState` becomes `SearchFormState`
293
+ - Rename JSX identifiers
294
+ - `<SearchBar>` becomes `<SearchForm>`
295
+ - Rename type references and interface declarations
296
+ - `type CustomSearchProps = SearchBarProps;` becomes `type CustomSearchProps = SearchFormProps;`
297
+ - `interface CustomSearchProps extends SearchBarProps` becomes
298
+ `interface CustomSearchProps extends SearchFormProps`
299
+
300
+ ```tsx
301
+ // v5
302
+ import {
303
+ SearchBar,
304
+ SearchBarProps,
305
+ SearchBarState,
306
+ SearchThemeAttributes,
307
+ SearchTheme,
308
+ } from '@workday/canvas-kit-labs-react/header';
309
+
310
+ const CustomSearchForm = (props: SearchFormProps) => {
311
+ return <SearchForm searchTheme={SearchTheme.Dark} {...props} />;
312
+ };
313
+
314
+ // v6
315
+ import {
316
+ SearchForm,
317
+ SearchFormProps,
318
+ SearchFormState,
319
+ SearchThemeAttributes,
320
+ SearchTheme,
321
+ } from '@workday/canvas-kit-labs-react/search-form';
322
+
323
+ const CustomSearchForm = (props: SearchFormProps) => {
324
+ return <SearchForm searchTheme={SearchTheme.Dark} {...props} />;
325
+ };
326
+ ```
327
+
328
+ ## Name Updates
329
+
330
+ ### Depth Tokens
331
+
332
+ The `CanvasDepthValue` type has been renamed to `CanvasDepthValues` to be more consistent with our
333
+ other token type names, such as `CanvasBorderRadiusValues`, `CanvasSpaceValues`, and
334
+ `CanvasSpaceNumberValues`.
335
+
336
+ 🤖 The codemod will handle this rename transformation automatically:
337
+
338
+ ```ts
339
+ // v5
340
+ import {CanvasDepthValue} from '@workday/canvas-kit-react/tokens';
341
+
342
+ type CustomDepthValues = CanvasDepthValue;
343
+ interface OtherCustomDepthValues extends CanvasDepthValue {}
344
+
345
+ // v6
346
+ import {CanvasDepthValues} from '@workday/canvas-kit-react/tokens';
347
+
348
+ type CustomDepthValues = CanvasDepthValues;
349
+ interface OtherCustomDepthValues extends CanvasDepthValues {}
350
+ ```
351
+
352
+ ## Theme Breakpoint Updates
353
+
354
+ Our default theme breakpoints have been updated to match the viewport ranges described in our design
355
+ guidelines. We also updated `ActionBar`'s media query to align with this change. Those changes are
356
+ described in [the section below](#action-bar). If you are using these default breakpoints, you will
357
+ need to do visual regression testing to ensure there are no adverse effects to your application's
358
+ layout. If you have questions about this testing, please reach out to our team.
359
+
360
+ Below is a reference table for the V5 and V6 breakpoint values.
361
+
362
+ | Breakpoint Name | V5 Value (px) | V6 Value (px) |
363
+ | --------------- | ------------- | ------------- |
364
+ | `zero` | 0 | 0 |
365
+ | `s` | 600 | 320 |
366
+ | `m` | 900 | 768 |
367
+ | `l` | 1280 | 1024 |
368
+ | `xl` | 1920 | 1440 |
369
+
370
+ Also for reference, these are our viewport ranges:
371
+
372
+ - `small` (`320px` - `767px`) Used for mobile-sized screens
373
+ - `medium` (`768px` - `1023px`) Used for tablet-sized screens
374
+ - `large` - (`1024px` - `1439px`) Used for laptop and small desktop screens
375
+ - `extra-large` (`≥1440px`) Used for very large screens
376
+
377
+ ### Action Bar
378
+
379
+ `ActionBar` was updated to use the new breakpoint values. It previously had two media queries with
380
+ `max-width: 575px`. They now use `max-width: 767.5px` – the upper limit of the `small` range. This
381
+ will have two effects for this component:
382
+
383
+ - Container padding will decrease from `s` (`16px`) to `xxs` (`8px`) on all viewports less than `768px` wide
384
+ - This was previously happening only on viewports less than `576px` wide
385
+ - Button order will be reversed on all viewports less than `768px` wide
386
+ - This was previously happening only on viewports less than `576px` wide
387
+
388
+ These changes in behavior are intentional and expected.
389
+
390
+ ## Tabs Component
391
+
392
+ The Tabs API changed to support a responsive layout
393
+ ([#1325](https://github.com/Workday/canvas-kit/pull/1325)). The model API was updated to support
394
+ more generic behaviors to allow for other components to support responsive layouts using the same
395
+ models and behaviors. The most notable changes were concerning the state and events around tab
396
+ selection. The verb "select" was chosen to more accurately reflect selection for more component
397
+ types. Also selection of lists (which Tabs is based on) can support single or multiple selection.
398
+ Selection is now stored on state as an array of selected keys.
399
+
400
+ ```tsx
401
+ // v5
402
+ const model = useTabsModel({
403
+ shouldActivate,
404
+ onActivate,
405
+ });
406
+
407
+ console.log('Selected tab', model.state.activeTab);
408
+ model.events.activate({tab: tabName});
409
+
410
+ // v6
411
+ const model = useTabsModel({
412
+ shouldSelect,
413
+ onSelect,
414
+ });
415
+
416
+ console.log('Selected tab', model.state.selectedKey[0]);
417
+ model.events.select({id: tabName});
418
+ ```
419
+
420
+ The Tabs component can now handle responsive containers, but the support is not automatic. You must
421
+ use the dynamic API and provide an overflow menu subcomponent. The dynamic API doesn't know the
422
+ shape of your object, so render props must be used to instruct React how to render each item.
423
+
424
+ ```tsx
425
+ // Use `useState` because React will give the same reference each render
426
+ const [items] = React.useState([
427
+ {id: 'first', text: 'First Tab', contents: 'First Tab Content'},
428
+ {id: 'second', text: 'Second Tab', contents: 'Second Tab Content'},
429
+ ]);
430
+
431
+ return (
432
+ <Tabs items={items}>
433
+ <Tabs.List overflowButton={<Tabs.OverflowButton>More</Tabs.OverflowButton>}>
434
+ {item => <Tabs.Item name={item.id}>{item.text}</Tabs.Item>}
435
+ </Tabs.List>
436
+ <Tabs.Menu.Popper>
437
+ <Tabs.Menu.Card maxWidth={300} maxHeight={200}>
438
+ <Tabs.Menu.List>
439
+ {(item: MyTabItem) => <Tabs.Menu.Item name={item.id}>{item.text}</Tabs.Menu.Item>}
440
+ </Tabs.Menu.List>
441
+ </Tabs.Menu.Card>
442
+ </Tabs.Menu.Popper>
443
+ </Tabs>
444
+ );
445
+ ```
446
+
447
+ ## Button Updates
448
+
449
+ All button updates for V6 are limited to our Primary, Secondary, and Tertiary buttons. Most of the
450
+ button updates are small visual adjustments:
451
+
452
+ - We tightened up tighten the spacing for visual balance and added our new type hierarchy.
453
+ - We adjusted icon sizes for uniformity:
454
+ - `large`: `24px` x `24px`
455
+ - `medium`: `20px` x `20px`
456
+ - `small`: `20px` x `20px`
457
+ - `extraSmall`: `18px` x `18px`
458
+ - We also adjusted the opacity for their disabled state so they behave more appropriately on varied
459
+ / dark backgrounds.
460
+
461
+ These changes are automatic when you upgrade and do not require any manual updates in your codebase.
462
+ However, they will likely cause any automated visual regression tests to fail, and you will need to
463
+ update your tests accordingly. We do not expect these minor adjustments to create significant layout
464
+ shifts in your UI. But, as with any visual update, you will want to review your UI to ensure there
465
+ are no adverse effects.
466
+
467
+ We also added some net-new features:
468
+
469
+ - All buttons have a new `extraSmall` size.
470
+ - Icons are now supported for all sizes.
471
+ - `PrimaryButton` has a new `inverse` variant.
472
+
473
+ All these changes are described in detail by button type in the sections below.
474
+
475
+ ### Primary Button
476
+
477
+ #### Primary Disabled State
478
+
479
+ Previously the button's disabled state had a `blueberry200` background, but it now uses the default
480
+ `blueberry400` and sets the entire button to 40% opacity. This creates more consistency for the
481
+ disabled states across all our buttons.
482
+
483
+ #### Primary Large
484
+
485
+ The padding for large `PrimaryButton`s has been slightly adjusted for more visual balance and to
486
+ take up a bit less layout space. Specifically we:
487
+
488
+ - decreased the space between the button icon and text from `12px` to `8px`
489
+ - decreased the space between the button container and the icon from `28px` to `24px`
490
+
491
+ #### Primary Medium
492
+
493
+ The icon size for medium `PrimaryButton`s has been decreased from `24px` to `20px`, but the overall
494
+ height of the button will remain the same.
495
+
496
+ #### Primary Small
497
+
498
+ We now support icons for small `PrimaryButton`s. The icons are `20px` x `20px`.
499
+
500
+ #### Primary Extra Small
501
+
502
+ We added a new size, `extraSmall` to our `PrimaryButton`s. These are particularly helpful for use
503
+ cases where you have dense UI or tight layout constraints such as tables.
504
+
505
+ ### Secondary Button
506
+
507
+ #### Secondary Large
508
+
509
+ The padding for large `SecondaryButton`s has been slightly adjusted for more visual balance and to
510
+ take up a bit less layout space. Specifically we:
511
+
512
+ - decreased the space between the button icon and text from `12px` to `8px`
513
+ - decreased the space between the button container and the icon from `28px` to `24px`
514
+
515
+ #### Secondary Medium
516
+
517
+ The icon size for medium `SecondaryButton`s has been decreased from `24px` to `20px`, but the
518
+ overall height of the button will remain the same.
519
+
520
+ #### Secondary Small
521
+
522
+ We now support icons for small `SecondaryButton`s. The icons are `20px` x `20px`.
523
+
524
+ #### Secondary Extra Small
525
+
526
+ We added a new size, `extraSmall` to our `SecondaryButton`s. These are particularly helpful for use
527
+ cases where you have dense UI or tight layout constraints such as tables.
528
+
529
+ ### Tertiary Button
530
+
531
+ #### Tertiary Default
532
+
533
+ We added an underline to the button text for all states to help distinguish it from the
534
+ `SecondaryButton` and create more visual consistency.
535
+
536
+ #### Tertiary Disabled
537
+
538
+ As with our other buttons, we updated the disabled state to set the entire button to 40% opacity.
539
+ They were previously using our light theme color at 50% opacity for icons and text.
540
+
541
+ #### Tertiary Medium
542
+
543
+ The medium `TertiaryButton` now uses our new type hierarchy and adjusted the padding, but the
544
+ overall size of the button will stay the same. Specifically, we:
545
+
546
+ - decreased the space between the button icon and text from `8px` to `4px`
547
+
548
+ #### Tertiary Small
549
+
550
+ The small `TertiaryButton` now uses our new type hierarchy and adjusted the padding, but the overall
551
+ size of the button will stay the same. Specifically, we:
552
+
553
+ - decreased the space between the button icon and text from `8px` to `4px`
554
+ - increased the container padding outside the button text when an icon is present from `8px` to
555
+ `12px`
556
+
557
+ #### Tertiary Extra Small
558
+
559
+ We added a new size, `extraSmall` to our `TertiaryButton`s. These are particularly helpful for use
560
+ cases where you have dense UI or tight layout constraints such as tables.