@astryxdesign/core 0.5.2-canary.c9c8564 → 0.5.2-canary.e03511b
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/BottomSheet/BottomSheet.d.ts +3 -1
- package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheet.js +4 -3
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts +2 -2
- package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetEdgeTint.js +7 -10
- package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
- package/dist/BottomSheet/BottomSheetSwitcher.js +1 -1
- package/dist/Button/Button.d.ts +2 -1
- package/dist/Button/Button.d.ts.map +1 -1
- package/dist/Button/Button.js +11 -4
- package/dist/Carousel/Carousel.d.ts.map +1 -1
- package/dist/Carousel/Carousel.js +2 -2
- package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
- package/dist/Chat/ChatToolCalls.js +34 -17
- package/dist/ContextMenu/ContextMenu.d.ts +14 -3
- package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
- package/dist/ContextMenu/ContextMenu.js +149 -26
- package/dist/ContextMenu/index.d.ts +1 -0
- package/dist/ContextMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.d.ts +24 -5
- package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenu.js +340 -26
- package/dist/DropdownMenu/DropdownMenuContext.d.ts +1 -1
- package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuItem.js +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +6 -2
- package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
- package/dist/DropdownMenu/DropdownMenuSubMenu.js +43 -14
- package/dist/DropdownMenu/MenuBottomSheet.d.ts +20 -0
- package/dist/DropdownMenu/MenuBottomSheet.d.ts.map +1 -0
- package/dist/DropdownMenu/MenuBottomSheet.js +36 -0
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts +10 -0
- package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -0
- package/dist/DropdownMenu/MenuBottomSheetActionList.js +111 -0
- package/dist/DropdownMenu/index.d.ts +2 -1
- package/dist/DropdownMenu/index.d.ts.map +1 -1
- package/dist/DropdownMenu/menuWidth.d.ts +14 -0
- package/dist/DropdownMenu/menuWidth.d.ts.map +1 -0
- package/dist/DropdownMenu/menuWidth.js +35 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts +10 -0
- package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -0
- package/dist/DropdownMenu/useMenuOverflow.js +60 -0
- package/dist/MoreMenu/MoreMenu.d.ts +8 -2
- package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
- package/dist/MoreMenu/MoreMenu.js +2 -0
- package/dist/MultiSelector/MultiSelector.d.ts +11 -1
- package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
- package/dist/MultiSelector/MultiSelector.js +97 -68
- package/dist/MultiSelector/index.d.ts +1 -1
- package/dist/MultiSelector/index.d.ts.map +1 -1
- package/dist/Popover/Popover.d.ts +10 -6
- package/dist/Popover/Popover.d.ts.map +1 -1
- package/dist/Popover/Popover.js +141 -16
- package/dist/Popover/usePopover.d.ts +4 -0
- package/dist/Popover/usePopover.d.ts.map +1 -1
- package/dist/Popover/usePopover.js +52 -5
- package/dist/Selector/Selector.d.ts +10 -0
- package/dist/Selector/Selector.d.ts.map +1 -1
- package/dist/Selector/Selector.js +106 -80
- package/dist/Selector/SelectorBottomSheet.d.ts +21 -0
- package/dist/Selector/SelectorBottomSheet.d.ts.map +1 -0
- package/dist/Selector/SelectorBottomSheet.js +83 -0
- package/dist/Selector/index.d.ts +1 -1
- package/dist/Selector/index.d.ts.map +1 -1
- package/dist/Selector/selectorPresentation.stylex.d.ts +16 -0
- package/dist/Selector/selectorPresentation.stylex.d.ts.map +1 -0
- package/dist/Selector/selectorPresentation.stylex.js +21 -0
- package/dist/Selector/useSelectorPresentation.d.ts +32 -0
- package/dist/Selector/useSelectorPresentation.d.ts.map +1 -0
- package/dist/Selector/useSelectorPresentation.js +90 -0
- package/dist/Toast/useToastGesture.d.ts.map +1 -1
- package/dist/Toast/useToastGesture.js +46 -9
- package/dist/astryx.css +19 -1
- package/dist/hooks/useAdaptivePresentation.d.ts +5 -0
- package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -0
- package/dist/hooks/useAdaptivePresentation.js +19 -0
- package/dist/hooks/useFocusReturnVisibility.d.ts +7 -0
- package/dist/hooks/useFocusReturnVisibility.d.ts.map +1 -0
- package/dist/hooks/useFocusReturnVisibility.js +35 -0
- package/dist/hooks/useFocusTrap.d.ts.map +1 -1
- package/dist/hooks/useFocusTrap.js +12 -0
- package/locales/en.json +20 -0
- package/locales/pseudo.json +15 -0
- package/package.json +2 -2
- package/src/BottomSheet/BottomSheet.doc.mjs +37 -0
- package/src/BottomSheet/BottomSheet.spec.md +177 -0
- package/src/BottomSheet/BottomSheet.test.tsx +29 -0
- package/src/BottomSheet/BottomSheet.tsx +7 -4
- package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +4 -6
- package/src/BottomSheet/BottomSheetEdgeTint.tsx +7 -10
- package/src/BottomSheet/BottomSheetSwitcher.tsx +1 -2
- package/src/Button/Button.doc.mjs +56 -0
- package/src/Button/Button.test.tsx +10 -0
- package/src/Button/Button.tsx +13 -5
- package/src/ButtonGroup/ButtonGroup.doc.mjs +47 -0
- package/src/Carousel/Carousel.test.tsx +83 -0
- package/src/Carousel/Carousel.tsx +8 -2
- package/src/Chat/ChatToolCalls.test.tsx +44 -0
- package/src/Chat/ChatToolCalls.tsx +36 -15
- package/src/CheckboxList/CheckboxList.doc.mjs +172 -31
- package/src/CheckboxList/CheckboxList.spec.md +214 -0
- package/src/CommandPalette/CommandPalette.doc.mjs +72 -0
- package/src/CommandPalette/CommandPalette.spec.md +223 -0
- package/src/ComplexSelector/ComplexSelector.doc.mjs +42 -0
- package/src/ComplexSelector/ComplexSelector.spec.md +189 -0
- package/src/ContextMenu/ContextMenu.doc.mjs +61 -1
- package/src/ContextMenu/ContextMenu.spec.md +206 -0
- package/src/ContextMenu/ContextMenu.test.tsx +131 -1
- package/src/ContextMenu/ContextMenu.tsx +199 -32
- package/src/ContextMenu/index.ts +1 -0
- package/src/Divider/Divider.doc.mjs +24 -0
- package/src/Divider/Divider.spec.md +150 -0
- package/src/DropdownMenu/DropdownMenu.doc.mjs +305 -40
- package/src/DropdownMenu/DropdownMenu.spec.md +245 -0
- package/src/DropdownMenu/DropdownMenu.test.tsx +518 -7
- package/src/DropdownMenu/DropdownMenu.tsx +459 -28
- package/src/DropdownMenu/DropdownMenuContext.tsx +1 -1
- package/src/DropdownMenu/DropdownMenuItem.tsx +2 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +4 -2
- package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +124 -0
- package/src/DropdownMenu/DropdownMenuSubMenu.tsx +72 -17
- package/src/DropdownMenu/MenuBottomSheet.tsx +46 -0
- package/src/DropdownMenu/MenuBottomSheetActionList.tsx +141 -0
- package/src/DropdownMenu/index.ts +2 -0
- package/src/DropdownMenu/menuWidth.ts +51 -0
- package/src/DropdownMenu/useMenuOverflow.ts +77 -0
- package/src/FieldStatus/FieldStatus.doc.mjs +21 -0
- package/src/FieldStatus/FieldStatus.spec.md +212 -0
- package/src/Grid/Grid.doc.mjs +19 -0
- package/src/Grid/Grid.spec.md +161 -0
- package/src/Icon/Icon.doc.mjs +196 -48
- package/src/Icon/Icon.spec.md +191 -0
- package/src/IconButton/IconButton.doc.mjs +38 -0
- package/src/Kbd/Kbd.doc.mjs +18 -0
- package/src/Kbd/Kbd.spec.md +141 -0
- package/src/Layout/Layout.doc.mjs +32 -0
- package/src/Layout/Layout.spec.md +199 -0
- package/src/Lightbox/Lightbox.doc.mjs +149 -33
- package/src/Lightbox/Lightbox.spec.md +197 -0
- package/src/Markdown/Markdown.doc.mjs +60 -0
- package/src/Markdown/Markdown.spec.md +200 -0
- package/src/MobileNav/MobileNav.doc.mjs +140 -32
- package/src/MobileNav/MobileNav.spec.md +208 -0
- package/src/MoreMenu/MoreMenu.doc.mjs +59 -0
- package/src/MoreMenu/MoreMenu.spec.md +221 -0
- package/src/MoreMenu/MoreMenu.test.tsx +47 -0
- package/src/MoreMenu/MoreMenu.tsx +13 -1
- package/src/MultiSelector/MultiSelector.doc.mjs +128 -0
- package/src/MultiSelector/MultiSelector.spec.md +266 -0
- package/src/MultiSelector/MultiSelector.test.tsx +127 -0
- package/src/MultiSelector/MultiSelector.tsx +121 -73
- package/src/MultiSelector/index.ts +1 -0
- package/src/NavIcon/NavIcon.doc.mjs +17 -0
- package/src/NavIcon/NavIcon.spec.md +133 -0
- package/src/NavMenu/NavHeadingMenu.spec.md +205 -0
- package/src/NavMenu/NavMenu.doc.mjs +37 -0
- package/src/Outline/Outline.doc.mjs +35 -0
- package/src/Outline/Outline.spec.md +161 -0
- package/src/OverflowList/OverflowList.doc.mjs +24 -0
- package/src/OverflowList/OverflowList.spec.md +156 -0
- package/src/Pagination/Pagination.doc.mjs +74 -0
- package/src/Pagination/Pagination.spec.md +225 -0
- package/src/Popover/Popover.doc.mjs +11 -11
- package/src/Popover/Popover.test.tsx +397 -2
- package/src/Popover/Popover.tsx +228 -21
- package/src/Popover/usePopover.tsx +92 -15
- package/src/ProgressBar/ProgressBar.doc.mjs +198 -38
- package/src/ProgressBar/ProgressBar.spec.md +260 -0
- package/src/Resizable/Resizable.doc.mjs +59 -16
- package/src/Resizable/Resizable.spec.md +194 -0
- package/src/Section/Section.doc.mjs +17 -0
- package/src/Section/Section.spec.md +138 -0
- package/src/SegmentedControl/SegmentedControl.doc.mjs +83 -0
- package/src/SegmentedControl/SegmentedControl.spec.md +151 -0
- package/src/Selector/Selector.doc.mjs +12 -0
- package/src/Selector/Selector.spec.md +202 -0
- package/src/Selector/Selector.test.tsx +135 -0
- package/src/Selector/Selector.tsx +141 -82
- package/src/Selector/SelectorBottomSheet.tsx +97 -0
- package/src/Selector/index.ts +1 -0
- package/src/Selector/selectorPresentation.stylex.ts +20 -0
- package/src/Selector/useSelectorPresentation.ts +147 -0
- package/src/Skeleton/Skeleton.doc.mjs +12 -0
- package/src/Skeleton/Skeleton.spec.md +126 -0
- package/src/Slider/Slider.doc.mjs +184 -30
- package/src/Slider/Slider.spec.md +223 -0
- package/src/Stack/Stack.doc.mjs +22 -0
- package/src/Stack/Stack.spec.md +154 -0
- package/src/StatusDot/StatusDot.doc.mjs +17 -0
- package/src/StatusDot/StatusDot.spec.md +137 -0
- package/src/Switch/Switch.doc.mjs +40 -0
- package/src/Switch/Switch.spec.md +174 -0
- package/src/Table/Table.doc.mjs +102 -24
- package/src/Table/Table.spec.md +283 -0
- package/src/Text/Text.doc.mjs +190 -43
- package/src/Text/Text.spec.md +205 -0
- package/src/TextArea/TextArea.doc.mjs +255 -45
- package/src/TextArea/TextArea.spec.md +204 -0
- package/src/Toast/ToastViewport.test.tsx +118 -4
- package/src/Toast/useToastGesture.ts +61 -8
- package/src/ToggleButton/ToggleButton.doc.mjs +56 -0
- package/src/Toolbar/Toolbar.doc.mjs +19 -0
- package/src/Toolbar/Toolbar.spec.md +173 -0
- package/src/Tooltip/Tooltip.doc.mjs +17 -0
- package/src/Tooltip/Tooltip.spec.md +141 -0
- package/src/TreeList/TreeList.doc.mjs +58 -0
- package/src/TreeList/TreeList.spec.md +220 -0
- package/src/Typeahead/Typeahead.doc.mjs +83 -1
- package/src/Typeahead/Typeahead.spec.md +250 -0
- package/src/hooks/useAdaptivePresentation.ts +35 -0
- package/src/hooks/useFocusReturnVisibility.ts +45 -0
- package/src/hooks/useFocusTrap.test.tsx +40 -0
- package/src/hooks/useFocusTrap.ts +13 -0
- package/src/theme/themingTargets.test.ts +91 -25
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
template_version: 3
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:Slider
|
|
6
|
+
authority: draft
|
|
7
|
+
archive_reason: null
|
|
8
|
+
superseded_by: null
|
|
9
|
+
approved_by: null
|
|
10
|
+
approved_at: null
|
|
11
|
+
owners: [cixzhang]
|
|
12
|
+
review_triggers: [theming]
|
|
13
|
+
verified_by:
|
|
14
|
+
[
|
|
15
|
+
packages/core/src/Slider/Slider.test.tsx,
|
|
16
|
+
packages/core/src/theme/themingTargets.test.ts,
|
|
17
|
+
scripts/check-knowledge.mjs,
|
|
18
|
+
]
|
|
19
|
+
families: []
|
|
20
|
+
design_specs: []
|
|
21
|
+
architecture: [architecture:component-theming-surface]
|
|
22
|
+
contributing: []
|
|
23
|
+
system_specs: []
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
# Slider component contract
|
|
27
|
+
|
|
28
|
+
## Intent
|
|
29
|
+
|
|
30
|
+
Slider presents a labeled control for selecting one numeric value or a bounded
|
|
31
|
+
range. This draft records its current consumer anatomy and theming ownership
|
|
32
|
+
without changing runtime behavior, styling, targets, or public API.
|
|
33
|
+
|
|
34
|
+
## Compatibility and migration
|
|
35
|
+
|
|
36
|
+
- Released default preserved: `yes`
|
|
37
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling,
|
|
38
|
+
targets, and public API remain unchanged
|
|
39
|
+
- Controlled/uncontrolled behavior: unchanged; Slider remains controlled
|
|
40
|
+
- Migration decision: none
|
|
41
|
+
|
|
42
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
43
|
+
|
|
44
|
+
## Ownership boundary
|
|
45
|
+
|
|
46
|
+
**Owns**
|
|
47
|
+
|
|
48
|
+
- The current slider row, background track, filled range, tick marks and labels,
|
|
49
|
+
thumbs, and adjacent text value presentation.
|
|
50
|
+
- The existing `slider`, `slider-track`, and `slider-thumb` public targets.
|
|
51
|
+
|
|
52
|
+
**Does not own / non-goals**
|
|
53
|
+
|
|
54
|
+
- Label and validation-message presentation — owned by `component:Field` and
|
|
55
|
+
`component:FieldStatus`.
|
|
56
|
+
- Value-tooltip presentation — owned by `component:Tooltip`.
|
|
57
|
+
- New public targets for the filled range, tick marks, mark labels, description,
|
|
58
|
+
or adjacent text value display.
|
|
59
|
+
- A decision that the current target asymmetry should be preserved or removed.
|
|
60
|
+
|
|
61
|
+
## Public concepts
|
|
62
|
+
|
|
63
|
+
No new public concept is introduced. Consumer props, modes, states, and usage
|
|
64
|
+
remain documented in `Slider.doc.mjs`.
|
|
65
|
+
|
|
66
|
+
## Behavioral and layout contract
|
|
67
|
+
|
|
68
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
69
|
+
| --- | ----------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------------------------------------------------- |
|
|
70
|
+
| FR1 | The current render places a filled range, one or two thumbs, and optional tick marks over the background track. | Current source, docs, and focused tests | Verified current behavior; no new behavior decided |
|
|
71
|
+
| FR2 | `Slider`, `Track`, and `Thumb` carry the existing `slider`, `slider-track`, and `slider-thumb` targets respectively. | Current source and public docs | Verified current behavior; no target change |
|
|
72
|
+
| FR3 | Filled range, tick marks, mark labels, and adjacent text value display are stable rendered parts without their own current Slider target. | Current source and public docs | Verified current asymmetry; not ratified as policy |
|
|
73
|
+
| FR4 | Label and status presentation continue to use Field and FieldStatus; value tooltips continue to use Tooltip. | Current source and focused tests | Verified composition boundary |
|
|
74
|
+
|
|
75
|
+
### Observed current target asymmetry
|
|
76
|
+
|
|
77
|
+
ProgressBar currently exposes targets for its fill and marks, while Slider
|
|
78
|
+
exposes targets for its root row, background track, and thumbs but not its
|
|
79
|
+
filled range, tick marks, mark labels, or adjacent text value display. This is
|
|
80
|
+
implementation evidence for a joint audit, not approval of either target shape.
|
|
81
|
+
|
|
82
|
+
### Allowed variation
|
|
83
|
+
|
|
84
|
+
- Orientation, single or range mode, disabled state, value-display mode, and the
|
|
85
|
+
number or labels of supplied marks remain current capabilities rather than
|
|
86
|
+
separate target names.
|
|
87
|
+
- A description, status message, mark label, text value, or value tooltip may be
|
|
88
|
+
absent without changing the remaining anatomy.
|
|
89
|
+
|
|
90
|
+
### Representative states
|
|
91
|
+
|
|
92
|
+
| State | Required invariant | Allowed variation |
|
|
93
|
+
| ------------------------ | ----------------------------------------------------------------------- | -------------------------------------------------- |
|
|
94
|
+
| Single value | One thumb and a filled range render over the track. | Orientation, value, disabled state, value display |
|
|
95
|
+
| Range value | Two thumbs bound the filled range. | Values and minimum step separation |
|
|
96
|
+
| With marks | Tick marks and optional mark labels align to the same range geometry. | Mark count, values, and label presence |
|
|
97
|
+
| With shared field output | Field or Tooltip renders the requested label, feedback, or value layer. | Description, status, disabled reason, tooltip mode |
|
|
98
|
+
|
|
99
|
+
### Transformation and precedence order
|
|
100
|
+
|
|
101
|
+
- No new value, snapping, geometry, interaction, or styling precedence rule is
|
|
102
|
+
introduced.
|
|
103
|
+
|
|
104
|
+
### Performance and resources
|
|
105
|
+
|
|
106
|
+
- No new performance or resource rule is introduced.
|
|
107
|
+
|
|
108
|
+
## Accessibility contract
|
|
109
|
+
|
|
110
|
+
This draft does not change or extend Slider's existing accessible name, value,
|
|
111
|
+
range-thumb naming, description/status association, keyboard behavior, disabled
|
|
112
|
+
behavior, or value-tooltip behavior.
|
|
113
|
+
|
|
114
|
+
## Design relationships
|
|
115
|
+
|
|
116
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
117
|
+
| ----------------------- | ------------------------------------------------------------- | ------------------------------- | -------------- | ------------------ |
|
|
118
|
+
| Label and description | Identify and explain the numeric setting. | Current shared-component source | Supporting | FR4 |
|
|
119
|
+
| Slider and track | Arrange the current interactive range control and rail. | Current source and public docs | Prominent | FR1, FR2 |
|
|
120
|
+
| Filled range and thumbs | Show the selected value or interval over the available range. | Current source and public docs | Prominent | FR1, FR2, FR3 |
|
|
121
|
+
| Tick marks and labels | Show optional supplied positions and their text. | Current source and public docs | Supporting | FR1, FR3 |
|
|
122
|
+
| Value presentation | Shows the formatted value as text or a shared Tooltip. | Current source and public docs | Supporting | FR3, FR4 |
|
|
123
|
+
| Status message | Presents shared validation feedback below the slider. | Current shared-component source | Supporting | FR4 |
|
|
124
|
+
|
|
125
|
+
### Theming anatomy
|
|
126
|
+
|
|
127
|
+
<!-- anatomy-theming:v1 -->
|
|
128
|
+
|
|
129
|
+
```json
|
|
130
|
+
{
|
|
131
|
+
"Label": {
|
|
132
|
+
"delegatesTo": {"owner": "component:Field", "target": "field-label"}
|
|
133
|
+
},
|
|
134
|
+
"Description": {
|
|
135
|
+
"none": {
|
|
136
|
+
"reason": "unsettled: No current public target reaches this part; future target ownership is undecided."
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"Slider": {"target": "slider"},
|
|
140
|
+
"Track": {"target": "slider-track"},
|
|
141
|
+
"Filled range": {
|
|
142
|
+
"none": {
|
|
143
|
+
"reason": "unsettled: No current public Slider target reaches this part; future target ownership is undecided."
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
"Tick mark": {
|
|
147
|
+
"none": {
|
|
148
|
+
"reason": "unsettled: No current public Slider target reaches this part; future target ownership is undecided."
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
"Mark label": {
|
|
152
|
+
"none": {
|
|
153
|
+
"reason": "unsettled: No current public Slider target reaches this part; future target ownership is undecided."
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
"Thumb": {"target": "slider-thumb"},
|
|
157
|
+
"Value display": {
|
|
158
|
+
"none": {
|
|
159
|
+
"reason": "unsettled: No current public Slider target reaches this part; future target ownership is undecided."
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
"Value tooltip": {
|
|
163
|
+
"delegatesTo": {"owner": "component:Tooltip", "target": "tooltip"}
|
|
164
|
+
},
|
|
165
|
+
"Status message": {
|
|
166
|
+
"delegatesTo": {
|
|
167
|
+
"owner": "component:FieldStatus",
|
|
168
|
+
"target": "field-status"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
`Filled range`, `Tick mark`, `Mark label`, and `Value display` remain stable
|
|
175
|
+
consumer anatomy, but no current Slider target reaches them. The map records
|
|
176
|
+
those gaps without making their absence intentional. `Value display` names the
|
|
177
|
+
adjacent text mode; the separately listed value tooltip retains Tooltip's target.
|
|
178
|
+
|
|
179
|
+
## Family and system relationships
|
|
180
|
+
|
|
181
|
+
- `architecture:component-theming-surface` owns anatomy qualification, factual
|
|
182
|
+
`none` dispositions, and composition-preserving target ownership.
|
|
183
|
+
- Field, FieldStatus, and Tooltip retain their existing public target contracts
|
|
184
|
+
when composed by Slider.
|
|
185
|
+
- Slider and ProgressBar both render a track, a filled segment, positioned
|
|
186
|
+
indicators, and optional value presentation, while their current target
|
|
187
|
+
coverage differs. That evidence requires a future joint family/audit pass; it
|
|
188
|
+
does not declare a current family, require a new target, or authorize runtime
|
|
189
|
+
behavior changes.
|
|
190
|
+
|
|
191
|
+
## Verification map
|
|
192
|
+
|
|
193
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
194
|
+
| ------------------- | -------------------------------------------------------------------------------------- | ------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ---------------------- |
|
|
195
|
+
| FR1 | `Slider.test.tsx` structure, range, and marks suites | Single, range, horizontal, vertical, marks | Removing or misaligning stable parts breaks existing role, position, or mark assertions. | `audit:Slider/anatomy` |
|
|
196
|
+
| FR2 | `themingTargets.test.ts` | Root, track, and thumb target call sites | Source and public target metadata drift fails the target guard. | `audit:Slider/theming` |
|
|
197
|
+
| FR3 | Source and consumer-doc review | Filled range, marks, labels, adjacent text value | A missing target is inaccurately documented as present or intentionally permanent. | `audit:Slider/theming` |
|
|
198
|
+
| FR4 | Source inspection; focused tests cover label, status, and disabled-reason Tooltip only | Label, status, value tooltip, disabled reason | Shared composition or its accessible association disappears; value-tooltip composition still lacks focused coverage. | `audit:Slider/anatomy` |
|
|
199
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and three current local targets | Missing, extra, prefixed, stale, or unclaimed mappings fail repository validation. | `audit:Slider/theming` |
|
|
200
|
+
|
|
201
|
+
The focused Slider suite does not separately assert the exact `slider`,
|
|
202
|
+
`slider-track`, or `slider-thumb` class placement. The source/metadata target
|
|
203
|
+
guard covers those declarations. It also covers only the disabled-reason
|
|
204
|
+
Tooltip path, not the `valueDisplay="tooltip"` composition; that anatomy is
|
|
205
|
+
source-inspected and remains missing focused test coverage.
|
|
206
|
+
|
|
207
|
+
## Decision log
|
|
208
|
+
|
|
209
|
+
None. This draft records current facts and introduces no component-local design,
|
|
210
|
+
family, theming, or API decision.
|
|
211
|
+
|
|
212
|
+
## Open questions
|
|
213
|
+
|
|
214
|
+
- **OQ1 — After a joint ProgressBar and Slider family audit, should any shared
|
|
215
|
+
painted parts have aligned target coverage?** (`human-api`)
|
|
216
|
+
|
|
217
|
+
This question records the audit need only. It does not presume that either
|
|
218
|
+
component should add, remove, or rename a target.
|
|
219
|
+
|
|
220
|
+
## Content boundary
|
|
221
|
+
|
|
222
|
+
This file does not duplicate consumer prop tables, examples, implementation
|
|
223
|
+
steps, audit outcomes, or shared-component contracts. It links to their owners.
|
package/src/Stack/Stack.doc.mjs
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Stack container',
|
|
7
|
+
required: true,
|
|
8
|
+
description: 'Layout container that arranges content along one flex axis.',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'Item',
|
|
12
|
+
required: false,
|
|
13
|
+
description: 'Optional StackItem wrapper that controls one item in the stack.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Content',
|
|
17
|
+
required: false,
|
|
18
|
+
description: 'Caller-supplied content rendered by a Stack or StackItem.',
|
|
19
|
+
},
|
|
20
|
+
];
|
|
21
|
+
|
|
3
22
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
23
|
|
|
5
24
|
export const docs = {
|
|
@@ -440,6 +459,7 @@ export const docs = {
|
|
|
440
459
|
},
|
|
441
460
|
],
|
|
442
461
|
usage: {
|
|
462
|
+
anatomy,
|
|
443
463
|
description:
|
|
444
464
|
'Stack arranges items in a row or column with consistent spacing. Use the gap prop to control the space between items.',
|
|
445
465
|
bestPractices: [
|
|
@@ -629,6 +649,7 @@ export const docsZh = {
|
|
|
629
649
|
},
|
|
630
650
|
],
|
|
631
651
|
usage: {
|
|
652
|
+
anatomy,
|
|
632
653
|
description:
|
|
633
654
|
'Stack arranges items in a row or column with consistent spacing. Use the gap prop to control the space between items.',
|
|
634
655
|
bestPractices: [
|
|
@@ -643,6 +664,7 @@ export const docsZh = {
|
|
|
643
664
|
export const docsDense = {
|
|
644
665
|
description: 'Stack layout primitives for horizontal/vertical sequences using flexbox w/ themed spacing tokens.',
|
|
645
666
|
usage: {
|
|
667
|
+
anatomy,
|
|
646
668
|
description:
|
|
647
669
|
'Stack arranges items in a row or column with consistent spacing. Use the gap prop to control the space between items.',
|
|
648
670
|
bestPractices: [
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
template_version: 3
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:Stack
|
|
6
|
+
authority: draft
|
|
7
|
+
archive_reason: null
|
|
8
|
+
superseded_by: null
|
|
9
|
+
approved_by: null
|
|
10
|
+
approved_at: null
|
|
11
|
+
owners: [cixzhang]
|
|
12
|
+
review_triggers: [layout, theming]
|
|
13
|
+
verified_by:
|
|
14
|
+
[
|
|
15
|
+
packages/core/src/Stack/Stack.test.tsx,
|
|
16
|
+
packages/core/src/Stack/StackItem.test.tsx,
|
|
17
|
+
packages/core/src/theme/themingTargets.test.ts,
|
|
18
|
+
scripts/check-knowledge.mjs,
|
|
19
|
+
]
|
|
20
|
+
families: [family:layout-primitives]
|
|
21
|
+
design_specs: []
|
|
22
|
+
architecture:
|
|
23
|
+
[architecture:component-theming-surface, architecture:container-padding]
|
|
24
|
+
contributing: []
|
|
25
|
+
system_specs: []
|
|
26
|
+
---
|
|
27
|
+
|
|
28
|
+
# Stack component contract
|
|
29
|
+
|
|
30
|
+
## Intent
|
|
31
|
+
|
|
32
|
+
Stack arranges caller-supplied content along one flex axis. StackItem optionally
|
|
33
|
+
wraps one item to control its participation in that layout. This draft records
|
|
34
|
+
the current consumer anatomy and theming ownership without changing layout,
|
|
35
|
+
padding, targets, or public API.
|
|
36
|
+
|
|
37
|
+
## Compatibility and migration
|
|
38
|
+
|
|
39
|
+
- Released default preserved: `yes`
|
|
40
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling,
|
|
41
|
+
targets, and public API remain unchanged
|
|
42
|
+
- Controlled/uncontrolled behavior: not applicable
|
|
43
|
+
- Migration decision: none
|
|
44
|
+
|
|
45
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
46
|
+
|
|
47
|
+
## Ownership boundary
|
|
48
|
+
|
|
49
|
+
**Owns**
|
|
50
|
+
|
|
51
|
+
- The Stack container and its current `stack` theming target.
|
|
52
|
+
- The optional StackItem wrapper and its current `stack-item` theming target.
|
|
53
|
+
|
|
54
|
+
**Does not own / non-goals**
|
|
55
|
+
|
|
56
|
+
- Content supplied to Stack or StackItem — owned by the caller.
|
|
57
|
+
- Container-inset publication or descendant bleed behavior; Stack padding is
|
|
58
|
+
currently local and does not participate in the container-padding protocol.
|
|
59
|
+
- New layout, padding, or responsive behavior.
|
|
60
|
+
|
|
61
|
+
## Public concepts
|
|
62
|
+
|
|
63
|
+
No new public concept is introduced. Consumer props and usage remain documented
|
|
64
|
+
in `Stack.doc.mjs`; `family:layout-primitives` owns the shared layout vocabulary.
|
|
65
|
+
|
|
66
|
+
## Behavioral and layout contract
|
|
67
|
+
|
|
68
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
69
|
+
| --- | -------------------------------------------------------------------------------------------------------------- | --------------------------------------- | -------------------------------------------------- |
|
|
70
|
+
| FR1 | Stack, HStack, and VStack render caller content in a container carrying the current `stack` target. | Current source, docs, tests, and family | Verified current behavior; no new behavior decided |
|
|
71
|
+
| FR2 | StackItem renders caller content in its own wrapper carrying the current `stack-item` target. | Current source, docs, and tests | Verified current behavior; no new behavior decided |
|
|
72
|
+
| FR3 | Stack and StackItem render caller-supplied content directly without applying a content-specific public target. | Current source and tests | Verified current behavior; no target change |
|
|
73
|
+
| FR4 | Stack's existing padding remains local and does not publish container-padding geometry to descendants. | Current source and architecture record | Verified current behavior; no protocol change |
|
|
74
|
+
|
|
75
|
+
### Allowed variation
|
|
76
|
+
|
|
77
|
+
- Caller content may render directly in Stack or inside optional StackItem
|
|
78
|
+
wrappers without changing target ownership.
|
|
79
|
+
|
|
80
|
+
### Representative states
|
|
81
|
+
|
|
82
|
+
- Horizontal and vertical Stack forms use the same container target. StackItem
|
|
83
|
+
uses its item target across static, fill, and scrollable behavior.
|
|
84
|
+
|
|
85
|
+
### Transformation and precedence order
|
|
86
|
+
|
|
87
|
+
- No new direction, alignment, spacing, sizing, or padding precedence rule is
|
|
88
|
+
introduced.
|
|
89
|
+
|
|
90
|
+
### Performance and resources
|
|
91
|
+
|
|
92
|
+
- No new performance or resource rule is introduced.
|
|
93
|
+
|
|
94
|
+
## Accessibility contract
|
|
95
|
+
|
|
96
|
+
This draft does not change or extend Stack's polymorphic element, forwarded DOM
|
|
97
|
+
props, or caller-owned content semantics.
|
|
98
|
+
|
|
99
|
+
## Design relationships
|
|
100
|
+
|
|
101
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
102
|
+
| ---------------- | ---------------------------------------------------------- | ----------------------------------------- | ----------------- | ------------------ |
|
|
103
|
+
| Stack container | Presents the one-dimensional layout container. | Current source, docs, and family contract | Supporting | FR1, FR4 |
|
|
104
|
+
| Item | Optionally controls one child's participation in Stack. | Current source, docs, and family contract | Supporting | FR2 |
|
|
105
|
+
| Content | Presents caller-supplied content in either public wrapper. | Caller-supplied content | Context-dependent | FR1, FR2, FR3 |
|
|
106
|
+
|
|
107
|
+
### Theming anatomy
|
|
108
|
+
|
|
109
|
+
<!-- anatomy-theming:v1 -->
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
{
|
|
113
|
+
"Stack container": {"target": "stack"},
|
|
114
|
+
"Item": {"target": "stack-item"},
|
|
115
|
+
"Content": {
|
|
116
|
+
"none": {
|
|
117
|
+
"reason": "intentional: Caller-supplied content retains its own theming ownership; Stack and StackItem apply no content target."
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
## Family and system relationships
|
|
124
|
+
|
|
125
|
+
- `family:layout-primitives` owns Stack's shared direction, alignment, spacing,
|
|
126
|
+
sizing, padding, and item-participation vocabulary.
|
|
127
|
+
- `architecture:container-padding` records that Stack padding is local and does
|
|
128
|
+
not publish descendant bleed geometry.
|
|
129
|
+
- `architecture:component-theming-surface` owns anatomy qualification and target
|
|
130
|
+
mapping rules.
|
|
131
|
+
|
|
132
|
+
## Verification map
|
|
133
|
+
|
|
134
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
135
|
+
| ------------------- | -------------------------------------------------- | ---------------------------------------------- | -------------------------------------------------------------------------------------- | ------------------------- |
|
|
136
|
+
| FR1, FR3, FR4 | `Stack.test.tsx` render, props, and padding suites | Horizontal/vertical, direct content, padding | Removing the container/content or changing shipped local padding fails existing tests. | `audit:Stack/anatomy` |
|
|
137
|
+
| FR2, FR3 | `StackItem.test.tsx` render and behavior suites | Static, fill, polymorphic, and scrollable item | Removing the wrapper/content or changing current item behavior fails existing tests. | `audit:StackItem/anatomy` |
|
|
138
|
+
| Target inventory | `packages/core/src/theme/themingTargets.test.ts` | Stack and StackItem targets | Runtime and documented target metadata drift fails target validation. | `audit:Stack/theming` |
|
|
139
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and both current targets | Missing, extra, prefixed, or stale mappings fail repository validation. | `audit:Stack/theming` |
|
|
140
|
+
|
|
141
|
+
## Decision log
|
|
142
|
+
|
|
143
|
+
None. This draft records current facts and introduces no component-local design,
|
|
144
|
+
layout, or API decision.
|
|
145
|
+
|
|
146
|
+
## Open questions
|
|
147
|
+
|
|
148
|
+
None.
|
|
149
|
+
|
|
150
|
+
## Content boundary
|
|
151
|
+
|
|
152
|
+
This file does not duplicate consumer prop tables, examples, family layout
|
|
153
|
+
rules, container-padding mechanics, implementation steps, or system rules. It
|
|
154
|
+
links to their owners.
|
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Dot',
|
|
7
|
+
required: true,
|
|
8
|
+
description: 'Painted status dot that carries the selected semantic variant.',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'Status icon',
|
|
12
|
+
required: false,
|
|
13
|
+
description: 'Optional caller-supplied icon rendered inside the dot.',
|
|
14
|
+
},
|
|
15
|
+
];
|
|
16
|
+
|
|
3
17
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
18
|
|
|
5
19
|
export const docs = {
|
|
@@ -55,6 +69,7 @@ export const docs = {
|
|
|
55
69
|
],
|
|
56
70
|
},
|
|
57
71
|
usage: {
|
|
72
|
+
anatomy,
|
|
58
73
|
description:
|
|
59
74
|
'A small colored dot that communicates status like online/offline presence or severity levels. Supports five semantic variants and an optional pulse animation. Always pair with a visible text label, as color alone should not carry meaning.',
|
|
60
75
|
bestPractices: [
|
|
@@ -115,6 +130,7 @@ export const docsZh = {
|
|
|
115
130
|
],
|
|
116
131
|
},
|
|
117
132
|
usage: {
|
|
133
|
+
anatomy,
|
|
118
134
|
description:
|
|
119
135
|
'A small colored dot that communicates status like online/offline presence or severity levels. Supports five semantic variants and an optional pulse animation. Always pair with a visible text label, as color alone should not carry meaning.',
|
|
120
136
|
bestPractices: [
|
|
@@ -133,6 +149,7 @@ export const docsZh = {
|
|
|
133
149
|
export const docsDense = {
|
|
134
150
|
description: 'Small colored dot indicator for status display (online/offline, severity, etc).',
|
|
135
151
|
usage: {
|
|
152
|
+
anatomy,
|
|
136
153
|
description:
|
|
137
154
|
'A small colored dot that communicates status like online/offline presence or severity levels. Supports five semantic variants and an optional pulse animation. Always pair with a visible text label, as color alone should not carry meaning.',
|
|
138
155
|
bestPractices: [
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
---
|
|
2
|
+
schema_version: 1
|
|
3
|
+
template_version: 3
|
|
4
|
+
kind: component
|
|
5
|
+
id: component:StatusDot
|
|
6
|
+
authority: draft
|
|
7
|
+
archive_reason: null
|
|
8
|
+
superseded_by: null
|
|
9
|
+
approved_by: null
|
|
10
|
+
approved_at: null
|
|
11
|
+
owners: [cixzhang]
|
|
12
|
+
review_triggers: [theming]
|
|
13
|
+
verified_by:
|
|
14
|
+
[packages/core/src/StatusDot/StatusDot.test.tsx, scripts/check-knowledge.mjs]
|
|
15
|
+
families: []
|
|
16
|
+
design_specs: []
|
|
17
|
+
architecture: [architecture:component-theming-surface]
|
|
18
|
+
contributing: []
|
|
19
|
+
system_specs: []
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
# StatusDot component contract
|
|
23
|
+
|
|
24
|
+
## Intent
|
|
25
|
+
|
|
26
|
+
StatusDot renders a compact painted status signal with an optional status icon.
|
|
27
|
+
This draft records the current consumer anatomy and theming ownership without
|
|
28
|
+
changing runtime behavior, target compatibility, or public API.
|
|
29
|
+
|
|
30
|
+
## Compatibility and migration
|
|
31
|
+
|
|
32
|
+
- Released default preserved: `yes`
|
|
33
|
+
- Compatibility class: additive documentation only; runtime, DOM, styling,
|
|
34
|
+
targets, aliases, and public API remain unchanged
|
|
35
|
+
- Controlled/uncontrolled behavior: not applicable
|
|
36
|
+
- Migration decision: none
|
|
37
|
+
|
|
38
|
+
Consumer migration instructions belong in consumer docs and release notes.
|
|
39
|
+
|
|
40
|
+
## Ownership boundary
|
|
41
|
+
|
|
42
|
+
**Owns**
|
|
43
|
+
|
|
44
|
+
- The painted dot and its current `status-dot` theming target.
|
|
45
|
+
- The wrapper that positions optional status-icon content inside the dot.
|
|
46
|
+
|
|
47
|
+
**Does not own / non-goals**
|
|
48
|
+
|
|
49
|
+
- The artwork supplied through `icon` — owned by the caller.
|
|
50
|
+
- The tooltip surface or trigger behavior when `tooltip` is supplied — owned by
|
|
51
|
+
Tooltip.
|
|
52
|
+
- A built-in icon for each variant — the default dot remains childless.
|
|
53
|
+
|
|
54
|
+
## Public concepts
|
|
55
|
+
|
|
56
|
+
No new public concept is introduced. Consumer props and usage remain documented
|
|
57
|
+
in `StatusDot.doc.mjs`.
|
|
58
|
+
|
|
59
|
+
## Behavioral and layout contract
|
|
60
|
+
|
|
61
|
+
| ID | Candidate invariant | Basis | Draft review state |
|
|
62
|
+
| --- | ------------------------------------------------------------------------------------------------------------------ | ------------------------------- | -------------------------------------------------- |
|
|
63
|
+
| FR1 | The current render always contains one painted dot carrying the `status-dot` target. | Current source, docs, and tests | Verified current behavior; no new behavior decided |
|
|
64
|
+
| FR2 | When renderable icon content is supplied, it appears in an assistive-technology-hidden wrapper inside the dot. | Current source and tests | Verified current behavior; no new behavior decided |
|
|
65
|
+
| FR3 | The deprecated `statusdot` class remains emitted beside `status-dot` for compatibility but is not current anatomy. | Current source, docs, and tests | Verified current behavior; no target change |
|
|
66
|
+
|
|
67
|
+
### Allowed variation
|
|
68
|
+
|
|
69
|
+
- Caller-supplied icon artwork may vary without creating a separate public
|
|
70
|
+
target.
|
|
71
|
+
|
|
72
|
+
### Representative states
|
|
73
|
+
|
|
74
|
+
- The anatomy and target ownership are unchanged across semantic variants and
|
|
75
|
+
pulsing state. The optional status icon is absent when its content is not
|
|
76
|
+
renderable.
|
|
77
|
+
|
|
78
|
+
### Transformation and precedence order
|
|
79
|
+
|
|
80
|
+
- No new rendering, styling, or target precedence rule is introduced.
|
|
81
|
+
|
|
82
|
+
### Performance and resources
|
|
83
|
+
|
|
84
|
+
- No new performance or resource rule is introduced.
|
|
85
|
+
|
|
86
|
+
## Accessibility contract
|
|
87
|
+
|
|
88
|
+
This draft does not change or extend StatusDot's existing role, accessible-name,
|
|
89
|
+
reduced-motion, or decorative-icon behavior.
|
|
90
|
+
|
|
91
|
+
## Design relationships
|
|
92
|
+
|
|
93
|
+
| Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
|
|
94
|
+
| ---------------- | --------------------------------------------------------- | ------------------------------ | -------------- | ------------------ |
|
|
95
|
+
| Dot | Presents the current painted semantic-status signal. | Current source and public docs | Supporting | FR1, FR3 |
|
|
96
|
+
| Status icon | Presents optional caller-supplied artwork inside the dot. | Current source and tests | Supporting | FR2 |
|
|
97
|
+
|
|
98
|
+
The deprecated `statusdot` alias is compatibility metadata, not a separate
|
|
99
|
+
anatomy part or current target.
|
|
100
|
+
|
|
101
|
+
### Theming anatomy
|
|
102
|
+
|
|
103
|
+
<!-- anatomy-theming:v1 -->
|
|
104
|
+
|
|
105
|
+
```json
|
|
106
|
+
{
|
|
107
|
+
"Dot": {"target": "status-dot"},
|
|
108
|
+
"Status icon": {"inherits": "status-dot"}
|
|
109
|
+
}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## Family and system relationships
|
|
113
|
+
|
|
114
|
+
- `architecture:component-theming-surface` owns anatomy qualification,
|
|
115
|
+
inheritance, and deprecated-alias exclusion.
|
|
116
|
+
|
|
117
|
+
## Verification map
|
|
118
|
+
|
|
119
|
+
| Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
|
|
120
|
+
| ------------------- | -------------------------------------------------- | ------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------- |
|
|
121
|
+
| FR1, FR2 | `StatusDot.test.tsx` render and custom-icon suites | Plain dot and dot with supplied icon | Removing the dot or changing optional icon rendering fails existing DOM assertions. | `audit:StatusDot/anatomy` |
|
|
122
|
+
| FR3 | `StatusDot.test.tsx` theme-target-name suite | Current and deprecated target classes | Removing either emitted compatibility class fails the existing target assertion. | `audit:StatusDot/theming` |
|
|
123
|
+
| Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current target | Missing, extra, prefixed, stale, or alias-backed mappings fail repository validation. | `audit:StatusDot/theming` |
|
|
124
|
+
|
|
125
|
+
## Decision log
|
|
126
|
+
|
|
127
|
+
None. This draft records current facts and introduces no component-local design
|
|
128
|
+
or API decision.
|
|
129
|
+
|
|
130
|
+
## Open questions
|
|
131
|
+
|
|
132
|
+
None.
|
|
133
|
+
|
|
134
|
+
## Content boundary
|
|
135
|
+
|
|
136
|
+
This file does not duplicate consumer prop tables, examples, implementation
|
|
137
|
+
steps, or system rules. It links to their owners.
|
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
|
+
/** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
|
|
4
|
+
const anatomy = [
|
|
5
|
+
{
|
|
6
|
+
name: 'Field',
|
|
7
|
+
required: true,
|
|
8
|
+
description: 'Container arranging the switch, label, and feedback.',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
name: 'Track',
|
|
12
|
+
required: true,
|
|
13
|
+
description: 'Pill-shaped surface that shows the off or on state.',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
name: 'Thumb',
|
|
17
|
+
required: true,
|
|
18
|
+
description: 'Indicator that moves across the track when state changes.',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'Label',
|
|
22
|
+
required: true,
|
|
23
|
+
description: 'Text identifying the setting controlled by the switch.',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
name: 'Description',
|
|
27
|
+
required: false,
|
|
28
|
+
description: 'Helper text below the label.',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Spinner',
|
|
32
|
+
required: false,
|
|
33
|
+
description: 'Loading indicator shown inside the thumb while busy.',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'Status message',
|
|
37
|
+
required: false,
|
|
38
|
+
description: 'Error, warning, or success message below the switch.',
|
|
39
|
+
},
|
|
40
|
+
];
|
|
41
|
+
|
|
3
42
|
/** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
|
|
4
43
|
|
|
5
44
|
export const docs = {
|
|
@@ -171,6 +210,7 @@ export const docs = {
|
|
|
171
210
|
],
|
|
172
211
|
},
|
|
173
212
|
usage: {
|
|
213
|
+
anatomy,
|
|
174
214
|
description:
|
|
175
215
|
'A toggle control for on/off states that take effect immediately. Supports labels, descriptions, loading states, and validation. Use it for settings or preferences that apply instantly. For changes requiring a form submission, use a checkbox instead.',
|
|
176
216
|
bestPractices: [
|