@slotted/react 0.1.0-beta.41 → 0.1.0-beta.42
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/{accordion-n5D6mcmS.js → accordion-xW-aFeGb.js} +1 -1
- package/dist/accordion.js +1 -1
- package/dist/{action-bar-Cq4dt4hP.js → action-bar-BSUuY6pJ.js} +1 -1
- package/dist/action-bar.js +1 -1
- package/dist/{action-sheet-dNnB26br.js → action-sheet-BouG2qh_.js} +1 -1
- package/dist/action-sheet.js +1 -1
- package/dist/{app-shell-DyPHYe4K.js → app-shell-D54YkU7E.js} +126 -110
- package/dist/app-shell.js +2 -2
- package/dist/{calendar-DRuJ7z0H.js → calendar-YQ784o4d.js} +139 -123
- package/dist/calendar.js +1 -1
- package/dist/{cascader-CivJ76VR.js → cascader-fq8fNWSr.js} +1 -1
- package/dist/cascader.js +1 -1
- package/dist/{chart-CgXbG6gZ.js → chart-vedR0BDN.js} +1 -1
- package/dist/chart.js +1 -1
- package/dist/{checkbox-D3E4gzMe.js → checkbox-DsJhlB5c.js} +3 -3
- package/dist/{checkbox-group-Dg5YN3fx.js → checkbox-group-pvX9R_yS.js} +2 -2
- package/dist/checkbox-group.js +1 -1
- package/dist/checkbox.js +1 -1
- package/dist/{collapsible-CT4_3aXm.js → collapsible-KzBs5HvA.js} +2 -2
- package/dist/collapsible.js +1 -1
- package/dist/{color-picker-CeOl4ikV.js → color-picker-i-MJ5VVs.js} +4 -4
- package/dist/color-picker.js +1 -1
- package/dist/{column-manager-CnOhzVGP.js → column-manager-D028QbfO.js} +5 -5
- package/dist/column-manager.js +1 -1
- package/dist/{combobox-C2qlkTw6.js → combobox-599heRN_.js} +1 -1
- package/dist/combobox.js +1 -1
- package/dist/{context-menu-WiKS4Zwv.js → context-menu-WM_tT9hz.js} +1 -1
- package/dist/context-menu.js +1 -1
- package/dist/{currency-field-LAawS9qo.js → currency-field-rS36pjCO.js} +1 -1
- package/dist/currency-field.js +1 -1
- package/dist/{dashboard-grid-Zzqmbzqq.js → dashboard-grid-Dh2Q3IQv.js} +2 -2
- package/dist/dashboard-grid.js +1 -1
- package/dist/{data-grid-Y5aX9njc.js → data-grid-D106baPp.js} +17 -17
- package/dist/data-grid.js +1 -1
- package/dist/{data-list-CyEq7M2D.js → data-list-BA0xrySM.js} +2 -2
- package/dist/data-list.js +1 -1
- package/dist/{date-field-CxubN_3u.js → date-field-BZ5JcvXJ.js} +1 -1
- package/dist/date-field.js +1 -1
- package/dist/{date-picker-6hj83x5D.js → date-picker-BvEbsbJC.js} +4 -4
- package/dist/date-picker.js +2 -2
- package/dist/{date-range-picker-CBWnFTgL.js → date-range-picker-uIr-yReE.js} +5 -5
- package/dist/date-range-picker.js +1 -1
- package/dist/{datetime-field-GMIqBuTa.js → datetime-field-DDs3mV9Z.js} +1 -1
- package/dist/datetime-field.js +1 -1
- package/dist/{datetime-picker-DwUYd3zF.js → datetime-picker-DDYXqrjm.js} +6 -6
- package/dist/datetime-picker.js +1 -1
- package/dist/{datetime-range-picker-CX_tBt6b.js → datetime-range-picker-CFTHW771.js} +6 -6
- package/dist/datetime-range-picker.js +1 -1
- package/dist/docs/accordion.examples.md +743 -0
- package/dist/docs/accordion.json +84 -28
- package/dist/docs/accordion.md +56 -152
- package/dist/docs/action-sheet.examples.md +771 -0
- package/dist/docs/action-sheet.json +91 -51
- package/dist/docs/action-sheet.md +72 -233
- package/dist/docs/app-shell.json +7 -0
- package/dist/docs/app-shell.md +1 -0
- package/dist/docs/breadcrumb.json +64 -16
- package/dist/docs/breadcrumb.md +489 -56
- package/dist/docs/collapsible.examples.md +575 -0
- package/dist/docs/collapsible.json +89 -49
- package/dist/docs/collapsible.md +47 -197
- package/dist/docs/context-menu.json +58 -18
- package/dist/docs/context-menu.md +442 -77
- package/dist/docs/field.json +15 -1
- package/dist/docs/field.md +3 -1
- package/dist/docs/floating-panel.json +56 -0
- package/dist/docs/floating-panel.md +329 -8
- package/dist/docs/hover-card.json +65 -17
- package/dist/docs/hover-card.md +422 -64
- package/dist/docs/loading-overlay.examples.md +577 -0
- package/dist/docs/loading-overlay.json +55 -23
- package/dist/docs/loading-overlay.md +49 -168
- package/dist/docs/menu.json +67 -0
- package/dist/docs/menu.md +8 -1
- package/dist/docs/menubar.json +55 -15
- package/dist/docs/menubar.md +488 -42
- package/dist/docs/pagination.json +89 -33
- package/dist/docs/pagination.md +462 -55
- package/dist/docs/popover.json +1 -1
- package/dist/docs/popover.md +1 -1
- package/dist/docs/select.json +55 -1
- package/dist/docs/select.md +7 -2
- package/dist/docs/toggle-group.examples.md +584 -0
- package/dist/docs/toggle-group.json +84 -20
- package/dist/docs/toggle-group.md +17 -182
- package/dist/docs/toggle.json +93 -37
- package/dist/docs/toggle.md +304 -51
- package/dist/{drawer-Du1aC1px.js → drawer-CQagePr_.js} +256 -256
- package/dist/drawer.js +1 -1
- package/dist/{entity-picker-BwJX0gNJ.js → entity-picker-CC4VoC3p.js} +2 -2
- package/dist/entity-picker.js +1 -1
- package/dist/{event-calendar-DzlL95E4.js → event-calendar-CjmF_e0H.js} +5 -5
- package/dist/event-calendar.js +1 -1
- package/dist/field-C-HRhke0.js +421 -0
- package/dist/{field-group-7zV68b3d.js → field-group-CU0PasvW.js} +1 -1
- package/dist/field-group.js +1 -1
- package/dist/field.js +1 -1
- package/dist/{filter-bar-DMuP5P6e.js → filter-bar-B3QJD7SZ.js} +11 -11
- package/dist/filter-bar.js +1 -1
- package/dist/{hover-card-CWCSZ5_p.js → hover-card-CTItbEfH.js} +2 -2
- package/dist/hover-card.js +1 -1
- package/dist/{import-export-center-DzAUMTq5.js → import-export-center-CW8YVZev.js} +1 -1
- package/dist/import-export-center.js +1 -1
- package/dist/index.js +132 -132
- package/dist/{listbox-CWU3DiEt.js → listbox-ZqiJ2yer.js} +1 -1
- package/dist/listbox.js +1 -1
- package/dist/{markdown-7wOBMXTl.js → markdown-BdskE4-L.js} +1 -1
- package/dist/markdown.js +1 -1
- package/dist/menu-parts-DXs5YuUA.js +932 -0
- package/dist/menu.js +1 -1
- package/dist/{menubar-k8Q4_p9l.js → menubar-CVoAFc6r.js} +2 -2
- package/dist/menubar.js +1 -1
- package/dist/{multi-select-DEd_92BC.js → multi-select-Dc2d6dDB.js} +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/{number-field-BJKoidAE.js → number-field-BQ54hXmk.js} +1 -1
- package/dist/number-field.js +1 -1
- package/dist/{otp-input-Czz9Z6dQ.js → otp-input-DRooqa3f.js} +1 -1
- package/dist/otp-input.js +1 -1
- package/dist/{pagination-D0PUAFYm.js → pagination-BRXuyPzo.js} +1 -1
- package/dist/pagination.js +1 -1
- package/dist/{picker-frame-CT5WNEnw.js → picker-frame-B6sPCP5Y.js} +1 -1
- package/dist/{popover-B2t__iNO.js → popover-1DlOu95x.js} +198 -197
- package/dist/popover.js +1 -1
- package/dist/{prompt-composer-Lsfcz_i9.js → prompt-composer-tYIs39rn.js} +1 -1
- package/dist/prompt-composer.js +1 -1
- package/dist/{radio-group-_ZRUgcI5.js → radio-group-AW3xcYYh.js} +2 -2
- package/dist/radio-group.js +1 -1
- package/dist/{rating-C6AkIIUi.js → rating-h3qdHLNi.js} +1 -1
- package/dist/rating.js +1 -1
- package/dist/{saved-views-zM-DxT1F.js → saved-views-nqn0SDXn.js} +4 -4
- package/dist/saved-views.js +1 -1
- package/dist/{segmented-control-D52GeOlS.js → segmented-control-CbK7SurB.js} +2 -2
- package/dist/segmented-control.js +1 -1
- package/dist/select-d448Wkzb.js +1124 -0
- package/dist/select.js +1 -1
- package/dist/{side-navigation-CtZuP87S.js → side-navigation-CKRETc8E.js} +99 -99
- package/dist/side-navigation.js +1 -1
- package/dist/{slider-DQqQ0skr.js → slider-DQ2CnxTO.js} +1 -1
- package/dist/slider.js +1 -1
- package/dist/{split-button-BYowsA6Q.js → split-button-D4MPKSB2.js} +1 -1
- package/dist/split-button.js +1 -1
- package/dist/styles/action-bar.css +1 -1
- package/dist/styles/app-shell.css +1 -1
- package/dist/styles/cascader.css +2 -0
- package/dist/styles/chart.css +1 -1
- package/dist/styles/checkbox-group.css +2 -0
- package/dist/styles/checkbox.css +2 -0
- package/dist/styles/color-picker.css +3 -3
- package/dist/styles/column-manager.css +2 -2
- package/dist/styles/combobox.css +2 -0
- package/dist/styles/context-menu.css +1 -1
- package/dist/styles/currency-field.css +2 -0
- package/dist/styles/dashboard-grid.css +2 -2
- package/dist/styles/data-grid.css +4 -4
- package/dist/styles/data-list.css +3 -1
- package/dist/styles/date-field.css +2 -0
- package/dist/styles/date-picker.css +3 -1
- package/dist/styles/date-range-picker.css +3 -1
- package/dist/styles/datetime-field.css +2 -0
- package/dist/styles/datetime-picker.css +3 -1
- package/dist/styles/datetime-range-picker.css +3 -1
- package/dist/styles/entity-picker.css +3 -1
- package/dist/styles/event-calendar.css +2 -2
- package/dist/styles/field-group.css +2 -0
- package/dist/styles/field.css +2 -0
- package/dist/styles/filter-bar.css +4 -4
- package/dist/styles/floating-panel.css +1 -1
- package/dist/styles/hover-card.css +1 -1
- package/dist/styles/import-export-center.css +3 -3
- package/dist/styles/index.css +9 -9
- package/dist/styles/listbox.css +2 -0
- package/dist/styles/markdown.css +2 -0
- package/dist/styles/menu.css +1 -1
- package/dist/styles/menubar.css +1 -1
- package/dist/styles/multi-select.css +2 -0
- package/dist/styles/number-field.css +2 -0
- package/dist/styles/otp-input.css +2 -0
- package/dist/styles/pagination.css +1 -1
- package/dist/styles/popover.css +1 -1
- package/dist/styles/prompt-composer.css +2 -0
- package/dist/styles/radio-group.css +2 -0
- package/dist/styles/rating.css +2 -0
- package/dist/styles/saved-views.css +3 -3
- package/dist/styles/segmented-control.css +2 -0
- package/dist/styles/select.css +3 -1
- package/dist/styles/side-navigation.css +1 -1
- package/dist/styles/slider.css +2 -0
- package/dist/styles/split-button.css +1 -1
- package/dist/styles/switch.css +2 -0
- package/dist/styles/table.css +3 -3
- package/dist/styles/tags-input.css +2 -0
- package/dist/styles/text-field.css +2 -0
- package/dist/styles/textarea.css +2 -0
- package/dist/styles/time-field.css +2 -0
- package/dist/styles/time-picker.css +3 -1
- package/dist/styles/time-range-picker.css +3 -1
- package/dist/styles/toggle-group.css +3 -1
- package/dist/styles/toolbar.css +1 -1
- package/dist/styles/top-navigation.css +1 -1
- package/dist/styles/transfer.css +2 -0
- package/dist/styles/upload.css +2 -0
- package/dist/styles.css +1 -1
- package/dist/{switch-CcZAVLiW.js → switch-DxMukg7F.js} +1 -1
- package/dist/switch.js +1 -1
- package/dist/{table-D4oX9Gvn.js → table-BecApjeD.js} +13 -13
- package/dist/table.js +1 -1
- package/dist/{tags-input-O87zTh7h.js → tags-input-CqCeLtk-.js} +1 -1
- package/dist/tags-input.js +1 -1
- package/dist/{text-field-Cnjc7LB5.js → text-field-CMOkJ9Z6.js} +1 -1
- package/dist/text-field.js +1 -1
- package/dist/{textarea-DcA7jwOM.js → textarea-DfqPfXTr.js} +1 -1
- package/dist/textarea.js +1 -1
- package/dist/{time-field-BanhrUvf.js → time-field-GyLQsxcc.js} +1 -1
- package/dist/time-field.js +1 -1
- package/dist/{time-picker-Cu1iV039.js → time-picker-CGHPnust.js} +3 -3
- package/dist/time-picker.js +1 -1
- package/dist/{time-range-picker-sdbaFJFN.js → time-range-picker-BMRtAqPy.js} +4 -4
- package/dist/time-range-picker.js +1 -1
- package/dist/{toggle-zDTD5G3H.js → toggle-DSEEtL3Y.js} +7 -2
- package/dist/{toggle-group-D7GQyNQP.js → toggle-group-DZEWkVRo.js} +8 -3
- package/dist/toggle-group.js +1 -1
- package/dist/toggle.js +1 -1
- package/dist/{toolbar-DOV4BKY8.js → toolbar-BP7ka6lN.js} +1 -1
- package/dist/toolbar.js +1 -1
- package/dist/{top-navigation-D3rpgBV2.js → top-navigation-D8IHPOmm.js} +1 -1
- package/dist/top-navigation.js +1 -1
- package/dist/{transfer-CuLlF_nY.js → transfer-sKUvmEKe.js} +5 -5
- package/dist/transfer.js +1 -1
- package/dist/types/app-shell/app-shell-parts.d.ts +7 -0
- package/dist/types/app-shell/app-shell-parts.d.ts.map +1 -1
- package/dist/types/app-shell/index.d.ts +1 -1
- package/dist/types/app-shell/index.d.ts.map +1 -1
- package/dist/types/calendar/calendar.d.ts.map +1 -1
- package/dist/types/calendar/use-clock-today.d.ts +10 -0
- package/dist/types/calendar/use-clock-today.d.ts.map +1 -0
- package/dist/types/field/field-defaults.d.ts +1 -1
- package/dist/types/field/field-defaults.d.ts.map +1 -1
- package/dist/types/field/field-help-sheet.d.ts +15 -0
- package/dist/types/field/field-help-sheet.d.ts.map +1 -0
- package/dist/types/field/field-parts.d.ts +1 -1
- package/dist/types/field/field-parts.d.ts.map +1 -1
- package/dist/types/field/field.types.d.ts +11 -0
- package/dist/types/field/field.types.d.ts.map +1 -1
- package/dist/types/field/index.d.ts +1 -1
- package/dist/types/field/index.d.ts.map +1 -1
- package/dist/types/menu/index.d.ts +1 -1
- package/dist/types/menu/index.d.ts.map +1 -1
- package/dist/types/menu/menu-defaults.d.ts.map +1 -1
- package/dist/types/menu/menu-parts.d.ts.map +1 -1
- package/dist/types/menu/menu-sheet-step.d.ts +6 -0
- package/dist/types/menu/menu-sheet-step.d.ts.map +1 -0
- package/dist/types/menu/menu.d.ts +1 -1
- package/dist/types/menu/menu.d.ts.map +1 -1
- package/dist/types/menu/menu.types.d.ts +15 -0
- package/dist/types/menu/menu.types.d.ts.map +1 -1
- package/dist/types/menu/use-menu-sheet.d.ts +9 -0
- package/dist/types/menu/use-menu-sheet.d.ts.map +1 -0
- package/dist/types/pagination/pagination-parts.d.ts.map +1 -1
- package/dist/types/picker-panel/picker-layer.d.ts +4 -1
- package/dist/types/picker-panel/picker-layer.d.ts.map +1 -1
- package/dist/types/picker-panel/use-picker-layer.d.ts.map +1 -1
- package/dist/types/popover/popover-parts.d.ts.map +1 -1
- package/dist/types/select/index.d.ts +1 -1
- package/dist/types/select/index.d.ts.map +1 -1
- package/dist/types/select/select-defaults.d.ts.map +1 -1
- package/dist/types/select/select-parts.d.ts.map +1 -1
- package/dist/types/select/select.d.ts +6 -2
- package/dist/types/select/select.d.ts.map +1 -1
- package/dist/types/select/select.types.d.ts +9 -0
- package/dist/types/select/select.types.d.ts.map +1 -1
- package/dist/types/select/use-select-sheet.d.ts +9 -0
- package/dist/types/select/use-select-sheet.d.ts.map +1 -0
- package/dist/types/toggle/toggle.d.ts.map +1 -1
- package/dist/types/toggle/toggle.types.d.ts +4 -1
- package/dist/types/toggle/toggle.types.d.ts.map +1 -1
- package/dist/types/toggle-group/toggle-group-parts.d.ts.map +1 -1
- package/dist/types/toggle-group/toggle-group.types.d.ts +4 -1
- package/dist/types/toggle-group/toggle-group.types.d.ts.map +1 -1
- package/dist/{upload-CPl38p-S.js → upload-CuMOaPK3.js} +1 -1
- package/dist/upload.js +1 -1
- package/dist/{use-date-picker-DWV7KWS7.js → use-date-picker-DdSX3RE4.js} +2 -2
- package/dist/{use-picker-draft-BJlHcb6J.js → use-picker-draft-I_pxqYsc.js} +48 -35
- package/package.json +6 -6
- package/dist/field-vOVzvq5t.js +0 -368
- package/dist/menu-parts-DgL617_H.js +0 -814
- package/dist/select-BkUuIVBK.js +0 -1017
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"part": "root",
|
|
92
92
|
"element": "div, inside drawer’s panel",
|
|
93
93
|
"required": true,
|
|
94
|
-
"purpose": "The
|
|
94
|
+
"purpose": "The action sheet’s own box, data-ui=\"action-sheet\": a grid of header, list and footer that spans every row of drawer’s panel, so the list is the one row that scrolls when the sheet reaches its cap. The layer around it is drawer with side=\"bottom\" and size=\"content\", which owns the portal, the scrim, the role=\"dialog\" panel, the slide, the drag and the width — here the action sheet’s --slotted-action-sheet-inline-size, handed to drawer’s sheet."
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
"part": "trigger",
|
|
@@ -184,56 +184,56 @@
|
|
|
184
184
|
"type": "boolean",
|
|
185
185
|
"defaultValue": "—",
|
|
186
186
|
"appliesTo": "ActionSheet",
|
|
187
|
-
"description": "Present at all means the consumer owns the state, for the life of the component.
|
|
187
|
+
"description": "Present at all means the consumer owns the state, for the life of the component. ActionSheet then asks and waits."
|
|
188
188
|
},
|
|
189
189
|
{
|
|
190
190
|
"name": "defaultOpen",
|
|
191
191
|
"type": "boolean",
|
|
192
192
|
"defaultValue": "—",
|
|
193
193
|
"appliesTo": "ActionSheet",
|
|
194
|
-
"description": "The value an uncontrolled sheet starts from, read once"
|
|
194
|
+
"description": "The value an uncontrolled sheet starts from, read once."
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
197
|
"name": "modal",
|
|
198
198
|
"type": "boolean",
|
|
199
199
|
"defaultValue": "true",
|
|
200
200
|
"appliesTo": "ActionSheet, ActionSheetDefaultsProvider",
|
|
201
|
-
"description": "Whether the page is inert, the scroll locked, focus contained and the scrim painted. false keeps the page operable and paints no scrim"
|
|
201
|
+
"description": "Whether the page is inert, the scroll locked, focus contained and the scrim painted. false keeps the page operable and paints no scrim."
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
204
|
"name": "mount",
|
|
205
205
|
"type": "'active' | 'lazy' | 'eager'",
|
|
206
206
|
"defaultValue": "active",
|
|
207
207
|
"appliesTo": "ActionSheet, ActionSheetDefaultsProvider",
|
|
208
|
-
"description": "When the layer exists. active drops it once the exit is over, lazy builds it on the first open and keeps it, eager builds it up front and makes it inert"
|
|
208
|
+
"description": "When the layer exists. active drops it once the exit is over, lazy builds it on the first open and keeps it, eager builds it up front and makes it inert."
|
|
209
209
|
},
|
|
210
210
|
{
|
|
211
211
|
"name": "escape",
|
|
212
212
|
"type": "'close' | 'none'",
|
|
213
213
|
"defaultValue": "close",
|
|
214
214
|
"appliesTo": "ActionSheet, ActionSheetDefaultsProvider",
|
|
215
|
-
"description": "Whether Escape asks to close. It reaches the topmost layer only"
|
|
215
|
+
"description": "Whether Escape asks to close. It reaches the topmost layer only."
|
|
216
216
|
},
|
|
217
217
|
{
|
|
218
218
|
"name": "outsidePress",
|
|
219
219
|
"type": "'close' | 'none'",
|
|
220
220
|
"defaultValue": "close",
|
|
221
221
|
"appliesTo": "ActionSheet, ActionSheetDefaultsProvider",
|
|
222
|
-
"description": "Whether a press outside the panel — on the scrim, or on the page behind a non-modal sheet — asks to close"
|
|
222
|
+
"description": "Whether a press outside the panel — on the scrim, or on the page behind a non-modal sheet — asks to close."
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
"name": "back",
|
|
226
226
|
"type": "'close' | 'none'",
|
|
227
227
|
"defaultValue": "close",
|
|
228
228
|
"appliesTo": "ActionSheet, ActionSheetDefaultsProvider",
|
|
229
|
-
"description": "The platform’s way back — a phone’s gesture, a browser’s button — closes the sheet instead of leaving the page, while it is modal"
|
|
229
|
+
"description": "The platform’s way back — a phone’s gesture, a browser’s button — closes the sheet instead of leaving the page, while it is modal."
|
|
230
230
|
},
|
|
231
231
|
{
|
|
232
232
|
"name": "closeOnSelect",
|
|
233
233
|
"type": "boolean",
|
|
234
234
|
"defaultValue": "true",
|
|
235
235
|
"appliesTo": "ActionSheet, ActionSheetDefaultsProvider",
|
|
236
|
-
"description": "Whether choosing an action closes the sheet with the reason select"
|
|
236
|
+
"description": "Whether choosing an action closes the sheet with the reason select."
|
|
237
237
|
},
|
|
238
238
|
{
|
|
239
239
|
"name": "messages",
|
|
@@ -247,77 +247,77 @@
|
|
|
247
247
|
"type": "RefObject<HTMLElement> | false",
|
|
248
248
|
"defaultValue": "—",
|
|
249
249
|
"appliesTo": "ActionSheet",
|
|
250
|
-
"description": "Where focus goes on opening. Unstated, the first action that can run, or the least destructive one when that action is danger. false moves nothing"
|
|
250
|
+
"description": "Where focus goes on opening. Unstated, the first action that can run, or the least destructive one when that action is danger. false moves nothing."
|
|
251
251
|
},
|
|
252
252
|
{
|
|
253
253
|
"name": "finalFocus",
|
|
254
254
|
"type": "RefObject<HTMLElement> | false",
|
|
255
255
|
"defaultValue": "—",
|
|
256
256
|
"appliesTo": "ActionSheet",
|
|
257
|
-
"description": "Where focus goes on closing. Unstated, the element that held it on opening"
|
|
257
|
+
"description": "Where focus goes on closing. Unstated, the element that held it on opening."
|
|
258
258
|
},
|
|
259
259
|
{
|
|
260
260
|
"name": "value",
|
|
261
261
|
"type": "string",
|
|
262
262
|
"defaultValue": "—",
|
|
263
263
|
"appliesTo": "ActionSheetItem",
|
|
264
|
-
"description": "What the close request carries as result when this action is chosen"
|
|
264
|
+
"description": "What the close request carries as result when this action is chosen."
|
|
265
265
|
},
|
|
266
266
|
{
|
|
267
267
|
"name": "textValue",
|
|
268
268
|
"type": "string",
|
|
269
269
|
"defaultValue": "—",
|
|
270
270
|
"appliesTo": "ActionSheetItem",
|
|
271
|
-
"description": "What typeahead matches when the label is not plain text"
|
|
271
|
+
"description": "What typeahead matches when the label is not plain text."
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
274
|
"name": "icon",
|
|
275
275
|
"type": "ReactNode",
|
|
276
276
|
"defaultValue": "—",
|
|
277
277
|
"appliesTo": "ActionSheetItem",
|
|
278
|
-
"description": "The action’s visual, drawn in the mark column"
|
|
278
|
+
"description": "The action’s visual, drawn in the mark column."
|
|
279
279
|
},
|
|
280
280
|
{
|
|
281
281
|
"name": "description",
|
|
282
282
|
"type": "ReactNode",
|
|
283
283
|
"defaultValue": "—",
|
|
284
284
|
"appliesTo": "ActionSheetItem",
|
|
285
|
-
"description": "The second line, which aria-describedby points at"
|
|
285
|
+
"description": "The second line, which aria-describedby points at."
|
|
286
286
|
},
|
|
287
287
|
{
|
|
288
288
|
"name": "tone",
|
|
289
289
|
"type": "'accent' | 'secondary' | 'success' | 'warning' | 'danger'",
|
|
290
290
|
"defaultValue": "—",
|
|
291
291
|
"appliesTo": "ActionSheetItem",
|
|
292
|
-
"description": "Paints the words, the mark and the highlight. danger is the destructive action"
|
|
292
|
+
"description": "Paints the words, the mark and the highlight. danger is the destructive action."
|
|
293
293
|
},
|
|
294
294
|
{
|
|
295
295
|
"name": "disabled",
|
|
296
296
|
"type": "boolean",
|
|
297
297
|
"defaultValue": "false",
|
|
298
298
|
"appliesTo": "ActionSheetItem",
|
|
299
|
-
"description": "The action cannot run. It stays focusable and takes aria-disabled"
|
|
299
|
+
"description": "The action cannot run. It stays focusable and takes aria-disabled."
|
|
300
300
|
},
|
|
301
301
|
{
|
|
302
302
|
"name": "loading",
|
|
303
303
|
"type": "boolean",
|
|
304
304
|
"defaultValue": "false",
|
|
305
305
|
"appliesTo": "ActionSheetItem",
|
|
306
|
-
"description": "The action is running: the ring takes the mark’s box, aria-busy is written, a second press is refused and the sheet stays open"
|
|
306
|
+
"description": "The action is running: the ring takes the mark’s box, aria-busy is written, a second press is refused and the sheet stays open."
|
|
307
307
|
},
|
|
308
308
|
{
|
|
309
309
|
"name": "closeOnSelect",
|
|
310
310
|
"type": "boolean",
|
|
311
311
|
"defaultValue": "—",
|
|
312
312
|
"appliesTo": "ActionSheetItem",
|
|
313
|
-
"description": "Overrides the sheet’s closeOnSelect for this action"
|
|
313
|
+
"description": "Overrides the sheet’s closeOnSelect for this action."
|
|
314
314
|
},
|
|
315
315
|
{
|
|
316
316
|
"name": "label",
|
|
317
317
|
"type": "ReactNode",
|
|
318
318
|
"defaultValue": "—",
|
|
319
319
|
"appliesTo": "ActionSheetGroup",
|
|
320
|
-
"description": "Rendered as the group-label part, and the group’s accessible name"
|
|
320
|
+
"description": "Rendered as the group-label part, and the group’s accessible name."
|
|
321
321
|
}
|
|
322
322
|
],
|
|
323
323
|
"composition": [
|
|
@@ -326,35 +326,35 @@
|
|
|
326
326
|
"type": "(props) => ReactNode",
|
|
327
327
|
"defaultValue": "—",
|
|
328
328
|
"appliesTo": "ActionSheetTrigger, ActionSheetContent, ActionSheetTitle, ActionSheetMessage, ActionSheetItem, ActionSheetCancel",
|
|
329
|
-
"description": "Substitutes the element. An item that navigates renders an anchor and keeps its role and keyboard; the trigger becomes the application’s own Button. The list, the groups and the separator are fixed, because their role is what they are"
|
|
329
|
+
"description": "Substitutes the element. An item that navigates renders an anchor and keeps its role and keyboard; the trigger becomes the application’s own Button. The list, the groups and the separator are fixed, because their role is what they are."
|
|
330
330
|
},
|
|
331
331
|
{
|
|
332
332
|
"name": "ref",
|
|
333
333
|
"type": "Ref<ActionSheetHandle> on ActionSheet, Ref<HTMLElement> on every part",
|
|
334
334
|
"defaultValue": "—",
|
|
335
335
|
"appliesTo": "ActionSheet, every part",
|
|
336
|
-
"description": "On a part it reaches the element. On
|
|
336
|
+
"description": "On a part it reaches the element. On ActionSheet it is a handle with open(), close() and focus() — the actions a consumer cannot express declaratively."
|
|
337
337
|
},
|
|
338
338
|
{
|
|
339
339
|
"name": "container",
|
|
340
340
|
"type": "Element | null",
|
|
341
341
|
"defaultValue": "—",
|
|
342
342
|
"appliesTo": "ActionSheet",
|
|
343
|
-
"description": "A parent for this layer alone instead of the shared portal root, passed to drawer"
|
|
343
|
+
"description": "A parent for this layer alone instead of the shared portal root, passed to drawer."
|
|
344
344
|
},
|
|
345
345
|
{
|
|
346
346
|
"name": "useActionSheet()",
|
|
347
347
|
"type": "() => ActionSheetContextValue",
|
|
348
348
|
"defaultValue": "—",
|
|
349
349
|
"appliesTo": "inside ActionSheet",
|
|
350
|
-
"description": "What the parts read: the open state, the identifiers, the axes and close(reason, result). It throws outside a sheet"
|
|
350
|
+
"description": "What the parts read: the open state, the identifiers, the axes and close(reason, result). It throws outside a sheet."
|
|
351
351
|
},
|
|
352
352
|
{
|
|
353
353
|
"name": "ActionSheetDefaultsProvider",
|
|
354
354
|
"type": "{ modal, mount, escape, outsidePress, back, closeOnSelect }",
|
|
355
355
|
"defaultValue": "—",
|
|
356
356
|
"appliesTo": "a subtree",
|
|
357
|
-
"description": "The decisions an application takes once. A sheet that states any of them itself still wins"
|
|
357
|
+
"description": "The decisions an application takes once. A sheet that states any of them itself still wins."
|
|
358
358
|
}
|
|
359
359
|
],
|
|
360
360
|
"events": [
|
|
@@ -371,7 +371,7 @@
|
|
|
371
371
|
{
|
|
372
372
|
"name": "onClick, onKeyDown, onPointerMove, on every part",
|
|
373
373
|
"payload": "the element’s own events",
|
|
374
|
-
"when": "Whenever the element fires them. The consumer’s handler runs first, and preventDefault() refuses the
|
|
374
|
+
"when": "Whenever the element fires them. The consumer’s handler runs first, and preventDefault() refuses the action sheet’s own behavior."
|
|
375
375
|
}
|
|
376
376
|
],
|
|
377
377
|
"accessibility": [
|
|
@@ -448,15 +448,15 @@
|
|
|
448
448
|
{
|
|
449
449
|
"id": "playground",
|
|
450
450
|
"title": "A trigger, the actions and the way out",
|
|
451
|
-
"note": "Press
|
|
451
|
+
"note": "Press Share: the sheet rises from the bottom edge over a scrim, focus lands on the first action, and choosing one closes it with the reason select and the action’s value.",
|
|
452
452
|
"language": "tsx",
|
|
453
|
-
"source": "<ActionSheet onOpenChange={(open, request) => run(request.result)}>\n <ActionSheetTrigger>
|
|
453
|
+
"source": "<ActionSheet onOpenChange={(open, request) => run(request.result)}>\n <ActionSheetTrigger>Share</ActionSheetTrigger>\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Share report</ActionSheetTitle>\n <ActionSheetMessage>Anyone who receives the link sees today's version.</ActionSheetMessage>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem value=\"copy\" icon={<Copy />}>\n Copy link\n </ActionSheetItem>\n <ActionSheetItem value=\"pdf\" icon={<FileText />}>\n Download PDF\n </ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel>Cancel</ActionSheetCancel>\n </ActionSheetContent>\n</ActionSheet>;\n",
|
|
454
454
|
"verdict": "excerpt"
|
|
455
455
|
},
|
|
456
456
|
{
|
|
457
457
|
"id": "destructive",
|
|
458
458
|
"title": "The destructive choice, at the top",
|
|
459
|
-
"note": "tone=\"danger\" paints the words, the mark and the highlight red, and the destructive action goes first, where it is noticed. Opened, this sheet puts focus on
|
|
459
|
+
"note": "tone=\"danger\" paints the words, the mark and the highlight red, and the destructive action goes first, where it is noticed. Opened, this sheet puts focus on Cancel rather than on the danger.",
|
|
460
460
|
"language": "tsx",
|
|
461
461
|
"source": "<ActionSheetList>\n <ActionSheetItem value=\"delete\" tone=\"danger\">\n Delete draft\n </ActionSheetItem>\n <ActionSheetItem value=\"save\">Save draft</ActionSheetItem>\n</ActionSheetList>;\n",
|
|
462
462
|
"verdict": "excerpt"
|
|
@@ -466,61 +466,61 @@
|
|
|
466
466
|
"title": "Groups, a rule, a second line and an action that is not available",
|
|
467
467
|
"note": "A group is named by its label, a separator draws the rule between two runs, and a disabled action keeps its place and says in its second line why it cannot run — it stays in the arrow ring and refuses the press.",
|
|
468
468
|
"language": "tsx",
|
|
469
|
-
"source": "<ActionSheetList>\n
|
|
470
|
-
"verdict": "
|
|
469
|
+
"source": "import {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetGroup,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetSeparator,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\n\nexport default function ActionSheetGroups() {\n return (\n <ActionSheet>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Shipment\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Shipment SH-4471</ActionSheetTitle>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetGroup label=\"Notify\">\n <ActionSheetItem value=\"email-carrier\">Email the carrier</ActionSheetItem>\n <ActionSheetItem value=\"text-consignee\">Text the consignee</ActionSheetItem>\n </ActionSheetGroup>\n <ActionSheetSeparator />\n <ActionSheetGroup label=\"Documents\">\n <ActionSheetItem value=\"bill-of-lading\">Download bill of lading</ActionSheetItem>\n <ActionSheetItem value=\"packing-slip\">Print packing slip</ActionSheetItem>\n </ActionSheetGroup>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n );\n}\n",
|
|
470
|
+
"verdict": "example"
|
|
471
471
|
},
|
|
472
472
|
{
|
|
473
473
|
"id": "content",
|
|
474
|
-
"title": "Content the
|
|
474
|
+
"title": "Content the sheet did not choose",
|
|
475
475
|
"note": "A title of two lines, a long message, labels that wrap and a reference with no spaces: nothing truncates, the list is the one row that scrolls, and the title and the cancel stay on screen.",
|
|
476
476
|
"language": "tsx",
|
|
477
|
-
"source": "<ActionSheetItem value=\"copy-ref\">\n
|
|
477
|
+
"source": "<ActionSheetItem value=\"copy-ref\">\n Copy ENC-2026-0000088213-ATLANTIC-PT-LISBON-NORTH\n</ActionSheetItem>;\n",
|
|
478
478
|
"verdict": "excerpt"
|
|
479
479
|
},
|
|
480
480
|
{
|
|
481
481
|
"id": "loading",
|
|
482
482
|
"title": "An action that takes time",
|
|
483
|
-
"note": "Press
|
|
483
|
+
"note": "Press Download PDF: the ring takes the mark’s box and the label stays, so nothing moves; the item carries aria-busy, refuses a second press, and the sheet stays open until the consumer clears loading.",
|
|
484
484
|
"language": "tsx",
|
|
485
|
-
"source": "
|
|
486
|
-
"verdict": "
|
|
485
|
+
"source": "import { useState } from 'react';\n\nimport {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetMessage,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport type { ActionSheetSelectEvent } from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Glyph } from '@slotted/react/icon';\n\nexport default function ActionSheetLoading() {\n const [open, setOpen] = useState(false);\n const [exporting, setExporting] = useState(false);\n\n function handleExport(event: ActionSheetSelectEvent) {\n event.preventDefault();\n setExporting(true);\n setTimeout(() => {\n setExporting(false);\n setOpen(false);\n }, 2500);\n }\n\n return (\n <ActionSheet open={open} onOpenChange={setOpen}>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n October invoices\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>October invoices</ActionSheetTitle>\n <ActionSheetMessage>142 invoices, $318,450.00.</ActionSheetMessage>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem\n icon={<Glyph name=\"file-spreadsheet\" />}\n loading={exporting}\n onSelect={handleExport}\n value=\"export\"\n >\n Export as CSV\n </ActionSheetItem>\n <ActionSheetItem icon={<Glyph name=\"file-text\" />} value=\"summary\">\n Print summary\n </ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n );\n}\n",
|
|
486
|
+
"verdict": "example"
|
|
487
487
|
},
|
|
488
488
|
{
|
|
489
489
|
"id": "modal",
|
|
490
490
|
"title": "Modal, or beside the page",
|
|
491
491
|
"note": "modal is the default: the page is inert, the scroll is locked and the scrim is painted. modal={false} paints no scrim and leaves the page operable — the map behind stays live — while a press outside still closes the sheet.",
|
|
492
492
|
"language": "tsx",
|
|
493
|
-
"source": "<ActionSheet modal={false}
|
|
494
|
-
"verdict": "
|
|
493
|
+
"source": "import { useState } from 'react';\n\nimport {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetMessage,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\n\nexport default function ActionSheetModal() {\n const [scanned, setScanned] = useState(0);\n\n return (\n <Inline align=\"center\" gap={3}>\n <ActionSheet modal={false}>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Dock 3 actions\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Dock 3 receiving</ActionSheetTitle>\n <ActionSheetMessage>Keep scanning while this sheet stays open.</ActionSheetMessage>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem tone=\"warning\" value=\"damaged\">\n Flag damaged parcel\n </ActionSheetItem>\n <ActionSheetItem value=\"inspection\">Hold for inspection</ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n <Button onClick={() => setScanned((count) => count + 1)}>Scan parcel ({scanned})</Button>\n </Inline>\n );\n}\n",
|
|
494
|
+
"verdict": "example"
|
|
495
495
|
},
|
|
496
496
|
{
|
|
497
497
|
"id": "policy",
|
|
498
498
|
"title": "What may close it",
|
|
499
|
-
"note": "escape, outsidePress and back each take close or none, and every close is a request the consumer can cancel. Here only
|
|
499
|
+
"note": "escape, outsidePress and back each take close or none, and every close is a request the consumer can cancel. Here only Cancel closes the sheet; the line under the trigger names each request that arrived and whether it was refused.",
|
|
500
500
|
"language": "tsx",
|
|
501
|
-
"source": "<ActionSheet
|
|
502
|
-
"verdict": "
|
|
501
|
+
"source": "import {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetMessage,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\n\nexport default function ActionSheetPolicy() {\n return (\n <ActionSheet back=\"none\" escape=\"none\" outsidePress=\"none\">\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Adjust stock\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Inventory adjustment</ActionSheetTitle>\n <ActionSheetMessage>SKU 40-1182 in Reno: 140 on hand, 132 counted.</ActionSheetMessage>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem value=\"apply\">Apply adjustment of -8</ActionSheetItem>\n <ActionSheetItem value=\"recount\">Request a recount</ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n );\n}\n",
|
|
502
|
+
"verdict": "example"
|
|
503
503
|
},
|
|
504
504
|
{
|
|
505
505
|
"id": "focus",
|
|
506
506
|
"title": "Where focus enters, and where it goes back",
|
|
507
|
-
"note": "Focus enters on the first action that can run; when that action is destructive it enters on
|
|
507
|
+
"note": "Focus enters on the first action that can run; when that action is destructive it enters on Cancel, the least destructive one the dialog pattern asks for. On close it returns to the trigger; initialFocus and finalFocus name other elements.",
|
|
508
508
|
"language": "tsx",
|
|
509
|
-
"source": "<ActionSheet initialFocus={
|
|
510
|
-
"verdict": "
|
|
509
|
+
"source": "import { useRef } from 'react';\n\nimport {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\n\nexport default function ActionSheetFocus() {\n const reprint = useRef<HTMLButtonElement>(null);\n const next = useRef<HTMLButtonElement>(null);\n\n return (\n <Inline align=\"center\" gap={3}>\n <ActionSheet finalFocus={next} initialFocus={reprint}>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Label actions\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Shipment SH-4471</ActionSheetTitle>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem value=\"slip\">Print packing slip</ActionSheetItem>\n <ActionSheetItem ref={reprint} value=\"reprint\">\n Reprint shipping label\n </ActionSheetItem>\n <ActionSheetItem value=\"void\">Void shipping label</ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n <Button ref={next} variant=\"ghost\">\n Scan next parcel\n </Button>\n </Inline>\n );\n}\n",
|
|
510
|
+
"verdict": "example"
|
|
511
511
|
},
|
|
512
512
|
{
|
|
513
513
|
"id": "result",
|
|
514
514
|
"title": "Which action was chosen, and why it closed",
|
|
515
515
|
"note": "The close request carries reason and, when the reason is select, result — the value of the item chosen. There is no controller that returns a promise: the request already says what the promise would.",
|
|
516
516
|
"language": "tsx",
|
|
517
|
-
"source": "
|
|
518
|
-
"verdict": "
|
|
517
|
+
"source": "import { useState } from 'react';\n\nimport {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport type { ActionSheetChangeRequest } from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { Text } from '@slotted/react/typography';\n\nexport default function ActionSheetResult() {\n const [open, setOpen] = useState(false);\n const [last, setLast] = useState('none');\n\n function handleOpenChange(next: boolean, request: ActionSheetChangeRequest) {\n setOpen(next);\n setLast(request.result === undefined ? request.reason : `${request.reason}: ${request.result}`);\n }\n\n return (\n <Inline align=\"center\" gap={3}>\n <ActionSheet open={open} onOpenChange={handleOpenChange}>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Ticket\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Support ticket T-3306</ActionSheetTitle>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem value=\"assign\">Assign to me</ActionSheetItem>\n <ActionSheetItem value=\"escalate\">Escalate to billing</ActionSheetItem>\n <ActionSheetItem value=\"resolve\">Mark as resolved</ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n <Text size=\"sm\">Last request: {last}</Text>\n </Inline>\n );\n}\n",
|
|
518
|
+
"verdict": "example"
|
|
519
519
|
},
|
|
520
520
|
{
|
|
521
521
|
"id": "responsive",
|
|
522
522
|
"title": "One list of actions, a menu on a pointer and a sheet on a phone",
|
|
523
|
-
"note": "The item vocabulary is menu’s, word for word — value, icon, description, tone, disabled, onSelect — so one array renders as either
|
|
523
|
+
"note": "The item vocabulary is menu’s, word for word — value, icon, description, tone, disabled, onSelect — so one array renders as either component, and the breakpoint that picks between them is the application’s.",
|
|
524
524
|
"language": "tsx",
|
|
525
525
|
"source": "const coarse = useMediaQuery('(pointer: coarse)');\n\ncoarse ? (\n <ActionSheet>\n <ActionSheetTrigger>More</ActionSheetTrigger>\n <ActionSheetContent aria-label=\"Actions\">\n <ActionSheetList aria-label=\"Actions\">\n {actions.map((action) => (\n <ActionSheetItem key={action.value} {...action} />\n ))}\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n) : (\n <Menu>\n <MenuTrigger>More</MenuTrigger>\n <MenuContent aria-label=\"Actions\">\n {actions.map((action) => (\n <MenuItem key={action.value} {...action} />\n ))}\n </MenuContent>\n </Menu>\n);\n",
|
|
526
526
|
"verdict": "excerpt"
|
|
@@ -530,16 +530,56 @@
|
|
|
530
530
|
"title": "Decided once for the application",
|
|
531
531
|
"note": "ActionSheetDefaultsProvider sets modal, mount, escape, outsidePress, back and closeOnSelect for every sheet below it, and a sheet that states a value itself still wins. The cancel’s words come from the language in force (SlottedProvider).",
|
|
532
532
|
"language": "tsx",
|
|
533
|
-
"source": "<ActionSheetDefaultsProvider closeOnSelect={false}
|
|
534
|
-
"verdict": "
|
|
533
|
+
"source": "import {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetDefaultsProvider,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\n\nexport default function ActionSheetDefaults() {\n return (\n <ActionSheetDefaultsProvider closeOnSelect={false} outsidePress=\"none\">\n <Inline gap={3}>\n <ActionSheet>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Picking\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Picking wave 22</ActionSheetTitle>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem value=\"start\">Start picking</ActionSheetItem>\n <ActionSheetItem value=\"pause\">Pause the wave</ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n <ActionSheet closeOnSelect>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Packing\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Packing bench 6</ActionSheetTitle>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem value=\"print\">Print labels</ActionSheetItem>\n <ActionSheetItem value=\"close\">Close the bench</ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n </Inline>\n </ActionSheetDefaultsProvider>\n );\n}\n",
|
|
534
|
+
"verdict": "example"
|
|
535
535
|
},
|
|
536
536
|
{
|
|
537
537
|
"id": "accessibility",
|
|
538
538
|
"title": "The keyboard",
|
|
539
|
-
"note": "Open it and use the keys: the arrows move between actions and wrap, Home and End reach the ends, a letter moves to the next action that starts with it, Tab moves between the list and
|
|
539
|
+
"note": "Open it and use the keys: the arrows move between actions and wrap, Home and End reach the ends, a letter moves to the next action that starts with it, Tab moves between the list and Cancel, and Escape closes and returns focus.",
|
|
540
540
|
"language": "tsx",
|
|
541
|
-
"source": "<ActionSheetItem value=\"flag\" textValue=\"
|
|
541
|
+
"source": "<ActionSheetItem value=\"flag\" textValue=\"Flag\">\n <FlagBadge /> Flag\n</ActionSheetItem>;\n",
|
|
542
542
|
"verdict": "excerpt"
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"id": "basic",
|
|
546
|
+
"title": "basic.tsx",
|
|
547
|
+
"note": null,
|
|
548
|
+
"language": "tsx",
|
|
549
|
+
"source": "import {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetMessage,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Glyph } from '@slotted/react/icon';\n\nexport default function ActionSheetBasic() {\n return (\n <ActionSheet>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Order actions\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Order SO-20418</ActionSheetTitle>\n <ActionSheetMessage>Harbor Freight Supply, 12 lines, $4,820.00.</ActionSheetMessage>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem icon={<Glyph name=\"copy\" />} value=\"copy\">\n Copy order link\n </ActionSheetItem>\n <ActionSheetItem icon={<Glyph name=\"download\" />} value=\"invoice\">\n Download invoice\n </ActionSheetItem>\n <ActionSheetItem icon={<Glyph name=\"pencil\" />} value=\"edit\">\n Edit order\n </ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n );\n}\n",
|
|
550
|
+
"verdict": "example"
|
|
551
|
+
},
|
|
552
|
+
{
|
|
553
|
+
"id": "keep-open",
|
|
554
|
+
"title": "keep-open.tsx",
|
|
555
|
+
"note": null,
|
|
556
|
+
"language": "tsx",
|
|
557
|
+
"source": "import { useState } from 'react';\n\nimport {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetMessage,\n ActionSheetSeparator,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport type { ActionSheetSelectEvent } from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Inline } from '@slotted/react/inline';\nimport { Text } from '@slotted/react/typography';\n\nexport default function ActionSheetKeepOpen() {\n const [loaded, setLoaded] = useState<string[]>([]);\n\n function handleToggle(event: ActionSheetSelectEvent) {\n const pallet = event.value ?? '';\n setLoaded((current) =>\n current.includes(pallet) ? current.filter((id) => id !== pallet) : [...current, pallet],\n );\n }\n\n return (\n <Inline align=\"center\" gap={3}>\n <ActionSheet closeOnSelect={false} messages={{ cancel: 'Done' }}>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Load route 14\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Route 14, Reno to Sacramento</ActionSheetTitle>\n <ActionSheetMessage>\n Press a pallet to add it or take it off the truck.\n </ActionSheetMessage>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem onSelect={handleToggle} value=\"P-118\">\n Pallet P-118, 24 cartons\n </ActionSheetItem>\n <ActionSheetItem onSelect={handleToggle} value=\"P-119\">\n Pallet P-119, 18 cartons\n </ActionSheetItem>\n <ActionSheetItem onSelect={handleToggle} value=\"P-124\">\n Pallet P-124, 30 cartons\n </ActionSheetItem>\n <ActionSheetSeparator />\n <ActionSheetItem closeOnSelect value=\"dispatch\">\n Dispatch route 14\n </ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n <Text size=\"sm\">Loaded: {loaded.length === 0 ? 'none' : loaded.join(', ')}</Text>\n </Inline>\n );\n}\n",
|
|
558
|
+
"verdict": "example"
|
|
559
|
+
},
|
|
560
|
+
{
|
|
561
|
+
"id": "links",
|
|
562
|
+
"title": "links.tsx",
|
|
563
|
+
"note": null,
|
|
564
|
+
"language": "tsx",
|
|
565
|
+
"source": "import {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Glyph } from '@slotted/react/icon';\n\nexport default function ActionSheetLinks() {\n return (\n <ActionSheet>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Open\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Order SO-10482</ActionSheetTitle>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem render={(props) => <a {...props} href=\"#order-SO-10482\" />}>\n Order page\n </ActionSheetItem>\n <ActionSheetItem render={(props) => <a {...props} href=\"#customer-northwind\" />}>\n Customer profile\n </ActionSheetItem>\n <ActionSheetItem\n icon={<Glyph name=\"external\" />}\n render={(props) => (\n <a\n {...props}\n href=\"https://example.com/carriers/track/1Z999AA10123456784\"\n rel=\"noreferrer\"\n target=\"_blank\"\n />\n )}\n >\n Carrier tracking\n </ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n );\n}\n",
|
|
566
|
+
"verdict": "example"
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
"id": "states",
|
|
570
|
+
"title": "states.tsx",
|
|
571
|
+
"note": null,
|
|
572
|
+
"language": "tsx",
|
|
573
|
+
"source": "import {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Glyph } from '@slotted/react/icon';\n\nexport default function ActionSheetStates() {\n return (\n <ActionSheet>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Invoice\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Invoice INV-9302</ActionSheetTitle>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem\n description=\"Needs a second approver above $5,000.\"\n icon={<Glyph name=\"circle-check\" />}\n value=\"approve\"\n >\n Approve invoice\n </ActionSheetItem>\n <ActionSheetItem\n description=\"Available after approval.\"\n disabled\n icon={<Glyph name=\"upload\" />}\n value=\"send\"\n >\n Send to accounting\n </ActionSheetItem>\n <ActionSheetItem icon={<Glyph name=\"download\" />} value=\"pdf\">\n Download PDF\n </ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n );\n}\n",
|
|
574
|
+
"verdict": "example"
|
|
575
|
+
},
|
|
576
|
+
{
|
|
577
|
+
"id": "tones",
|
|
578
|
+
"title": "tones.tsx",
|
|
579
|
+
"note": null,
|
|
580
|
+
"language": "tsx",
|
|
581
|
+
"source": "import {\n ActionSheet,\n ActionSheetCancel,\n ActionSheetContent,\n ActionSheetHeader,\n ActionSheetItem,\n ActionSheetList,\n ActionSheetMessage,\n ActionSheetTitle,\n ActionSheetTrigger,\n} from '@slotted/react/action-sheet';\nimport { Button } from '@slotted/react/button';\nimport { Glyph } from '@slotted/react/icon';\n\nexport default function ActionSheetTones() {\n return (\n <ActionSheet>\n <ActionSheetTrigger\n render={(props) => (\n <Button {...props} variant=\"outline\">\n Purchase order\n </Button>\n )}\n />\n <ActionSheetContent>\n <ActionSheetHeader>\n <ActionSheetTitle>Purchase order PO-7731</ActionSheetTitle>\n <ActionSheetMessage>Northwind Traders, 18 lines, due 14 October.</ActionSheetMessage>\n </ActionSheetHeader>\n <ActionSheetList>\n <ActionSheetItem icon={<Glyph name=\"trash\" />} tone=\"danger\" value=\"void\">\n Void purchase order\n </ActionSheetItem>\n <ActionSheetItem icon={<Glyph name=\"pause\" />} tone=\"warning\" value=\"hold\">\n Put payments on hold\n </ActionSheetItem>\n <ActionSheetItem icon={<Glyph name=\"circle-check\" />} tone=\"success\" value=\"approve\">\n Approve for purchasing\n </ActionSheetItem>\n <ActionSheetItem icon={<Glyph name=\"person\" />} tone=\"accent\" value=\"reassign\">\n Reassign buyer\n </ActionSheetItem>\n <ActionSheetItem icon={<Glyph name=\"file-archive\" />} tone=\"secondary\" value=\"archive\">\n Archive order\n </ActionSheetItem>\n </ActionSheetList>\n <ActionSheetCancel />\n </ActionSheetContent>\n </ActionSheet>\n );\n}\n",
|
|
582
|
+
"verdict": "example"
|
|
543
583
|
}
|
|
544
584
|
]
|
|
545
585
|
}
|