@slotted/react 0.1.0-beta.39 → 0.1.0-beta.40
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/alert-CV8wKS-N.js +179 -0
- package/dist/alert.js +1 -1
- package/dist/{avatar-DLWElrgg.js → avatar-fHRva5zn.js} +1 -1
- package/dist/{avatar-group-DshHqe8B.js → avatar-group-bJaZE1_C.js} +1 -1
- package/dist/avatar-group.js +1 -1
- package/dist/avatar.js +1 -1
- package/dist/calendar-D3QZDlm0.js +598 -0
- package/dist/calendar.js +1 -1
- package/dist/clock-DzkQa57Q.js +290 -0
- package/dist/clock.js +2 -0
- package/dist/{dashboard-grid-B6jxBz4j.js → dashboard-grid-DAY_CjCW.js} +1 -1
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-Cx0ZOf_e.js → data-grid-B7UuUvBH.js} +42 -37
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-Cb2sNA6I.js → data-list-CyEq7M2D.js} +1 -1
- package/dist/data-list.js +1 -1
- package/dist/date-picker-DMcMFW_N.js +344 -0
- package/dist/date-picker.js +3 -2
- package/dist/date-range-picker-D9zo93NE.js +543 -0
- package/dist/date-range-picker.js +2 -2
- package/dist/datetime-picker-lOXZbAx_.js +462 -0
- package/dist/datetime-picker.js +2 -2
- package/dist/datetime-range-picker-DU5ctZbm.js +641 -0
- package/dist/datetime-range-picker.js +2 -2
- package/dist/divider-DUUPCIh4.js +35 -0
- package/dist/divider.js +1 -1
- package/dist/docs/alert.examples.md +500 -0
- package/dist/docs/alert.json +85 -37
- package/dist/docs/alert.md +37 -189
- package/dist/docs/aspect-ratio.json +40 -16
- package/dist/docs/aspect-ratio.md +204 -29
- package/dist/docs/avatar.json +125 -29
- package/dist/docs/avatar.md +374 -31
- package/dist/docs/badge.json +119 -23
- package/dist/docs/badge.md +436 -27
- package/dist/docs/calendar.json +53 -5
- package/dist/docs/calendar.md +7 -2
- package/dist/docs/card.json +98 -10
- package/dist/docs/card.md +468 -26
- package/dist/docs/clock.json +405 -0
- package/dist/docs/clock.md +189 -0
- package/dist/docs/container.json +54 -6
- package/dist/docs/container.md +247 -17
- package/dist/docs/date-picker.examples.md +143 -169
- package/dist/docs/date-picker.json +178 -223
- package/dist/docs/date-picker.md +44 -50
- package/dist/docs/date-range-picker.examples.md +169 -187
- package/dist/docs/date-range-picker.json +206 -337
- package/dist/docs/date-range-picker.md +52 -67
- package/dist/docs/datetime-picker.examples.md +75 -210
- package/dist/docs/datetime-picker.json +183 -410
- package/dist/docs/datetime-picker.md +50 -72
- package/dist/docs/datetime-range-picker.json +225 -502
- package/dist/docs/datetime-range-picker.md +250 -101
- package/dist/docs/divider.json +71 -7
- package/dist/docs/divider.md +281 -13
- package/dist/docs/grid.json +76 -12
- package/dist/docs/grid.md +376 -18
- package/dist/docs/index.md +1 -0
- package/dist/docs/inline-message.json +87 -40
- package/dist/docs/inline-message.md +314 -71
- package/dist/docs/inline.json +65 -9
- package/dist/docs/inline.md +276 -13
- package/dist/docs/kbd.json +76 -36
- package/dist/docs/kbd.md +346 -63
- package/dist/docs/link.json +65 -25
- package/dist/docs/link.md +317 -60
- package/dist/docs/progress-indicator.examples.md +522 -0
- package/dist/docs/progress-indicator.json +51 -27
- package/dist/docs/progress-indicator.md +13 -238
- package/dist/docs/result-state.examples.md +752 -0
- package/dist/docs/result-state.json +95 -47
- package/dist/docs/result-state.md +45 -228
- package/dist/docs/skeleton.json +70 -38
- package/dist/docs/skeleton.md +393 -71
- package/dist/docs/stack.json +57 -9
- package/dist/docs/stack.md +225 -12
- package/dist/docs/table.examples.md +6 -10
- package/dist/docs/table.json +5 -5
- package/dist/docs/table.md +1 -1
- package/dist/docs/tag.examples.md +503 -0
- package/dist/docs/tag.json +128 -32
- package/dist/docs/tag.md +27 -138
- package/dist/docs/time-picker.json +162 -300
- package/dist/docs/time-picker.md +100 -154
- package/dist/docs/time-range-picker.json +203 -465
- package/dist/docs/time-range-picker.md +125 -173
- package/dist/docs/toast.examples.md +690 -0
- package/dist/docs/toast.json +119 -71
- package/dist/docs/toast.md +44 -212
- package/dist/docs/tree.examples.md +2008 -0
- package/dist/docs/tree.json +283 -106
- package/dist/docs/tree.md +96 -328
- package/dist/docs/visually-hidden.json +38 -6
- package/dist/docs/visually-hidden.md +148 -11
- package/dist/{entity-picker-CwfA1wr_.js → entity-picker-BwJX0gNJ.js} +1 -1
- package/dist/entity-picker.js +1 -1
- package/dist/{filter-bar-b8bRNPs9.js → filter-bar-BQZFgV0A.js} +5 -3
- package/dist/filter-bar.js +1 -1
- package/dist/{import-export-center-C_oNc-RM.js → import-export-center-DWSEOV5Z.js} +3 -3
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +101 -99
- package/dist/{markdown-x59MHBAa.js → markdown-7wOBMXTl.js} +1 -1
- package/dist/markdown.js +1 -1
- package/dist/picker-frame-_9ZqQOjf.js +43 -0
- package/dist/picker-group-CrNRKUxz.js +33 -0
- package/dist/picker-head-C_Z0tQGq.js +69 -0
- package/dist/picker-jump-BcTRIJs6.js +70 -0
- package/dist/picker-range-head-B4tsDOc5.js +100 -0
- package/dist/picker-step-MgBwF9g1.js +26 -0
- package/dist/read-title-id-DQZVWlMt.js +14 -0
- package/dist/result-state-Ct9AB01a.js +123 -0
- package/dist/result-state.js +1 -1
- package/dist/styles/app-shell.css +1 -1
- package/dist/styles/aspect-ratio.css +1 -1
- package/dist/styles/attachment.css +1 -1
- package/dist/styles/badge.css +1 -1
- package/dist/styles/calendar.css +1 -1
- package/dist/styles/cascader.css +1 -1
- package/dist/styles/chart.css +1 -1
- package/dist/styles/clock.css +2 -0
- package/dist/styles/code-block.css +1 -1
- package/dist/styles/command-palette.css +1 -1
- package/dist/styles/dashboard-grid.css +1 -1
- package/dist/styles/data-grid.css +14 -10
- package/dist/styles/data-list.css +1 -1
- package/dist/styles/date-picker.css +4 -2
- package/dist/styles/date-range-picker.css +4 -2
- package/dist/styles/datetime-picker.css +8 -2
- package/dist/styles/datetime-range-picker.css +6 -2
- package/dist/styles/detail-panel.css +3 -3
- package/dist/styles/entity-picker.css +1 -1
- package/dist/styles/event-calendar.css +1 -1
- package/dist/styles/filter-bar.css +11 -7
- package/dist/styles/grid.css +1 -1
- package/dist/styles/image.css +1 -1
- package/dist/styles/import-export-center.css +15 -11
- package/dist/styles/index.css +21 -17
- package/dist/styles/inline.css +1 -1
- package/dist/styles/loading-overlay.css +1 -1
- package/dist/styles/markdown.css +1 -1
- package/dist/styles/multi-select.css +1 -1
- package/dist/styles/notification-center.css +1 -1
- package/dist/styles/page-header.css +2 -2
- package/dist/styles/progress-indicator.css +1 -1
- package/dist/styles/side-navigation.css +2 -2
- package/dist/styles/skeleton.css +1 -1
- package/dist/styles/stack.css +1 -1
- package/dist/styles/stat-card.css +1 -1
- package/dist/styles/table-of-contents.css +1 -1
- package/dist/styles/table.css +14 -10
- package/dist/styles/time-picker.css +5 -1
- package/dist/styles/time-range-picker.css +5 -1
- package/dist/styles/toast.css +1 -1
- package/dist/styles/top-navigation.css +1 -1
- package/dist/styles/tree.css +1 -1
- package/dist/styles/upload.css +1 -1
- package/dist/styles/wizard.css +1 -1
- package/dist/styles.css +1 -1
- package/dist/{table-DqwYPHGS.js → table-MGb3iZY_.js} +11 -6
- package/dist/table.js +1 -1
- package/dist/time-picker-z4GSRuha.js +313 -0
- package/dist/time-picker.js +2 -2
- package/dist/time-range-picker-ar40oPcf.js +563 -0
- package/dist/time-range-picker.js +2 -2
- package/dist/{toast-DHDVXIew.js → toast-Cg28GkqX.js} +121 -117
- package/dist/toast.js +1 -1
- package/dist/tree-CytfCFT-.js +874 -0
- package/dist/tree.js +1 -1
- package/dist/types/alert/alert-parts.d.ts +1 -1
- package/dist/types/alert/alert-parts.d.ts.map +1 -1
- package/dist/types/alert/alert.d.ts.map +1 -1
- package/dist/types/alert/alert.types.d.ts +1 -1
- package/dist/types/alert/alert.types.d.ts.map +1 -1
- package/dist/types/avatar/avatar.d.ts.map +1 -1
- package/dist/types/badge/badge.types.d.ts +1 -1
- package/dist/types/badge/badge.types.d.ts.map +1 -1
- package/dist/types/calendar/calendar-day-cell.d.ts +3 -1
- package/dist/types/calendar/calendar-day-cell.d.ts.map +1 -1
- package/dist/types/calendar/calendar-header.d.ts +9 -5
- package/dist/types/calendar/calendar-header.d.ts.map +1 -1
- package/dist/types/calendar/calendar-month-table.d.ts +8 -3
- package/dist/types/calendar/calendar-month-table.d.ts.map +1 -1
- package/dist/types/calendar/calendar.d.ts +1 -1
- package/dist/types/calendar/calendar.d.ts.map +1 -1
- package/dist/types/calendar/calendar.types.d.ts +12 -1
- package/dist/types/calendar/calendar.types.d.ts.map +1 -1
- package/dist/types/clock/clock-body.d.ts +16 -0
- package/dist/types/clock/clock-body.d.ts.map +1 -0
- package/dist/types/clock/clock-demo.d.ts +15 -0
- package/dist/types/clock/clock-demo.d.ts.map +1 -0
- package/dist/types/clock/clock-groups.d.ts +15 -0
- package/dist/types/clock/clock-groups.d.ts.map +1 -0
- package/dist/types/clock/clock-option.d.ts +14 -0
- package/dist/types/clock/clock-option.d.ts.map +1 -0
- package/dist/types/clock/clock-units.d.ts +13 -0
- package/dist/types/clock/clock-units.d.ts.map +1 -0
- package/dist/types/clock/clock.d.ts +11 -0
- package/dist/types/clock/clock.d.ts.map +1 -0
- package/dist/types/clock/clock.types.d.ts +66 -0
- package/dist/types/clock/clock.types.d.ts.map +1 -0
- package/dist/types/clock/index.d.ts +3 -0
- package/dist/types/clock/index.d.ts.map +1 -0
- package/dist/types/clock/use-clock-grid.d.ts +28 -0
- package/dist/types/clock/use-clock-grid.d.ts.map +1 -0
- package/dist/types/clock/use-clock-view.d.ts +16 -0
- package/dist/types/clock/use-clock-view.d.ts.map +1 -0
- package/dist/types/data-grid/data-grid-filter.d.ts.map +1 -1
- package/dist/types/date-picker/date-panel.d.ts +32 -0
- package/dist/types/date-picker/date-panel.d.ts.map +1 -0
- package/dist/types/date-picker/date-picker-demo.d.ts +8 -15
- package/dist/types/date-picker/date-picker-demo.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker-panel.d.ts +18 -0
- package/dist/types/date-picker/date-picker-panel.d.ts.map +1 -0
- package/dist/types/date-picker/date-picker.d.ts +7 -13
- package/dist/types/date-picker/date-picker.d.ts.map +1 -1
- package/dist/types/date-picker/date-picker.types.d.ts +15 -16
- package/dist/types/date-picker/date-picker.types.d.ts.map +1 -1
- package/dist/types/date-picker/index.d.ts +1 -1
- package/dist/types/date-picker/index.d.ts.map +1 -1
- package/dist/types/date-picker/month-picker.d.ts +12 -0
- package/dist/types/date-picker/month-picker.d.ts.map +1 -0
- package/dist/types/date-picker/use-date-panel.d.ts +50 -0
- package/dist/types/date-picker/use-date-panel.d.ts.map +1 -0
- package/dist/types/date-picker/use-date-picker.d.ts +24 -0
- package/dist/types/date-picker/use-date-picker.d.ts.map +1 -0
- package/dist/types/date-range-picker/date-range-control.d.ts +34 -0
- package/dist/types/date-range-picker/date-range-control.d.ts.map +1 -0
- package/dist/types/date-range-picker/date-range-panel.d.ts +24 -0
- package/dist/types/date-range-picker/date-range-panel.d.ts.map +1 -0
- package/dist/types/date-range-picker/date-range-picker-demo.d.ts +8 -15
- package/dist/types/date-range-picker/date-range-picker-demo.d.ts.map +1 -1
- package/dist/types/date-range-picker/date-range-picker.d.ts +11 -21
- package/dist/types/date-range-picker/date-range-picker.d.ts.map +1 -1
- package/dist/types/date-range-picker/date-range-picker.types.d.ts +12 -26
- package/dist/types/date-range-picker/date-range-picker.types.d.ts.map +1 -1
- package/dist/types/date-range-picker/index.d.ts +2 -2
- package/dist/types/date-range-picker/index.d.ts.map +1 -1
- package/dist/types/date-range-picker/range-words.d.ts +30 -0
- package/dist/types/date-range-picker/range-words.d.ts.map +1 -0
- package/dist/types/date-range-picker/use-date-range-picker.d.ts +32 -0
- package/dist/types/date-range-picker/use-date-range-picker.d.ts.map +1 -0
- package/dist/types/date-range-picker/use-range-draft.d.ts +39 -0
- package/dist/types/date-range-picker/use-range-draft.d.ts.map +1 -0
- package/dist/types/date-range-picker/use-range-panel.d.ts +71 -0
- package/dist/types/date-range-picker/use-range-panel.d.ts.map +1 -0
- package/dist/types/datetime-picker/datetime-picker-defaults.d.ts +3 -9
- package/dist/types/datetime-picker/datetime-picker-defaults.d.ts.map +1 -1
- package/dist/types/datetime-picker/datetime-picker-demo.d.ts +8 -31
- package/dist/types/datetime-picker/datetime-picker-demo.d.ts.map +1 -1
- package/dist/types/datetime-picker/datetime-picker-panel.d.ts +23 -0
- package/dist/types/datetime-picker/datetime-picker-panel.d.ts.map +1 -0
- package/dist/types/datetime-picker/datetime-picker.d.ts +8 -19
- package/dist/types/datetime-picker/datetime-picker.d.ts.map +1 -1
- package/dist/types/datetime-picker/datetime-picker.types.d.ts +25 -66
- package/dist/types/datetime-picker/datetime-picker.types.d.ts.map +1 -1
- package/dist/types/datetime-picker/index.d.ts +2 -2
- package/dist/types/datetime-picker/index.d.ts.map +1 -1
- package/dist/types/datetime-picker/use-datetime-panel.d.ts +69 -0
- package/dist/types/datetime-picker/use-datetime-panel.d.ts.map +1 -0
- package/dist/types/datetime-picker/use-datetime-picker.d.ts +22 -0
- package/dist/types/datetime-picker/use-datetime-picker.d.ts.map +1 -0
- package/dist/types/datetime-range-picker/datetime-range-half.d.ts +20 -0
- package/dist/types/datetime-range-picker/datetime-range-half.d.ts.map +1 -0
- package/dist/types/datetime-range-picker/datetime-range-panel.d.ts +30 -0
- package/dist/types/datetime-range-picker/datetime-range-panel.d.ts.map +1 -0
- package/dist/types/datetime-range-picker/datetime-range-picker-defaults.d.ts +5 -7
- package/dist/types/datetime-range-picker/datetime-range-picker-defaults.d.ts.map +1 -1
- package/dist/types/datetime-range-picker/datetime-range-picker-demo.d.ts +8 -24
- package/dist/types/datetime-range-picker/datetime-range-picker-demo.d.ts.map +1 -1
- package/dist/types/datetime-range-picker/datetime-range-picker.d.ts +12 -24
- package/dist/types/datetime-range-picker/datetime-range-picker.d.ts.map +1 -1
- package/dist/types/datetime-range-picker/datetime-range-picker.types.d.ts +31 -66
- package/dist/types/datetime-range-picker/datetime-range-picker.types.d.ts.map +1 -1
- package/dist/types/datetime-range-picker/datetime-range-words.d.ts +40 -0
- package/dist/types/datetime-range-picker/datetime-range-words.d.ts.map +1 -0
- package/dist/types/datetime-range-picker/index.d.ts +4 -3
- package/dist/types/datetime-range-picker/index.d.ts.map +1 -1
- package/dist/types/datetime-range-picker/use-datetime-range-draft.d.ts +43 -0
- package/dist/types/datetime-range-picker/use-datetime-range-draft.d.ts.map +1 -0
- package/dist/types/datetime-range-picker/use-datetime-range-panel.d.ts +82 -0
- package/dist/types/datetime-range-picker/use-datetime-range-panel.d.ts.map +1 -0
- package/dist/types/datetime-range-picker/use-datetime-range-picker.d.ts +28 -0
- package/dist/types/datetime-range-picker/use-datetime-range-picker.d.ts.map +1 -0
- package/dist/types/divider/divider.d.ts +1 -1
- package/dist/types/divider/divider.d.ts.map +1 -1
- package/dist/types/filter-bar/filter-bar-rules.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/picker-panel/picker-footer.d.ts +17 -0
- package/dist/types/picker-panel/picker-footer.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-frame.d.ts +21 -0
- package/dist/types/picker-panel/picker-frame.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-group.d.ts +18 -0
- package/dist/types/picker-panel/picker-group.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-head.d.ts +27 -0
- package/dist/types/picker-panel/picker-head.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-jump.d.ts +18 -0
- package/dist/types/picker-panel/picker-jump.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-layer.d.ts +14 -0
- package/dist/types/picker-panel/picker-layer.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-panel.d.ts +17 -0
- package/dist/types/picker-panel/picker-panel.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-rail.d.ts +17 -0
- package/dist/types/picker-panel/picker-rail.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-range-head.d.ts +37 -0
- package/dist/types/picker-panel/picker-range-head.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-ruler.d.ts +14 -0
- package/dist/types/picker-panel/picker-ruler.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-step.d.ts +11 -0
- package/dist/types/picker-panel/picker-step.d.ts.map +1 -0
- package/dist/types/picker-panel/picker-trigger.d.ts +16 -0
- package/dist/types/picker-panel/picker-trigger.d.ts.map +1 -0
- package/dist/types/picker-panel/use-media-query.d.ts +3 -0
- package/dist/types/picker-panel/use-media-query.d.ts.map +1 -0
- package/dist/types/picker-panel/use-picker-draft.d.ts +18 -0
- package/dist/types/picker-panel/use-picker-draft.d.ts.map +1 -0
- package/dist/types/picker-panel/use-picker-layer.d.ts +31 -0
- package/dist/types/picker-panel/use-picker-layer.d.ts.map +1 -0
- package/dist/types/picker-panel/use-picker-open.d.ts +14 -0
- package/dist/types/picker-panel/use-picker-open.d.ts.map +1 -0
- package/dist/types/picker-panel/use-picker-position.d.ts +12 -0
- package/dist/types/picker-panel/use-picker-position.d.ts.map +1 -0
- package/dist/types/picker-panel/use-picker-value.d.ts +20 -0
- package/dist/types/picker-panel/use-picker-value.d.ts.map +1 -0
- package/dist/types/result-state/result-state.d.ts +32 -2
- package/dist/types/result-state/result-state.d.ts.map +1 -1
- package/dist/types/table/table-filter.d.ts.map +1 -1
- package/dist/types/table/table.types.d.ts +16 -14
- package/dist/types/table/table.types.d.ts.map +1 -1
- package/dist/types/tag/tag.types.d.ts +1 -1
- package/dist/types/tag/tag.types.d.ts.map +1 -1
- package/dist/types/time-picker/index.d.ts +2 -2
- package/dist/types/time-picker/index.d.ts.map +1 -1
- package/dist/types/time-picker/time-picker-defaults.d.ts +0 -7
- package/dist/types/time-picker/time-picker-defaults.d.ts.map +1 -1
- package/dist/types/time-picker/time-picker-demo.d.ts +15 -0
- package/dist/types/time-picker/time-picker-demo.d.ts.map +1 -0
- package/dist/types/time-picker/time-picker-panel.d.ts +17 -0
- package/dist/types/time-picker/time-picker-panel.d.ts.map +1 -0
- package/dist/types/time-picker/time-picker.d.ts +6 -14
- package/dist/types/time-picker/time-picker.d.ts.map +1 -1
- package/dist/types/time-picker/time-picker.types.d.ts +21 -45
- package/dist/types/time-picker/time-picker.types.d.ts.map +1 -1
- package/dist/types/time-picker/use-time-panel.d.ts +42 -0
- package/dist/types/time-picker/use-time-panel.d.ts.map +1 -0
- package/dist/types/time-picker/use-time-picker.d.ts +27 -0
- package/dist/types/time-picker/use-time-picker.d.ts.map +1 -0
- package/dist/types/time-range-picker/index.d.ts +4 -3
- package/dist/types/time-range-picker/index.d.ts.map +1 -1
- package/dist/types/time-range-picker/time-range-panel.d.ts +23 -0
- package/dist/types/time-range-picker/time-range-panel.d.ts.map +1 -0
- package/dist/types/time-range-picker/time-range-picker-defaults.d.ts +2 -4
- package/dist/types/time-range-picker/time-range-picker-defaults.d.ts.map +1 -1
- package/dist/types/time-range-picker/time-range-picker-demo.d.ts +8 -24
- package/dist/types/time-range-picker/time-range-picker-demo.d.ts.map +1 -1
- package/dist/types/time-range-picker/time-range-picker.d.ts +12 -28
- package/dist/types/time-range-picker/time-range-picker.d.ts.map +1 -1
- package/dist/types/time-range-picker/time-range-picker.types.d.ts +24 -64
- package/dist/types/time-range-picker/time-range-picker.types.d.ts.map +1 -1
- package/dist/types/time-range-picker/time-range-words.d.ts +37 -0
- package/dist/types/time-range-picker/time-range-words.d.ts.map +1 -0
- package/dist/types/time-range-picker/use-time-range-panel.d.ts +68 -0
- package/dist/types/time-range-picker/use-time-range-panel.d.ts.map +1 -0
- package/dist/types/time-range-picker/use-time-range-picker.d.ts +25 -0
- package/dist/types/time-range-picker/use-time-range-picker.d.ts.map +1 -0
- package/dist/types/title-id/read-title-id.d.ts +15 -0
- package/dist/types/title-id/read-title-id.d.ts.map +1 -0
- package/dist/types/toast/toast.d.ts.map +1 -1
- package/dist/types/tree/index.d.ts +1 -1
- package/dist/types/tree/index.d.ts.map +1 -1
- package/dist/types/tree/tree-parts.d.ts +2 -0
- package/dist/types/tree/tree-parts.d.ts.map +1 -1
- package/dist/types/tree/tree.d.ts +1 -1
- package/dist/types/tree/tree.d.ts.map +1 -1
- package/dist/types/tree/tree.types.d.ts +15 -5
- package/dist/types/tree/tree.types.d.ts.map +1 -1
- package/dist/use-date-picker-DL8tRXji.js +63 -0
- package/dist/use-picker-draft-Bw8VFaj0.js +377 -0
- package/dist/{wizard-CL6u1aJb.js → wizard-BokOrtwq.js} +1 -1
- package/dist/wizard.js +1 -1
- package/package.json +10 -6
- package/dist/alert-Bi9s1cjV.js +0 -174
- package/dist/calendar-CX0wN5Bh.js +0 -564
- package/dist/date-picker-CLXTtQGe.js +0 -337
- package/dist/date-range-picker-Br0neGyT.js +0 -522
- package/dist/datetime-picker-CR-H_BLu.js +0 -683
- package/dist/datetime-range-picker-BLo58OIk.js +0 -1050
- package/dist/divider-ryFeK0Pi.js +0 -35
- package/dist/docs/datetime-range-picker.examples.md +0 -219
- package/dist/result-state-BMYhelu1.js +0 -128
- package/dist/time-picker-B4-GsO24.js +0 -436
- package/dist/time-range-picker-DVOWN8PF.js +0 -800
- package/dist/tree-D-y-0TrL.js +0 -794
|
@@ -0,0 +1,690 @@
|
|
|
1
|
+
<!-- index: ./index.md -->
|
|
2
|
+
# toast
|
|
3
|
+
|
|
4
|
+
`data-ui="toast"` · Temporary notification with optional action.
|
|
5
|
+
|
|
6
|
+
## Examples
|
|
7
|
+
|
|
8
|
+
### Playground
|
|
9
|
+
|
|
10
|
+
One region with every axis on it, driven by the controls below the canvas. The messages here are given no duration so the page has something to show; an application states one, or lets the default of five seconds stand.
|
|
11
|
+
|
|
12
|
+
Excerpt — not a complete module
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
// Once, near the root of the application.
|
|
16
|
+
<ToastRegion />;
|
|
17
|
+
|
|
18
|
+
// From anywhere at all — an event handler, an interceptor, a saga.
|
|
19
|
+
toast.show({
|
|
20
|
+
title: 'Draft saved',
|
|
21
|
+
description: 'Everything since 2:02 PM is saved.',
|
|
22
|
+
});
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
### What the message is about
|
|
26
|
+
|
|
27
|
+
Five tones and five marks. The mark is the answer to WCAG 2.2 1.4.1: read in grayscale, or under forced colors where every ground becomes one system color, the silhouette is the only thing left to tell a failure from a note.
|
|
28
|
+
|
|
29
|
+
Example
|
|
30
|
+
|
|
31
|
+
```tsx
|
|
32
|
+
import { Button } from '@slotted/react/button';
|
|
33
|
+
import { Inline } from '@slotted/react/inline';
|
|
34
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
35
|
+
|
|
36
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
37
|
+
const toaster = createToaster();
|
|
38
|
+
|
|
39
|
+
export default function ToastTones() {
|
|
40
|
+
return (
|
|
41
|
+
<>
|
|
42
|
+
<ToastRegion toaster={toaster} />
|
|
43
|
+
<Inline gap={2}>
|
|
44
|
+
<Button
|
|
45
|
+
variant="outline"
|
|
46
|
+
onClick={() => toaster.show({ title: 'Nightly sync starts at 02:00', tone: 'info' })}
|
|
47
|
+
>
|
|
48
|
+
Info
|
|
49
|
+
</Button>
|
|
50
|
+
<Button
|
|
51
|
+
variant="outline"
|
|
52
|
+
onClick={() => toaster.show({ title: 'Invoice INV-2041 sent', tone: 'success' })}
|
|
53
|
+
>
|
|
54
|
+
Success
|
|
55
|
+
</Button>
|
|
56
|
+
<Button
|
|
57
|
+
variant="outline"
|
|
58
|
+
onClick={() =>
|
|
59
|
+
toaster.show({ title: 'Stock of BEV-104 is below 20 units', tone: 'warning' })
|
|
60
|
+
}
|
|
61
|
+
>
|
|
62
|
+
Warning
|
|
63
|
+
</Button>
|
|
64
|
+
<Button
|
|
65
|
+
variant="outline"
|
|
66
|
+
onClick={() =>
|
|
67
|
+
toaster.show({ title: 'Payment for SO-10482 was declined', tone: 'danger' })
|
|
68
|
+
}
|
|
69
|
+
>
|
|
70
|
+
Danger
|
|
71
|
+
</Button>
|
|
72
|
+
<Button
|
|
73
|
+
variant="outline"
|
|
74
|
+
onClick={() =>
|
|
75
|
+
toaster.show({ title: 'Columns restored to their defaults', tone: 'secondary' })
|
|
76
|
+
}
|
|
77
|
+
>
|
|
78
|
+
Note
|
|
79
|
+
</Button>
|
|
80
|
+
</Inline>
|
|
81
|
+
</>
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### How that tone is painted
|
|
87
|
+
|
|
88
|
+
raised is the default and the one the other message families do not have: a toast floats over content this family does not own, so the tone is in the mark and the box keeps the neutral raised surface. soft and solid are for a region inside a page’s own chrome.
|
|
89
|
+
|
|
90
|
+
Example
|
|
91
|
+
|
|
92
|
+
```tsx
|
|
93
|
+
import { Button } from '@slotted/react/button';
|
|
94
|
+
import { Inline } from '@slotted/react/inline';
|
|
95
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
96
|
+
|
|
97
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
98
|
+
const toaster = createToaster();
|
|
99
|
+
|
|
100
|
+
export default function ToastVariants() {
|
|
101
|
+
return (
|
|
102
|
+
<>
|
|
103
|
+
<ToastRegion toaster={toaster} />
|
|
104
|
+
<Inline gap={2}>
|
|
105
|
+
<Button
|
|
106
|
+
variant="outline"
|
|
107
|
+
onClick={() =>
|
|
108
|
+
toaster.show({ title: 'Invoice INV-2041 sent', tone: 'success', variant: 'raised' })
|
|
109
|
+
}
|
|
110
|
+
>
|
|
111
|
+
Raised
|
|
112
|
+
</Button>
|
|
113
|
+
<Button
|
|
114
|
+
variant="outline"
|
|
115
|
+
onClick={() =>
|
|
116
|
+
toaster.show({ title: 'Invoice INV-2041 sent', tone: 'success', variant: 'soft' })
|
|
117
|
+
}
|
|
118
|
+
>
|
|
119
|
+
Soft
|
|
120
|
+
</Button>
|
|
121
|
+
<Button
|
|
122
|
+
variant="outline"
|
|
123
|
+
onClick={() =>
|
|
124
|
+
toaster.show({ title: 'Invoice INV-2041 sent', tone: 'success', variant: 'solid' })
|
|
125
|
+
}
|
|
126
|
+
>
|
|
127
|
+
Solid
|
|
128
|
+
</Button>
|
|
129
|
+
</Inline>
|
|
130
|
+
</>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Which corner the region owns
|
|
136
|
+
|
|
137
|
+
Six placements, all written in logical properties: bottom-end is the bottom right of this page and the bottom left of the same page in Arabic. Switch the direction in the toolbar and the region moves with the text.
|
|
138
|
+
|
|
139
|
+
Example
|
|
140
|
+
|
|
141
|
+
```tsx
|
|
142
|
+
import { Button } from '@slotted/react/button';
|
|
143
|
+
import { Inline } from '@slotted/react/inline';
|
|
144
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
145
|
+
|
|
146
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
147
|
+
const toaster = createToaster();
|
|
148
|
+
|
|
149
|
+
export default function ToastPlacement() {
|
|
150
|
+
return (
|
|
151
|
+
<>
|
|
152
|
+
<ToastRegion toaster={toaster} placement="top" />
|
|
153
|
+
<Inline gap={2}>
|
|
154
|
+
<Button onClick={() => toaster.show({ title: 'Draft saved' })}>Show at the top</Button>
|
|
155
|
+
</Inline>
|
|
156
|
+
</>
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### How long a message stays
|
|
162
|
+
|
|
163
|
+
The bar reads the same number the timer does. Hover the region and both stop together — the clock also stops while focus is inside it and while the tab is hidden, and it resumes on what was left rather than starting again.
|
|
164
|
+
|
|
165
|
+
Excerpt — not a complete module
|
|
166
|
+
|
|
167
|
+
```tsx
|
|
168
|
+
toast.show({ title: 'Exported', duration: 8000, progress: true });
|
|
169
|
+
|
|
170
|
+
// 0 never expires. A message that must be answered rather than read is one
|
|
171
|
+
// of the two cases the family gives no duration to on its own.
|
|
172
|
+
toast.show({ title: 'Session expired', tone: 'danger', duration: 0 });
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### A message the reader can act on
|
|
176
|
+
|
|
177
|
+
A message that carries an action is given no duration unless one is stated: Angular Material is the only surveyed implementation that states the rule, and a reader on their way to Undo must not watch it disappear. Press Undo and the message closes with it.
|
|
178
|
+
|
|
179
|
+
Example
|
|
180
|
+
|
|
181
|
+
```tsx
|
|
182
|
+
import { useState } from 'react';
|
|
183
|
+
import { Button } from '@slotted/react/button';
|
|
184
|
+
import { Stack } from '@slotted/react/stack';
|
|
185
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
186
|
+
import { Text } from '@slotted/react/typography';
|
|
187
|
+
|
|
188
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
189
|
+
const toaster = createToaster();
|
|
190
|
+
|
|
191
|
+
export default function ToastActionsExample() {
|
|
192
|
+
const [archived, setArchived] = useState(false);
|
|
193
|
+
|
|
194
|
+
function handleArchive() {
|
|
195
|
+
setArchived(true);
|
|
196
|
+
const id = toaster.show({
|
|
197
|
+
title: 'Order SO-10482 archived',
|
|
198
|
+
actions: (
|
|
199
|
+
<Button
|
|
200
|
+
size="sm"
|
|
201
|
+
variant="outline"
|
|
202
|
+
onClick={() => {
|
|
203
|
+
setArchived(false);
|
|
204
|
+
toaster.dismiss(id);
|
|
205
|
+
}}
|
|
206
|
+
>
|
|
207
|
+
Undo
|
|
208
|
+
</Button>
|
|
209
|
+
),
|
|
210
|
+
});
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
return (
|
|
214
|
+
<Stack align="start" gap={3}>
|
|
215
|
+
<ToastRegion toaster={toaster} />
|
|
216
|
+
<Button disabled={archived} onClick={handleArchive}>
|
|
217
|
+
Archive order
|
|
218
|
+
</Button>
|
|
219
|
+
<Text size="sm" tone="muted">
|
|
220
|
+
{archived ? 'SO-10482 is archived.' : 'SO-10482 is open.'}
|
|
221
|
+
</Text>
|
|
222
|
+
</Stack>
|
|
223
|
+
);
|
|
224
|
+
}
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
### A message that follows a promise
|
|
228
|
+
|
|
229
|
+
One message from start to finish: it begins as loading with no duration and no countdown, and the same element becomes the success or the failure. Replacing it with a second message would make a reader hear the sentence twice.
|
|
230
|
+
|
|
231
|
+
Example
|
|
232
|
+
|
|
233
|
+
```tsx
|
|
234
|
+
import { Button } from '@slotted/react/button';
|
|
235
|
+
import { Inline } from '@slotted/react/inline';
|
|
236
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
237
|
+
|
|
238
|
+
function publish(succeeds: boolean) {
|
|
239
|
+
return new Promise<number>((resolve, reject) => {
|
|
240
|
+
setTimeout(() => (succeeds ? resolve(148) : reject(new Error('Offline'))), 2000);
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
const MESSAGES = {
|
|
245
|
+
loading: { title: 'Publishing prices' },
|
|
246
|
+
success: (count: number) => ({ title: `${count} prices published`, tone: 'success' as const }),
|
|
247
|
+
error: { title: 'Prices were not published', tone: 'danger' as const },
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
251
|
+
const toaster = createToaster();
|
|
252
|
+
|
|
253
|
+
export default function ToastPromise() {
|
|
254
|
+
return (
|
|
255
|
+
<>
|
|
256
|
+
<ToastRegion toaster={toaster} />
|
|
257
|
+
<Inline gap={2}>
|
|
258
|
+
<Button onClick={() => void toaster.promise(publish(true), MESSAGES)}>
|
|
259
|
+
Publish prices
|
|
260
|
+
</Button>
|
|
261
|
+
<Button
|
|
262
|
+
variant="outline"
|
|
263
|
+
onClick={() => toaster.promise(publish(false), MESSAGES).catch(() => undefined)}
|
|
264
|
+
>
|
|
265
|
+
Publish with an error
|
|
266
|
+
</Button>
|
|
267
|
+
</Inline>
|
|
268
|
+
</>
|
|
269
|
+
);
|
|
270
|
+
}
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### More messages than the screen
|
|
274
|
+
|
|
275
|
+
Past the limit a message waits, and what is already on screen stays — a reader half way through one does not lose it to something that arrived after. A waiting message has no clock at all: its duration starts when it appears.
|
|
276
|
+
|
|
277
|
+
Example
|
|
278
|
+
|
|
279
|
+
```tsx
|
|
280
|
+
import { Button } from '@slotted/react/button';
|
|
281
|
+
import { Inline } from '@slotted/react/inline';
|
|
282
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
283
|
+
|
|
284
|
+
const LABELS = ['SO-10482', 'SO-10483', 'SO-10484', 'SO-10485', 'SO-10486'];
|
|
285
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
286
|
+
const toaster = createToaster();
|
|
287
|
+
|
|
288
|
+
export default function ToastQueue() {
|
|
289
|
+
return (
|
|
290
|
+
<>
|
|
291
|
+
<ToastRegion toaster={toaster} limit={2} />
|
|
292
|
+
<Inline gap={2}>
|
|
293
|
+
<Button
|
|
294
|
+
onClick={() => LABELS.forEach((label) => toaster.show({ title: `${label} printed` }))}
|
|
295
|
+
>
|
|
296
|
+
Print five labels
|
|
297
|
+
</Button>
|
|
298
|
+
<Button variant="outline" onClick={() => toaster.clear()}>
|
|
299
|
+
Clear
|
|
300
|
+
</Button>
|
|
301
|
+
</Inline>
|
|
302
|
+
</>
|
|
303
|
+
);
|
|
304
|
+
}
|
|
305
|
+
```
|
|
306
|
+
|
|
307
|
+
### A pile that opens
|
|
308
|
+
|
|
309
|
+
Four messages at full height fill a phone. stack puts them one behind another at the edge the placement names and opens the pile when the pointer is over it or the keyboard is inside — the same two conditions that stop the clock, because both mean the reader is reading.
|
|
310
|
+
|
|
311
|
+
Example
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import { Button } from '@slotted/react/button';
|
|
315
|
+
import { Inline } from '@slotted/react/inline';
|
|
316
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
317
|
+
|
|
318
|
+
const SHIPMENTS = ['SH-2201', 'SH-2202', 'SH-2203', 'SH-2204'];
|
|
319
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
320
|
+
const toaster = createToaster();
|
|
321
|
+
|
|
322
|
+
export default function ToastStacking() {
|
|
323
|
+
return (
|
|
324
|
+
<>
|
|
325
|
+
<ToastRegion toaster={toaster} limit={4} stacking="stack" />
|
|
326
|
+
<Inline gap={2}>
|
|
327
|
+
<Button
|
|
328
|
+
onClick={() =>
|
|
329
|
+
SHIPMENTS.forEach((shipment) =>
|
|
330
|
+
toaster.show({ title: `${shipment} received`, tone: 'success', duration: 0 }),
|
|
331
|
+
)
|
|
332
|
+
}
|
|
333
|
+
>
|
|
334
|
+
Receive four shipments
|
|
335
|
+
</Button>
|
|
336
|
+
<Button variant="outline" onClick={() => toaster.clear()}>
|
|
337
|
+
Clear
|
|
338
|
+
</Button>
|
|
339
|
+
</Inline>
|
|
340
|
+
</>
|
|
341
|
+
);
|
|
342
|
+
}
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
### The ways a message leaves
|
|
346
|
+
|
|
347
|
+
Four, and each carries its own reason: the close control says dismiss, Escape inside the message says escape, a swipe toward the edge says pointer, and the timer says timeout. A page that has to tell them apart reads the reason rather than guessing.
|
|
348
|
+
|
|
349
|
+
Example
|
|
350
|
+
|
|
351
|
+
```tsx
|
|
352
|
+
import { useState } from 'react';
|
|
353
|
+
import { Button } from '@slotted/react/button';
|
|
354
|
+
import { Stack } from '@slotted/react/stack';
|
|
355
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
356
|
+
import { Text } from '@slotted/react/typography';
|
|
357
|
+
|
|
358
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
359
|
+
const toaster = createToaster();
|
|
360
|
+
|
|
361
|
+
export default function ToastDismissal() {
|
|
362
|
+
const [reason, setReason] = useState('none yet');
|
|
363
|
+
|
|
364
|
+
return (
|
|
365
|
+
<Stack align="start" gap={3}>
|
|
366
|
+
<ToastRegion
|
|
367
|
+
onToastsChange={(_toasts, request) => {
|
|
368
|
+
if (request.reason !== 'programmatic') setReason(request.reason);
|
|
369
|
+
}}
|
|
370
|
+
toaster={toaster}
|
|
371
|
+
/>
|
|
372
|
+
<Button onClick={() => toaster.show({ title: 'Draft saved', progress: true })}>
|
|
373
|
+
Save draft
|
|
374
|
+
</Button>
|
|
375
|
+
<Text role="status" size="sm" tone="muted">
|
|
376
|
+
Last departure: {reason}
|
|
377
|
+
</Text>
|
|
378
|
+
</Stack>
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
### Reaching the messages from the keyboard
|
|
384
|
+
|
|
385
|
+
A message arriving never moves focus — the APG’s Alert pattern is explicit about it. F6 is what the reader presses to get there, Tab walks the controls, and Escape closes the message and hands the keyboard back to where it came from.
|
|
386
|
+
|
|
387
|
+
Example
|
|
388
|
+
|
|
389
|
+
```tsx
|
|
390
|
+
import { Button } from '@slotted/react/button';
|
|
391
|
+
import { Inline } from '@slotted/react/inline';
|
|
392
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
393
|
+
|
|
394
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
395
|
+
const toaster = createToaster();
|
|
396
|
+
|
|
397
|
+
export default function ToastKeyboard() {
|
|
398
|
+
return (
|
|
399
|
+
<>
|
|
400
|
+
<ToastRegion toaster={toaster} hotkey="Alt+N" />
|
|
401
|
+
<Inline gap={2}>
|
|
402
|
+
<Button
|
|
403
|
+
onClick={() =>
|
|
404
|
+
toaster.show({
|
|
405
|
+
title: 'Draft saved',
|
|
406
|
+
description: 'Press Alt+N to reach this message.',
|
|
407
|
+
duration: 0,
|
|
408
|
+
})
|
|
409
|
+
}
|
|
410
|
+
>
|
|
411
|
+
Show a message
|
|
412
|
+
</Button>
|
|
413
|
+
</Inline>
|
|
414
|
+
</>
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
### Content the family did not choose
|
|
420
|
+
|
|
421
|
+
A digest no language can break, a title that doubled in translation, and a message with no mark at all. Nothing is removed from the document to make any of them fit: the whole string stays selectable and findable by a page search.
|
|
422
|
+
|
|
423
|
+
Excerpt — not a complete module
|
|
424
|
+
|
|
425
|
+
```tsx
|
|
426
|
+
toast.show({
|
|
427
|
+
title: 'Deployment rejected',
|
|
428
|
+
description: digest,
|
|
429
|
+
tone: 'danger',
|
|
430
|
+
duration: 0,
|
|
431
|
+
});
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### A message a page draws itself
|
|
435
|
+
|
|
436
|
+
The region hands each message to a function and keeps everything that is behavior: the clock, the exit, the swipe, the keyboard and the announcement. What the page writes is the body, and it can be anything at all.
|
|
437
|
+
|
|
438
|
+
Excerpt — not a complete module
|
|
439
|
+
|
|
440
|
+
```tsx
|
|
441
|
+
<ToastRegion>
|
|
442
|
+
{(message) => (
|
|
443
|
+
<Toast key={message.id} message={message}>
|
|
444
|
+
<ToastContent>
|
|
445
|
+
<ToastTitle>{message.data.title}</ToastTitle>
|
|
446
|
+
</ToastContent>
|
|
447
|
+
</Toast>
|
|
448
|
+
)}
|
|
449
|
+
</ToastRegion>;
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
### controlled.tsx
|
|
453
|
+
|
|
454
|
+
Example
|
|
455
|
+
|
|
456
|
+
```tsx
|
|
457
|
+
import { useState } from 'react';
|
|
458
|
+
import { Stack } from '@slotted/react/stack';
|
|
459
|
+
import { Button } from '@slotted/react/button';
|
|
460
|
+
import { ToastRegion, type ToastContentValue, type ToastMessage } from '@slotted/react/toast';
|
|
461
|
+
import { Text } from '@slotted/react/typography';
|
|
462
|
+
|
|
463
|
+
const FIRST: ToastMessage<ToastContentValue> = {
|
|
464
|
+
id: 'import-118',
|
|
465
|
+
duration: 0,
|
|
466
|
+
priority: 'polite',
|
|
467
|
+
announcement: 'Import 118 finished',
|
|
468
|
+
loading: false,
|
|
469
|
+
action: false,
|
|
470
|
+
data: { title: 'Import 118 finished', tone: 'success' },
|
|
471
|
+
status: 'visible',
|
|
472
|
+
revision: 0,
|
|
473
|
+
};
|
|
474
|
+
|
|
475
|
+
export default function ToastControlled() {
|
|
476
|
+
const [toasts, setToasts] = useState<readonly ToastMessage<ToastContentValue>[]>([FIRST]);
|
|
477
|
+
|
|
478
|
+
return (
|
|
479
|
+
<Stack align="start" gap={3}>
|
|
480
|
+
<div style={{ blockSize: '9rem', inlineSize: '100%', position: 'relative' }}>
|
|
481
|
+
<ToastRegion attach="inline" onToastsChange={(next) => setToasts(next)} toasts={toasts} />
|
|
482
|
+
</div>
|
|
483
|
+
<Button disabled={toasts.length > 0} variant="outline" onClick={() => setToasts([FIRST])}>
|
|
484
|
+
Show again
|
|
485
|
+
</Button>
|
|
486
|
+
<Text size="sm" tone="muted">
|
|
487
|
+
Messages in the queue: {toasts.length}
|
|
488
|
+
</Text>
|
|
489
|
+
</Stack>
|
|
490
|
+
);
|
|
491
|
+
}
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
### defaults.tsx
|
|
495
|
+
|
|
496
|
+
Example
|
|
497
|
+
|
|
498
|
+
```tsx
|
|
499
|
+
import { Button } from '@slotted/react/button';
|
|
500
|
+
import { createToaster, ToastDefaultsProvider, ToastRegion } from '@slotted/react/toast';
|
|
501
|
+
|
|
502
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
503
|
+
const toaster = createToaster();
|
|
504
|
+
|
|
505
|
+
export default function ToastDefaultsExample() {
|
|
506
|
+
return (
|
|
507
|
+
<ToastDefaultsProvider duration={0} placement="top-end" variant="soft">
|
|
508
|
+
<ToastRegion toaster={toaster} />
|
|
509
|
+
<Button onClick={() => toaster.show({ title: 'Order SO-10482 packed', tone: 'success' })}>
|
|
510
|
+
Pack order
|
|
511
|
+
</Button>
|
|
512
|
+
</ToastDefaultsProvider>
|
|
513
|
+
);
|
|
514
|
+
}
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
### duration.tsx
|
|
518
|
+
|
|
519
|
+
Example
|
|
520
|
+
|
|
521
|
+
```tsx
|
|
522
|
+
import { Button } from '@slotted/react/button';
|
|
523
|
+
import { Inline } from '@slotted/react/inline';
|
|
524
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
525
|
+
|
|
526
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
527
|
+
const toaster = createToaster();
|
|
528
|
+
|
|
529
|
+
export default function ToastDuration() {
|
|
530
|
+
return (
|
|
531
|
+
<>
|
|
532
|
+
<ToastRegion toaster={toaster} />
|
|
533
|
+
<Inline gap={2}>
|
|
534
|
+
<Button
|
|
535
|
+
variant="outline"
|
|
536
|
+
onClick={() =>
|
|
537
|
+
toaster.show({
|
|
538
|
+
title: 'Export ready',
|
|
539
|
+
description: 'orders-november.csv',
|
|
540
|
+
duration: 8000,
|
|
541
|
+
progress: true,
|
|
542
|
+
})
|
|
543
|
+
}
|
|
544
|
+
>
|
|
545
|
+
Eight seconds
|
|
546
|
+
</Button>
|
|
547
|
+
<Button
|
|
548
|
+
variant="outline"
|
|
549
|
+
onClick={() =>
|
|
550
|
+
toaster.show({
|
|
551
|
+
title: 'Your session has expired',
|
|
552
|
+
description: 'Sign in again to go on.',
|
|
553
|
+
tone: 'danger',
|
|
554
|
+
duration: 0,
|
|
555
|
+
})
|
|
556
|
+
}
|
|
557
|
+
>
|
|
558
|
+
Until dismissed
|
|
559
|
+
</Button>
|
|
560
|
+
</Inline>
|
|
561
|
+
</>
|
|
562
|
+
);
|
|
563
|
+
}
|
|
564
|
+
```
|
|
565
|
+
|
|
566
|
+
### long-content.tsx
|
|
567
|
+
|
|
568
|
+
Example
|
|
569
|
+
|
|
570
|
+
```tsx
|
|
571
|
+
import { Button } from '@slotted/react/button';
|
|
572
|
+
import { Inline } from '@slotted/react/inline';
|
|
573
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
574
|
+
|
|
575
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
576
|
+
const toaster = createToaster();
|
|
577
|
+
|
|
578
|
+
export default function ToastLongContent() {
|
|
579
|
+
return (
|
|
580
|
+
<>
|
|
581
|
+
<ToastRegion toaster={toaster} />
|
|
582
|
+
<Inline gap={2}>
|
|
583
|
+
<Button
|
|
584
|
+
onClick={() =>
|
|
585
|
+
toaster.show({
|
|
586
|
+
title: 'Deployment of the storefront rejected by the registry',
|
|
587
|
+
description:
|
|
588
|
+
'sha256:9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08',
|
|
589
|
+
tone: 'danger',
|
|
590
|
+
duration: 0,
|
|
591
|
+
})
|
|
592
|
+
}
|
|
593
|
+
>
|
|
594
|
+
Show a long message
|
|
595
|
+
</Button>
|
|
596
|
+
<Button
|
|
597
|
+
variant="outline"
|
|
598
|
+
onClick={() =>
|
|
599
|
+
toaster.show({ title: 'Columns restored to their defaults', hideIcon: true })
|
|
600
|
+
}
|
|
601
|
+
>
|
|
602
|
+
Without a mark
|
|
603
|
+
</Button>
|
|
604
|
+
</Inline>
|
|
605
|
+
</>
|
|
606
|
+
);
|
|
607
|
+
}
|
|
608
|
+
```
|
|
609
|
+
|
|
610
|
+
### priority.tsx
|
|
611
|
+
|
|
612
|
+
Example
|
|
613
|
+
|
|
614
|
+
```tsx
|
|
615
|
+
import { Button } from '@slotted/react/button';
|
|
616
|
+
import { Inline } from '@slotted/react/inline';
|
|
617
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
618
|
+
|
|
619
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
620
|
+
const toaster = createToaster();
|
|
621
|
+
|
|
622
|
+
export default function ToastPriority() {
|
|
623
|
+
return (
|
|
624
|
+
<>
|
|
625
|
+
<ToastRegion toaster={toaster} />
|
|
626
|
+
<Inline gap={2}>
|
|
627
|
+
<Button variant="outline" onClick={() => toaster.show({ title: 'Draft saved' })}>
|
|
628
|
+
Polite
|
|
629
|
+
</Button>
|
|
630
|
+
<Button
|
|
631
|
+
variant="outline"
|
|
632
|
+
onClick={() =>
|
|
633
|
+
toaster.show({
|
|
634
|
+
title: 'Connection lost',
|
|
635
|
+
description: 'Changes are kept on this device.',
|
|
636
|
+
tone: 'danger',
|
|
637
|
+
priority: 'assertive',
|
|
638
|
+
})
|
|
639
|
+
}
|
|
640
|
+
>
|
|
641
|
+
Assertive
|
|
642
|
+
</Button>
|
|
643
|
+
</Inline>
|
|
644
|
+
</>
|
|
645
|
+
);
|
|
646
|
+
}
|
|
647
|
+
```
|
|
648
|
+
|
|
649
|
+
### update.tsx
|
|
650
|
+
|
|
651
|
+
Example
|
|
652
|
+
|
|
653
|
+
```tsx
|
|
654
|
+
import { Button } from '@slotted/react/button';
|
|
655
|
+
import { Inline } from '@slotted/react/inline';
|
|
656
|
+
import { createToaster, ToastRegion } from '@slotted/react/toast';
|
|
657
|
+
|
|
658
|
+
/* A queue for this example. The shared `toast` serves the whole application. */
|
|
659
|
+
const toaster = createToaster();
|
|
660
|
+
|
|
661
|
+
export default function ToastUpdate() {
|
|
662
|
+
return (
|
|
663
|
+
<>
|
|
664
|
+
<ToastRegion toaster={toaster} />
|
|
665
|
+
<Inline gap={2}>
|
|
666
|
+
<Button
|
|
667
|
+
onClick={() =>
|
|
668
|
+
toaster.show({ id: 'price-list', title: 'Uploading price list', duration: 0 })
|
|
669
|
+
}
|
|
670
|
+
>
|
|
671
|
+
Upload the price list
|
|
672
|
+
</Button>
|
|
673
|
+
<Button
|
|
674
|
+
variant="outline"
|
|
675
|
+
onClick={() =>
|
|
676
|
+
toaster.show({
|
|
677
|
+
id: 'price-list',
|
|
678
|
+
title: 'Price list uploaded',
|
|
679
|
+
tone: 'success',
|
|
680
|
+
duration: 5000,
|
|
681
|
+
})
|
|
682
|
+
}
|
|
683
|
+
>
|
|
684
|
+
Finish
|
|
685
|
+
</Button>
|
|
686
|
+
</Inline>
|
|
687
|
+
</>
|
|
688
|
+
);
|
|
689
|
+
}
|
|
690
|
+
```
|