@workday/canvas-kit-mcp 15.0.0-alpha.0074-next.0 → 15.0.0-alpha.0076-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/lib/theming.md
CHANGED
|
@@ -23,9 +23,12 @@ developer experience, and greater flexibility for theming applications.
|
|
|
23
23
|
> If your application renders within an environment that already imports these CSS variables, \*\*do
|
|
24
24
|
> not re-
|
|
25
25
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
```tsx
|
|
27
|
+
<CanvasProvider theme={{canvas: {palette: {primary: {main: 'purple'}}}}}>
|
|
28
|
+
{' '}
|
|
29
|
+
<App />{' '}
|
|
30
|
+
</CanvasProvider>
|
|
31
|
+
```
|
|
29
32
|
|
|
30
33
|
This would use `chroma.js` to generate a palette based on the `main` color provided.
|
|
31
34
|
|
|
@@ -57,7 +60,7 @@ precedence. Take the following example:
|
|
|
57
60
|
.my-app {
|
|
58
61
|
--cnvs-brand-primary-base: red;
|
|
59
62
|
}
|
|
60
|
-
|
|
63
|
+
```
|
|
61
64
|
|
|
62
65
|
In the case of the `CanvasProvider` prior to v14, all our brand tokens where defined within a class
|
|
63
66
|
and scoped to the `div` that the `CanvasProvider` created. This meant that anything set on `:root`
|
|
@@ -18,65 +18,49 @@ visual reference of what's changed.**
|
|
|
18
18
|
|
|
19
19
|
## Table of Contents
|
|
20
20
|
|
|
21
|
-
- [
|
|
22
|
-
|
|
23
|
-
- [
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
- [LLM Assisted Migration](#llm-assisted-migration)
|
|
22
|
+
- [Codemod](#codemod)
|
|
23
|
+
- [Instructions](#instructions)
|
|
24
|
+
- [Tokens](#tokens)
|
|
25
|
+
- [Caution Naming](#caution-naming)
|
|
26
|
+
- [Theming](#theming)
|
|
27
|
+
- [New Documentation](#new-documentation)
|
|
28
|
+
- [Canvas Provider](#canvas-provider-)
|
|
29
|
+
- [Component Updates](#component-updates)
|
|
30
|
+
- [Avatar (Preview)](#avatar-preview)
|
|
31
|
+
- [Branding Changes](#branding-changes-)
|
|
32
|
+
- [Buttons](#buttons)
|
|
33
|
+
- [Card](#card-)
|
|
34
|
+
- [Count Badge](#count-badge)
|
|
35
|
+
- [Expandable](#expandable)
|
|
36
|
+
- [Hyperlink and External Hyperlink](#hyperlink-and-external-hyperlink)
|
|
37
|
+
- [Loading Dots](#loading-dots)
|
|
38
|
+
- [Modals and Dialogs](#modals-and-dialogs)
|
|
39
|
+
- [Pill (Preview)](#pill-preview)
|
|
40
|
+
- [Search Form (Labs)](#search-form-labs-)
|
|
41
|
+
- [Status Indicator (Preview)](#status-indicator-preview-)
|
|
42
|
+
- [Icons](#icons)
|
|
43
|
+
- [Deprecations](#deprecations)
|
|
44
|
+
- [Avatar (Main)](#avatar-in-main)
|
|
45
|
+
- [Combobox (Labs)](#combobox-labs)
|
|
46
|
+
- [Radio (Main)](#radio-main)
|
|
47
|
+
- [Search Form (Labs)](#searchform-labs)
|
|
48
|
+
- [Segmented Control (Main)](#segmented-control-main)
|
|
49
|
+
- [Side Panel (Main)](#side-panel-main)
|
|
27
50
|
- [Tokens](#tokens)
|
|
28
|
-
- [
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
- [
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- [Removed Box Shadow](#removed-box-shadow)
|
|
42
|
-
- [New Card Variants](#new-card-variants)
|
|
43
|
-
- [Replaced Margins with Gap](#replaced-margins-with-gap)
|
|
44
|
-
- [Count Badge](#count-badge)
|
|
45
|
-
- [Expandable](#expandable)
|
|
46
|
-
- [Hyperlink and External Hyperlink](#hyperlink-and-external-hyperlink)
|
|
47
|
-
- [Loading Dots](#loading-dots)
|
|
48
|
-
- [Pill (Preview)](#pill-preview)
|
|
49
|
-
- [Modals and Dialogs](#modals-and-dialogs)
|
|
50
|
-
- [Scoped Theming vs Global Theming](#scoped-theming-vs-global-theming)
|
|
51
|
-
- [Search Form (Labs) 🚨](#search-form-labs-)
|
|
52
|
-
- [Status Indicator (Preview) 🚨](#status-indicator-preview-)
|
|
53
|
-
- [Icons](#icons)
|
|
54
|
-
- [Deprecations](#deprecations)
|
|
55
|
-
- [Avatar in Main](#avatar-in-main)
|
|
56
|
-
- [Combobox (Labs)](#combobox-labs)
|
|
57
|
-
- [Radio (Main)](#radio-main)
|
|
58
|
-
- [SearchForm (Labs)](#searchform-labs)
|
|
59
|
-
- [Segmented Control (Main)](#segmented-control-main)
|
|
60
|
-
- [Side Panel (Main)](#side-panel-main)
|
|
61
|
-
- [Tokens](#tokens-1)
|
|
62
|
-
- [Removals](#removals)
|
|
63
|
-
- [Deprecated Buttons](#deprecated-buttons)
|
|
64
|
-
- [Input Provider](#input-provider)
|
|
65
|
-
- [Menu (Preview)](#menu-preview)
|
|
66
|
-
- [readOnlyPillStencil and removeablePillStencil](#readonlypillstencil-and-removeablepillstencil)
|
|
67
|
-
- [Text Area (Preview)](#text-area-preview)
|
|
68
|
-
- [Text Input (Preview)](#text-input-preview)
|
|
69
|
-
- [Troubleshooting](#troubleshooting)
|
|
70
|
-
- [Common Issues](#common-issues)
|
|
71
|
-
- [Glossary](#glossary)
|
|
72
|
-
- [Main](#main)
|
|
73
|
-
- [Preview](#preview)
|
|
74
|
-
- [Labs](#labs)
|
|
75
|
-
- [Codemod Reference](#codemod-reference)
|
|
76
|
-
- [What is a Codemod?](#what-is-a-codemod)
|
|
77
|
-
- [Running a Codemod](#running-a-codemod)
|
|
78
|
-
- [Instructions](#instructions-1)
|
|
79
|
-
- [Codemod Transformations for v14](#codemod-transformations-for-v14)
|
|
51
|
+
- [useIsRTL](#useisrtl)
|
|
52
|
+
- [Removals](#removals)
|
|
53
|
+
- [Deprecated Buttons](#deprecated-buttons)
|
|
54
|
+
- [Input Provider](#input-provider)
|
|
55
|
+
- [Menu (Preview)](#menu-preview)
|
|
56
|
+
- [readOnlyPillStencil and removeablePillStencil](#readonlypillstencil-and-removeablepillstencil)
|
|
57
|
+
- [Text Area (Labs)](#text-area)
|
|
58
|
+
- [Text Input (Labs)](#text-input)
|
|
59
|
+
- [Troubleshooting](#troubleshooting)
|
|
60
|
+
- [Glossary](#glossary)
|
|
61
|
+
- [Main](#main)
|
|
62
|
+
- [Preview](#preview)
|
|
63
|
+
- [Labs](#labs)
|
|
80
64
|
|
|
81
65
|
## LLM Assisted Migration <StorybookStatusIndicator type="ai" />
|
|
82
66
|
|
|
@@ -344,7 +328,7 @@ specificity.
|
|
|
344
328
|
|
|
345
329
|
### useIsRTL
|
|
346
330
|
|
|
347
|
-
**PR:** [#
|
|
331
|
+
**PR:** [#3477](https://github.com/Workday/canvas-kit/pull/3477)
|
|
348
332
|
|
|
349
333
|
The `useIsRTL` hook has been deprecated. Please use
|
|
350
334
|
[CSS logical properties](https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_Logical_Properties)
|
|
@@ -919,7 +903,7 @@ replaced the removed component or utility.
|
|
|
919
903
|
|
|
920
904
|
### Deprecated Buttons
|
|
921
905
|
|
|
922
|
-
**PR:** [#
|
|
906
|
+
**PR:** [#3439](https://github.com/Workday/canvas-kit/pull/3439)
|
|
923
907
|
|
|
924
908
|
Long overdue, but a sign of moving forward, we've removed our `DeprecatedButton`. Our design system
|
|
925
909
|
supported this for quite some time, but with the advancement in theming, our components API and our
|
|
@@ -17,6 +17,9 @@ space tokens, the new tokens aim to add more semantic meaning to allow for bette
|
|
|
17
17
|
- [Codemod](#codemod)
|
|
18
18
|
- [Instructions](#instructions)
|
|
19
19
|
- [Component Promotions](#component-promotions)
|
|
20
|
+
- [Pill](#pill-)
|
|
21
|
+
- [Segmented Control](#segmented-control-)
|
|
22
|
+
- [Information Highlight](#information-highlight-)
|
|
20
23
|
- [Segmented Control ⚡️](#segmented-control-️)
|
|
21
24
|
- [API Differences](#api-differences)
|
|
22
25
|
- [Structure Changes](#structure-changes)
|
|
@@ -28,6 +31,7 @@ space tokens, the new tokens aim to add more semantic meaning to allow for bette
|
|
|
28
31
|
- [Buttons](#buttons)
|
|
29
32
|
- [Removals](#removals)
|
|
30
33
|
- [Segmented Control (Deprecated)](#segmented-control-deprecated)
|
|
34
|
+
- [Select (Deprecated)](#select-deprecated)
|
|
31
35
|
- [Search Form (Labs)](#search-form-labs)
|
|
32
36
|
- [Combobox (Labs)](#combobox-labs)
|
|
33
37
|
- [Glossary](#glossary)
|
|
@@ -99,8 +103,32 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
99
103
|
|
|
100
104
|
## Component Promotions
|
|
101
105
|
|
|
106
|
+
### Pill ⚡️
|
|
107
|
+
|
|
108
|
+
**PR** [#3634](https://github.com/Workday/canvas-kit/pull/3634)
|
|
109
|
+
|
|
110
|
+
We've promoted `Pill` from [Preview](#preview) to [Main](#main). There are no changes to the
|
|
111
|
+
functionality or styling of the component. The only change required is updating the import
|
|
112
|
+
statement.
|
|
113
|
+
|
|
114
|
+
**Before in v14**
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import {Pill} from '@workday/canvas-kit-preview-react/pill';
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**After in v15**
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import {Pill} from '@workday/canvas-kit-react/pill';
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
> 🤖 The codemod will handle the change of imports as shown above.
|
|
127
|
+
|
|
102
128
|
### Segmented Control ⚡️
|
|
103
129
|
|
|
130
|
+
**PR:** [#3633](https://github.com/Workday/canvas-kit/pull/3633)
|
|
131
|
+
|
|
104
132
|
We've promoted `SegmentedControl` from [Preview](#preview) to [Main](#main). This replaces the deprecated `SegmentedControl` that was previously in Main.
|
|
105
133
|
|
|
106
134
|
**Before in v14**
|
|
@@ -201,6 +229,8 @@ The promoted `SegmentedControl` includes several new features:
|
|
|
201
229
|
|
|
202
230
|
### Information Highlight ⚡️
|
|
203
231
|
|
|
232
|
+
**PR:** [#3633](https://github.com/Workday/canvas-kit/pull/3633)
|
|
233
|
+
|
|
204
234
|
We've promoted `InformationHighlight` from [Preview](#preview) to [Main](#main). There are no changes to the functionality or styling of the component. The only change required is updating the import statement.
|
|
205
235
|
|
|
206
236
|
**Before in v14**
|
|
@@ -240,6 +270,124 @@ Please migrate to the new `SegmentedControl` component (promoted from Preview) w
|
|
|
240
270
|
component pattern with `SegmentedControl.List` and `SegmentedControl.Item`. See the
|
|
241
271
|
[API Differences](#api-differences) section above for migration guidance.
|
|
242
272
|
|
|
273
|
+
### Select (Deprecated)
|
|
274
|
+
|
|
275
|
+
**PR:** [#3658](https://github.com/Workday/canvas-kit/pull/3658)
|
|
276
|
+
|
|
277
|
+
The `Select` component in `@workday/canvas-kit-preview-react/select` has been removed. Please use the
|
|
278
|
+
`Select` component from `@workday/canvas-kit-react/select` instead.
|
|
279
|
+
|
|
280
|
+
**Before in v14**
|
|
281
|
+
|
|
282
|
+
```tsx
|
|
283
|
+
import {Select} from '@workday/canvas-kit-preview-react/select';
|
|
284
|
+
```
|
|
285
|
+
|
|
286
|
+
**After in v15**
|
|
287
|
+
|
|
288
|
+
```tsx
|
|
289
|
+
import {Select} from '@workday/canvas-kit-react/select';
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
#### API Differences
|
|
293
|
+
|
|
294
|
+
The Main `Select` is a [compound component](/getting-started/for-developers/resources/compound-components/)
|
|
295
|
+
built on top of the Combobox component with a composition-based API, whereas the Preview Select was a
|
|
296
|
+
monolithic class-based component.
|
|
297
|
+
|
|
298
|
+
##### Structure Changes
|
|
299
|
+
|
|
300
|
+
| Preview (Removed) | Main |
|
|
301
|
+
| --------------------------- | ------------------------------------------------------------- |
|
|
302
|
+
| `Select` (single component) | `Select` + `Select.Input` + `Select.Popper` + `Select.Card` + `Select.List` + `Select.Item` |
|
|
303
|
+
|
|
304
|
+
##### Prop Changes
|
|
305
|
+
|
|
306
|
+
| Feature | Preview (Removed) | Main |
|
|
307
|
+
| ---------------- | ------------------------------------------ | ------------------------------------------------ |
|
|
308
|
+
| Options | `options` prop (array of Option objects) | `items` prop (array of any type) |
|
|
309
|
+
| Selected value | `value` prop | Managed via model (`useSelectModel`) |
|
|
310
|
+
| Change handler | `onChange={(e) => {}}` | `onChange` on `Select.Input` |
|
|
311
|
+
| Error state | `error={Select.ErrorType.Error}` | `error="error"` or `error="caution"` |
|
|
312
|
+
| Custom rendering | `renderOption` / `renderSelected` props | Composition via `Select.Item` children |
|
|
313
|
+
| Form integration | Manual | Built-in with `FormField` wrapper |
|
|
314
|
+
| Accessibility | Manual ARIA | Built-in via Combobox foundation |
|
|
315
|
+
|
|
316
|
+
##### Code Migration
|
|
317
|
+
|
|
318
|
+
**Preview API (Removed)**
|
|
319
|
+
|
|
320
|
+
```tsx
|
|
321
|
+
import {Select} from '@workday/canvas-kit-preview-react/select';
|
|
322
|
+
|
|
323
|
+
const options = [
|
|
324
|
+
{label: 'Small', value: 'small'},
|
|
325
|
+
{label: 'Medium', value: 'medium'},
|
|
326
|
+
{label: 'Large', value: 'large'},
|
|
327
|
+
];
|
|
328
|
+
|
|
329
|
+
const [value, setValue] = React.useState('medium');
|
|
330
|
+
|
|
331
|
+
<Select
|
|
332
|
+
options={options}
|
|
333
|
+
value={value}
|
|
334
|
+
onChange={e => setValue(e.target.value)}
|
|
335
|
+
/>
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
**Main API (v15)**
|
|
339
|
+
|
|
340
|
+
```tsx
|
|
341
|
+
import {Select} from '@workday/canvas-kit-react/select';
|
|
342
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
343
|
+
|
|
344
|
+
const items = ['Small', 'Medium', 'Large'];
|
|
345
|
+
|
|
346
|
+
<Select items={items}>
|
|
347
|
+
<FormField label="Size">
|
|
348
|
+
<Select.Input onChange={e => console.log('Selected:', e.target.value)} />
|
|
349
|
+
<Select.Popper>
|
|
350
|
+
<Select.Card>
|
|
351
|
+
<Select.List>
|
|
352
|
+
{item => <Select.Item>{item}</Select.Item>}
|
|
353
|
+
</Select.List>
|
|
354
|
+
</Select.Card>
|
|
355
|
+
</Select.Popper>
|
|
356
|
+
</FormField>
|
|
357
|
+
</Select>
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
##### Main Select Features
|
|
361
|
+
|
|
362
|
+
The Main `Select` includes features not available in the Preview version:
|
|
363
|
+
|
|
364
|
+
- **Composition-based API**: Full control over structure with subcomponents
|
|
365
|
+
- **FormField integration**: Built-in accessibility when wrapped with FormField
|
|
366
|
+
- **Model-based state**: Use `useSelectModel` for advanced state management
|
|
367
|
+
- **Virtualization support**: Enable for large lists via model config
|
|
368
|
+
- **Icons in input**: Use `inputStartIcon` prop on `Select.Input`
|
|
369
|
+
- **Icons in items**: Use `Select.Item.Icon` subcomponent
|
|
370
|
+
|
|
371
|
+
```tsx
|
|
372
|
+
// With icons
|
|
373
|
+
<Select.Input inputStartIcon={myIcon} />
|
|
374
|
+
|
|
375
|
+
// With item icons
|
|
376
|
+
<Select.Item>
|
|
377
|
+
<Select.Item.Icon icon={starIcon} />
|
|
378
|
+
Favorite
|
|
379
|
+
</Select.Item>
|
|
380
|
+
|
|
381
|
+
// With model for controlled state
|
|
382
|
+
const model = useSelectModel({
|
|
383
|
+
items: myItems,
|
|
384
|
+
onSelect: ({id}) => console.log('Selected:', id),
|
|
385
|
+
});
|
|
386
|
+
|
|
387
|
+
<Select model={model}>
|
|
388
|
+
...
|
|
389
|
+
</Select>
|
|
390
|
+
```
|
|
243
391
|
### Search Form (Labs)
|
|
244
392
|
|
|
245
393
|
The deprecated `SearchForm` component has been removed from `@workday/canvas-kit-labs-react`.
|
|
@@ -301,7 +449,7 @@ things you'll want to keep in mind.
|
|
|
301
449
|
dependencies on your own.
|
|
302
450
|
- We recommend upgrading dependencies before running the codemod.
|
|
303
451
|
- Always review your `package.json` files to make sure your dependency versions look correct.
|
|
304
|
-
- The codemod will not handle every breaking change in
|
|
452
|
+
- The codemod will not handle every breaking change in this upgrade. You will likely need to make some manual
|
|
305
453
|
changes to be compatible. Use our Upgrade Guide as a checklist.
|
|
306
454
|
- Codemods are not bulletproof.
|
|
307
455
|
- Conduct a thorough PR and QA review of all changes to ensure no regressions were introduced.
|
|
@@ -331,7 +479,7 @@ finished.
|
|
|
331
479
|
|
|
332
480
|
```sh
|
|
333
481
|
yarn add @workday/canvas-kit-codemod --dev
|
|
334
|
-
yarn canvas-kit-codemod v${
|
|
482
|
+
yarn canvas-kit-codemod v${canvasKitMajorVersionNumber} [path]
|
|
335
483
|
yarn remove @workday/canvas-kit-codemod
|
|
336
484
|
```
|
|
337
485
|
|
|
@@ -345,6 +493,7 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
345
493
|
The following automated transformations are available for upgrading to v15:
|
|
346
494
|
|
|
347
495
|
- **Promote Information Highlight**: promoteInformationHighlight
|
|
496
|
+
- **Promote Pill**: promotePill
|
|
348
497
|
- **Promote Segmented Control**: promoteSegmentedControl
|
|
349
498
|
|
|
350
499
|
Run the codemod with: `npx @workday/canvas-kit-codemod v15 [path]`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-mcp",
|
|
3
|
-
"version": "15.0.0-alpha.
|
|
3
|
+
"version": "15.0.0-alpha.0076-next.0",
|
|
4
4
|
"description": "MCP package for Canvas Kit",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"tsx": "^4.7.0",
|
|
54
54
|
"typescript": "5.0"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "5d389f1b5a66cf5bde37eb570ff634a7b143ee98"
|
|
57
57
|
}
|