@astryxdesign/core 0.5.1 → 0.5.2-canary.00477a5

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.
Files changed (270) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/BottomSheet/BottomSheet.d.ts +3 -1
  3. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  4. package/dist/BottomSheet/BottomSheet.js +4 -3
  5. package/dist/BottomSheet/BottomSheetEdgeTint.d.ts +2 -2
  6. package/dist/BottomSheet/BottomSheetEdgeTint.d.ts.map +1 -1
  7. package/dist/BottomSheet/BottomSheetEdgeTint.js +7 -10
  8. package/dist/BottomSheet/BottomSheetSwitcher.d.ts.map +1 -1
  9. package/dist/BottomSheet/BottomSheetSwitcher.js +1 -1
  10. package/dist/Button/Button.d.ts +2 -1
  11. package/dist/Button/Button.d.ts.map +1 -1
  12. package/dist/Button/Button.js +11 -4
  13. package/dist/Carousel/Carousel.d.ts.map +1 -1
  14. package/dist/Carousel/Carousel.js +2 -2
  15. package/dist/Chat/ChatToolCalls.d.ts.map +1 -1
  16. package/dist/Chat/ChatToolCalls.js +34 -17
  17. package/dist/ContextMenu/ContextMenu.d.ts +14 -3
  18. package/dist/ContextMenu/ContextMenu.d.ts.map +1 -1
  19. package/dist/ContextMenu/ContextMenu.js +149 -26
  20. package/dist/ContextMenu/index.d.ts +1 -0
  21. package/dist/ContextMenu/index.d.ts.map +1 -1
  22. package/dist/DropdownMenu/DropdownMenu.d.ts +24 -5
  23. package/dist/DropdownMenu/DropdownMenu.d.ts.map +1 -1
  24. package/dist/DropdownMenu/DropdownMenu.js +340 -26
  25. package/dist/DropdownMenu/DropdownMenuContext.d.ts +1 -1
  26. package/dist/DropdownMenu/DropdownMenuContext.d.ts.map +1 -1
  27. package/dist/DropdownMenu/DropdownMenuItem.d.ts.map +1 -1
  28. package/dist/DropdownMenu/DropdownMenuItem.js +1 -1
  29. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts +6 -2
  30. package/dist/DropdownMenu/DropdownMenuSubMenu.d.ts.map +1 -1
  31. package/dist/DropdownMenu/DropdownMenuSubMenu.js +43 -14
  32. package/dist/DropdownMenu/MenuBottomSheet.d.ts +20 -0
  33. package/dist/DropdownMenu/MenuBottomSheet.d.ts.map +1 -0
  34. package/dist/DropdownMenu/MenuBottomSheet.js +36 -0
  35. package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts +10 -0
  36. package/dist/DropdownMenu/MenuBottomSheetActionList.d.ts.map +1 -0
  37. package/dist/DropdownMenu/MenuBottomSheetActionList.js +111 -0
  38. package/dist/DropdownMenu/index.d.ts +2 -1
  39. package/dist/DropdownMenu/index.d.ts.map +1 -1
  40. package/dist/DropdownMenu/menuWidth.d.ts +14 -0
  41. package/dist/DropdownMenu/menuWidth.d.ts.map +1 -0
  42. package/dist/DropdownMenu/menuWidth.js +35 -0
  43. package/dist/DropdownMenu/useMenuOverflow.d.ts +10 -0
  44. package/dist/DropdownMenu/useMenuOverflow.d.ts.map +1 -0
  45. package/dist/DropdownMenu/useMenuOverflow.js +60 -0
  46. package/dist/MoreMenu/MoreMenu.d.ts +8 -2
  47. package/dist/MoreMenu/MoreMenu.d.ts.map +1 -1
  48. package/dist/MoreMenu/MoreMenu.js +2 -0
  49. package/dist/MultiSelector/MultiSelector.d.ts +11 -1
  50. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  51. package/dist/MultiSelector/MultiSelector.js +97 -68
  52. package/dist/MultiSelector/index.d.ts +1 -1
  53. package/dist/MultiSelector/index.d.ts.map +1 -1
  54. package/dist/Popover/Popover.d.ts +10 -6
  55. package/dist/Popover/Popover.d.ts.map +1 -1
  56. package/dist/Popover/Popover.js +141 -16
  57. package/dist/Popover/usePopover.d.ts +4 -0
  58. package/dist/Popover/usePopover.d.ts.map +1 -1
  59. package/dist/Popover/usePopover.js +52 -5
  60. package/dist/Selector/Selector.d.ts +10 -0
  61. package/dist/Selector/Selector.d.ts.map +1 -1
  62. package/dist/Selector/Selector.js +106 -80
  63. package/dist/Selector/SelectorBottomSheet.d.ts +21 -0
  64. package/dist/Selector/SelectorBottomSheet.d.ts.map +1 -0
  65. package/dist/Selector/SelectorBottomSheet.js +83 -0
  66. package/dist/Selector/index.d.ts +1 -1
  67. package/dist/Selector/index.d.ts.map +1 -1
  68. package/dist/Selector/selectorPresentation.stylex.d.ts +16 -0
  69. package/dist/Selector/selectorPresentation.stylex.d.ts.map +1 -0
  70. package/dist/Selector/selectorPresentation.stylex.js +21 -0
  71. package/dist/Selector/useSelectorPresentation.d.ts +32 -0
  72. package/dist/Selector/useSelectorPresentation.d.ts.map +1 -0
  73. package/dist/Selector/useSelectorPresentation.js +90 -0
  74. package/dist/Toast/useToastGesture.d.ts.map +1 -1
  75. package/dist/Toast/useToastGesture.js +46 -9
  76. package/dist/astryx.css +19 -1
  77. package/dist/hooks/useAdaptivePresentation.d.ts +5 -0
  78. package/dist/hooks/useAdaptivePresentation.d.ts.map +1 -0
  79. package/dist/hooks/useAdaptivePresentation.js +19 -0
  80. package/dist/hooks/useFocusReturnVisibility.d.ts +7 -0
  81. package/dist/hooks/useFocusReturnVisibility.d.ts.map +1 -0
  82. package/dist/hooks/useFocusReturnVisibility.js +35 -0
  83. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  84. package/dist/hooks/useFocusTrap.js +12 -0
  85. package/dist/i18n/InternationalizationContext.d.ts +2 -0
  86. package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
  87. package/dist/i18n/InternationalizationContext.js +3 -1
  88. package/dist/i18n/InternationalizationProvider.d.ts.map +1 -1
  89. package/dist/i18n/InternationalizationProvider.js +3 -1
  90. package/dist/i18n/resolve.d.ts +1 -1
  91. package/dist/i18n/resolve.d.ts.map +1 -1
  92. package/dist/i18n/resolve.js +37 -38
  93. package/dist/i18n/useTranslator.d.ts.map +1 -1
  94. package/dist/i18n/useTranslator.js +2 -3
  95. package/locales/af-ZA.json +0 -4
  96. package/locales/ar-SA.json +0 -4
  97. package/locales/ca-ES.json +0 -4
  98. package/locales/cs-CZ.json +0 -4
  99. package/locales/da-DK.json +0 -4
  100. package/locales/de-DE.json +0 -4
  101. package/locales/el-GR.json +0 -4
  102. package/locales/en.json +20 -0
  103. package/locales/es-ES.json +0 -4
  104. package/locales/fi-FI.json +0 -4
  105. package/locales/fr-FR.json +0 -4
  106. package/locales/he-IL.json +0 -4
  107. package/locales/hu-HU.json +0 -4
  108. package/locales/it-IT.json +0 -4
  109. package/locales/ja-JP.json +0 -4
  110. package/locales/ko-KR.json +0 -4
  111. package/locales/nl-NL.json +0 -4
  112. package/locales/no-NO.json +0 -4
  113. package/locales/pl-PL.json +0 -4
  114. package/locales/pseudo.json +15 -0
  115. package/locales/pt-BR.json +0 -4
  116. package/locales/pt-PT.json +0 -4
  117. package/locales/ro-RO.json +0 -4
  118. package/locales/ru-RU.json +0 -4
  119. package/locales/sr-SP.json +0 -4
  120. package/locales/sv-SE.json +0 -4
  121. package/locales/tr-TR.json +0 -4
  122. package/locales/uk-UA.json +0 -4
  123. package/locales/vi-VN.json +0 -4
  124. package/locales/zh-CN.json +0 -4
  125. package/locales/zh-TW.json +0 -4
  126. package/package.json +3 -3
  127. package/src/BottomSheet/BottomSheet.doc.mjs +37 -0
  128. package/src/BottomSheet/BottomSheet.spec.md +177 -0
  129. package/src/BottomSheet/BottomSheet.test.tsx +29 -0
  130. package/src/BottomSheet/BottomSheet.tsx +7 -4
  131. package/src/BottomSheet/BottomSheetEdgeTint.test.tsx +4 -6
  132. package/src/BottomSheet/BottomSheetEdgeTint.tsx +7 -10
  133. package/src/BottomSheet/BottomSheetSwitcher.tsx +1 -2
  134. package/src/Button/Button.doc.mjs +56 -0
  135. package/src/Button/Button.test.tsx +10 -0
  136. package/src/Button/Button.tsx +13 -5
  137. package/src/ButtonGroup/ButtonGroup.doc.mjs +47 -0
  138. package/src/Calendar/Calendar.doc.mjs +1 -1
  139. package/src/Carousel/Carousel.test.tsx +83 -0
  140. package/src/Carousel/Carousel.tsx +8 -2
  141. package/src/Chat/ChatToolCalls.test.tsx +44 -0
  142. package/src/Chat/ChatToolCalls.tsx +36 -15
  143. package/src/CheckboxInput/CheckboxInput.doc.mjs +1 -1
  144. package/src/CheckboxList/CheckboxList.doc.mjs +173 -32
  145. package/src/CheckboxList/CheckboxList.spec.md +214 -0
  146. package/src/CommandPalette/CommandPalette.doc.mjs +72 -0
  147. package/src/CommandPalette/CommandPalette.spec.md +223 -0
  148. package/src/ComplexSelector/ComplexSelector.doc.mjs +44 -2
  149. package/src/ComplexSelector/ComplexSelector.spec.md +189 -0
  150. package/src/ContextMenu/ContextMenu.doc.mjs +13 -1
  151. package/src/ContextMenu/ContextMenu.test.tsx +131 -1
  152. package/src/ContextMenu/ContextMenu.tsx +199 -32
  153. package/src/ContextMenu/index.ts +1 -0
  154. package/src/DateInput/DateInput.doc.mjs +1 -1
  155. package/src/DateRangeInput/DateRangeInput.doc.mjs +1 -1
  156. package/src/DateTimeInput/DateTimeInput.doc.mjs +1 -1
  157. package/src/Divider/Divider.doc.mjs +24 -0
  158. package/src/Divider/Divider.spec.md +150 -0
  159. package/src/DropdownMenu/DropdownMenu.doc.mjs +201 -40
  160. package/src/DropdownMenu/DropdownMenu.test.tsx +518 -7
  161. package/src/DropdownMenu/DropdownMenu.tsx +459 -28
  162. package/src/DropdownMenu/DropdownMenuContext.tsx +1 -1
  163. package/src/DropdownMenu/DropdownMenuItem.tsx +2 -0
  164. package/src/DropdownMenu/DropdownMenuSubMenu.doc.mjs +4 -2
  165. package/src/DropdownMenu/DropdownMenuSubMenu.test.tsx +124 -0
  166. package/src/DropdownMenu/DropdownMenuSubMenu.tsx +72 -17
  167. package/src/DropdownMenu/MenuBottomSheet.tsx +46 -0
  168. package/src/DropdownMenu/MenuBottomSheetActionList.tsx +141 -0
  169. package/src/DropdownMenu/index.ts +2 -0
  170. package/src/DropdownMenu/menuWidth.ts +51 -0
  171. package/src/DropdownMenu/useMenuOverflow.ts +77 -0
  172. package/src/Field/Field.doc.mjs +1 -1
  173. package/src/FieldStatus/FieldStatus.doc.mjs +22 -1
  174. package/src/FieldStatus/FieldStatus.spec.md +212 -0
  175. package/src/FileInput/FileInput.doc.mjs +1 -1
  176. package/src/Grid/Grid.doc.mjs +19 -0
  177. package/src/Grid/Grid.spec.md +161 -0
  178. package/src/Icon/Icon.doc.mjs +196 -48
  179. package/src/Icon/Icon.spec.md +191 -0
  180. package/src/IconButton/IconButton.doc.mjs +38 -0
  181. package/src/Indicator/Indicator.doc.mjs +1 -1
  182. package/src/InputGroup/InputGroup.doc.mjs +1 -1
  183. package/src/Kbd/Kbd.doc.mjs +18 -0
  184. package/src/Kbd/Kbd.spec.md +141 -0
  185. package/src/Layout/Layout.doc.mjs +32 -0
  186. package/src/Layout/Layout.spec.md +199 -0
  187. package/src/Lightbox/Lightbox.doc.mjs +149 -33
  188. package/src/Lightbox/Lightbox.spec.md +197 -0
  189. package/src/Markdown/Markdown.doc.mjs +60 -0
  190. package/src/Markdown/Markdown.spec.md +200 -0
  191. package/src/MobileNav/MobileNav.doc.mjs +140 -32
  192. package/src/MobileNav/MobileNav.spec.md +208 -0
  193. package/src/MoreMenu/MoreMenu.doc.mjs +17 -0
  194. package/src/MoreMenu/MoreMenu.test.tsx +47 -0
  195. package/src/MoreMenu/MoreMenu.tsx +13 -1
  196. package/src/MultiSelector/MultiSelector.doc.mjs +129 -1
  197. package/src/MultiSelector/MultiSelector.spec.md +266 -0
  198. package/src/MultiSelector/MultiSelector.test.tsx +127 -0
  199. package/src/MultiSelector/MultiSelector.tsx +121 -73
  200. package/src/MultiSelector/index.ts +1 -0
  201. package/src/NavIcon/NavIcon.doc.mjs +17 -0
  202. package/src/NavIcon/NavIcon.spec.md +133 -0
  203. package/src/NavMenu/NavHeadingMenu.spec.md +205 -0
  204. package/src/NavMenu/NavMenu.doc.mjs +37 -0
  205. package/src/NumberInput/NumberInput.doc.mjs +1 -1
  206. package/src/Outline/Outline.doc.mjs +35 -0
  207. package/src/Outline/Outline.spec.md +161 -0
  208. package/src/OverflowList/OverflowList.doc.mjs +24 -0
  209. package/src/OverflowList/OverflowList.spec.md +156 -0
  210. package/src/Pagination/Pagination.doc.mjs +74 -0
  211. package/src/Pagination/Pagination.spec.md +225 -0
  212. package/src/Popover/Popover.doc.mjs +11 -11
  213. package/src/Popover/Popover.test.tsx +397 -2
  214. package/src/Popover/Popover.tsx +228 -21
  215. package/src/Popover/usePopover.tsx +92 -15
  216. package/src/PowerSearch/PowerSearch.doc.mjs +1 -1
  217. package/src/ProgressBar/ProgressBar.doc.mjs +198 -38
  218. package/src/ProgressBar/ProgressBar.spec.md +260 -0
  219. package/src/RadioList/RadioList.doc.mjs +1 -1
  220. package/src/Resizable/Resizable.doc.mjs +59 -16
  221. package/src/Resizable/Resizable.spec.md +194 -0
  222. package/src/Section/Section.doc.mjs +17 -0
  223. package/src/Section/Section.spec.md +138 -0
  224. package/src/SegmentedControl/SegmentedControl.doc.mjs +83 -0
  225. package/src/SegmentedControl/SegmentedControl.spec.md +151 -0
  226. package/src/Selector/Selector.doc.mjs +13 -1
  227. package/src/Selector/Selector.test.tsx +135 -0
  228. package/src/Selector/Selector.tsx +141 -82
  229. package/src/Selector/SelectorBottomSheet.tsx +97 -0
  230. package/src/Selector/index.ts +1 -0
  231. package/src/Selector/selectorPresentation.stylex.ts +20 -0
  232. package/src/Selector/useSelectorPresentation.ts +147 -0
  233. package/src/Skeleton/Skeleton.doc.mjs +12 -0
  234. package/src/Skeleton/Skeleton.spec.md +126 -0
  235. package/src/Slider/Slider.doc.mjs +186 -32
  236. package/src/Slider/Slider.spec.md +223 -0
  237. package/src/Stack/Stack.doc.mjs +22 -0
  238. package/src/Stack/Stack.spec.md +154 -0
  239. package/src/StatusDot/StatusDot.doc.mjs +17 -0
  240. package/src/StatusDot/StatusDot.spec.md +137 -0
  241. package/src/Switch/Switch.doc.mjs +41 -1
  242. package/src/Switch/Switch.spec.md +174 -0
  243. package/src/Text/Text.doc.mjs +190 -43
  244. package/src/Text/Text.spec.md +205 -0
  245. package/src/TextArea/TextArea.doc.mjs +256 -46
  246. package/src/TextArea/TextArea.spec.md +204 -0
  247. package/src/TextInput/TextInput.doc.mjs +1 -1
  248. package/src/TimeInput/TimeInput.doc.mjs +1 -1
  249. package/src/Toast/ToastViewport.test.tsx +118 -4
  250. package/src/Toast/useToastGesture.ts +61 -8
  251. package/src/ToggleButton/ToggleButton.doc.mjs +56 -0
  252. package/src/Tokenizer/Tokenizer.doc.mjs +1 -1
  253. package/src/Toolbar/Toolbar.doc.mjs +19 -0
  254. package/src/Toolbar/Toolbar.spec.md +173 -0
  255. package/src/Tooltip/Tooltip.doc.mjs +17 -0
  256. package/src/Tooltip/Tooltip.spec.md +141 -0
  257. package/src/TreeList/TreeList.doc.mjs +58 -0
  258. package/src/TreeList/TreeList.spec.md +220 -0
  259. package/src/Typeahead/Typeahead.doc.mjs +84 -2
  260. package/src/Typeahead/Typeahead.spec.md +250 -0
  261. package/src/hooks/useAdaptivePresentation.ts +35 -0
  262. package/src/hooks/useFocusReturnVisibility.ts +45 -0
  263. package/src/hooks/useFocusTrap.test.tsx +40 -0
  264. package/src/hooks/useFocusTrap.ts +13 -0
  265. package/src/i18n/InternationalizationContext.ts +3 -0
  266. package/src/i18n/InternationalizationProvider.tsx +8 -1
  267. package/src/i18n/__tests__/resolve.test.ts +23 -1
  268. package/src/i18n/resolve.ts +46 -49
  269. package/src/i18n/useTranslator.ts +2 -7
  270. package/src/theme/themingTargets.test.ts +91 -25
