@workday/canvas-kit-mcp 15.0.0-alpha.0056-next.0 → 15.0.0-alpha.0060-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.
@@ -0,0 +1,520 @@
1
+ # Color Roles
2
+
3
+ Color roles provide a systematic approach to applying color across interfaces. Each role serves a
4
+ specific purpose and includes modifiers to control visual emphasis and hierarchy.
5
+
6
+ ![Color roles system overview showing all semantic roles mapped to interface components with proper contrast relationships](color-roles-system-overview.png)
7
+
8
+ Canvas components use standardized color roles for visual consistency. Whether building standard or
9
+ custom components, follow these role definitions for predictable results.
10
+
11
+ Color roles guarantee accessible combinations—each pairing meets WCAG 2.1 AA standards. Roles are
12
+ implemented as system design tokens, creating a shared language between design and development teams
13
+ that enables theming and customization.
14
+
15
+ ## How to Apply Colors
16
+
17
+ Use color roles instead of raw palette colors to ensure consistency and accessibility at scale.
18
+ Color roles map semantic meaning to specific colors through system tokens.
19
+
20
+ The product palette assigns roles to these color families: `red` (critical), `blue` (primary),
21
+ `green` (positive), `amber` (caution), `slate`, and `neutral`.
22
+
23
+ ## Design Tokens
24
+
25
+ Design tokens like `bg.primary.soft` shift the question from "what color should this be?" to "what
26
+ role does this element fill?" This prevents isolated color decisions and ensures color is being
27
+ applied as large of a larger system.
28
+
29
+ When possible, always use system tokens to apply colors. Avoid raw palette colors to prevent
30
+ inconsistencies in the app and potential accessibility violations.
31
+
32
+ System tokens follow a three-part naming structure: `{property}-{role}-{modifier}`
33
+
34
+ ![System token naming convention breakdown showing property-role-modifier structure](color-roles-token-naming-convention.png)
35
+
36
+ - **Property**: What the color applies to (`bg`, `fg`, `text`, `border`)
37
+ - **Role**: How to use the color (`primary`, `positive`, `caution`)
38
+ - **Modifier**: Intensity or variation (`default`, `strong`, `stronger`)
39
+
40
+ For example, `bg-primary-soft` can be read as a "soft primary background color".
41
+
42
+ ## Usage Guidance
43
+
44
+ When choosing colors, consider:
45
+
46
+ - **What** will the color be applied to (property)
47
+ - **Why** color should be used in the first place (role)
48
+ - **How** much emphasis is needed for the color (modifier)
49
+
50
+ ## Properties
51
+
52
+ ![Token naming convention showing property highlighted in bg-primary-default structure](color-roles-property-highlighted.png)
53
+
54
+ Properties indicate what the color should be applied to, like a background or icon. `Static` and
55
+ `brand` tokens may be applied to any property.
56
+
57
+ | **Property** | **Description** |
58
+ | ------------ | ------------------------------------------------------------------------------- |
59
+ | `bg` | Background colors for surfaces and containers |
60
+ | `fg` | Foreground colors that exist on top of backgrounds, inclusive of text and icons |
61
+ | `text` | Used for text elements that need differentiation from icon colors |
62
+ | `icon` | Used for icons that need differentiation from text colors |
63
+ | `border` | Used for borders and dividers |
64
+ | `shadow` | Used for box-shadows |
65
+ | `static` | Static colors are non-dynamic colors that don't change |
66
+ | `brand` | Brand indicates colors that are tenant themeable |
67
+
68
+ ### Background Colors
69
+
70
+ Background colors are used to create the foundation for other elements. Use these for page
71
+ backgrounds, card surfaces, and container fills. All content, such as text, buttons, forms, and
72
+ icons should be on top of a background.
73
+
74
+ ### Foreground Colors
75
+
76
+ Foreground colors are applied to elements that appear on top of backgrounds, inclusive of both text
77
+ and icons.
78
+
79
+ ### Text Colors
80
+
81
+ Text colors should be used for standalone text, for example, headings, body text, and labels. Use
82
+ these colors intead of foreground colors when text colors may need to be different than the icon
83
+ color.
84
+
85
+ ### Icon Colors
86
+
87
+ Icon colors may be used for System Icons if text elements are not used. Use these for interface
88
+ icons, indicators, and symbols.
89
+
90
+ ### Border Colors
91
+
92
+ Border colors are used to define boundaries against a background, or to separate content areas.
93
+
94
+ ### Shadow Colors
95
+
96
+ Shadow colors are used in Depth tokens to create a sense of depth and hierarchy between surfaces.
97
+
98
+ ### Static Colors
99
+
100
+ Static colors maintain consistent colors regardless of tenant theming.
101
+
102
+ ### Brand Colors
103
+
104
+ Brand colors are tenant-themeable colors that are subject to change. These colors are used to match
105
+ a tenant's brand identity.
106
+
107
+ ## Roles
108
+
109
+ ![Token naming convention showing role highlighted in bg-primary-default structure](color-roles-role-highlighted.png)
110
+
111
+ Roles define colors by assigning semantic purpose to colors rather than categorizing them by
112
+ appearance. Each role is a collection of tokens that specify when and how to use colors in the
113
+ interface. Choose roles based on purpose, not preference.
114
+
115
+ Role can be grouped into the following categories:
116
+
117
+ - **Interactive**: `primary`, `focus` — guide user actions
118
+ - **Status**: `positive`, `caution`, `critical` — communicate system feedback
119
+ - **Hierarchy**: `alt`, `muted`, `contrast` — level of emphasis
120
+ - **Functional**: `disabled`, `translucent`, `overlay` — serve specific interface needs
121
+
122
+ Some roles like `default` include tokens for all properties. Others like `overlay` include only
123
+ tokens relevant to a specific use case.
124
+
125
+ | **Role** | **Description** |
126
+ | ------------- | ------------------------------------------------------------------- |
127
+ | `default` | Baseline color for that property or role, like `bg.primary.default` |
128
+ | `primary` | Brand color for main actions and interactive elements |
129
+ | `alt` | Secondary surfaces and alternate states |
130
+ | `muted` | Subtle elements with reduced emphasis |
131
+ | `positive` | Success states and completion feedback |
132
+ | `caution` | Warning messages and non-blocking alerts |
133
+ | `critical` | Error states and destructive actions |
134
+ | `inverse` | High contrast text on dark backgrounds |
135
+ | `contrast` | Enhanced contrast on default backgrounds |
136
+ | `hint` | Placeholder and helper text |
137
+ | `disabled` | Non-interactive and unavailable elements |
138
+ | `static` | Theme-independent colors |
139
+ | `error` | Blocking errors and failed states |
140
+ | `info` | Informational messages and notifications |
141
+ | `ai` | AI-powered features and content |
142
+ | `focus` | Keyboard navigation indicators |
143
+ | `transparent` | Invisible elements for spacing |
144
+ | `translucent` | Semi-transparent overlays |
145
+ | `overlay` | Modal scrims and background dimming |
146
+
147
+ ### Primary Colors
148
+
149
+ Primary brand color for main actions and interactions. Use sparingly for maximum impact.
150
+
151
+ ![Primary Button component showing primary background and text colors](color-roles-primary-role.png)
152
+
153
+ <Do>
154
+
155
+ - Apply to brand elements and main actions
156
+
157
+ </Do>
158
+
159
+ <Dont>
160
+
161
+ - Use for secondary UI or informational content
162
+ - Apply to decorative elements
163
+
164
+ </Dont>
165
+
166
+ ### Positive Colors
167
+
168
+ Success states and completion feedback. Provides immediate confirmation when tasks are completed.
169
+
170
+ ![Success Alert component with positive background and text colors](color-roles-positive-role.png)
171
+
172
+ <Do>
173
+
174
+ - Use for success messages and completed states
175
+ - Apply to confirmation feedback
176
+
177
+ </Do>
178
+
179
+ ### Alt Colors
180
+
181
+ Alternative styling for secondary elements that need visual distinction from primary elements.
182
+
183
+ <Do>
184
+
185
+ - Use to create subtle differences against the default background color
186
+
187
+ </Do>
188
+
189
+ <Dont>
190
+
191
+ - Use on foregrounds, text or icons
192
+ - Use on main actions
193
+
194
+ </Dont>
195
+
196
+ ### Muted Colors
197
+
198
+ Subtle elements with reduced emphasis. Present but not prominent.
199
+
200
+ <Do>
201
+
202
+ - Use on interactive secondary UI borders
203
+
204
+ </Do>
205
+
206
+ <Dont>
207
+
208
+ - Use for main actions
209
+ - Apply to non-interactive surfaces
210
+
211
+ </Dont>
212
+
213
+ ### Caution Colors
214
+
215
+ Non-blocking warnings and alerts. Informs the user of potential risk without blocking them.
216
+
217
+ ![Warning Alert component and TextInput with caution border showing validation error](color-roles-caution-role.png)
218
+
219
+ <Do>
220
+
221
+ - Use for alerts in forms
222
+ - Use for non-critical messaging
223
+
224
+ </Do>
225
+
226
+ <Dont>
227
+
228
+ - Use for blocking errors or destructive actions
229
+
230
+ </Dont>
231
+
232
+ ### Critical Colors
233
+
234
+ Blocking errors and destructive actions. Reserved for situations that call for immediate attention.
235
+
236
+ ![Error Alert component and Destructive Button with critical background and text colors](color-roles-critical-role.png)
237
+
238
+ <Do>
239
+
240
+ - Use for blocking errors and to confirm destructive actions
241
+ - Apply to system failures
242
+
243
+ </Do>
244
+
245
+ <Dont>
246
+
247
+ - Use for warnings or informational messages
248
+ - Apply to non-destructive actions
249
+
250
+ </Dont>
251
+
252
+ ### Info Colors
253
+
254
+ System announcements and informational messages that provide context or status updates.
255
+
256
+ <Do>
257
+
258
+ - Use for system announcements and status updates
259
+ - Apply to informational banners and notices
260
+ - Use for contextual information about features or changes
261
+
262
+ </Do>
263
+
264
+ <Dont>
265
+
266
+ - Use for errors, warnings, or success messages
267
+ - Apply to instructional or helper content
268
+ - Use for placeholder text or form guidance
269
+
270
+ </Dont>
271
+
272
+ ### AI Colors
273
+
274
+ Highlights AI-powered content and features. Use consistently for all AI functionality.
275
+
276
+ ![AI Badge and Button components with AI-specific background and accent colors](color-roles-ai-role.png)
277
+
278
+ <Do>
279
+
280
+ - Use for AI-driven features and ML-powered content
281
+ - Apply to intelligent assistance widgets
282
+
283
+ </Do>
284
+
285
+ <Dont>
286
+
287
+ - Use for standard automation or manual processes
288
+ - Apply to features not powered by AI
289
+
290
+ </Dont>
291
+
292
+ ### Focus Colors
293
+
294
+ Used for focus indicators. Shows the interactive element currently has focus.
295
+
296
+ ![Button and TextInput components with focus ring outlines for keyboard navigation](color-roles-focus-role.png)
297
+
298
+ <Do>
299
+
300
+ - Use for focus rings and keyboard navigation indicators
301
+
302
+ </Do>
303
+
304
+ <Dont>
305
+
306
+ - Use for active or selected states
307
+
308
+ </Dont>
309
+
310
+ ### Transparent Colors
311
+
312
+ Colors that are fully or slightly transparent. Consistent behavior across dynamic backgrounds.
313
+
314
+ <Do>
315
+
316
+ - Use for invisible borders and spacing elements
317
+ - Use when backgrounds are unpredictable/dynamic
318
+
319
+ </Do>
320
+
321
+ <Dont>
322
+
323
+ - Apply to content that should be visible
324
+
325
+ </Dont>
326
+
327
+ ### Inverse Colors
328
+
329
+ High contrast text on dark backgrounds. May be used when backgrounds use a color greater than 600.
330
+
331
+ ![Dark Card component with inverse text color for high contrast on dark backgrounds](color-roles-inverse-role.png)
332
+
333
+ <Do>
334
+
335
+ - Use for text on dark backgrounds (step 600+)
336
+ - Apply when high contrast is required
337
+
338
+ </Do>
339
+
340
+ <Dont>
341
+
342
+ - Use on backgrounds lighter than 600
343
+ - Apply solely as a means to draw attention
344
+
345
+ </Dont>
346
+
347
+ ### Contrast Colors
348
+
349
+ Contrast tokens are used to stand out strongly against the default page or surface background. Use
350
+ them for situations that require high contrast.
351
+
352
+ <Do>
353
+
354
+ - Use for strong contrast on the default page background
355
+
356
+ </Do>
357
+
358
+ <Dont>
359
+
360
+ - Use for standard prose
361
+
362
+ </Dont>
363
+
364
+ ### Input Colors
365
+
366
+ Form field borders ensuring 3:1 contrast against surface backgrounds.
367
+
368
+ <Do>
369
+
370
+ - Use for form field borders and input outlines
371
+ - Apply to interactive form elements
372
+
373
+ </Do>
374
+
375
+ <Dont>
376
+
377
+ - Use on non-interactive surfaces
378
+
379
+ </Dont>
380
+
381
+ ### Container Colors
382
+
383
+ Surfaces that exist on top of the page background.
384
+
385
+ <Do>
386
+
387
+ - Use for cards, side panels, and dialogs, popups
388
+ - Add a border or some other treatment (e.g. Depth) to visually separate from page backgrounds
389
+
390
+ </Do>
391
+
392
+ <Dont>
393
+
394
+ - Use for page sections or content areas
395
+
396
+ </Dont>
397
+
398
+ ### Divider Colors
399
+
400
+ Content separators that organize information between sections.
401
+
402
+ <Do>
403
+
404
+ - Use to create visual separation between page sections or content areas
405
+ - Apply consistently between sections in a group
406
+
407
+ </Do>
408
+
409
+ <Dont>
410
+
411
+ - Apply to Containers
412
+
413
+ </Dont>
414
+
415
+ ### Overlay Colors
416
+
417
+ Semi-transparent scrims that dim the background to focus attention on a modal view.
418
+
419
+ ![Modal Dialog with semi-transparent overlay background dimming page content](color-roles-overlay-role.png)
420
+
421
+ <Do>
422
+
423
+ - Use to focus attention on modals
424
+ - Apply consistent opacity (`opacity.overlay`) for all scrims
425
+
426
+ </Do>
427
+
428
+ <Dont>
429
+
430
+ - Use for non-modal views or when content visibility is a priority
431
+ - Stack overlays on top of each other
432
+
433
+ </Dont>
434
+
435
+ ### Disabled Colors
436
+
437
+ Non-interactive elements that are unavailable. Some disabled elements use opacity instead.
438
+
439
+ ![Disabled Button and TextInput components with reduced opacity disabled colors](color-roles-disabled-role.png)
440
+
441
+ <Do>
442
+
443
+ - Use to indicate disabled elements, like Buttons or FormFields
444
+
445
+ </Do>
446
+
447
+ <Dont>
448
+
449
+ - Use for interactive elements
450
+ - Apply when opacity works better
451
+
452
+ </Dont>
453
+
454
+ ### Translucent Colors
455
+
456
+ Slightly opaque overlays for dynamic surfaces. More opaque than transparent.
457
+
458
+ <Do>
459
+
460
+ - Use on dynamic surfaces like video players
461
+ - Apply to tooltips and overlays needing background visibility
462
+
463
+ </Do>
464
+
465
+ <Dont>
466
+
467
+ - Use when full transparency is needed
468
+ - Apply to static surfaces
469
+
470
+ </Dont>
471
+
472
+ ### Hint Colors
473
+
474
+ Helper text and instructional content that guides users through tasks and interactions.
475
+
476
+ <Do>
477
+
478
+ - Use for placeholder text in form fields
479
+ - Apply to instructional content and step-by-step guidance
480
+ - Use for tooltips and contextual help
481
+ - Apply to field descriptions and input formatting requirements
482
+
483
+ </Do>
484
+
485
+ <Dont>
486
+
487
+ - Use for system announcements or status updates
488
+ - Apply to error or critical messages
489
+ - Use for informational banners or notices
490
+
491
+ </Dont>
492
+
493
+ ## Modifiers
494
+
495
+ Modifiers specify the intensity or variation of a color role, creating a hierarchy through different
496
+ emphasis levels.
497
+
498
+ ![Modifier scale showing bg-primary from softest (most subtle) to strongest (most intense) with visual progression of intensity](color-roles-modifier-scale.png)
499
+
500
+ | **Modifier** | **Description** |
501
+ | ------------ | --------------------------------------------------------- |
502
+ | `softest` | Minimal intensity for subtle backgrounds |
503
+ | `softer` | Low intensity for reduced emphasis |
504
+ | `soft` | Gentle intensity for understated applications |
505
+ | `default` | Standard color for most use cases |
506
+ | `strong` | Increased intensity for more emphasis |
507
+ | `stronger` | High intensity for important elements |
508
+ | `strongest` | Maximum intensity for active states and critical elements |
509
+
510
+ Modifiers are named to clearly differentiate between levels of emphasis, but flexible enough to
511
+ accomodate a number of use cases, like interaction states (hover, active), and levels in typography
512
+ (heading, body text, captions). The table below shows examples of applying emphasis modifiers to
513
+ functional use cases.
514
+
515
+ | Use Case | Design Token |
516
+ | ----------------------------------- | ----------------------- |
517
+ | PrimaryButton Background Hover | `bg.primary.strong` |
518
+ | Inverse Secondary Background Active | `bg.transparent.strong` |
519
+ | Heading Text | `bg.primary.strong` |
520
+ | TextInput Border Hover | `border.input.strong` |