@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
|
@@ -0,0 +1,771 @@
|
|
|
1
|
+
<!-- index: ./index.md -->
|
|
2
|
+
# action-sheet
|
|
3
|
+
|
|
4
|
+
`data-ui="action-sheet"` · Bottom sheet of short actions for touch.
|
|
5
|
+
|
|
6
|
+
## Examples
|
|
7
|
+
|
|
8
|
+
### A trigger, the actions and the way out
|
|
9
|
+
|
|
10
|
+
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.
|
|
11
|
+
|
|
12
|
+
Excerpt — not a complete module
|
|
13
|
+
|
|
14
|
+
```tsx
|
|
15
|
+
<ActionSheet onOpenChange={(open, request) => run(request.result)}>
|
|
16
|
+
<ActionSheetTrigger>Share</ActionSheetTrigger>
|
|
17
|
+
<ActionSheetContent>
|
|
18
|
+
<ActionSheetHeader>
|
|
19
|
+
<ActionSheetTitle>Share report</ActionSheetTitle>
|
|
20
|
+
<ActionSheetMessage>Anyone who receives the link sees today's version.</ActionSheetMessage>
|
|
21
|
+
</ActionSheetHeader>
|
|
22
|
+
<ActionSheetList>
|
|
23
|
+
<ActionSheetItem value="copy" icon={<Copy />}>
|
|
24
|
+
Copy link
|
|
25
|
+
</ActionSheetItem>
|
|
26
|
+
<ActionSheetItem value="pdf" icon={<FileText />}>
|
|
27
|
+
Download PDF
|
|
28
|
+
</ActionSheetItem>
|
|
29
|
+
</ActionSheetList>
|
|
30
|
+
<ActionSheetCancel>Cancel</ActionSheetCancel>
|
|
31
|
+
</ActionSheetContent>
|
|
32
|
+
</ActionSheet>;
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### The destructive choice, at the top
|
|
36
|
+
|
|
37
|
+
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.
|
|
38
|
+
|
|
39
|
+
Excerpt — not a complete module
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
<ActionSheetList>
|
|
43
|
+
<ActionSheetItem value="delete" tone="danger">
|
|
44
|
+
Delete draft
|
|
45
|
+
</ActionSheetItem>
|
|
46
|
+
<ActionSheetItem value="save">Save draft</ActionSheetItem>
|
|
47
|
+
</ActionSheetList>;
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Groups, a rule, a second line and an action that is not available
|
|
51
|
+
|
|
52
|
+
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.
|
|
53
|
+
|
|
54
|
+
Example
|
|
55
|
+
|
|
56
|
+
```tsx
|
|
57
|
+
import {
|
|
58
|
+
ActionSheet,
|
|
59
|
+
ActionSheetCancel,
|
|
60
|
+
ActionSheetContent,
|
|
61
|
+
ActionSheetGroup,
|
|
62
|
+
ActionSheetHeader,
|
|
63
|
+
ActionSheetItem,
|
|
64
|
+
ActionSheetList,
|
|
65
|
+
ActionSheetSeparator,
|
|
66
|
+
ActionSheetTitle,
|
|
67
|
+
ActionSheetTrigger,
|
|
68
|
+
} from '@slotted/react/action-sheet';
|
|
69
|
+
import { Button } from '@slotted/react/button';
|
|
70
|
+
|
|
71
|
+
export default function ActionSheetGroups() {
|
|
72
|
+
return (
|
|
73
|
+
<ActionSheet>
|
|
74
|
+
<ActionSheetTrigger
|
|
75
|
+
render={(props) => (
|
|
76
|
+
<Button {...props} variant="outline">
|
|
77
|
+
Shipment
|
|
78
|
+
</Button>
|
|
79
|
+
)}
|
|
80
|
+
/>
|
|
81
|
+
<ActionSheetContent>
|
|
82
|
+
<ActionSheetHeader>
|
|
83
|
+
<ActionSheetTitle>Shipment SH-4471</ActionSheetTitle>
|
|
84
|
+
</ActionSheetHeader>
|
|
85
|
+
<ActionSheetList>
|
|
86
|
+
<ActionSheetGroup label="Notify">
|
|
87
|
+
<ActionSheetItem value="email-carrier">Email the carrier</ActionSheetItem>
|
|
88
|
+
<ActionSheetItem value="text-consignee">Text the consignee</ActionSheetItem>
|
|
89
|
+
</ActionSheetGroup>
|
|
90
|
+
<ActionSheetSeparator />
|
|
91
|
+
<ActionSheetGroup label="Documents">
|
|
92
|
+
<ActionSheetItem value="bill-of-lading">Download bill of lading</ActionSheetItem>
|
|
93
|
+
<ActionSheetItem value="packing-slip">Print packing slip</ActionSheetItem>
|
|
94
|
+
</ActionSheetGroup>
|
|
95
|
+
</ActionSheetList>
|
|
96
|
+
<ActionSheetCancel />
|
|
97
|
+
</ActionSheetContent>
|
|
98
|
+
</ActionSheet>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Content the sheet did not choose
|
|
104
|
+
|
|
105
|
+
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.
|
|
106
|
+
|
|
107
|
+
Excerpt — not a complete module
|
|
108
|
+
|
|
109
|
+
```tsx
|
|
110
|
+
<ActionSheetItem value="copy-ref">
|
|
111
|
+
Copy ENC-2026-0000088213-ATLANTIC-PT-LISBON-NORTH
|
|
112
|
+
</ActionSheetItem>;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### An action that takes time
|
|
116
|
+
|
|
117
|
+
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.
|
|
118
|
+
|
|
119
|
+
Example
|
|
120
|
+
|
|
121
|
+
```tsx
|
|
122
|
+
import { useState } from 'react';
|
|
123
|
+
|
|
124
|
+
import {
|
|
125
|
+
ActionSheet,
|
|
126
|
+
ActionSheetCancel,
|
|
127
|
+
ActionSheetContent,
|
|
128
|
+
ActionSheetHeader,
|
|
129
|
+
ActionSheetItem,
|
|
130
|
+
ActionSheetList,
|
|
131
|
+
ActionSheetMessage,
|
|
132
|
+
ActionSheetTitle,
|
|
133
|
+
ActionSheetTrigger,
|
|
134
|
+
} from '@slotted/react/action-sheet';
|
|
135
|
+
import type { ActionSheetSelectEvent } from '@slotted/react/action-sheet';
|
|
136
|
+
import { Button } from '@slotted/react/button';
|
|
137
|
+
import { Glyph } from '@slotted/react/icon';
|
|
138
|
+
|
|
139
|
+
export default function ActionSheetLoading() {
|
|
140
|
+
const [open, setOpen] = useState(false);
|
|
141
|
+
const [exporting, setExporting] = useState(false);
|
|
142
|
+
|
|
143
|
+
function handleExport(event: ActionSheetSelectEvent) {
|
|
144
|
+
event.preventDefault();
|
|
145
|
+
setExporting(true);
|
|
146
|
+
setTimeout(() => {
|
|
147
|
+
setExporting(false);
|
|
148
|
+
setOpen(false);
|
|
149
|
+
}, 2500);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<ActionSheet open={open} onOpenChange={setOpen}>
|
|
154
|
+
<ActionSheetTrigger
|
|
155
|
+
render={(props) => (
|
|
156
|
+
<Button {...props} variant="outline">
|
|
157
|
+
October invoices
|
|
158
|
+
</Button>
|
|
159
|
+
)}
|
|
160
|
+
/>
|
|
161
|
+
<ActionSheetContent>
|
|
162
|
+
<ActionSheetHeader>
|
|
163
|
+
<ActionSheetTitle>October invoices</ActionSheetTitle>
|
|
164
|
+
<ActionSheetMessage>142 invoices, $318,450.00.</ActionSheetMessage>
|
|
165
|
+
</ActionSheetHeader>
|
|
166
|
+
<ActionSheetList>
|
|
167
|
+
<ActionSheetItem
|
|
168
|
+
icon={<Glyph name="file-spreadsheet" />}
|
|
169
|
+
loading={exporting}
|
|
170
|
+
onSelect={handleExport}
|
|
171
|
+
value="export"
|
|
172
|
+
>
|
|
173
|
+
Export as CSV
|
|
174
|
+
</ActionSheetItem>
|
|
175
|
+
<ActionSheetItem icon={<Glyph name="file-text" />} value="summary">
|
|
176
|
+
Print summary
|
|
177
|
+
</ActionSheetItem>
|
|
178
|
+
</ActionSheetList>
|
|
179
|
+
<ActionSheetCancel />
|
|
180
|
+
</ActionSheetContent>
|
|
181
|
+
</ActionSheet>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
### Modal, or beside the page
|
|
187
|
+
|
|
188
|
+
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.
|
|
189
|
+
|
|
190
|
+
Example
|
|
191
|
+
|
|
192
|
+
```tsx
|
|
193
|
+
import { useState } from 'react';
|
|
194
|
+
|
|
195
|
+
import {
|
|
196
|
+
ActionSheet,
|
|
197
|
+
ActionSheetCancel,
|
|
198
|
+
ActionSheetContent,
|
|
199
|
+
ActionSheetHeader,
|
|
200
|
+
ActionSheetItem,
|
|
201
|
+
ActionSheetList,
|
|
202
|
+
ActionSheetMessage,
|
|
203
|
+
ActionSheetTitle,
|
|
204
|
+
ActionSheetTrigger,
|
|
205
|
+
} from '@slotted/react/action-sheet';
|
|
206
|
+
import { Button } from '@slotted/react/button';
|
|
207
|
+
import { Inline } from '@slotted/react/inline';
|
|
208
|
+
|
|
209
|
+
export default function ActionSheetModal() {
|
|
210
|
+
const [scanned, setScanned] = useState(0);
|
|
211
|
+
|
|
212
|
+
return (
|
|
213
|
+
<Inline align="center" gap={3}>
|
|
214
|
+
<ActionSheet modal={false}>
|
|
215
|
+
<ActionSheetTrigger
|
|
216
|
+
render={(props) => (
|
|
217
|
+
<Button {...props} variant="outline">
|
|
218
|
+
Dock 3 actions
|
|
219
|
+
</Button>
|
|
220
|
+
)}
|
|
221
|
+
/>
|
|
222
|
+
<ActionSheetContent>
|
|
223
|
+
<ActionSheetHeader>
|
|
224
|
+
<ActionSheetTitle>Dock 3 receiving</ActionSheetTitle>
|
|
225
|
+
<ActionSheetMessage>Keep scanning while this sheet stays open.</ActionSheetMessage>
|
|
226
|
+
</ActionSheetHeader>
|
|
227
|
+
<ActionSheetList>
|
|
228
|
+
<ActionSheetItem tone="warning" value="damaged">
|
|
229
|
+
Flag damaged parcel
|
|
230
|
+
</ActionSheetItem>
|
|
231
|
+
<ActionSheetItem value="inspection">Hold for inspection</ActionSheetItem>
|
|
232
|
+
</ActionSheetList>
|
|
233
|
+
<ActionSheetCancel />
|
|
234
|
+
</ActionSheetContent>
|
|
235
|
+
</ActionSheet>
|
|
236
|
+
<Button onClick={() => setScanned((count) => count + 1)}>Scan parcel ({scanned})</Button>
|
|
237
|
+
</Inline>
|
|
238
|
+
);
|
|
239
|
+
}
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### What may close it
|
|
243
|
+
|
|
244
|
+
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.
|
|
245
|
+
|
|
246
|
+
Example
|
|
247
|
+
|
|
248
|
+
```tsx
|
|
249
|
+
import {
|
|
250
|
+
ActionSheet,
|
|
251
|
+
ActionSheetCancel,
|
|
252
|
+
ActionSheetContent,
|
|
253
|
+
ActionSheetHeader,
|
|
254
|
+
ActionSheetItem,
|
|
255
|
+
ActionSheetList,
|
|
256
|
+
ActionSheetMessage,
|
|
257
|
+
ActionSheetTitle,
|
|
258
|
+
ActionSheetTrigger,
|
|
259
|
+
} from '@slotted/react/action-sheet';
|
|
260
|
+
import { Button } from '@slotted/react/button';
|
|
261
|
+
|
|
262
|
+
export default function ActionSheetPolicy() {
|
|
263
|
+
return (
|
|
264
|
+
<ActionSheet back="none" escape="none" outsidePress="none">
|
|
265
|
+
<ActionSheetTrigger
|
|
266
|
+
render={(props) => (
|
|
267
|
+
<Button {...props} variant="outline">
|
|
268
|
+
Adjust stock
|
|
269
|
+
</Button>
|
|
270
|
+
)}
|
|
271
|
+
/>
|
|
272
|
+
<ActionSheetContent>
|
|
273
|
+
<ActionSheetHeader>
|
|
274
|
+
<ActionSheetTitle>Inventory adjustment</ActionSheetTitle>
|
|
275
|
+
<ActionSheetMessage>SKU 40-1182 in Reno: 140 on hand, 132 counted.</ActionSheetMessage>
|
|
276
|
+
</ActionSheetHeader>
|
|
277
|
+
<ActionSheetList>
|
|
278
|
+
<ActionSheetItem value="apply">Apply adjustment of -8</ActionSheetItem>
|
|
279
|
+
<ActionSheetItem value="recount">Request a recount</ActionSheetItem>
|
|
280
|
+
</ActionSheetList>
|
|
281
|
+
<ActionSheetCancel />
|
|
282
|
+
</ActionSheetContent>
|
|
283
|
+
</ActionSheet>
|
|
284
|
+
);
|
|
285
|
+
}
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Where focus enters, and where it goes back
|
|
289
|
+
|
|
290
|
+
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.
|
|
291
|
+
|
|
292
|
+
Example
|
|
293
|
+
|
|
294
|
+
```tsx
|
|
295
|
+
import { useRef } from 'react';
|
|
296
|
+
|
|
297
|
+
import {
|
|
298
|
+
ActionSheet,
|
|
299
|
+
ActionSheetCancel,
|
|
300
|
+
ActionSheetContent,
|
|
301
|
+
ActionSheetHeader,
|
|
302
|
+
ActionSheetItem,
|
|
303
|
+
ActionSheetList,
|
|
304
|
+
ActionSheetTitle,
|
|
305
|
+
ActionSheetTrigger,
|
|
306
|
+
} from '@slotted/react/action-sheet';
|
|
307
|
+
import { Button } from '@slotted/react/button';
|
|
308
|
+
import { Inline } from '@slotted/react/inline';
|
|
309
|
+
|
|
310
|
+
export default function ActionSheetFocus() {
|
|
311
|
+
const reprint = useRef<HTMLButtonElement>(null);
|
|
312
|
+
const next = useRef<HTMLButtonElement>(null);
|
|
313
|
+
|
|
314
|
+
return (
|
|
315
|
+
<Inline align="center" gap={3}>
|
|
316
|
+
<ActionSheet finalFocus={next} initialFocus={reprint}>
|
|
317
|
+
<ActionSheetTrigger
|
|
318
|
+
render={(props) => (
|
|
319
|
+
<Button {...props} variant="outline">
|
|
320
|
+
Label actions
|
|
321
|
+
</Button>
|
|
322
|
+
)}
|
|
323
|
+
/>
|
|
324
|
+
<ActionSheetContent>
|
|
325
|
+
<ActionSheetHeader>
|
|
326
|
+
<ActionSheetTitle>Shipment SH-4471</ActionSheetTitle>
|
|
327
|
+
</ActionSheetHeader>
|
|
328
|
+
<ActionSheetList>
|
|
329
|
+
<ActionSheetItem value="slip">Print packing slip</ActionSheetItem>
|
|
330
|
+
<ActionSheetItem ref={reprint} value="reprint">
|
|
331
|
+
Reprint shipping label
|
|
332
|
+
</ActionSheetItem>
|
|
333
|
+
<ActionSheetItem value="void">Void shipping label</ActionSheetItem>
|
|
334
|
+
</ActionSheetList>
|
|
335
|
+
<ActionSheetCancel />
|
|
336
|
+
</ActionSheetContent>
|
|
337
|
+
</ActionSheet>
|
|
338
|
+
<Button ref={next} variant="ghost">
|
|
339
|
+
Scan next parcel
|
|
340
|
+
</Button>
|
|
341
|
+
</Inline>
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### Which action was chosen, and why it closed
|
|
347
|
+
|
|
348
|
+
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.
|
|
349
|
+
|
|
350
|
+
Example
|
|
351
|
+
|
|
352
|
+
```tsx
|
|
353
|
+
import { useState } from 'react';
|
|
354
|
+
|
|
355
|
+
import {
|
|
356
|
+
ActionSheet,
|
|
357
|
+
ActionSheetCancel,
|
|
358
|
+
ActionSheetContent,
|
|
359
|
+
ActionSheetHeader,
|
|
360
|
+
ActionSheetItem,
|
|
361
|
+
ActionSheetList,
|
|
362
|
+
ActionSheetTitle,
|
|
363
|
+
ActionSheetTrigger,
|
|
364
|
+
} from '@slotted/react/action-sheet';
|
|
365
|
+
import type { ActionSheetChangeRequest } from '@slotted/react/action-sheet';
|
|
366
|
+
import { Button } from '@slotted/react/button';
|
|
367
|
+
import { Inline } from '@slotted/react/inline';
|
|
368
|
+
import { Text } from '@slotted/react/typography';
|
|
369
|
+
|
|
370
|
+
export default function ActionSheetResult() {
|
|
371
|
+
const [open, setOpen] = useState(false);
|
|
372
|
+
const [last, setLast] = useState('none');
|
|
373
|
+
|
|
374
|
+
function handleOpenChange(next: boolean, request: ActionSheetChangeRequest) {
|
|
375
|
+
setOpen(next);
|
|
376
|
+
setLast(request.result === undefined ? request.reason : `${request.reason}: ${request.result}`);
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
return (
|
|
380
|
+
<Inline align="center" gap={3}>
|
|
381
|
+
<ActionSheet open={open} onOpenChange={handleOpenChange}>
|
|
382
|
+
<ActionSheetTrigger
|
|
383
|
+
render={(props) => (
|
|
384
|
+
<Button {...props} variant="outline">
|
|
385
|
+
Ticket
|
|
386
|
+
</Button>
|
|
387
|
+
)}
|
|
388
|
+
/>
|
|
389
|
+
<ActionSheetContent>
|
|
390
|
+
<ActionSheetHeader>
|
|
391
|
+
<ActionSheetTitle>Support ticket T-3306</ActionSheetTitle>
|
|
392
|
+
</ActionSheetHeader>
|
|
393
|
+
<ActionSheetList>
|
|
394
|
+
<ActionSheetItem value="assign">Assign to me</ActionSheetItem>
|
|
395
|
+
<ActionSheetItem value="escalate">Escalate to billing</ActionSheetItem>
|
|
396
|
+
<ActionSheetItem value="resolve">Mark as resolved</ActionSheetItem>
|
|
397
|
+
</ActionSheetList>
|
|
398
|
+
<ActionSheetCancel />
|
|
399
|
+
</ActionSheetContent>
|
|
400
|
+
</ActionSheet>
|
|
401
|
+
<Text size="sm">Last request: {last}</Text>
|
|
402
|
+
</Inline>
|
|
403
|
+
);
|
|
404
|
+
}
|
|
405
|
+
```
|
|
406
|
+
|
|
407
|
+
### One list of actions, a menu on a pointer and a sheet on a phone
|
|
408
|
+
|
|
409
|
+
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.
|
|
410
|
+
|
|
411
|
+
Excerpt — not a complete module
|
|
412
|
+
|
|
413
|
+
```tsx
|
|
414
|
+
const coarse = useMediaQuery('(pointer: coarse)');
|
|
415
|
+
|
|
416
|
+
coarse ? (
|
|
417
|
+
<ActionSheet>
|
|
418
|
+
<ActionSheetTrigger>More</ActionSheetTrigger>
|
|
419
|
+
<ActionSheetContent aria-label="Actions">
|
|
420
|
+
<ActionSheetList aria-label="Actions">
|
|
421
|
+
{actions.map((action) => (
|
|
422
|
+
<ActionSheetItem key={action.value} {...action} />
|
|
423
|
+
))}
|
|
424
|
+
</ActionSheetList>
|
|
425
|
+
<ActionSheetCancel />
|
|
426
|
+
</ActionSheetContent>
|
|
427
|
+
</ActionSheet>
|
|
428
|
+
) : (
|
|
429
|
+
<Menu>
|
|
430
|
+
<MenuTrigger>More</MenuTrigger>
|
|
431
|
+
<MenuContent aria-label="Actions">
|
|
432
|
+
{actions.map((action) => (
|
|
433
|
+
<MenuItem key={action.value} {...action} />
|
|
434
|
+
))}
|
|
435
|
+
</MenuContent>
|
|
436
|
+
</Menu>
|
|
437
|
+
);
|
|
438
|
+
```
|
|
439
|
+
|
|
440
|
+
### Decided once for the application
|
|
441
|
+
|
|
442
|
+
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).
|
|
443
|
+
|
|
444
|
+
Example
|
|
445
|
+
|
|
446
|
+
```tsx
|
|
447
|
+
import {
|
|
448
|
+
ActionSheet,
|
|
449
|
+
ActionSheetCancel,
|
|
450
|
+
ActionSheetContent,
|
|
451
|
+
ActionSheetDefaultsProvider,
|
|
452
|
+
ActionSheetHeader,
|
|
453
|
+
ActionSheetItem,
|
|
454
|
+
ActionSheetList,
|
|
455
|
+
ActionSheetTitle,
|
|
456
|
+
ActionSheetTrigger,
|
|
457
|
+
} from '@slotted/react/action-sheet';
|
|
458
|
+
import { Button } from '@slotted/react/button';
|
|
459
|
+
import { Inline } from '@slotted/react/inline';
|
|
460
|
+
|
|
461
|
+
export default function ActionSheetDefaults() {
|
|
462
|
+
return (
|
|
463
|
+
<ActionSheetDefaultsProvider closeOnSelect={false} outsidePress="none">
|
|
464
|
+
<Inline gap={3}>
|
|
465
|
+
<ActionSheet>
|
|
466
|
+
<ActionSheetTrigger
|
|
467
|
+
render={(props) => (
|
|
468
|
+
<Button {...props} variant="outline">
|
|
469
|
+
Picking
|
|
470
|
+
</Button>
|
|
471
|
+
)}
|
|
472
|
+
/>
|
|
473
|
+
<ActionSheetContent>
|
|
474
|
+
<ActionSheetHeader>
|
|
475
|
+
<ActionSheetTitle>Picking wave 22</ActionSheetTitle>
|
|
476
|
+
</ActionSheetHeader>
|
|
477
|
+
<ActionSheetList>
|
|
478
|
+
<ActionSheetItem value="start">Start picking</ActionSheetItem>
|
|
479
|
+
<ActionSheetItem value="pause">Pause the wave</ActionSheetItem>
|
|
480
|
+
</ActionSheetList>
|
|
481
|
+
<ActionSheetCancel />
|
|
482
|
+
</ActionSheetContent>
|
|
483
|
+
</ActionSheet>
|
|
484
|
+
<ActionSheet closeOnSelect>
|
|
485
|
+
<ActionSheetTrigger
|
|
486
|
+
render={(props) => (
|
|
487
|
+
<Button {...props} variant="outline">
|
|
488
|
+
Packing
|
|
489
|
+
</Button>
|
|
490
|
+
)}
|
|
491
|
+
/>
|
|
492
|
+
<ActionSheetContent>
|
|
493
|
+
<ActionSheetHeader>
|
|
494
|
+
<ActionSheetTitle>Packing bench 6</ActionSheetTitle>
|
|
495
|
+
</ActionSheetHeader>
|
|
496
|
+
<ActionSheetList>
|
|
497
|
+
<ActionSheetItem value="print">Print labels</ActionSheetItem>
|
|
498
|
+
<ActionSheetItem value="close">Close the bench</ActionSheetItem>
|
|
499
|
+
</ActionSheetList>
|
|
500
|
+
<ActionSheetCancel />
|
|
501
|
+
</ActionSheetContent>
|
|
502
|
+
</ActionSheet>
|
|
503
|
+
</Inline>
|
|
504
|
+
</ActionSheetDefaultsProvider>
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
```
|
|
508
|
+
|
|
509
|
+
### The keyboard
|
|
510
|
+
|
|
511
|
+
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.
|
|
512
|
+
|
|
513
|
+
Excerpt — not a complete module
|
|
514
|
+
|
|
515
|
+
```tsx
|
|
516
|
+
<ActionSheetItem value="flag" textValue="Flag">
|
|
517
|
+
<FlagBadge /> Flag
|
|
518
|
+
</ActionSheetItem>;
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
### keep-open.tsx
|
|
522
|
+
|
|
523
|
+
Example
|
|
524
|
+
|
|
525
|
+
```tsx
|
|
526
|
+
import { useState } from 'react';
|
|
527
|
+
|
|
528
|
+
import {
|
|
529
|
+
ActionSheet,
|
|
530
|
+
ActionSheetCancel,
|
|
531
|
+
ActionSheetContent,
|
|
532
|
+
ActionSheetHeader,
|
|
533
|
+
ActionSheetItem,
|
|
534
|
+
ActionSheetList,
|
|
535
|
+
ActionSheetMessage,
|
|
536
|
+
ActionSheetSeparator,
|
|
537
|
+
ActionSheetTitle,
|
|
538
|
+
ActionSheetTrigger,
|
|
539
|
+
} from '@slotted/react/action-sheet';
|
|
540
|
+
import type { ActionSheetSelectEvent } from '@slotted/react/action-sheet';
|
|
541
|
+
import { Button } from '@slotted/react/button';
|
|
542
|
+
import { Inline } from '@slotted/react/inline';
|
|
543
|
+
import { Text } from '@slotted/react/typography';
|
|
544
|
+
|
|
545
|
+
export default function ActionSheetKeepOpen() {
|
|
546
|
+
const [loaded, setLoaded] = useState<string[]>([]);
|
|
547
|
+
|
|
548
|
+
function handleToggle(event: ActionSheetSelectEvent) {
|
|
549
|
+
const pallet = event.value ?? '';
|
|
550
|
+
setLoaded((current) =>
|
|
551
|
+
current.includes(pallet) ? current.filter((id) => id !== pallet) : [...current, pallet],
|
|
552
|
+
);
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
return (
|
|
556
|
+
<Inline align="center" gap={3}>
|
|
557
|
+
<ActionSheet closeOnSelect={false} messages={{ cancel: 'Done' }}>
|
|
558
|
+
<ActionSheetTrigger
|
|
559
|
+
render={(props) => (
|
|
560
|
+
<Button {...props} variant="outline">
|
|
561
|
+
Load route 14
|
|
562
|
+
</Button>
|
|
563
|
+
)}
|
|
564
|
+
/>
|
|
565
|
+
<ActionSheetContent>
|
|
566
|
+
<ActionSheetHeader>
|
|
567
|
+
<ActionSheetTitle>Route 14, Reno to Sacramento</ActionSheetTitle>
|
|
568
|
+
<ActionSheetMessage>
|
|
569
|
+
Press a pallet to add it or take it off the truck.
|
|
570
|
+
</ActionSheetMessage>
|
|
571
|
+
</ActionSheetHeader>
|
|
572
|
+
<ActionSheetList>
|
|
573
|
+
<ActionSheetItem onSelect={handleToggle} value="P-118">
|
|
574
|
+
Pallet P-118, 24 cartons
|
|
575
|
+
</ActionSheetItem>
|
|
576
|
+
<ActionSheetItem onSelect={handleToggle} value="P-119">
|
|
577
|
+
Pallet P-119, 18 cartons
|
|
578
|
+
</ActionSheetItem>
|
|
579
|
+
<ActionSheetItem onSelect={handleToggle} value="P-124">
|
|
580
|
+
Pallet P-124, 30 cartons
|
|
581
|
+
</ActionSheetItem>
|
|
582
|
+
<ActionSheetSeparator />
|
|
583
|
+
<ActionSheetItem closeOnSelect value="dispatch">
|
|
584
|
+
Dispatch route 14
|
|
585
|
+
</ActionSheetItem>
|
|
586
|
+
</ActionSheetList>
|
|
587
|
+
<ActionSheetCancel />
|
|
588
|
+
</ActionSheetContent>
|
|
589
|
+
</ActionSheet>
|
|
590
|
+
<Text size="sm">Loaded: {loaded.length === 0 ? 'none' : loaded.join(', ')}</Text>
|
|
591
|
+
</Inline>
|
|
592
|
+
);
|
|
593
|
+
}
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
### links.tsx
|
|
597
|
+
|
|
598
|
+
Example
|
|
599
|
+
|
|
600
|
+
```tsx
|
|
601
|
+
import {
|
|
602
|
+
ActionSheet,
|
|
603
|
+
ActionSheetCancel,
|
|
604
|
+
ActionSheetContent,
|
|
605
|
+
ActionSheetHeader,
|
|
606
|
+
ActionSheetItem,
|
|
607
|
+
ActionSheetList,
|
|
608
|
+
ActionSheetTitle,
|
|
609
|
+
ActionSheetTrigger,
|
|
610
|
+
} from '@slotted/react/action-sheet';
|
|
611
|
+
import { Button } from '@slotted/react/button';
|
|
612
|
+
import { Glyph } from '@slotted/react/icon';
|
|
613
|
+
|
|
614
|
+
export default function ActionSheetLinks() {
|
|
615
|
+
return (
|
|
616
|
+
<ActionSheet>
|
|
617
|
+
<ActionSheetTrigger
|
|
618
|
+
render={(props) => (
|
|
619
|
+
<Button {...props} variant="outline">
|
|
620
|
+
Open
|
|
621
|
+
</Button>
|
|
622
|
+
)}
|
|
623
|
+
/>
|
|
624
|
+
<ActionSheetContent>
|
|
625
|
+
<ActionSheetHeader>
|
|
626
|
+
<ActionSheetTitle>Order SO-10482</ActionSheetTitle>
|
|
627
|
+
</ActionSheetHeader>
|
|
628
|
+
<ActionSheetList>
|
|
629
|
+
<ActionSheetItem render={(props) => <a {...props} href="#order-SO-10482" />}>
|
|
630
|
+
Order page
|
|
631
|
+
</ActionSheetItem>
|
|
632
|
+
<ActionSheetItem render={(props) => <a {...props} href="#customer-northwind" />}>
|
|
633
|
+
Customer profile
|
|
634
|
+
</ActionSheetItem>
|
|
635
|
+
<ActionSheetItem
|
|
636
|
+
icon={<Glyph name="external" />}
|
|
637
|
+
render={(props) => (
|
|
638
|
+
<a
|
|
639
|
+
{...props}
|
|
640
|
+
href="https://example.com/carriers/track/1Z999AA10123456784"
|
|
641
|
+
rel="noreferrer"
|
|
642
|
+
target="_blank"
|
|
643
|
+
/>
|
|
644
|
+
)}
|
|
645
|
+
>
|
|
646
|
+
Carrier tracking
|
|
647
|
+
</ActionSheetItem>
|
|
648
|
+
</ActionSheetList>
|
|
649
|
+
<ActionSheetCancel />
|
|
650
|
+
</ActionSheetContent>
|
|
651
|
+
</ActionSheet>
|
|
652
|
+
);
|
|
653
|
+
}
|
|
654
|
+
```
|
|
655
|
+
|
|
656
|
+
### states.tsx
|
|
657
|
+
|
|
658
|
+
Example
|
|
659
|
+
|
|
660
|
+
```tsx
|
|
661
|
+
import {
|
|
662
|
+
ActionSheet,
|
|
663
|
+
ActionSheetCancel,
|
|
664
|
+
ActionSheetContent,
|
|
665
|
+
ActionSheetHeader,
|
|
666
|
+
ActionSheetItem,
|
|
667
|
+
ActionSheetList,
|
|
668
|
+
ActionSheetTitle,
|
|
669
|
+
ActionSheetTrigger,
|
|
670
|
+
} from '@slotted/react/action-sheet';
|
|
671
|
+
import { Button } from '@slotted/react/button';
|
|
672
|
+
import { Glyph } from '@slotted/react/icon';
|
|
673
|
+
|
|
674
|
+
export default function ActionSheetStates() {
|
|
675
|
+
return (
|
|
676
|
+
<ActionSheet>
|
|
677
|
+
<ActionSheetTrigger
|
|
678
|
+
render={(props) => (
|
|
679
|
+
<Button {...props} variant="outline">
|
|
680
|
+
Invoice
|
|
681
|
+
</Button>
|
|
682
|
+
)}
|
|
683
|
+
/>
|
|
684
|
+
<ActionSheetContent>
|
|
685
|
+
<ActionSheetHeader>
|
|
686
|
+
<ActionSheetTitle>Invoice INV-9302</ActionSheetTitle>
|
|
687
|
+
</ActionSheetHeader>
|
|
688
|
+
<ActionSheetList>
|
|
689
|
+
<ActionSheetItem
|
|
690
|
+
description="Needs a second approver above $5,000."
|
|
691
|
+
icon={<Glyph name="circle-check" />}
|
|
692
|
+
value="approve"
|
|
693
|
+
>
|
|
694
|
+
Approve invoice
|
|
695
|
+
</ActionSheetItem>
|
|
696
|
+
<ActionSheetItem
|
|
697
|
+
description="Available after approval."
|
|
698
|
+
disabled
|
|
699
|
+
icon={<Glyph name="upload" />}
|
|
700
|
+
value="send"
|
|
701
|
+
>
|
|
702
|
+
Send to accounting
|
|
703
|
+
</ActionSheetItem>
|
|
704
|
+
<ActionSheetItem icon={<Glyph name="download" />} value="pdf">
|
|
705
|
+
Download PDF
|
|
706
|
+
</ActionSheetItem>
|
|
707
|
+
</ActionSheetList>
|
|
708
|
+
<ActionSheetCancel />
|
|
709
|
+
</ActionSheetContent>
|
|
710
|
+
</ActionSheet>
|
|
711
|
+
);
|
|
712
|
+
}
|
|
713
|
+
```
|
|
714
|
+
|
|
715
|
+
### tones.tsx
|
|
716
|
+
|
|
717
|
+
Example
|
|
718
|
+
|
|
719
|
+
```tsx
|
|
720
|
+
import {
|
|
721
|
+
ActionSheet,
|
|
722
|
+
ActionSheetCancel,
|
|
723
|
+
ActionSheetContent,
|
|
724
|
+
ActionSheetHeader,
|
|
725
|
+
ActionSheetItem,
|
|
726
|
+
ActionSheetList,
|
|
727
|
+
ActionSheetMessage,
|
|
728
|
+
ActionSheetTitle,
|
|
729
|
+
ActionSheetTrigger,
|
|
730
|
+
} from '@slotted/react/action-sheet';
|
|
731
|
+
import { Button } from '@slotted/react/button';
|
|
732
|
+
import { Glyph } from '@slotted/react/icon';
|
|
733
|
+
|
|
734
|
+
export default function ActionSheetTones() {
|
|
735
|
+
return (
|
|
736
|
+
<ActionSheet>
|
|
737
|
+
<ActionSheetTrigger
|
|
738
|
+
render={(props) => (
|
|
739
|
+
<Button {...props} variant="outline">
|
|
740
|
+
Purchase order
|
|
741
|
+
</Button>
|
|
742
|
+
)}
|
|
743
|
+
/>
|
|
744
|
+
<ActionSheetContent>
|
|
745
|
+
<ActionSheetHeader>
|
|
746
|
+
<ActionSheetTitle>Purchase order PO-7731</ActionSheetTitle>
|
|
747
|
+
<ActionSheetMessage>Northwind Traders, 18 lines, due 14 October.</ActionSheetMessage>
|
|
748
|
+
</ActionSheetHeader>
|
|
749
|
+
<ActionSheetList>
|
|
750
|
+
<ActionSheetItem icon={<Glyph name="trash" />} tone="danger" value="void">
|
|
751
|
+
Void purchase order
|
|
752
|
+
</ActionSheetItem>
|
|
753
|
+
<ActionSheetItem icon={<Glyph name="pause" />} tone="warning" value="hold">
|
|
754
|
+
Put payments on hold
|
|
755
|
+
</ActionSheetItem>
|
|
756
|
+
<ActionSheetItem icon={<Glyph name="circle-check" />} tone="success" value="approve">
|
|
757
|
+
Approve for purchasing
|
|
758
|
+
</ActionSheetItem>
|
|
759
|
+
<ActionSheetItem icon={<Glyph name="person" />} tone="accent" value="reassign">
|
|
760
|
+
Reassign buyer
|
|
761
|
+
</ActionSheetItem>
|
|
762
|
+
<ActionSheetItem icon={<Glyph name="file-archive" />} tone="secondary" value="archive">
|
|
763
|
+
Archive order
|
|
764
|
+
</ActionSheetItem>
|
|
765
|
+
</ActionSheetList>
|
|
766
|
+
<ActionSheetCancel />
|
|
767
|
+
</ActionSheetContent>
|
|
768
|
+
</ActionSheet>
|
|
769
|
+
);
|
|
770
|
+
}
|
|
771
|
+
```
|