@workday/canvas-kit-docs 5.3.15 → 5.4.0-next.1

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 (78) hide show
  1. package/dist/commonjs/lib/specs.js +429 -19
  2. package/dist/es6/lib/specs.js +429 -19
  3. package/dist/mdx/6.0-MIGRATION-GUIDE.mdx +567 -0
  4. package/dist/mdx/COMPOUND_COMPONENTS.mdx +31 -30
  5. package/dist/mdx/TESTING.mdx +30 -6
  6. package/dist/mdx/changelog.stories.mdx +0 -1
  7. package/dist/mdx/labs-react/layout/Stack.mdx +7 -2
  8. package/dist/mdx/labs-react/search-form/SearchForm.mdx +62 -0
  9. package/dist/mdx/labs-react/search-form/examples/Basic.tsx +61 -0
  10. package/dist/mdx/labs-react/search-form/examples/CustomTheme.tsx +72 -0
  11. package/dist/mdx/labs-react/search-form/examples/Grow.tsx +62 -0
  12. package/dist/mdx/labs-react/search-form/examples/PropTables.splitProps.tsx +4 -0
  13. package/dist/mdx/labs-react/search-form/examples/RTL.tsx +70 -0
  14. package/dist/mdx/labs-react/search-form/examples/Theming.tsx +64 -0
  15. package/dist/mdx/preview-react/_examples/SelectWithFormik.mdx +8 -0
  16. package/dist/mdx/preview-react/_examples/TextInputWithFormik.mdx +8 -0
  17. package/dist/mdx/preview-react/_examples/examples/SelectWithFormik.tsx +47 -0
  18. package/dist/mdx/preview-react/_examples/examples/TextInputWithFormik.tsx +105 -0
  19. package/dist/mdx/preview-react/form-field/FormField.mdx +39 -0
  20. package/dist/mdx/preview-react/form-field/examples/Custom.tsx +57 -0
  21. package/dist/mdx/preview-react/form-field/examples/Select.tsx +50 -0
  22. package/dist/mdx/preview-react/side-panel/examples/AlwaysOpen.tsx +1 -1
  23. package/dist/mdx/preview-react/side-panel/examples/Basic.tsx +1 -1
  24. package/dist/mdx/preview-react/side-panel/examples/ExternalControl.tsx +1 -1
  25. package/dist/mdx/preview-react/side-panel/examples/RightOrigin.tsx +1 -1
  26. package/dist/mdx/preview-react/side-panel/examples/Variant.tsx +1 -1
  27. package/dist/mdx/preview-react/text-area/TextArea.mdx +122 -0
  28. package/dist/mdx/preview-react/text-area/examples/Alert.tsx +36 -0
  29. package/dist/mdx/preview-react/text-area/examples/Basic.tsx +17 -0
  30. package/dist/mdx/preview-react/text-area/examples/Disabled.tsx +17 -0
  31. package/dist/mdx/preview-react/text-area/examples/Error.tsx +40 -0
  32. package/dist/mdx/preview-react/text-area/examples/Grow.tsx +17 -0
  33. package/dist/mdx/preview-react/text-area/examples/HiddenLabel.tsx +20 -0
  34. package/dist/mdx/preview-react/text-area/examples/LabelPositionHorizontal.tsx +17 -0
  35. package/dist/mdx/preview-react/text-area/examples/LabelPositionVertical.tsx +17 -0
  36. package/dist/mdx/preview-react/text-area/examples/Placeholder.tsx +17 -0
  37. package/dist/mdx/preview-react/text-area/examples/RefForwarding.tsx +28 -0
  38. package/dist/mdx/preview-react/text-area/examples/Required.tsx +17 -0
  39. package/dist/mdx/preview-react/text-area/examples/ResizeConstraints.tsx +22 -0
  40. package/dist/mdx/preview-react/text-input/TextInput.mdx +138 -0
  41. package/dist/mdx/preview-react/text-input/examples/Alert.tsx +35 -0
  42. package/dist/mdx/preview-react/text-input/examples/Basic.tsx +17 -0
  43. package/dist/mdx/preview-react/text-input/examples/Disabled.tsx +17 -0
  44. package/dist/mdx/preview-react/text-input/examples/Error.tsx +40 -0
  45. package/dist/mdx/preview-react/text-input/examples/Grow.tsx +17 -0
  46. package/dist/mdx/preview-react/text-input/examples/HiddenLabel.tsx +20 -0
  47. package/dist/mdx/preview-react/text-input/examples/LabelPositionHorizontal.tsx +17 -0
  48. package/dist/mdx/preview-react/text-input/examples/LabelPositionVertical.tsx +17 -0
  49. package/dist/mdx/preview-react/text-input/examples/Password.tsx +17 -0
  50. package/dist/mdx/preview-react/text-input/examples/Placeholder.tsx +17 -0
  51. package/dist/mdx/preview-react/text-input/examples/RefForwarding.tsx +28 -0
  52. package/dist/mdx/preview-react/text-input/examples/Required.tsx +17 -0
  53. package/dist/mdx/preview-react/text-input/examples/ThemedAlert.tsx +46 -0
  54. package/dist/mdx/preview-react/text-input/examples/ThemedError.tsx +35 -0
  55. package/dist/mdx/react/_examples/CookieBanner.mdx +8 -0
  56. package/dist/mdx/react/_examples/GlobalHeader.mdx +12 -0
  57. package/dist/mdx/react/_examples/PageHeader.mdx +8 -0
  58. package/dist/mdx/react/_examples/examples/CookieBanner.tsx +97 -0
  59. package/dist/mdx/react/_examples/examples/GlobalHeader.tsx +66 -0
  60. package/dist/mdx/react/_examples/examples/PageHeader.tsx +63 -0
  61. package/dist/mdx/react/button/button/Button.mdx +26 -2
  62. package/dist/mdx/react/button/button/examples/Primary.tsx +10 -1
  63. package/dist/mdx/react/button/button/examples/PrimaryInverse.tsx +14 -0
  64. package/dist/mdx/react/button/button/examples/Secondary.tsx +10 -1
  65. package/dist/mdx/react/button/button/examples/SecondaryInverse.tsx +14 -0
  66. package/dist/mdx/react/button/button/examples/Tertiary.tsx +13 -1
  67. package/dist/mdx/react/button/button/examples/TertiaryInverse.tsx +14 -0
  68. package/dist/mdx/react/popup/examples/FocusRedirect.tsx +2 -1
  69. package/dist/mdx/react/tabs/Tabs.mdx +31 -5
  70. package/dist/mdx/react/tabs/examples/DisabledTab.tsx +1 -1
  71. package/dist/mdx/react/tabs/examples/DynamicTabs.tsx +82 -38
  72. package/dist/mdx/react/tabs/examples/HoistedModel.tsx +4 -4
  73. package/dist/mdx/react/tabs/examples/Icons.tsx +36 -0
  74. package/dist/mdx/react/tabs/examples/{NamedKeys.tsx → NamedTabs.tsx} +0 -0
  75. package/dist/mdx/react/tabs/examples/OverflowTabs.tsx +58 -0
  76. package/dist/mdx/react/tabs/examples/SinglePanel.tsx +1 -1
  77. package/dist/mdx/react/text-area/TextArea.mdx +1 -1
  78. package/package.json +3 -3
