@workday/canvas-kit-docs 16.0.0-alpha.0490-next.0 → 16.0.0-alpha.0491-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/es6/lib/docs.js +54 -20
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.js +2 -2
- package/dist/es6/lib/stackblitzFiles/packageJSONFile.ts +2 -2
- package/dist/mdx/16.0-UPGRADE-GUIDE.mdx +69 -9
- package/dist/mdx/react/card/card.mdx +6 -6
- package/dist/mdx/react/card/examples/{Borderless.tsx → Alt.tsx} +4 -2
- package/dist/mdx/react/card/examples/CustomStyles.tsx +3 -1
- package/dist/mdx/react/card/examples/Tonal.tsx +16 -9
- package/dist/mdx/react/dialog/Dialog.mdx +7 -0
- package/dist/mdx/react/dialog/examples/Alt.tsx +39 -0
- package/dist/mdx/react/menu/Menu.mdx +7 -0
- package/dist/mdx/react/menu/examples/Alt.tsx +35 -0
- package/dist/mdx/react/toast/examples/Alt.tsx +22 -0
- package/dist/mdx/react/toast/toast.mdx +7 -0
- package/dist/mdx/react/tooltip/Tooltip.mdx +7 -0
- package/dist/mdx/react/tooltip/examples/Alt.tsx +20 -0
- package/lib/stackblitzFiles/packageJSONFile.ts +2 -2
- package/package.json +7 -7
package/dist/es6/lib/docs.js
CHANGED
|
@@ -46188,7 +46188,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
46188
46188
|
"value": [
|
|
46189
46189
|
{
|
|
46190
46190
|
"kind": "string",
|
|
46191
|
-
"value": "
|
|
46191
|
+
"value": "alt"
|
|
46192
46192
|
},
|
|
46193
46193
|
{
|
|
46194
46194
|
"kind": "string",
|
|
@@ -46196,7 +46196,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
46196
46196
|
}
|
|
46197
46197
|
]
|
|
46198
46198
|
},
|
|
46199
|
-
"description": "The variant of the Card. Can be `
|
|
46199
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
46200
46200
|
"declarations": [
|
|
46201
46201
|
{
|
|
46202
46202
|
"name": "variant",
|
|
@@ -131275,7 +131275,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
131275
131275
|
"value": [
|
|
131276
131276
|
{
|
|
131277
131277
|
"kind": "string",
|
|
131278
|
-
"value": "
|
|
131278
|
+
"value": "alt"
|
|
131279
131279
|
},
|
|
131280
131280
|
{
|
|
131281
131281
|
"kind": "string",
|
|
@@ -131283,7 +131283,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
131283
131283
|
}
|
|
131284
131284
|
]
|
|
131285
131285
|
},
|
|
131286
|
-
"description": "The variant of the Card. Can be `
|
|
131286
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
131287
131287
|
"declarations": [
|
|
131288
131288
|
{
|
|
131289
131289
|
"name": "variant",
|
|
@@ -155576,7 +155576,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
155576
155576
|
"value": [
|
|
155577
155577
|
{
|
|
155578
155578
|
"kind": "string",
|
|
155579
|
-
"value": "
|
|
155579
|
+
"value": "alt"
|
|
155580
155580
|
},
|
|
155581
155581
|
{
|
|
155582
155582
|
"kind": "string",
|
|
@@ -155584,7 +155584,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
155584
155584
|
}
|
|
155585
155585
|
]
|
|
155586
155586
|
},
|
|
155587
|
-
"description": "The variant of the Card. Can be `
|
|
155587
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
155588
155588
|
"declarations": [
|
|
155589
155589
|
{
|
|
155590
155590
|
"name": "variant",
|
|
@@ -209280,7 +209280,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
209280
209280
|
"value": [
|
|
209281
209281
|
{
|
|
209282
209282
|
"kind": "string",
|
|
209283
|
-
"value": "
|
|
209283
|
+
"value": "alt"
|
|
209284
209284
|
},
|
|
209285
209285
|
{
|
|
209286
209286
|
"kind": "string",
|
|
@@ -209288,7 +209288,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
209288
209288
|
}
|
|
209289
209289
|
]
|
|
209290
209290
|
},
|
|
209291
|
-
"description": "The variant of the Card. Can be `
|
|
209291
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
209292
209292
|
"declarations": [
|
|
209293
209293
|
{
|
|
209294
209294
|
"name": "variant",
|
|
@@ -240638,7 +240638,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
240638
240638
|
"value": [
|
|
240639
240639
|
{
|
|
240640
240640
|
"kind": "string",
|
|
240641
|
-
"value": "
|
|
240641
|
+
"value": "alt"
|
|
240642
240642
|
},
|
|
240643
240643
|
{
|
|
240644
240644
|
"kind": "string",
|
|
@@ -240646,7 +240646,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
240646
240646
|
}
|
|
240647
240647
|
]
|
|
240648
240648
|
},
|
|
240649
|
-
"description": "The variant of the Card. Can be `
|
|
240649
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
240650
240650
|
"declarations": [
|
|
240651
240651
|
{
|
|
240652
240652
|
"name": "variant",
|
|
@@ -293888,7 +293888,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
293888
293888
|
"value": [
|
|
293889
293889
|
{
|
|
293890
293890
|
"kind": "string",
|
|
293891
|
-
"value": "
|
|
293891
|
+
"value": "alt"
|
|
293892
293892
|
},
|
|
293893
293893
|
{
|
|
293894
293894
|
"kind": "string",
|
|
@@ -293896,7 +293896,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
293896
293896
|
}
|
|
293897
293897
|
]
|
|
293898
293898
|
},
|
|
293899
|
-
"description": "The variant of the Card. Can be `
|
|
293899
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
293900
293900
|
"declarations": [
|
|
293901
293901
|
{
|
|
293902
293902
|
"name": "variant",
|
|
@@ -326547,7 +326547,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
326547
326547
|
"value": [
|
|
326548
326548
|
{
|
|
326549
326549
|
"kind": "string",
|
|
326550
|
-
"value": "
|
|
326550
|
+
"value": "alt"
|
|
326551
326551
|
},
|
|
326552
326552
|
{
|
|
326553
326553
|
"kind": "string",
|
|
@@ -326555,7 +326555,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
326555
326555
|
}
|
|
326556
326556
|
]
|
|
326557
326557
|
},
|
|
326558
|
-
"description": "The variant of the Card. Can be `
|
|
326558
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
326559
326559
|
"declarations": [
|
|
326560
326560
|
{
|
|
326561
326561
|
"name": "variant",
|
|
@@ -360450,7 +360450,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
360450
360450
|
"value": [
|
|
360451
360451
|
{
|
|
360452
360452
|
"kind": "string",
|
|
360453
|
-
"value": "
|
|
360453
|
+
"value": "alt"
|
|
360454
360454
|
},
|
|
360455
360455
|
{
|
|
360456
360456
|
"kind": "string",
|
|
@@ -360458,7 +360458,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
360458
360458
|
}
|
|
360459
360459
|
]
|
|
360460
360460
|
},
|
|
360461
|
-
"description": "The variant of the Card. Can be `
|
|
360461
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
360462
360462
|
"declarations": [
|
|
360463
360463
|
{
|
|
360464
360464
|
"name": "variant",
|
|
@@ -391271,7 +391271,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
391271
391271
|
"value": [
|
|
391272
391272
|
{
|
|
391273
391273
|
"kind": "string",
|
|
391274
|
-
"value": "
|
|
391274
|
+
"value": "alt"
|
|
391275
391275
|
},
|
|
391276
391276
|
{
|
|
391277
391277
|
"kind": "string",
|
|
@@ -391279,7 +391279,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
391279
391279
|
}
|
|
391280
391280
|
]
|
|
391281
391281
|
},
|
|
391282
|
-
"description": "The variant of the Card. Can be `
|
|
391282
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
391283
391283
|
"declarations": [
|
|
391284
391284
|
{
|
|
391285
391285
|
"name": "variant",
|
|
@@ -454341,7 +454341,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
454341
454341
|
"value": [
|
|
454342
454342
|
{
|
|
454343
454343
|
"kind": "string",
|
|
454344
|
-
"value": "
|
|
454344
|
+
"value": "alt"
|
|
454345
454345
|
},
|
|
454346
454346
|
{
|
|
454347
454347
|
"kind": "string",
|
|
@@ -454349,7 +454349,7 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
454349
454349
|
}
|
|
454350
454350
|
]
|
|
454351
454351
|
},
|
|
454352
|
-
"description": "The variant of the Card. Can be `
|
|
454352
|
+
"description": "The variant of the Card. Can be `alt`, `tonal` or default.",
|
|
454353
454353
|
"declarations": [
|
|
454354
454354
|
{
|
|
454355
454355
|
"name": "variant",
|
|
@@ -470342,6 +470342,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
470342
470342
|
"value": 100
|
|
470343
470343
|
}
|
|
470344
470344
|
},
|
|
470345
|
+
{
|
|
470346
|
+
"kind": "property",
|
|
470347
|
+
"name": "variant",
|
|
470348
|
+
"required": false,
|
|
470349
|
+
"type": {
|
|
470350
|
+
"kind": "string",
|
|
470351
|
+
"value": "alt"
|
|
470352
|
+
},
|
|
470353
|
+
"description": "The `alt` variant is designed for use on alternative page backgrounds (`system.color.bg.alt.default`). Use this variant to maintain proper visual hierarchy when placing components on colored backgrounds. While the default variant should be used on `system.color.bg.default` backgrounds, the `alt` variant ensures the component remains visually elevated on `system.color.bg.alt.default` backgrounds.",
|
|
470354
|
+
"declarations": [
|
|
470355
|
+
{
|
|
470356
|
+
"name": "variant",
|
|
470357
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tooltip/lib/Tooltip.tsx"
|
|
470358
|
+
}
|
|
470359
|
+
],
|
|
470360
|
+
"tags": {}
|
|
470361
|
+
},
|
|
470345
470362
|
{
|
|
470346
470363
|
"kind": "property",
|
|
470347
470364
|
"name": "cs",
|
|
@@ -471219,6 +471236,23 @@ export const docs = (typeof window !== 'undefined' && window.__docs) ||
|
|
|
471219
471236
|
"value": false
|
|
471220
471237
|
}
|
|
471221
471238
|
},
|
|
471239
|
+
{
|
|
471240
|
+
"kind": "property",
|
|
471241
|
+
"name": "variant",
|
|
471242
|
+
"required": false,
|
|
471243
|
+
"type": {
|
|
471244
|
+
"kind": "string",
|
|
471245
|
+
"value": "alt"
|
|
471246
|
+
},
|
|
471247
|
+
"description": "",
|
|
471248
|
+
"declarations": [
|
|
471249
|
+
{
|
|
471250
|
+
"name": "variant",
|
|
471251
|
+
"filePath": "/home/runner/work/canvas-kit/canvas-kit/modules/react/tooltip/lib/TooltipContainer.tsx"
|
|
471252
|
+
}
|
|
471253
|
+
],
|
|
471254
|
+
"tags": {}
|
|
471255
|
+
},
|
|
471222
471256
|
{
|
|
471223
471257
|
"kind": "property",
|
|
471224
471258
|
"name": "children",
|
|
@@ -23,9 +23,9 @@ export const packageJSONFile = `{
|
|
|
23
23
|
"@workday/canvas-kit-react": "15.1.4",
|
|
24
24
|
"@workday/canvas-kit-react-fonts": "^15.1.4",
|
|
25
25
|
"@workday/canvas-kit-styling": "15.1.4",
|
|
26
|
-
"@workday/canvas-system-icons-web": "
|
|
26
|
+
"@workday/canvas-system-icons-web": "5.0.1",
|
|
27
27
|
"@workday/canvas-expressive-icons-web": "1.0.1",
|
|
28
|
-
"@workday/canvas-tokens-web": "4.
|
|
28
|
+
"@workday/canvas-tokens-web": "4.4.0-beta.11"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/react": "^18.2.59",
|
|
@@ -24,9 +24,9 @@ export const packageJSONFile = `{
|
|
|
24
24
|
"@workday/canvas-kit-react": "15.1.4",
|
|
25
25
|
"@workday/canvas-kit-react-fonts": "^15.1.4",
|
|
26
26
|
"@workday/canvas-kit-styling": "15.1.4",
|
|
27
|
-
"@workday/canvas-system-icons-web": "
|
|
27
|
+
"@workday/canvas-system-icons-web": "5.0.1",
|
|
28
28
|
"@workday/canvas-expressive-icons-web": "1.0.1",
|
|
29
|
-
"@workday/canvas-tokens-web": "4.
|
|
29
|
+
"@workday/canvas-tokens-web": "4.4.0-beta.11"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": "^18.2.59",
|
|
@@ -20,8 +20,9 @@ Soon to be...
|
|
|
20
20
|
- [Avatar](#avatar)
|
|
21
21
|
- [Buttons](#buttons)
|
|
22
22
|
- [Delete Button Outline Variant](#delete-button-outline-variant)
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
- [Container Components](#container-components)
|
|
24
|
+
- [Card](#card)
|
|
25
|
+
- [Expandable](#expandable)
|
|
25
26
|
- [Indicators](#indicators)
|
|
26
27
|
- [Banner](#banner)
|
|
27
28
|
- [Count Badge](#count-badge)
|
|
@@ -29,7 +30,6 @@ Soon to be...
|
|
|
29
30
|
- [Pill](#pill)
|
|
30
31
|
- [Skeleton](#skeleton)
|
|
31
32
|
- [Status Indicator](#status-indicator)
|
|
32
|
-
- [Form Field](#form-field)
|
|
33
33
|
- [Inputs](#inputs)
|
|
34
34
|
- [Accessibility: Checked-State Contrast](#accessibility-checked-state-contrast)
|
|
35
35
|
- [Checkbox](#checkbox)
|
|
@@ -254,11 +254,69 @@ import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
|
254
254
|
<DeleteButton variant="outline">Delete</DeleteButton>;
|
|
255
255
|
```
|
|
256
256
|
|
|
257
|
-
###
|
|
257
|
+
### Container Components
|
|
258
258
|
|
|
259
|
-
**PR:** [#
|
|
259
|
+
**PR:** [#4088](https://github.com/Workday/canvas-kit/pull/4088)
|
|
260
260
|
|
|
261
|
-
####
|
|
261
|
+
#### Alt Variant Support
|
|
262
|
+
|
|
263
|
+
Several container components now support an `alt` variant that provides an elevated surface appearance:
|
|
264
|
+
|
|
265
|
+
- `Menu.Card` - Can use `variant="alt"` for elevated menu styling
|
|
266
|
+
- `Dialog.Card` - Can use `variant="alt"` for elevated dialog styling
|
|
267
|
+
- `Popup.Card` - Can use `variant="alt"` for elevated popup styling
|
|
268
|
+
- `Toast` - Can use `variant="alt"` for elevated toast styling
|
|
269
|
+
- `Tooltip` - Can use `variant="alt"` for elevated tooltip styling
|
|
270
|
+
|
|
271
|
+
The `alt` variant uses `system.sana.color.surface.elevated` background with inverse borders, providing visual hierarchy and depth to these components when placed on an alt background.
|
|
272
|
+
|
|
273
|
+
```tsx
|
|
274
|
+
// Examples of using the alt variant
|
|
275
|
+
<Menu.Card variant="alt">
|
|
276
|
+
<Menu.List>...</Menu.List>
|
|
277
|
+
</Menu.Card>
|
|
278
|
+
|
|
279
|
+
<Dialog.Card variant="alt">
|
|
280
|
+
<Dialog.Heading>Dialog Title</Dialog.Heading>
|
|
281
|
+
<Dialog.Body>Content</Dialog.Body>
|
|
282
|
+
</Dialog.Card>
|
|
283
|
+
|
|
284
|
+
<Toast variant="alt">
|
|
285
|
+
<Toast.Body>
|
|
286
|
+
<Toast.Message>Notification message</Toast.Message>
|
|
287
|
+
</Toast.Body>
|
|
288
|
+
</Toast>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
#### Card
|
|
292
|
+
|
|
293
|
+
**PR:** [#4014](https://github.com/Workday/canvas-kit/pull/4014), [#4088](https://github.com/Workday/canvas-kit/pull/4088)
|
|
294
|
+
|
|
295
|
+
##### Variant Changes
|
|
296
|
+
|
|
297
|
+
The `Card` component's variants have been updated:
|
|
298
|
+
- **Removed:** The `borderless` variant has been removed and replaced with `alt`
|
|
299
|
+
- **New:** The `alt` variant provides an elevated surface with inverse borders
|
|
300
|
+
- **Updated:** The default variant now has a visible border
|
|
301
|
+
- The `tonal` variant now uses a `system.legacy.color.surface.alt.strong` background.
|
|
302
|
+
|
|
303
|
+
**Note:** If you were previously using `variant="borderless"`, you should use `variant="alt"` instead. While the styles are different, both where intended to be used on an `alt` background.
|
|
304
|
+
|
|
305
|
+
🤖 The codemod will automatically update `variant="borderless"` to `variant="alt"`.
|
|
306
|
+
|
|
307
|
+
```tsx
|
|
308
|
+
// v15
|
|
309
|
+
<Card variant="borderless">
|
|
310
|
+
<Card.Body>Content</Card.Body>
|
|
311
|
+
</Card>
|
|
312
|
+
|
|
313
|
+
// v16
|
|
314
|
+
<Card variant="alt">
|
|
315
|
+
<Card.Body>Content</Card.Body>
|
|
316
|
+
</Card>
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
##### Visual Updates
|
|
262
320
|
|
|
263
321
|
- `Card.Heading` now defaults to `body.small` type level (previously `body.large`). If your design
|
|
264
322
|
requires a larger heading, you can override the `typeLevel` prop on `Card.Heading`.
|
|
@@ -266,10 +324,12 @@ import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
|
266
324
|
`padding.sm`).
|
|
267
325
|
- Card's border radius is now managed via the new `cornerShapeStencil` (see
|
|
268
326
|
[New Utilities](#new-utilities)).
|
|
327
|
+
- The default variant now includes a visible border (`system.color.border.default`).
|
|
328
|
+
- The `alt` variant uses an elevated surface color (`system.sana.color.surface.elevated`) with inverse borders.
|
|
269
329
|
|
|
270
|
-
|
|
330
|
+
#### Expandable
|
|
271
331
|
|
|
272
|
-
|
|
332
|
+
##### Visual Updates
|
|
273
333
|
|
|
274
334
|
- `Expandable.Target` border radius changed from `shape.xxl` (24px, pill) to `shape.lg` (12px), now
|
|
275
335
|
managed via `cornerShapeStencil` (see [New Utilities](#new-utilities)).
|
|
@@ -599,7 +659,7 @@ Menu icons are now smaller to align with Sana Canvas specs. In v15, `Menu.Item.I
|
|
|
599
659
|
`size` prop and fell back to the `SystemIcon` default of `lg` (24px / 1.5rem). In v16, all icons
|
|
600
660
|
rendered through `Menu.Item.Icon` and `Menu.Option.Icon` use `size="md"` (20px / 1.25rem).
|
|
601
661
|
|
|
602
|
-
The selected checkmark in `Menu.Option` now uses `checkIcon` at `size="
|
|
662
|
+
The selected checkmark in `Menu.Option` now uses `checkIcon` at `size="md"` instead of
|
|
603
663
|
`checkSmallIcon` at the previous 24px default. The nested submenu chevron in `Submenu.TargetItem`
|
|
604
664
|
also changed from `chevronRightSmallIcon` to `chevronRightIcon` at `size="md"`.
|
|
605
665
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/Basic';
|
|
3
|
-
import
|
|
3
|
+
import Alt from './examples/Alt';
|
|
4
4
|
import Tonal from './examples/Tonal';
|
|
5
5
|
import WithCustomStyles from './examples/CustomStyles';
|
|
6
6
|
import WithStencils from './examples/Stencils';
|
|
@@ -29,13 +29,11 @@ yarn add @workday/canvas-kit-react
|
|
|
29
29
|
|
|
30
30
|
<ExampleCodeBlock code={Basic} />
|
|
31
31
|
|
|
32
|
-
###
|
|
32
|
+
### Alt Example
|
|
33
33
|
|
|
34
|
-
The `
|
|
35
|
-
maintaining the same internal spacing and structure. Use this variant when placing cards on colored
|
|
36
|
-
backgrounds where you want the card to blend seamlessly without borders or shadows.
|
|
34
|
+
The `alt` variant is designed for use on alternative page backgrounds (`system.color.bg.alt.default`). Use this variant to maintain proper visual hierarchy when placing components on colored backgrounds. While the default variant should be used on `system.color.bg.default` backgrounds, the `alt` variant ensures the component remains visually elevated on `system.color.bg.alt.default` backgrounds.
|
|
37
35
|
|
|
38
|
-
<ExampleCodeBlock code={
|
|
36
|
+
<ExampleCodeBlock code={Alt} />
|
|
39
37
|
|
|
40
38
|
### Tonal Example
|
|
41
39
|
|
|
@@ -50,6 +48,8 @@ grayish background to create visual separation from the page background.
|
|
|
50
48
|
Card and its subcomponents support custom styling via the `cs` prop. For more information, check our
|
|
51
49
|
["How To Customize Styles"](https://workday.github.io/canvas-kit/?path=/docs/styling-guides-customizing-styles--docs).
|
|
52
50
|
|
|
51
|
+
**Note:** The card uses the `background` css property to style the background color. If you want to override the background, you can use the `[cardStencil.vars.background]` css variable.
|
|
52
|
+
|
|
53
53
|
<ExampleCodeBlock code={WithCustomStyles} />
|
|
54
54
|
|
|
55
55
|
## Stencils
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
1
3
|
import {Card} from '@workday/canvas-kit-react/card';
|
|
2
4
|
import {createStyles} from '@workday/canvas-kit-styling';
|
|
3
5
|
import {system} from '@workday/canvas-tokens-web';
|
|
4
6
|
|
|
5
7
|
const styles = createStyles({
|
|
6
|
-
background: system.color.
|
|
8
|
+
background: system.color.bg.alt.default,
|
|
7
9
|
padding: system.padding.md,
|
|
8
10
|
});
|
|
9
11
|
|
|
10
12
|
export default () => {
|
|
11
13
|
return (
|
|
12
14
|
<div className={styles}>
|
|
13
|
-
<Card variant="
|
|
15
|
+
<Card variant="alt">
|
|
14
16
|
<Card.Heading>Canvas Supreme</Card.Heading>
|
|
15
17
|
<Card.Body>
|
|
16
18
|
Our house special supreme pizza includes pepperoni, sausage, bell peppers, mushrooms,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {Card} from '@workday/canvas-kit-react/card';
|
|
1
|
+
import {Card, cardStencil} from '@workday/canvas-kit-react/card';
|
|
2
2
|
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
3
3
|
import {system} from '@workday/canvas-tokens-web';
|
|
4
4
|
|
|
@@ -6,6 +6,8 @@ const customCardStyles = createStyles({
|
|
|
6
6
|
boxShadow: system.depth[2],
|
|
7
7
|
maxWidth: px2rem(320),
|
|
8
8
|
padding: system.padding.sm,
|
|
9
|
+
color: system.color.fg.default,
|
|
10
|
+
[cardStencil.vars.background]: system.color.surface.info.default,
|
|
9
11
|
});
|
|
10
12
|
|
|
11
13
|
export default () => (
|
|
@@ -1,15 +1,22 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
1
|
import {Card} from '@workday/canvas-kit-react/card';
|
|
2
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
3
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
4
|
+
|
|
5
|
+
const styles = createStyles({
|
|
6
|
+
background: system.color.bg.default,
|
|
7
|
+
padding: system.padding.md,
|
|
8
|
+
});
|
|
4
9
|
|
|
5
10
|
export default () => {
|
|
6
11
|
return (
|
|
7
|
-
<
|
|
8
|
-
<Card
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
<div className={styles}>
|
|
13
|
+
<Card variant="tonal">
|
|
14
|
+
<Card.Heading>Canvas Supreme</Card.Heading>
|
|
15
|
+
<Card.Body>
|
|
16
|
+
Our house special supreme pizza includes pepperoni, sausage, bell peppers, mushrooms,
|
|
17
|
+
onions, and oregano.
|
|
18
|
+
</Card.Body>
|
|
19
|
+
</Card>
|
|
20
|
+
</div>
|
|
14
21
|
);
|
|
15
22
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
2
|
import Basic from './examples/Basic';
|
|
3
3
|
import Focus from './examples/Focus';
|
|
4
|
+
import Alt from './examples/Alt';
|
|
4
5
|
|
|
5
6
|
# Canvas Kit Dialog
|
|
6
7
|
|
|
@@ -33,6 +34,12 @@ shows how Dialog manages focus in and out of the component.
|
|
|
33
34
|
> **Accessibility Note**: Focus redirect **will not** have any effect on the reading order of a
|
|
34
35
|
> screen reader.
|
|
35
36
|
|
|
37
|
+
### Alt Example
|
|
38
|
+
|
|
39
|
+
The `alt` variant is designed for use on alternative page backgrounds (`system.color.bg.alt.default`). Use this variant to maintain proper visual hierarchy when placing components on colored backgrounds. While the default variant should be used on `system.color.bg.default` backgrounds, the `alt` variant ensures the component remains visually elevated on `system.color.bg.alt.default` backgrounds.
|
|
40
|
+
|
|
41
|
+
<ExampleCodeBlock code={Alt} />
|
|
42
|
+
|
|
36
43
|
## Accessibility
|
|
37
44
|
|
|
38
45
|
`Dialog` composes the popup stack with `useInitialFocus`, `useReturnFocus`, `useCloseOnEscape`,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Dialog} from '@workday/canvas-kit-react/dialog';
|
|
5
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
6
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
7
|
+
|
|
8
|
+
const altBackgroundStyles = createStyles({
|
|
9
|
+
background: system.color.bg.alt.default,
|
|
10
|
+
padding: system.padding.xl,
|
|
11
|
+
borderRadius: system.shape.md,
|
|
12
|
+
minHeight: px2rem(400),
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default () => {
|
|
19
|
+
return (
|
|
20
|
+
<div className={altBackgroundStyles}>
|
|
21
|
+
<Dialog>
|
|
22
|
+
<Dialog.Target as={SecondaryButton}>Open Dialog</Dialog.Target>
|
|
23
|
+
<Dialog.Popper>
|
|
24
|
+
<Dialog.Card variant="alt">
|
|
25
|
+
<Dialog.CloseIcon aria-label="Close" />
|
|
26
|
+
<Dialog.Heading>Dialog with Alt Variant</Dialog.Heading>
|
|
27
|
+
<Dialog.Body>
|
|
28
|
+
This dialog uses the alt variant for proper contrast on colored backgrounds.
|
|
29
|
+
</Dialog.Body>
|
|
30
|
+
<Dialog.ButtonGroup>
|
|
31
|
+
<Dialog.CloseButton as={SecondaryButton}>Cancel</Dialog.CloseButton>
|
|
32
|
+
<Dialog.CloseButton>OK</Dialog.CloseButton>
|
|
33
|
+
</Dialog.ButtonGroup>
|
|
34
|
+
</Dialog.Card>
|
|
35
|
+
</Dialog.Popper>
|
|
36
|
+
</Dialog>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {ExampleCodeBlock, Specifications, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
2
2
|
|
|
3
3
|
import Basic from './examples/Basic';
|
|
4
|
+
import Alt from './examples/Alt';
|
|
4
5
|
import ContextMenu from './examples/ContextMenu';
|
|
5
6
|
import Grouping from './examples/Grouping';
|
|
6
7
|
import Icons from './examples/Icons';
|
|
@@ -33,6 +34,12 @@ yarn add @workday/canvas-kit-react
|
|
|
33
34
|
`Menu` will automatically focus on the cursor item (first item by default). The `Menu` uses a menu
|
|
34
35
|
model which composes a list model and a popup model and sets up accessibility features for you.
|
|
35
36
|
|
|
37
|
+
### Alt Example
|
|
38
|
+
|
|
39
|
+
The `alt` variant is designed for use on alternative page backgrounds (`system.color.bg.alt.default`). Use this variant to maintain proper visual hierarchy when placing components on colored backgrounds. While the default variant should be used on `system.color.bg.default` backgrounds, the `alt` variant ensures the component remains visually elevated on `system.color.bg.alt.default` backgrounds.
|
|
40
|
+
|
|
41
|
+
<ExampleCodeBlock code={Alt} />
|
|
42
|
+
|
|
36
43
|
### Context Menu
|
|
37
44
|
|
|
38
45
|
<ExampleCodeBlock code={ContextMenu} />
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import {SecondaryButton} from '@workday/canvas-kit-react/button';
|
|
4
|
+
import {Menu} from '@workday/canvas-kit-react/menu';
|
|
5
|
+
import {createStyles, px2rem} from '@workday/canvas-kit-styling';
|
|
6
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
7
|
+
|
|
8
|
+
const altBackgroundStyles = createStyles({
|
|
9
|
+
background: system.color.bg.alt.default,
|
|
10
|
+
padding: system.padding.xl,
|
|
11
|
+
borderRadius: system.shape.md,
|
|
12
|
+
minHeight: px2rem(300),
|
|
13
|
+
display: 'flex',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export default () => {
|
|
19
|
+
return (
|
|
20
|
+
<div className={altBackgroundStyles}>
|
|
21
|
+
<Menu>
|
|
22
|
+
<Menu.Target as={SecondaryButton}>Open Menu</Menu.Target>
|
|
23
|
+
<Menu.Popper>
|
|
24
|
+
<Menu.Card variant="alt">
|
|
25
|
+
<Menu.List>
|
|
26
|
+
<Menu.Item>First Item</Menu.Item>
|
|
27
|
+
<Menu.Item>Second Item</Menu.Item>
|
|
28
|
+
<Menu.Item>Third Item</Menu.Item>
|
|
29
|
+
</Menu.List>
|
|
30
|
+
</Menu.Card>
|
|
31
|
+
</Menu.Popper>
|
|
32
|
+
</Menu>
|
|
33
|
+
</div>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {Toast} from '@workday/canvas-kit-react/toast';
|
|
2
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
3
|
+
import {checkIcon} from '@workday/canvas-system-icons-web';
|
|
4
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
5
|
+
|
|
6
|
+
const styles = createStyles({
|
|
7
|
+
background: system.color.bg.alt.default,
|
|
8
|
+
padding: system.padding.md,
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
export default () => {
|
|
12
|
+
return (
|
|
13
|
+
<div className={styles}>
|
|
14
|
+
<Toast variant="alt">
|
|
15
|
+
<Toast.Icon icon={checkIcon} color={system.color.brand.fg.positive.default} />
|
|
16
|
+
<Toast.Body>
|
|
17
|
+
<Toast.Message>Your workbook was successfully processed.</Toast.Message>
|
|
18
|
+
</Toast.Body>
|
|
19
|
+
</Toast>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -2,6 +2,7 @@ import {ExampleCodeBlock, SymbolDoc} from '@workday/canvas-kit-docs';
|
|
|
2
2
|
import {Toast} from '@workday/canvas-kit-react/toast';
|
|
3
3
|
|
|
4
4
|
import Basic from './examples/Basic';
|
|
5
|
+
import Alt from './examples/Alt';
|
|
5
6
|
import RTL from './examples/RTL';
|
|
6
7
|
import ToastAlert from './examples/ToastAlert';
|
|
7
8
|
import ToastDialog from './examples/ToastDialog';
|
|
@@ -35,6 +36,12 @@ such as a successful action.
|
|
|
35
36
|
|
|
36
37
|
<ExampleCodeBlock code={Basic} />
|
|
37
38
|
|
|
39
|
+
### Alt Example
|
|
40
|
+
|
|
41
|
+
The `alt` variant is designed for use on alternative page backgrounds (`system.color.bg.alt.default`). Use this variant to maintain proper visual hierarchy when placing components on colored backgrounds. While the default variant should be used on `system.color.bg.default` backgrounds, the `alt` variant ensures the component remains visually elevated on `system.color.bg.alt.default` backgrounds.
|
|
42
|
+
|
|
43
|
+
<ExampleCodeBlock code={Alt} />
|
|
44
|
+
|
|
38
45
|
A `status` `Toast` will wrap the message within a `polite` ARIA live region with a `role` of
|
|
39
46
|
`status`.
|
|
40
47
|
|
|
@@ -11,6 +11,7 @@ import LineClamp from './examples/LineClamp';
|
|
|
11
11
|
import Muted from './examples/Muted';
|
|
12
12
|
import Placements from './examples/Placements';
|
|
13
13
|
import UseTooltip from './examples/UseTooltip';
|
|
14
|
+
import Alt from './examples/Alt';
|
|
14
15
|
|
|
15
16
|
|
|
16
17
|
# Canvas Kit React Tooltips
|
|
@@ -64,6 +65,12 @@ and focus events.
|
|
|
64
65
|
|
|
65
66
|
<ExampleCodeBlock code={Default} />
|
|
66
67
|
|
|
68
|
+
### Alt Example
|
|
69
|
+
|
|
70
|
+
The `alt` variant is designed for use on alternative page backgrounds (`system.color.bg.alt.default`). Use this variant to maintain proper visual hierarchy when placing components on colored backgrounds. While the default variant should be used on `system.color.bg.default` backgrounds, the `alt` variant ensures the component remains visually elevated on `system.color.bg.alt.default` backgrounds.
|
|
71
|
+
|
|
72
|
+
<ExampleCodeBlock code={Alt} />
|
|
73
|
+
|
|
67
74
|
### Describing an Element
|
|
68
75
|
|
|
69
76
|
<InformationHighlight variant={'caution'} className="sb-unstyled">
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import {TertiaryButton} from '@workday/canvas-kit-react/button';
|
|
2
|
+
import {Tooltip} from '@workday/canvas-kit-react/tooltip';
|
|
3
|
+
import {createStyles} from '@workday/canvas-kit-styling';
|
|
4
|
+
import {xIcon} from '@workday/canvas-system-icons-web';
|
|
5
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
6
|
+
|
|
7
|
+
const customStyles = createStyles({
|
|
8
|
+
background: system.color.bg.alt.default,
|
|
9
|
+
padding: system.padding.xl,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export default () => {
|
|
13
|
+
return (
|
|
14
|
+
<div className={customStyles}>
|
|
15
|
+
<Tooltip title="Close" variant="alt">
|
|
16
|
+
<TertiaryButton icon={xIcon} aria-label="Close" />
|
|
17
|
+
</Tooltip>
|
|
18
|
+
</div>
|
|
19
|
+
);
|
|
20
|
+
};
|
|
@@ -24,9 +24,9 @@ export const packageJSONFile = `{
|
|
|
24
24
|
"@workday/canvas-kit-react": "${version}",
|
|
25
25
|
"@workday/canvas-kit-react-fonts": "^${version}",
|
|
26
26
|
"@workday/canvas-kit-styling": "${version}",
|
|
27
|
-
"@workday/canvas-system-icons-web": "
|
|
27
|
+
"@workday/canvas-system-icons-web": "5.0.1",
|
|
28
28
|
"@workday/canvas-expressive-icons-web": "1.0.1",
|
|
29
|
-
"@workday/canvas-tokens-web": "4.
|
|
29
|
+
"@workday/canvas-tokens-web": "4.4.0-beta.11"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/react": "^18.2.59",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@workday/canvas-kit-docs",
|
|
3
|
-
"version": "16.0.0-alpha.
|
|
3
|
+
"version": "16.0.0-alpha.0491-next.0",
|
|
4
4
|
"description": "Documentation components of Canvas Kit components",
|
|
5
5
|
"author": "Workday, Inc. (https://www.workday.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -47,12 +47,12 @@
|
|
|
47
47
|
"@stackblitz/sdk": "^1.11.0",
|
|
48
48
|
"@storybook/csf": "0.0.1",
|
|
49
49
|
"@workday/canvas-expressive-icons-web": "1.0.2",
|
|
50
|
-
"@workday/canvas-kit-labs-react": "^16.0.0-alpha.
|
|
51
|
-
"@workday/canvas-kit-preview-react": "^16.0.0-alpha.
|
|
52
|
-
"@workday/canvas-kit-react": "^16.0.0-alpha.
|
|
53
|
-
"@workday/canvas-kit-styling": "^16.0.0-alpha.
|
|
50
|
+
"@workday/canvas-kit-labs-react": "^16.0.0-alpha.0491-next.0",
|
|
51
|
+
"@workday/canvas-kit-preview-react": "^16.0.0-alpha.0491-next.0",
|
|
52
|
+
"@workday/canvas-kit-react": "^16.0.0-alpha.0491-next.0",
|
|
53
|
+
"@workday/canvas-kit-styling": "^16.0.0-alpha.0491-next.0",
|
|
54
54
|
"@workday/canvas-system-icons-web": "5.0.1",
|
|
55
|
-
"@workday/canvas-tokens-web": "4.4.0-beta.
|
|
55
|
+
"@workday/canvas-tokens-web": "4.4.0-beta.11",
|
|
56
56
|
"markdown-to-jsx": "^7.2.0",
|
|
57
57
|
"react-syntax-highlighter": "^15.5.0",
|
|
58
58
|
"ts-node": "^10.9.1"
|
|
@@ -63,5 +63,5 @@
|
|
|
63
63
|
"mkdirp": "^1.0.3",
|
|
64
64
|
"typescript": "5.0"
|
|
65
65
|
},
|
|
66
|
-
"gitHead": "
|
|
66
|
+
"gitHead": "46f6ffe99425371997fcc5ad1821235567db140b"
|
|
67
67
|
}
|