@workday/canvas-kit-docs 16.0.0-alpha.0490-next.0 → 16.0.0-alpha.0492-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 +79 -11
- package/dist/mdx/FONTS.mdx +128 -0
- 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/mdx/react/fonts/mdx/Fonts.mdx +0 -46
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)
|
|
@@ -55,6 +55,7 @@ Soon to be...
|
|
|
55
55
|
- [Tooltip](#tooltip)
|
|
56
56
|
- [New Utilities](#new-utilities)
|
|
57
57
|
- [cornerShapeStencil](#cornershapestencil)
|
|
58
|
+
- [Fonts](#fonts)
|
|
58
59
|
- [Deprecations](#deprecations)
|
|
59
60
|
- [Glossary](#glossary)
|
|
60
61
|
- [Main](#main)
|
|
@@ -254,11 +255,69 @@ import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
|
254
255
|
<DeleteButton variant="outline">Delete</DeleteButton>;
|
|
255
256
|
```
|
|
256
257
|
|
|
257
|
-
###
|
|
258
|
+
### Container Components
|
|
258
259
|
|
|
259
|
-
**PR:** [#
|
|
260
|
+
**PR:** [#4088](https://github.com/Workday/canvas-kit/pull/4088)
|
|
260
261
|
|
|
261
|
-
####
|
|
262
|
+
#### Alt Variant Support
|
|
263
|
+
|
|
264
|
+
Several container components now support an `alt` variant that provides an elevated surface appearance:
|
|
265
|
+
|
|
266
|
+
- `Menu.Card` - Can use `variant="alt"` for elevated menu styling
|
|
267
|
+
- `Dialog.Card` - Can use `variant="alt"` for elevated dialog styling
|
|
268
|
+
- `Popup.Card` - Can use `variant="alt"` for elevated popup styling
|
|
269
|
+
- `Toast` - Can use `variant="alt"` for elevated toast styling
|
|
270
|
+
- `Tooltip` - Can use `variant="alt"` for elevated tooltip styling
|
|
271
|
+
|
|
272
|
+
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.
|
|
273
|
+
|
|
274
|
+
```tsx
|
|
275
|
+
// Examples of using the alt variant
|
|
276
|
+
<Menu.Card variant="alt">
|
|
277
|
+
<Menu.List>...</Menu.List>
|
|
278
|
+
</Menu.Card>
|
|
279
|
+
|
|
280
|
+
<Dialog.Card variant="alt">
|
|
281
|
+
<Dialog.Heading>Dialog Title</Dialog.Heading>
|
|
282
|
+
<Dialog.Body>Content</Dialog.Body>
|
|
283
|
+
</Dialog.Card>
|
|
284
|
+
|
|
285
|
+
<Toast variant="alt">
|
|
286
|
+
<Toast.Body>
|
|
287
|
+
<Toast.Message>Notification message</Toast.Message>
|
|
288
|
+
</Toast.Body>
|
|
289
|
+
</Toast>
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
#### Card
|
|
293
|
+
|
|
294
|
+
**PR:** [#4014](https://github.com/Workday/canvas-kit/pull/4014), [#4088](https://github.com/Workday/canvas-kit/pull/4088)
|
|
295
|
+
|
|
296
|
+
##### Variant Changes
|
|
297
|
+
|
|
298
|
+
The `Card` component's variants have been updated:
|
|
299
|
+
- **Removed:** The `borderless` variant has been removed and replaced with `alt`
|
|
300
|
+
- **New:** The `alt` variant provides an elevated surface with inverse borders
|
|
301
|
+
- **Updated:** The default variant now has a visible border
|
|
302
|
+
- The `tonal` variant now uses a `system.legacy.color.surface.alt.strong` background.
|
|
303
|
+
|
|
304
|
+
**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.
|
|
305
|
+
|
|
306
|
+
🤖 The codemod will automatically update `variant="borderless"` to `variant="alt"`.
|
|
307
|
+
|
|
308
|
+
```tsx
|
|
309
|
+
// v15
|
|
310
|
+
<Card variant="borderless">
|
|
311
|
+
<Card.Body>Content</Card.Body>
|
|
312
|
+
</Card>
|
|
313
|
+
|
|
314
|
+
// v16
|
|
315
|
+
<Card variant="alt">
|
|
316
|
+
<Card.Body>Content</Card.Body>
|
|
317
|
+
</Card>
|
|
318
|
+
```
|
|
319
|
+
|
|
320
|
+
##### Visual Updates
|
|
262
321
|
|
|
263
322
|
- `Card.Heading` now defaults to `body.small` type level (previously `body.large`). If your design
|
|
264
323
|
requires a larger heading, you can override the `typeLevel` prop on `Card.Heading`.
|
|
@@ -266,10 +325,12 @@ import {DeleteButton} from '@workday/canvas-kit-react/button';
|
|
|
266
325
|
`padding.sm`).
|
|
267
326
|
- Card's border radius is now managed via the new `cornerShapeStencil` (see
|
|
268
327
|
[New Utilities](#new-utilities)).
|
|
328
|
+
- The default variant now includes a visible border (`system.color.border.default`).
|
|
329
|
+
- The `alt` variant uses an elevated surface color (`system.sana.color.surface.elevated`) with inverse borders.
|
|
269
330
|
|
|
270
|
-
|
|
331
|
+
#### Expandable
|
|
271
332
|
|
|
272
|
-
|
|
333
|
+
##### Visual Updates
|
|
273
334
|
|
|
274
335
|
- `Expandable.Target` border radius changed from `shape.xxl` (24px, pill) to `shape.lg` (12px), now
|
|
275
336
|
managed via `cornerShapeStencil` (see [New Utilities](#new-utilities)).
|
|
@@ -599,7 +660,7 @@ Menu icons are now smaller to align with Sana Canvas specs. In v15, `Menu.Item.I
|
|
|
599
660
|
`size` prop and fell back to the `SystemIcon` default of `lg` (24px / 1.5rem). In v16, all icons
|
|
600
661
|
rendered through `Menu.Item.Icon` and `Menu.Option.Icon` use `size="md"` (20px / 1.25rem).
|
|
601
662
|
|
|
602
|
-
The selected checkmark in `Menu.Option` now uses `checkIcon` at `size="
|
|
663
|
+
The selected checkmark in `Menu.Option` now uses `checkIcon` at `size="md"` instead of
|
|
603
664
|
`checkSmallIcon` at the previous 24px default. The nested submenu chevron in `Submenu.TargetItem`
|
|
604
665
|
also changed from `chevronRightSmallIcon` to `chevronRightIcon` at `size="md"`.
|
|
605
666
|
|
|
@@ -827,8 +888,15 @@ export const myStencil = createStencil({
|
|
|
827
888
|
});
|
|
828
889
|
```
|
|
829
890
|
|
|
830
|
-
`Card`, `Expandable` (`Expandable.Target`), `Menu` (`Menu.Card`, `Menu.List`, `Menu.Item`),
|
|
831
|
-
`Table` (`BaseTable`, `Table`) extend this stencil for their rounded corners.
|
|
891
|
+
`Card`, `Expandable` (`Expandable.Target`), `Menu` (`Menu.Card`, `Menu.List`, `Menu.Item`),
|
|
892
|
+
`MultiSelect`, and `Table` (`BaseTable`, `Table`) extend this stencil for their rounded corners.
|
|
893
|
+
|
|
894
|
+
## Fonts
|
|
895
|
+
|
|
896
|
+
Sana Canvas is a new theme available in v16, enabled by setting `data-theme="sana-canvas"` on
|
|
897
|
+
`<html>` (or a scoped ancestor element). See our
|
|
898
|
+
[Fonts guide](https://workday.github.io/canvas-kit/?path=/docs/guides-fonts--docs) for instructions
|
|
899
|
+
on setting up the Sana Sans font required by this theme.
|
|
832
900
|
|
|
833
901
|
## Deprecations
|
|
834
902
|
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# Fonts
|
|
2
|
+
|
|
3
|
+
Canvas Kit doesn't include fonts by default. Which font you need, and how to load it, depends on
|
|
4
|
+
whether your application has the [Sana Canvas theme](#sana-sans) (`data-theme="sana-canvas"`)
|
|
5
|
+
enabled.
|
|
6
|
+
|
|
7
|
+
- If the Sana Canvas theme **is** enabled, use [Sana Sans](#sana-sans).
|
|
8
|
+
- If the Sana Canvas theme **is not** enabled (the default/legacy Canvas theme), configure your app
|
|
9
|
+
to use [Roboto](#roboto) instead.
|
|
10
|
+
|
|
11
|
+
## Sana Sans
|
|
12
|
+
|
|
13
|
+
Sana Sans should be applied whenever the
|
|
14
|
+
[Sana Canvas theme](#using-sana-sans-with-the-sana-canvas-theme) is enabled in your application.
|
|
15
|
+
|
|
16
|
+
### Installation
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
yarn add @workday/canvas-kit-react
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
### Usage
|
|
23
|
+
|
|
24
|
+
The `fonts` module, exported from `@workday/canvas-kit-react`, makes importing font files simple so
|
|
25
|
+
you know you're using the correct font in your environment. We use Sana Sans for most languages we
|
|
26
|
+
support at Workday.
|
|
27
|
+
|
|
28
|
+
> Note: If your application environment already provides Sana Sans, you don't need to inject it as
|
|
29
|
+
> in the example below. Otherwise, follow these steps to inject it.
|
|
30
|
+
|
|
31
|
+
You can inject our CSS `@font-face` styles into your application by using `injectGlobal`. We prefer
|
|
32
|
+
this approach over `@emotion/react`'s [Global](https://emotion.sh/docs/globals) component that
|
|
33
|
+
injects the styles at runtime.
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import {fonts} from '@workday/canvas-kit-react/fonts';
|
|
37
|
+
import {injectGlobal} from '@workday/canvas-kit-styling';
|
|
38
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
39
|
+
|
|
40
|
+
injectGlobal({
|
|
41
|
+
...fonts,
|
|
42
|
+
'html, body': {
|
|
43
|
+
fontFamily: system.fontFamily.default,
|
|
44
|
+
margin: 0,
|
|
45
|
+
minHeight: '100vh',
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Hosting Fonts
|
|
51
|
+
|
|
52
|
+
We currently host Sana Sans on AWS S3, and the `fonts` module includes `@font-face` rules to connect
|
|
53
|
+
the proper font files.
|
|
54
|
+
|
|
55
|
+
### Variable Fonts
|
|
56
|
+
|
|
57
|
+
Sana Sans is a
|
|
58
|
+
[variable font](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Fonts/Variable_fonts). That
|
|
59
|
+
means instead of importing multiple static files, you can import a single, dynamic file that
|
|
60
|
+
supports multiple font weights and styles. It also provides more flexibility and customization than
|
|
61
|
+
traditional, static fonts. But you should be able to use it identically to how you've been using
|
|
62
|
+
other fonts.
|
|
63
|
+
|
|
64
|
+
- **Family**: Sana Sans
|
|
65
|
+
- **Format**: TrueType variable font
|
|
66
|
+
- **Weight range**: 100–700 (Regular through Bold)
|
|
67
|
+
- **Styles**: normal, italic
|
|
68
|
+
- **Source**: `https://design.workdaycdn.com/assets/fonts/Sana-Sans/SanaSansLCG05-Variable.ttf`
|
|
69
|
+
|
|
70
|
+
### Monospace Font
|
|
71
|
+
|
|
72
|
+
The `fonts` module also includes IBM Plex Mono, used for `system.fontFamily.mono` under the Sana
|
|
73
|
+
Canvas theme.
|
|
74
|
+
|
|
75
|
+
- **Family**: IBM Plex Mono
|
|
76
|
+
- **Format**: WOFF2
|
|
77
|
+
- **Weight**: 400 (Regular)
|
|
78
|
+
- **Styles**: normal
|
|
79
|
+
- **Source**: `https://design.workdaycdn.com/assets/fonts/IBM-Plex-Mono/IBMPlexMono-Regular.woff2`
|
|
80
|
+
|
|
81
|
+
### Using Sana Sans with the Sana Canvas Theme
|
|
82
|
+
|
|
83
|
+
The Sana Canvas theme is enabled by setting `data-theme="sana-canvas"` on `<html>` (or a scoped
|
|
84
|
+
ancestor element). This switches the `--cnvs-sys-font-family-default` token
|
|
85
|
+
(`system.fontFamily.default`) to reference `'Sana Sans VF'` via the cascade in
|
|
86
|
+
`@workday/canvas-tokens-web/css/sana/_variables.css`.
|
|
87
|
+
|
|
88
|
+
To use this theme, you also must import `@workday/canvas-tokens-web/css/sana/_variables.css` in
|
|
89
|
+
addition to the other token CSS files. See the
|
|
90
|
+
[Getting Started guide](https://workday.github.io/canvas-kit/?path=/docs/guides-getting-started--docs)
|
|
91
|
+
for a full tokens CSS file import example.
|
|
92
|
+
|
|
93
|
+
> **Note:** This requires `@workday/canvas-tokens-web` `4.4.0` or later. If you're on an older
|
|
94
|
+
> version, upgrade `@workday/canvas-tokens-web` first.
|
|
95
|
+
|
|
96
|
+
Once the theme's font-family token and the loaded `@font-face` share the same family name, no
|
|
97
|
+
additional CSS override is required — import and use the `fonts` module exactly as described in
|
|
98
|
+
[Usage](#usage) above, and Sana Sans will render automatically wherever `data-theme="sana-canvas"`
|
|
99
|
+
is set.
|
|
100
|
+
|
|
101
|
+
## Roboto
|
|
102
|
+
|
|
103
|
+
If your application doesn't have the Sana Canvas theme enabled, install
|
|
104
|
+
`@workday/canvas-kit-react-fonts` to load Roboto instead. This module also includes Roboto Mono,
|
|
105
|
+
used for `system.fontFamily.mono`.
|
|
106
|
+
|
|
107
|
+
### Installation
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
yarn add @workday/canvas-kit-react-fonts
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
### Usage
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
import {fonts} from '@workday/canvas-kit-react-fonts';
|
|
117
|
+
import {injectGlobal} from '@workday/canvas-kit-styling';
|
|
118
|
+
import {system} from '@workday/canvas-tokens-web';
|
|
119
|
+
|
|
120
|
+
injectGlobal({
|
|
121
|
+
...fonts,
|
|
122
|
+
'html, body': {
|
|
123
|
+
fontFamily: system.fontFamily.default,
|
|
124
|
+
margin: 0,
|
|
125
|
+
minHeight: '100vh',
|
|
126
|
+
},
|
|
127
|
+
});
|
|
128
|
+
```
|
|
@@ -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.0492-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.0492-next.0",
|
|
51
|
+
"@workday/canvas-kit-preview-react": "^16.0.0-alpha.0492-next.0",
|
|
52
|
+
"@workday/canvas-kit-react": "^16.0.0-alpha.0492-next.0",
|
|
53
|
+
"@workday/canvas-kit-styling": "^16.0.0-alpha.0492-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.13",
|
|
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": "27691d763b93d270f78808ca298848d405c888e1"
|
|
67
67
|
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
# Sana Sans Font
|
|
2
|
-
|
|
3
|
-
## Installation
|
|
4
|
-
|
|
5
|
-
```sh
|
|
6
|
-
yarn add @workday/canvas-kit-react
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
## Usage
|
|
10
|
-
|
|
11
|
-
The fonts package makes importing font files simple so you know you're using the correct font in your environment. We use Sana Sans for most languages we support at Workday.
|
|
12
|
-
|
|
13
|
-
> Note: If your application environment already provides Sana Sans, you don't need to inject it as in the example below. But this package is useful for testing, documentation, and development where you don't have the font readily available. This package is likely not appropriate to use in production environments due to how the font is [hosted](#hosting-fonts).
|
|
14
|
-
|
|
15
|
-
You can inject our CSS `@font-face` styles into your application by using `injectGlobal`. We prefer this approach over `@emotion/react`'s [Global](https://emotion.sh/docs/globals) component that injects the styles at runtime.
|
|
16
|
-
|
|
17
|
-
```ts
|
|
18
|
-
import {injectGlobal} from '@workday/canvas-kit-styling';
|
|
19
|
-
import {fonts} from '@workday/canvas-kit-react/fonts';
|
|
20
|
-
import {system} from '@workday/canvas-tokens-web';
|
|
21
|
-
|
|
22
|
-
injectGlobal(...fonts);
|
|
23
|
-
injectGlobal({
|
|
24
|
-
'html, body': {
|
|
25
|
-
fontFamily: system.fontFamily.default,
|
|
26
|
-
margin: 0,
|
|
27
|
-
minHeight: '100vh',
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
## Hosting Fonts
|
|
33
|
-
|
|
34
|
-
We currently host Sana Sans through durable storage, and this package connects `@font-faces` to those font files. This keeps the package size minimal, while ensuring you don't have to worry about the wiring. But because durable storage is regionally-bound, you might consider using a CDN if your environment experiences degraded performance.
|
|
35
|
-
|
|
36
|
-
## Variable Fonts
|
|
37
|
-
|
|
38
|
-
Sana Sans is a [variable font](https://developer.mozilla.org/en-US/docs/Web/CSS/Guides/Fonts/Variable_fonts). That means instead of importing multiple static files, you can import a single, dynamic file that supports multiple font weights and styles. It also provides more flexibility and customization than traditional, static fonts. But you should be able to use it identically to how you've been using other fonts.
|
|
39
|
-
|
|
40
|
-
### Sana Sans
|
|
41
|
-
|
|
42
|
-
- **Family**: Sana Sans
|
|
43
|
-
- **Format**: TrueType variable font
|
|
44
|
-
- **Weight range**: 100–700 (Regular through Bold)
|
|
45
|
-
- **Styles**: normal, italic
|
|
46
|
-
- **Source**: `https://design.workdaycdn.com/assets/fonts/Sana-Sans/SanaSansLCG05-Variable.ttf`
|