@workday/canvas-kit-mcp 15.0.0-alpha.0075-next.0 → 15.0.0-alpha.0077-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.
|
@@ -17,6 +17,7 @@ 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
|
+
- [Avatar](#avatar-)
|
|
20
21
|
- [Pill](#pill-)
|
|
21
22
|
- [Segmented Control](#segmented-control-)
|
|
22
23
|
- [Information Highlight](#information-highlight-)
|
|
@@ -30,7 +31,9 @@ space tokens, the new tokens aim to add more semantic meaning to allow for bette
|
|
|
30
31
|
- [Component Updates](#component-updates)
|
|
31
32
|
- [Buttons](#buttons)
|
|
32
33
|
- [Removals](#removals)
|
|
34
|
+
- [Avatar (Deprecated)](#avatar-deprecated)
|
|
33
35
|
- [Segmented Control (Deprecated)](#segmented-control-deprecated)
|
|
36
|
+
- [Select (Deprecated)](#select-deprecated)
|
|
34
37
|
- [Search Form (Labs)](#search-form-labs)
|
|
35
38
|
- [Combobox (Labs)](#combobox-labs)
|
|
36
39
|
- [Glossary](#glossary)
|
|
@@ -102,6 +105,121 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
102
105
|
|
|
103
106
|
## Component Promotions
|
|
104
107
|
|
|
108
|
+
### Avatar ⚡️
|
|
109
|
+
|
|
110
|
+
**PR:** [](https://github.com/Workday/canvas-kit/issues/3659)
|
|
111
|
+
|
|
112
|
+
We've promoted `Avatar` from [Preview](#preview) to [Main](#main). This replaces the deprecated `Avatar` that was previously in Main.
|
|
113
|
+
|
|
114
|
+
**Before in v14**
|
|
115
|
+
|
|
116
|
+
```tsx
|
|
117
|
+
import {Avatar} from '@workday/canvas-kit-preview-react/avatar';
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**After in v15**
|
|
121
|
+
|
|
122
|
+
```tsx
|
|
123
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
> 🤖 The codemod will handle the change of imports as shown above.
|
|
127
|
+
|
|
128
|
+
#### API Differences
|
|
129
|
+
|
|
130
|
+
The new `Avatar` is a [compound component](/getting-started/for-developers/resources/compound-components/)
|
|
131
|
+
with a different API than the deprecated version.
|
|
132
|
+
|
|
133
|
+
##### Structure Changes
|
|
134
|
+
|
|
135
|
+
| Deprecated (Old Main) | New (Promoted from Preview) |
|
|
136
|
+
| --------------------- | ----------------------------------- |
|
|
137
|
+
| `Avatar` | `Avatar` |
|
|
138
|
+
| - | `BaseAvatar` |
|
|
139
|
+
| - | `BaseAvatar.Image` / `AvatarImage` |
|
|
140
|
+
| - | `BaseAvatar.Name` / `AvatarName` |
|
|
141
|
+
|
|
142
|
+
##### Prop Changes
|
|
143
|
+
|
|
144
|
+
| Feature | Deprecated (Old Main) | New (Promoted from Preview) |
|
|
145
|
+
| -------------------- | ------------------------------------------ | ------------------------------------------------ |
|
|
146
|
+
| Variant | `variant` (`light`, `dark`) | `variant` (`blue`, `amber`, `teal`, `purple`) |
|
|
147
|
+
| Size | `size` (extraSmall=16px to extraExtraLarge=120px) | `size` (extraExtraSmall=24px to extraExtraLarge=120px) |
|
|
148
|
+
| User identifier | `altText` prop | `name` prop |
|
|
149
|
+
| Custom initials | Not supported | `preferredInitials` prop |
|
|
150
|
+
| Decorative mode | Not supported | `isDecorative` prop |
|
|
151
|
+
| Image URL | `url` prop | `url` prop |
|
|
152
|
+
| Object fit | `objectFit` prop | `objectFit` prop |
|
|
153
|
+
| Initials display | Not supported (shows user icon) | Shows initials from `name` when no image |
|
|
154
|
+
|
|
155
|
+
##### Size Mapping
|
|
156
|
+
|
|
157
|
+
| Size Name | Deprecated (Old Main) | New (Promoted from Preview) |
|
|
158
|
+
| ---------------- | --------------------- | --------------------------- |
|
|
159
|
+
| extraExtraSmall | - | 24px |
|
|
160
|
+
| extraSmall | 16px | 32px |
|
|
161
|
+
| small | 24px | 40px |
|
|
162
|
+
| medium | 32px | 48px |
|
|
163
|
+
| large | 40px | 72px |
|
|
164
|
+
| extraLarge | 64px | 96px |
|
|
165
|
+
| extraExtraLarge | 120px | 120px |
|
|
166
|
+
|
|
167
|
+
##### Code Migration
|
|
168
|
+
|
|
169
|
+
**Deprecated API (Old Main)**
|
|
170
|
+
|
|
171
|
+
```tsx
|
|
172
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
173
|
+
|
|
174
|
+
<Avatar
|
|
175
|
+
size="medium"
|
|
176
|
+
variant="light"
|
|
177
|
+
url="https://example.com/photo.jpg"
|
|
178
|
+
altText="John Doe"
|
|
179
|
+
/>
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
**New API (v15)**
|
|
183
|
+
|
|
184
|
+
```tsx
|
|
185
|
+
import {Avatar} from '@workday/canvas-kit-react/avatar';
|
|
186
|
+
|
|
187
|
+
<Avatar
|
|
188
|
+
size="medium"
|
|
189
|
+
variant="blue"
|
|
190
|
+
url="https://example.com/photo.jpg"
|
|
191
|
+
name="John Doe"
|
|
192
|
+
/>
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
##### New Features
|
|
196
|
+
|
|
197
|
+
The promoted `Avatar` includes several new features:
|
|
198
|
+
|
|
199
|
+
- **Initials display**: Automatically shows initials from the `name` prop when no image URL is provided
|
|
200
|
+
- **Color variants**: Four color variants (`blue`, `amber`, `teal`, `purple`) instead of light/dark
|
|
201
|
+
- **Custom initials**: Use `preferredInitials` for full control over displayed initials
|
|
202
|
+
- **Decorative mode**: Use `isDecorative` when Avatar is purely decorative (rendered next to a name)
|
|
203
|
+
- **Compound components**: Build custom avatars using `BaseAvatar`, `BaseAvatar.Image`, and `BaseAvatar.Name`
|
|
204
|
+
- **Utility function**: Use `getInitialsFromName` to extract initials from a name string
|
|
205
|
+
|
|
206
|
+
```tsx
|
|
207
|
+
// With initials (no image)
|
|
208
|
+
<Avatar name="John Doe" variant="blue" />
|
|
209
|
+
|
|
210
|
+
// Custom initials
|
|
211
|
+
<Avatar name="John Doe" preferredInitials="JD" />
|
|
212
|
+
|
|
213
|
+
// Decorative (next to text name)
|
|
214
|
+
<Avatar name="John Doe" url="..." isDecorative />
|
|
215
|
+
|
|
216
|
+
// Using compound components for custom layouts
|
|
217
|
+
<BaseAvatar variant="teal" size="large">
|
|
218
|
+
<BaseAvatar.Image src="..." alt="John Doe" />
|
|
219
|
+
<BaseAvatar.Name name="John Doe" />
|
|
220
|
+
</BaseAvatar>
|
|
221
|
+
```
|
|
222
|
+
|
|
105
223
|
### Pill ⚡️
|
|
106
224
|
|
|
107
225
|
**PR** [#3634](https://github.com/Workday/canvas-kit/pull/3634)
|
|
@@ -126,6 +244,8 @@ import {Pill} from '@workday/canvas-kit-react/pill';
|
|
|
126
244
|
|
|
127
245
|
### Segmented Control ⚡️
|
|
128
246
|
|
|
247
|
+
**PR:** [#3633](https://github.com/Workday/canvas-kit/pull/3633)
|
|
248
|
+
|
|
129
249
|
We've promoted `SegmentedControl` from [Preview](#preview) to [Main](#main). This replaces the deprecated `SegmentedControl` that was previously in Main.
|
|
130
250
|
|
|
131
251
|
**Before in v14**
|
|
@@ -226,6 +346,8 @@ The promoted `SegmentedControl` includes several new features:
|
|
|
226
346
|
|
|
227
347
|
### Information Highlight ⚡️
|
|
228
348
|
|
|
349
|
+
**PR:** [#3633](https://github.com/Workday/canvas-kit/pull/3633)
|
|
350
|
+
|
|
229
351
|
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.
|
|
230
352
|
|
|
231
353
|
**Before in v14**
|
|
@@ -256,6 +378,16 @@ tokens. These changes are **only visual**.
|
|
|
256
378
|
|
|
257
379
|
## Removals
|
|
258
380
|
|
|
381
|
+
### Avatar (Deprecated)
|
|
382
|
+
|
|
383
|
+
The deprecated `Avatar` that was previously in `@workday/canvas-kit-react/avatar`
|
|
384
|
+
has been removed. This was the older implementation that showed a user icon placeholder
|
|
385
|
+
and supported `light`/`dark` variants.
|
|
386
|
+
|
|
387
|
+
Please migrate to the new `Avatar` component (promoted from Preview) which uses initials
|
|
388
|
+
display, color variants (`blue`, `amber`, `teal`, `purple`), and supports compound components.
|
|
389
|
+
See the [API Differences](#api-differences) section above for migration guidance.
|
|
390
|
+
|
|
259
391
|
### Segmented Control (Deprecated)
|
|
260
392
|
|
|
261
393
|
The deprecated `SegmentedControl` that was previously in `@workday/canvas-kit-react/segmented-control`
|
|
@@ -265,6 +397,124 @@ Please migrate to the new `SegmentedControl` component (promoted from Preview) w
|
|
|
265
397
|
component pattern with `SegmentedControl.List` and `SegmentedControl.Item`. See the
|
|
266
398
|
[API Differences](#api-differences) section above for migration guidance.
|
|
267
399
|
|
|
400
|
+
### Select (Deprecated)
|
|
401
|
+
|
|
402
|
+
**PR:** [#3658](https://github.com/Workday/canvas-kit/pull/3658)
|
|
403
|
+
|
|
404
|
+
The `Select` component in `@workday/canvas-kit-preview-react/select` has been removed. Please use the
|
|
405
|
+
`Select` component from `@workday/canvas-kit-react/select` instead.
|
|
406
|
+
|
|
407
|
+
**Before in v14**
|
|
408
|
+
|
|
409
|
+
```tsx
|
|
410
|
+
import {Select} from '@workday/canvas-kit-preview-react/select';
|
|
411
|
+
```
|
|
412
|
+
|
|
413
|
+
**After in v15**
|
|
414
|
+
|
|
415
|
+
```tsx
|
|
416
|
+
import {Select} from '@workday/canvas-kit-react/select';
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
#### API Differences
|
|
420
|
+
|
|
421
|
+
The Main `Select` is a [compound component](/getting-started/for-developers/resources/compound-components/)
|
|
422
|
+
built on top of the Combobox component with a composition-based API, whereas the Preview Select was a
|
|
423
|
+
monolithic class-based component.
|
|
424
|
+
|
|
425
|
+
##### Structure Changes
|
|
426
|
+
|
|
427
|
+
| Preview (Removed) | Main |
|
|
428
|
+
| --------------------------- | ------------------------------------------------------------- |
|
|
429
|
+
| `Select` (single component) | `Select` + `Select.Input` + `Select.Popper` + `Select.Card` + `Select.List` + `Select.Item` |
|
|
430
|
+
|
|
431
|
+
##### Prop Changes
|
|
432
|
+
|
|
433
|
+
| Feature | Preview (Removed) | Main |
|
|
434
|
+
| ---------------- | ------------------------------------------ | ------------------------------------------------ |
|
|
435
|
+
| Options | `options` prop (array of Option objects) | `items` prop (array of any type) |
|
|
436
|
+
| Selected value | `value` prop | Managed via model (`useSelectModel`) |
|
|
437
|
+
| Change handler | `onChange={(e) => {}}` | `onChange` on `Select.Input` |
|
|
438
|
+
| Error state | `error={Select.ErrorType.Error}` | `error="error"` or `error="caution"` |
|
|
439
|
+
| Custom rendering | `renderOption` / `renderSelected` props | Composition via `Select.Item` children |
|
|
440
|
+
| Form integration | Manual | Built-in with `FormField` wrapper |
|
|
441
|
+
| Accessibility | Manual ARIA | Built-in via Combobox foundation |
|
|
442
|
+
|
|
443
|
+
##### Code Migration
|
|
444
|
+
|
|
445
|
+
**Preview API (Removed)**
|
|
446
|
+
|
|
447
|
+
```tsx
|
|
448
|
+
import {Select} from '@workday/canvas-kit-preview-react/select';
|
|
449
|
+
|
|
450
|
+
const options = [
|
|
451
|
+
{label: 'Small', value: 'small'},
|
|
452
|
+
{label: 'Medium', value: 'medium'},
|
|
453
|
+
{label: 'Large', value: 'large'},
|
|
454
|
+
];
|
|
455
|
+
|
|
456
|
+
const [value, setValue] = React.useState('medium');
|
|
457
|
+
|
|
458
|
+
<Select
|
|
459
|
+
options={options}
|
|
460
|
+
value={value}
|
|
461
|
+
onChange={e => setValue(e.target.value)}
|
|
462
|
+
/>
|
|
463
|
+
```
|
|
464
|
+
|
|
465
|
+
**Main API (v15)**
|
|
466
|
+
|
|
467
|
+
```tsx
|
|
468
|
+
import {Select} from '@workday/canvas-kit-react/select';
|
|
469
|
+
import {FormField} from '@workday/canvas-kit-react/form-field';
|
|
470
|
+
|
|
471
|
+
const items = ['Small', 'Medium', 'Large'];
|
|
472
|
+
|
|
473
|
+
<Select items={items}>
|
|
474
|
+
<FormField label="Size">
|
|
475
|
+
<Select.Input onChange={e => console.log('Selected:', e.target.value)} />
|
|
476
|
+
<Select.Popper>
|
|
477
|
+
<Select.Card>
|
|
478
|
+
<Select.List>
|
|
479
|
+
{item => <Select.Item>{item}</Select.Item>}
|
|
480
|
+
</Select.List>
|
|
481
|
+
</Select.Card>
|
|
482
|
+
</Select.Popper>
|
|
483
|
+
</FormField>
|
|
484
|
+
</Select>
|
|
485
|
+
```
|
|
486
|
+
|
|
487
|
+
##### Main Select Features
|
|
488
|
+
|
|
489
|
+
The Main `Select` includes features not available in the Preview version:
|
|
490
|
+
|
|
491
|
+
- **Composition-based API**: Full control over structure with subcomponents
|
|
492
|
+
- **FormField integration**: Built-in accessibility when wrapped with FormField
|
|
493
|
+
- **Model-based state**: Use `useSelectModel` for advanced state management
|
|
494
|
+
- **Virtualization support**: Enable for large lists via model config
|
|
495
|
+
- **Icons in input**: Use `inputStartIcon` prop on `Select.Input`
|
|
496
|
+
- **Icons in items**: Use `Select.Item.Icon` subcomponent
|
|
497
|
+
|
|
498
|
+
```tsx
|
|
499
|
+
// With icons
|
|
500
|
+
<Select.Input inputStartIcon={myIcon} />
|
|
501
|
+
|
|
502
|
+
// With item icons
|
|
503
|
+
<Select.Item>
|
|
504
|
+
<Select.Item.Icon icon={starIcon} />
|
|
505
|
+
Favorite
|
|
506
|
+
</Select.Item>
|
|
507
|
+
|
|
508
|
+
// With model for controlled state
|
|
509
|
+
const model = useSelectModel({
|
|
510
|
+
items: myItems,
|
|
511
|
+
onSelect: ({id}) => console.log('Selected:', id),
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
<Select model={model}>
|
|
515
|
+
...
|
|
516
|
+
</Select>
|
|
517
|
+
```
|
|
268
518
|
### Search Form (Labs)
|
|
269
519
|
|
|
270
520
|
The deprecated `SearchForm` component has been removed from `@workday/canvas-kit-labs-react`.
|
|
@@ -369,6 +619,7 @@ yarn remove @workday/canvas-kit-codemod
|
|
|
369
619
|
|
|
370
620
|
The following automated transformations are available for upgrading to v15:
|
|
371
621
|
|
|
622
|
+
- **Promote Avatar**: promoteAvatar
|
|
372
623
|
- **Promote Information Highlight**: promoteInformationHighlight
|
|
373
624
|
- **Promote Pill**: promotePill
|
|
374
625
|
- **Promote Segmented Control**: promoteSegmentedControl
|
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.0077-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": "6944d028b6f1250481ad8c4f8d5f817bea4e01a1"
|
|
57
57
|
}
|