@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
package/dist/docs/accordion.json
CHANGED
|
@@ -94,91 +94,91 @@
|
|
|
94
94
|
"type": "readonly string[]",
|
|
95
95
|
"defaultValue": "—",
|
|
96
96
|
"appliesTo": "Accordion",
|
|
97
|
-
"description": "Present means the consumer owns the set of open panels, for the life of the component. Each entry is a Collapsible’s value"
|
|
97
|
+
"description": "Present means the consumer owns the set of open panels, for the life of the component. Each entry is a Collapsible’s value."
|
|
98
98
|
},
|
|
99
99
|
{
|
|
100
100
|
"name": "defaultValue",
|
|
101
101
|
"type": "readonly string[]",
|
|
102
102
|
"defaultValue": "—",
|
|
103
103
|
"appliesTo": "Accordion",
|
|
104
|
-
"description": "The set an uncontrolled accordion starts from, read once. A later change to it does not silently become new state"
|
|
104
|
+
"description": "The set an uncontrolled accordion starts from, read once. A later change to it does not silently become new state."
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
"name": "multiple",
|
|
108
108
|
"type": "boolean",
|
|
109
109
|
"defaultValue": "false",
|
|
110
110
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
111
|
-
"description": "Whether more than one panel may be open. With it off, opening one closes the one that was, and that panel is told the reason was select"
|
|
111
|
+
"description": "Whether more than one panel may be open. With it off, opening one closes the one that was, and that panel is told the reason was select."
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
"name": "requireOpen",
|
|
115
115
|
"type": "boolean",
|
|
116
116
|
"defaultValue": "false",
|
|
117
117
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
118
|
-
"description": "Whether the set refuses to empty. The one open header then carries aria-disabled=\"true\", which is what the pattern asks of an accordion that does not permit its panel to be collapsed"
|
|
118
|
+
"description": "Whether the set refuses to empty. The one open header then carries aria-disabled=\"true\", which is what the pattern asks of an accordion that does not permit its panel to be collapsed."
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
"name": "loop",
|
|
122
122
|
"type": "boolean",
|
|
123
123
|
"defaultValue": "true",
|
|
124
124
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
125
|
-
"description": "Whether the arrow keys wrap past the ends of the set"
|
|
125
|
+
"description": "Whether the arrow keys wrap past the ends of the set."
|
|
126
126
|
},
|
|
127
127
|
{
|
|
128
128
|
"name": "size",
|
|
129
129
|
"type": "'sm' | 'md' | 'lg'",
|
|
130
130
|
"defaultValue": "md",
|
|
131
131
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
132
|
-
"description": "The step every item sits at, and the air between cards under separated"
|
|
132
|
+
"description": "The step every item sits at, and the air between cards under separated."
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"name": "variant",
|
|
136
136
|
"type": "'plain' | 'ruled' | 'framed' | 'separated'",
|
|
137
137
|
"defaultValue": "ruled",
|
|
138
138
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
139
|
-
"description": "How the set is drawn. Each value maps onto the item variant the set hands over: plain to plain, ruled and framed to ruled, separated to framed. The set never selects into an item to draw it"
|
|
139
|
+
"description": "How the set is drawn. Each value maps onto the item variant the set hands over: plain to plain, ruled and framed to ruled, separated to framed. The set never selects into an item to draw it."
|
|
140
140
|
},
|
|
141
141
|
{
|
|
142
142
|
"name": "indicator",
|
|
143
143
|
"type": "'chevron' | 'plus-minus' | 'none'",
|
|
144
144
|
"defaultValue": "chevron",
|
|
145
145
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
146
|
-
"description": "The mark every header carries, handed to each item"
|
|
146
|
+
"description": "The mark every header carries, handed to each item."
|
|
147
147
|
},
|
|
148
148
|
{
|
|
149
149
|
"name": "togglePlacement",
|
|
150
150
|
"type": "'end' | 'start'",
|
|
151
151
|
"defaultValue": "end",
|
|
152
152
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
153
|
-
"description": "Which side of the words that mark stands on, handed to each item"
|
|
153
|
+
"description": "Which side of the words that mark stands on, handed to each item."
|
|
154
154
|
},
|
|
155
155
|
{
|
|
156
156
|
"name": "headingLevel",
|
|
157
157
|
"type": "'none' | '1' | '2' | '3' | '4' | '5' | '6'",
|
|
158
158
|
"defaultValue": "3",
|
|
159
159
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
160
|
-
"description": "The heading element every item’s header renders as. 3 is the level the pattern’s own example uses for a set inside a section"
|
|
160
|
+
"description": "The heading element every item’s header renders as. 3 is the level the pattern’s own example uses for a set inside a section."
|
|
161
161
|
},
|
|
162
162
|
{
|
|
163
163
|
"name": "mount",
|
|
164
164
|
"type": "'active' | 'lazy' | 'eager' | 'until-found'",
|
|
165
165
|
"defaultValue": "eager",
|
|
166
166
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
167
|
-
"description": "When each panel’s content exists, handed to every item"
|
|
167
|
+
"description": "When each panel’s content exists, handed to every item."
|
|
168
168
|
},
|
|
169
169
|
{
|
|
170
170
|
"name": "truncate",
|
|
171
171
|
"type": "boolean",
|
|
172
172
|
"defaultValue": "false",
|
|
173
173
|
"appliesTo": "Accordion, AccordionDefaultsProvider",
|
|
174
|
-
"description": "Clips every title to one line instead of letting the row grow"
|
|
174
|
+
"description": "Clips every title to one line instead of letting the row grow."
|
|
175
175
|
},
|
|
176
176
|
{
|
|
177
177
|
"name": "disabled",
|
|
178
178
|
"type": "boolean",
|
|
179
179
|
"defaultValue": "false",
|
|
180
180
|
"appliesTo": "Accordion",
|
|
181
|
-
"description": "Reaches every item, and every trigger as the native attribute"
|
|
181
|
+
"description": "Reaches every item, and every trigger as the native attribute."
|
|
182
182
|
}
|
|
183
183
|
],
|
|
184
184
|
"composition": [
|
|
@@ -187,35 +187,35 @@
|
|
|
187
187
|
"type": "Ref<AccordionHandle>",
|
|
188
188
|
"defaultValue": "—",
|
|
189
189
|
"appliesTo": "Accordion",
|
|
190
|
-
"description": "openAll() and closeAll(), the two moves an array cannot express while the family owns the array. They are on a handle of their own so ref keeps reaching the element, which is the rule for every other family here"
|
|
190
|
+
"description": "openAll() and closeAll(), the two moves an array cannot express while the family owns the array. They are on a handle of their own so ref keeps reaching the element, which is the rule for every other family here."
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
193
|
"name": "render",
|
|
194
194
|
"type": "(props) => ReactNode",
|
|
195
195
|
"defaultValue": "—",
|
|
196
196
|
"appliesTo": "Accordion",
|
|
197
|
-
"description": "Substitutes the set’s root and hands it every attribute — a set of sections can be a real section element"
|
|
197
|
+
"description": "Substitutes the set’s root and hands it every attribute — a set of sections can be a real section element."
|
|
198
198
|
},
|
|
199
199
|
{
|
|
200
200
|
"name": "ref",
|
|
201
201
|
"type": "Ref<HTMLElement>",
|
|
202
202
|
"defaultValue": "—",
|
|
203
203
|
"appliesTo": "Accordion",
|
|
204
|
-
"description": "Reaches the element itself, so the platform’s own methods are the platform’s"
|
|
204
|
+
"description": "Reaches the element itself, so the platform’s own methods are the platform’s."
|
|
205
205
|
},
|
|
206
206
|
{
|
|
207
207
|
"name": "useAccordion()",
|
|
208
208
|
"type": "() => AccordionContextValue | undefined",
|
|
209
209
|
"defaultValue": "—",
|
|
210
210
|
"appliesTo": "inside Accordion",
|
|
211
|
-
"description": "What each item reads: the axes the set hands over, whether a value is open, whether it is held open, and toggle(value, reason). It is undefined outside a set rather than a throw, because a Collapsible standing alone is a complete component"
|
|
211
|
+
"description": "What each item reads: the axes the set hands over, whether a value is open, whether it is held open, and toggle(value, reason). It is undefined outside a set rather than a throw, because a Collapsible standing alone is a complete component."
|
|
212
212
|
},
|
|
213
213
|
{
|
|
214
214
|
"name": "AccordionDefaultsProvider",
|
|
215
215
|
"type": "{ multiple, requireOpen, loop, size, variant, indicator, togglePlacement, headingLevel, mount, truncate }",
|
|
216
216
|
"defaultValue": "—",
|
|
217
217
|
"appliesTo": "a subtree",
|
|
218
|
-
"description": "The ten decisions an application takes once. A set that states any of them itself still wins"
|
|
218
|
+
"description": "The ten decisions an application takes once. A set that states any of them itself still wins."
|
|
219
219
|
}
|
|
220
220
|
],
|
|
221
221
|
"events": [
|
|
@@ -275,8 +275,8 @@
|
|
|
275
275
|
"title": "One panel open, or several",
|
|
276
276
|
"note": "With multiple off, opening one closes the one that was — and that panel is told it closed with the reason select, not because the reader asked it to.",
|
|
277
277
|
"language": "tsx",
|
|
278
|
-
"source": "<Accordion multiple defaultValue={['
|
|
279
|
-
"verdict": "
|
|
278
|
+
"source": "import { Accordion } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\n\nconst TASKS = [\n {\n value: 'receiving',\n title: 'Receiving',\n body: '14 pallets arrive today between 08:00 and 15:00.',\n },\n { value: 'putaway', title: 'Putaway', body: '6 pallets wait in dock 3 for a bin assignment.' },\n { value: 'counts', title: 'Cycle counts', body: 'Aisles 12 to 15 are due this week.' },\n { value: 'dispatch', title: 'Dispatch', body: 'The 16:30 carrier pickup holds 38 parcels.' },\n];\n\nexport default function AccordionMultiple() {\n return (\n <Accordion multiple defaultValue={['receiving', 'putaway']}>\n {TASKS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n );\n}\n",
|
|
279
|
+
"verdict": "example"
|
|
280
280
|
},
|
|
281
281
|
{
|
|
282
282
|
"id": "requireOpen",
|
|
@@ -299,32 +299,32 @@
|
|
|
299
299
|
"title": "The step the set sits at",
|
|
300
300
|
"note": "The set hands the step to every item, so one word moves the type of every title and the rhythm of every row at once. The gap between cards moves with it.",
|
|
301
301
|
"language": "tsx",
|
|
302
|
-
"source": "
|
|
303
|
-
"verdict": "
|
|
302
|
+
"source": "import { Accordion } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst SECTIONS = [\n {\n value: 'delivery',\n title: 'Delivery',\n body: 'Scheduled for September 12 with Harbor Freight, tracking HF-48213.',\n },\n { value: 'payment', title: 'Payment', body: 'Invoice INV-20877 for $2,146.50, due October 4.' },\n];\n\nconst SIZES = ['sm', 'md', 'lg'] as const;\n\nexport default function AccordionSizes() {\n return (\n <Stack gap={6}>\n {SIZES.map((value) => (\n <Stack key={value} gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n size=\"{value}\"\n </Text>\n <Accordion size={value} defaultValue={['delivery']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n ))}\n </Stack>\n );\n}\n",
|
|
303
|
+
"verdict": "example"
|
|
304
304
|
},
|
|
305
305
|
{
|
|
306
306
|
"id": "mount",
|
|
307
307
|
"title": "When each panel’s content exists",
|
|
308
308
|
"note": "The set hands the strategy to every item: eager keeps every panel ready to transition, lazy builds one on its first open, and active drops each one as it closes.",
|
|
309
309
|
"language": "tsx",
|
|
310
|
-
"source": "<Accordion mount=\"
|
|
311
|
-
"verdict": "
|
|
310
|
+
"source": "import { Accordion } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\nimport { Field, FieldLabel } from '@slotted/react/field';\nimport { Stack } from '@slotted/react/stack';\nimport { TextField } from '@slotted/react/text-field';\nimport { Text } from '@slotted/react/typography';\n\nconst MOUNTS = ['active', 'lazy', 'eager', 'until-found'] as const;\n\nexport default function AccordionMount() {\n return (\n <Stack gap={6}>\n {MOUNTS.map((mount) => (\n <Stack key={mount} gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n mount=\"{mount}\"\n </Text>\n <Accordion mount={mount}>\n <Collapsible value=\"note\">\n <CollapsibleHeader>\n <CollapsibleTrigger>Carrier note</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>\n <Field>\n <FieldLabel>Note for the carrier</FieldLabel>\n <TextField />\n </Field>\n </CollapsiblePanel>\n </Collapsible>\n </Accordion>\n </Stack>\n ))}\n </Stack>\n );\n}\n",
|
|
311
|
+
"verdict": "example"
|
|
312
312
|
},
|
|
313
313
|
{
|
|
314
314
|
"id": "states",
|
|
315
315
|
"title": "Every state the set paints",
|
|
316
316
|
"note": "A disabled set reaches every trigger as the native attribute, and one item may be out of action inside a live set. Hover and press are the item’s, held back for both.",
|
|
317
317
|
"language": "tsx",
|
|
318
|
-
"source": "<Accordion>\n
|
|
319
|
-
"verdict": "
|
|
318
|
+
"source": "import { Accordion } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst SECTIONS = [\n {\n value: 'delivery',\n title: 'Delivery',\n body: 'Scheduled for September 12 with Harbor Freight, tracking HF-48213.',\n },\n { value: 'payment', title: 'Payment', body: 'Invoice INV-20877 for $2,146.50, due October 4.' },\n];\n\nconst REVIEW = [\n {\n value: 'delivery',\n title: 'Delivery',\n body: 'Scheduled for September 12 with Harbor Freight, tracking HF-48213.',\n },\n { value: 'payment', title: 'Payment', body: 'Invoice INV-20877 for $2,146.50, due October 4.' },\n {\n value: 'hold',\n title: 'Credit hold',\n body: 'Released by finance on October 1.',\n disabled: true,\n },\n];\n\nexport default function AccordionStates() {\n return (\n <Stack gap={6}>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n disabled\n </Text>\n <Accordion disabled defaultValue={['payment']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n disabled on one item\n </Text>\n <Accordion defaultValue={['payment']}>\n {REVIEW.map((section) => (\n <Collapsible key={section.value} value={section.value} disabled={section.disabled}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n </Stack>\n );\n}\n",
|
|
319
|
+
"verdict": "example"
|
|
320
320
|
},
|
|
321
321
|
{
|
|
322
322
|
"id": "imperative",
|
|
323
323
|
"title": "Opening and closing everything",
|
|
324
324
|
"note": "A controlled consumer already owns the array and needs neither of these; an uncontrolled one has no array to set, which is the case the handle exists for.",
|
|
325
325
|
"language": "tsx",
|
|
326
|
-
"source": "const set = useRef<AccordionHandle>(null);\n\n<
|
|
327
|
-
"verdict": "
|
|
326
|
+
"source": "import { useRef } from 'react';\nimport { Accordion } from '@slotted/react/accordion';\nimport type { AccordionHandle } from '@slotted/react/accordion';\nimport { Button } from '@slotted/react/button';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\n\nconst TASKS = [\n {\n value: 'receiving',\n title: 'Receiving',\n body: '14 pallets arrive today between 08:00 and 15:00.',\n },\n { value: 'putaway', title: 'Putaway', body: '6 pallets wait in dock 3 for a bin assignment.' },\n { value: 'counts', title: 'Cycle counts', body: 'Aisles 12 to 15 are due this week.' },\n {\n value: 'archive',\n title: 'Archived pallets',\n body: 'Moved to cold storage on September 30.',\n disabled: true,\n },\n];\n\nexport default function AccordionImperative() {\n const set = useRef<AccordionHandle>(null);\n\n return (\n <Stack gap={4}>\n <Inline gap={2}>\n <Button size=\"sm\" variant=\"outline\" onClick={() => set.current?.openAll()}>\n Open all\n </Button>\n <Button size=\"sm\" variant=\"outline\" onClick={() => set.current?.closeAll()}>\n Close all\n </Button>\n </Inline>\n <Accordion handle={set} multiple>\n {TASKS.map((task) => (\n <Collapsible key={task.value} value={task.value} disabled={task.disabled}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{task.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{task.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n );\n}\n",
|
|
327
|
+
"verdict": "example"
|
|
328
328
|
},
|
|
329
329
|
{
|
|
330
330
|
"id": "content",
|
|
@@ -349,6 +349,62 @@
|
|
|
349
349
|
"language": "tsx",
|
|
350
350
|
"source": "<Accordion onValueChange={(value, request) => report(request.reason)}>…</Accordion>;\n",
|
|
351
351
|
"verdict": "excerpt"
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
"id": "basic",
|
|
355
|
+
"title": "basic.tsx",
|
|
356
|
+
"note": null,
|
|
357
|
+
"language": "tsx",
|
|
358
|
+
"source": "import { Accordion } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\n\nconst SECTIONS = [\n {\n value: 'delivery',\n title: 'Delivery',\n body: 'Scheduled for September 12 with Harbor Freight, tracking HF-48213.',\n },\n { value: 'payment', title: 'Payment', body: 'Invoice INV-20877 for $2,146.50, due October 4.' },\n {\n value: 'returns',\n title: 'Returns',\n body: 'Accepted within 30 days of delivery, with the original packing slip.',\n },\n];\n\nexport default function AccordionBasic() {\n return (\n <Accordion defaultValue={['delivery']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n );\n}\n",
|
|
359
|
+
"verdict": "example"
|
|
360
|
+
},
|
|
361
|
+
{
|
|
362
|
+
"id": "controlled",
|
|
363
|
+
"title": "controlled.tsx",
|
|
364
|
+
"note": null,
|
|
365
|
+
"language": "tsx",
|
|
366
|
+
"source": "import { useState } from 'react';\nimport { Accordion } from '@slotted/react/accordion';\nimport type { AccordionChangeRequest } from '@slotted/react/accordion';\nimport { Button } from '@slotted/react/button';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst SECTIONS = [\n {\n value: 'delivery',\n title: 'Delivery',\n body: 'Scheduled for September 12 with Harbor Freight, tracking HF-48213.',\n },\n { value: 'payment', title: 'Payment', body: 'Invoice INV-20877 for $2,146.50, due October 4.' },\n {\n value: 'returns',\n title: 'Returns',\n body: 'Accepted within 30 days of delivery, with the original packing slip.',\n },\n];\n\nexport default function AccordionControlled() {\n const [open, setOpen] = useState<readonly string[]>(['delivery']);\n const [reason, setReason] = useState('none');\n\n function handleValueChange(next: readonly string[], request: AccordionChangeRequest) {\n setOpen(next);\n setReason(request.reason);\n }\n\n return (\n <Stack gap={4}>\n <Inline gap={3} align=\"center\" justify=\"between\">\n <Text size=\"sm\" tone=\"muted\">\n Open: {open.join(', ') || 'none'}. Last change by the reader: {reason}.\n </Text>\n <Button size=\"sm\" variant=\"outline\" onClick={() => setOpen(['payment'])}>\n Show payment\n </Button>\n </Inline>\n <Accordion value={open} onValueChange={handleValueChange}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n );\n}\n",
|
|
367
|
+
"verdict": "example"
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"id": "defaults",
|
|
371
|
+
"title": "defaults.tsx",
|
|
372
|
+
"note": null,
|
|
373
|
+
"language": "tsx",
|
|
374
|
+
"source": "import { Accordion, AccordionDefaultsProvider } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst SECTIONS = [\n {\n value: 'po',\n title: 'Purchase order PO-44821 from Harbor & Pine Supply Co. awaiting approval',\n body: 'Requested by Mira Alvarez for $12,480.00.',\n },\n {\n value: 'rma',\n title: 'Return authorization RMA-3107 for 24 damaged cartons',\n body: 'Credit of $1,036.80 issues after inspection.',\n },\n];\n\nexport default function AccordionDefaults() {\n return (\n <AccordionDefaultsProvider variant=\"separated\" indicator=\"plus-minus\" truncate>\n <Stack gap={6}>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n From the defaults\n </Text>\n <Accordion defaultValue={['po']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n variant=\"plain\" on the set\n </Text>\n <Accordion variant=\"plain\" defaultValue={['po']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n </Stack>\n </AccordionDefaultsProvider>\n );\n}\n",
|
|
375
|
+
"verdict": "example"
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
"id": "headings",
|
|
379
|
+
"title": "headings.tsx",
|
|
380
|
+
"note": null,
|
|
381
|
+
"language": "tsx",
|
|
382
|
+
"source": "import { Accordion } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst SECTIONS = [\n {\n value: 'delivery',\n title: 'Delivery',\n body: 'Scheduled for September 12 with Harbor Freight, tracking HF-48213.',\n },\n { value: 'payment', title: 'Payment', body: 'Invoice INV-20877 for $2,146.50, due October 4.' },\n];\n\nexport default function AccordionHeadings() {\n return (\n <Stack gap={6}>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n headingLevel=\"2\"\n </Text>\n <Accordion headingLevel=\"2\" defaultValue={['delivery']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n headingLevel=\"none\"\n </Text>\n <Accordion headingLevel=\"none\" defaultValue={['delivery']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n </Stack>\n );\n}\n",
|
|
383
|
+
"verdict": "example"
|
|
384
|
+
},
|
|
385
|
+
{
|
|
386
|
+
"id": "indicator",
|
|
387
|
+
"title": "indicator.tsx",
|
|
388
|
+
"note": null,
|
|
389
|
+
"language": "tsx",
|
|
390
|
+
"source": "import { Accordion } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst SECTIONS = [\n {\n value: 'delivery',\n title: 'Delivery',\n body: 'Scheduled for September 12 with Harbor Freight, tracking HF-48213.',\n },\n { value: 'payment', title: 'Payment', body: 'Invoice INV-20877 for $2,146.50, due October 4.' },\n];\n\nexport default function AccordionIndicator() {\n return (\n <Stack gap={6}>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n indicator=\"chevron\"\n </Text>\n <Accordion indicator=\"chevron\" defaultValue={['delivery']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n indicator=\"plus-minus\" togglePlacement=\"start\"\n </Text>\n <Accordion indicator=\"plus-minus\" togglePlacement=\"start\" defaultValue={['delivery']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n <Stack gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n indicator=\"none\"\n </Text>\n <Accordion indicator=\"none\" defaultValue={['delivery']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n </Stack>\n );\n}\n",
|
|
391
|
+
"verdict": "example"
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"id": "require-open",
|
|
395
|
+
"title": "require-open.tsx",
|
|
396
|
+
"note": null,
|
|
397
|
+
"language": "tsx",
|
|
398
|
+
"source": "import { Accordion } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\n\nconst ACCOUNT = [\n { value: 'summary', title: 'Summary', body: 'Harbor & Pine Supply Co., customer since 2019.' },\n {\n value: 'contacts',\n title: 'Contacts',\n body: 'Mira Alvarez, purchasing, and Tomas Berg, accounts payable.',\n },\n {\n value: 'terms',\n title: 'Payment terms',\n body: 'Net 30, with a 2% discount when paid within 10 days.',\n },\n];\n\nexport default function AccordionRequireOpen() {\n return (\n <Accordion requireOpen defaultValue={['summary']}>\n {ACCOUNT.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n );\n}\n",
|
|
399
|
+
"verdict": "example"
|
|
400
|
+
},
|
|
401
|
+
{
|
|
402
|
+
"id": "variants",
|
|
403
|
+
"title": "variants.tsx",
|
|
404
|
+
"note": null,
|
|
405
|
+
"language": "tsx",
|
|
406
|
+
"source": "import { Accordion } from '@slotted/react/accordion';\nimport {\n Collapsible,\n CollapsibleHeader,\n CollapsiblePanel,\n CollapsibleTrigger,\n} from '@slotted/react/collapsible';\nimport { Stack } from '@slotted/react/stack';\nimport { Text } from '@slotted/react/typography';\n\nconst SECTIONS = [\n {\n value: 'delivery',\n title: 'Delivery',\n body: 'Scheduled for September 12 with Harbor Freight, tracking HF-48213.',\n },\n { value: 'payment', title: 'Payment', body: 'Invoice INV-20877 for $2,146.50, due October 4.' },\n];\n\nconst VARIANTS = ['plain', 'ruled', 'framed', 'separated'] as const;\n\nexport default function AccordionVariants() {\n return (\n <Stack gap={6}>\n {VARIANTS.map((value) => (\n <Stack key={value} gap={2}>\n <Text size=\"sm\" tone=\"muted\">\n variant=\"{value}\"\n </Text>\n <Accordion variant={value} defaultValue={['delivery']}>\n {SECTIONS.map((section) => (\n <Collapsible key={section.value} value={section.value}>\n <CollapsibleHeader>\n <CollapsibleTrigger>{section.title}</CollapsibleTrigger>\n </CollapsibleHeader>\n <CollapsiblePanel>{section.body}</CollapsiblePanel>\n </Collapsible>\n ))}\n </Accordion>\n </Stack>\n ))}\n </Stack>\n );\n}\n",
|
|
407
|
+
"verdict": "example"
|
|
352
408
|
}
|
|
353
409
|
]
|
|
354
410
|
}
|
package/dist/docs/accordion.md
CHANGED
|
@@ -11,23 +11,45 @@ import { Accordion, AccordionDefaultsProvider, Collapsible, CollapsibleHeader, C
|
|
|
11
11
|
|
|
12
12
|
## Minimal example
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Example
|
|
15
15
|
|
|
16
16
|
```tsx
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
17
|
+
import { Accordion } from '@slotted/react/accordion';
|
|
18
|
+
import {
|
|
19
|
+
Collapsible,
|
|
20
|
+
CollapsibleHeader,
|
|
21
|
+
CollapsiblePanel,
|
|
22
|
+
CollapsibleTrigger,
|
|
23
|
+
} from '@slotted/react/collapsible';
|
|
24
|
+
|
|
25
|
+
const SECTIONS = [
|
|
26
|
+
{
|
|
27
|
+
value: 'delivery',
|
|
28
|
+
title: 'Delivery',
|
|
29
|
+
body: 'Scheduled for September 12 with Harbor Freight, tracking HF-48213.',
|
|
30
|
+
},
|
|
31
|
+
{ value: 'payment', title: 'Payment', body: 'Invoice INV-20877 for $2,146.50, due October 4.' },
|
|
32
|
+
{
|
|
33
|
+
value: 'returns',
|
|
34
|
+
title: 'Returns',
|
|
35
|
+
body: 'Accepted within 30 days of delivery, with the original packing slip.',
|
|
36
|
+
},
|
|
37
|
+
];
|
|
38
|
+
|
|
39
|
+
export default function AccordionBasic() {
|
|
40
|
+
return (
|
|
41
|
+
<Accordion defaultValue={['delivery']}>
|
|
42
|
+
{SECTIONS.map((section) => (
|
|
43
|
+
<Collapsible key={section.value} value={section.value}>
|
|
44
|
+
<CollapsibleHeader>
|
|
45
|
+
<CollapsibleTrigger>{section.title}</CollapsibleTrigger>
|
|
46
|
+
</CollapsibleHeader>
|
|
47
|
+
<CollapsiblePanel>{section.body}</CollapsiblePanel>
|
|
48
|
+
</Collapsible>
|
|
49
|
+
))}
|
|
50
|
+
</Accordion>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
31
53
|
```
|
|
32
54
|
|
|
33
55
|
## Anatomy
|
|
@@ -40,24 +62,24 @@ Excerpt — not a complete module
|
|
|
40
62
|
|
|
41
63
|
| Name | Type | Default | Applies to | Description |
|
|
42
64
|
| --- | --- | --- | --- | --- |
|
|
43
|
-
| `value` | `readonly string[]` | — | Accordion | Present means the consumer owns the set of open panels, for the life of the component. Each entry is a Collapsible’s value |
|
|
44
|
-
| `defaultValue` | `readonly string[]` | — | Accordion | The set an uncontrolled accordion starts from, read once. A later change to it does not silently become new state |
|
|
45
|
-
| `multiple` | `boolean` | false | Accordion, AccordionDefaultsProvider | Whether more than one panel may be open. With it off, opening one closes the one that was, and that panel is told the reason was select |
|
|
46
|
-
| `requireOpen` | `boolean` | false | Accordion, AccordionDefaultsProvider | Whether the set refuses to empty. The one open header then carries aria-disabled="true", which is what the pattern asks of an accordion that does not permit its panel to be collapsed |
|
|
47
|
-
| `loop` | `boolean` | true | Accordion, AccordionDefaultsProvider | Whether the arrow keys wrap past the ends of the set |
|
|
48
|
-
| `size` | `'sm' \| 'md' \| 'lg'` | md | Accordion, AccordionDefaultsProvider | The step every item sits at, and the air between cards under separated |
|
|
49
|
-
| `variant` | `'plain' \| 'ruled' \| 'framed' \| 'separated'` | ruled | Accordion, AccordionDefaultsProvider | How the set is drawn. Each value maps onto the item variant the set hands over: plain to plain, ruled and framed to ruled, separated to framed. The set never selects into an item to draw it |
|
|
50
|
-
| `indicator` | `'chevron' \| 'plus-minus' \| 'none'` | chevron | Accordion, AccordionDefaultsProvider | The mark every header carries, handed to each item |
|
|
51
|
-
| `togglePlacement` | `'end' \| 'start'` | end | Accordion, AccordionDefaultsProvider | Which side of the words that mark stands on, handed to each item |
|
|
52
|
-
| `headingLevel` | `'none' \| '1' \| '2' \| '3' \| '4' \| '5' \| '6'` | 3 | Accordion, AccordionDefaultsProvider | The heading element every item’s header renders as. 3 is the level the pattern’s own example uses for a set inside a section |
|
|
53
|
-
| `mount` | `'active' \| 'lazy' \| 'eager' \| 'until-found'` | eager | Accordion, AccordionDefaultsProvider | When each panel’s content exists, handed to every item |
|
|
54
|
-
| `truncate` | `boolean` | false | Accordion, AccordionDefaultsProvider | Clips every title to one line instead of letting the row grow |
|
|
55
|
-
| `disabled` | `boolean` | false | Accordion | Reaches every item, and every trigger as the native attribute |
|
|
56
|
-
| `handle` | `Ref<AccordionHandle>` | — | Accordion | openAll() and closeAll(), the two moves an array cannot express while the family owns the array. They are on a handle of their own so ref keeps reaching the element, which is the rule for every other family here |
|
|
57
|
-
| `render` | `(props) => ReactNode` | — | Accordion | Substitutes the set’s root and hands it every attribute — a set of sections can be a real section element |
|
|
58
|
-
| `ref` | `Ref<HTMLElement>` | — | Accordion | Reaches the element itself, so the platform’s own methods are the platform’s |
|
|
59
|
-
| `useAccordion()` | `() => AccordionContextValue \| undefined` | — | inside Accordion | What each item reads: the axes the set hands over, whether a value is open, whether it is held open, and toggle(value, reason). It is undefined outside a set rather than a throw, because a Collapsible standing alone is a complete component |
|
|
60
|
-
| `AccordionDefaultsProvider` | `{ multiple, requireOpen, loop, size, variant, indicator, togglePlacement, headingLevel, mount, truncate }` | — | a subtree | The ten decisions an application takes once. A set that states any of them itself still wins |
|
|
65
|
+
| `value` | `readonly string[]` | — | Accordion | Present means the consumer owns the set of open panels, for the life of the component. Each entry is a Collapsible’s value. |
|
|
66
|
+
| `defaultValue` | `readonly string[]` | — | Accordion | The set an uncontrolled accordion starts from, read once. A later change to it does not silently become new state. |
|
|
67
|
+
| `multiple` | `boolean` | false | Accordion, AccordionDefaultsProvider | Whether more than one panel may be open. With it off, opening one closes the one that was, and that panel is told the reason was select. |
|
|
68
|
+
| `requireOpen` | `boolean` | false | Accordion, AccordionDefaultsProvider | Whether the set refuses to empty. The one open header then carries aria-disabled="true", which is what the pattern asks of an accordion that does not permit its panel to be collapsed. |
|
|
69
|
+
| `loop` | `boolean` | true | Accordion, AccordionDefaultsProvider | Whether the arrow keys wrap past the ends of the set. |
|
|
70
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | md | Accordion, AccordionDefaultsProvider | The step every item sits at, and the air between cards under separated. |
|
|
71
|
+
| `variant` | `'plain' \| 'ruled' \| 'framed' \| 'separated'` | ruled | Accordion, AccordionDefaultsProvider | How the set is drawn. Each value maps onto the item variant the set hands over: plain to plain, ruled and framed to ruled, separated to framed. The set never selects into an item to draw it. |
|
|
72
|
+
| `indicator` | `'chevron' \| 'plus-minus' \| 'none'` | chevron | Accordion, AccordionDefaultsProvider | The mark every header carries, handed to each item. |
|
|
73
|
+
| `togglePlacement` | `'end' \| 'start'` | end | Accordion, AccordionDefaultsProvider | Which side of the words that mark stands on, handed to each item. |
|
|
74
|
+
| `headingLevel` | `'none' \| '1' \| '2' \| '3' \| '4' \| '5' \| '6'` | 3 | Accordion, AccordionDefaultsProvider | The heading element every item’s header renders as. 3 is the level the pattern’s own example uses for a set inside a section. |
|
|
75
|
+
| `mount` | `'active' \| 'lazy' \| 'eager' \| 'until-found'` | eager | Accordion, AccordionDefaultsProvider | When each panel’s content exists, handed to every item. |
|
|
76
|
+
| `truncate` | `boolean` | false | Accordion, AccordionDefaultsProvider | Clips every title to one line instead of letting the row grow. |
|
|
77
|
+
| `disabled` | `boolean` | false | Accordion | Reaches every item, and every trigger as the native attribute. |
|
|
78
|
+
| `handle` | `Ref<AccordionHandle>` | — | Accordion | openAll() and closeAll(), the two moves an array cannot express while the family owns the array. They are on a handle of their own so ref keeps reaching the element, which is the rule for every other family here. |
|
|
79
|
+
| `render` | `(props) => ReactNode` | — | Accordion | Substitutes the set’s root and hands it every attribute — a set of sections can be a real section element. |
|
|
80
|
+
| `ref` | `Ref<HTMLElement>` | — | Accordion | Reaches the element itself, so the platform’s own methods are the platform’s. |
|
|
81
|
+
| `useAccordion()` | `() => AccordionContextValue \| undefined` | — | inside Accordion | What each item reads: the axes the set hands over, whether a value is open, whether it is held open, and toggle(value, reason). It is undefined outside a set rather than a throw, because a Collapsible standing alone is a complete component. |
|
|
82
|
+
| `AccordionDefaultsProvider` | `{ multiple, requireOpen, loop, size, variant, indicator, togglePlacement, headingLevel, mount, truncate }` | — | a subtree | The ten decisions an application takes once. A set that states any of them itself still wins. |
|
|
61
83
|
|
|
62
84
|
## Events
|
|
63
85
|
|
|
@@ -93,122 +115,4 @@ Excerpt — not a complete module
|
|
|
93
115
|
|
|
94
116
|
## Examples
|
|
95
117
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
With multiple off, opening one closes the one that was — and that panel is told it closed with the reason select, not because the reader asked it to.
|
|
99
|
-
|
|
100
|
-
Excerpt — not a complete module
|
|
101
|
-
|
|
102
|
-
```tsx
|
|
103
|
-
<Accordion multiple defaultValue={['delivery', 'payment']}>
|
|
104
|
-
…
|
|
105
|
-
</Accordion>;
|
|
106
|
-
```
|
|
107
|
-
|
|
108
|
-
### A set that refuses to empty
|
|
109
|
-
|
|
110
|
-
The one open header carries aria-disabled="true", which is the pattern’s own instruction for an accordion that does not permit its panel to be collapsed. It stays focusable and announced.
|
|
111
|
-
|
|
112
|
-
Excerpt — not a complete module
|
|
113
|
-
|
|
114
|
-
```tsx
|
|
115
|
-
<Accordion requireOpen defaultValue={['delivery']}>
|
|
116
|
-
…
|
|
117
|
-
</Accordion>;
|
|
118
|
-
```
|
|
119
|
-
|
|
120
|
-
### The four ways a set is drawn
|
|
121
|
-
|
|
122
|
-
ruled puts one hairline per seam and closes the stack at the bottom, framed wraps that set in one frame, separated gives each item a card, and plain paints nothing at all.
|
|
123
|
-
|
|
124
|
-
Excerpt — not a complete module
|
|
125
|
-
|
|
126
|
-
```tsx
|
|
127
|
-
<Accordion variant="separated">…</Accordion>;
|
|
128
|
-
```
|
|
129
|
-
|
|
130
|
-
### The step the set sits at
|
|
131
|
-
|
|
132
|
-
The set hands the step to every item, so one word moves the type of every title and the rhythm of every row at once. The gap between cards moves with it.
|
|
133
|
-
|
|
134
|
-
Excerpt — not a complete module
|
|
135
|
-
|
|
136
|
-
```tsx
|
|
137
|
-
<Accordion size="lg" variant="separated">
|
|
138
|
-
…
|
|
139
|
-
</Accordion>;
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
### When each panel’s content exists
|
|
143
|
-
|
|
144
|
-
The set hands the strategy to every item: eager keeps every panel ready to transition, lazy builds one on its first open, and active drops each one as it closes.
|
|
145
|
-
|
|
146
|
-
Excerpt — not a complete module
|
|
147
|
-
|
|
148
|
-
```tsx
|
|
149
|
-
<Accordion mount="lazy">…</Accordion>;
|
|
150
|
-
```
|
|
151
|
-
|
|
152
|
-
### Every state the set paints
|
|
153
|
-
|
|
154
|
-
A disabled set reaches every trigger as the native attribute, and one item may be out of action inside a live set. Hover and press are the item’s, held back for both.
|
|
155
|
-
|
|
156
|
-
Excerpt — not a complete module
|
|
157
|
-
|
|
158
|
-
```tsx
|
|
159
|
-
<Accordion>
|
|
160
|
-
<Collapsible value="delivery" disabled>
|
|
161
|
-
…
|
|
162
|
-
</Collapsible>
|
|
163
|
-
</Accordion>;
|
|
164
|
-
```
|
|
165
|
-
|
|
166
|
-
### Opening and closing everything
|
|
167
|
-
|
|
168
|
-
A controlled consumer already owns the array and needs neither of these; an uncontrolled one has no array to set, which is the case the handle exists for.
|
|
169
|
-
|
|
170
|
-
Excerpt — not a complete module
|
|
171
|
-
|
|
172
|
-
```tsx
|
|
173
|
-
const set = useRef<AccordionHandle>(null);
|
|
174
|
-
|
|
175
|
-
<Accordion handle={set} multiple>
|
|
176
|
-
…
|
|
177
|
-
</Accordion>;
|
|
178
|
-
|
|
179
|
-
<Button onClick={() => set.current?.openAll()}>Open all</Button>;
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Content the set did not choose
|
|
183
|
-
|
|
184
|
-
A hundred sections, a title longer than its row, and an accordion nested inside another’s panel — which stays closed, because nothing in the family is a descendant rule.
|
|
185
|
-
|
|
186
|
-
Excerpt — not a complete module
|
|
187
|
-
|
|
188
|
-
```tsx
|
|
189
|
-
<CollapsiblePanel>
|
|
190
|
-
<Accordion variant="plain">…</Accordion>
|
|
191
|
-
</CollapsiblePanel>;
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
### Setting it once, and reaching past it
|
|
195
|
-
|
|
196
|
-
The provider carries the ten decisions an application takes once, and a set that states any of them still wins; render substitutes the set’s own root.
|
|
197
|
-
|
|
198
|
-
Excerpt — not a complete module
|
|
199
|
-
|
|
200
|
-
```tsx
|
|
201
|
-
<AccordionDefaultsProvider variant="separated" multiple>
|
|
202
|
-
<Accordion>…</Accordion>
|
|
203
|
-
</AccordionDefaultsProvider>;
|
|
204
|
-
```
|
|
205
|
-
|
|
206
|
-
### The pattern’s table, and the four keys beside it
|
|
207
|
-
|
|
208
|
-
Every header is a Tab stop, which is what the pattern requires; the arrows, Home and End move focus on top of that sequence and open nothing at all.
|
|
209
|
-
|
|
210
|
-
Excerpt — not a complete module
|
|
211
|
-
|
|
212
|
-
```tsx
|
|
213
|
-
<Accordion onValueChange={(value, request) => report(request.reason)}>…</Accordion>;
|
|
214
|
-
```
|
|
118
|
+
See [accordion.examples.md](./accordion.examples.md).
|