@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,12 +1,59 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
+ /** @type {import('@astryxdesign/cli/authoring').ComponentAnatomyElement[]} */
4
+ const anatomy = [
5
+ {
6
+ name: 'Progress bar',
7
+ required: true,
8
+ description: 'Container arranging the label row and progress track.',
9
+ },
10
+ {
11
+ name: 'Label',
12
+ required: true,
13
+ description:
14
+ 'Text naming the operation, optionally hidden visually while remaining accessible.',
15
+ },
16
+ {
17
+ name: 'Value text',
18
+ required: false,
19
+ description:
20
+ 'Formatted determinate value shown beside the label when requested.',
21
+ },
22
+ {
23
+ name: 'Track',
24
+ required: true,
25
+ description:
26
+ 'Remaining-progress rail that carries the progressbar semantics.',
27
+ },
28
+ {
29
+ name: 'Fill',
30
+ required: true,
31
+ description:
32
+ 'Painted segment showing completed progress or indeterminate movement.',
33
+ },
34
+ {
35
+ name: 'Mark',
36
+ required: false,
37
+ description: 'Labeled target tick positioned on a determinate track.',
38
+ },
39
+ ];
40
+
3
41
  /** @type {import('@astryxdesign/cli/authoring').ComponentDoc} */
4
42
 