@@ -0,0 +1,567 @@
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
220
+ hard-deprecate it in Canvas Kit v7. If you would like to migrate away from this deprecated component
221
+ now, you can reference
222
+ [this example](https://workday.github.io/canvas-kit/?path=/story/examples-global-header-react--basic)
223
+ instead.
224
+
225
+ ### Page Header
226
+
227
+ We are [soft-deprecating](#soft-deprecation) `PageHeader`. It has been renamed to
228
+ `DeprecatedPageHeader`. Similarly, `PageHeaderProps` has been renamed to
229
+ `DeprecatedPageHeaderProps`. You may continue to use this component exactly as you did in v5, but
230
+ note that we plan to [hard-deprecate](#hard-deprecation) it in Canvas Kit v7.
231
+
232
+ 🤖 The codemod will rename `PageHeader` and `PageHeaderProps` to their deprecated names:
233
+
234
+ ```tsx
235
+ // v5
236
+ import PageHeader, {PageHeaderProps} from '@workday/canvas-kit-react/page-header';
237
+
238
+ export const CustomPageHeader = (props: PageHeaderProps) => {
239
+ return <PageHeader {...props} />;
240
+ };
241
+
242
+ // v6
243
+ import DeprecatedPageHeader, {
244
+ DeprecatedPageHeaderProps,
245
+ } from '@workday/canvas-kit-react/page-header';
246
+
247
+ export const CustomPageHeader = (props: DeprecatedPageHeaderProps) => {
248
+ return <DeprecatedPageHeader {...props} />;
249
+ };
250
+ ```
251
+
252
+ ```tsx
253
+ // v5
254
+ import {PageHeader, PageHeaderProps} from '@workday/canvas-kit-react';
255
+
256
+ interface CustomPageHeaderProps extends PageHeaderProps {
257
+ // custom page header props
258
+ }
259
+
260
+ export const CustomPageHeader = (props: CustomPageHeaderProps) => {
261
+ return <PageHeader {...props} />;
262
+ };
263
+
264
+ // v6
265
+ import {DeprecatedPageHeader, DeprecatedPageHeaderProps} from '@workday/canvas-kit-react';
266
+
267
+ interface CustomPageHeaderProps extends DeprecatedPageHeaderProps {
268
+ // custom page header props
269
+ }
270
+
271
+ export const CustomPageHeader = (props: CustomPageHeaderProps) => {
272
+ return <DeprecatedPageHeader {...props} />;
273
+ };
274
+ ```
275
+
276
+ You may continue to use this component exactly as you did in v5, but note that we plan to
277
+ hard-deprecate it in Canvas Kit v7. If you would like to migrate away from this deprecated component
278
+ now, you can reference
279
+ [this example](https://workday.github.io/canvas-kit/?path=/story/examples-page-header-react--basic)
280
+ instead.
281
+
282
+ ## Component Migrations
283
+
284
+ ### Search Bar
285
+
286
+ `SeachBar` is being renamed to `SearchForm` and is moving out of
287
+ `@workday/canvas-kit-labs-react/header` into its own dedicated package,
288
+ `@workday/canvas-kit-labs-react/search-form`. The component has not been modified and you may
289
+ continue to use this component exactly as you did in v5.
290
+
291
+ 🤖 The codemod will handle all these changes automatically:
292
+
293
+ - Rename import sources
294
+ - `@workday/canvas-kit-labs-react/header` becomes `@workday/canvas-kit-labs-react/search-form`
295
+ - Rename import specifiers
296
+ - `SearchBar` becomes `SearchForm`
297
+ - `SearchBarProps` becomes `SearchFormProps`
298
+ - `SearchBarState` becomes `SearchFormState`
299
+ - Rename JSX identifiers
300
+ - `<SearchBar>` becomes `<SearchForm>`
301
+ - Rename type references and interface declarations
302
+ - `type CustomSearchProps = SearchBarProps;` becomes `type CustomSearchProps = SearchFormProps;`
303
+ - `interface CustomSearchProps extends SearchBarProps` becomes
304
+ `interface CustomSearchProps extends SearchFormProps`
305
+
306
+ ```tsx
307
+ // v5
308
+ import {
309
+ SearchBar,
310
+ SearchBarProps,
311
+ SearchBarState,
312
+ SearchThemeAttributes,
313
+ SearchTheme,
314
+ } from '@workday/canvas-kit-labs-react/header';
315
+
316
+ const CustomSearchForm = (props: SearchFormProps) => {
317
+ return <SearchForm searchTheme={SearchTheme.Dark} {...props} />;
318
+ };
319
+
320
+ // v6
321
+ import {
322
+ SearchForm,
323
+ SearchFormProps,
324
+ SearchFormState,
325
+ SearchThemeAttributes,
326
+ SearchTheme,
327
+ } from '@workday/canvas-kit-labs-react/search-form';
328
+
329
+ const CustomSearchForm = (props: SearchFormProps) => {
330
+ return <SearchForm searchTheme={SearchTheme.Dark} {...props} />;
331
+ };
332
+ ```
333
+
334
+ ## Name Updates
335
+
336
+ ### Depth Tokens
337
+
338
+ The `CanvasDepthValue` type has been renamed to `CanvasDepthValues` to be more consistent with our
339
+ other token type names, such as `CanvasBorderRadiusValues`, `CanvasSpaceValues`, and
340
+ `CanvasSpaceNumberValues`.
341
+
342
+ 🤖 The codemod will handle this rename transformation automatically:
343
+
344
+ ```ts
345
+ // v5
346
+ import {CanvasDepthValue} from '@workday/canvas-kit-react/tokens';
347
+
348
+ type CustomDepthValues = CanvasDepthValue;
349
+ interface OtherCustomDepthValues extends CanvasDepthValue {}
350
+
351
+ // v6
352
+ import {CanvasDepthValues} from '@workday/canvas-kit-react/tokens';
353
+
354
+ type CustomDepthValues = CanvasDepthValues;
355
+ interface OtherCustomDepthValues extends CanvasDepthValues {}
356
+ ```
357
+
358
+ ## Theme Breakpoint Updates
359
+
360
+ Our default theme breakpoints have been updated to match the viewport ranges described in our design
361
+ guidelines. We also updated `ActionBar`'s media query to align with this change. Those changes are
362
+ described in [the section below](#action-bar). If you are using these default breakpoints, you will
363
+ need to do visual regression testing to ensure there are no adverse effects to your application's
364
+ layout. If you have questions about this testing, please reach out to our team.
365
+
366
+ Below is a reference table for the V5 and V6 breakpoint values.
367
+
368
+ | Breakpoint Name | V5 Value (px) | V6 Value (px) |
369
+ | --------------- | ------------- | ------------- |
370
+ | `zero` | 0 | 0 |
371
+ | `s` | 600 | 320 |
372
+ | `m` | 900 | 768 |
373
+ | `l` | 1280 | 1024 |
374
+ | `xl` | 1920 | 1440 |
375
+
376
+ Also for reference, these are our viewport ranges:
377
+
378
+ - `small` (`320px` - `767px`) Used for mobile-sized screens
379
+ - `medium` (`768px` - `1023px`) Used for tablet-sized screens
380
+ - `large` - (`1024px` - `1439px`) Used for laptop and small desktop screens
381
+ - `extra-large` (`≥1440px`) Used for very large screens
382
+
383
+ ### Action Bar
384
+
385
+ `ActionBar` was updated to use the new breakpoint values. It previously had two media queries with
386
+ `max-width: 575px`. They now use `max-width: 767.5px` – the upper limit of the `small` range. This
387
+ will have two effects for this component:
388
+
389
+ - Container padding will decrease from `s` (`16px`) to `xxs` (`8px`) on all viewports less than
390
+ `768px` wide
391
+ - This was previously happening only on viewports less than `576px` wide
392
+ - Button order will be reversed on all viewports less than `768px` wide
393
+ - This was previously happening only on viewports less than `576px` wide
394
+
395
+ These changes in behavior are intentional and expected.
396
+
397
+ ## Tabs Component
398
+
399
+ The Tabs API changed to support a responsive layout
400
+ ([#1325](https://github.com/Workday/canvas-kit/pull/1325)). The model API was updated to support
401
+ more generic behaviors to allow for other components to support responsive layouts using the same
402
+ models and behaviors. The most notable changes were concerning the state and events around tab
403
+ selection. The verb "select" was chosen to more accurately reflect selection for more component
404
+ types. Also selection of lists (which Tabs is based on) can support single or multiple selection.
405
+ Selection is now stored on state as an array of selected keys.
406
+
407
+ ```tsx
408
+ // v5
409
+ const model = useTabsModel({
410
+ shouldActivate,
411
+ onActivate,
412
+ });
413
+
414
+ console.log('Selected tab', model.state.activeTab);
415
+ model.events.activate({tab: tabName});
416
+
417
+ // v6
418
+ const model = useTabsModel({
419
+ shouldSelect,
420
+ onSelect,
421
+ });
422
+
423
+ console.log('Selected tab', model.state.selectedKey[0]);
424
+ model.events.select({id: tabName});
425
+ ```
426
+
427
+ The Tabs component can now handle responsive containers, but the support is not automatic. You must
428
+ use the dynamic API and provide an overflow menu subcomponent. The dynamic API doesn't know the
429
+ shape of your object, so render props must be used to instruct React how to render each item.
430
+
431
+ ```tsx
432
+ // Use `useState` because React will give the same reference each render
433
+ const [items] = React.useState([
434
+ {id: 'first', text: 'First Tab', contents: 'First Tab Content'},
435
+ {id: 'second', text: 'Second Tab', contents: 'Second Tab Content'},
436
+ ]);
437
+
438
+ return (
439
+ <Tabs items={items}>
440
+ <Tabs.List overflowButton={<Tabs.OverflowButton>More</Tabs.OverflowButton>}>
441
+ {item => <Tabs.Item name={item.id}>{item.text}</Tabs.Item>}
442
+ </Tabs.List>
443
+ <Tabs.Menu.Popper>
444
+ <Tabs.Menu.Card maxWidth={300} maxHeight={200}>
445
+ <Tabs.Menu.List>
446
+ {(item: MyTabItem) => <Tabs.Menu.Item name={item.id}>{item.text}</Tabs.Menu.Item>}
447
+ </Tabs.Menu.List>
448
+ </Tabs.Menu.Card>
449
+ </Tabs.Menu.Popper>
450
+ </Tabs>
451
+ );
452
+ ```
453
+
454
+ ## Button Updates
455
+
456
+ All button updates for V6 are limited to our Primary, Secondary, and Tertiary buttons. Most of the
457
+ button updates are small visual adjustments:
458
+
459
+ - We tightened up tighten the spacing for visual balance and added our new type hierarchy.
460
+ - We adjusted icon sizes for uniformity:
461
+ - `large`: `24px` x `24px`
462
+ - `medium`: `20px` x `20px`
463
+ - `small`: `20px` x `20px`
464
+ - `extraSmall`: `18px` x `18px`
465
+ - We also adjusted the opacity for their disabled state so they behave more appropriately on varied
466
+ / dark backgrounds.
467
+
468
+ These changes are automatic when you upgrade and do not require any manual updates in your codebase.
469
+ However, they will likely cause any automated visual regression tests to fail, and you will need to
470
+ update your tests accordingly. We do not expect these minor adjustments to create significant layout
471
+ shifts in your UI. But, as with any visual update, you will want to review your UI to ensure there
472
+ are no adverse effects.
473
+
474
+ We also added some net-new features:
475
+
476
+ - All buttons have a new `extraSmall` size.
477
+ - Icons are now supported for all sizes.
478
+ - `PrimaryButton` has a new `inverse` variant.
479
+
480
+ All these changes are described in detail by button type in the sections below.
481
+
482
+ ### Primary Button
483
+
484
+ #### Primary Disabled State
485
+
486
+ Previously the button's disabled state had a `blueberry200` background, but it now uses the default
487
+ `blueberry400` and sets the entire button to 40% opacity. This creates more consistency for the
488
+ disabled states across all our buttons.
489
+
490
+ #### Primary Large
491
+
492
+ The padding for large `PrimaryButton`s has been slightly adjusted for more visual balance and to
493
+ take up a bit less layout space. Specifically we:
494
+
495
+ - decreased the space between the button icon and text from `12px` to `8px`
496
+ - decreased the space between the button container and the icon from `28px` to `24px`
497
+
498
+ #### Primary Medium
499
+
500
+ The icon size for medium `PrimaryButton`s has been decreased from `24px` to `20px`, but the overall
501
+ height of the button will remain the same.
502
+
503
+ #### Primary Small
504
+
505
+ We now support icons for small `PrimaryButton`s. The icons are `20px` x `20px`.
506
+
507
+ #### Primary Extra Small
508
+
509
+ We added a new size, `extraSmall` to our `PrimaryButton`s. These are particularly helpful for use
510
+ cases where you have dense UI or tight layout constraints such as tables.
511
+
512
+ ### Secondary Button
513
+
514
+ #### Secondary Large
515
+
516
+ The padding for large `SecondaryButton`s has been slightly adjusted for more visual balance and to
517
+ take up a bit less layout space. Specifically we:
518
+
519
+ - decreased the space between the button icon and text from `12px` to `8px`
520
+ - decreased the space between the button container and the icon from `28px` to `24px`
521
+
522
+ #### Secondary Medium
523
+
524
+ The icon size for medium `SecondaryButton`s has been decreased from `24px` to `20px`, but the
525
+ overall height of the button will remain the same.
526
+
527
+ #### Secondary Small
528
+
529
+ We now support icons for small `SecondaryButton`s. The icons are `20px` x `20px`.
530
+
531
+ #### Secondary Extra Small
532
+
533
+ We added a new size, `extraSmall` to our `SecondaryButton`s. These are particularly helpful for use
534
+ cases where you have dense UI or tight layout constraints such as tables.
535
+
536
+ ### Tertiary Button
537
+
538
+ #### Tertiary Default
539
+
540
+ We added an underline to the button text for all states to help distinguish it from the
541
+ `SecondaryButton` and create more visual consistency.
542
+
543
+ #### Tertiary Disabled
544
+
545
+ As with our other buttons, we updated the disabled state to set the entire button to 40% opacity.
546
+ They were previously using our light theme color at 50% opacity for icons and text.
547
+
548
+ #### Tertiary Medium
549
+
550
+ The medium `TertiaryButton` now uses our new type hierarchy and adjusted the padding, but the
551
+ overall 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
+
555
+ #### Tertiary Small
556
+
557
+ The small `TertiaryButton` now uses our new type hierarchy and adjusted the padding, but the overall
558
+ size of the button will stay the same. Specifically, we:
559
+
560
+ - decreased the space between the button icon and text from `8px` to `4px`
561
+ - increased the container padding outside the button text when an icon is present from `8px` to
562
+ `12px`
563
+
564
+ #### Tertiary Extra Small
565
+
566
+ We added a new size, `extraSmall` to our `TertiaryButton`s. These are particularly helpful for use
567
+ cases where you have dense UI or tight layout constraints such as tables.