@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
|
@@ -172,7 +172,7 @@
|
|
|
172
172
|
"part": "actions",
|
|
173
173
|
"element": "div",
|
|
174
174
|
"required": false,
|
|
175
|
-
"purpose": "The consumer’s own controls, from actions: an
|
|
175
|
+
"purpose": "The consumer’s own controls, from actions: an Import button that opens a dialog holding upload, an Export button that opens the format dialog."
|
|
176
176
|
},
|
|
177
177
|
{
|
|
178
178
|
"part": "views",
|
|
@@ -256,7 +256,7 @@
|
|
|
256
256
|
"part": "mark",
|
|
257
257
|
"element": "span, aria-hidden",
|
|
258
258
|
"required": false,
|
|
259
|
-
"purpose": "An Icon with the status glyph — clock, circle-check, circle-alert, circle-x, circle — or spinner while running, the line’s own size,
|
|
259
|
+
"purpose": "An Icon with the status glyph — clock, circle-check, circle-alert, circle-x, circle — or spinner while running, the line’s own size, centered on the band between the cap height and the x-height."
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
262
|
"part": "status-label",
|
|
@@ -316,13 +316,13 @@
|
|
|
316
316
|
"part": "retry",
|
|
317
317
|
"element": "span around a Button",
|
|
318
318
|
"required": false,
|
|
319
|
-
"purpose": "Asks onRetry:
|
|
319
|
+
"purpose": "Asks onRetry: Try again after a failure or a cancel, Generate again on an export whose result expired."
|
|
320
320
|
},
|
|
321
321
|
{
|
|
322
322
|
"part": "toggle",
|
|
323
323
|
"element": "span around a Button",
|
|
324
324
|
"required": false,
|
|
325
|
-
"purpose": "The Disclosure button:
|
|
325
|
+
"purpose": "The Disclosure button: Details in both states, aria-expanded and aria-controls the details. Present only when the job has a count, a file or a failed row."
|
|
326
326
|
},
|
|
327
327
|
{
|
|
328
328
|
"part": "chevron",
|
|
@@ -376,13 +376,13 @@
|
|
|
376
376
|
"part": "errors-note",
|
|
377
377
|
"element": "p",
|
|
378
378
|
"required": false,
|
|
379
|
-
"purpose": "
|
|
379
|
+
"purpose": "Showing 50 of 12,000 when errorCount is larger than the rows sent."
|
|
380
380
|
},
|
|
381
381
|
{
|
|
382
382
|
"part": "more",
|
|
383
383
|
"element": "button",
|
|
384
384
|
"required": false,
|
|
385
|
-
"purpose": "growing=\"button\" with hasMore: asks onLoadMore; says
|
|
385
|
+
"purpose": "growing=\"button\" with hasMore: asks onLoadMore; says Loading jobs and refuses a second press while loading."
|
|
386
386
|
},
|
|
387
387
|
{
|
|
388
388
|
"part": "empty",
|
|
@@ -567,12 +567,12 @@
|
|
|
567
567
|
{
|
|
568
568
|
"name": "onCancel",
|
|
569
569
|
"payload": "(key: string, request: { reason, source, cancelled, cancel() })",
|
|
570
|
-
"when": "When the reader presses
|
|
570
|
+
"when": "When the reader presses Cancel on a queued or running job — reasons pointer, keyboard. The store stops the job and answers by changing its status."
|
|
571
571
|
},
|
|
572
572
|
{
|
|
573
573
|
"name": "onRetry",
|
|
574
574
|
"payload": "(key: string, request)",
|
|
575
|
-
"when": "When the reader presses
|
|
575
|
+
"when": "When the reader presses Try again or Generate again — reasons pointer, keyboard."
|
|
576
576
|
},
|
|
577
577
|
{
|
|
578
578
|
"name": "onRemove",
|
|
@@ -713,7 +713,7 @@
|
|
|
713
713
|
"title": "Every part, written out",
|
|
714
714
|
"note": "The header with its count, clear and the consumer’s two actions; the strip; a running job with its bar; a partial import with its details open — counts, the original file, the report and the failed rows; growing by button; a footer. Every part the contract names, in one box.",
|
|
715
715
|
"language": "tsx",
|
|
716
|
-
"source": "<ImportExportCenter\n actions={<ImportActions />}\n defaultExpanded={['catalog-autumn']}\n footer={<Link href=\"/jobs\">
|
|
716
|
+
"source": "<ImportExportCenter\n actions={<ImportActions />}\n defaultExpanded={['catalog-autumn']}\n footer={<Link href=\"/jobs\">See all jobs</Link>}\n growing=\"button\"\n hasMore\n jobs={jobs}\n/>;\n",
|
|
717
717
|
"verdict": "excerpt"
|
|
718
718
|
},
|
|
719
719
|
{
|
|
@@ -721,45 +721,45 @@
|
|
|
721
721
|
"title": "Five statuses, four outcomes",
|
|
722
722
|
"note": "Queued, running, succeeded, succeeded with failed rows, failed and cancelled, each with its word, its mark and its tone. The partial row is derived: the store wrote succeeded and counts.failed 12, and the family refused to paint it green.",
|
|
723
723
|
"language": "tsx",
|
|
724
|
-
"source": "
|
|
725
|
-
"verdict": "
|
|
724
|
+
"source": "import { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\n\nconst NOW = 1790344800000;\n\nconst VIEWS = [{ value: 'all', label: 'All' }];\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'stock-september',\n direction: 'export',\n title: 'Stock movements, September',\n status: 'queued',\n format: 'XLSX',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T13:59:00Z',\n stage: 'Starts after the customer import',\n },\n {\n key: 'customers',\n direction: 'import',\n title: 'Customer contacts',\n status: 'running',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T13:58:00Z',\n source: {\n name: 'customers-2026-09-24.csv',\n size: 4200000,\n },\n stage: 'Writing records',\n progress: {\n value: 1204,\n max: 5000,\n },\n eta: '2026-09-25T14:03:00Z',\n },\n {\n key: 'suppliers',\n direction: 'import',\n title: 'Supplier list',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Rui Tavares',\n createdAt: '2026-09-25T10:40:00Z',\n finishedAt: '2026-09-25T10:42:00Z',\n counts: {\n total: 420,\n processed: 420,\n created: 36,\n updated: 384,\n },\n source: {\n name: 'suppliers-2026.xlsx',\n size: 96000,\n href: '#suppliers',\n },\n },\n {\n key: 'catalog-autumn',\n direction: 'import',\n title: 'Product catalog',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T10:50:00Z',\n finishedAt: '2026-09-25T11:00:00Z',\n counts: {\n total: 3000,\n processed: 2988,\n created: 2210,\n updated: 778,\n failed: 12,\n },\n errorCount: 12,\n errors: [\n {\n row: 14,\n column: 'SKU',\n value: '',\n message: 'Required field is empty',\n },\n {\n row: 208,\n column: 'Price',\n value: '12.5O',\n message: 'Not a number',\n },\n {\n row: 391,\n column: 'HS code',\n value: '8471.3',\n message: 'Code with 8 digits expected',\n },\n ],\n source: {\n name: 'catalog-autumn-2026.xlsx',\n size: 1800000,\n href: '#catalog',\n },\n errorsFile: {\n name: 'catalog-autumn-2026-errors.csv',\n size: 2048,\n href: '#catalog-errors',\n },\n },\n {\n key: 'statement',\n direction: 'export',\n title: 'Overdue customer statement',\n status: 'failed',\n format: 'PDF',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T07:40:00Z',\n finishedAt: '2026-09-25T07:50:00Z',\n message: 'The reporting service did not respond within 10 minutes.',\n },\n {\n key: 'freight',\n direction: 'import',\n title: 'Freight table',\n status: 'canceled',\n format: 'JSON',\n actor: 'Rui Tavares',\n createdAt: '2026-09-24T17:30:00Z',\n finishedAt: '2026-09-24T17:31:00Z',\n stage: 'No records written',\n },\n];\n\nexport default function ImportExportCenterStatusesExample() {\n return <ImportExportCenter jobs={JOBS} now={NOW} timeZone=\"UTC\" views={VIEWS} />;\n}\n",
|
|
725
|
+
"verdict": "example"
|
|
726
726
|
},
|
|
727
727
|
{
|
|
728
728
|
"id": "progress",
|
|
729
729
|
"title": "Progress, in the job’s unit",
|
|
730
730
|
"note": "Rows with a percentage and the server’s eta; bytes in the size scale; a bare percentage; an indeterminate bar that says only its stage; and a job whose time left the family estimates from the updates it saw. The bar is progress-indicator at its small step and says nothing aloud.",
|
|
731
731
|
"language": "tsx",
|
|
732
|
-
"source": "
|
|
733
|
-
"verdict": "
|
|
732
|
+
"source": "import { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\n\nconst NOW = 1790344800000;\n\nconst VIEWS = [{ value: 'all', label: 'All' }];\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'customers',\n direction: 'import',\n title: 'Customer contacts',\n status: 'running',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T13:58:00Z',\n source: {\n name: 'customers-2026-09-24.csv',\n size: 4200000,\n },\n stage: 'Writing records',\n progress: {\n value: 1204,\n max: 5000,\n },\n eta: '2026-09-25T14:03:00Z',\n },\n {\n direction: 'export',\n status: 'running',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T13:50:00Z',\n key: 'warehouse-scans',\n title: 'Warehouse scans',\n format: 'CSV',\n progress: {\n unit: 'bytes',\n value: 2500000,\n max: 10000000,\n },\n },\n {\n direction: 'import',\n status: 'running',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T13:50:00Z',\n key: 'price-list',\n title: 'Price list',\n format: 'XLSX',\n progress: {\n unit: 'percent',\n value: 62,\n max: 100,\n },\n },\n {\n direction: 'import',\n status: 'running',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T13:50:00Z',\n key: 'carrier-rates',\n title: 'Carrier rates',\n format: 'JSON',\n progress: {},\n stage: 'Preparing the file',\n },\n];\n\nexport default function ImportExportCenterProgressExample() {\n return <ImportExportCenter jobs={JOBS} now={NOW} timeZone=\"UTC\" views={VIEWS} />;\n}\n",
|
|
733
|
+
"verdict": "example"
|
|
734
734
|
},
|
|
735
735
|
{
|
|
736
736
|
"id": "errors",
|
|
737
737
|
"title": "Rows that failed",
|
|
738
|
-
"note": "A partial import with its details open: the counts, the report download as the job’s primary control, and a table of the rows the store sent — the message second, so it stays in view when the table scrolls sideways — with
|
|
738
|
+
"note": "A partial import with its details open: the counts, the report download as the job’s primary control, and a table of the rows the store sent — the message second, so it stays in view when the table scrolls sideways — with Showing 5 of 1,284 because the store sent a sample.",
|
|
739
739
|
"language": "tsx",
|
|
740
|
-
"source": "
|
|
741
|
-
"verdict": "
|
|
740
|
+
"source": "import { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\n\nconst NOW = 1790344800000;\n\nconst EXPANDED = ['catalog-autumn'];\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'catalog-autumn',\n direction: 'import',\n title: 'Product catalog',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T10:50:00Z',\n finishedAt: '2026-09-25T11:00:00Z',\n counts: {\n total: 15000,\n processed: 13716,\n created: 9200,\n updated: 4516,\n failed: 1284,\n },\n errorCount: 1284,\n errors: [\n {\n row: 14,\n column: 'SKU',\n value: '',\n message: 'Required field is empty',\n },\n {\n row: 208,\n column: 'Price',\n value: '12.5O',\n message: 'Not a number',\n },\n {\n row: 391,\n column: 'HS code',\n value: '8471.3',\n message: 'Code with 8 digits expected',\n },\n {\n row: 1027,\n column: 'Category',\n value: 'Hardware',\n message: 'Category does not exist',\n },\n {\n row: 2640,\n column: 'SKU',\n value: 'VN-00431',\n message: 'Duplicate SKU on row 2588',\n },\n ],\n source: {\n name: 'catalog-autumn-2026.xlsx',\n size: 1800000,\n href: '#catalog',\n },\n errorsFile: {\n name: 'catalog-autumn-2026-errors.csv',\n size: 2048,\n href: '#catalog-errors',\n },\n },\n];\n\nexport default function ImportExportCenterErrorsExample() {\n return <ImportExportCenter defaultExpanded={EXPANDED} jobs={JOBS} now={NOW} timeZone=\"UTC\" />;\n}\n",
|
|
741
|
+
"verdict": "example"
|
|
742
742
|
},
|
|
743
743
|
{
|
|
744
744
|
"id": "files",
|
|
745
745
|
"title": "Deadlines and permission",
|
|
746
746
|
"note": "An export whose file expired offers Generate again in place of Download and says when it expired; an export still available says until when; an import whose original the reader may not download says why in the consumer’s words, and draws no control for it.",
|
|
747
747
|
"language": "tsx",
|
|
748
|
-
"source": "
|
|
749
|
-
"verdict": "
|
|
748
|
+
"source": "import { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\n\nconst NOW = 1790344800000;\n\nconst VIEWS = [{ value: 'all', label: 'All' }];\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'invoices-september',\n direction: 'export',\n title: 'Tax invoices, September',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T09:38:00Z',\n finishedAt: '2026-09-25T09:40:00Z',\n result: {\n name: 'tax-invoices-september.zip',\n size: 312000000,\n href: '#tax-september',\n expiresAt: '2026-10-02T10:00:00Z',\n },\n },\n {\n key: 'invoices-august',\n direction: 'export',\n title: 'Tax invoices, August',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-01T10:00:00Z',\n finishedAt: '2026-09-01T10:04:00Z',\n result: {\n name: 'tax-invoices-august.zip',\n size: 298000000,\n href: '#tax-august',\n expiresAt: '2026-09-08T10:00:00Z',\n },\n },\n {\n key: 'wholesale-prices',\n direction: 'import',\n title: 'Wholesale price list',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Rui Tavares',\n createdAt: '2026-09-25T10:40:00Z',\n finishedAt: '2026-09-25T10:42:00Z',\n counts: {\n total: 420,\n processed: 420,\n created: 36,\n updated: 384,\n },\n source: {\n name: 'wholesale-prices.csv',\n size: 96000,\n denied:\n 'Only the person who imported the file or an administrator can download the original.',\n },\n },\n];\n\nexport default function ImportExportCenterFilesExample() {\n return <ImportExportCenter jobs={JOBS} now={NOW} timeZone=\"UTC\" views={VIEWS} />;\n}\n",
|
|
749
|
+
"verdict": "example"
|
|
750
750
|
},
|
|
751
751
|
{
|
|
752
752
|
"id": "views",
|
|
753
753
|
"title": "Views",
|
|
754
754
|
"note": "The built-in All, Imports and Exports, filtered by direction; below, the consumer’s own views — Mine is the consumer’s query, so the family shows the jobs it is given — held in the consumer’s state, which refuses Archived with request.cancel().",
|
|
755
755
|
"language": "tsx",
|
|
756
|
-
"source": "<ImportExportCenter\n
|
|
757
|
-
"verdict": "
|
|
756
|
+
"source": "import { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\nimport { useState } from 'react';\n\nconst NOW = 1790344800000;\n\nconst VIEWS = [\n {\n value: 'all',\n label: 'All',\n },\n {\n value: 'mine',\n label: 'Mine',\n },\n {\n value: 'archived',\n label: 'Archived',\n },\n];\n\nconst ALL: ImportExportJob[] = [\n {\n key: 'suppliers',\n direction: 'import',\n title: 'Supplier list',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Rui Tavares',\n createdAt: '2026-09-25T10:40:00Z',\n finishedAt: '2026-09-25T10:42:00Z',\n counts: {\n total: 420,\n processed: 420,\n created: 36,\n updated: 384,\n },\n source: {\n name: 'suppliers-2026.xlsx',\n size: 96000,\n href: '#suppliers',\n },\n },\n {\n key: 'catalog-autumn',\n direction: 'import',\n title: 'Product catalog',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T10:50:00Z',\n finishedAt: '2026-09-25T11:00:00Z',\n counts: {\n total: 3000,\n processed: 2988,\n created: 2210,\n updated: 778,\n failed: 12,\n },\n errorCount: 12,\n errors: [\n {\n row: 14,\n column: 'SKU',\n value: '',\n message: 'Required field is empty',\n },\n {\n row: 208,\n column: 'Price',\n value: '12.5O',\n message: 'Not a number',\n },\n {\n row: 391,\n column: 'HS code',\n value: '8471.3',\n message: 'Code with 8 digits expected',\n },\n ],\n source: {\n name: 'catalog-autumn-2026.xlsx',\n size: 1800000,\n href: '#catalog',\n },\n errorsFile: {\n name: 'catalog-autumn-2026-errors.csv',\n size: 2048,\n href: '#catalog-errors',\n },\n },\n {\n key: 'invoices-q3',\n direction: 'export',\n title: 'Q3 invoices',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T09:38:00Z',\n finishedAt: '2026-09-25T09:40:00Z',\n result: {\n name: 'invoices-q3-2026.csv',\n size: 640000,\n href: '#invoices-q3',\n expiresAt: '2026-10-02T09:40:00Z',\n },\n },\n {\n key: 'freight',\n direction: 'import',\n title: 'Freight table',\n status: 'canceled',\n format: 'JSON',\n actor: 'Rui Tavares',\n createdAt: '2026-09-24T17:30:00Z',\n finishedAt: '2026-09-24T17:31:00Z',\n stage: 'No records written',\n },\n];\n\nconst MINE = ALL.filter((job) => job.actor === 'Marina Duarte');\n\nexport default function ImportExportCenterViewsExample() {\n const [view, setView] = useState('all');\n\n return (\n <ImportExportCenter\n jobs={view === 'mine' ? MINE : ALL}\n now={NOW}\n onViewChange={(next, request) => {\n if (next === 'archived') request.cancel();\n else setView(next);\n }}\n timeZone=\"UTC\"\n view={view}\n views={VIEWS}\n />\n );\n}\n",
|
|
757
|
+
"verdict": "example"
|
|
758
758
|
},
|
|
759
759
|
{
|
|
760
760
|
"id": "intake",
|
|
761
761
|
"title": "Starting a job",
|
|
762
|
-
"note": "
|
|
762
|
+
"note": "Import opens a dialog with upload as its dropzone; its adapter sends the bytes and the store creates the job, which appears at the top of the list. Export opens a dialog with the format and the file name. The center starts nothing itself and never transfers a byte.",
|
|
763
763
|
"language": "tsx",
|
|
764
764
|
"source": "<ImportExportCenter\n actions={\n <>\n <ImportDialog onUploaded={(file) => store.createImport(file)} />\n <ExportDialog onConfirm={(format) => store.createExport(format)} />\n </>\n }\n jobs={store.jobs}\n/>;\n",
|
|
765
765
|
"verdict": "excerpt"
|
|
@@ -783,7 +783,7 @@
|
|
|
783
783
|
{
|
|
784
784
|
"id": "loading",
|
|
785
785
|
"title": "The first wait, and the next page",
|
|
786
|
-
"note": "Three skeleton jobs with the anatomy of a job — the tile, the name, the meta line — stand in the boxes the jobs will occupy while the list is busy; with jobs already shown, more says
|
|
786
|
+
"note": "Three skeleton jobs with the anatomy of a job — the tile, the name, the meta line — stand in the boxes the jobs will occupy while the list is busy; with jobs already shown, more says Loading jobs and refuses a second press.",
|
|
787
787
|
"language": "tsx",
|
|
788
788
|
"source": "<ImportExportCenter jobs={[]} loading />;\n<ImportExportCenter growing=\"button\" hasMore jobs={jobs} loading />;\n",
|
|
789
789
|
"verdict": "excerpt"
|
|
@@ -801,15 +801,15 @@
|
|
|
801
801
|
"title": "Two sizes",
|
|
802
802
|
"note": "sm for the popover and the drawer: the small type steps, tighter insets, a floor width so a panel sized to its content does not collapse; md for the page. The controls keep the button family’s small step in both.",
|
|
803
803
|
"language": "tsx",
|
|
804
|
-
"source": "<ImportExportCenter jobs={
|
|
805
|
-
"verdict": "
|
|
804
|
+
"source": "import { Stack } from '@slotted/react/stack';\nimport { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\n\nconst NOW = 1790344800000;\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'suppliers',\n direction: 'import',\n title: 'Supplier list',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Rui Tavares',\n createdAt: '2026-09-25T10:40:00Z',\n finishedAt: '2026-09-25T10:42:00Z',\n counts: {\n total: 420,\n processed: 420,\n created: 36,\n updated: 384,\n },\n source: {\n name: 'suppliers-2026.xlsx',\n size: 96000,\n href: '#suppliers',\n },\n },\n {\n key: 'catalog-autumn',\n direction: 'import',\n title: 'Product catalog',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T10:50:00Z',\n finishedAt: '2026-09-25T11:00:00Z',\n counts: {\n total: 3000,\n processed: 2988,\n created: 2210,\n updated: 778,\n failed: 12,\n },\n errorCount: 12,\n errors: [\n {\n row: 14,\n column: 'SKU',\n value: '',\n message: 'Required field is empty',\n },\n {\n row: 208,\n column: 'Price',\n value: '12.5O',\n message: 'Not a number',\n },\n {\n row: 391,\n column: 'HS code',\n value: '8471.3',\n message: 'Code with 8 digits expected',\n },\n ],\n source: {\n name: 'catalog-autumn-2026.xlsx',\n size: 1800000,\n href: '#catalog',\n },\n errorsFile: {\n name: 'catalog-autumn-2026-errors.csv',\n size: 2048,\n href: '#catalog-errors',\n },\n },\n];\n\nexport default function ImportExportCenterSizesExample() {\n return (\n <Stack gap={6}>\n <ImportExportCenter jobs={JOBS} now={NOW} size=\"sm\" timeZone=\"UTC\" />\n\n <ImportExportCenter jobs={JOBS} now={NOW} size=\"md\" timeZone=\"UTC\" />\n </Stack>\n );\n}\n",
|
|
805
|
+
"verdict": "example"
|
|
806
806
|
},
|
|
807
807
|
{
|
|
808
808
|
"id": "content",
|
|
809
809
|
"title": "Content the family did not choose",
|
|
810
810
|
"note": "A title of fourteen words, a file name of ninety characters that keeps its extension, an Arabic report in a left-to-right page, a stage longer than the line, a million rows, and a job with the consumer’s own action.",
|
|
811
811
|
"language": "tsx",
|
|
812
|
-
"source": "<ImportExportCenter\n jobs={jobs}\n renderJobActions={(job) =>\n job.direction === 'export' ? <Link href={shareUrl(job)}>
|
|
812
|
+
"source": "<ImportExportCenter\n jobs={jobs}\n renderJobActions={(job) =>\n job.direction === 'export' ? <Link href={shareUrl(job)}>Share</Link> : null\n }\n/>;\n",
|
|
813
813
|
"verdict": "excerpt"
|
|
814
814
|
},
|
|
815
815
|
{
|
|
@@ -817,8 +817,8 @@
|
|
|
817
817
|
"title": "Defaults, once",
|
|
818
818
|
"note": "ImportExportCenterDefaultsProvider sets the size, the rank, the time format and the zone for a whole application — here with absolute times; the second center states size=\"md\" itself and wins. The words and the locale come from SlottedProvider.",
|
|
819
819
|
"language": "tsx",
|
|
820
|
-
"source": "<ImportExportCenterDefaultsProvider level=\"3\" size=\"sm\" timeFormat=\"absolute\">\n
|
|
821
|
-
"verdict": "
|
|
820
|
+
"source": "import {\n ImportExportCenter,\n ImportExportCenterDefaultsProvider,\n} from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\nimport { Stack } from '@slotted/react/stack';\n\nconst NOW = 1790344800000;\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'catalog-autumn',\n direction: 'import',\n title: 'Product catalog',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T10:50:00Z',\n finishedAt: '2026-09-25T11:00:00Z',\n counts: {\n total: 3000,\n processed: 2988,\n created: 2210,\n updated: 778,\n failed: 12,\n },\n errorCount: 12,\n errors: [\n {\n row: 14,\n column: 'SKU',\n value: '',\n message: 'Required field is empty',\n },\n {\n row: 208,\n column: 'Price',\n value: '12.5O',\n message: 'Not a number',\n },\n {\n row: 391,\n column: 'HS code',\n value: '8471.3',\n message: 'Code with 8 digits expected',\n },\n ],\n source: {\n name: 'catalog-autumn-2026.xlsx',\n size: 1800000,\n href: '#catalog',\n },\n errorsFile: {\n name: 'catalog-autumn-2026-errors.csv',\n size: 2048,\n href: '#catalog-errors',\n },\n },\n {\n key: 'invoices-q3',\n direction: 'export',\n title: 'Q3 invoices',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T09:38:00Z',\n finishedAt: '2026-09-25T09:40:00Z',\n result: {\n name: 'invoices-q3-2026.csv',\n size: 640000,\n href: '#invoices-q3',\n expiresAt: '2026-10-02T09:40:00Z',\n },\n },\n];\n\nexport default function ImportExportCenterDefaultsExample() {\n return (\n <ImportExportCenterDefaultsProvider level=\"3\" size=\"sm\" timeFormat=\"absolute\" timeZone=\"UTC\">\n <Stack gap={6}>\n <ImportExportCenter jobs={JOBS} now={NOW} />\n\n <ImportExportCenter jobs={JOBS} now={NOW} size=\"md\" />\n </Stack>\n </ImportExportCenterDefaultsProvider>\n );\n}\n",
|
|
821
|
+
"verdict": "example"
|
|
822
822
|
},
|
|
823
823
|
{
|
|
824
824
|
"id": "accessibility",
|
|
@@ -827,6 +827,46 @@
|
|
|
827
827
|
"language": "tsx",
|
|
828
828
|
"source": "<ImportExportCenter\n jobs={jobs}\n onCancel={(key) => cancel(key)}\n onRemove={({ keys }) => remove(keys)}\n/>;\n",
|
|
829
829
|
"verdict": "excerpt"
|
|
830
|
+
},
|
|
831
|
+
{
|
|
832
|
+
"id": "actions",
|
|
833
|
+
"title": "actions.tsx",
|
|
834
|
+
"note": null,
|
|
835
|
+
"language": "tsx",
|
|
836
|
+
"source": "import { Button } from '@slotted/react/button';\nimport { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\nimport { Link } from '@slotted/react/link';\nimport { useState } from 'react';\n\nconst NOW = 1790344800000;\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'suppliers',\n direction: 'import',\n title: 'Supplier list',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Rui Tavares',\n createdAt: '2026-09-25T10:40:00Z',\n finishedAt: '2026-09-25T10:42:00Z',\n counts: {\n total: 420,\n processed: 420,\n created: 36,\n updated: 384,\n },\n source: {\n name: 'suppliers-2026.xlsx',\n size: 96000,\n href: '#suppliers',\n },\n },\n {\n key: 'invoices-q3',\n direction: 'export',\n title: 'Q3 invoices',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T09:38:00Z',\n finishedAt: '2026-09-25T09:40:00Z',\n result: {\n name: 'invoices-q3-2026.csv',\n size: 640000,\n href: '#invoices-q3',\n expiresAt: '2026-10-02T09:40:00Z',\n },\n },\n];\n\nexport default function ImportExportCenterActionsExample() {\n const [jobs, setJobs] = useState(JOBS);\n\n function handleImport() {\n setJobs((current) => [\n {\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T14:00:00Z',\n direction: 'import',\n format: 'CSV',\n key: 'import-' + String(current.length),\n stage: 'Waiting for a worker',\n status: 'queued',\n title: 'Price list import',\n },\n ...current,\n ]);\n }\n\n function handleExport() {\n setJobs((current) => [\n {\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T14:00:00Z',\n direction: 'export',\n format: 'CSV',\n key: 'export-' + String(current.length),\n stage: 'Waiting for a worker',\n status: 'queued',\n title: 'Stock export',\n },\n ...current,\n ]);\n }\n\n return (\n <ImportExportCenter\n actions={\n <>\n <Button onClick={handleImport} size=\"sm\">\n Import file\n </Button>\n\n <Button onClick={handleExport} size=\"sm\">\n Export data\n </Button>\n </>\n }\n footer={<Link href=\"#all-jobs\">See all jobs</Link>}\n jobs={jobs}\n now={NOW}\n renderJobActions={() => <Link href=\"#share\">Share</Link>}\n timeZone=\"UTC\"\n />\n );\n}\n",
|
|
837
|
+
"verdict": "example"
|
|
838
|
+
},
|
|
839
|
+
{
|
|
840
|
+
"id": "basic",
|
|
841
|
+
"title": "basic.tsx",
|
|
842
|
+
"note": null,
|
|
843
|
+
"language": "tsx",
|
|
844
|
+
"source": "import { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\n\nconst NOW = 1790344800000;\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'stock-september',\n direction: 'export',\n title: 'Stock movements, September',\n status: 'queued',\n format: 'XLSX',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T13:59:00Z',\n stage: 'Starts after the customer import',\n },\n {\n key: 'suppliers',\n direction: 'import',\n title: 'Supplier list',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Rui Tavares',\n createdAt: '2026-09-25T10:40:00Z',\n finishedAt: '2026-09-25T10:42:00Z',\n counts: {\n total: 420,\n processed: 420,\n created: 36,\n updated: 384,\n },\n source: {\n name: 'suppliers-2026.xlsx',\n size: 96000,\n href: '#suppliers',\n },\n },\n {\n key: 'catalog-autumn',\n direction: 'import',\n title: 'Product catalog',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T10:50:00Z',\n finishedAt: '2026-09-25T11:00:00Z',\n counts: {\n total: 3000,\n processed: 2988,\n created: 2210,\n updated: 778,\n failed: 12,\n },\n errorCount: 12,\n errors: [\n {\n row: 14,\n column: 'SKU',\n value: '',\n message: 'Required field is empty',\n },\n {\n row: 208,\n column: 'Price',\n value: '12.5O',\n message: 'Not a number',\n },\n {\n row: 391,\n column: 'HS code',\n value: '8471.3',\n message: 'Code with 8 digits expected',\n },\n ],\n source: {\n name: 'catalog-autumn-2026.xlsx',\n size: 1800000,\n href: '#catalog',\n },\n errorsFile: {\n name: 'catalog-autumn-2026-errors.csv',\n size: 2048,\n href: '#catalog-errors',\n },\n },\n {\n key: 'invoices-q3',\n direction: 'export',\n title: 'Q3 invoices',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T09:38:00Z',\n finishedAt: '2026-09-25T09:40:00Z',\n result: {\n name: 'invoices-q3-2026.csv',\n size: 640000,\n href: '#invoices-q3',\n expiresAt: '2026-10-02T09:40:00Z',\n },\n },\n {\n key: 'statement',\n direction: 'export',\n title: 'Overdue customer statement',\n status: 'failed',\n format: 'PDF',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T07:40:00Z',\n finishedAt: '2026-09-25T07:50:00Z',\n message: 'The reporting service did not respond within 10 minutes.',\n },\n];\n\nexport default function ImportExportCenterBasicExample() {\n return <ImportExportCenter jobs={JOBS} now={NOW} timeZone=\"UTC\" />;\n}\n",
|
|
845
|
+
"verdict": "example"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
"id": "growing",
|
|
849
|
+
"title": "growing.tsx",
|
|
850
|
+
"note": null,
|
|
851
|
+
"language": "tsx",
|
|
852
|
+
"source": "import { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\nimport { useState } from 'react';\n\nconst NOW = 1790344800000;\n\nconst FIRST: ImportExportJob[] = [\n {\n key: 'suppliers',\n direction: 'import',\n title: 'Supplier list',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Rui Tavares',\n createdAt: '2026-09-25T10:40:00Z',\n finishedAt: '2026-09-25T10:42:00Z',\n counts: {\n total: 420,\n processed: 420,\n created: 36,\n updated: 384,\n },\n source: {\n name: 'suppliers-2026.xlsx',\n size: 96000,\n href: '#suppliers',\n },\n },\n {\n key: 'invoices-q3',\n direction: 'export',\n title: 'Q3 invoices',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T09:38:00Z',\n finishedAt: '2026-09-25T09:40:00Z',\n result: {\n name: 'invoices-q3-2026.csv',\n size: 640000,\n href: '#invoices-q3',\n expiresAt: '2026-10-02T09:40:00Z',\n },\n },\n {\n key: 'statement',\n direction: 'export',\n title: 'Overdue customer statement',\n status: 'failed',\n format: 'PDF',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T07:40:00Z',\n finishedAt: '2026-09-25T07:50:00Z',\n message: 'The reporting service did not respond within 10 minutes.',\n },\n];\n\nconst NEXT: ImportExportJob[] = [\n {\n key: 'freight',\n direction: 'import',\n title: 'Freight table',\n status: 'canceled',\n format: 'JSON',\n actor: 'Rui Tavares',\n createdAt: '2026-09-24T17:30:00Z',\n finishedAt: '2026-09-24T17:31:00Z',\n stage: 'No records written',\n },\n {\n key: 'returns',\n direction: 'export',\n title: 'Returns by carrier',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-24T15:10:00Z',\n finishedAt: '2026-09-24T15:11:00Z',\n result: {\n name: 'returns-by-carrier.csv',\n size: 212000,\n href: '#returns',\n expiresAt: '2026-10-01T15:11:00Z',\n },\n },\n];\n\nexport default function ImportExportCenterGrowingExample() {\n const [jobs, setJobs] = useState(FIRST);\n const [loading, setLoading] = useState(false);\n const [hasMore, setHasMore] = useState(true);\n\n function handleLoadMore() {\n setLoading(true);\n setTimeout(() => {\n setJobs((current) => [...current, ...NEXT]);\n setHasMore(false);\n setLoading(false);\n }, 1200);\n }\n\n return (\n <ImportExportCenter\n growing=\"button\"\n hasMore={hasMore}\n jobs={jobs}\n loading={loading}\n now={NOW}\n onLoadMore={handleLoadMore}\n timeZone=\"UTC\"\n />\n );\n}\n",
|
|
853
|
+
"verdict": "example"
|
|
854
|
+
},
|
|
855
|
+
{
|
|
856
|
+
"id": "requests",
|
|
857
|
+
"title": "requests.tsx",
|
|
858
|
+
"note": null,
|
|
859
|
+
"language": "tsx",
|
|
860
|
+
"source": "import { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\nimport { useState } from 'react';\n\nconst NOW = 1790344800000;\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'stock-september',\n direction: 'export',\n title: 'Stock movements, September',\n status: 'queued',\n format: 'XLSX',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T13:59:00Z',\n stage: 'Starts after the customer import',\n },\n {\n key: 'statement',\n direction: 'export',\n title: 'Overdue customer statement',\n status: 'failed',\n format: 'PDF',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T07:40:00Z',\n finishedAt: '2026-09-25T07:50:00Z',\n message: 'The reporting service did not respond within 10 minutes.',\n },\n {\n key: 'suppliers',\n direction: 'import',\n title: 'Supplier list',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Rui Tavares',\n createdAt: '2026-09-25T10:40:00Z',\n finishedAt: '2026-09-25T10:42:00Z',\n counts: {\n total: 420,\n processed: 420,\n created: 36,\n updated: 384,\n },\n source: {\n name: 'suppliers-2026.xlsx',\n size: 96000,\n href: '#suppliers',\n },\n },\n {\n key: 'freight',\n direction: 'import',\n title: 'Freight table',\n status: 'canceled',\n format: 'JSON',\n actor: 'Rui Tavares',\n createdAt: '2026-09-24T17:30:00Z',\n finishedAt: '2026-09-24T17:31:00Z',\n stage: 'No records written',\n },\n];\n\nexport default function ImportExportCenterRequestsExample() {\n const [jobs, setJobs] = useState(JOBS);\n\n function handleCancel(key: string) {\n setJobs((current) =>\n patchJob(current, key, {\n finishedAt: '2026-09-25T14:00:00Z',\n progress: undefined,\n stage: 'Stopped by Marina Duarte',\n status: 'canceled',\n }),\n );\n }\n\n function handleRetry(key: string) {\n setJobs((current) =>\n patchJob(current, key, {\n finishedAt: undefined,\n message: undefined,\n stage: 'Waiting for a worker',\n status: 'queued',\n }),\n );\n }\n\n function handleRemove(keys: readonly string[]) {\n setJobs((current) => current.filter((job) => !keys.includes(job.key)));\n }\n\n return (\n <ImportExportCenter\n jobs={jobs}\n now={NOW}\n onCancel={handleCancel}\n onRemove={({ keys }) => {\n handleRemove(keys);\n }}\n onRetry={handleRetry}\n timeZone=\"UTC\"\n />\n );\n}\n\nfunction patchJob(jobs: ImportExportJob[], key: string, patch: Partial<ImportExportJob>) {\n return jobs.map((job) => (job.key === key ? { ...job, ...patch } : job));\n}\n",
|
|
861
|
+
"verdict": "example"
|
|
862
|
+
},
|
|
863
|
+
{
|
|
864
|
+
"id": "states",
|
|
865
|
+
"title": "states.tsx",
|
|
866
|
+
"note": null,
|
|
867
|
+
"language": "tsx",
|
|
868
|
+
"source": "import { Stack } from '@slotted/react/stack';\nimport { ImportExportCenter } from '@slotted/react/import-export-center';\nimport type { ImportExportJob } from '@slotted/react/import-export-center';\nimport { useState } from 'react';\n\nconst NOW = 1790344800000;\n\nconst JOBS: ImportExportJob[] = [\n {\n key: 'suppliers',\n direction: 'import',\n title: 'Supplier list',\n status: 'succeeded',\n format: 'XLSX',\n actor: 'Rui Tavares',\n createdAt: '2026-09-25T10:40:00Z',\n finishedAt: '2026-09-25T10:42:00Z',\n counts: {\n total: 420,\n processed: 420,\n created: 36,\n updated: 384,\n },\n source: {\n name: 'suppliers-2026.xlsx',\n size: 96000,\n href: '#suppliers',\n },\n },\n {\n key: 'invoices-q3',\n direction: 'export',\n title: 'Q3 invoices',\n status: 'succeeded',\n format: 'CSV',\n actor: 'Marina Duarte',\n createdAt: '2026-09-25T09:38:00Z',\n finishedAt: '2026-09-25T09:40:00Z',\n result: {\n name: 'invoices-q3-2026.csv',\n size: 640000,\n href: '#invoices-q3',\n expiresAt: '2026-10-02T09:40:00Z',\n },\n },\n];\n\nexport default function ImportExportCenterStatesExample() {\n const [failed, setFailed] = useState(true);\n\n return (\n <Stack gap={6}>\n <ImportExportCenter jobs={[]} loading now={NOW} timeZone=\"UTC\" />\n\n <ImportExportCenter defaultView=\"export\" jobs={[]} now={NOW} timeZone=\"UTC\" />\n\n <ImportExportCenter\n jobs={failed ? [] : JOBS}\n now={NOW}\n onReload={() => {\n setFailed(false);\n }}\n status={failed ? 'error' : 'ready'}\n timeZone=\"UTC\"\n />\n </Stack>\n );\n}\n",
|
|
869
|
+
"verdict": "example"
|
|
830
870
|
}
|
|
831
871
|
]
|
|
832
872
|
}
|