@cssints/apg-specs 0.0.0-stage → 0.5.2
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/LICENSE +21 -0
- package/README.md +65 -2
- package/dist/apg/accordion.bridge.d.mts +35 -0
- package/dist/apg/accordion.bridge.mjs +326 -0
- package/dist/apg/accordion.model.json +8397 -0
- package/dist/apg/alert.bridge.d.mts +22 -0
- package/dist/apg/alert.bridge.mjs +86 -0
- package/dist/apg/alert.model.json +871 -0
- package/dist/apg/alertdialog.bridge.d.mts +21 -0
- package/dist/apg/alertdialog.bridge.mjs +221 -0
- package/dist/apg/alertdialog.model.json +5232 -0
- package/dist/apg/breadcrumb.bridge.d.mts +26 -0
- package/dist/apg/breadcrumb.bridge.mjs +120 -0
- package/dist/apg/breadcrumb.model.json +574 -0
- package/dist/apg/button.bridge.d.mts +35 -0
- package/dist/apg/button.bridge.mjs +208 -0
- package/dist/apg/button.model.json +5814 -0
- package/dist/apg/carousel.bridge.d.mts +44 -0
- package/dist/apg/carousel.bridge.mjs +262 -0
- package/dist/apg/carousel.model.json +8963 -0
- package/dist/apg/checkbox-group.bridge.d.mts +25 -0
- package/dist/apg/checkbox-group.bridge.mjs +276 -0
- package/dist/apg/checkbox-group.model.json +3863 -0
- package/dist/apg/checkbox.bridge.d.mts +34 -0
- package/dist/apg/checkbox.bridge.mjs +253 -0
- package/dist/apg/checkbox.model.json +3158 -0
- package/dist/apg/combobox-autocomplete.bridge.d.mts +14 -0
- package/dist/apg/combobox-autocomplete.bridge.mjs +326 -0
- package/dist/apg/combobox-autocomplete.model.json +11586 -0
- package/dist/apg/combobox-dialog.bridge.d.mts +17 -0
- package/dist/apg/combobox-dialog.bridge.mjs +250 -0
- package/dist/apg/combobox-dialog.model.json +8981 -0
- package/dist/apg/combobox-grid.bridge.d.mts +17 -0
- package/dist/apg/combobox-grid.bridge.mjs +227 -0
- package/dist/apg/combobox-grid.model.json +8554 -0
- package/dist/apg/combobox-select-only.bridge.d.mts +24 -0
- package/dist/apg/combobox-select-only.bridge.mjs +304 -0
- package/dist/apg/combobox-select-only.model.json +7846 -0
- package/dist/apg/combobox-tree.bridge.d.mts +17 -0
- package/dist/apg/combobox-tree.bridge.mjs +211 -0
- package/dist/apg/combobox-tree.model.json +9345 -0
- package/dist/apg/dialog-modal.bridge.d.mts +35 -0
- package/dist/apg/dialog-modal.bridge.mjs +186 -0
- package/dist/apg/dialog-modal.model.json +7580 -0
- package/dist/apg/disclosure.bridge.d.mts +25 -0
- package/dist/apg/disclosure.bridge.mjs +202 -0
- package/dist/apg/disclosure.model.json +4703 -0
- package/dist/apg/feed.bridge.d.mts +31 -0
- package/dist/apg/feed.bridge.mjs +246 -0
- package/dist/apg/feed.model.json +4523 -0
- package/dist/apg/grid-selection.bridge.d.mts +13 -0
- package/dist/apg/grid-selection.bridge.mjs +160 -0
- package/dist/apg/grid-selection.model.json +6974 -0
- package/dist/apg/grid-sort.bridge.d.mts +12 -0
- package/dist/apg/grid-sort.bridge.mjs +138 -0
- package/dist/apg/grid-sort.model.json +3799 -0
- package/dist/apg/grid.bridge.d.mts +54 -0
- package/dist/apg/grid.bridge.mjs +441 -0
- package/dist/apg/grid.model.json +3802 -0
- package/dist/apg/link.bridge.d.mts +24 -0
- package/dist/apg/link.bridge.mjs +126 -0
- package/dist/apg/link.model.json +694 -0
- package/dist/apg/listbox-multi.bridge.d.mts +10 -0
- package/dist/apg/listbox-multi.bridge.mjs +261 -0
- package/dist/apg/listbox-multi.model.json +10893 -0
- package/dist/apg/listbox-rearrangeable.bridge.d.mts +20 -0
- package/dist/apg/listbox-rearrangeable.bridge.mjs +237 -0
- package/dist/apg/listbox-rearrangeable.model.json +17592 -0
- package/dist/apg/listbox-shared.d.mts +58 -0
- package/dist/apg/listbox-shared.mjs +171 -0
- package/dist/apg/listbox-single.bridge.d.mts +10 -0
- package/dist/apg/listbox-single.bridge.mjs +196 -0
- package/dist/apg/listbox-single.model.json +8024 -0
- package/dist/apg/listbox-typeahead.bridge.d.mts +10 -0
- package/dist/apg/listbox-typeahead.bridge.mjs +153 -0
- package/dist/apg/listbox-typeahead.model.json +5615 -0
- package/dist/apg/menu-button.bridge.d.mts +29 -0
- package/dist/apg/menu-button.bridge.mjs +259 -0
- package/dist/apg/menu-button.model.json +5706 -0
- package/dist/apg/menu-checkable.bridge.d.mts +25 -0
- package/dist/apg/menu-checkable.bridge.mjs +226 -0
- package/dist/apg/menu-checkable.model.json +4277 -0
- package/dist/apg/menu-menubar.bridge.d.mts +27 -0
- package/dist/apg/menu-menubar.bridge.mjs +273 -0
- package/dist/apg/menu-menubar.model.json +9540 -0
- package/dist/apg/meter.bridge.d.mts +28 -0
- package/dist/apg/meter.bridge.mjs +159 -0
- package/dist/apg/meter.model.json +1185 -0
- package/dist/apg/player.bridge.d.mts +24 -0
- package/dist/apg/player.bridge.mjs +342 -0
- package/dist/apg/player.model.json +11013 -0
- package/dist/apg/radio.bridge.d.mts +35 -0
- package/dist/apg/radio.bridge.mjs +371 -0
- package/dist/apg/radio.model.json +5011 -0
- package/dist/apg/slider-multithumb.bridge.d.mts +34 -0
- package/dist/apg/slider-multithumb.bridge.mjs +365 -0
- package/dist/apg/slider-multithumb.model.json +5774 -0
- package/dist/apg/slider.bridge.d.mts +54 -0
- package/dist/apg/slider.bridge.mjs +359 -0
- package/dist/apg/slider.model.json +4881 -0
- package/dist/apg/spinbutton.bridge.d.mts +41 -0
- package/dist/apg/spinbutton.bridge.mjs +327 -0
- package/dist/apg/spinbutton.model.json +7571 -0
- package/dist/apg/switch.bridge.d.mts +30 -0
- package/dist/apg/switch.bridge.mjs +243 -0
- package/dist/apg/switch.model.json +3159 -0
- package/dist/apg/tabs.bridge.d.mts +41 -0
- package/dist/apg/tabs.bridge.mjs +294 -0
- package/dist/apg/tabs.model.json +7659 -0
- package/dist/apg/timeline.bridge.d.mts +36 -0
- package/dist/apg/timeline.bridge.mjs +265 -0
- package/dist/apg/timeline.model.json +6189 -0
- package/dist/apg/toolbar.bridge.d.mts +25 -0
- package/dist/apg/toolbar.bridge.mjs +307 -0
- package/dist/apg/toolbar.model.json +6616 -0
- package/dist/apg/tooltip.bridge.d.mts +36 -0
- package/dist/apg/tooltip.bridge.mjs +208 -0
- package/dist/apg/tooltip.model.json +8295 -0
- package/dist/apg/treegrid.bridge.d.mts +28 -0
- package/dist/apg/treegrid.bridge.mjs +311 -0
- package/dist/apg/treegrid.model.json +17358 -0
- package/dist/apg/treeview.bridge.d.mts +26 -0
- package/dist/apg/treeview.bridge.mjs +396 -0
- package/dist/apg/treeview.model.json +13745 -0
- package/dist/apg/windowsplitter.bridge.d.mts +36 -0
- package/dist/apg/windowsplitter.bridge.mjs +242 -0
- package/dist/apg/windowsplitter.model.json +6253 -0
- package/dist/canvas/camera.model.json +6568 -0
- package/dist/canvas/canvas.bridge.d.mts +190 -0
- package/dist/canvas/canvas.bridge.mjs +729 -0
- package/dist/canvas/pointer.model.json +17095 -0
- package/dist/scenario.d.mts +233 -0
- package/dist/scenario.mjs +313 -0
- package/package.json +57 -4
- package/scenarios/apg/README.md +221 -0
- package/scenarios/apg/accordion.base-ui.json +1005 -0
- package/scenarios/apg/accordion.react-aria.json +929 -0
- package/scenarios/apg/alert.base-ui.json +81 -0
- package/scenarios/apg/alert.react-aria.json +98 -0
- package/scenarios/apg/alertdialog.base-ui.json +331 -0
- package/scenarios/apg/alertdialog.react-aria.json +225 -0
- package/scenarios/apg/breadcrumb.react-aria.json +312 -0
- package/scenarios/apg/button.ariakit.json +136 -0
- package/scenarios/apg/button.base-ui.json +747 -0
- package/scenarios/apg/button.react-aria.json +443 -0
- package/scenarios/apg/carousel.apg.json +909 -0
- package/scenarios/apg/checkbox.ariakit.json +299 -0
- package/scenarios/apg/checkbox.base-ui.json +1126 -0
- package/scenarios/apg/checkbox.react-aria.json +518 -0
- package/scenarios/apg/combobox.ariakit.json +945 -0
- package/scenarios/apg/combobox.base-ui.json +2444 -0
- package/scenarios/apg/combobox.react-aria.json +845 -0
- package/scenarios/apg/dialog-modal.ariakit.json +1102 -0
- package/scenarios/apg/dialog-modal.base-ui.json +775 -0
- package/scenarios/apg/dialog-modal.react-aria.json +638 -0
- package/scenarios/apg/disclosure.apg.json +349 -0
- package/scenarios/apg/disclosure.ariakit.json +163 -0
- package/scenarios/apg/disclosure.base-ui.json +451 -0
- package/scenarios/apg/disclosure.react-aria.json +643 -0
- package/scenarios/apg/feed.apg.json +442 -0
- package/scenarios/apg/grid.ariakit.json +197 -0
- package/scenarios/apg/grid.base-ui.json +720 -0
- package/scenarios/apg/grid.react-aria.json +969 -0
- package/scenarios/apg/landmarks.ariakit.json +93 -0
- package/scenarios/apg/landmarks.react-aria.json +330 -0
- package/scenarios/apg/link.ariakit.json +83 -0
- package/scenarios/apg/link.base-ui.json +88 -0
- package/scenarios/apg/link.react-aria.json +186 -0
- package/scenarios/apg/listbox.ariakit.json +78 -0
- package/scenarios/apg/listbox.base-ui.json +163 -0
- package/scenarios/apg/listbox.react-aria.json +1118 -0
- package/scenarios/apg/menu-button.ariakit.json +924 -0
- package/scenarios/apg/menu-button.base-ui.json +1155 -0
- package/scenarios/apg/menu-button.react-aria.json +1080 -0
- package/scenarios/apg/menubar.ariakit.json +758 -0
- package/scenarios/apg/menubar.base-ui.json +673 -0
- package/scenarios/apg/meter.base-ui.json +243 -0
- package/scenarios/apg/meter.react-aria.json +201 -0
- package/scenarios/apg/radio.ariakit.json +459 -0
- package/scenarios/apg/radio.base-ui.json +581 -0
- package/scenarios/apg/radio.react-aria.json +576 -0
- package/scenarios/apg/slider-multithumb.base-ui.json +316 -0
- package/scenarios/apg/slider-multithumb.react-aria.json +363 -0
- package/scenarios/apg/slider.base-ui.json +544 -0
- package/scenarios/apg/slider.react-aria.json +456 -0
- package/scenarios/apg/spinbutton.base-ui.json +1688 -0
- package/scenarios/apg/spinbutton.react-aria.json +426 -0
- package/scenarios/apg/switch.base-ui.json +456 -0
- package/scenarios/apg/switch.react-aria.json +303 -0
- package/scenarios/apg/table.ariakit.json +65 -0
- package/scenarios/apg/table.react-aria.json +221 -0
- package/scenarios/apg/tabs.ariakit.json +329 -0
- package/scenarios/apg/tabs.base-ui.json +875 -0
- package/scenarios/apg/tabs.react-aria.json +644 -0
- package/scenarios/apg/toolbar.ariakit.json +595 -0
- package/scenarios/apg/toolbar.base-ui.json +1189 -0
- package/scenarios/apg/toolbar.react-aria.json +383 -0
- package/scenarios/apg/tooltip.ariakit.json +441 -0
- package/scenarios/apg/tooltip.base-ui.json +411 -0
- package/scenarios/apg/tooltip.react-aria.json +454 -0
- package/scenarios/apg/treegrid.apg.json +2558 -0
- package/scenarios/apg/treegrid.react-aria.json +5094 -0
- package/scenarios/apg/treeview.apg.json +928 -0
- package/scenarios/apg/windowsplitter.apg.json +557 -0
- package/scenarios/canvas/README.md +69 -0
- package/scenarios/canvas/camera.contract.json +237 -0
- package/scenarios/canvas/camera.excalidraw.json +57 -0
- package/scenarios/canvas/marquee.excalidraw.json +122 -0
- package/scenarios/canvas/pan.excalidraw.json +46 -0
- package/scenarios/canvas/pointer.contract.json +528 -0
- package/scenarios/parts.json +291 -0
- package/shared/aria.qnt +186 -0
- package/shared/details-group.qnt +50 -0
- package/shared/focusgroup.qnt +152 -0
- package/shared/invokers.qnt +81 -0
- package/shared/popover.qnt +71 -0
- package/specs/apg/STATIC.md +103 -0
- package/specs/apg/accordion.qnt +578 -0
- package/specs/apg/alert.qnt +131 -0
- package/specs/apg/alertdialog.qnt +455 -0
- package/specs/apg/breadcrumb.qnt +88 -0
- package/specs/apg/button.qnt +445 -0
- package/specs/apg/carousel.qnt +732 -0
- package/specs/apg/checkbox-group.qnt +388 -0
- package/specs/apg/checkbox.qnt +394 -0
- package/specs/apg/combobox-autocomplete.qnt +764 -0
- package/specs/apg/combobox-dialog.qnt +627 -0
- package/specs/apg/combobox-grid.qnt +632 -0
- package/specs/apg/combobox-select-only.qnt +626 -0
- package/specs/apg/combobox-tree.qnt +633 -0
- package/specs/apg/dialog-modal.qnt +499 -0
- package/specs/apg/disclosure.qnt +309 -0
- package/specs/apg/feed.qnt +485 -0
- package/specs/apg/grid-selection.qnt +512 -0
- package/specs/apg/grid-sort.qnt +330 -0
- package/specs/apg/grid.qnt +360 -0
- package/specs/apg/link.qnt +119 -0
- package/specs/apg/listbox-multi.qnt +799 -0
- package/specs/apg/listbox-rearrangeable.qnt +801 -0
- package/specs/apg/listbox-single.qnt +511 -0
- package/specs/apg/listbox-typeahead.qnt +396 -0
- package/specs/apg/menu-button.qnt +363 -0
- package/specs/apg/menu-checkable.qnt +304 -0
- package/specs/apg/menu-menubar.qnt +531 -0
- package/specs/apg/meter.qnt +129 -0
- package/specs/apg/player.qnt +1081 -0
- package/specs/apg/radio.qnt +394 -0
- package/specs/apg/slider-multithumb.qnt +441 -0
- package/specs/apg/slider.qnt +396 -0
- package/specs/apg/spinbutton.qnt +494 -0
- package/specs/apg/switch.qnt +389 -0
- package/specs/apg/tabs.qnt +412 -0
- package/specs/apg/timeline.qnt +612 -0
- package/specs/apg/toolbar.qnt +364 -0
- package/specs/apg/tooltip.qnt +553 -0
- package/specs/apg/treegrid.qnt +983 -0
- package/specs/apg/treeview.qnt +1004 -0
- package/specs/apg/windowsplitter.qnt +487 -0
- package/specs/canvas/camera.qnt +407 -0
- package/specs/canvas/pointer.qnt +841 -0
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
{
|
|
2
|
+
"pattern": "switch",
|
|
3
|
+
"source": "base-ui",
|
|
4
|
+
"commit": "19511bb171f3b360b006c94cf6d07e53cb446505",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"skipped": [
|
|
7
|
+
{ "reason": "describeConformance blocks" },
|
|
8
|
+
{
|
|
9
|
+
"reason": "Field/Form integration, validation, error and dirty/filled/focused style hooks"
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"reason": "form submission (uncheckedValue, external form, native checkbox parity)"
|
|
13
|
+
},
|
|
14
|
+
{ "reason": "SSR/hydration, inputRef plumbing" },
|
|
15
|
+
{
|
|
16
|
+
"reason": "style-hook assertions on Switch.Thumb and data-* attributes unless they encode checked/disabled/readonly/required state"
|
|
17
|
+
},
|
|
18
|
+
{ "reason": "console-warning and imperative ref-callback edge cases" },
|
|
19
|
+
{ "reason": "styling/class-name assertions" }
|
|
20
|
+
],
|
|
21
|
+
"scenarios": [
|
|
22
|
+
{
|
|
23
|
+
"id": "switch.base-ui.click-toggles-aria-checked",
|
|
24
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L36",
|
|
25
|
+
"upstreamTest": "interactions > should change its state when clicked",
|
|
26
|
+
"apg": "aria",
|
|
27
|
+
"config": { "part": "switch", "checked": false },
|
|
28
|
+
"steps": [
|
|
29
|
+
{ "event": "prop", "set": {} },
|
|
30
|
+
{
|
|
31
|
+
"expect": {
|
|
32
|
+
"attrs": { "switch": { "role": "switch", "aria-checked": "false" } }
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
{ "event": "click", "target": "switch" },
|
|
36
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } }
|
|
37
|
+
],
|
|
38
|
+
"notes": "Click toggles aria-checked on the exposed switch element."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"id": "switch.base-ui.controlled-updates-from-outside",
|
|
42
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L49",
|
|
43
|
+
"upstreamTest": "interactions > should update its state when changed from outside",
|
|
44
|
+
"apg": "aria",
|
|
45
|
+
"config": { "part": "switch", "checked": false },
|
|
46
|
+
"steps": [
|
|
47
|
+
{ "event": "prop", "set": { "checked": true } },
|
|
48
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } },
|
|
49
|
+
{ "event": "prop", "set": { "checked": false } },
|
|
50
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "false" } } } }
|
|
51
|
+
],
|
|
52
|
+
"notes": "aria-checked follows the controlled checked prop."
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"id": "switch.base-ui.hidden-input-toggle-updates-switch",
|
|
56
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L78",
|
|
57
|
+
"upstreamTest": "interactions > should update its state if the underlying input is toggled",
|
|
58
|
+
"apg": "extension",
|
|
59
|
+
"config": { "part": "switch" },
|
|
60
|
+
"steps": [
|
|
61
|
+
{ "event": "prop", "set": {} },
|
|
62
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "false" } } } },
|
|
63
|
+
{ "event": "click", "target": "input:hidden" },
|
|
64
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } }
|
|
65
|
+
],
|
|
66
|
+
"notes": "The hidden native checkbox and the exposed switch stay in sync."
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
"id": "switch.base-ui.ignores-canceled-hidden-input-click",
|
|
70
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L90",
|
|
71
|
+
"upstreamTest": "interactions > ignores a hidden input click canceled before React handles it",
|
|
72
|
+
"apg": "extension",
|
|
73
|
+
"config": { "part": "switch" },
|
|
74
|
+
"steps": [
|
|
75
|
+
{ "event": "click", "target": "input:hidden", "canceled": true },
|
|
76
|
+
{
|
|
77
|
+
"expect": {
|
|
78
|
+
"attrs": { "switch": { "aria-checked": "false" } },
|
|
79
|
+
"events": { "onCheckedChange": [0] }
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"notes": "A click whose default is prevented before React never reaches the switch behaviour."
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
"id": "switch.base-ui.enter-activates",
|
|
87
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L105",
|
|
88
|
+
"upstreamTest": "interactions > can be activated with Enter key",
|
|
89
|
+
"apg": "keyboard",
|
|
90
|
+
"config": { "part": "switch" },
|
|
91
|
+
"steps": [
|
|
92
|
+
{ "event": "key", "key": "Tab" },
|
|
93
|
+
{ "expect": { "focus": "switch" } },
|
|
94
|
+
{ "event": "key", "key": "Enter", "target": "switch" },
|
|
95
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } }
|
|
96
|
+
],
|
|
97
|
+
"notes": "Enter toggles the switch."
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "switch.base-ui.space-activates",
|
|
101
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L105",
|
|
102
|
+
"upstreamTest": "interactions > can be activated with Space key",
|
|
103
|
+
"apg": "keyboard",
|
|
104
|
+
"config": { "part": "switch" },
|
|
105
|
+
"steps": [
|
|
106
|
+
{ "event": "key", "key": "Tab" },
|
|
107
|
+
{ "expect": { "focus": "switch" } },
|
|
108
|
+
{ "event": "key", "key": " ", "target": "switch" },
|
|
109
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } }
|
|
110
|
+
],
|
|
111
|
+
"notes": "Space toggles the switch."
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"id": "switch.base-ui.role-can-be-overridden",
|
|
115
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L122",
|
|
116
|
+
"upstreamTest": "extra props > should override the built-in attributes",
|
|
117
|
+
"apg": "extension",
|
|
118
|
+
"config": { "part": "switch", "role": "checkbox" },
|
|
119
|
+
"steps": [
|
|
120
|
+
{ "event": "prop", "set": {} },
|
|
121
|
+
{ "expect": { "attrs": { "switch": { "role": "checkbox" } } } }
|
|
122
|
+
],
|
|
123
|
+
"notes": "Consumer role prop wins over the built-in switch role."
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"id": "switch.base-ui.aria-labelledby-from-sibling-label",
|
|
127
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L127",
|
|
128
|
+
"upstreamTest": "extra props > sets aria-labelledby from a sibling label associated with the hidden input",
|
|
129
|
+
"apg": "aria",
|
|
130
|
+
"config": { "part": "switch", "label": "Label", "labelFor": true },
|
|
131
|
+
"steps": [
|
|
132
|
+
{ "event": "prop", "set": {} },
|
|
133
|
+
{ "expect": { "attrs": { "switch": { "aria-labelledby": "label" } } } }
|
|
134
|
+
],
|
|
135
|
+
"notes": "A <label htmlFor> bound to the hidden input supplies the accessible name."
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
"id": "switch.base-ui.aria-labelledby-updates-with-input-id",
|
|
139
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L140",
|
|
140
|
+
"upstreamTest": "extra props > updates fallback aria-labelledby when the hidden input id changes",
|
|
141
|
+
"apg": "aria",
|
|
142
|
+
"config": { "part": "switch", "labels": ["Label A", "Label B"] },
|
|
143
|
+
"steps": [
|
|
144
|
+
{ "event": "prop", "set": { "id": "switch-input-a" } },
|
|
145
|
+
{
|
|
146
|
+
"expect": { "attrs": { "switch": { "aria-labelledby": "label-a" } } }
|
|
147
|
+
},
|
|
148
|
+
{ "event": "prop", "set": { "id": "switch-input-b" } },
|
|
149
|
+
{
|
|
150
|
+
"expect": { "attrs": { "switch": { "aria-labelledby": "label-b" } } }
|
|
151
|
+
}
|
|
152
|
+
],
|
|
153
|
+
"notes": "aria-labelledby tracks the currently associated label."
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
"id": "switch.base-ui.aria-label-preferred-over-label",
|
|
157
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L175",
|
|
158
|
+
"upstreamTest": "extra props > prefers aria-label over an associated label",
|
|
159
|
+
"apg": "aria",
|
|
160
|
+
"config": { "part": "switch", "aria-label": "Wi-Fi", "label": "Wi-Fi" },
|
|
161
|
+
"steps": [
|
|
162
|
+
{ "event": "prop", "set": {} },
|
|
163
|
+
{ "expect": { "attrs": { "switch": { "aria-labelledby": null } } } }
|
|
164
|
+
],
|
|
165
|
+
"notes": "With aria-label present the wrapping label is not referenced by aria-labelledby."
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
"id": "switch.base-ui.oncheckedchange-called",
|
|
169
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L199",
|
|
170
|
+
"upstreamTest": "prop: onCheckedChange > should call onCheckedChange when clicked",
|
|
171
|
+
"apg": "extension",
|
|
172
|
+
"config": { "part": "switch" },
|
|
173
|
+
"steps": [
|
|
174
|
+
{ "event": "click", "target": "switch" },
|
|
175
|
+
{ "expect": { "events": { "onCheckedChange": [true] } } }
|
|
176
|
+
],
|
|
177
|
+
"notes": "Callback receives the next checked value."
|
|
178
|
+
},
|
|
179
|
+
{
|
|
180
|
+
"id": "switch.base-ui.oncheckedchange-reports-modifiers",
|
|
181
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L213",
|
|
182
|
+
"upstreamTest": "prop: onCheckedChange > should report keyboard modifier event properties",
|
|
183
|
+
"apg": "extension",
|
|
184
|
+
"config": { "part": "switch" },
|
|
185
|
+
"steps": [
|
|
186
|
+
{ "event": "click", "target": "switch", "modifiers": ["Shift"] },
|
|
187
|
+
{
|
|
188
|
+
"expect": {
|
|
189
|
+
"events": {
|
|
190
|
+
"onCheckedChange": [{ "canceled": false, "shiftKey": true }]
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
],
|
|
195
|
+
"notes": "Event details expose the modifier state at activation time."
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
"id": "switch.base-ui.cancel-root-click",
|
|
199
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L226",
|
|
200
|
+
"upstreamTest": "prop: onCheckedChange > does not change state when canceled via a root click",
|
|
201
|
+
"apg": "extension",
|
|
202
|
+
"config": { "part": "switch", "cancelOnCheckedChange": true },
|
|
203
|
+
"steps": [
|
|
204
|
+
{ "event": "click", "target": "switch" },
|
|
205
|
+
{
|
|
206
|
+
"expect": {
|
|
207
|
+
"attrs": {
|
|
208
|
+
"switch": { "aria-checked": "false", "data-dirty": null }
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
],
|
|
213
|
+
"notes": "eventDetails.cancel() reverts aria-checked and keeps the input unchecked."
|
|
214
|
+
},
|
|
215
|
+
{
|
|
216
|
+
"id": "switch.base-ui.cancel-hidden-input-click",
|
|
217
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L247",
|
|
218
|
+
"upstreamTest": "prop: onCheckedChange > does not change state when canceled via a hidden input click",
|
|
219
|
+
"apg": "extension",
|
|
220
|
+
"config": { "part": "switch", "cancelOnCheckedChange": true },
|
|
221
|
+
"steps": [
|
|
222
|
+
{ "event": "click", "target": "input:hidden" },
|
|
223
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "false" } } } }
|
|
224
|
+
],
|
|
225
|
+
"notes": "Cancelling from a hidden-input click keeps the switch off."
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"id": "switch.base-ui.onclick-called",
|
|
229
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L269",
|
|
230
|
+
"upstreamTest": "prop: onClick > should call onClick when clicked",
|
|
231
|
+
"apg": "extension",
|
|
232
|
+
"config": { "part": "switch" },
|
|
233
|
+
"steps": [
|
|
234
|
+
{ "event": "click", "target": "switch" },
|
|
235
|
+
{ "expect": { "events": { "onClick": [1] } } }
|
|
236
|
+
],
|
|
237
|
+
"notes": "Consumer onClick fires once."
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
"id": "switch.base-ui.click-propagates-once",
|
|
241
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L282",
|
|
242
|
+
"upstreamTest": "prop: onClick > propagates a single click event to ancestors per user click",
|
|
243
|
+
"apg": "extension",
|
|
244
|
+
"config": { "part": "switch" },
|
|
245
|
+
"steps": [
|
|
246
|
+
{ "event": "click", "target": "switch" },
|
|
247
|
+
{
|
|
248
|
+
"expect": {
|
|
249
|
+
"events": { "onAncestorClick": [1] },
|
|
250
|
+
"attrs": { "switch": { "aria-checked": "true" } }
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
],
|
|
254
|
+
"notes": "The synthetic click does not double-fire on ancestors."
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
"id": "switch.base-ui.stop-propagation",
|
|
258
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L296",
|
|
259
|
+
"upstreamTest": "prop: onClick > does not propagate to ancestors when stopPropagation() is called",
|
|
260
|
+
"apg": "extension",
|
|
261
|
+
"config": { "part": "switch", "stopPropagation": true },
|
|
262
|
+
"steps": [
|
|
263
|
+
{ "event": "click", "target": "switch" },
|
|
264
|
+
{
|
|
265
|
+
"expect": {
|
|
266
|
+
"events": { "onAncestorClick": [0] },
|
|
267
|
+
"attrs": { "switch": { "aria-checked": "true" } }
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
],
|
|
271
|
+
"notes": "State still toggles when propagation is stopped."
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"id": "switch.base-ui.click-propagates-once-native-button",
|
|
275
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L310",
|
|
276
|
+
"upstreamTest": "prop: onClick > propagates a single click event to ancestors with a native button",
|
|
277
|
+
"apg": "extension",
|
|
278
|
+
"config": { "part": "switch", "nativeButton": true },
|
|
279
|
+
"steps": [
|
|
280
|
+
{ "event": "click", "target": "switch" },
|
|
281
|
+
{
|
|
282
|
+
"expect": {
|
|
283
|
+
"events": { "onAncestorClick": [1] },
|
|
284
|
+
"attrs": { "switch": { "aria-checked": "true" } }
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
],
|
|
288
|
+
"notes": "Native-button rendering keeps single-click propagation."
|
|
289
|
+
},
|
|
290
|
+
{
|
|
291
|
+
"id": "switch.base-ui.stop-propagation-native-button",
|
|
292
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L324",
|
|
293
|
+
"upstreamTest": "prop: onClick > does not propagate to ancestors when stopPropagation() is called with a native button",
|
|
294
|
+
"apg": "extension",
|
|
295
|
+
"config": {
|
|
296
|
+
"part": "switch",
|
|
297
|
+
"nativeButton": true,
|
|
298
|
+
"stopPropagation": true
|
|
299
|
+
},
|
|
300
|
+
"steps": [
|
|
301
|
+
{ "event": "click", "target": "switch" },
|
|
302
|
+
{
|
|
303
|
+
"expect": {
|
|
304
|
+
"events": { "onAncestorClick": [0] },
|
|
305
|
+
"attrs": { "switch": { "aria-checked": "true" } }
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
],
|
|
309
|
+
"notes": "Native-button variant honours stopPropagation."
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
"id": "switch.base-ui.disabled-uses-aria-disabled",
|
|
313
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L344",
|
|
314
|
+
"upstreamTest": "prop: disabled > uses aria-disabled instead of HTML disabled",
|
|
315
|
+
"apg": "states",
|
|
316
|
+
"config": { "part": "switch", "disabled": true },
|
|
317
|
+
"steps": [
|
|
318
|
+
{ "event": "prop", "set": {} },
|
|
319
|
+
{
|
|
320
|
+
"expect": {
|
|
321
|
+
"attrs": { "switch": { "disabled": null, "aria-disabled": "true" } }
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
],
|
|
325
|
+
"notes": "Disabled switch exposes aria-disabled, not the native disabled attribute."
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"id": "switch.base-ui.disabled-ignores-click",
|
|
329
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L355",
|
|
330
|
+
"upstreamTest": "prop: disabled > should not change its state when clicked",
|
|
331
|
+
"apg": "states",
|
|
332
|
+
"config": { "part": "switch", "disabled": true },
|
|
333
|
+
"steps": [
|
|
334
|
+
{ "event": "click", "target": "switch" },
|
|
335
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "false" } } } }
|
|
336
|
+
],
|
|
337
|
+
"notes": "Click is ignored while disabled."
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"id": "switch.base-ui.readonly-aria",
|
|
341
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L370",
|
|
342
|
+
"upstreamTest": "prop: readOnly > should have the aria-readonly attribute",
|
|
343
|
+
"apg": "states",
|
|
344
|
+
"config": { "part": "switch", "readOnly": true },
|
|
345
|
+
"steps": [
|
|
346
|
+
{ "event": "prop", "set": {} },
|
|
347
|
+
{ "expect": { "attrs": { "switch": { "aria-readonly": "true" } } } }
|
|
348
|
+
],
|
|
349
|
+
"notes": "Read-only switch exposes aria-readonly."
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"id": "switch.base-ui.readonly-ignores-click",
|
|
353
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L380",
|
|
354
|
+
"upstreamTest": "prop: readOnly > should not change its state when clicked",
|
|
355
|
+
"apg": "states",
|
|
356
|
+
"config": { "part": "switch", "readOnly": true },
|
|
357
|
+
"steps": [
|
|
358
|
+
{ "event": "click", "target": "switch" },
|
|
359
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "false" } } } }
|
|
360
|
+
],
|
|
361
|
+
"notes": "Read-only blocks direct clicks."
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"id": "switch.base-ui.readonly-ignores-label-click",
|
|
365
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L393",
|
|
366
|
+
"upstreamTest": "prop: readOnly > should not change its state when its label is clicked",
|
|
367
|
+
"apg": "states",
|
|
368
|
+
"config": { "part": "switch", "readOnly": true },
|
|
369
|
+
"steps": [
|
|
370
|
+
{ "event": "click", "target": "label" },
|
|
371
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "false" } } } }
|
|
372
|
+
],
|
|
373
|
+
"notes": "Read-only also blocks activation through the wrapping label."
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"id": "switch.base-ui.required-aria",
|
|
377
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L414",
|
|
378
|
+
"upstreamTest": "prop: required > should have the aria-required attribute",
|
|
379
|
+
"apg": "states",
|
|
380
|
+
"config": { "part": "switch", "required": true },
|
|
381
|
+
"steps": [
|
|
382
|
+
{ "event": "prop", "set": {} },
|
|
383
|
+
{ "expect": { "attrs": { "switch": { "aria-required": "true" } } } }
|
|
384
|
+
],
|
|
385
|
+
"notes": "Required switch exposes aria-required."
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"id": "switch.base-ui.wrapping-label-toggles",
|
|
389
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L494",
|
|
390
|
+
"upstreamTest": "with native <label> > should toggle the switch when a wrapping <label> is clicked",
|
|
391
|
+
"apg": "extension",
|
|
392
|
+
"config": { "part": "switch" },
|
|
393
|
+
"steps": [
|
|
394
|
+
{ "event": "click", "target": "label" },
|
|
395
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } }
|
|
396
|
+
],
|
|
397
|
+
"notes": "Clicking a wrapping label toggles the switch."
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"id": "switch.base-ui.linked-label-toggles",
|
|
401
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L509",
|
|
402
|
+
"upstreamTest": "with native <label> > should toggle the switch when a explicitly linked <label> is clicked",
|
|
403
|
+
"apg": "extension",
|
|
404
|
+
"config": { "part": "switch", "labelFor": true },
|
|
405
|
+
"steps": [
|
|
406
|
+
{ "event": "click", "target": "label" },
|
|
407
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } }
|
|
408
|
+
],
|
|
409
|
+
"notes": "A label with htmlFor pointing at the switch input toggles it."
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"id": "switch.base-ui.native-button-id-association",
|
|
413
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L527",
|
|
414
|
+
"upstreamTest": "with native <label> > should associate id with the native button when nativeButton=true",
|
|
415
|
+
"apg": "extension",
|
|
416
|
+
"config": { "part": "switch", "nativeButton": true, "labelFor": true },
|
|
417
|
+
"steps": [
|
|
418
|
+
{ "event": "prop", "set": {} },
|
|
419
|
+
{
|
|
420
|
+
"expect": {
|
|
421
|
+
"attrs": {
|
|
422
|
+
"switch": { "id": "mySwitch" },
|
|
423
|
+
"input:hidden": { "id": null }
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
},
|
|
427
|
+
{ "event": "click", "target": "label" },
|
|
428
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } }
|
|
429
|
+
],
|
|
430
|
+
"notes": "In native-button mode the id lives on the button, and the label still toggles it."
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
"id": "switch.base-ui.renders-native-button-keyboard-and-click",
|
|
434
|
+
"upstream": "https://github.com/mui/base-ui/blob/19511bb171f3b360b006c94cf6d07e53cb446505/packages/react/src/switch/root/SwitchRoot.test.tsx#L1355",
|
|
435
|
+
"upstreamTest": "can render a native button",
|
|
436
|
+
"apg": "keyboard",
|
|
437
|
+
"config": { "part": "switch", "nativeButton": true },
|
|
438
|
+
"steps": [
|
|
439
|
+
{ "event": "key", "key": "Tab" },
|
|
440
|
+
{
|
|
441
|
+
"expect": {
|
|
442
|
+
"focus": "switch",
|
|
443
|
+
"attrs": { "switch": { "aria-checked": "false" } }
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
{ "event": "key", "key": "Enter", "target": "switch" },
|
|
447
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } },
|
|
448
|
+
{ "event": "key", "key": " ", "target": "switch" },
|
|
449
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "false" } } } },
|
|
450
|
+
{ "event": "click", "target": "switch" },
|
|
451
|
+
{ "expect": { "attrs": { "switch": { "aria-checked": "true" } } } }
|
|
452
|
+
],
|
|
453
|
+
"notes": "Native button rendering preserves Enter/Space/click activation."
|
|
454
|
+
}
|
|
455
|
+
]
|
|
456
|
+
}
|