@slotted/react 0.1.0-beta.42 → 0.1.0-beta.43
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/{app-shell-D54YkU7E.js → app-shell-DsWhsSMU.js} +3 -2
- package/dist/app-shell.js +1 -1
- package/dist/attachment-TZykYNu5.js +300 -0
- package/dist/attachment.js +2 -2
- package/dist/{avatar-group-bJaZE1_C.js → avatar-group-Bzmmj2HI.js} +2 -1
- package/dist/avatar-group.js +1 -1
- package/dist/{carousel-B9nMK7Yf.js → carousel-CRNz-T3g.js} +1 -1
- package/dist/carousel.js +1 -1
- package/dist/{command-palette-C90CzfQi.js → command-palette-Bgf5tfCI.js} +160 -156
- package/dist/command-palette.js +1 -1
- package/dist/{data-grid-D106baPp.js → data-grid-DUft3rJb.js} +1 -1
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-BA0xrySM.js → data-list-Dv3orBtf.js} +15 -15
- package/dist/data-list.js +1 -1
- package/dist/detail-panel-Cke3ZFU3.js +342 -0
- package/dist/detail-panel.js +2 -2
- package/dist/docs/action-bar.examples.md +768 -0
- package/dist/docs/action-bar.json +74 -50
- package/dist/docs/action-bar.md +49 -311
- package/dist/docs/app-shell.examples.md +1221 -64
- package/dist/docs/app-shell.json +92 -60
- package/dist/docs/app-shell.md +92 -57
- package/dist/docs/attachment.examples.md +689 -0
- package/dist/docs/attachment.json +69 -37
- package/dist/docs/attachment.md +44 -203
- package/dist/docs/avatar-group.json +111 -23
- package/dist/docs/avatar-group.md +487 -28
- package/dist/docs/button-group.json +98 -2
- package/dist/docs/button-group.md +411 -8
- package/dist/docs/calendar.examples.md +512 -0
- package/dist/docs/calendar.json +72 -24
- package/dist/docs/calendar.md +18 -147
- package/dist/docs/carousel.examples.md +868 -0
- package/dist/docs/carousel.json +58 -50
- package/dist/docs/carousel.md +66 -300
- package/dist/docs/cascader.examples.md +1269 -0
- package/dist/docs/cascader.json +72 -16
- package/dist/docs/cascader.md +78 -154
- package/dist/docs/chart.examples.md +734 -24
- package/dist/docs/chart.json +93 -13
- package/dist/docs/chart.md +28 -7
- package/dist/docs/clock.json +71 -15
- package/dist/docs/clock.md +326 -21
- package/dist/docs/code-block.json +79 -55
- package/dist/docs/code-block.md +417 -74
- package/dist/docs/color-picker.json +60 -12
- package/dist/docs/color-picker.md +245 -22
- package/dist/docs/column-manager.examples.md +764 -0
- package/dist/docs/column-manager.json +68 -12
- package/dist/docs/column-manager.md +44 -203
- package/dist/docs/command-palette.examples.md +747 -0
- package/dist/docs/command-palette.json +48 -24
- package/dist/docs/command-palette.md +60 -339
- package/dist/docs/currency-field.examples.md +355 -73
- package/dist/docs/currency-field.json +96 -64
- package/dist/docs/currency-field.md +57 -50
- package/dist/docs/dashboard-grid.examples.md +629 -0
- package/dist/docs/dashboard-grid.json +64 -16
- package/dist/docs/dashboard-grid.md +34 -152
- package/dist/docs/data-list.examples.md +1556 -0
- package/dist/docs/data-list.json +58 -18
- package/dist/docs/data-list.md +139 -224
- package/dist/docs/date-field.examples.md +543 -0
- package/dist/docs/date-field.json +64 -24
- package/dist/docs/date-field.md +22 -168
- package/dist/docs/datetime-field.examples.md +699 -0
- package/dist/docs/datetime-field.json +79 -31
- package/dist/docs/datetime-field.md +24 -269
- package/dist/docs/datetime-range-picker.examples.md +682 -0
- package/dist/docs/datetime-range-picker.json +117 -61
- package/dist/docs/datetime-range-picker.md +59 -224
- package/dist/docs/description-list.examples.md +652 -0
- package/dist/docs/description-list.json +49 -25
- package/dist/docs/description-list.md +33 -188
- package/dist/docs/detail-panel.examples.md +1177 -0
- package/dist/docs/detail-panel.json +69 -53
- package/dist/docs/detail-panel.md +114 -324
- package/dist/docs/entity-picker.examples.md +1037 -0
- package/dist/docs/entity-picker.json +66 -18
- package/dist/docs/entity-picker.md +56 -246
- package/dist/docs/event-calendar.examples.md +749 -49
- package/dist/docs/event-calendar.json +46 -22
- package/dist/docs/event-calendar.md +81 -11
- package/dist/docs/field-group.examples.md +554 -0
- package/dist/docs/field-group.json +98 -34
- package/dist/docs/field-group.md +55 -133
- package/dist/docs/filter-bar.examples.md +772 -0
- package/dist/docs/filter-bar.json +41 -25
- package/dist/docs/filter-bar.md +42 -246
- package/dist/docs/form.examples.md +579 -0
- package/dist/docs/form.json +87 -39
- package/dist/docs/form.md +53 -177
- package/dist/docs/fullscreen.examples.md +558 -0
- package/dist/docs/fullscreen.json +58 -18
- package/dist/docs/fullscreen.md +50 -169
- package/dist/docs/highlight.json +57 -25
- package/dist/docs/highlight.md +402 -50
- package/dist/docs/icon.json +85 -5
- package/dist/docs/icon.md +401 -10
- package/dist/docs/image.examples.md +670 -0
- package/dist/docs/image.json +44 -28
- package/dist/docs/image.md +24 -176
- package/dist/docs/import-export-center.examples.md +1280 -0
- package/dist/docs/import-export-center.json +67 -27
- package/dist/docs/import-export-center.md +121 -226
- package/dist/docs/list-item.examples.md +769 -0
- package/dist/docs/list-item.json +110 -38
- package/dist/docs/list-item.md +84 -201
- package/dist/docs/listbox.examples.md +858 -0
- package/dist/docs/listbox.json +76 -28
- package/dist/docs/listbox.md +41 -263
- package/dist/docs/markdown.json +79 -55
- package/dist/docs/markdown.md +581 -85
- package/dist/docs/media-viewer.examples.md +1038 -0
- package/dist/docs/media-viewer.json +70 -15
- package/dist/docs/media-viewer.md +84 -135
- package/dist/docs/message-scroller.examples.md +1193 -0
- package/dist/docs/message-scroller.json +41 -17
- package/dist/docs/message-scroller.md +80 -134
- package/dist/docs/message.examples.md +944 -0
- package/dist/docs/message.json +64 -16
- package/dist/docs/message.md +34 -326
- package/dist/docs/meter.json +58 -26
- package/dist/docs/meter.md +312 -32
- package/dist/docs/navigation-menu.examples.md +1107 -0
- package/dist/docs/navigation-menu.json +57 -41
- package/dist/docs/navigation-menu.md +105 -298
- package/dist/docs/notification-center.examples.md +1045 -0
- package/dist/docs/notification-center.json +71 -15
- package/dist/docs/notification-center.md +76 -266
- package/dist/docs/otp-input.examples.md +490 -0
- package/dist/docs/otp-input.json +65 -25
- package/dist/docs/otp-input.md +20 -191
- package/dist/docs/page-header.examples.md +1041 -0
- package/dist/docs/page-header.json +75 -43
- package/dist/docs/page-header.md +79 -291
- package/dist/docs/page.examples.md +633 -0
- package/dist/docs/page.json +48 -16
- package/dist/docs/page.md +62 -129
- package/dist/docs/prompt-composer.examples.md +630 -0
- package/dist/docs/prompt-composer.json +66 -18
- package/dist/docs/prompt-composer.md +35 -161
- package/dist/docs/prose.json +69 -37
- package/dist/docs/prose.md +393 -75
- package/dist/docs/rating.examples.md +525 -0
- package/dist/docs/rating.json +92 -28
- package/dist/docs/rating.md +27 -241
- package/dist/docs/saved-views.examples.md +1108 -0
- package/dist/docs/saved-views.json +53 -21
- package/dist/docs/saved-views.md +86 -171
- package/dist/docs/scroll-area.examples.md +837 -0
- package/dist/docs/scroll-area.json +64 -24
- package/dist/docs/scroll-area.md +57 -140
- package/dist/docs/section.examples.md +676 -0
- package/dist/docs/section.json +68 -20
- package/dist/docs/section.md +39 -162
- package/dist/docs/segmented-control.examples.md +480 -0
- package/dist/docs/segmented-control.json +76 -28
- package/dist/docs/segmented-control.md +20 -191
- package/dist/docs/side-navigation.examples.md +1468 -0
- package/dist/docs/side-navigation.json +53 -53
- package/dist/docs/side-navigation.md +79 -354
- package/dist/docs/slider.examples.md +505 -0
- package/dist/docs/slider.json +91 -51
- package/dist/docs/slider.md +47 -212
- package/dist/docs/sparkline.json +60 -36
- package/dist/docs/sparkline.md +447 -71
- package/dist/docs/split-button.examples.md +509 -0
- package/dist/docs/split-button.json +73 -41
- package/dist/docs/split-button.md +64 -194
- package/dist/docs/splitter.examples.md +921 -0
- package/dist/docs/splitter.json +94 -46
- package/dist/docs/splitter.md +75 -182
- package/dist/docs/stat-card.examples.md +725 -0
- package/dist/docs/stat-card.json +89 -41
- package/dist/docs/stat-card.md +55 -227
- package/dist/docs/status-indicator.json +80 -32
- package/dist/docs/status-indicator.md +409 -65
- package/dist/docs/stepper.json +53 -21
- package/dist/docs/stepper.md +369 -48
- package/dist/docs/table-of-contents.examples.md +550 -0
- package/dist/docs/table-of-contents.json +60 -28
- package/dist/docs/table-of-contents.md +70 -205
- package/dist/docs/tags-input.examples.md +541 -0
- package/dist/docs/tags-input.json +64 -16
- package/dist/docs/tags-input.md +15 -262
- package/dist/docs/time-field.examples.md +587 -0
- package/dist/docs/time-field.json +69 -29
- package/dist/docs/time-field.md +21 -223
- package/dist/docs/time-picker.json +117 -53
- package/dist/docs/time-picker.md +499 -54
- package/dist/docs/time-range-picker.examples.md +750 -0
- package/dist/docs/time-range-picker.json +139 -75
- package/dist/docs/time-range-picker.md +63 -225
- package/dist/docs/timeline.examples.md +617 -0
- package/dist/docs/timeline.json +44 -28
- package/dist/docs/timeline.md +34 -208
- package/dist/docs/toolbar.json +56 -16
- package/dist/docs/toolbar.md +357 -63
- package/dist/docs/top-navigation.examples.md +1206 -140
- package/dist/docs/top-navigation.json +49 -33
- package/dist/docs/top-navigation.md +87 -36
- package/dist/docs/tour.examples.md +960 -0
- package/dist/docs/tour.json +57 -25
- package/dist/docs/tour.md +60 -244
- package/dist/docs/transfer.examples.md +631 -0
- package/dist/docs/transfer.json +80 -16
- package/dist/docs/transfer.md +41 -170
- package/dist/docs/typography.json +96 -0
- package/dist/docs/typography.md +352 -4
- package/dist/docs/upload.examples.md +555 -53
- package/dist/docs/upload.json +62 -30
- package/dist/docs/upload.md +46 -11
- package/dist/docs/wizard.examples.md +1389 -0
- package/dist/docs/wizard.json +89 -49
- package/dist/docs/wizard.md +122 -263
- package/dist/{entity-picker-CC4VoC3p.js → entity-picker-C78f3Z0o.js} +9 -6
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-CjmF_e0H.js → event-calendar-DJPoCi-O.js} +1 -1
- package/dist/event-calendar.js +1 -1
- package/dist/{filter-bar-B3QJD7SZ.js → filter-bar-D61wiQFP.js} +1 -1
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-CW8YVZev.js → import-export-center-mqvmlzwB.js} +44 -36
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +58 -58
- package/dist/{markdown-BdskE4-L.js → markdown-8CtV4k44.js} +2 -2
- package/dist/markdown.js +1 -1
- package/dist/{media-viewer-zEXcwfEY.js → media-viewer-C_cbuAq-.js} +64 -60
- package/dist/media-viewer.js +2 -2
- package/dist/message-P91bEGyV.js +455 -0
- package/dist/message.js +2 -2
- package/dist/{page-header-DmwBGwlm.js → page-header-jeAIQSZM.js} +103 -108
- package/dist/page-header.js +1 -1
- package/dist/section-CVTQdWBl.js +216 -0
- package/dist/section.js +2 -2
- package/dist/{segmented-control-CbK7SurB.js → segmented-control-BSMVjukr.js} +1 -1
- package/dist/segmented-control.js +1 -1
- package/dist/{side-navigation-CKRETc8E.js → side-navigation-BQzBxz2B.js} +179 -179
- package/dist/side-navigation.js +1 -1
- package/dist/{stat-card-CL3Xe6pV.js → stat-card-BpGZiFbG.js} +12 -14
- package/dist/stat-card.js +1 -1
- package/dist/{stepper-DHdrANZI.js → stepper-Cxb_tHnA.js} +130 -127
- package/dist/stepper.js +2 -2
- package/dist/styles/carousel.css +1 -1
- package/dist/styles/index.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{timeline-BiL2CXfn.js → timeline-ZngK6zLC.js} +9 -6
- package/dist/timeline.js +1 -1
- package/dist/top-navigation-YSEQzBhD.js +744 -0
- package/dist/top-navigation.js +2 -2
- package/dist/{transfer-sKUvmEKe.js → transfer-Cv5yQuTN.js} +1 -1
- package/dist/transfer.js +1 -1
- package/dist/types/attachment/attachment-parts.d.ts +24 -11
- package/dist/types/attachment/attachment-parts.d.ts.map +1 -1
- package/dist/types/attachment/attachment.d.ts +3 -3
- package/dist/types/attachment/attachment.d.ts.map +1 -1
- package/dist/types/avatar-group/avatar-group.d.ts.map +1 -1
- package/dist/types/carousel/carousel-parts.d.ts +2 -2
- package/dist/types/command-palette/command-palette.d.ts.map +1 -1
- package/dist/types/data-list/data-list.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel-parts.d.ts +10 -3
- package/dist/types/detail-panel/detail-panel-parts.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.d.ts.map +1 -1
- package/dist/types/detail-panel/detail-panel.types.d.ts +7 -0
- package/dist/types/detail-panel/detail-panel.types.d.ts.map +1 -1
- package/dist/types/entity-picker/entity-picker.d.ts.map +1 -1
- package/dist/types/import-export-center/import-export-center.d.ts.map +1 -1
- package/dist/types/media-viewer/index.d.ts +2 -2
- package/dist/types/media-viewer/index.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts +3 -1
- package/dist/types/media-viewer/media-viewer-bar.d.ts.map +1 -1
- package/dist/types/media-viewer/media-viewer.types.d.ts +1 -0
- package/dist/types/media-viewer/media-viewer.types.d.ts.map +1 -1
- package/dist/types/message/message-parts.d.ts +7 -0
- package/dist/types/message/message-parts.d.ts.map +1 -1
- package/dist/types/message/message.d.ts.map +1 -1
- package/dist/types/page-header/page-header-parts.d.ts.map +1 -1
- package/dist/types/section/section-parts.d.ts +16 -8
- package/dist/types/section/section-parts.d.ts.map +1 -1
- package/dist/types/section/section.d.ts.map +1 -1
- package/dist/types/segmented-control/segmented-control-parts.d.ts.map +1 -1
- package/dist/types/side-navigation/side-navigation-parts.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-delta.d.ts.map +1 -1
- package/dist/types/stat-card/stat-card-parts.d.ts +3 -3
- package/dist/types/stat-card/stat-card-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper-parts.d.ts +11 -2
- package/dist/types/stepper/stepper-parts.d.ts.map +1 -1
- package/dist/types/stepper/stepper.d.ts.map +1 -1
- package/dist/types/timeline/timeline-parts.d.ts.map +1 -1
- package/dist/types/top-navigation/top-navigation.d.ts.map +1 -1
- package/dist/{wizard-4c0X7Bx_.js → wizard-Dfryz1id.js} +214 -214
- package/dist/wizard.js +1 -1
- package/package.json +6 -6
- package/dist/attachment-MqczA38F.js +0 -292
- package/dist/detail-panel-EImAtksY.js +0 -327
- package/dist/message-D1Dd6Y2k.js +0 -452
- package/dist/section-D_qOfdxR.js +0 -213
- package/dist/top-navigation-D8IHPOmm.js +0 -744
package/dist/docs/stat-card.json
CHANGED
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
"part": "body",
|
|
110
110
|
"element": "div",
|
|
111
111
|
"required": true,
|
|
112
|
-
"purpose": "The grid, rendered by StatCard
|
|
112
|
+
"purpose": "The grid inside the root, rendered by StatCard: header on top, figure and trend on the row that grows, message at the bottom."
|
|
113
113
|
},
|
|
114
114
|
{
|
|
115
115
|
"part": "header",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"part": "action",
|
|
140
140
|
"element": "span",
|
|
141
141
|
"required": false,
|
|
142
|
-
"purpose": "The end of the header, for
|
|
142
|
+
"purpose": "The end of the header, for a Link or a Button. Stays on the first line when the name wraps, and takes the next line only when the two do not fit. It counts as one line of the name: a button extends past the line, and the value stands on the line of the values beside it."
|
|
143
143
|
},
|
|
144
144
|
{
|
|
145
145
|
"part": "figure",
|
|
@@ -202,119 +202,119 @@
|
|
|
202
202
|
"type": "'sm' | 'md' | 'lg'",
|
|
203
203
|
"defaultValue": "md",
|
|
204
204
|
"appliesTo": "StatCard",
|
|
205
|
-
"description": "The figure’s type and the card’s inset"
|
|
205
|
+
"description": "The figure’s type and the card’s inset."
|
|
206
206
|
},
|
|
207
207
|
{
|
|
208
208
|
"name": "fill",
|
|
209
209
|
"type": "'outline' | 'elevated' | 'subtle' | 'plain'",
|
|
210
210
|
"defaultValue": "outline",
|
|
211
211
|
"appliesTo": "StatCard",
|
|
212
|
-
"description": "The frame: a hairline, a shadow, a sunken fill, or none at all"
|
|
212
|
+
"description": "The frame: a hairline, a shadow, a sunken fill, or none at all."
|
|
213
213
|
},
|
|
214
214
|
{
|
|
215
215
|
"name": "layout",
|
|
216
216
|
"type": "'inline' | 'stacked'",
|
|
217
217
|
"defaultValue": "inline",
|
|
218
218
|
"appliesTo": "StatCard",
|
|
219
|
-
"description": "The trend beside the figure, or on its own row under it"
|
|
219
|
+
"description": "The trend beside the figure, or on its own row under it."
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
222
|
"name": "status",
|
|
223
223
|
"type": "'ready' | 'empty' | 'error'",
|
|
224
224
|
"defaultValue": "ready",
|
|
225
225
|
"appliesTo": "StatCard",
|
|
226
|
-
"description": "Whether there is a value to show, and if not, why. The layout is kept either way"
|
|
226
|
+
"description": "Whether there is a value to show, and if not, why. The layout is kept either way."
|
|
227
227
|
},
|
|
228
228
|
{
|
|
229
229
|
"name": "loading",
|
|
230
230
|
"type": "boolean",
|
|
231
231
|
"defaultValue": "false",
|
|
232
232
|
"appliesTo": "StatCard",
|
|
233
|
-
"description": "The value is on its way: every part stands in with a placeholder and the root is aria-busy"
|
|
233
|
+
"description": "The value is on its way: every part stands in with a placeholder and the root is aria-busy."
|
|
234
234
|
},
|
|
235
235
|
{
|
|
236
236
|
"name": "goodWhen",
|
|
237
237
|
"type": "'up' | 'down' | 'none'",
|
|
238
238
|
"defaultValue": "up",
|
|
239
239
|
"appliesTo": "StatCard, StatCardDelta",
|
|
240
|
-
"description": "Which way is good for this metric. The tone of a change is derived from it, never from the sign"
|
|
240
|
+
"description": "Which way is good for this metric. The tone of a change is derived from it, never from the sign."
|
|
241
241
|
},
|
|
242
242
|
{
|
|
243
243
|
"name": "delta",
|
|
244
244
|
"type": "number",
|
|
245
245
|
"defaultValue": "—",
|
|
246
246
|
"appliesTo": "StatCard",
|
|
247
|
-
"description": "The change, as the first delta reads it: a fraction for a percentage. Stated on the root so the card knows its tone before its delta renders"
|
|
247
|
+
"description": "The change, as the first delta reads it: a fraction for a percentage. Stated on the root so the card knows its tone before its delta renders."
|
|
248
248
|
},
|
|
249
249
|
{
|
|
250
250
|
"name": "tone",
|
|
251
251
|
"type": "'neutral' | 'accent' | 'secondary' | 'info' | 'success' | 'warning' | 'danger'",
|
|
252
252
|
"defaultValue": "—",
|
|
253
253
|
"appliesTo": "StatCard, StatCardDelta",
|
|
254
|
-
"description": "An explicit tone, which wins over the derived one. On the root it is what the trend hands its sparkline"
|
|
254
|
+
"description": "An explicit tone, which wins over the derived one. On the root it is what the trend hands its sparkline."
|
|
255
255
|
},
|
|
256
256
|
{
|
|
257
257
|
"name": "attention",
|
|
258
258
|
"type": "'warning' | 'danger'",
|
|
259
259
|
"defaultValue": "—",
|
|
260
260
|
"appliesTo": "StatCard",
|
|
261
|
-
"description": "The figure is past a threshold the product states: the value and the edge take the tone, the delta keeps its own. Ready values only; the comparison line names the threshold"
|
|
261
|
+
"description": "The figure is past a threshold the product states: the value and the edge take the tone, the delta keeps its own. Ready values only; the comparison line names the threshold."
|
|
262
262
|
},
|
|
263
263
|
{
|
|
264
264
|
"name": "locale",
|
|
265
265
|
"type": "string",
|
|
266
266
|
"defaultValue": "—",
|
|
267
267
|
"appliesTo": "StatCard",
|
|
268
|
-
"description": "BCP 47, for every number the card formats; the language in force when absent"
|
|
268
|
+
"description": "BCP 47, for every number the card formats; the language in force when absent."
|
|
269
269
|
},
|
|
270
270
|
{
|
|
271
271
|
"name": "formatOptions",
|
|
272
272
|
"type": "Intl.NumberFormatOptions",
|
|
273
273
|
"defaultValue": "—",
|
|
274
274
|
"appliesTo": "StatCard, StatCardValue, StatCardDelta",
|
|
275
|
-
"description": "How a number is written. On the root, the default for the value and the delta"
|
|
275
|
+
"description": "How a number is written. On the root, the default for the value and the delta."
|
|
276
276
|
},
|
|
277
277
|
{
|
|
278
278
|
"name": "emphasis",
|
|
279
279
|
"type": "'none' | 'whole'",
|
|
280
280
|
"defaultValue": "'none'",
|
|
281
281
|
"appliesTo": "StatCardValue",
|
|
282
|
-
"description": "whole draws the symbol, the decimals and the suffix of a numeric value in the unit part, so the whole units carry the figure; the text is the formatter’s either way"
|
|
282
|
+
"description": "whole draws the symbol, the decimals and the suffix of a numeric value in the unit part, so the whole units carry the figure; the text is the formatter’s either way."
|
|
283
283
|
},
|
|
284
284
|
{
|
|
285
285
|
"name": "transition",
|
|
286
286
|
"type": "'none' | 'count'",
|
|
287
287
|
"defaultValue": "'none'",
|
|
288
288
|
"appliesTo": "StatCardValue",
|
|
289
|
-
"description": "count moves a changed numeric value from the number it showed over --slotted-duration-long with the standard easing, each frame drawn by the formatter; the moving figure is hidden from assistive technology and the final one is said. The first render, a loading or empty card and a 1ms duration show the value as it is"
|
|
289
|
+
"description": "count moves a changed numeric value from the number it showed over --slotted-duration-long with the standard easing, each frame drawn by the formatter; the moving figure is hidden from assistive technology and the final one is said. The first render, a loading or empty card and a 1ms duration show the value as it is."
|
|
290
290
|
},
|
|
291
291
|
{
|
|
292
292
|
"name": "useCountTransition(value, options?)",
|
|
293
293
|
"type": "(value: number, { enabled?, source? }) => number",
|
|
294
294
|
"defaultValue": "—",
|
|
295
295
|
"appliesTo": "a value drawn through children",
|
|
296
|
-
"description": "The number to draw while value moves to a new one, for a figure the consumer formats; the timing is read on source, the document root by default"
|
|
296
|
+
"description": "The number to draw while value moves to a new one, for a figure the consumer formats; the timing is read on source, the document root by default."
|
|
297
297
|
},
|
|
298
298
|
{
|
|
299
299
|
"name": "messages",
|
|
300
300
|
"type": "Partial<StatCardMessages>",
|
|
301
301
|
"defaultValue": "—",
|
|
302
302
|
"appliesTo": "StatCard",
|
|
303
|
-
"description": "Words laid over the language in force, key by key: up, down and flat, heard before the delta; empty, shown in place of a missing value"
|
|
303
|
+
"description": "Words laid over the language in force, key by key: up, down and flat, heard before the delta; empty, shown in place of a missing value."
|
|
304
304
|
},
|
|
305
305
|
{
|
|
306
306
|
"name": "value",
|
|
307
307
|
"type": "number | string",
|
|
308
308
|
"defaultValue": "—",
|
|
309
309
|
"appliesTo": "StatCardValue, StatCardDelta",
|
|
310
|
-
"description": "A number the card formats, or text as written. On a delta, unset means the root’s delta"
|
|
310
|
+
"description": "A number the card formats, or text as written. On a delta, unset means the root’s delta."
|
|
311
311
|
},
|
|
312
312
|
{
|
|
313
313
|
"name": "format",
|
|
314
314
|
"type": "'percent' | 'decimal'",
|
|
315
315
|
"defaultValue": "percent",
|
|
316
316
|
"appliesTo": "StatCardDelta",
|
|
317
|
-
"description": "percent reads the value as a fraction; decimal reads it as it is. The sign is shown except on
|
|
317
|
+
"description": "percent reads the value as a fraction; decimal reads it as it is. The sign is shown except on zero."
|
|
318
318
|
}
|
|
319
319
|
],
|
|
320
320
|
"composition": [
|
|
@@ -323,57 +323,57 @@
|
|
|
323
323
|
"type": "ReactNode",
|
|
324
324
|
"defaultValue": "—",
|
|
325
325
|
"appliesTo": "StatCardValue, StatCardDelta",
|
|
326
|
-
"description": "
|
|
326
|
+
"description": "A custom rendering of the number, unit included; wins over value."
|
|
327
327
|
},
|
|
328
328
|
{
|
|
329
329
|
"name": "render",
|
|
330
330
|
"type": "(props) => ReactNode",
|
|
331
331
|
"defaultValue": "—",
|
|
332
332
|
"appliesTo": "every part",
|
|
333
|
-
"description": "Substitutes the rendered element: a heading for the label, a link for the action, a figure for the root"
|
|
333
|
+
"description": "Substitutes the rendered element: a heading for the label, a link for the action, a figure for the root."
|
|
334
334
|
},
|
|
335
335
|
{
|
|
336
336
|
"name": "ref",
|
|
337
337
|
"type": "Ref<HTMLElement>",
|
|
338
338
|
"defaultValue": "—",
|
|
339
339
|
"appliesTo": "every part",
|
|
340
|
-
"description": "Reaches the native element; each part’s props are that element’s, extended"
|
|
340
|
+
"description": "Reaches the native element; each part’s props are that element’s, extended."
|
|
341
341
|
},
|
|
342
342
|
{
|
|
343
343
|
"name": "StatCardTrend",
|
|
344
344
|
"type": "children",
|
|
345
345
|
"defaultValue": "—",
|
|
346
346
|
"appliesTo": "StatCard",
|
|
347
|
-
"description": "Takes a Sparkline and hands it the card’s tone through --slotted-sparkline-color, its ground for the marker’s ring, and curve=\"monotone\" with area unless sparkline defaults or the sparkline state otherwise; a tone or series on the sparkline still wins"
|
|
347
|
+
"description": "Takes a Sparkline and hands it the card’s tone through --slotted-sparkline-color, its ground for the marker’s ring, and curve=\"monotone\" with area unless sparkline defaults or the sparkline state otherwise; a tone or series on the sparkline still wins."
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
350
|
"name": "StatCardStatus, StatCardAction",
|
|
351
351
|
"type": "children",
|
|
352
352
|
"defaultValue": "—",
|
|
353
353
|
"appliesTo": "StatCardHeader",
|
|
354
|
-
"description": "Slots for a Badge or StatusIndicator, and for a Link or Button
|
|
354
|
+
"description": "Slots for a Badge or a StatusIndicator, and for a Link or a Button. The content is kept as written."
|
|
355
355
|
},
|
|
356
356
|
{
|
|
357
357
|
"name": "trendOf, toneOf",
|
|
358
358
|
"type": "function",
|
|
359
359
|
"defaultValue": "—",
|
|
360
360
|
"appliesTo": "Application",
|
|
361
|
-
"description": "The two derivations, exported for a delta you format yourself"
|
|
361
|
+
"description": "The two derivations, exported for a delta you format yourself."
|
|
362
362
|
},
|
|
363
363
|
{
|
|
364
364
|
"name": "StatCardDefaultsProvider",
|
|
365
365
|
"type": "StatCardDefaults",
|
|
366
366
|
"defaultValue": "—",
|
|
367
367
|
"appliesTo": "Application",
|
|
368
|
-
"description": "Sets goodWhen, size, fill, layout and formatOptions once for everything below it; a prop still wins"
|
|
368
|
+
"description": "Sets goodWhen, size, fill, layout and formatOptions once for everything below it; a prop still wins."
|
|
369
369
|
}
|
|
370
370
|
],
|
|
371
371
|
"events": [],
|
|
372
372
|
"accessibility": [
|
|
373
|
-
"The root is a group named by its label through aria-labelledby, so a reader who lands on the action inside it hears which metric it belongs to. There is no APG pattern for a statistic
|
|
373
|
+
"The root is a group named by its label through aria-labelledby, so a reader who lands on the action inside it hears which metric it belongs to. There is no APG pattern for a statistic. A group with an accessible name is the platform’s labelled region that is not a landmark.",
|
|
374
374
|
"The delta reads its direction before its number — “up +12.4%” — from a visually hidden word, because a sign is a glyph some readers skip and “12.4%” alone does not say which way. The indicator is aria-hidden; it repeats what the word says.",
|
|
375
375
|
"The tone is never the only channel: the indicator turns, the word is read, the sign is written. A rise that is bad and a rise that is good differ in color and in nothing a reader without color loses.",
|
|
376
|
-
"While loading the root carries aria-busy=\"true\" and every placeholder is a skeleton, hidden and inert.
|
|
376
|
+
"While loading the root carries aria-busy=\"true\" and every placeholder is a skeleton, hidden and inert. To announce a whole dashboard once instead of once per card, wrap it in a SkeletonRegion.",
|
|
377
377
|
"A missing or failed value is a dash and a message, in the DOM and in the tree; a card never announces a stale number as current.",
|
|
378
378
|
"The value is never truncated. A number wider than the trend’s room takes the room; a number wider than the card breaks; nothing is clipped or hidden behind an ellipsis."
|
|
379
379
|
]
|
|
@@ -489,7 +489,7 @@
|
|
|
489
489
|
{
|
|
490
490
|
"id": "playground",
|
|
491
491
|
"title": "Playground",
|
|
492
|
-
"note": "One card, driven by the controls: move delta across
|
|
492
|
+
"note": "One card, driven by the controls: move delta across zero and switch goodWhen to watch the tone follow the meaning; switch status and loading to see the layout hold.",
|
|
493
493
|
"language": "tsx",
|
|
494
494
|
"source": "<StatCard delta={0.124} goodWhen=\"up\">\n <StatCardHeader>\n <StatCardLabel>Open orders</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={1510} />\n <StatCardDelta />\n <StatCardComparison>\n from 1,343 <StatCardPeriod>last week</StatCardPeriod>\n </StatCardComparison>\n </StatCardFigure>\n <StatCardTrend>\n <Sparkline area data={orders} label=\"Open orders\" />\n </StatCardTrend>\n</StatCard>;\n",
|
|
495
495
|
"verdict": "excerpt"
|
|
@@ -507,48 +507,48 @@
|
|
|
507
507
|
"title": "The tone comes from the meaning, not the sign",
|
|
508
508
|
"note": "A rise in fill rate and a fall in stockouts are both success; a rise in lead time and a fall in orders are both danger; a flat change and a metric with no valence stay neutral, and the sparkline in the trend follows the delta.",
|
|
509
509
|
"language": "tsx",
|
|
510
|
-
"source": "
|
|
511
|
-
"verdict": "
|
|
510
|
+
"source": "import { Grid } from '@slotted/react/grid';\nimport {\n StatCard,\n StatCardComparison,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst CARDS = [\n { label: 'Fill rate', value: '96.1%', delta: 0.032, goodWhen: 'up', note: 'Higher is better' },\n { label: 'Stockouts', value: '38', delta: -0.18, goodWhen: 'down', note: 'Lower is better' },\n { label: 'Lead time', value: '5.2 days', delta: 0.18, goodWhen: 'down', note: 'Lower is better' },\n { label: 'Open orders', value: '1,510', delta: -0.061, goodWhen: 'up', note: 'Higher is better' },\n { label: 'Pick accuracy', value: '99.2%', delta: 0, goodWhen: 'up', note: 'Higher is better' },\n {\n label: 'Purchase orders',\n value: '212',\n delta: 0.094,\n goodWhen: 'none',\n note: 'No preferred way',\n },\n] as const;\n\nexport default function StatCardGoodWhen() {\n return (\n <Grid columns={2} gap={4}>\n {CARDS.map((card) => (\n <StatCard key={card.label} delta={card.delta} goodWhen={card.goodWhen}>\n <StatCardHeader>\n <StatCardLabel>{card.label}</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={card.value} />\n <StatCardDelta />\n <StatCardComparison>{card.note}</StatCardComparison>\n </StatCardFigure>\n </StatCard>\n ))}\n </Grid>\n );\n}\n",
|
|
511
|
+
"verdict": "example"
|
|
512
512
|
},
|
|
513
513
|
{
|
|
514
514
|
"id": "sizes",
|
|
515
515
|
"title": "Three sizes of figure",
|
|
516
516
|
"note": "sm sets the value at 20 pixels for a row of eight, md at 24 for the four a dashboard opens with, lg at 32 — the step the type scale gained for it — for the one metric a page leads with. The trend column widens with the step.",
|
|
517
517
|
"language": "tsx",
|
|
518
|
-
"source": "
|
|
519
|
-
"verdict": "
|
|
518
|
+
"source": "import { Stack } from '@slotted/react/stack';\nimport {\n StatCard,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst CARDS = [\n { size: 'sm', label: 'Pick accuracy', value: '99.2%', delta: 0.003 },\n { size: 'md', label: 'Orders shipped', value: '1,284', delta: 0.041 },\n { size: 'lg', label: 'Revenue', value: '$48,210', delta: 0.087 },\n] as const;\n\nexport default function StatCardSizes() {\n return (\n <Stack gap={4}>\n {CARDS.map((card) => (\n <StatCard key={card.size} delta={card.delta} size={card.size}>\n <StatCardHeader>\n <StatCardLabel>{card.label}</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={card.value} />\n <StatCardDelta />\n </StatCardFigure>\n </StatCard>\n ))}\n </Stack>\n );\n}\n",
|
|
519
|
+
"verdict": "example"
|
|
520
520
|
},
|
|
521
521
|
{
|
|
522
522
|
"id": "fill",
|
|
523
523
|
"title": "Four frames",
|
|
524
524
|
"note": "outline is the hairline card; elevated lifts on a shadow and keeps the hairline for forced colors; subtle recedes onto the sunken surface; plain has no frame and no inset, for a table cell or a row divided by rules where a second edge would be a box in a box.",
|
|
525
525
|
"language": "tsx",
|
|
526
|
-
"source": "
|
|
527
|
-
"verdict": "
|
|
526
|
+
"source": "import { Grid } from '@slotted/react/grid';\nimport {\n StatCard,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst CARDS = [\n { fill: 'outline', label: 'Open orders', value: '1,510', delta: 0.124 },\n { fill: 'elevated', label: 'Orders shipped', value: '1,284', delta: 0.041 },\n { fill: 'subtle', label: 'Pick accuracy', value: '99.2%', delta: 0.003 },\n { fill: 'plain', label: 'Return rate', value: '2.4%', delta: -0.003 },\n] as const;\n\nexport default function StatCardFill() {\n return (\n <Grid columns={2} gap={4}>\n {CARDS.map((card) => (\n <StatCard\n key={card.fill}\n delta={card.delta}\n fill={card.fill}\n goodWhen={card.label === 'Return rate' ? 'down' : 'up'}\n >\n <StatCardHeader>\n <StatCardLabel>{card.label}</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={card.value} />\n <StatCardDelta />\n </StatCardFigure>\n </StatCard>\n ))}\n </Grid>\n );\n}\n",
|
|
527
|
+
"verdict": "example"
|
|
528
528
|
},
|
|
529
529
|
{
|
|
530
530
|
"id": "layout",
|
|
531
531
|
"title": "The trend beside the figure, or under it",
|
|
532
532
|
"note": "inline puts the sparkline in a column beside the value, as tall as the figure; stacked runs it to the card’s edges on the last row, level with the bottom of every card in the row. Under 220 pixels a card stacks on its own and drops the value one step.",
|
|
533
533
|
"language": "tsx",
|
|
534
|
-
"source": "
|
|
535
|
-
"verdict": "
|
|
534
|
+
"source": "import { Sparkline } from '@slotted/react/sparkline';\nimport { Stack } from '@slotted/react/stack';\nimport {\n StatCard,\n StatCardComparison,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardPeriod,\n StatCardTrend,\n StatCardValue,\n} from '@slotted/react/stat-card';\nimport { Text } from '@slotted/react/typography';\n\nconst LAYOUTS = ['inline', 'stacked'] as const;\n\nconst OPEN_ORDERS = [1290, 1312, 1301, 1340, 1388, 1427, 1451, 1510];\n\nexport default function StatCardLayout() {\n return (\n <Stack gap={6}>\n {LAYOUTS.map((layout) => (\n <Stack key={layout} gap={3}>\n <Text size=\"sm\" tone=\"muted\">{`layout: ${layout}`}</Text>\n\n <StatCard delta={0.124} layout={layout}>\n <StatCardHeader>\n <StatCardLabel>Open orders</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={1510} />\n <StatCardDelta />\n <StatCardComparison>\n from 1,343 <StatCardPeriod>last week</StatCardPeriod>\n </StatCardComparison>\n </StatCardFigure>\n <StatCardTrend>\n <Sparkline data={OPEN_ORDERS} label=\"Open orders\" />\n </StatCardTrend>\n </StatCard>\n </Stack>\n ))}\n </Stack>\n );\n}\n",
|
|
535
|
+
"verdict": "example"
|
|
536
536
|
},
|
|
537
537
|
{
|
|
538
538
|
"id": "loading",
|
|
539
539
|
"title": "The layout is kept while the value is on its way",
|
|
540
540
|
"note": "Every text part stands in with a placeholder of its own line height and the trend with a block in the trend’s own box, so nothing moves when the numbers arrive; the previous value is not shown as if it were current.",
|
|
541
541
|
"language": "tsx",
|
|
542
|
-
"source": "<StatCard loading={
|
|
543
|
-
"verdict": "
|
|
542
|
+
"source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport { Grid } from '@slotted/react/grid';\nimport { Inline } from '@slotted/react/inline';\nimport { Sparkline } from '@slotted/react/sparkline';\nimport { Stack } from '@slotted/react/stack';\nimport {\n StatCard,\n StatCardComparison,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardPeriod,\n StatCardTrend,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst CARDS = [\n { label: 'Open orders', value: 1510, delta: 0.124, data: [1290, 1312, 1301, 1340, 1427, 1510] },\n {\n label: 'Orders shipped',\n value: 1284,\n delta: 0.041,\n data: [1180, 1204, 1196, 1240, 1262, 1284],\n },\n] as const;\n\nexport default function StatCardLoading() {\n const [loading, setLoading] = useState(true);\n\n function handleToggle() {\n setLoading((current) => !current);\n }\n\n return (\n <Stack gap={4}>\n <Inline>\n <Button onClick={handleToggle}>{loading ? 'Show values' : 'Show loading'}</Button>\n </Inline>\n\n <Grid gap={4} minItemWidth=\"xs\">\n {CARDS.map((card) => (\n <StatCard key={card.label} delta={card.delta} loading={loading}>\n <StatCardHeader>\n <StatCardLabel>{card.label}</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={card.value} />\n <StatCardDelta />\n <StatCardComparison>\n from last week <StatCardPeriod>Mon to Sun</StatCardPeriod>\n </StatCardComparison>\n </StatCardFigure>\n <StatCardTrend>\n <Sparkline data={card.data} label={card.label} />\n </StatCardTrend>\n </StatCard>\n ))}\n </Grid>\n </Stack>\n );\n}\n",
|
|
543
|
+
"verdict": "example"
|
|
544
544
|
},
|
|
545
545
|
{
|
|
546
546
|
"id": "status",
|
|
547
547
|
"title": "A value that is missing, and one that failed",
|
|
548
548
|
"note": "empty and error keep the card’s frame and height, put a dash where the value was, drop the delta, the comparison and the trend, and show the message — in the danger tone when the metrics service did not answer.",
|
|
549
549
|
"language": "tsx",
|
|
550
|
-
"source": "
|
|
551
|
-
"verdict": "
|
|
550
|
+
"source": "import { Grid } from '@slotted/react/grid';\nimport {\n StatCard,\n StatCardComparison,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardMessage,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst CARDS = [\n { status: 'ready', label: 'Return rate', value: '2.4%', message: '' },\n {\n status: 'empty',\n label: 'Customer churn',\n value: '3.1%',\n message: 'No data for this period yet.',\n },\n {\n status: 'error',\n label: 'Carrier on-time rate',\n value: '94.0%',\n message: 'The carrier service did not answer.',\n },\n] as const;\n\nexport default function StatCardStatusExample() {\n return (\n <Grid gap={4} minItemWidth=\"xs\">\n {CARDS.map((card) => (\n <StatCard key={card.status} delta={-0.003} goodWhen=\"down\" status={card.status}>\n <StatCardHeader>\n <StatCardLabel>{card.label}</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={card.value} />\n <StatCardDelta />\n <StatCardComparison>from 2.7% last week</StatCardComparison>\n </StatCardFigure>\n <StatCardMessage>{card.message}</StatCardMessage>\n </StatCard>\n ))}\n </Grid>\n );\n}\n",
|
|
551
|
+
"verdict": "example"
|
|
552
552
|
},
|
|
553
553
|
{
|
|
554
554
|
"id": "row",
|
|
@@ -573,6 +573,54 @@
|
|
|
573
573
|
"language": "tsx",
|
|
574
574
|
"source": "<SlottedProvider locale=\"pt-BR\" catalogs={{ 'pt-BR': PT_BR }}>\n <Dashboard />\n</SlottedProvider>;\n",
|
|
575
575
|
"verdict": "excerpt"
|
|
576
|
+
},
|
|
577
|
+
{
|
|
578
|
+
"id": "attention",
|
|
579
|
+
"title": "attention.tsx",
|
|
580
|
+
"note": null,
|
|
581
|
+
"language": "tsx",
|
|
582
|
+
"source": "import { Grid } from '@slotted/react/grid';\nimport {\n StatCard,\n StatCardComparison,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst CARDS = [\n {\n label: 'Pick backlog',\n value: 412,\n delta: 0.05,\n note: 'Warning above 400 lines',\n attention: 'warning',\n },\n {\n label: 'Dock-to-stock hours',\n value: 31,\n delta: 0.12,\n note: 'Danger above 24 hours',\n attention: 'danger',\n },\n] as const;\n\nexport default function StatCardAttention() {\n return (\n <Grid gap={4} minItemWidth=\"xs\">\n {CARDS.map((card) => (\n <StatCard key={card.label} attention={card.attention} delta={card.delta} goodWhen=\"down\">\n <StatCardHeader>\n <StatCardLabel>{card.label}</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={card.value} />\n <StatCardDelta />\n <StatCardComparison>{card.note}</StatCardComparison>\n </StatCardFigure>\n </StatCard>\n ))}\n </Grid>\n );\n}\n",
|
|
583
|
+
"verdict": "example"
|
|
584
|
+
},
|
|
585
|
+
{
|
|
586
|
+
"id": "basic",
|
|
587
|
+
"title": "basic.tsx",
|
|
588
|
+
"note": null,
|
|
589
|
+
"language": "tsx",
|
|
590
|
+
"source": "import {\n StatCard,\n StatCardComparison,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardPeriod,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nexport default function StatCardBasic() {\n return (\n <StatCard delta={0.124}>\n <StatCardHeader>\n <StatCardLabel>Open orders</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={1510} />\n <StatCardDelta />\n <StatCardComparison>\n from 1,343 <StatCardPeriod>last week</StatCardPeriod>\n </StatCardComparison>\n </StatCardFigure>\n </StatCard>\n );\n}\n",
|
|
591
|
+
"verdict": "example"
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
"id": "count",
|
|
595
|
+
"title": "count.tsx",
|
|
596
|
+
"note": null,
|
|
597
|
+
"language": "tsx",
|
|
598
|
+
"source": "import { useState } from 'react';\n\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport {\n StatCard,\n StatCardComparison,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardPeriod,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst USD = { style: 'currency', currency: 'USD', maximumFractionDigits: 0 } as const;\n\nexport default function StatCardCount() {\n const [revenue, setRevenue] = useState(184200);\n\n function handleBook() {\n setRevenue((current) => current + 2450);\n }\n\n return (\n <Stack gap={4}>\n <StatCard>\n <StatCardHeader>\n <StatCardLabel>Revenue today</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue formatOptions={USD} transition=\"count\" value={revenue} />\n <StatCardComparison>\n from $171,800 <StatCardPeriod>yesterday</StatCardPeriod>\n </StatCardComparison>\n </StatCardFigure>\n </StatCard>\n\n <Inline>\n <Button onClick={handleBook}>Book an order</Button>\n </Inline>\n </Stack>\n );\n}\n",
|
|
599
|
+
"verdict": "example"
|
|
600
|
+
},
|
|
601
|
+
{
|
|
602
|
+
"id": "format",
|
|
603
|
+
"title": "format.tsx",
|
|
604
|
+
"note": null,
|
|
605
|
+
"language": "tsx",
|
|
606
|
+
"source": "import { Grid } from '@slotted/react/grid';\nimport {\n StatCard,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardUnit,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst COMPACT_USD = { style: 'currency', currency: 'USD', notation: 'compact' } as const;\nconst USD = { style: 'currency', currency: 'USD' } as const;\nconst EUR = { style: 'currency', currency: 'EUR' } as const;\n\nexport default function StatCardFormat() {\n return (\n <Grid columns={2} gap={4}>\n <StatCard delta={0.087}>\n <StatCardHeader>\n <StatCardLabel>Revenue</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue formatOptions={COMPACT_USD} value={1234567} />\n <StatCardDelta />\n </StatCardFigure>\n </StatCard>\n\n <StatCard delta={0.021}>\n <StatCardHeader>\n <StatCardLabel>Average order value</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue emphasis=\"whole\" formatOptions={USD} value={128.45} />\n <StatCardDelta />\n </StatCardFigure>\n </StatCard>\n\n <StatCard delta={0.032} locale=\"de-DE\">\n <StatCardHeader>\n <StatCardLabel>Revenue, Hamburg</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue formatOptions={EUR} value={48210.5} />\n <StatCardDelta />\n </StatCardFigure>\n </StatCard>\n\n <StatCard goodWhen=\"down\">\n <StatCardHeader>\n <StatCardLabel>Average lead time</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue>\n 5.2<StatCardUnit>days</StatCardUnit>\n </StatCardValue>\n <StatCardDelta format=\"decimal\" value={-0.3} />\n </StatCardFigure>\n </StatCard>\n </Grid>\n );\n}\n",
|
|
607
|
+
"verdict": "example"
|
|
608
|
+
},
|
|
609
|
+
{
|
|
610
|
+
"id": "parts",
|
|
611
|
+
"title": "parts.tsx",
|
|
612
|
+
"note": null,
|
|
613
|
+
"language": "tsx",
|
|
614
|
+
"source": "import { Badge } from '@slotted/react/badge';\nimport { Link } from '@slotted/react/link';\nimport { Sparkline } from '@slotted/react/sparkline';\nimport {\n StatCard,\n StatCardAction,\n StatCardComparison,\n StatCardDelta,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardPeriod,\n StatCardStatus,\n StatCardTrend,\n StatCardUnit,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst FILL_RATE = [92.8, 93.4, 93.1, 94, 94.6, 95.2, 96.1];\n\nexport default function StatCardParts() {\n return (\n <StatCard delta={0.032}>\n <StatCardHeader>\n <StatCardLabel>Fill rate</StatCardLabel>\n <StatCardStatus>\n <Badge tone=\"success\" variant=\"soft\">\n Live\n </Badge>\n </StatCardStatus>\n <StatCardAction>\n <Link href=\"#fill-rate\">Details</Link>\n </StatCardAction>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue>\n 96.1<StatCardUnit>%</StatCardUnit>\n </StatCardValue>\n <StatCardDelta />\n <StatCardComparison>\n from 93.1% <StatCardPeriod>last week</StatCardPeriod>\n </StatCardComparison>\n </StatCardFigure>\n <StatCardTrend>\n <Sparkline data={FILL_RATE} label=\"Fill rate\" />\n </StatCardTrend>\n </StatCard>\n );\n}\n",
|
|
615
|
+
"verdict": "example"
|
|
616
|
+
},
|
|
617
|
+
{
|
|
618
|
+
"id": "tone",
|
|
619
|
+
"title": "tone.tsx",
|
|
620
|
+
"note": null,
|
|
621
|
+
"language": "tsx",
|
|
622
|
+
"source": "import { Grid } from '@slotted/react/grid';\nimport { Sparkline } from '@slotted/react/sparkline';\nimport {\n StatCard,\n StatCardDefaultsProvider,\n StatCardFigure,\n StatCardHeader,\n StatCardLabel,\n StatCardTrend,\n StatCardValue,\n} from '@slotted/react/stat-card';\n\nconst CARDS = [\n { tone: 'neutral', label: 'Backorders', value: '38', data: [41, 44, 40, 43, 39, 41, 38] },\n { tone: 'accent', label: 'Web orders', value: '612', data: [540, 566, 551, 580, 597, 604, 612] },\n {\n tone: 'secondary',\n label: 'Wholesale',\n value: '148',\n data: [132, 129, 140, 137, 144, 151, 148],\n },\n { tone: 'info', label: 'Marketplace', value: '395', data: [350, 362, 371, 366, 380, 388, 395] },\n { tone: 'success', label: 'Fill rate', value: '96.1%', data: [92.8, 93.4, 93.1, 94, 95.2, 96.1] },\n { tone: 'warning', label: 'Late pickups', value: '14', data: [6, 8, 7, 10, 12, 11, 14] },\n { tone: 'danger', label: 'Payment failures', value: '9', data: [2, 3, 2, 5, 4, 7, 9] },\n] as const;\n\nexport default function StatCardTone() {\n return (\n <StatCardDefaultsProvider layout=\"stacked\" size=\"sm\">\n <Grid gap={4} minItemWidth=\"xs\">\n {CARDS.map((card) => (\n <StatCard key={card.tone} tone={card.tone}>\n <StatCardHeader>\n <StatCardLabel>{card.label}</StatCardLabel>\n </StatCardHeader>\n <StatCardFigure>\n <StatCardValue value={card.value} />\n </StatCardFigure>\n <StatCardTrend>\n <Sparkline data={card.data} label={card.label} />\n </StatCardTrend>\n </StatCard>\n ))}\n </Grid>\n </StatCardDefaultsProvider>\n );\n}\n",
|
|
623
|
+
"verdict": "example"
|
|
576
624
|
}
|
|
577
625
|
]
|
|
578
626
|
}
|