@@ -1,5 +1,14 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
+ /** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
4
+ const anatomy = [
5
+ {
6
+ name: 'Placeholder',
7
+ required: true,
8
+ description: 'Painted shape that stands in for content while it loads.',
9
+ },
10
+ ];
11
+
3
12
  /** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
4
13
 
5
14
  export const docs = {
@@ -49,6 +58,7 @@ export const docs = {
49
58
  ],
50
59
  },
51
60
  usage: {
61
+ anatomy,
52
62
  description:
53
63
  'An animated shimmer placeholder that previews the shape of content while it loads. Use it to build loading screens that match the layout of the real content. For content with unknown dimensions, use Spinner instead.',
54
64
  bestPractices: [
@@ -98,6 +108,7 @@ export const docsZh = {
98
108
  ],
99
109
  },
100
110
  usage: {
111
+ anatomy,
101
112
  description:
102
113
  'An animated shimmer placeholder that previews the shape of content while it loads. Use it to build loading screens that match the layout of the real content. For content with unknown dimensions, use Spinner instead.',
103
114
  bestPractices: [
@@ -113,6 +124,7 @@ export const docsZh = {
113
124
  /** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
114
125
  export const docsDense = {
115
126
  usage: {
127
+ anatomy,
116
128
  description:
117
129
  'An animated shimmer placeholder that previews the shape of content while it loads. Use it to build loading screens that match the layout of the real content. For content with unknown dimensions, use Spinner instead.',
118
130
  bestPractices: [
@@ -0,0 +1,126 @@
1
+ ---
2
+ schema_version: 1
3
+ template_version: 3
4
+ kind: component
5
+ id: component:Skeleton
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/Skeleton/Skeleton.test.tsx, scripts/check-knowledge.mjs]
15
+ families: []
16
+ design_specs: []
17
+ architecture:
18
+ [architecture:component-theming-surface, architecture:public-component-api]
19
+ contributing: []
20
+ system_specs: []
21
+ ---
22
+
23
+ # Skeleton component contract
24
+
25
+ ## Intent
26
+
27
+ Skeleton renders a placeholder shape while surrounding content loads. This draft
28
+ records the component's current consumer anatomy and theming ownership without
29
+ changing its runtime contract.
30
+
31
+ ## Compatibility and migration
32
+
33
+ - Released default preserved: `yes`
34
+ - Compatibility class: additive documentation only; runtime, DOM, styling,
35
+ targets, and public API remain unchanged
36
+ - Controlled/uncontrolled behavior: not applicable
37
+ - Migration decision: none
38
+
39
+ Consumer migration instructions belong in consumer docs and release notes.
40
+
41
+ ## Ownership boundary
42
+
43
+ **Owns**
44
+
45
+ - The rendered placeholder shape and its existing `skeleton` theming target.
46
+
47
+ **Does not own / non-goals**
48
+
49
+ - The surrounding content's loading state, layout, or replacement timing — owned
50
+ by the product callsite.
51
+
52
+ ## Public concepts
53
+
54
+ No new public concept is introduced. Consumer props and usage remain documented
55
+ in `Skeleton.doc.mjs`.
56
+
57
+ ## Behavioral and layout contract
58
+
59
+ | ID | Candidate invariant | Basis | Draft review state |
60
+ | --- | ----------------------------------------------------------------------------------- | ------------------------------- | -------------------------------------------------- |
61
+ | FR1 | The current render contains one painted placeholder carrying the `skeleton` target. | Current source, docs, and tests | Verified current behavior; no new behavior decided |
62
+
63
+ ### Allowed variation
64
+
65
+ - This documentation does not constrain behavior beyond the factual anatomy and
66
+ target relationship recorded here.
67
+
68
+ ### Representative states
69
+
70
+ - The anatomy and target relationship is the same for the documented size,
71
+ radius, and animation inputs.
72
+
73
+ ### Transformation and precedence order
74
+
75
+ - No new ordering rule is introduced.
76
+
77
+ ### Performance and resources
78
+
79
+ - No new performance or resource rule is introduced.
80
+
81
+ ## Accessibility contract
82
+
83
+ This draft does not change or extend Skeleton's existing accessibility behavior.
84
+
85
+ ## Design relationships
86
+
87
+ | Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
88
+ | ---------------- | ------------------------------------------ | ------------------------------ | -------------- | ------------------ |
89
+ | Placeholder | Represents the current painted loading UI. | Current source and public docs | Supporting | FR1 |
90
+
91
+ ### Theming anatomy
92
+
93
+ <!-- anatomy-theming:v1 -->
94
+
95
+ ```json
96
+ {
97
+ "Placeholder": {"target": "skeleton"}
98
+ }
99
+ ```
100
+
101
+ ## Family and system relationships
102
+
103
+ This draft references the current shared owners without restating their rules:
104
+ `architecture:component-theming-surface` and
105
+ `architecture:public-component-api`.
106
+
107
+ ## Verification map
108
+
109
+ | Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
110
+ | ------------------- | -------------------------------- | ------------------------------------ | ----------------------------------------------------------------------- | ------------------------ |
111
+ | FR1 | `Skeleton.test.tsx` render suite | A rendered placeholder | Removing the placeholder fails the existing render assertion. | `audit:Skeleton/anatomy` |
112
+ | Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and current target | Missing, extra, prefixed, or stale mappings fail repository validation. | `audit:Skeleton/theming` |
113
+
114
+ ## Decision log
115
+
116
+ None. This draft records current facts and introduces no component-local design
117
+ decision.
118
+
119
+ ## Open questions
120
+
121
+ None.
122
+
123
+ ## Content boundary
124
+
125
+ This file does not duplicate consumer prop tables, examples, implementation
126
+ steps, or system rules. It links to their owners.
@@ -1,12 +1,86 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
+ /** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
4
+ const anatomy = [
5
+ {
6
+ name: 'Label',
7
+ required: true,
8
+ description:
9
+ 'Text identifying the numeric setting controlled by the slider.',
10
+ },
11
+ {
12
+ name: 'Description',
13
+ required: false,
14
+ description: 'Helper text between the label and the slider control.',
15
+ },
16
+ {
17
+ name: 'Slider',
18
+ required: true,
19
+ description:
20
+ 'Control row containing the track, thumb or thumbs, and optional text value.',
21
+ },
22
+ {
23
+ name: 'Track',
24
+ required: true,
25
+ description: 'Background rail representing the available numeric range.',
26
+ },
27
+ {
28
+ name: 'Filled range',
29
+ required: true,
30
+ description:
31
+ 'Accent segment from the minimum to a single value, or between two range values.',
32
+ },
33
+ {
34
+ name: 'Tick mark',
35
+ required: false,
36
+ description: 'Position marker supplied through the marks collection.',
37
+ },
38
+ {
39
+ name: 'Mark label',
40
+ required: false,
41
+ description: 'Optional text displayed beside a tick mark.',
42
+ },
43
+ {
44
+ name: 'Thumb',
45
+ required: true,
46
+ description:
47
+ 'Draggable value indicator; range mode renders a minimum and maximum thumb.',
48
+ },
49
+ {
50
+ name: 'Value display',
51
+ required: false,
52
+ description:
53
+ 'Formatted current value shown beside the slider when valueDisplay is text.',
54
+ },
55
+ {
56
+ name: 'Value tooltip',
57
+ required: false,
58
+ description:
59
+ 'Formatted current value shown in a tooltip when valueDisplay is tooltip.',
60
+ },
61
+ {
62
+ name: 'Status message',
63
+ required: false,
64
+ description: 'Error, warning, or success message below the slider.',
65
+ },
66
+ ];
67
+
3
68
  /** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
4
69
 
5
70
  export const docs = {
6
71
  name: 'Slider',
7
72
  displayName: 'Slider',
8
- category: 'Data Input',
9
- keywords: ["slider","range","slidebar","trackbar","scrubber","knob","thumb","rangeslider"],
73
+ category: 'Form Controls',
74
+ keywords: [
75
+ 'slider',
76
+ 'range',
77
+ 'slidebar',
78
+ 'trackbar',
79
+ 'scrubber',
80
+ 'knob',
81
+ 'thumb',
82
+ 'rangeslider',
83
+ ],
10
84
  playground: {
11
85
  defaults: {
12
86
  label: 'Volume',
@@ -156,20 +230,49 @@ export const docs = {
156
230
  ],
157
231
  theming: {
158
232
  targets: [
159
- {className: 'astryx-slider', visualProps: ['orientation'], states: ['disabled']},
233
+ {
234
+ className: 'astryx-slider',
235
+ visualProps: ['orientation'],
236
+ states: ['disabled'],
237
+ },
160
238
  {className: 'astryx-slider-track', visualProps: ['orientation']},
161
- {className: 'astryx-slider-thumb', visualProps: ['orientation'], states: ['disabled']},
239
+ {
240
+ className: 'astryx-slider-thumb',
241
+ visualProps: ['orientation'],
242
+ states: ['disabled'],
243
+ },
162
244
  ],
163
245
  },
164
246
  usage: {
247
+ anatomy,
165
248
  description:
166
249
  'A draggable control for selecting a numeric value or range within defined bounds. Supports single value and range selection, tick marks, custom value formatting, and vertical orientation. Use it when users need to explore a continuous range, such as volume, price, or percentage.',
167
250
  bestPractices: [
168
- {guidance: true, description: 'Always provide a label, even if visually hidden, so the slider is accessible to screen readers.'},
169
- {guidance: true, description: 'Format values with meaningful units like "$50" or "75%" instead of raw numbers.'},
170
- {guidance: false, description: 'Use for precise numeric entry; pair with a text input or use NumberInput instead.'},
171
- {guidance: false, description: 'Set a step size so large that only a few positions are possible; use SegmentedControl or radio buttons instead.'},
172
- {guidance: false, description: 'Wrap a disabled slider in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.'},
251
+ {
252
+ guidance: true,
253
+ description:
254
+ 'Always provide a label, even if visually hidden, so the slider is accessible to screen readers.',
255
+ },
256
+ {
257
+ guidance: true,
258
+ description:
259
+ 'Format values with meaningful units like "$50" or "75%" instead of raw numbers.',
260
+ },
261
+ {
262
+ guidance: false,
263
+ description:
264
+ 'Use for precise numeric entry; pair with a text input or use NumberInput instead.',
265
+ },
266
+ {
267
+ guidance: false,
268
+ description:
269
+ 'Set a step size so large that only a few positions are possible; use SegmentedControl or radio buttons instead.',
270
+ },
271
+ {
272
+ guidance: false,
273
+ description:
274
+ 'Wrap a disabled slider in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.',
275
+ },
173
276
  ],
174
277
  },
175
278
  };
@@ -229,8 +332,7 @@ export const docsZh = {
229
332
  {
230
333
  name: 'formatValue',
231
334
  type: '(value: number) => string',
232
- description:
233
- '自定义值格式化函数,用于显示和 `aria-valuetext`。',
335
+ description: '自定义值格式化函数,用于显示和 `aria-valuetext`。',
234
336
  },
235
337
  {
236
338
  name: 'valueDisplay',
@@ -246,8 +348,7 @@ export const docsZh = {
246
348
  {
247
349
  name: 'minStepsBetweenThumbs',
248
350
  type: 'number',
249
- description:
250
- '范围模式下滑块之间的最小步数;防止滑块重叠。',
351
+ description: '范围模式下滑块之间的最小步数;防止滑块重叠。',
251
352
  default: '0',
252
353
  },
253
354
  {
@@ -259,7 +360,8 @@ export const docsZh = {
259
360
  {
260
361
  name: 'htmlName',
261
362
  type: 'string',
262
- description: '用于表单提交的 HTML name 属性。渲染携带当前值的隐藏输入(范围模式下为两个条目)。',
363
+ description:
364
+ '用于表单提交的 HTML name 属性。渲染携带当前值的隐藏输入(范围模式下为两个条目)。',
263
365
  },
264
366
  {
265
367
  name: 'disabledMessage',
@@ -293,8 +395,7 @@ export const docsZh = {
293
395
  {
294
396
  name: 'status',
295
397
  type: "{type: 'warning' | 'error' | 'success', message?: string}",
296
- description:
297
- '验证反馈的状态指示器对象(`{ type, message }`)。',
398
+ description: '验证反馈的状态指示器对象(`{ type, message }`)。',
298
399
  },
299
400
  {
300
401
  name: 'labelTooltip',
@@ -310,20 +411,49 @@ export const docsZh = {
310
411
  ],
311
412
  theming: {
312
413
  targets: [
313
- {className: 'astryx-slider', visualProps: ['orientation'], states: ['disabled']},
414
+ {
415
+ className: 'astryx-slider',
416
+ visualProps: ['orientation'],
417
+ states: ['disabled'],
418
+ },
314
419
  {className: 'astryx-slider-track', visualProps: ['orientation']},
315
- {className: 'astryx-slider-thumb', visualProps: ['orientation'], states: ['disabled']},
420
+ {
421
+ className: 'astryx-slider-thumb',
422
+ visualProps: ['orientation'],
423
+ states: ['disabled'],
424
+ },
316
425
  ],
317
426
  },
318
427
  usage: {
428
+ anatomy,
319
429
  description:
320
430
  'A draggable control for selecting a numeric value or range within defined bounds. Supports single value and range selection, tick marks, custom value formatting, and vertical orientation. Use it when users need to explore a continuous range, such as volume, price, or percentage.',
321
431
  bestPractices: [
322
- {guidance: true, description: 'Always provide a label, even if visually hidden, so the slider is accessible to screen readers.'},
323
- {guidance: true, description: 'Format values with meaningful units like "$50" or "75%" instead of raw numbers.'},
324
- {guidance: false, description: 'Use for precise numeric entry; pair with a text input or use NumberInput instead.'},
325
- {guidance: false, description: 'Set a step size so large that only a few positions are possible; use SegmentedControl or radio buttons instead.'},
326
- {guidance: false, description: 'Wrap a disabled slider in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.'},
432
+ {
433
+ guidance: true,
434
+ description:
435
+ 'Always provide a label, even if visually hidden, so the slider is accessible to screen readers.',
436
+ },
437
+ {
438
+ guidance: true,
439
+ description:
440
+ 'Format values with meaningful units like "$50" or "75%" instead of raw numbers.',
441
+ },
442
+ {
443
+ guidance: false,
444
+ description:
445
+ 'Use for precise numeric entry; pair with a text input or use NumberInput instead.',
446
+ },
447
+ {
448
+ guidance: false,
449
+ description:
450
+ 'Set a step size so large that only a few positions are possible; use SegmentedControl or radio buttons instead.',
451
+ },
452
+ {
453
+ guidance: false,
454
+ description:
455
+ 'Wrap a disabled slider in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.',
456
+ },
327
457
  ],
328
458
  },
329
459
  };
@@ -331,19 +461,41 @@ export const docsZh = {
331
461
  /** @type {import('@astryxdesign/cli/authoring').ComponentTranslationDoc} */
