@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
package/dist/docs/alert.json
CHANGED
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"part": "icon",
|
|
88
88
|
"element": "span",
|
|
89
89
|
"required": false,
|
|
90
|
-
"purpose": "The tone’s mark, drawn as a mask from the
|
|
90
|
+
"purpose": "The tone’s mark, drawn as a mask from the status glyph set and hidden from assistive technology. Absent when hideIcon; holds the page’s own artwork when icon is passed."
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
93
|
"part": "content",
|
|
@@ -117,7 +117,7 @@
|
|
|
117
117
|
"part": "dismiss",
|
|
118
118
|
"element": "button",
|
|
119
119
|
"required": false,
|
|
120
|
-
"purpose": "Closes the message. Rendered when dismissible, named by the
|
|
120
|
+
"purpose": "Closes the message. Rendered when dismissible, named by the dismiss message, and sized from its glyph plus a step of air, floored at the WCAG 2.2 minimum target size so it holds at every density."
|
|
121
121
|
}
|
|
122
122
|
],
|
|
123
123
|
"api": [
|
|
@@ -126,84 +126,84 @@
|
|
|
126
126
|
"type": "'accent' | 'secondary' | 'info' | 'success' | 'warning' | 'danger'",
|
|
127
127
|
"defaultValue": "accent",
|
|
128
128
|
"appliesTo": "Alert",
|
|
129
|
-
"description": "Which of the
|
|
129
|
+
"description": "Which of the six tones the message speaks in, and which mark it draws: status-info for accent and info, none for secondary, status-success, status-warning, status-danger."
|
|
130
130
|
},
|
|
131
131
|
{
|
|
132
132
|
"name": "variant",
|
|
133
133
|
"type": "'soft' | 'outline' | 'solid'",
|
|
134
134
|
"defaultValue": "soft",
|
|
135
135
|
"appliesTo": "Alert",
|
|
136
|
-
"description": "How that color is painted. soft carries the tone’s surface and its border, outline the border alone, solid the tone’s fill and the ink the theme measures against it"
|
|
136
|
+
"description": "How that color is painted. soft carries the tone’s surface and its border, outline the border alone, solid the tone’s fill and the ink the theme measures against it."
|
|
137
137
|
},
|
|
138
138
|
{
|
|
139
139
|
"name": "reach",
|
|
140
140
|
"type": "'inline' | 'section' | 'page'",
|
|
141
141
|
"defaultValue": "section",
|
|
142
142
|
"appliesTo": "Alert",
|
|
143
|
-
"description": "The scope the message applies to. inline is tightest and sits beside a field group; page loses its corners and its inline edges because it runs to both edges of what holds it"
|
|
143
|
+
"description": "The scope the message applies to. inline is tightest and sits beside a field group; page loses its corners and its inline edges because it runs to both edges of what holds it."
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
"name": "live",
|
|
147
147
|
"type": "'off' | 'polite' | 'assertive'",
|
|
148
148
|
"defaultValue": "off",
|
|
149
149
|
"appliesTo": "Alert",
|
|
150
|
-
"description": "Whether the text announces itself. polite writes role=\"status\" on the content part and assertive writes role=\"alert\"; both imply aria-live and aria-atomic, and neither is written on the box"
|
|
150
|
+
"description": "Whether the text announces itself. polite writes role=\"status\" on the content part and assertive writes role=\"alert\"; both imply aria-live and aria-atomic, and neither is written on the box."
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
"name": "actionsPlacement",
|
|
154
154
|
"type": "'below' | 'end'",
|
|
155
155
|
"defaultValue": "end for reach='page', below otherwise",
|
|
156
156
|
"appliesTo": "Alert",
|
|
157
|
-
"description": "Where the actions stand. below puts them on a row under the words; end puts them at the end of the words’ line, before the dismiss control, once the box is 40rem wide, and under the words below that width"
|
|
157
|
+
"description": "Where the actions stand. below puts them on a row under the words; end puts them at the end of the words’ line, before the dismiss control, once the box is 40rem wide, and under the words below that width."
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
"name": "hideIcon",
|
|
161
161
|
"type": "boolean",
|
|
162
162
|
"defaultValue": "false",
|
|
163
163
|
"appliesTo": "Alert",
|
|
164
|
-
"description": "Draws no mark at all, for a callout that carries its own artwork in the body"
|
|
164
|
+
"description": "Draws no mark at all, for a callout that carries its own artwork in the body."
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
"name": "icon",
|
|
168
168
|
"type": "ReactNode",
|
|
169
169
|
"defaultValue": "—",
|
|
170
170
|
"appliesTo": "Alert",
|
|
171
|
-
"description": "Replaces the tone’s mark, keeping the box, the size and the place on the message’s first line. Angular projects an element carrying slAlertIcon instead"
|
|
171
|
+
"description": "Replaces the tone’s mark, keeping the box, the size and the place on the message’s first line. Angular projects an element carrying slAlertIcon instead."
|
|
172
172
|
},
|
|
173
173
|
{
|
|
174
174
|
"name": "dismissible",
|
|
175
175
|
"type": "boolean",
|
|
176
176
|
"defaultValue": "false",
|
|
177
177
|
"appliesTo": "Alert",
|
|
178
|
-
"description": "Renders the control that closes the message.
|
|
178
|
+
"description": "Renders the control that closes the message. Leave it off for a critical banner that must stay until the condition is resolved."
|
|
179
179
|
},
|
|
180
180
|
{
|
|
181
181
|
"name": "messages",
|
|
182
182
|
"type": "Partial<AlertMessages>",
|
|
183
183
|
"defaultValue": "—",
|
|
184
184
|
"appliesTo": "Alert",
|
|
185
|
-
"description": "Words laid over the language in force, key by key: what that control announces (dismiss)"
|
|
185
|
+
"description": "Words laid over the language in force, key by key: what that control announces (dismiss)."
|
|
186
186
|
},
|
|
187
187
|
{
|
|
188
188
|
"name": "open",
|
|
189
189
|
"type": "boolean",
|
|
190
190
|
"defaultValue": "—",
|
|
191
191
|
"appliesTo": "Alert",
|
|
192
|
-
"description": "The openness the consumer owns. Passing it puts the alert in controlled mode
|
|
192
|
+
"description": "The openness the consumer owns. Passing it puts the alert in controlled mode: the alert only requests changes and the consumer moves open."
|
|
193
193
|
},
|
|
194
194
|
{
|
|
195
195
|
"name": "defaultOpen",
|
|
196
196
|
"type": "boolean",
|
|
197
197
|
"defaultValue": "true",
|
|
198
198
|
"appliesTo": "Alert",
|
|
199
|
-
"description": "The openness an uncontrolled alert starts from, read once. A later change to it is not silently adopted"
|
|
199
|
+
"description": "The openness an uncontrolled alert starts from, read once. A later change to it is not silently adopted."
|
|
200
200
|
},
|
|
201
201
|
{
|
|
202
202
|
"name": "restoreFocus",
|
|
203
203
|
"type": "boolean",
|
|
204
204
|
"defaultValue": "true",
|
|
205
205
|
"appliesTo": "Alert",
|
|
206
|
-
"description": "Returns the keyboard to the element it came from when the message closes with focus inside it. Nothing moves when focus was never there"
|
|
206
|
+
"description": "Returns the keyboard to the element it came from when the message closes with focus inside it. Nothing moves when focus was never there."
|
|
207
207
|
}
|
|
208
208
|
],
|
|
209
209
|
"composition": [
|
|
@@ -212,28 +212,28 @@
|
|
|
212
212
|
"type": "(props) => ReactNode",
|
|
213
213
|
"defaultValue": "—",
|
|
214
214
|
"appliesTo": "Alert, AlertContent, AlertTitle, AlertDescription, AlertActions",
|
|
215
|
-
"description": "Substitutes the rendered element of a part, and hands it every data attribute. A title rendered as a heading is how a page puts the message in its outline"
|
|
215
|
+
"description": "Substitutes the rendered element of a part, and hands it every data attribute. A title rendered as a heading is how a page puts the message in its outline."
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
218
|
"name": "ref",
|
|
219
219
|
"type": "Ref<HTMLElement>",
|
|
220
220
|
"defaultValue": "—",
|
|
221
221
|
"appliesTo": "Alert",
|
|
222
|
-
"description": "Reaches the section, which carries tabindex=\"-1\" so focus() works. There is no imperative handle beyond it:
|
|
222
|
+
"description": "Reaches the section, which carries tabindex=\"-1\" so focus() works. There is no imperative handle beyond it: Alert never moves focus on its own, because the APG says an alert must not affect keyboard focus."
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"name": "AlertDefaultsProvider",
|
|
226
226
|
"type": "{ tone, variant, reach, live }",
|
|
227
227
|
"defaultValue": "—",
|
|
228
228
|
"appliesTo": "a subtree",
|
|
229
|
-
"description": "Sets all four once for every alert under it; an explicit prop on one message still wins"
|
|
229
|
+
"description": "Sets all four once for every alert under it; an explicit prop on one message still wins."
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
"name": "children",
|
|
233
233
|
"type": "ReactNode",
|
|
234
234
|
"defaultValue": "—",
|
|
235
235
|
"appliesTo": "AlertContent",
|
|
236
|
-
"description": "The title and the description. Anything else placed here joins the live region, which is why the actions are a part of their own"
|
|
236
|
+
"description": "The title and the description. Anything else placed here joins the live region, which is why the actions are a part of their own."
|
|
237
237
|
}
|
|
238
238
|
],
|
|
239
239
|
"events": [
|
|
@@ -244,12 +244,12 @@
|
|
|
244
244
|
}
|
|
245
245
|
],
|
|
246
246
|
"accessibility": [
|
|
247
|
-
"The applicable pattern is the WAI-ARIA APG Alert Pattern (w3.org/WAI/ARIA/apg/patterns/alert/). It declares one role and no keyboard interaction: an alert is not a widget, so it holds no keys. Its two prose requirements — that an alert must not affect keyboard focus, and must not disappear on its own — are
|
|
248
|
-
"The box is a landmark, not a live region. MDN’s alert role reference states that the role “should only be used for text content, not interactive elements such as links or buttons”, and
|
|
247
|
+
"The applicable pattern is the WAI-ARIA APG Alert Pattern (w3.org/WAI/ARIA/apg/patterns/alert/). It declares one role and no keyboard interaction: an alert is not a widget, so it holds no keys. Its two prose requirements — that an alert must not affect keyboard focus, and must not disappear on its own — are why Alert never moves focus and never dismisses itself.",
|
|
248
|
+
"The box is a landmark, not a live region. MDN’s alert role reference states that the role “should only be used for text content, not interactive elements such as links or buttons”, and an alert can carry a dismiss control and actions. The root renders a section named by its own title through aria-labelledby, and the region that announces is the content part, which holds the title and the description alone.",
|
|
249
249
|
"live defaults to off because the APG records that “screen readers do not inform users of alerts that are present on the page before page load completes”. An alert already on the page announces nothing whatever role it carries; polite and assertive are for a message that arrives while the reader is working, and both are written as a role that already implies aria-live and aria-atomic.",
|
|
250
|
-
"Every tone with a severity carries a mark as well as a color, and secondary carries none: a neutral note has no severity to state. Under forced colors the
|
|
251
|
-
"The dismiss control is a
|
|
252
|
-
"When the message closes with focus inside it, the keyboard goes back to the element it came from.
|
|
250
|
+
"Every tone with a severity carries a mark as well as a color, and secondary carries none: a neutral note has no severity to state. Under forced colors the grounds become one system color and the borders one more, so the mark, and its absence on a note, is the only thing distinguishing an error from a note — WCAG 2.2 1.4.1.",
|
|
251
|
+
"The dismiss control is a native button with an accessible name, not a Button: its box is the glyph plus a step of air on each side, floored at --slotted-target-min, which is the WCAG 2.2 2.5.8 minimum of 24 CSS pixels; at rest it has no frame and no ground, and hover moves only the ground.",
|
|
252
|
+
"When the message closes with focus inside it, the keyboard goes back to the element it came from. Without it, the dismiss control is hidden, focus falls to the document body, and the next Tab starts again at the top of the page.",
|
|
253
253
|
"Closing hides rather than unmounts, so the live region is still in the document if the message comes back and data-open is a state a consumer can style. An application that must not pay for the hidden subtree renders the alert conditionally and never passes defaultOpen.",
|
|
254
254
|
"Escape does not close the message. An alert is not a dismissable layer, and one inside a dialog would swallow the dialog’s own Escape; a message that must interrupt the reader is an alert dialog rather than an alert."
|
|
255
255
|
]
|
|
@@ -341,7 +341,7 @@
|
|
|
341
341
|
{
|
|
342
342
|
"id": "playground",
|
|
343
343
|
"title": "Playground",
|
|
344
|
-
"note": "One message with every axis on it, driven by the controls below the canvas. Change the tone and the mark changes with it,
|
|
344
|
+
"note": "One message with every axis on it, driven by the controls below the canvas. Change the tone and the mark changes with it, so a tone is not carried by color alone.",
|
|
345
345
|
"language": "tsx",
|
|
346
346
|
"source": "<Alert tone=\"warning\">\n <AlertContent>\n <AlertTitle>Your subscription expires in three days</AlertTitle>\n <AlertDescription>Renew to keep access for your team.</AlertDescription>\n </AlertContent>\n</Alert>;\n",
|
|
347
347
|
"verdict": "excerpt"
|
|
@@ -349,26 +349,26 @@
|
|
|
349
349
|
{
|
|
350
350
|
"id": "tones",
|
|
351
351
|
"title": "What the message is about",
|
|
352
|
-
"note": "
|
|
352
|
+
"note": "Six tones and four marks: accent and info share the information mark, and secondary draws none. The mark states the severity without color, in grayscale and under forced colors (WCAG 2.2, 1.4.1).",
|
|
353
353
|
"language": "tsx",
|
|
354
|
-
"source": "
|
|
355
|
-
"verdict": "
|
|
354
|
+
"source": "import { Alert, AlertContent, AlertTitle } from '@slotted/react/alert';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function AlertTones() {\n return (\n <Stack gap={3}>\n <Alert tone=\"accent\">\n <AlertContent>\n <AlertTitle>Cycle count starts Monday</AlertTitle>\n </AlertContent>\n </Alert>\n <Alert tone=\"secondary\">\n <AlertContent>\n <AlertTitle>Carrier rates exclude tax</AlertTitle>\n </AlertContent>\n </Alert>\n <Alert tone=\"info\">\n <AlertContent>\n <AlertTitle>Reorder points were recalculated</AlertTitle>\n </AlertContent>\n </Alert>\n <Alert tone=\"success\">\n <AlertContent>\n <AlertTitle>Invoice INV-2041 was sent</AlertTitle>\n </AlertContent>\n </Alert>\n <Alert tone=\"warning\">\n <AlertContent>\n <AlertTitle>Three shipments miss the pickup window</AlertTitle>\n </AlertContent>\n </Alert>\n <Alert tone=\"danger\">\n <AlertContent>\n <AlertTitle>Payment to Harbor Freight failed</AlertTitle>\n </AlertContent>\n </Alert>\n </Stack>\n );\n}\n",
|
|
355
|
+
"verdict": "example"
|
|
356
356
|
},
|
|
357
357
|
{
|
|
358
358
|
"id": "variants",
|
|
359
359
|
"title": "How that tone is painted",
|
|
360
360
|
"note": "soft and solid bring a ground with them and survive any surface; outline takes the one underneath, so it reads on the page’s own surfaces and goes quiet on a ground the theme never measured its ink against.",
|
|
361
361
|
"language": "tsx",
|
|
362
|
-
"source": "<Alert variant=\"soft\"
|
|
363
|
-
"verdict": "
|
|
362
|
+
"source": "import { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function AlertVariants() {\n return (\n <Stack gap={3}>\n <Alert tone=\"warning\" variant=\"soft\">\n <AlertContent>\n <AlertTitle>Soft</AlertTitle>\n <AlertDescription>Inventory sync is 40 minutes behind.</AlertDescription>\n </AlertContent>\n </Alert>\n <Alert tone=\"warning\" variant=\"outline\">\n <AlertContent>\n <AlertTitle>Outline</AlertTitle>\n <AlertDescription>Inventory sync is 40 minutes behind.</AlertDescription>\n </AlertContent>\n </Alert>\n <Alert tone=\"warning\" variant=\"solid\">\n <AlertContent>\n <AlertTitle>Solid</AlertTitle>\n <AlertDescription>Inventory sync is 40 minutes behind.</AlertDescription>\n </AlertContent>\n </Alert>\n </Stack>\n );\n}\n",
|
|
363
|
+
"verdict": "example"
|
|
364
364
|
},
|
|
365
365
|
{
|
|
366
366
|
"id": "reach",
|
|
367
367
|
"title": "How far the message reaches",
|
|
368
368
|
"note": "The guide’s three recipes as one axis: inline beside the thing it is about, section inside a page section, page across an application. A page banner loses its corners because it runs to both edges.",
|
|
369
369
|
"language": "tsx",
|
|
370
|
-
"source": "<Alert reach=\"inline\" tone=\"danger\">\n
|
|
371
|
-
"verdict": "
|
|
370
|
+
"source": "import { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function AlertReach() {\n return (\n <Stack gap={4}>\n <Alert reach=\"inline\" tone=\"danger\">\n <AlertContent>\n <AlertDescription>Enter a valid EIN, such as 12-3456789.</AlertDescription>\n </AlertContent>\n </Alert>\n <Alert reach=\"section\" tone=\"warning\">\n <AlertContent>\n <AlertTitle>Billing address is incomplete</AlertTitle>\n <AlertDescription>\n Add a postal code before Northwind can issue invoices.\n </AlertDescription>\n </AlertContent>\n </Alert>\n <Alert reach=\"page\" tone=\"info\">\n <AlertContent>\n <AlertTitle>Scheduled maintenance on Saturday from 1:00 AM to 3:00 AM</AlertTitle>\n </AlertContent>\n </Alert>\n </Stack>\n );\n}\n",
|
|
371
|
+
"verdict": "example"
|
|
372
372
|
},
|
|
373
373
|
{
|
|
374
374
|
"id": "dismissal",
|
|
@@ -383,24 +383,24 @@
|
|
|
383
383
|
"title": "What the message asks for",
|
|
384
384
|
"note": "The controls are the consumer’s own Buttons, in a part outside the live region — a reader hearing the message is not read two button labels in the middle of it. They stack when the box is narrow. actionsPlacement=\"end\" puts them at the end of the message’s own line once the box is 40rem wide, which a page banner does by default. Each Button in the part takes the alert’s tone and the sm size; a Button that states its own tone or size keeps it. The first action is solid and every other one ghost; outline draws no fill over the alert’s ground and is not used here.",
|
|
385
385
|
"language": "tsx",
|
|
386
|
-
"source": "<Alert tone=\"warning\">\n
|
|
387
|
-
"verdict": "
|
|
386
|
+
"source": "import {\n Alert,\n AlertActions,\n AlertContent,\n AlertDescription,\n AlertTitle,\n} from '@slotted/react/alert';\nimport { Button } from '@slotted/react/button';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function AlertActionsExample() {\n return (\n <Stack gap={4}>\n <Alert tone=\"warning\">\n <AlertContent>\n <AlertTitle>Your Northwind plan renews in three days</AlertTitle>\n </AlertContent>\n <AlertActions>\n <Button>Renew now</Button>\n <Button variant=\"ghost\">View plans</Button>\n </AlertActions>\n </Alert>\n <Alert actionsPlacement=\"end\" tone=\"info\">\n <AlertContent>\n <AlertDescription>\n The suggestion changes three lines of purchase order PO-7712.\n </AlertDescription>\n </AlertContent>\n <AlertActions>\n <Button>Apply</Button>\n </AlertActions>\n </Alert>\n <Alert reach=\"page\" tone=\"danger\">\n <AlertContent>\n <AlertTitle>Payments are paused for the Rotterdam warehouse</AlertTitle>\n </AlertContent>\n <AlertActions>\n <Button>Resolve</Button>\n </AlertActions>\n </Alert>\n </Stack>\n );\n}\n",
|
|
387
|
+
"verdict": "example"
|
|
388
388
|
},
|
|
389
389
|
{
|
|
390
390
|
"id": "live",
|
|
391
391
|
"title": "What a reader hears, and when",
|
|
392
392
|
"note": "off by default, because the APG records that alerts already on the page when it loads are not announced at all. Press the button and the message arrives while the reader is elsewhere, which is what polite and assertive are for.",
|
|
393
393
|
"language": "tsx",
|
|
394
|
-
"source": "
|
|
395
|
-
"verdict": "
|
|
394
|
+
"source": "import { useState } from 'react';\n\nimport { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\n\ntype Status = 'failed' | 'idle' | 'saved';\n\nexport default function AlertLive() {\n const [status, setStatus] = useState<Status>('idle');\n\n return (\n <Stack gap={4}>\n <Inline gap={2}>\n <Button onClick={() => setStatus('saved')} variant=\"outline\">\n Save prices\n </Button>\n <Button onClick={() => setStatus('failed')} variant=\"outline\">\n Lose connection\n </Button>\n </Inline>\n {status === 'saved' && (\n <Alert live=\"polite\" tone=\"success\">\n <AlertContent>\n <AlertTitle>Prices saved</AlertTitle>\n <AlertDescription>Changes to 214 products are live.</AlertDescription>\n </AlertContent>\n </Alert>\n )}\n {status === 'failed' && (\n <Alert live=\"assertive\" tone=\"danger\">\n <AlertContent>\n <AlertTitle>Connection lost</AlertTitle>\n <AlertDescription>Price changes are not being saved.</AlertDescription>\n </AlertContent>\n </Alert>\n )}\n </Stack>\n );\n}\n",
|
|
395
|
+
"verdict": "example"
|
|
396
396
|
},
|
|
397
397
|
{
|
|
398
398
|
"id": "content",
|
|
399
399
|
"title": "Content the family did not choose",
|
|
400
400
|
"note": "A German compound that wraps, a container digest with no break opportunity, a message with no mark, and a title standing alone — all in a column narrow enough to make each of them a problem.",
|
|
401
401
|
"language": "tsx",
|
|
402
|
-
"source": "<Alert
|
|
403
|
-
"verdict": "
|
|
402
|
+
"source": "import { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function AlertContentExample() {\n return (\n <Stack gap={3}>\n <Alert tone=\"danger\">\n <AlertContent>\n <AlertTitle>Deploy failed</AlertTitle>\n <AlertDescription>\n Image sha256:9f2c1ab4e0d37c58b1e6a7d94f03c2b85a1d6e7f4039bc82e15d7a60f3b9c418 was not\n found in the registry.\n </AlertDescription>\n </AlertContent>\n </Alert>\n <Alert hideIcon tone=\"warning\">\n <AlertContent>\n <AlertTitle>Recount required</AlertTitle>\n <AlertDescription>Aisle 14 differs from the system by 3.2%.</AlertDescription>\n </AlertContent>\n </Alert>\n <Alert tone=\"success\">\n <AlertContent>\n <AlertTitle>Pickup confirmed</AlertTitle>\n </AlertContent>\n </Alert>\n <Alert tone=\"info\">\n <AlertContent>\n <AlertDescription>Rates were updated this morning.</AlertDescription>\n </AlertContent>\n </Alert>\n </Stack>\n );\n}\n",
|
|
403
|
+
"verdict": "example"
|
|
404
404
|
},
|
|
405
405
|
{
|
|
406
406
|
"id": "composition",
|
|
@@ -417,6 +417,54 @@
|
|
|
417
417
|
"language": "tsx",
|
|
418
418
|
"source": "// A region landmark named \"Maintenance\", holding a polite status region.\n<Alert live=\"polite\">\n <AlertContent>\n <AlertTitle>Maintenance</AlertTitle>\n </AlertContent>\n</Alert>;\n\n// No title: a plain grouping element, and no landmark to jump to.\n<Alert>\n <AlertContent>Done.</AlertContent>\n</Alert>;\n",
|
|
419
419
|
"verdict": "excerpt"
|
|
420
|
+
},
|
|
421
|
+
{
|
|
422
|
+
"id": "basic",
|
|
423
|
+
"title": "basic.tsx",
|
|
424
|
+
"note": null,
|
|
425
|
+
"language": "tsx",
|
|
426
|
+
"source": "import { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';\n\nexport default function AlertBasic() {\n return (\n <Alert>\n <AlertContent>\n <AlertTitle>Spring price list is live</AlertTitle>\n <AlertDescription>\n The new prices took effect for 1,240 products at 6:00 AM.\n </AlertDescription>\n </AlertContent>\n </Alert>\n );\n}\n",
|
|
427
|
+
"verdict": "example"
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
"id": "controlled",
|
|
431
|
+
"title": "controlled.tsx",
|
|
432
|
+
"note": null,
|
|
433
|
+
"language": "tsx",
|
|
434
|
+
"source": "import { useState } from 'react';\n\nimport { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function AlertControlled() {\n const [open, setOpen] = useState(true);\n\n return (\n <Stack gap={4}>\n <Inline>\n <Button disabled={open} onClick={() => setOpen(true)} variant=\"outline\">\n Show import summary\n </Button>\n </Inline>\n <Alert dismissible onOpenChange={setOpen} open={open} tone=\"success\">\n <AlertContent>\n <AlertTitle>Import finished</AlertTitle>\n <AlertDescription>412 of 415 rows were added to the catalog.</AlertDescription>\n </AlertContent>\n </Alert>\n </Stack>\n );\n}\n",
|
|
435
|
+
"verdict": "example"
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
"id": "defaults",
|
|
439
|
+
"title": "defaults.tsx",
|
|
440
|
+
"note": null,
|
|
441
|
+
"language": "tsx",
|
|
442
|
+
"source": "import { Alert, AlertContent, AlertDefaultsProvider, AlertTitle } from '@slotted/react/alert';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function AlertDefaults() {\n return (\n <AlertDefaultsProvider reach=\"inline\" tone=\"warning\" variant=\"outline\">\n <Stack gap={3}>\n <Alert>\n <AlertContent>\n <AlertTitle>Low stock: Oak desk, 4 left</AlertTitle>\n </AlertContent>\n </Alert>\n <Alert>\n <AlertContent>\n <AlertTitle>Low stock: Desk lamp, 7 left</AlertTitle>\n </AlertContent>\n </Alert>\n <Alert tone=\"danger\">\n <AlertContent>\n <AlertTitle>Out of stock: Task chair</AlertTitle>\n </AlertContent>\n </Alert>\n </Stack>\n </AlertDefaultsProvider>\n );\n}\n",
|
|
443
|
+
"verdict": "example"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
"id": "dismissible",
|
|
447
|
+
"title": "dismissible.tsx",
|
|
448
|
+
"note": null,
|
|
449
|
+
"language": "tsx",
|
|
450
|
+
"source": "import { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\n\nexport default function AlertDismissible() {\n return (\n <Stack gap={4}>\n <Inline>\n <Button variant=\"outline\">Export report</Button>\n </Inline>\n <Alert dismissible tone=\"info\">\n <AlertContent>\n <AlertTitle>Carrier tracking links expire in 14 days</AlertTitle>\n <AlertDescription>Download the shipment manifests you still need.</AlertDescription>\n </AlertContent>\n </Alert>\n </Stack>\n );\n}\n",
|
|
451
|
+
"verdict": "example"
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
"id": "markup",
|
|
455
|
+
"title": "markup.tsx",
|
|
456
|
+
"note": null,
|
|
457
|
+
"language": "tsx",
|
|
458
|
+
"source": "import { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';\nimport { Glyph, Icon } from '@slotted/react/icon';\n\nexport default function AlertMarkup() {\n return (\n <Alert\n icon={\n <Icon>\n <Glyph name=\"calendar\" />\n </Icon>\n }\n reach=\"page\"\n tone=\"secondary\"\n >\n <AlertContent>\n <AlertTitle render={(props) => <h3 {...props} />}>Rotterdam warehouse is closed</AlertTitle>\n <AlertDescription>Orders ship from Antwerp until Monday.</AlertDescription>\n </AlertContent>\n </Alert>\n );\n}\n",
|
|
459
|
+
"verdict": "example"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
"id": "refusal",
|
|
463
|
+
"title": "refusal.tsx",
|
|
464
|
+
"note": null,
|
|
465
|
+
"language": "tsx",
|
|
466
|
+
"source": "import { useState } from 'react';\n\nimport { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';\nimport { Stack } from '@slotted/react/stack';\nimport { Switch } from '@slotted/react/switch';\n\nexport default function AlertRefusal() {\n const [reviewed, setReviewed] = useState(false);\n\n return (\n <Stack gap={4}>\n <Switch checked={reviewed} onCheckedChange={setReviewed}>\n I reviewed the 12 price changes\n </Switch>\n <Alert\n dismissible\n onOpenChange={(_, request) => {\n if (!reviewed) request.cancel();\n }}\n tone=\"warning\"\n >\n <AlertContent>\n <AlertTitle>12 price changes are waiting for approval</AlertTitle>\n <AlertDescription>The message stays until the changes are reviewed.</AlertDescription>\n </AlertContent>\n </Alert>\n </Stack>\n );\n}\n",
|
|
467
|
+
"verdict": "example"
|
|
420
468
|
}
|
|
421
469
|
]
|
|
422
470
|
}
|
package/dist/docs/alert.md
CHANGED
|
@@ -18,15 +18,23 @@ import {
|
|
|
18
18
|
|
|
19
19
|
## Minimal example
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
Example
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
import { Alert, AlertContent, AlertDescription, AlertTitle } from '@slotted/react/alert';
|
|
25
|
+
|
|
26
|
+
export default function AlertBasic() {
|
|
27
|
+
return (
|
|
28
|
+
<Alert>
|
|
29
|
+
<AlertContent>
|
|
30
|
+
<AlertTitle>Spring price list is live</AlertTitle>
|
|
31
|
+
<AlertDescription>
|
|
32
|
+
The new prices took effect for 1,240 products at 6:00 AM.
|
|
33
|
+
</AlertDescription>
|
|
34
|
+
</AlertContent>
|
|
35
|
+
</Alert>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
30
38
|
```
|
|
31
39
|
|
|
32
40
|
## Anatomy
|
|
@@ -45,22 +53,22 @@ Excerpt — not a complete module
|
|
|
45
53
|
|
|
46
54
|
| Name | Type | Default | Applies to | Description |
|
|
47
55
|
| --- | --- | --- | --- | --- |
|
|
48
|
-
| `tone` | `'accent' \| 'secondary' \| 'info' \| 'success' \| 'warning' \| 'danger'` | accent | Alert | Which of the
|
|
49
|
-
| `variant` | `'soft' \| 'outline' \| 'solid'` | soft | Alert | How that color is painted. soft carries the tone’s surface and its border, outline the border alone, solid the tone’s fill and the ink the theme measures against it |
|
|
50
|
-
| `reach` | `'inline' \| 'section' \| 'page'` | section | Alert | The scope the message applies to. inline is tightest and sits beside a field group; page loses its corners and its inline edges because it runs to both edges of what holds it |
|
|
51
|
-
| `live` | `'off' \| 'polite' \| 'assertive'` | off | Alert | Whether the text announces itself. polite writes role="status" on the content part and assertive writes role="alert"; both imply aria-live and aria-atomic, and neither is written on the box |
|
|
52
|
-
| `actionsPlacement` | `'below' \| 'end'` | end for reach='page', below otherwise | Alert | Where the actions stand. below puts them on a row under the words; end puts them at the end of the words’ line, before the dismiss control, once the box is 40rem wide, and under the words below that width |
|
|
53
|
-
| `hideIcon` | `boolean` | false | Alert | Draws no mark at all, for a callout that carries its own artwork in the body |
|
|
54
|
-
| `icon` | `ReactNode` | — | Alert | Replaces the tone’s mark, keeping the box, the size and the place on the message’s first line. Angular projects an element carrying slAlertIcon instead |
|
|
55
|
-
| `dismissible` | `boolean` | false | Alert | Renders the control that closes the message.
|
|
56
|
-
| `messages` | `Partial<AlertMessages>` | — | Alert | Words laid over the language in force, key by key: what that control announces (dismiss) |
|
|
57
|
-
| `open` | `boolean` | — | Alert | The openness the consumer owns. Passing it puts the alert in controlled mode
|
|
58
|
-
| `defaultOpen` | `boolean` | true | Alert | The openness an uncontrolled alert starts from, read once. A later change to it is not silently adopted |
|
|
59
|
-
| `restoreFocus` | `boolean` | true | Alert | Returns the keyboard to the element it came from when the message closes with focus inside it. Nothing moves when focus was never there |
|
|
60
|
-
| `render` | `(props) => ReactNode` | — | Alert, AlertContent, AlertTitle, AlertDescription, AlertActions | Substitutes the rendered element of a part, and hands it every data attribute. A title rendered as a heading is how a page puts the message in its outline |
|
|
61
|
-
| `ref` | `Ref<HTMLElement>` | — | Alert | Reaches the section, which carries tabindex="-1" so focus() works. There is no imperative handle beyond it:
|
|
62
|
-
| `AlertDefaultsProvider` | `{ tone, variant, reach, live }` | — | a subtree | Sets all four once for every alert under it; an explicit prop on one message still wins |
|
|
63
|
-
| `children` | `ReactNode` | — | AlertContent | The title and the description. Anything else placed here joins the live region, which is why the actions are a part of their own |
|
|
56
|
+
| `tone` | `'accent' \| 'secondary' \| 'info' \| 'success' \| 'warning' \| 'danger'` | accent | Alert | Which of the six tones the message speaks in, and which mark it draws: status-info for accent and info, none for secondary, status-success, status-warning, status-danger. |
|
|
57
|
+
| `variant` | `'soft' \| 'outline' \| 'solid'` | soft | Alert | How that color is painted. soft carries the tone’s surface and its border, outline the border alone, solid the tone’s fill and the ink the theme measures against it. |
|
|
58
|
+
| `reach` | `'inline' \| 'section' \| 'page'` | section | Alert | The scope the message applies to. inline is tightest and sits beside a field group; page loses its corners and its inline edges because it runs to both edges of what holds it. |
|
|
59
|
+
| `live` | `'off' \| 'polite' \| 'assertive'` | off | Alert | Whether the text announces itself. polite writes role="status" on the content part and assertive writes role="alert"; both imply aria-live and aria-atomic, and neither is written on the box. |
|
|
60
|
+
| `actionsPlacement` | `'below' \| 'end'` | end for reach='page', below otherwise | Alert | Where the actions stand. below puts them on a row under the words; end puts them at the end of the words’ line, before the dismiss control, once the box is 40rem wide, and under the words below that width. |
|
|
61
|
+
| `hideIcon` | `boolean` | false | Alert | Draws no mark at all, for a callout that carries its own artwork in the body. |
|
|
62
|
+
| `icon` | `ReactNode` | — | Alert | Replaces the tone’s mark, keeping the box, the size and the place on the message’s first line. Angular projects an element carrying slAlertIcon instead. |
|
|
63
|
+
| `dismissible` | `boolean` | false | Alert | Renders the control that closes the message. Leave it off for a critical banner that must stay until the condition is resolved. |
|
|
64
|
+
| `messages` | `Partial<AlertMessages>` | — | Alert | Words laid over the language in force, key by key: what that control announces (dismiss). |
|
|
65
|
+
| `open` | `boolean` | — | Alert | The openness the consumer owns. Passing it puts the alert in controlled mode: the alert only requests changes and the consumer moves open. |
|
|
66
|
+
| `defaultOpen` | `boolean` | true | Alert | The openness an uncontrolled alert starts from, read once. A later change to it is not silently adopted. |
|
|
67
|
+
| `restoreFocus` | `boolean` | true | Alert | Returns the keyboard to the element it came from when the message closes with focus inside it. Nothing moves when focus was never there. |
|
|
68
|
+
| `render` | `(props) => ReactNode` | — | Alert, AlertContent, AlertTitle, AlertDescription, AlertActions | Substitutes the rendered element of a part, and hands it every data attribute. A title rendered as a heading is how a page puts the message in its outline. |
|
|
69
|
+
| `ref` | `Ref<HTMLElement>` | — | Alert | Reaches the section, which carries tabindex="-1" so focus() works. There is no imperative handle beyond it: Alert never moves focus on its own, because the APG says an alert must not affect keyboard focus. |
|
|
70
|
+
| `AlertDefaultsProvider` | `{ tone, variant, reach, live }` | — | a subtree | Sets all four once for every alert under it; an explicit prop on one message still wins. |
|
|
71
|
+
| `children` | `ReactNode` | — | AlertContent | The title and the description. Anything else placed here joins the live region, which is why the actions are a part of their own. |
|
|
64
72
|
|
|
65
73
|
## Events
|
|
66
74
|
|
|
@@ -80,12 +88,12 @@ Excerpt — not a complete module
|
|
|
80
88
|
|
|
81
89
|
## Rules
|
|
82
90
|
|
|
83
|
-
- The applicable pattern is the WAI-ARIA APG Alert Pattern (w3.org/WAI/ARIA/apg/patterns/alert/). It declares one role and no keyboard interaction: an alert is not a widget, so it holds no keys. Its two prose requirements — that an alert must not affect keyboard focus, and must not disappear on its own — are
|
|
84
|
-
- The box is a landmark, not a live region. MDN’s alert role reference states that the role “should only be used for text content, not interactive elements such as links or buttons”, and
|
|
91
|
+
- The applicable pattern is the WAI-ARIA APG Alert Pattern (w3.org/WAI/ARIA/apg/patterns/alert/). It declares one role and no keyboard interaction: an alert is not a widget, so it holds no keys. Its two prose requirements — that an alert must not affect keyboard focus, and must not disappear on its own — are why Alert never moves focus and never dismisses itself.
|
|
92
|
+
- The box is a landmark, not a live region. MDN’s alert role reference states that the role “should only be used for text content, not interactive elements such as links or buttons”, and an alert can carry a dismiss control and actions. The root renders a section named by its own title through aria-labelledby, and the region that announces is the content part, which holds the title and the description alone.
|
|
85
93
|
- live defaults to off because the APG records that “screen readers do not inform users of alerts that are present on the page before page load completes”. An alert already on the page announces nothing whatever role it carries; polite and assertive are for a message that arrives while the reader is working, and both are written as a role that already implies aria-live and aria-atomic.
|
|
86
|
-
- Every tone with a severity carries a mark as well as a color, and secondary carries none: a neutral note has no severity to state. Under forced colors the
|
|
87
|
-
- The dismiss control is a
|
|
88
|
-
- When the message closes with focus inside it, the keyboard goes back to the element it came from.
|
|
94
|
+
- Every tone with a severity carries a mark as well as a color, and secondary carries none: a neutral note has no severity to state. Under forced colors the grounds become one system color and the borders one more, so the mark, and its absence on a note, is the only thing distinguishing an error from a note — WCAG 2.2 1.4.1.
|
|
95
|
+
- The dismiss control is a native button with an accessible name, not a Button: its box is the glyph plus a step of air on each side, floored at --slotted-target-min, which is the WCAG 2.2 2.5.8 minimum of 24 CSS pixels; at rest it has no frame and no ground, and hover moves only the ground.
|
|
96
|
+
- When the message closes with focus inside it, the keyboard goes back to the element it came from. Without it, the dismiss control is hidden, focus falls to the document body, and the next Tab starts again at the top of the page.
|
|
89
97
|
- Closing hides rather than unmounts, so the live region is still in the document if the message comes back and data-open is a state a consumer can style. An application that must not pay for the hidden subtree renders the alert conditionally and never passes defaultOpen.
|
|
90
98
|
- Escape does not close the message. An alert is not a dismissable layer, and one inside a dialog would swallow the dialog’s own Escape; a message that must interrupt the reader is an alert dialog rather than an alert.
|
|
91
99
|
|
|
@@ -95,164 +103,4 @@ Excerpt — not a complete module
|
|
|
95
103
|
|
|
96
104
|
## Examples
|
|
97
105
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
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.
|
|
101
|
-
|
|
102
|
-
Excerpt — not a complete module
|
|
103
|
-
|
|
104
|
-
```tsx
|
|
105
|
-
// accent is information, secondary a neutral note, success something
|
|
106
|
-
// finished, warning something that needs attention, danger something failed.
|
|
107
|
-
<Alert tone="danger">
|
|
108
|
-
<AlertContent>
|
|
109
|
-
<AlertTitle>Could not save</AlertTitle>
|
|
110
|
-
</AlertContent>
|
|
111
|
-
</Alert>;
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### How that tone is painted
|
|
115
|
-
|
|
116
|
-
soft and solid bring a ground with them and survive any surface; outline takes the one underneath, so it reads on the page’s own surfaces and goes quiet on a ground the theme never measured its ink against.
|
|
117
|
-
|
|
118
|
-
Excerpt — not a complete module
|
|
119
|
-
|
|
120
|
-
```tsx
|
|
121
|
-
<Alert variant="soft" />;
|
|
122
|
-
<Alert variant="outline" />;
|
|
123
|
-
<Alert variant="solid" />;
|
|
124
|
-
|
|
125
|
-
// A dark region is a scheme rather than a surface.
|
|
126
|
-
<div data-slotted-scheme="dark">
|
|
127
|
-
<Alert variant="outline" />
|
|
128
|
-
</div>;
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### How far the message reaches
|
|
132
|
-
|
|
133
|
-
The guide’s three recipes as one axis: inline beside the thing it is about, section inside a page section, page across an application. A page banner loses its corners because it runs to both edges.
|
|
134
|
-
|
|
135
|
-
Excerpt — not a complete module
|
|
136
|
-
|
|
137
|
-
```tsx
|
|
138
|
-
<Alert reach="inline" tone="danger">
|
|
139
|
-
<AlertContent>
|
|
140
|
-
<AlertDescription>Enter a valid EIN.</AlertDescription>
|
|
141
|
-
</AlertContent>
|
|
142
|
-
</Alert>;
|
|
143
|
-
|
|
144
|
-
<Alert reach="page" tone="warning" />;
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
### Putting the message away
|
|
148
|
-
|
|
149
|
-
The left one owns its own openness and needs no state at all; the right one hands it to the application, which can refuse the request. Watch where the keyboard lands after either of them closes.
|
|
150
|
-
|
|
151
|
-
Excerpt — not a complete module
|
|
152
|
-
|
|
153
|
-
```tsx
|
|
154
|
-
<Alert dismissible />;
|
|
155
|
-
|
|
156
|
-
<Alert dismissible onOpenChange={setOpen} open={open} />;
|
|
157
|
-
|
|
158
|
-
<Alert
|
|
159
|
-
dismissible
|
|
160
|
-
onOpenChange={(next, request) => {
|
|
161
|
-
if (!confirmed) request.cancel();
|
|
162
|
-
}}
|
|
163
|
-
/>;
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### What the message asks for
|
|
167
|
-
|
|
168
|
-
The controls are the consumer’s own Buttons, in a part outside the live region — a reader hearing the message is not read two button labels in the middle of it. They stack when the box is narrow. actionsPlacement="end" puts them at the end of the message’s own line once the box is 40rem wide, which a page banner does by default. Each Button in the part takes the alert’s tone and the sm size; a Button that states its own tone or size keeps it. The first action is solid and every other one ghost; outline draws no fill over the alert’s ground and is not used here.
|
|
169
|
-
|
|
170
|
-
Excerpt — not a complete module
|
|
171
|
-
|
|
172
|
-
```tsx
|
|
173
|
-
<Alert tone="warning">
|
|
174
|
-
<AlertContent>
|
|
175
|
-
<AlertTitle>Your subscription expires in three days</AlertTitle>
|
|
176
|
-
</AlertContent>
|
|
177
|
-
<AlertActions>
|
|
178
|
-
<Button>Renew</Button>
|
|
179
|
-
<Button variant="ghost">View plans</Button>
|
|
180
|
-
</AlertActions>
|
|
181
|
-
</Alert>;
|
|
182
|
-
|
|
183
|
-
<Alert actionsPlacement="end">
|
|
184
|
-
<AlertContent>
|
|
185
|
-
<AlertDescription>The suggestion changes three lines of the plan.</AlertDescription>
|
|
186
|
-
</AlertContent>
|
|
187
|
-
<AlertActions>
|
|
188
|
-
<Button>Apply</Button>
|
|
189
|
-
</AlertActions>
|
|
190
|
-
</Alert>;
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### What a reader hears, and when
|
|
194
|
-
|
|
195
|
-
off by default, because the APG records that alerts already on the page when it loads are not announced at all. Press the button and the message arrives while the reader is elsewhere, which is what polite and assertive are for.
|
|
196
|
-
|
|
197
|
-
Excerpt — not a complete module
|
|
198
|
-
|
|
199
|
-
```tsx
|
|
200
|
-
// role="status" on the text, which implies aria-live and aria-atomic.
|
|
201
|
-
<Alert live="polite" tone="success" />;
|
|
202
|
-
|
|
203
|
-
// role="alert": a failed save, a lost connection, an expiring session.
|
|
204
|
-
<Alert live="assertive" tone="danger" />;
|
|
205
|
-
```
|
|
206
|
-
|
|
207
|
-
### Content the family did not choose
|
|
208
|
-
|
|
209
|
-
A German compound that wraps, a container digest with no break opportunity, a message with no mark, and a title standing alone — all in a column narrow enough to make each of them a problem.
|
|
210
|
-
|
|
211
|
-
Excerpt — not a complete module
|
|
212
|
-
|
|
213
|
-
```tsx
|
|
214
|
-
<Alert hideIcon>
|
|
215
|
-
<AlertContent>
|
|
216
|
-
<AlertTitle>O deploy falhou</AlertTitle>
|
|
217
|
-
<AlertDescription>{digest}</AlertDescription>
|
|
218
|
-
</AlertContent>
|
|
219
|
-
</Alert>;
|
|
220
|
-
```
|
|
221
|
-
|
|
222
|
-
### Composition and escape hatches
|
|
223
|
-
|
|
224
|
-
The provider sets the defaults once, render substitutes the element of any part, icon replaces the mark, and ref reaches the section so a page that must move focus to the message can.
|
|
225
|
-
|
|
226
|
-
Excerpt — not a complete module
|
|
227
|
-
|
|
228
|
-
```tsx
|
|
229
|
-
<AlertDefaultsProvider reach="page">
|
|
230
|
-
<App />
|
|
231
|
-
</AlertDefaultsProvider>;
|
|
232
|
-
|
|
233
|
-
<Alert icon={<ShieldIcon />} render={(props) => <aside {...props} />}>
|
|
234
|
-
<AlertContent>
|
|
235
|
-
<AlertTitle render={(props) => <h3 {...props} />}>Maintenance</AlertTitle>
|
|
236
|
-
</AlertContent>
|
|
237
|
-
</Alert>;
|
|
238
|
-
```
|
|
239
|
-
|
|
240
|
-
### The landmark, the region and the keyboard
|
|
241
|
-
|
|
242
|
-
Tab into the message and out of it: the box is a region a reader can jump to, the text is the only thing that announces, and closing the message puts the keyboard back where it came from.
|
|
243
|
-
|
|
244
|
-
Excerpt — not a complete module
|
|
245
|
-
|
|
246
|
-
```tsx
|
|
247
|
-
// A region landmark named "Maintenance", holding a polite status region.
|
|
248
|
-
<Alert live="polite">
|
|
249
|
-
<AlertContent>
|
|
250
|
-
<AlertTitle>Maintenance</AlertTitle>
|
|
251
|
-
</AlertContent>
|
|
252
|
-
</Alert>;
|
|
253
|
-
|
|
254
|
-
// No title: a plain grouping element, and no landmark to jump to.
|
|
255
|
-
<Alert>
|
|
256
|
-
<AlertContent>Done.</AlertContent>
|
|
257
|
-
</Alert>;
|
|
258
|
-
```
|
|
106
|
+
See [alert.examples.md](./alert.examples.md).
|