@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/toggle.json
CHANGED
|
@@ -82,56 +82,56 @@
|
|
|
82
82
|
"type": "boolean",
|
|
83
83
|
"defaultValue": "—",
|
|
84
84
|
"appliesTo": "Toggle",
|
|
85
|
-
"description": "Present means the consumer owns the state, for the life of the component. Absent, the toggle owns it and starts from defaultPressed"
|
|
85
|
+
"description": "Present means the consumer owns the state, for the life of the component. Absent, the toggle owns it and starts from defaultPressed."
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
"name": "defaultPressed",
|
|
89
89
|
"type": "boolean",
|
|
90
90
|
"defaultValue": "false",
|
|
91
91
|
"appliesTo": "Toggle",
|
|
92
|
-
"description": "What an uncontrolled toggle starts from, read once. A later change to it does not silently become new state"
|
|
92
|
+
"description": "What an uncontrolled toggle starts from, read once. A later change to it does not silently become new state."
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
"name": "size",
|
|
96
96
|
"type": "'sm' | 'md' | 'lg'",
|
|
97
97
|
"defaultValue": "md",
|
|
98
98
|
"appliesTo": "Toggle",
|
|
99
|
-
"description": "The control step. It reads the control scale, so the toggle is as tall as the field beside it"
|
|
99
|
+
"description": "The control step. It reads the control scale, so the toggle is as tall as the field beside it."
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
"name": "variant",
|
|
103
103
|
"type": "'outline' | 'ghost' | 'chips'",
|
|
104
104
|
"defaultValue": "outline",
|
|
105
105
|
"appliesTo": "Toggle",
|
|
106
|
-
"description": "
|
|
106
|
+
"description": "outline draws its own edge, ghost is bare until the toggle is on, and chips is a rounded item that presses in the neutral ink. There is no tone axis: a mode is one color when it is on, and an action that persists, with a tone, is button’s ToggleButton."
|
|
107
107
|
},
|
|
108
108
|
{
|
|
109
109
|
"name": "icon",
|
|
110
110
|
"type": "ReactNode",
|
|
111
111
|
"defaultValue": "—",
|
|
112
112
|
"appliesTo": "Toggle",
|
|
113
|
-
"description": "The mark drawn before the words, sized from the control glyph scale and hidden from the reading order. Alone, it makes the toggle square"
|
|
113
|
+
"description": "The mark drawn before the words, sized from the control glyph scale and hidden from the reading order. Alone, it makes the toggle square."
|
|
114
114
|
},
|
|
115
115
|
{
|
|
116
116
|
"name": "children",
|
|
117
117
|
"type": "ReactNode",
|
|
118
118
|
"defaultValue": "—",
|
|
119
119
|
"appliesTo": "Toggle",
|
|
120
|
-
"description": "The words, which never change with the state. Absent, the toggle needs an aria-label"
|
|
120
|
+
"description": "The words, which never change with the state. Absent, the toggle needs an aria-label."
|
|
121
121
|
},
|
|
122
122
|
{
|
|
123
123
|
"name": "disabled",
|
|
124
124
|
"type": "boolean",
|
|
125
125
|
"defaultValue": "false",
|
|
126
126
|
"appliesTo": "Toggle",
|
|
127
|
-
"description": "The native attribute, which is also what makes the browser refuse focus. A toggle that is on and unavailable keeps saying both"
|
|
127
|
+
"description": "The native attribute, which is also what makes the browser refuse focus. A toggle that is on and unavailable keeps saying both."
|
|
128
128
|
},
|
|
129
129
|
{
|
|
130
130
|
"name": "type",
|
|
131
131
|
"type": "'button' | 'submit' | 'reset'",
|
|
132
132
|
"defaultValue": "button",
|
|
133
133
|
"appliesTo": "Toggle",
|
|
134
|
-
"description": "The native type. A toggle in a form is not a form control — checkbox and switch are — so it is a button unless the consumer says otherwise"
|
|
134
|
+
"description": "The native type. A toggle in a form is not a form control — checkbox and switch are — so it is a button unless the consumer says otherwise."
|
|
135
135
|
}
|
|
136
136
|
],
|
|
137
137
|
"composition": [
|
|
@@ -140,28 +140,28 @@
|
|
|
140
140
|
"type": "(props: ToggleRootProps) => ReactNode",
|
|
141
141
|
"defaultValue": "—",
|
|
142
142
|
"appliesTo": "Toggle",
|
|
143
|
-
"description": "Substitutes the root and
|
|
143
|
+
"description": "Substitutes the root and receives the data attributes, aria-pressed, className, style and the native props, with type, disabled and ref. It stays a button."
|
|
144
144
|
},
|
|
145
145
|
{
|
|
146
146
|
"name": "ref",
|
|
147
147
|
"type": "Ref<HTMLButtonElement>",
|
|
148
148
|
"defaultValue": "—",
|
|
149
149
|
"appliesTo": "Toggle",
|
|
150
|
-
"description": "Reaches the element. focus() and click() are the element’s own, so no imperative handle is invented for what the platform already ships"
|
|
150
|
+
"description": "Reaches the element. focus() and click() are the element’s own, so no imperative handle is invented for what the platform already ships."
|
|
151
151
|
},
|
|
152
152
|
{
|
|
153
153
|
"name": "ToggleDefaultsProvider",
|
|
154
154
|
"type": "{ size, variant }",
|
|
155
155
|
"defaultValue": "—",
|
|
156
156
|
"appliesTo": "a subtree",
|
|
157
|
-
"description": "The two decisions an application takes once. A toggle that states either itself still wins"
|
|
157
|
+
"description": "The two decisions an application takes once. A toggle that states either itself still wins."
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
"name": "name, value, form, aria-*",
|
|
161
161
|
"type": "the button’s own attributes",
|
|
162
162
|
"defaultValue": "—",
|
|
163
163
|
"appliesTo": "Toggle",
|
|
164
|
-
"description": "Every native attribute reaches the button unchanged and means what a button’s does"
|
|
164
|
+
"description": "Every native attribute reaches the button unchanged and means what a button’s does."
|
|
165
165
|
}
|
|
166
166
|
],
|
|
167
167
|
"events": [
|
|
@@ -173,13 +173,13 @@
|
|
|
173
173
|
{
|
|
174
174
|
"name": "onClick, onFocus, onBlur",
|
|
175
175
|
"payload": "the element’s own events",
|
|
176
|
-
"when": "Whenever the button fires them.
|
|
176
|
+
"when": "Whenever the button fires them. Toggle composes with a consumer’s handler rather than replacing it: the consumer’s runs first, and always runs. Calling preventDefault() in onClick stops the toggle as well."
|
|
177
177
|
}
|
|
178
178
|
],
|
|
179
179
|
"accessibility": [
|
|
180
180
|
"The APG Button pattern’s toggle button (w3.org/WAI/ARIA/apg/patterns/button/): a native button with aria-pressed, and no navigation pattern around it — a single control has no arrows of its own.",
|
|
181
181
|
"aria-pressed is written in both states, so the control is announced as a toggle rather than as a button that happens to be pressed — and the label never changes with the state, which the pattern calls critical. A toggle with only a mark takes its name from an aria-label the consumer writes.",
|
|
182
|
-
"Inside a toolbar the bar owns the tab stop and the arrows and reaches this control as it reaches every focusable control it holds; the
|
|
182
|
+
"Inside a toolbar the bar owns the tab stop and the arrows and reaches this control as it reaches every focusable control it holds; the toggle writes no listener. Space and Enter press it, from the platform.",
|
|
183
183
|
"disabled is the native attribute, because that is also what makes the browser refuse focus and skip the control. The toggle is not a form control: a value a form submits is checkbox or switch.",
|
|
184
184
|
"The target is the control itself, never narrower than it is tall, so the WCAG 2.2 minimum of 24 by 24 holds at the smallest step and the tightest density — and the theme grows every control to 44 under a coarse pointer."
|
|
185
185
|
]
|
|
@@ -251,23 +251,23 @@
|
|
|
251
251
|
{
|
|
252
252
|
"id": "playground",
|
|
253
253
|
"title": "Playground",
|
|
254
|
-
"note": "One toggle with every axis
|
|
254
|
+
"note": "One toggle with every axis exposed as a control below the canvas. Pressing it changes the state and leaves the label “Wrap lines” as written, so a screen reader announces the same name with a different pressed state.",
|
|
255
255
|
"language": "tsx",
|
|
256
|
-
"source": "<Toggle icon={<WrapText size={16} />} defaultPressed>\n
|
|
256
|
+
"source": "<Toggle icon={<WrapText size={16} />} defaultPressed>\n Wrap lines\n</Toggle>;\n",
|
|
257
257
|
"verdict": "excerpt"
|
|
258
258
|
},
|
|
259
259
|
{
|
|
260
260
|
"id": "pressed",
|
|
261
261
|
"title": "Owned by the consumer, or by the toggle",
|
|
262
|
-
"note": "The left toggle owns its state and starts from defaultPressed. The right
|
|
262
|
+
"note": "The left toggle owns its state and starts from defaultPressed. The right toggle is controlled: the application holds the value, the toggle emits a request that carries the reason, and the application decides. Both write aria-pressed the same way.",
|
|
263
263
|
"language": "tsx",
|
|
264
|
-
"source": "const [wrap, setWrap] = useState(false);\n\n<Toggle icon={<WrapText size={16} />} onPressedChange={setWrap} pressed={wrap}>\n
|
|
264
|
+
"source": "const [wrap, setWrap] = useState(false);\n\n<Toggle icon={<WrapText size={16} />} onPressedChange={setWrap} pressed={wrap}>\n Wrap lines\n</Toggle>;\n",
|
|
265
265
|
"verdict": "excerpt"
|
|
266
266
|
},
|
|
267
267
|
{
|
|
268
268
|
"id": "variant",
|
|
269
|
-
"title": "
|
|
270
|
-
"note": "outline draws its own edge and stands beside a field
|
|
269
|
+
"title": "Outline, ghost and chips",
|
|
270
|
+
"note": "outline draws its own edge and stands beside a field. ghost is the toggle inside something already framed, such as a toolbar or a card header. chips is a rounded item that presses in the neutral ink, which suits a row of filters. outline and ghost turn on into the same accent pair, so “on” is one color wherever the control is.",
|
|
271
271
|
"language": "tsx",
|
|
272
272
|
"source": "<Toggle icon={<Pin size={16} />} variant=\"ghost\">\n Pin header\n</Toggle>;\n",
|
|
273
273
|
"verdict": "excerpt"
|
|
@@ -275,41 +275,41 @@
|
|
|
275
275
|
{
|
|
276
276
|
"id": "sizes",
|
|
277
277
|
"title": "Three steps, one control tall",
|
|
278
|
-
"note": "Every step reads the control scale, so a toggle beside a text field of the same step
|
|
278
|
+
"note": "Every step reads the control scale, so a toggle beside a text field of the same step has the same height as it, and the density switch in the toolbar moves both together.",
|
|
279
279
|
"language": "tsx",
|
|
280
|
-
"source": "<Toggle icon={<
|
|
281
|
-
"verdict": "
|
|
280
|
+
"source": "import { Glyph } from '@slotted/react/icon';\nimport { Inline } from '@slotted/react/inline';\nimport { Toggle } from '@slotted/react/toggle';\n\nexport default function ToggleSizes() {\n return (\n <Inline align=\"center\" gap={2}>\n <Toggle icon={<Glyph name=\"text-wrap\" />} size=\"sm\">\n Dense rows\n </Toggle>\n <Toggle icon={<Glyph name=\"text-wrap\" />} size=\"md\">\n Default rows\n </Toggle>\n <Toggle icon={<Glyph name=\"text-wrap\" />} size=\"lg\">\n Roomy rows\n </Toggle>\n </Inline>\n );\n}\n",
|
|
281
|
+
"verdict": "example"
|
|
282
282
|
},
|
|
283
283
|
{
|
|
284
284
|
"id": "iconOnly",
|
|
285
285
|
"title": "A mark and no words",
|
|
286
|
-
"note": "Without children the toggle draws square
|
|
286
|
+
"note": "Without children the toggle draws a square the height of the control, with the mark centered in it. The name comes from aria-label, which the type does not require and the application writes.",
|
|
287
287
|
"language": "tsx",
|
|
288
|
-
"source": "<Toggle aria-label=\"
|
|
288
|
+
"source": "<Toggle aria-label=\"Bold\" icon={<Bold size={16} />} defaultPressed />;\n",
|
|
289
289
|
"verdict": "excerpt"
|
|
290
290
|
},
|
|
291
291
|
{
|
|
292
292
|
"id": "states",
|
|
293
293
|
"title": "Every state the contract declares",
|
|
294
|
-
"note": "Hover takes the neutral ground when off and the accent ground’s own hover step when on. Disabled keeps both facts of a toggle that is on: the ground says unavailable and the edge still says on, so
|
|
294
|
+
"note": "Hover takes the neutral ground when off and the accent ground’s own hover step when on. Disabled keeps both facts of a toggle that is on: the ground says unavailable and the edge still says on, so a reader learns the mode from a control that cannot be changed.",
|
|
295
295
|
"language": "tsx",
|
|
296
|
-
"source": "<Toggle icon={<Pin
|
|
297
|
-
"verdict": "
|
|
296
|
+
"source": "import { Glyph } from '@slotted/react/icon';\nimport { Inline } from '@slotted/react/inline';\nimport { Toggle } from '@slotted/react/toggle';\n\nexport default function ToggleStates() {\n return (\n <Inline gap={2}>\n <Toggle icon={<Glyph name=\"pin\" />}>Pin header</Toggle>\n <Toggle defaultPressed icon={<Glyph name=\"bell\" />}>\n Notify me\n </Toggle>\n <Toggle disabled icon={<Glyph name=\"star\" />}>\n Starred only\n </Toggle>\n <Toggle defaultPressed disabled icon={<Glyph name=\"funnel\" />}>\n Carrier filter\n </Toggle>\n </Inline>\n );\n}\n",
|
|
297
|
+
"verdict": "example"
|
|
298
298
|
},
|
|
299
299
|
{
|
|
300
300
|
"id": "toolbar",
|
|
301
301
|
"title": "Inside a toolbar",
|
|
302
|
-
"note": "The bar is one tab stop with arrow navigation across every control it holds, and a toggle is one of those controls: Tab reaches the bar once, the arrows reach the toggle, Space presses it.
|
|
302
|
+
"note": "The bar is one tab stop with arrow navigation across every control it holds, and a toggle is one of those controls: Tab reaches the bar once, the arrows reach the toggle, Space presses it. Toggle writes no listener of its own.",
|
|
303
303
|
"language": "tsx",
|
|
304
|
-
"source": "<Toolbar aria-label=\"
|
|
305
|
-
"verdict": "
|
|
304
|
+
"source": "import { Glyph } from '@slotted/react/icon';\nimport { Toggle } from '@slotted/react/toggle';\nimport { Toolbar, ToolbarSeparator } from '@slotted/react/toolbar';\n\nexport default function ToggleToolbar() {\n return (\n <Toolbar aria-label=\"Order table view\">\n <Toggle defaultPressed icon={<Glyph name=\"pin\" />} variant=\"ghost\">\n Pin header\n </Toggle>\n <Toggle icon={<Glyph name=\"star\" />} variant=\"ghost\">\n Starred only\n </Toggle>\n <ToolbarSeparator />\n <Toggle icon={<Glyph name=\"text-wrap\" />} variant=\"ghost\">\n Wrap lines\n </Toggle>\n </Toolbar>\n );\n}\n",
|
|
305
|
+
"verdict": "example"
|
|
306
306
|
},
|
|
307
307
|
{
|
|
308
308
|
"id": "content",
|
|
309
|
-
"title": "Content the
|
|
309
|
+
"title": "Content the application chooses",
|
|
310
310
|
"note": "A long translated label in a narrow column clamps at the ellipsis and keeps its string whole in the DOM; a right-to-left document mirrors the mark to the other side of the words. Switch the direction in the toolbar to see the second.",
|
|
311
311
|
"language": "tsx",
|
|
312
|
-
"source": "<Toggle icon={<WrapText size={16} />}>
|
|
312
|
+
"source": "<Toggle icon={<WrapText size={16} />}>Show every line of the order notes</Toggle>;\n",
|
|
313
313
|
"verdict": "excerpt"
|
|
314
314
|
},
|
|
315
315
|
{
|
|
@@ -317,7 +317,7 @@
|
|
|
317
317
|
"title": "Defaults once, and the consumer’s own element",
|
|
318
318
|
"note": "The provider sets size and variant for every toggle under it; a toggle that states either itself still wins. render hands the wiring to the consumer’s own button — it stays a button, because aria-pressed on a link is a link announcing a state a link does not hold.",
|
|
319
319
|
"language": "tsx",
|
|
320
|
-
"source": "<ToggleDefaultsProvider size=\"sm\" variant=\"ghost\">\n <Toggle icon={<Pin size={14} />} render={(props) => <button {...props} data-track=\"pin\" />}>\n
|
|
320
|
+
"source": "<ToggleDefaultsProvider size=\"sm\" variant=\"ghost\">\n <Toggle icon={<Pin size={14} />} render={(props) => <button {...props} data-track=\"pin\" />}>\n Pin\n </Toggle>\n</ToggleDefaultsProvider>;\n",
|
|
321
321
|
"verdict": "excerpt"
|
|
322
322
|
},
|
|
323
323
|
{
|
|
@@ -325,16 +325,72 @@
|
|
|
325
325
|
"title": "The keyboard, key by key",
|
|
326
326
|
"note": "Tab reaches the control; Space and Enter turn it on and off; nothing else is bound. The request that reaches the consumer says keyboard rather than pointer, and the page below shows which one it saw.",
|
|
327
327
|
"language": "tsx",
|
|
328
|
-
"source": "<Toggle icon={<WrapText size={16} />} onPressedChange={(pressed, request) => log(request.reason)}>\n
|
|
328
|
+
"source": "<Toggle icon={<WrapText size={16} />} onPressedChange={(pressed, request) => log(request.reason)}>\n Wrap lines\n</Toggle>;\n",
|
|
329
329
|
"verdict": "excerpt"
|
|
330
330
|
},
|
|
331
331
|
{
|
|
332
332
|
"id": "versus",
|
|
333
333
|
"title": "Toggle, or ToggleButton",
|
|
334
|
-
"note": "A mode is one color and true the moment it is pressed: Toggle. An action that persists — Follow, Subscribe — reaches a server, waits, and
|
|
334
|
+
"note": "A mode is one color and true the moment it is pressed: Toggle. An action that persists — Follow, Subscribe — reaches a server, waits, and carries a tone beside the other actions of a page: button’s ToggleButton. Same state model, different meaning.",
|
|
335
335
|
"language": "tsx",
|
|
336
|
-
"source": "<>\n <Toggle icon={<WrapText size={16} />}>
|
|
336
|
+
"source": "<>\n <Toggle icon={<WrapText size={16} />}>Wrap lines</Toggle>\n <ToggleButton loading={following} onPressedChange={follow} pressed={followed}>\n Follow\n </ToggleButton>\n</>;\n",
|
|
337
337
|
"verdict": "excerpt"
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"id": "basic",
|
|
341
|
+
"title": "basic.tsx",
|
|
342
|
+
"note": null,
|
|
343
|
+
"language": "tsx",
|
|
344
|
+
"source": "import { Glyph } from '@slotted/react/icon';\nimport { Toggle } from '@slotted/react/toggle';\n\nexport default function ToggleBasic() {\n return <Toggle icon={<Glyph name=\"pin\" />}>Pin header</Toggle>;\n}\n",
|
|
345
|
+
"verdict": "example"
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
"id": "controlled",
|
|
349
|
+
"title": "controlled.tsx",
|
|
350
|
+
"note": null,
|
|
351
|
+
"language": "tsx",
|
|
352
|
+
"source": "import { useState } from 'react';\n\nimport { Glyph } from '@slotted/react/icon';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Toggle } from '@slotted/react/toggle';\nimport { Text } from '@slotted/react/typography';\n\nexport default function ToggleControlled() {\n const [wrap, setWrap] = useState(false);\n\n return (\n <Stack gap={2}>\n <Inline>\n <Toggle\n icon={<Glyph name=\"text-wrap\" />}\n onPressedChange={(pressed) => setWrap(pressed)}\n pressed={wrap}\n >\n Wrap lines\n </Toggle>\n </Inline>\n <Text size=\"sm\" tone=\"muted\">\n {wrap ? 'Long order notes wrap onto further lines.' : 'Long order notes stay on one line.'}\n </Text>\n </Stack>\n );\n}\n",
|
|
353
|
+
"verdict": "example"
|
|
354
|
+
},
|
|
355
|
+
{
|
|
356
|
+
"id": "defaults",
|
|
357
|
+
"title": "defaults.tsx",
|
|
358
|
+
"note": null,
|
|
359
|
+
"language": "tsx",
|
|
360
|
+
"source": "import { Inline } from '@slotted/react/inline';\nimport { Toggle, ToggleDefaultsProvider } from '@slotted/react/toggle';\n\nexport default function ToggleDefaults() {\n return (\n <ToggleDefaultsProvider size=\"sm\" variant=\"chips\">\n <Inline gap={2}>\n <Toggle defaultPressed>Late pickups</Toggle>\n <Toggle>Low stock</Toggle>\n <Toggle>Backordered</Toggle>\n <Toggle variant=\"ghost\">Archived</Toggle>\n </Inline>\n </ToggleDefaultsProvider>\n );\n}\n",
|
|
361
|
+
"verdict": "example"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"id": "guard",
|
|
365
|
+
"title": "guard.tsx",
|
|
366
|
+
"note": null,
|
|
367
|
+
"language": "tsx",
|
|
368
|
+
"source": "import { useState } from 'react';\n\nimport { Glyph } from '@slotted/react/icon';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Toggle } from '@slotted/react/toggle';\nimport { Text } from '@slotted/react/typography';\n\nexport default function ToggleGuard() {\n const [notice, setNotice] = useState('Locking freezes the entries of March 2026.');\n\n return (\n <Stack gap={2}>\n <Inline>\n <Toggle\n icon={<Glyph name=\"lock\" />}\n onPressedChange={(pressed, request) => {\n if (pressed) {\n setNotice('March 2026 is locked.');\n return;\n }\n request.cancel();\n setNotice('A locked period is reopened by the finance approver.');\n }}\n >\n Lock period\n </Toggle>\n </Inline>\n <Text size=\"sm\" tone=\"muted\">\n {notice}\n </Text>\n </Stack>\n );\n}\n",
|
|
369
|
+
"verdict": "example"
|
|
370
|
+
},
|
|
371
|
+
{
|
|
372
|
+
"id": "icon-only",
|
|
373
|
+
"title": "icon-only.tsx",
|
|
374
|
+
"note": null,
|
|
375
|
+
"language": "tsx",
|
|
376
|
+
"source": "import { Glyph } from '@slotted/react/icon';\nimport { Inline } from '@slotted/react/inline';\nimport { Toggle } from '@slotted/react/toggle';\n\nexport default function ToggleIconOnly() {\n return (\n <Inline gap={2}>\n <Toggle aria-label=\"Pin header\" icon={<Glyph name=\"pin\" />} />\n <Toggle aria-label=\"Starred only\" defaultPressed icon={<Glyph name=\"star\" />} />\n <Toggle aria-label=\"Notify me\" icon={<Glyph name=\"bell\" />} />\n </Inline>\n );\n}\n",
|
|
377
|
+
"verdict": "example"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"id": "reason",
|
|
381
|
+
"title": "reason.tsx",
|
|
382
|
+
"note": null,
|
|
383
|
+
"language": "tsx",
|
|
384
|
+
"source": "import { useState } from 'react';\n\nimport { Glyph } from '@slotted/react/icon';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Toggle } from '@slotted/react/toggle';\nimport type { TogglePressedReason } from '@slotted/react/toggle';\nimport { Text } from '@slotted/react/typography';\n\nexport default function ToggleReason() {\n const [reason, setReason] = useState<TogglePressedReason | null>(null);\n\n return (\n <Stack gap={2}>\n <Inline>\n <Toggle\n icon={<Glyph name=\"rotate-cw\" />}\n onPressedChange={(_pressed, request) => setReason(request.reason)}\n >\n Auto-refresh\n </Toggle>\n </Inline>\n <Text size=\"sm\" tone=\"muted\">\n {reason === null ? 'No change yet.' : `Last change: ${reason}.`}\n </Text>\n </Stack>\n );\n}\n",
|
|
385
|
+
"verdict": "example"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"id": "variants",
|
|
389
|
+
"title": "variants.tsx",
|
|
390
|
+
"note": null,
|
|
391
|
+
"language": "tsx",
|
|
392
|
+
"source": "import { Glyph } from '@slotted/react/icon';\nimport { Inline } from '@slotted/react/inline';\nimport { Stack } from '@slotted/react/stack';\nimport { Toggle } from '@slotted/react/toggle';\n\nexport default function ToggleVariants() {\n return (\n <Stack gap={3}>\n <Inline gap={2}>\n <Toggle defaultPressed icon={<Glyph name=\"pin\" />} variant=\"outline\">\n Pin header\n </Toggle>\n <Toggle icon={<Glyph name=\"text-wrap\" />} variant=\"outline\">\n Wrap lines\n </Toggle>\n </Inline>\n <Inline gap={2}>\n <Toggle defaultPressed icon={<Glyph name=\"bell\" />} variant=\"ghost\">\n Notify me\n </Toggle>\n <Toggle icon={<Glyph name=\"star\" />} variant=\"ghost\">\n Starred only\n </Toggle>\n </Inline>\n <Inline gap={2}>\n <Toggle defaultPressed variant=\"chips\">\n Late pickups\n </Toggle>\n <Toggle variant=\"chips\">Low stock</Toggle>\n </Inline>\n </Stack>\n );\n}\n",
|
|
393
|
+
"verdict": "example"
|
|
338
394
|
}
|
|
339
395
|
]
|
|
340
396
|
}
|