332
462
  export const docsDense = {
333
463
  usage: {
464
+ anatomy,
334
465
  description:
335
466
  'A draggable control for selecting a numeric value or range within defined bounds. Supports single value and range selection, tick marks, custom value formatting, and vertical orientation. Use it when users need to explore a continuous range, such as volume, price, or percentage.',
336
467
  bestPractices: [
337
- {guidance: true, description: 'Always provide a label, even if visually hidden, so the slider is accessible to screen readers.'},
338
- {guidance: true, description: 'Format values with meaningful units like "$50" or "75%" instead of raw numbers.'},
339
- {guidance: false, description: 'Use for precise numeric entry; pair with a text input or use NumberInput instead.'},
340
- {guidance: false, description: 'Set a step size so large that only a few positions are possible; use SegmentedControl or radio buttons instead.'},
341
- {guidance: false, description: 'Wrap a disabled slider in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.'},
468
+ {
469
+ guidance: true,
470
+ description:
471
+ 'Always provide a label, even if visually hidden, so the slider is accessible to screen readers.',
472
+ },
473
+ {
474
+ guidance: true,
475
+ description:
476
+ 'Format values with meaningful units like "$50" or "75%" instead of raw numbers.',
477
+ },
478
+ {
479
+ guidance: false,
480
+ description:
481
+ 'Use for precise numeric entry; pair with a text input or use NumberInput instead.',
482
+ },
483
+ {
484
+ guidance: false,
485
+ description:
486
+ 'Set a step size so large that only a few positions are possible; use SegmentedControl or radio buttons instead.',
487
+ },
488
+ {
489
+ guidance: false,
490
+ description:
491
+ 'Wrap a disabled slider in Tooltip to explain why it is disabled; disabled controls swallow the hover events the wrapper needs. Use the disabledMessage prop instead.',
492
+ },
342
493
  ],
343
494
  },
344
495
  propDescriptions: {
345
496
  label: 'Label text (always rendered for a11y).',
346
- value: 'Current value; number for single thumb, [number, number] for range.',
497
+ value:
498
+ 'Current value; number for single thumb, [number, number] for range.',
347
499
  onChange: 'Fired on value change during drag.',
348
500
  onChangeEnd: 'Fired when drag ends.',
349
501
  min: 'Minimum value.',
@@ -353,9 +505,11 @@ export const docsDense = {
353
505
  formatValue: 'Custom value formatting fn for display + aria-valuetext.',
354
506
  valueDisplay: 'How current value is displayed.',
355
507
  marks: 'Tick marks at specified positions w/ optional labels.',
356
- minStepsBetweenThumbs: 'Min steps between thumbs in range mode; prevents overlap.',
508
+ minStepsBetweenThumbs:
509
+ 'Min steps between thumbs in range mode; prevents overlap.',
357
510
  isDisabled: 'Whether slider is disabled.',
358
- htmlName: 'HTML name attr; hidden inputs carry the value (two in range mode).',
511
+ htmlName:
512
+ 'HTML name attr; hidden inputs carry the value (two in range mode).',
359
513
  isOptional: 'Whether field is optional.',
360
514
  isRequired: 'Whether field is required.',
361
515
  isLabelHidden: 'Visually hide label.',
@@ -364,4 +518,4 @@ export const docsDense = {
364
518
  labelTooltip: 'Tooltip text for info icon next to label.',
365
519
  xstyle: 'StyleX layout styles; must be stylex.create() value.',
366
520
  },
367
- };
521
+ };