@workday/canvas-kit-mcp 15.0.0-alpha.0076-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,6 +31,7 @@ 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)
34
36
  - [Select (Deprecated)](#select-deprecated)
35
37
  - [Search Form (Labs)](#search-form-labs)
@@ -103,6 +105,121 @@ yarn remove @workday/canvas-kit-codemod
103
105
 
104
106
  ## Component Promotions
105
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
+
106
223
  ### Pill ⚡️
107
224
 
108
225
  **PR** [#3634](https://github.com/Workday/canvas-kit/pull/3634)
@@ -261,6 +378,16 @@ tokens. These changes are **only visual**.
261
378
 
262
379
  ## Removals
263
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
+
264
391
  ### Segmented Control (Deprecated)
265
392
 
266
393
  The deprecated `SegmentedControl` that was previously in `@workday/canvas-kit-react/segmented-control`
@@ -492,6 +619,7 @@ yarn remove @workday/canvas-kit-codemod
492
619
 
493
620
  The following automated transformations are available for upgrading to v15:
494
621
 
622
+ - **Promote Avatar**: promoteAvatar
495
623
  - **Promote Information Highlight**: promoteInformationHighlight
496
624
  - **Promote Pill**: promotePill
497
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.0076-next.0",
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": "5d389f1b5a66cf5bde37eb570ff634a7b143ee98"
56
+ "gitHead": "6944d028b6f1250481ad8c4f8d5f817bea4e01a1"
57
57
  }