5
43
  export const docs = {
6
44
  name: 'ProgressBar',
7
45
  displayName: 'Progress Bar',
8
46
  category: 'Feedback & Status',
9
- keywords: ["progressbar","progress","loader","loading","linear","determinate","indeterminate","meter"],
47
+ keywords: [
48
+ 'progressbar',
49
+ 'progress',
50
+ 'loader',
51
+ 'loading',
52
+ 'linear',
53
+ 'determinate',
54
+ 'indeterminate',
55
+ 'meter',
56
+ ],
10
57
  props: [
11
58
  {
12
59
  name: 'label',
@@ -60,12 +107,13 @@ export const docs = {
60
107
  name: 'marks',
61
108
  type: 'ReadonlyArray<{value: number; label: string}>',
62
109
  description:
63
- 'Fixed target marks drawn on the track at values in the same 0..max scale as value (e.g. a goal line). They stay visible whether progress is below or past them, and take their color from what they sit on: a mark inside the filled area uses the fill variant\'s on-color (on-accent, on-warning, on-error, and so on), a mark still out on the bare track uses the primary text color (the secondary one on a disabled bar, which dims everything it draws). Each mark requires a label: it is the mark\'s accessible name and the text revealed via a tooltip on hover/focus. Ignored when indeterminate.',
110
+ "Fixed target marks drawn on the track at values in the same 0..max scale as value (e.g. a goal line). They stay visible whether progress is below or past them, and take their color from what they sit on: a mark inside the filled area uses the fill variant's on-color (on-accent, on-warning, on-error, and so on), a mark still out on the bare track uses the primary text color (the secondary one on a disabled bar, which dims everything it draws). Each mark requires a label: it is the mark's accessible name and the text revealed via a tooltip on hover/focus. Ignored when indeterminate.",
64
111
  },
65
112
  {
66
113
  name: 'isDisabled',
67
114
  type: 'boolean',
68
- description: 'Visually disabled state: grays out the fill and text. Use for canceled or inactive operations.',
115
+ description:
116
+ 'Visually disabled state: grays out the fill and text. Use for canceled or inactive operations.',
69
117
  default: 'false',
70
118
  },
71
119
  {
@@ -96,7 +144,10 @@ export const docs = {
96
144
  visualProps: ['variant'],
97
145
  deprecatedFor: 'progress-bar-fill',
98
146
  },
99
- {className: 'astryx-progressbar-track', deprecatedFor: 'progress-bar-track'},
147
+ {
148
+ className: 'astryx-progressbar-track',
149
+ deprecatedFor: 'progress-bar-track',
150
+ },
100
151
  {
101
152
  className: 'astryx-progressbar-mark',
102
153
  visualProps: ['variant', 'placement'],
@@ -104,24 +155,63 @@ export const docs = {
104
155
  },
105
156
  ],
106
157
  vars: [
107
- {name: '--_progressbar-mark-width', description: 'Target mark tick width', default: '2px', private: true},
108
- {name: '--_progressbar-mark-height', description: 'Target mark tick height', default: '8px', private: true},
158
+ {
159
+ name: '--_progressbar-mark-width',
160
+ description: 'Target mark tick width',
161
+ default: '2px',
162
+ private: true,
163
+ },
164
+ {
165
+ name: '--_progressbar-mark-height',
166
+ description: 'Target mark tick height',
167
+ default: '8px',
168
+ private: true,
169
+ },
109
170
  ],
110
171
  derived: [
111
172
  {property: 'width', vars: ['--_progressbar-mark-width'], replaces: true},
112
- {property: 'height', vars: ['--_progressbar-mark-height'], replaces: true},
173
+ {
174
+ property: 'height',
175
+ vars: ['--_progressbar-mark-height'],
176
+ replaces: true,
177
+ },
113
178
  ],
114
179
  },
115
180
  usage: {
181
+ anatomy,
116
182
  description:
117
- 'A horizontal bar showing the completion progress of a task. Use it for operations where the duration is known, or as an animated indicator when progress can\'t be calculated. Supports semantic color variants, value labels, and custom formatting.',
183
+ "A horizontal bar showing the completion progress of a task. Use it for operations where the duration is known, or as an animated indicator when progress can't be calculated. Supports semantic color variants, value labels, and custom formatting.",
118
184
  bestPractices: [
119
- { guidance: true, description: "Use a determinate bar when the total amount of work is known, and indeterminate when it's not." },
120
- { guidance: true, description: 'Choose a color variant that matches the context: accent for general progress, success for completion, warning or error for alerts.' },
121
- { guidance: true, description: "Always provide a label, even if hidden; screen readers need it to announce what's loading." },
122
- { guidance: false, description: 'Place icons or labels inside the bar; compose them alongside it using layout components.' },
123
- { guidance: false, description: "Use a progress bar for instant actions; it's meant for operations that take noticeable time." },
124
- { guidance: false, description: 'Use multiple progress bars stacked together for the same operation; use one bar with a value label instead.' },
185
+ {
186
+ guidance: true,
187
+ description:
188
+ "Use a determinate bar when the total amount of work is known, and indeterminate when it's not.",
189
+ },
190
+ {
191
+ guidance: true,
192
+ description:
193
+ 'Choose a color variant that matches the context: accent for general progress, success for completion, warning or error for alerts.',
194
+ },
195
+ {
196
+ guidance: true,
197
+ description:
198
+ "Always provide a label, even if hidden; screen readers need it to announce what's loading.",
199
+ },
200
+ {
201
+ guidance: false,
202
+ description:
203
+ 'Place icons or labels inside the bar; compose them alongside it using layout components.',
204
+ },
205
+ {
206
+ guidance: false,
207
+ description:
208
+ "Use a progress bar for instant actions; it's meant for operations that take noticeable time.",
209
+ },
210
+ {
211
+ guidance: false,
212
+ description:
213
+ 'Use multiple progress bars stacked together for the same operation; use one bar with a value label instead.',
214
+ },
125
215
  ],
126
216
  },
127
217
  };
@@ -164,8 +254,7 @@ export const docsZh = {
164
254
  {
165
255
  name: 'formatValueLabel',
166
256
  type: '(value: number, max: number) => string',
167
- description:
168
- '自定义值标签格式化器;默认为百分比字符串。',
257
+ description: '自定义值标签格式化器;默认为百分比字符串。',
169
258
  },
170
259
  {
171
260
  name: 'variant',
@@ -188,7 +277,8 @@ export const docsZh = {
188
277
  {
189
278
  name: 'isDisabled',
190
279
  type: 'boolean',
191
- description: '视觉禁用状态——使填充条和文本变灰。用于已取消或不活跃的操作。',
280
+ description:
281
+ '视觉禁用状态——使填充条和文本变灰。用于已取消或不活跃的操作。',
192
282
  default: 'false',
193
283
  },
194
284
  {
@@ -219,7 +309,10 @@ export const docsZh = {
219
309
  visualProps: ['variant'],
220
310
  deprecatedFor: 'progress-bar-fill',
221
311
  },
222
- {className: 'astryx-progressbar-track', deprecatedFor: 'progress-bar-track'},
312
+ {
313
+ className: 'astryx-progressbar-track',
314
+ deprecatedFor: 'progress-bar-track',
315
+ },
223
316
  {
224
317
  className: 'astryx-progressbar-mark',
225
318
  visualProps: ['variant', 'placement'],
@@ -227,24 +320,63 @@ export const docsZh = {
227
320
  },
228
321
  ],
229
322
  vars: [
230
- {name: '--_progressbar-mark-width', description: '目标标记刻度宽度', default: '2px', private: true},
231
- {name: '--_progressbar-mark-height', description: '目标标记刻度高度', default: '8px', private: true},
323
+ {
324
+ name: '--_progressbar-mark-width',
325
+ description: '目标标记刻度宽度',
326
+ default: '2px',
327
+ private: true,
328
+ },
329
+ {
330
+ name: '--_progressbar-mark-height',
331
+ description: '目标标记刻度高度',
332
+ default: '8px',
333
+ private: true,
334
+ },
232
335
  ],
233
336
  derived: [
234
337
  {property: 'width', vars: ['--_progressbar-mark-width'], replaces: true},
235
- {property: 'height', vars: ['--_progressbar-mark-height'], replaces: true},
338
+ {
339
+ property: 'height',
340
+ vars: ['--_progressbar-mark-height'],
341
+ replaces: true,
342
+ },
236
343
  ],
237
344
  },
238
345
  usage: {
346
+ anatomy,
239
347
  description:
240
- 'A horizontal bar showing the completion progress of a task. Use it for operations where the duration is known, or as an animated indicator when progress can\'t be calculated. Supports semantic color variants, value labels, and custom formatting.',
348
+ "A horizontal bar showing the completion progress of a task. Use it for operations where the duration is known, or as an animated indicator when progress can't be calculated. Supports semantic color variants, value labels, and custom formatting.",
241
349
  bestPractices: [
242
- { guidance: true, description: "Use a determinate bar when the total amount of work is known, and indeterminate when it's not." },
243
- { guidance: true, description: 'Choose a color variant that matches the context: accent for general progress, success for completion, warning or error for alerts.' },
244
- { guidance: true, description: "Always provide a label, even if hidden; screen readers need it to announce what's loading." },
245
- { guidance: false, description: 'Place icons or labels inside the bar; compose them alongside it using layout components.' },
246
- { guidance: false, description: "Use a progress bar for instant actions; it's meant for operations that take noticeable time." },
247
- { guidance: false, description: 'Use multiple progress bars stacked together for the same operation; use one bar with a value label instead.' },
350
+ {
351
+ guidance: true,
352
+ description:
353
+ "Use a determinate bar when the total amount of work is known, and indeterminate when it's not.",
354
+ },
355
+ {
356
+ guidance: true,
357
+ description:
358
+ 'Choose a color variant that matches the context: accent for general progress, success for completion, warning or error for alerts.',
359
+ },
360
+ {
361
+ guidance: true,
362
+ description:
363
+ "Always provide a label, even if hidden; screen readers need it to announce what's loading.",
364
+ },
365
+ {
366
+ guidance: false,
367
+ description:
368
+ 'Place icons or labels inside the bar; compose them alongside it using layout components.',
369
+ },
370
+ {
371
+ guidance: false,
372
+ description:
373
+ "Use a progress bar for instant actions; it's meant for operations that take noticeable time.",
374
+ },
375
+ {
376
+ guidance: false,
377
+ description:
378
+ 'Use multiple progress bars stacked together for the same operation; use one bar with a value label instead.',
379
+ },
248
380
  ],
249
381
  },
250
382
  };
@@ -254,15 +386,40 @@ export const docsDense = {
254
386
  description:
255
387
  'Progress bar for displaying determinate or indeterminate progress.',
256
388
  usage: {
389
+ anatomy,
257
390
  description:
258
- 'A horizontal bar showing the completion progress of a task. Use it for operations where the duration is known, or as an animated indicator when progress can\'t be calculated. Supports semantic color variants, value labels, and custom formatting.',
391
+ "A horizontal bar showing the completion progress of a task. Use it for operations where the duration is known, or as an animated indicator when progress can't be calculated. Supports semantic color variants, value labels, and custom formatting.",
259
392
  bestPractices: [
260
- { guidance: true, description: "Use a determinate bar when the total amount of work is known, and indeterminate when it's not." },
261
- { guidance: true, description: 'Choose a color variant that matches the context: accent for general progress, success for completion, warning or error for alerts.' },
262
- { guidance: true, description: "Always provide a label, even if hidden; screen readers need it to announce what's loading." },
263
- { guidance: false, description: 'Place icons or labels inside the bar; compose them alongside it using layout components.' },
264
- { guidance: false, description: "Use a progress bar for instant actions; it's meant for operations that take noticeable time." },
265
- { guidance: false, description: 'Use multiple progress bars stacked together for the same operation; use one bar with a value label instead.' },
393
+ {
394
+ guidance: true,
395
+ description:
396
+ "Use a determinate bar when the total amount of work is known, and indeterminate when it's not.",
397
+ },
398
+ {
399
+ guidance: true,
400
+ description:
401
+ 'Choose a color variant that matches the context: accent for general progress, success for completion, warning or error for alerts.',
402
+ },
403
+ {
404
+ guidance: true,
405
+ description:
406
+ "Always provide a label, even if hidden; screen readers need it to announce what's loading.",
407
+ },
408
+ {
409
+ guidance: false,
410
+ description:
411
+ 'Place icons or labels inside the bar; compose them alongside it using layout components.',
412
+ },
413
+ {
414
+ guidance: false,
415
+ description:
416
+ "Use a progress bar for instant actions; it's meant for operations that take noticeable time.",
417
+ },
418
+ {
419
+ guidance: false,
420
+ description:
421
+ 'Use multiple progress bars stacked together for the same operation; use one bar with a value label instead.',
422
+ },
266
423
  ],
267
424
  },
268
425
  propDescriptions: {
@@ -271,11 +428,14 @@ export const docsDense = {
271
428
  max: 'Maximum value.',
272
429
  isLabelHidden: 'Visually hide label (remains accessible).',
273
430
  hasValueLabel: 'Show formatted value text (ignored when indeterminate).',
274
- formatValueLabel: 'Custom value label formatter; defaults to percentage string.',
431
+ formatValueLabel:
432
+ 'Custom value label formatter; defaults to percentage string.',
275
433
  variant: 'Semantic color variant.',
276
434
  isIndeterminate: 'Animated loading indicator for unknown progress.',
277
- marks: 'Fixed target marks ({value, label?}) drawn on the track in the 0..max scale; stay visible past the fill. Marks inside the fill take the variant on-color; marks on the bare track take the primary text color (secondary when disabled). A label reveals a tooltip on hover/focus. Ignored when indeterminate.',
435
+ marks:
436
+ 'Fixed target marks ({value, label?}) drawn on the track in the 0..max scale; stay visible past the fill. Marks inside the fill take the variant on-color; marks on the bare track take the primary text color (secondary when disabled). A label reveals a tooltip on hover/focus. Ignored when indeterminate.',
278
437
  isDisabled: 'Visually disabled: grays out fill and text.',
279
- xstyle: 'StyleX styles for layout customization. Must be stylex.create() value.',
438
+ xstyle:
439
+ 'StyleX styles for layout customization. Must be stylex.create() value.',
280
440
  },
281
441
  };
@@ -0,0 +1,260 @@
1
+ ---
2
+ schema_version: 1
3
+ template_version: 3
4
+ kind: component
5
+ id: component:ProgressBar
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: [public-api, behavior, theming, accessibility]
13
+ verified_by:
14
+ [
15
+ packages/core/src/ProgressBar/ProgressBar.test.tsx,
16
+ packages/core/src/theme/themingTargets.test.ts,
17
+ scripts/check-knowledge.mjs,
18
+ ]
19
+ families: []
20
+ design_specs: []
21
+ architecture:
22
+ [
23
+ architecture:public-component-api,
24
+ architecture:component-theming-surface,
25
+ architecture:theme-authoring-contract,
26
+ architecture:theme-tokens,
27
+ ]
28
+ contributing: []
29
+ system_specs: [spec:AST-002/DEC-1, spec:AST-002/DEC-2]
30
+ ---
31
+
32
+ # ProgressBar component contract
33
+
34
+ ## Intent
35
+
36
+ ProgressBar communicates the progress of an operation. A determinate bar must be
37
+ a sufficient standalone visual: people must be able to distinguish completed
38
+ from remaining progress without depending on visible text rendered elsewhere.
39
+ External text may supplement the bar, but it is not a prerequisite for the bar
40
+ to be correct.
41
+
42
+ This draft now also records the current consumer anatomy and exact theming
43
+ ownership. It still does not choose a visual treatment or change runtime
44
+ behavior.
45
+
46
+ ## Compatibility and migration
47
+
48
+ - Released default preserved: `yes`; this draft changes no runtime behavior.
49
+ - Compatibility class: additive documentation only; no public API, DOM, style,
50
+ target, or alias is added, removed, or changed.
51
+ - Controlled/uncontrolled behavior: unchanged.
52
+ - Migration decision: `component:ProgressBar/DEC-1`.
53
+
54
+ Consumer migration instructions belong in consumer docs and release notes.
55
+
56
+ ## Ownership boundary
57
+
58
+ **Owns**
59
+
60
+ - A sufficient standalone visual distinction between completed and remaining
61
+ progress for every determinate presentation the component provides.
62
+ - Internal resolution of that visual treatment when the caller supplies ordinary
63
+ progress state.
64
+ - The current progress-bar container, track, fill, and mark parts represented by
65
+ the `progress-bar`, `progress-bar-track`, `progress-bar-fill`, and
66
+ `progress-bar-mark` targets.
67
+
68
+ **Does not own / non-goals**
69
+
70
+ - External visible labels, values, or descriptions — owned by the product
71
+ callsite and supplementary to the bar.
72
+ - A separate public target for the built-in label or value text; none currently
73
+ exists.
74
+ - The exact standalone contrast treatment — still a human design decision.
75
+ - Theme token definitions — owned by `architecture:theme-tokens`.
76
+ - Public API that makes visual correctness depend on caller-declared external
77
+ content — governed by `architecture:public-component-api` and `spec:AST-002`.
78
+
79
+ ## Public concepts
80
+
81
+ | Concept | Closed values or states | Meaning | Availability by variant/orientation/state | Default | Owner | Stability | Invalid-value behavior |
82
+ | ------------------- | ---------------------------------------------------------- | --------------------------------------------------------------- | ----------------------------------------- | ------------------------------- | ----------------------- | ------------------ | ------------------------------ |
83
+ | Progress mode | `determinate`, `indeterminate` | Whether completed progress is known | All variants | Determinate | `component:ProgressBar` | Stable current API | Existing prop handling applies |
84
+ | Built-in value text | Shown or hidden | Optional visible text supplement generated by ProgressBar | Determinate only | Hidden | `component:ProgressBar` | Stable current API | Ignored when indeterminate |
85
+ | Visual treatment | One sufficient standalone treatment; exact form unresolved | How the graphic distinguishes completed from remaining progress | Determinate progress | Sufficient standalone treatment | `component:ProgressBar` | Draft decision | No incomplete public mode |
86
+
87
+ The current public props remain documented in `ProgressBar.doc.mjs`. This draft
88
+ does not turn nearby external content into a ProgressBar concept.
89
+
90
+ ## Behavioral and layout contract
91
+
92
+ Draft requirements identify their basis so observed code is not mistaken for an
93
+ intentional decision.
94
+
95
+ | ID | Candidate invariant | Basis | Draft review state |
96
+ | --- | ------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------ | ------------------------------------------- |
97
+ | FR1 | Every determinate presentation ProgressBar provides MUST be a sufficient standalone visual for distinguishing completed from remaining progress. | `component:ProgressBar/DEC-1`; existing non-text contrast standard | Settled |
98
+ | FR2 | External visible text MAY supplement the bar but MUST NOT be required for the bar's visual correctness. | `component:ProgressBar/DEC-1` | Settled |
99
+ | FR3 | ProgressBar MUST NOT make visual correctness depend on caller-declared external content that it cannot verify or associate. | `component:ProgressBar/DEC-1`; `spec:AST-002` | Settled |
100
+ | FR4 | Supplementary text or graphics MUST NOT substitute for a sufficient distinction between completed and remaining progress. | `component:ProgressBar/DEC-1` | Settled |
101
+ | FR5 | Public API MAY be considered only after the component has a correct base behavior and a stable caller-owned distinction still remains. | `component:ProgressBar/DEC-1`; `spec:AST-002` | Settled admission gate |
102
+ | FR6 | The current container, track, fill, and mark carry their four current targets; label and value text carry no separate ProgressBar target. | Current source, public docs, and focused tests | Verified current behavior; no target change |
103
+
104
+ ### Observed current behavior
105
+
106
+ These observations describe `main`; they are not design approval from this
107
+ draft:
108
+
109
+ - Determinate progress renders a semantic-color fill over a muted track.
110
+ - `hasValueLabel` optionally renders formatted value text in the component.
111
+ - Callers may compose other visible text outside the component.
112
+ - `Progress bar`, `Track`, `Fill`, and `Mark` carry `progress-bar`,
113
+ `progress-bar-track`, `progress-bar-fill`, and `progress-bar-mark`
114
+ respectively. `Label` and `Value text` have no separate public target.
115
+ - Variant state is reflected on the progress-bar, fill, and mark targets;
116
+ placement is also reflected on marks.
117
+ - Current unit tests cover value semantics, labels, variants, determinate and
118
+ indeterminate modes, disabled rendering, marks, and public target names. They
119
+ do not establish a sufficient standalone completed-versus-remaining visual
120
+ across shipped themes.
121
+
122
+ ### Allowed variation
123
+
124
+ - **AV1 — Exact visual treatment.** Shape, token choice, and other rendering
125
+ details may vary if every resulting presentation satisfies FR1.
126
+ - **AV2 — Themes.** Themes may express their visual language through the current
127
+ theming system while preserving the standalone distinction.
128
+
129
+ ### Representative states
130
+
131
+ | State | Required invariant | Allowed variation |
132
+ | -------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- |
133
+ | Determinate, partial progress | Completed and remaining progress are distinguishable from the graphic alone | Exact visual treatment and semantic variant |
134
+ | Determinate with built-in value text | The graphic still satisfies FR1; value text supplements it | Value formatting |
135
+ | Determinate with external visible text | The graphic still satisfies FR1 without relying on that text | Callsite composition |
136
+ | Indeterminate | Communicates ongoing activity without claiming a completed amount | Existing animation and theme variation; completed-versus-remaining distinction does not apply |
137
+
138
+ ### Transformation and precedence order
139
+
140
+ - **ORD1 — Progress state before presentation.** Resolve determinate or
141
+ indeterminate behavior from component state, then render a treatment valid for
142
+ that mode. External content does not weaken the determinate visual requirement.
143
+
144
+ ### Performance and resources
145
+
146
+ - **PR1 — No external-content inspection.** ProgressBar MUST NOT add DOM
147
+ observation, measurement, or relationship discovery to decide whether nearby
148
+ visible text makes a weaker bar acceptable.
149
+
150
+ ## Accessibility contract
151
+
152
+ - **AR1 — Standalone non-text distinction.** A determinate bar MUST satisfy the
153
+ applicable non-text contrast requirement without relying on external visible
154
+ text.
155
+ - **AR2 — Programmatic semantics remain present.** The current required
156
+ accessible name and determinate value semantics remain independent of the
157
+ visible treatment.
158
+ - **AR3 — Supplementary text is not inferred.** ProgressBar MUST NOT claim that
159
+ external text is present, visible, equivalent, or correctly associated when it
160
+ cannot encode or verify those facts.
161
+
162
+ ## Design relationships
163
+
164
+ | Anatomy or state | Design requirement | Representation authority | Hierarchy role | Component contract |
165
+ | ------------------------------------ | ------------------------------------------------------- | ------------------------------------- | -------------- | ------------------ |
166
+ | Progress bar | Arranges the current label row and progress track. | Current source and public docs | Supporting | FR6 |
167
+ | Label and value text | Name the operation and optionally supplement its value. | Current source and public docs | Supporting | FR2, AR2, FR6 |
168
+ | Determinate fill and remaining track | Provide a sufficient standalone distinction. | Unsettled standalone visual treatment | Prominent | FR1, AR1 |
169
+ | Mark | Presents an optional labeled target on the track. | Current source and public docs | Supporting | FR6 |
170
+
171
+ The component implements design requirements without copying their rationale.
172
+ The standalone visual remains a human design decision; this contract does not
173
+ invent its form.
174
+
175
+ ### Theming anatomy
176
+
177
+ <!-- anatomy-theming:v1 -->
178
+
179
+ ```json
180
+ {
181
+ "Progress bar": {"target": "progress-bar"},
182
+ "Label": {
183
+ "none": {
184
+ "reason": "unsettled: No current public ProgressBar target reaches this part; future target ownership is undecided."
185
+ }
186
+ },
187
+ "Value text": {
188
+ "none": {
189
+ "reason": "unsettled: No current public ProgressBar target reaches this part; future target ownership is undecided."
190
+ }
191
+ },
192
+ "Track": {"target": "progress-bar-track"},
193
+ "Fill": {"target": "progress-bar-fill"},
194
+ "Mark": {"target": "progress-bar-mark"}
195
+ }
196
+ ```
197
+
198
+ The `Label` and `Value text` gaps are current facts, not decisions that those
199
+ parts should remain untargeted. Deprecated `progressbar*` aliases are
200
+ compatibility metadata, not separate anatomy or current targets. This map does
201
+ not select a standalone visual treatment or resolve OQ1.
202
+
203
+ ## Family and system relationships
204
+
205
+ - `architecture:public-component-api` and `spec:AST-002/DEC-1` govern whether a
206
+ caller-owned distinction justifies a public prop.
207
+ - `architecture:component-theming-surface` governs which stable visible parts and
208
+ states become public theme capabilities.
209
+ - `architecture:theme-authoring-contract` governs how themes override those
210
+ component capabilities without creating a second component contract.
211
+ - `architecture:theme-tokens` governs the semantic token vocabulary used by the
212
+ eventual treatment.
213
+ - ProgressBar and Slider both render a track, a filled segment, positioned
214
+ indicators, and optional value presentation, while their current target
215
+ coverage differs. That evidence requires a future joint family/audit pass; it
216
+ does not declare a current family, require a new target, or authorize runtime
217
+ behavior changes.
218
+
219
+ ## Verification map
220
+
221
+ | Contract | Verification | Representative states | Mutation or failure expectation | Audit section |
222
+ | ------------------- | ------------------------------------------------------------------------------- | ----------------------------------------------------------- | ------------------------------------------------------------------------- | -------------------------------------- |
223
+ | FR1, AR1 | Real-browser visual and contrast evidence across shipped themes and color modes | Partial determinate progress for each semantic variant | A completed or remaining segment becomes indistinguishable without text | Future ProgressBar visual audit |
224
+ | FR2, FR3, AR3 | Public type and consumer-doc review | No value text, built-in value text, external composed text | A caller signal is credited with correctness the component cannot verify | Future ProgressBar API tests |
225
+ | AR2 | `ProgressBar.test.tsx` | Determinate, indeterminate, hidden label, custom value text | Accessible name or value semantics disappear when visuals change | Future ProgressBar accessibility audit |
226
+ | FR6 | `ProgressBar.test.tsx` and `themingTargets.test.ts` | Current and deprecated target classes | Source, metadata, or compatibility target placement drifts | `audit:ProgressBar/theming` |
227
+ | Theming anatomy map | `scripts/check-knowledge.mjs` | Canonical anatomy and four current targets | Missing, extra, prefixed, stale, alias-backed, or unclaimed mappings fail | `audit:ProgressBar/theming` |
228
+ | Theming | Theme-target metadata checks plus browser evidence | Shipped themes, light and dark modes | A theme override bypasses the standalone distinction | Future ProgressBar theming audit |
229
+
230
+ ## Decision log
231
+
232
+ ### DEC-1 — ProgressBar owns a sufficient standalone visual
233
+
234
+ **Reference:** `component:ProgressBar/DEC-1`
235
+ **Decider:** `cixzhang`, `2026-08-30`
236
+
237
+ ProgressBar must provide a sufficient standalone visual. Visible text inside or
238
+ outside the component may improve understanding, but the bar remains responsible
239
+ for communicating completed versus remaining progress without it.
240
+
241
+ Public API must not make that correctness depend on external content the
242
+ component cannot carry, associate, or verify. Solve the component behavior first.
243
+ Consider new API only when a stable caller-owned distinction still remains after
244
+ the base behavior is correct.
245
+
246
+ Rejected: weakening the bar based on a caller claim about nearby content. That
247
+ would move component correctness into an external condition the component cannot
248
+ verify.
249
+
250
+ ## Open questions
251
+
252
+ - **OQ1 — What exact visual treatment gives every determinate presentation a
253
+ sufficient standalone completed-versus-remaining distinction across supported
254
+ variants, themes, and color modes?** (`human-design`)
255
+
256
+ ## Content boundary
257
+
258
+ This file does not duplicate consumer prop tables or examples, current audit
259
+ results, implementation steps, exact visual values, or system theming rules. It
260
+ links to their owners.
@@ -6,7 +6,7 @@ export const docs = {
6
6
  name: 'RadioList',
7
7
  displayName: 'Radio List',
8
8
  group: 'Radio',
9
- category: 'Data Input',
9
+ category: 'Form Controls',
10
10
  keywords: ["radiolist","radio","radiogroup","radiobutton","optionlist","singlechoice","choicelist"],
11
11
  theming: {
12
12
  targets: [