@astryxdesign/core 0.4.4 → 0.4.5-canary.013e728

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 (469) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/dist/AvatarGroup/AvatarGroupOverflow.js +1 -1
  3. package/dist/BottomSheet/BottomSheet.d.ts +11 -2
  4. package/dist/BottomSheet/BottomSheet.d.ts.map +1 -1
  5. package/dist/BottomSheet/BottomSheet.js +4 -0
  6. package/dist/BottomSheet/BottomSheetPanel.d.ts +5 -2
  7. package/dist/BottomSheet/BottomSheetPanel.d.ts.map +1 -1
  8. package/dist/BottomSheet/BottomSheetPanel.js +65 -15
  9. package/dist/BottomSheet/index.d.ts +1 -1
  10. package/dist/BottomSheet/index.d.ts.map +1 -1
  11. package/dist/BottomSheet/snapOffsets.d.ts +57 -20
  12. package/dist/BottomSheet/snapOffsets.d.ts.map +1 -1
  13. package/dist/BottomSheet/snapOffsets.js +106 -30
  14. package/dist/BottomSheet/useSheetGestures.d.ts +13 -8
  15. package/dist/BottomSheet/useSheetGestures.d.ts.map +1 -1
  16. package/dist/BottomSheet/useSheetGestures.js +160 -64
  17. package/dist/Breadcrumbs/BreadcrumbItem.js +6 -6
  18. package/dist/Button/Button.js +5 -5
  19. package/dist/Calendar/Calendar.d.ts +17 -0
  20. package/dist/Calendar/Calendar.d.ts.map +1 -1
  21. package/dist/Calendar/Calendar.js +55 -15
  22. package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts +14 -0
  23. package/dist/Calendar/getStandaloneShortWeekdayNames.d.ts.map +1 -0
  24. package/dist/Calendar/getStandaloneShortWeekdayNames.js +26 -0
  25. package/dist/Calendar/hooks/useCalendarConstraints.d.ts +22 -1
  26. package/dist/Calendar/hooks/useCalendarConstraints.d.ts.map +1 -1
  27. package/dist/Calendar/hooks/useCalendarConstraints.js +26 -4
  28. package/dist/Calendar/hooks/useCalendarDays.d.ts.map +1 -1
  29. package/dist/Calendar/hooks/useCalendarDays.js +14 -10
  30. package/dist/Calendar/hooks/useCalendarNavigation.d.ts.map +1 -1
  31. package/dist/Calendar/hooks/useCalendarNavigation.js +8 -4
  32. package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts +47 -0
  33. package/dist/Calendar/standaloneShortWeekdayNames.generated.d.ts.map +1 -0
  34. package/dist/Calendar/standaloneShortWeekdayNames.generated.js +40 -0
  35. package/dist/Calendar/styles.js +3 -3
  36. package/dist/Center/Center.d.ts +23 -1
  37. package/dist/Center/Center.d.ts.map +1 -1
  38. package/dist/Center/Center.js +12 -6
  39. package/dist/Chat/ChatComposer.d.ts.map +1 -1
  40. package/dist/Chat/ChatComposer.js +2 -2
  41. package/dist/Chat/ChatToolCalls.js +1 -1
  42. package/dist/Chat/useChatDictation.d.ts +1 -1
  43. package/dist/Chat/useChatDictation.d.ts.map +1 -1
  44. package/dist/Chat/useSpeechRecognition.d.ts +1 -1
  45. package/dist/Chat/useSpeechRecognition.d.ts.map +1 -1
  46. package/dist/Chat/useSpeechRecognition.js +4 -3
  47. package/dist/CheckboxInput/CheckboxInput.d.ts.map +1 -1
  48. package/dist/CheckboxInput/CheckboxInput.js +9 -0
  49. package/dist/Citation/Citation.js +3 -3
  50. package/dist/ClickableCard/ClickableCard.js +2 -2
  51. package/dist/CommandPalette/CommandPaletteItem.js +1 -1
  52. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  53. package/dist/ComplexSelector/ComplexSelector.js +8 -3
  54. package/dist/DateInput/DateInput.d.ts.map +1 -1
  55. package/dist/DateInput/DateInput.js +17 -9
  56. package/dist/DateRangeInput/DateRangeInput.d.ts +23 -1
  57. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  58. package/dist/DateRangeInput/DateRangeInput.js +47 -9
  59. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  60. package/dist/DateTimeInput/DateTimeInput.js +18 -10
  61. package/dist/Dialog/Dialog.d.ts.map +1 -1
  62. package/dist/Dialog/Dialog.js +3 -3
  63. package/dist/Field/FieldLabel.d.ts +2 -1
  64. package/dist/Field/FieldLabel.d.ts.map +1 -1
  65. package/dist/Field/FieldLabel.js +21 -3
  66. package/dist/Field/InputClearButton.d.ts +2 -1
  67. package/dist/Field/InputClearButton.d.ts.map +1 -1
  68. package/dist/Field/InputClearButton.js +12 -1
  69. package/dist/Field/inputStyles.stylex.d.ts.map +1 -1
  70. package/dist/Field/inputStyles.stylex.js +4 -4
  71. package/dist/FileInput/FileInput.d.ts.map +1 -1
  72. package/dist/FileInput/FileInput.js +2 -2
  73. package/dist/FormLayout/FormLayout.d.ts +24 -2
  74. package/dist/FormLayout/FormLayout.d.ts.map +1 -1
  75. package/dist/FormLayout/FormLayout.js +7 -2
  76. package/dist/FormLayout/FormLayoutContext.d.ts +15 -2
  77. package/dist/FormLayout/FormLayoutContext.d.ts.map +1 -1
  78. package/dist/FormLayout/FormLayoutContext.js +19 -4
  79. package/dist/FormLayout/index.d.ts +1 -1
  80. package/dist/FormLayout/index.d.ts.map +1 -1
  81. package/dist/HoverCard/HoverCard.d.ts +13 -3
  82. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  83. package/dist/HoverCard/HoverCard.js +2 -0
  84. package/dist/HoverCard/index.d.ts +1 -1
  85. package/dist/HoverCard/index.d.ts.map +1 -1
  86. package/dist/HoverCard/useHoverCard.d.ts +17 -2
  87. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  88. package/dist/HoverCard/useHoverCard.js +78 -9
  89. package/dist/Item/Item.d.ts +9 -1
  90. package/dist/Item/Item.d.ts.map +1 -1
  91. package/dist/Item/Item.js +46 -8
  92. package/dist/Layer/index.d.ts +4 -2
  93. package/dist/Layer/index.d.ts.map +1 -1
  94. package/dist/Layer/index.js +2 -0
  95. package/dist/Layer/useLayer.d.ts.map +1 -1
  96. package/dist/Layer/useLayer.js +3 -2
  97. package/dist/Layer/useTouchTrigger.d.ts +113 -0
  98. package/dist/Layer/useTouchTrigger.d.ts.map +1 -0
  99. package/dist/Layer/useTouchTrigger.js +241 -0
  100. package/dist/Layout/container.stylex.d.ts +4 -2
  101. package/dist/Layout/container.stylex.d.ts.map +1 -1
  102. package/dist/Layout/container.stylex.js +19 -11
  103. package/dist/Layout/index.d.ts +1 -0
  104. package/dist/Layout/index.d.ts.map +1 -1
  105. package/dist/Layout/index.js +4 -0
  106. package/dist/Layout/padding.stylex.d.ts +315 -12
  107. package/dist/Layout/padding.stylex.d.ts.map +1 -1
  108. package/dist/Layout/padding.stylex.js +389 -12
  109. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  110. package/dist/Lightbox/Lightbox.js +2 -1
  111. package/dist/Link/Link.js +4 -4
  112. package/dist/Markdown/Markdown.d.ts +8 -0
  113. package/dist/Markdown/Markdown.d.ts.map +1 -1
  114. package/dist/Markdown/Markdown.js +31 -3
  115. package/dist/Markdown/parser.d.ts +14 -2
  116. package/dist/Markdown/parser.d.ts.map +1 -1
  117. package/dist/Markdown/parser.js +50 -2
  118. package/dist/MobileNav/MobileNav.d.ts +1 -0
  119. package/dist/MobileNav/MobileNav.d.ts.map +1 -1
  120. package/dist/MobileNav/MobileNav.js +24 -6
  121. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  122. package/dist/MultiSelector/MultiSelector.js +8 -3
  123. package/dist/NavItem/navItemStyles.stylex.d.ts +2 -2
  124. package/dist/NavItem/navItemStyles.stylex.js +2 -2
  125. package/dist/NavMenu/NavHeadingMenuItem.js +1 -1
  126. package/dist/NumberInput/NumberInput.d.ts.map +1 -1
  127. package/dist/NumberInput/NumberInput.js +38 -5
  128. package/dist/Outline/Outline.js +2 -2
  129. package/dist/Outline/parseOutlineFromMarkdown.d.ts +2 -0
  130. package/dist/Outline/parseOutlineFromMarkdown.d.ts.map +1 -1
  131. package/dist/Outline/parseOutlineFromMarkdown.js +5 -31
  132. package/dist/PowerSearch/PowerSearch.d.ts.map +1 -1
  133. package/dist/PowerSearch/PowerSearch.js +11 -12
  134. package/dist/PowerSearch/PowerSearchToken.d.ts.map +1 -1
  135. package/dist/PowerSearch/PowerSearchToken.js +3 -1
  136. package/dist/PowerSearch/formatFilterValue.d.ts +11 -2
  137. package/dist/PowerSearch/formatFilterValue.d.ts.map +1 -1
  138. package/dist/PowerSearch/formatFilterValue.js +23 -8
  139. package/dist/RadioList/RadioList.d.ts.map +1 -1
  140. package/dist/RadioList/RadioList.js +12 -1
  141. package/dist/RadioList/RadioListItem.d.ts +2 -2
  142. package/dist/RadioList/RadioListItem.d.ts.map +1 -1
  143. package/dist/RadioList/RadioListItem.js +68 -38
  144. package/dist/Resizable/ResizeHandle.d.ts.map +1 -1
  145. package/dist/Resizable/ResizeHandle.js +3 -3
  146. package/dist/Section/Section.d.ts +36 -1
  147. package/dist/Section/Section.d.ts.map +1 -1
  148. package/dist/Section/Section.js +12 -2
  149. package/dist/SegmentedControl/SegmentedControlItem.d.ts.map +1 -1
  150. package/dist/SegmentedControl/SegmentedControlItem.js +6 -1
  151. package/dist/SelectableCard/SelectableCard.js +1 -1
  152. package/dist/Selector/Selector.d.ts +26 -1
  153. package/dist/Selector/Selector.d.ts.map +1 -1
  154. package/dist/Selector/Selector.js +95 -17
  155. package/dist/Selector/SelectorOption.d.ts +14 -1
  156. package/dist/Selector/SelectorOption.d.ts.map +1 -1
  157. package/dist/Selector/SelectorOption.js +6 -0
  158. package/dist/Selector/SelectorRowLayoutContext.d.ts +8 -0
  159. package/dist/Selector/SelectorRowLayoutContext.d.ts.map +1 -0
  160. package/dist/Selector/SelectorRowLayoutContext.js +27 -0
  161. package/dist/Selector/types.d.ts +1 -0
  162. package/dist/Selector/types.d.ts.map +1 -1
  163. package/dist/SideNav/SideNavHeading.js +1 -1
  164. package/dist/SideNav/SideNavItem.js +1 -1
  165. package/dist/Slider/Slider.d.ts.map +1 -1
  166. package/dist/Slider/Slider.js +3 -3
  167. package/dist/Stack/Stack.d.ts +23 -1
  168. package/dist/Stack/Stack.d.ts.map +1 -1
  169. package/dist/Stack/Stack.js +12 -6
  170. package/dist/StatusDot/StatusDot.d.ts +43 -3
  171. package/dist/StatusDot/StatusDot.d.ts.map +1 -1
  172. package/dist/StatusDot/StatusDot.js +42 -5
  173. package/dist/Switch/Switch.d.ts.map +1 -1
  174. package/dist/Switch/Switch.js +9 -0
  175. package/dist/TabList/TabMenu.js +1 -1
  176. package/dist/Table/TableRow.js +4 -4
  177. package/dist/Table/plugins/columnResize/useTableColumnResize.d.ts.map +1 -1
  178. package/dist/Table/plugins/columnResize/useTableColumnResize.js +1 -1
  179. package/dist/Table/plugins/groupedRows/useTableGroupedRows.d.ts.map +1 -1
  180. package/dist/Table/plugins/groupedRows/useTableGroupedRows.js +1 -1
  181. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.d.ts.map +1 -1
  182. package/dist/Table/plugins/rowExpansion/useTableRowExpansion.js +7 -2
  183. package/dist/Table/plugins/sortable/useTableSortableState.d.ts +5 -3
  184. package/dist/Table/plugins/sortable/useTableSortableState.d.ts.map +1 -1
  185. package/dist/Table/plugins/sortable/useTableSortableState.js +12 -9
  186. package/dist/Table/plugins/tree/useTableTreeData.js +2 -2
  187. package/dist/TextArea/TextArea.d.ts.map +1 -1
  188. package/dist/TextArea/TextArea.js +6 -1
  189. package/dist/TextInput/TextInput.d.ts.map +1 -1
  190. package/dist/TextInput/TextInput.js +6 -1
  191. package/dist/Thumbnail/Thumbnail.js +1 -1
  192. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  193. package/dist/TimeInput/TimeInput.js +6 -1
  194. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  195. package/dist/Timestamp/Timestamp.js +6 -4
  196. package/dist/Timestamp/formatInstant.d.ts +3 -2
  197. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  198. package/dist/Timestamp/formatInstant.js +8 -8
  199. package/dist/Timestamp/tooltipEntries.d.ts +2 -1
  200. package/dist/Timestamp/tooltipEntries.d.ts.map +1 -1
  201. package/dist/Timestamp/tooltipEntries.js +5 -3
  202. package/dist/Token/Token.js +1 -1
  203. package/dist/Tooltip/Tooltip.d.ts +16 -3
  204. package/dist/Tooltip/Tooltip.d.ts.map +1 -1
  205. package/dist/Tooltip/Tooltip.js +2 -0
  206. package/dist/Tooltip/index.d.ts +1 -1
  207. package/dist/Tooltip/index.d.ts.map +1 -1
  208. package/dist/Tooltip/useTooltip.d.ts +21 -2
  209. package/dist/Tooltip/useTooltip.d.ts.map +1 -1
  210. package/dist/Tooltip/useTooltip.js +71 -13
  211. package/dist/TopNav/TopNavHeading.js +2 -2
  212. package/dist/TopNav/TopNavItem.js +2 -2
  213. package/dist/TopNav/TopNavMegaMenu.js +1 -1
  214. package/dist/TopNav/TopNavMegaMenuItem.js +1 -1
  215. package/dist/TopNav/TopNavMenu.js +2 -2
  216. package/dist/TreeList/TreeListItem.js +1 -1
  217. package/dist/astryx.css +85 -60
  218. package/dist/hooks/containerReveal.stylex.d.ts.map +1 -1
  219. package/dist/hooks/containerReveal.stylex.js +18 -18
  220. package/dist/hooks/scrollbarGutter.d.ts +28 -0
  221. package/dist/hooks/scrollbarGutter.d.ts.map +1 -0
  222. package/dist/hooks/scrollbarGutter.js +103 -0
  223. package/dist/hooks/useResolvedRequired.d.ts +19 -0
  224. package/dist/hooks/useResolvedRequired.d.ts.map +1 -0
  225. package/dist/hooks/useResolvedRequired.js +40 -0
  226. package/dist/hooks/useScrollLock.d.ts +4 -0
  227. package/dist/hooks/useScrollLock.d.ts.map +1 -1
  228. package/dist/hooks/useScrollLock.js +13 -1
  229. package/dist/i18n/InternationalizationContext.d.ts.map +1 -1
  230. package/dist/i18n/InternationalizationContext.js +2 -0
  231. package/dist/i18n/index.d.ts +6 -0
  232. package/dist/i18n/index.d.ts.map +1 -1
  233. package/dist/i18n/index.js +6 -0
  234. package/dist/i18n/useCollator.d.ts +12 -0
  235. package/dist/i18n/useCollator.d.ts.map +1 -0
  236. package/dist/i18n/useCollator.js +40 -0
  237. package/dist/i18n/useLocale.d.ts +3 -0
  238. package/dist/i18n/useLocale.d.ts.map +1 -0
  239. package/dist/i18n/useLocale.js +31 -0
  240. package/dist/theme/defineTheme.d.ts +5 -0
  241. package/dist/theme/defineTheme.d.ts.map +1 -1
  242. package/dist/theme/defineTheme.js +5 -0
  243. package/dist/theme/derivedVarRegistry.d.ts.map +1 -1
  244. package/dist/theme/derivedVarRegistry.js +7 -0
  245. package/dist/theme/generateThemeRules.d.ts.map +1 -1
  246. package/dist/theme/generateThemeRules.js +66 -5
  247. package/dist/utils/dateParser.d.ts +4 -3
  248. package/dist/utils/dateParser.d.ts.map +1 -1
  249. package/dist/utils/dateParser.js +8 -8
  250. package/dist/utils/plainDate.d.ts +9 -2
  251. package/dist/utils/plainDate.d.ts.map +1 -1
  252. package/dist/utils/plainDate.js +16 -4
  253. package/locales/af-ZA.json +958 -0
  254. package/locales/ar-SA.json +998 -0
  255. package/locales/ca-ES.json +974 -0
  256. package/locales/cs-CZ.json +990 -0
  257. package/locales/da-DK.json +966 -0
  258. package/locales/de-DE.json +966 -0
  259. package/locales/el-GR.json +990 -0
  260. package/locales/en.json +8 -0
  261. package/locales/es-ES.json +978 -0
  262. package/locales/fi-FI.json +990 -0
  263. package/locales/fr-FR.json +928 -0
  264. package/locales/he-IL.json +990 -0
  265. package/locales/hu-HU.json +990 -0
  266. package/locales/it-IT.json +978 -0
  267. package/locales/ja-JP.json +998 -0
  268. package/locales/ko-KR.json +990 -0
  269. package/locales/nl-NL.json +954 -0
  270. package/locales/no-NO.json +978 -0
  271. package/locales/pl-PL.json +982 -0
  272. package/locales/pseudo.json +6 -0
  273. package/locales/pt-BR.json +982 -0
  274. package/locales/pt-PT.json +982 -0
  275. package/locales/ro-RO.json +982 -0
  276. package/locales/ru-RU.json +990 -0
  277. package/locales/sr-SP.json +990 -0
  278. package/locales/sv-SE.json +986 -0
  279. package/locales/tr-TR.json +990 -0
  280. package/locales/uk-UA.json +990 -0
  281. package/locales/vi-VN.json +986 -0
  282. package/locales/zh-CN.json +998 -0
  283. package/locales/zh-TW.json +998 -0
  284. package/package.json +3 -3
  285. package/src/AvatarGroup/AvatarGroupOverflow.tsx +1 -1
  286. package/src/Banner/Banner.doc.mjs +2 -0
  287. package/src/BottomSheet/BottomSheet.doc.mjs +36 -3
  288. package/src/BottomSheet/BottomSheet.test.tsx +177 -2
  289. package/src/BottomSheet/BottomSheet.tsx +16 -2
  290. package/src/BottomSheet/BottomSheetPanel.test.tsx +41 -0
  291. package/src/BottomSheet/BottomSheetPanel.tsx +95 -15
  292. package/src/BottomSheet/index.ts +5 -1
  293. package/src/BottomSheet/snapOffsets.test.ts +114 -47
  294. package/src/BottomSheet/snapOffsets.ts +119 -33
  295. package/src/BottomSheet/useSheetGestures.test.ts +113 -15
  296. package/src/BottomSheet/useSheetGestures.ts +196 -100
  297. package/src/Breadcrumbs/BreadcrumbItem.tsx +1 -1
  298. package/src/Button/Button.tsx +7 -7
  299. package/src/Calendar/Calendar.doc.mjs +16 -0
  300. package/src/Calendar/Calendar.test.tsx +137 -0
  301. package/src/Calendar/Calendar.tsx +80 -11
  302. package/src/Calendar/getStandaloneShortWeekdayNames.test.ts +54 -0
  303. package/src/Calendar/getStandaloneShortWeekdayNames.ts +38 -0
  304. package/src/Calendar/hooks/useCalendarConstraints.ts +54 -3
  305. package/src/Calendar/hooks/useCalendarDays.ts +13 -10
  306. package/src/Calendar/hooks/useCalendarNavigation.ts +6 -4
  307. package/src/Calendar/standaloneShortWeekdayNames.generated.ts +50 -0
  308. package/src/Calendar/styles.ts +3 -3
  309. package/src/Center/Center.doc.mjs +48 -0
  310. package/src/Center/Center.test.tsx +158 -0
  311. package/src/Center/Center.tsx +50 -9
  312. package/src/Chat/ChatComposer.tsx +7 -4
  313. package/src/Chat/ChatToolCalls.tsx +1 -1
  314. package/src/Chat/{useChatDictation.test.ts → useChatDictation.test.tsx} +29 -14
  315. package/src/Chat/useChatDictation.ts +1 -1
  316. package/src/Chat/useSpeechRecognition.ts +5 -3
  317. package/src/CheckboxInput/CheckboxInput.tsx +6 -0
  318. package/src/Citation/Citation.tsx +3 -3
  319. package/src/ClickableCard/ClickableCard.tsx +2 -2
  320. package/src/CommandPalette/CommandPaletteItem.tsx +1 -1
  321. package/src/ComplexSelector/ComplexSelector.doc.mjs +10 -0
  322. package/src/ComplexSelector/ComplexSelector.tsx +8 -5
  323. package/src/DateInput/DateInput.test.tsx +17 -1
  324. package/src/DateInput/DateInput.tsx +13 -9
  325. package/src/DateRangeInput/DateRangeInput.doc.mjs +16 -0
  326. package/src/DateRangeInput/DateRangeInput.test.tsx +81 -1
  327. package/src/DateRangeInput/DateRangeInput.tsx +88 -8
  328. package/src/DateTimeInput/DateTimeInput.tsx +23 -8
  329. package/src/Dialog/Dialog.test.tsx +24 -0
  330. package/src/Dialog/Dialog.tsx +3 -0
  331. package/src/Field/Field.doc.mjs +3 -0
  332. package/src/Field/FieldLabel.tsx +20 -4
  333. package/src/Field/InputClearButton.test.tsx +134 -2
  334. package/src/Field/InputClearButton.tsx +42 -1
  335. package/src/Field/inputStyles.stylex.ts +16 -12
  336. package/src/FileInput/FileInput.tsx +5 -4
  337. package/src/FormLayout/FormLayout.doc.mjs +13 -0
  338. package/src/FormLayout/FormLayout.test.tsx +181 -4
  339. package/src/FormLayout/FormLayout.tsx +33 -2
  340. package/src/FormLayout/FormLayoutContext.ts +22 -7
  341. package/src/FormLayout/index.ts +1 -1
  342. package/src/HoverCard/HoverCard.doc.mjs +18 -0
  343. package/src/HoverCard/HoverCard.test.tsx +189 -0
  344. package/src/HoverCard/HoverCard.tsx +22 -2
  345. package/src/HoverCard/index.ts +1 -0
  346. package/src/HoverCard/useHoverCard.doc.mjs +2 -0
  347. package/src/HoverCard/useHoverCard.tsx +103 -7
  348. package/src/Item/Item.doc.mjs +1 -0
  349. package/src/Item/Item.test.tsx +50 -0
  350. package/src/Item/Item.tsx +41 -2
  351. package/src/Layer/index.ts +10 -0
  352. package/src/Layer/useLayer.tsx +13 -2
  353. package/src/Layer/useTouchTrigger.test.ts +70 -0
  354. package/src/Layer/useTouchTrigger.ts +366 -0
  355. package/src/Layout/Layout.doc.mjs +18 -0
  356. package/src/Layout/container.stylex.ts +11 -3
  357. package/src/Layout/index.ts +4 -0
  358. package/src/Layout/overlayPaddingReset.test.tsx +222 -0
  359. package/src/Layout/padding.stylex.ts +192 -12
  360. package/src/Lightbox/Lightbox.tsx +2 -1
  361. package/src/Link/Link.tsx +4 -4
  362. package/src/Markdown/Markdown.doc.mjs +3 -0
  363. package/src/Markdown/Markdown.test.tsx +78 -0
  364. package/src/Markdown/Markdown.tsx +41 -1
  365. package/src/Markdown/parser.ts +60 -2
  366. package/src/MobileNav/MobileNav.tsx +61 -5
  367. package/src/MobileNav/MobileNavEntryAnimation.test.tsx +212 -0
  368. package/src/MobileNav/MobileNavScrollbarGutter.test.tsx +109 -0
  369. package/src/MultiSelector/MultiSelector.test.tsx +1 -1
  370. package/src/MultiSelector/MultiSelector.tsx +8 -5
  371. package/src/NavItem/navItemStyles.stylex.ts +2 -2
  372. package/src/NavMenu/NavHeadingMenuItem.tsx +1 -1
  373. package/src/NumberInput/NumberInput.doc.mjs +24 -0
  374. package/src/NumberInput/NumberInput.test.tsx +138 -0
  375. package/src/NumberInput/NumberInput.tsx +44 -6
  376. package/src/Outline/Outline.doc.mjs +2 -0
  377. package/src/Outline/Outline.tsx +1 -1
  378. package/src/Outline/parseOutlineFromMarkdown.ts +10 -40
  379. package/src/PowerSearch/PowerSearch.tsx +17 -8
  380. package/src/PowerSearch/PowerSearchToken.tsx +3 -0
  381. package/src/PowerSearch/formatFilterValue.test.ts +22 -2
  382. package/src/PowerSearch/formatFilterValue.ts +31 -6
  383. package/src/RadioList/RadioList.doc.mjs +1 -1
  384. package/src/RadioList/RadioList.test.tsx +170 -2
  385. package/src/RadioList/RadioList.tsx +9 -1
  386. package/src/RadioList/RadioListItem.tsx +83 -51
  387. package/src/Resizable/ResizeHandle.test.tsx +22 -0
  388. package/src/Resizable/ResizeHandle.tsx +9 -3
  389. package/src/Section/Section.doc.mjs +55 -0
  390. package/src/Section/Section.test.tsx +201 -4
  391. package/src/Section/Section.tsx +69 -0
  392. package/src/SegmentedControl/SegmentedControl.test.tsx +31 -0
  393. package/src/SegmentedControl/SegmentedControlItem.tsx +11 -2
  394. package/src/SelectableCard/SelectableCard.tsx +1 -1
  395. package/src/Selector/Selector.doc.mjs +16 -2
  396. package/src/Selector/Selector.test.tsx +525 -1
  397. package/src/Selector/Selector.tsx +166 -21
  398. package/src/Selector/SelectorOption.doc.mjs +7 -0
  399. package/src/Selector/SelectorOption.tsx +21 -0
  400. package/src/Selector/SelectorRowLayoutContext.ts +32 -0
  401. package/src/Selector/types.ts +4 -4
  402. package/src/SideNav/SideNavHeading.tsx +2 -2
  403. package/src/SideNav/SideNavItem.tsx +1 -1
  404. package/src/Slider/Slider.tsx +11 -1
  405. package/src/Stack/Stack.doc.mjs +72 -0
  406. package/src/Stack/Stack.test.tsx +156 -0
  407. package/src/Stack/Stack.tsx +50 -8
  408. package/src/StatusDot/StatusDot.doc.mjs +13 -0
  409. package/src/StatusDot/StatusDot.test.tsx +115 -8
  410. package/src/StatusDot/StatusDot.tsx +74 -9
  411. package/src/Switch/Switch.tsx +6 -0
  412. package/src/TabList/TabMenu.tsx +1 -1
  413. package/src/Table/TableRow.tsx +4 -4
  414. package/src/Table/plugins/columnResize/useTableColumnResize.tsx +2 -1
  415. package/src/Table/plugins/groupedRows/useTableGroupedRows.tsx +2 -1
  416. package/src/Table/plugins/rowExpansion/useTableRowExpansion.tsx +22 -4
  417. package/src/Table/plugins/sortable/useTableSortableState.test.tsx +34 -0
  418. package/src/Table/plugins/sortable/useTableSortableState.tsx +26 -23
  419. package/src/Table/plugins/tree/useTableTreeData.tsx +2 -2
  420. package/src/TextArea/TextArea.doc.mjs +1 -1
  421. package/src/TextArea/TextArea.tsx +3 -1
  422. package/src/TextInput/TextInput.tsx +3 -1
  423. package/src/Thumbnail/Thumbnail.tsx +1 -1
  424. package/src/TimeInput/TimeInput.tsx +3 -1
  425. package/src/Timestamp/Timestamp.test.tsx +27 -7
  426. package/src/Timestamp/Timestamp.tsx +8 -4
  427. package/src/Timestamp/formatInstant.ts +9 -7
  428. package/src/Timestamp/tooltipEntries.test.ts +11 -6
  429. package/src/Timestamp/tooltipEntries.ts +6 -2
  430. package/src/Token/Token.tsx +1 -1
  431. package/src/Tooltip/Tooltip.doc.mjs +18 -0
  432. package/src/Tooltip/Tooltip.test.tsx +254 -1
  433. package/src/Tooltip/Tooltip.tsx +22 -2
  434. package/src/Tooltip/index.ts +1 -0
  435. package/src/Tooltip/useTooltip.doc.mjs +2 -0
  436. package/src/Tooltip/useTooltip.tsx +99 -21
  437. package/src/TopNav/TopNavHeading.tsx +1 -1
  438. package/src/TopNav/TopNavItem.tsx +2 -2
  439. package/src/TopNav/TopNavMegaMenu.tsx +1 -1
  440. package/src/TopNav/TopNavMegaMenuItem.tsx +1 -1
  441. package/src/TopNav/TopNavMenu.tsx +2 -2
  442. package/src/TreeList/TreeListItem.tsx +1 -1
  443. package/src/hooks/containerReveal.stylex.ts +54 -18
  444. package/src/hooks/scrollbarGutter.test.ts +167 -0
  445. package/src/hooks/scrollbarGutter.ts +121 -0
  446. package/src/hooks/useResolvedRequired.ts +42 -0
  447. package/src/hooks/useScrollLock.doc.mjs +4 -4
  448. package/src/hooks/useScrollLock.test.ts +73 -0
  449. package/src/hooks/useScrollLock.ts +14 -0
  450. package/src/i18n/InternationalizationContext.ts +2 -0
  451. package/src/i18n/__tests__/e2e-powersearch.test.tsx +37 -1
  452. package/src/i18n/__tests__/useCollator.test.tsx +115 -0
  453. package/src/i18n/__tests__/useLocale.test.tsx +52 -0
  454. package/src/i18n/index.ts +6 -0
  455. package/src/i18n/useCollator.doc.mjs +84 -0
  456. package/src/i18n/useCollator.ts +44 -0
  457. package/src/i18n/useLocale.doc.mjs +70 -0
  458. package/src/i18n/useLocale.ts +34 -0
  459. package/src/i18n/useTranslator.doc.mjs +1 -1
  460. package/src/theme/defineTheme.test.ts +9 -3
  461. package/src/theme/defineTheme.ts +5 -0
  462. package/src/theme/derivedVarRegistry.test.ts +19 -5
  463. package/src/theme/derivedVarRegistry.ts +4 -0
  464. package/src/theme/generateThemeRules.test.ts +118 -0
  465. package/src/theme/generateThemeRules.ts +83 -5
  466. package/src/utils/dateParser.test.ts +20 -0
  467. package/src/utils/dateParser.ts +14 -7
  468. package/src/utils/plainDate.test.ts +56 -0
  469. package/src/utils/plainDate.ts +17 -4
@@ -15,9 +15,9 @@
15
15
  * - /apps/storybook/stories/DateRangeInput.stories.tsx (storybook stories)
16
16
  * - /packages/cli/assets/templates/blocks/components/DateRangeInput/ (showcase blocks)
17
17
  */
18
- import { useId, useCallback, useMemo, useOptimistic, useTransition } from 'react';
18
+ import { use, useId, useCallback, useMemo, useOptimistic, useTransition } from 'react';
19
19
  import * as stylex from '@stylexjs/stylex';
20
- import { plainDateFromISO, plainDateToday, plainDateFormat, DATE_FORMAT_SHORT, DATE_FORMAT_SHORT_WITH_YEAR } from "../utils/plainDate.js";
20
+ import { plainDateFromISO, plainDateToday, plainDateFormat, plainDateDiffDays, DATE_FORMAT_SHORT, DATE_FORMAT_SHORT_WITH_YEAR } from "../utils/plainDate.js";
21
21
  import "../theme/tokens.stylex.js";
22
22
  import { colorVars, sizeVars, radiusVars, spacingVars, typographyVars, typeScaleVars, borderVars } from "../theme/tokens.stylex.js";
23
23
  import { Field, InputClearButton, inputWrapperStyles, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputStatusFocusWithinStyles } from "../Field/index.js";
@@ -29,10 +29,11 @@ import { useTooltip } from "../Tooltip/index.js";
29
29
  import { mergeProps } from "../utils/index.js";
30
30
  import { useSize } from "../SizeContext/SizeContext.js";
31
31
  import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
32
+ import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
32
33
  import { themeProps } from "../utils/themeProps.js";
33
34
  import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
34
35
  import { stableClassName } from "../naming.js";
35
- import { useTranslator } from "../i18n/index.js";
36
+ import { useTranslator, InternationalizationContext } from "../i18n/index.js";
36
37
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
37
38
  const styles = {
38
39
  iconButton: {
@@ -60,7 +61,7 @@ const styles = {
60
61
  kMzoRj: "xc342km",
61
62
  ksu8eU: "xng3xce",
62
63
  kaIpWk: "xh6dtrn",
63
- kWkggS: "xjbqb8w xe9uy6x",
64
+ kWkggS: "xjbqb8w xoevpu5",
64
65
  kMv6JI: "x9ynric",
65
66
  kGuDYH: "xcr08ib",
66
67
  kLWn49: "x1kq96og",
@@ -73,6 +74,12 @@ const styles = {
73
74
  kWkggS: "xgcxg3y",
74
75
  kMwMTN: "xqwr325",
75
76
  $$css: true
77
+ },
78
+ presetButtonDisabled: {
79
+ kMwMTN: "xnbbluu",
80
+ kkrTdU: "x1h6gzvc",
81
+ kWkggS: "xjbqb8w",
82
+ $$css: true
76
83
  }
77
84
  };
78
85
  const sizeStyles = {
@@ -92,7 +99,7 @@ const sizeStyles = {
92
99
  $$css: true
93
100
  }
94
101
  };
95
- function formatRangeDisplay(range) {
102
+ function formatRangeDisplay(range, locale) {
96
103
  if (!range) {
97
104
  return '';
98
105
  }
@@ -101,7 +108,7 @@ function formatRangeDisplay(range) {
101
108
  const currentYear = plainDateToday().year;
102
109
  const sameYear = start.year === end.year && start.year === currentYear;
103
110
  const fmt = sameYear ? DATE_FORMAT_SHORT : DATE_FORMAT_SHORT_WITH_YEAR;
104
- return `${plainDateFormat(start, fmt)} – ${plainDateFormat(end, fmt)}`;
111
+ return `${plainDateFormat(start, fmt, locale)} – ${plainDateFormat(end, fmt, locale)}`;
105
112
  }
106
113
  function isRangeEqual(a, b) {
107
114
  if (a === b) {
@@ -112,6 +119,24 @@ function isRangeEqual(a, b) {
112
119
  }
113
120
  return a.start === b.start && a.end === b.end;
114
121
  }
122
+
123
+ // A preset that would land outside the span bounds is disabled rather than
124
+ // allowed to override them: the cap is authoritative, so an out-of-window
125
+ // preset stays visible (discoverable) but non-committable, mirroring how the
126
+ // calendar disables out-of-window days. Spans count both endpoints.
127
+ function isRangeWithinSpan(range, maxRangeSpan, minRangeSpan) {
128
+ if (maxRangeSpan == null && minRangeSpan == null) {
129
+ return true;
130
+ }
131
+ const span = Math.abs(plainDateDiffDays(plainDateFromISO(range.start), plainDateFromISO(range.end))) + 1;
132
+ if (maxRangeSpan != null && span > maxRangeSpan) {
133
+ return false;
134
+ }
135
+ if (minRangeSpan != null && span < minRangeSpan) {
136
+ return false;
137
+ }
138
+ return true;
139
+ }
115
140
  /**
116
141
  * A date range picker with a button trigger that opens a popover
117
142
  * containing a dual-month calendar and optional preset ranges.
@@ -143,6 +168,8 @@ export function DateRangeInput({
143
168
  min,
144
169
  max,
145
170
  dateConstraints,
171
+ maxRangeSpan,
172
+ minRangeSpan,
146
173
  presets,
147
174
  hasClear = true,
148
175
  placeholder: placeholderFromProps,
@@ -160,6 +187,13 @@ export function DateRangeInput({
160
187
  ...rest
161
188
  }) {
162
189
  const t = useTranslator();
190
+ const isEffectivelyRequired = useResolvedRequired({
191
+ isRequired,
192
+ isOptional
193
+ });
194
+ const {
195
+ locale
196
+ } = use(InternationalizationContext);
163
197
  const placeholder = placeholderFromProps ?? t('@astryx.dateRangeInput.placeholder');
164
198
  const size = useSize(sizeProp, 'md');
165
199
  const id = useId();
@@ -195,7 +229,7 @@ export function DateRangeInput({
195
229
  // The tooltip variant renders no message box; describe the input by the
196
230
  // tooltip's content instead so the status is still announced.
197
231
  statusTooltipDescribedBy, showsDisabledMessage ? disabledMessageTooltip.describedBy : null].filter(Boolean).join(' ') || undefined;
198
- const displayValue = useMemo(() => formatRangeDisplay(optimisticValue), [optimisticValue]);
232
+ const displayValue = useMemo(() => formatRangeDisplay(optimisticValue, locale), [optimisticValue, locale]);
199
233
  const popover = usePopover({
200
234
  dialogLabel: t('@astryx.dateRangeInput.dialogLabel'),
201
235
  closeButtonLabel: t('@astryx.dateInput.closeCalendar')
@@ -293,7 +327,7 @@ export function DateRangeInput({
293
327
  "aria-disabled": showsDisabledMessage ? 'true' : undefined,
294
328
  "aria-label": triggerAriaLabel,
295
329
  "aria-describedby": ariaDescribedBy,
296
- "aria-required": isRequired === true ? 'true' : undefined,
330
+ "aria-required": isEffectivelyRequired ? 'true' : undefined,
297
331
  "aria-invalid": status?.type === 'error' ? 'true' : undefined,
298
332
  "aria-busy": isBusy || undefined,
299
333
  "aria-expanded": popover.isOpen,
@@ -336,6 +370,7 @@ export function DateRangeInput({
336
370
  children: presets.map(preset => {
337
371
  const presetRange = preset.getRange();
338
372
  const isActive = isRangeEqual(value, presetRange);
373
+ const isPresetDisabled = !isRangeWithinSpan(presetRange, maxRangeSpan, minRangeSpan);
339
374
  return /*#__PURE__*/_jsx("button", {
340
375
  type: "button"
341
376
  // These presets are independent action buttons navigated by
@@ -345,8 +380,9 @@ export function DateRangeInput({
345
380
  // concept that contradicted the Tab interaction) (forms-5).
346
381
  ,
347
382
  "aria-current": isActive ? 'true' : undefined,
383
+ disabled: isPresetDisabled,
348
384
  onClick: () => handlePresetClick(preset),
349
- ...stylex.props(focusOutlineStyles.focusVisible, styles.presetButton, isActive && styles.presetButtonActive),
385
+ ...stylex.props(focusOutlineStyles.focusVisible, styles.presetButton, isActive && styles.presetButtonActive, isPresetDisabled && styles.presetButtonDisabled),
350
386
  children: preset.label
351
387
  }, preset.label);
352
388
  })
@@ -357,6 +393,8 @@ export function DateRangeInput({
357
393
  min: min,
358
394
  max: max,
359
395
  dateConstraints: dateConstraints,
396
+ maxRangeSpan: maxRangeSpan,
397
+ minRangeSpan: minRangeSpan,
360
398
  numberOfMonths: numberOfMonths,
361
399
  weekStartsOn: weekStartsOn
362
400
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"DateTimeInput.d.ts","sourceRoot":"","sources":["../../src/DateTimeInput/DateTimeInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,EAKjB,MAAM,UA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H,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,IAAI,CAAC,EAAE,iBAAiB,CAAC;IAEzB;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAC;IAErB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;OAGG;IACH,cAAc,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IAEvB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC;CAC1C;AAqCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,aAAqB,EACrB,WAAW,EACX,UAAkB,EAClB,UAAkB,EAClB,UAAkB,EAClB,eAAe,EACf,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,SAAiB,EACjB,GAAG,EACH,GAAG,EACH,eAAe,EACf,UAAkB,EAClB,UAAkB,EAClB,aAAiB,EACjB,QAAgB,EAChB,WAAW,EAAE,oBAAoB,EACjC,eAAe,EAAE,wBAAwB,EACzC,SAAS,EACT,IAAI,EAAE,QAAQ,EACd,MAAM,EACN,YAAY,EACZ,cAAkB,EAClB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,kBAAkB,+BAisBpB;yBAluBe,aAAa"}
@@ -15,7 +15,7 @@
15
15
  * - /apps/storybook/stories/DateTimeInput.stories.tsx (storybook stories)
16
16
  * - /packages/cli/assets/templates/blocks/components/DateTimeInput/ (showcase blocks)
17
17
  */
18
- import { useId, useState, useCallback, useRef, useMemo, useOptimistic, useTransition } from 'react';
18
+ import { use, useId, useState, useCallback, useRef, useMemo, useOptimistic, useTransition } from 'react';
19
19
  import * as stylex from '@stylexjs/stylex';
20
20
  import "../theme/tokens.stylex.js";
21
21
  import { colorVars, sizeVars, radiusVars, spacingVars, typographyVars, typeScaleVars } from "../theme/tokens.stylex.js";
@@ -32,10 +32,11 @@ import { useInputStatusIcon } from "../hooks/useInputStatusIcon.js";
32
32
  import { parseDateInput, parseTimeInput, formatDisplayTime12h, formatDisplayTime24h, formatISOTime, isTimeInRange, adjustTime, isImeKeyEvent, mergeProps, mergeRefs, isFocusDetached } from "../utils/index.js";
33
33
  import { plainDateFromISO, plainDateToISO, plainDateFormat, DATE_FORMAT_LONG } from "../utils/plainDate.js";
34
34
  import { useAnnounce } from "../hooks/useAnnounce.js";
35
+ import { useResolvedRequired } from "../hooks/useResolvedRequired.js";
35
36
  import { useSize } from "../SizeContext/SizeContext.js";
36
37
  import { themeProps } from "../utils/themeProps.js";
37
38
  import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
38
- import { useTranslator } from "../i18n/index.js";
39
+ import { useTranslator, InternationalizationContext } from "../i18n/index.js";
39
40
 
40
41
  /** Supported minute increments for arrow-key stepping of the time field. */
41
42
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -170,6 +171,13 @@ export function DateTimeInput({
170
171
  ...rest
171
172
  }) {
172
173
  const t = useTranslator();
174
+ const isEffectivelyRequired = useResolvedRequired({
175
+ isRequired,
176
+ isOptional
177
+ });
178
+ const {
179
+ locale
180
+ } = use(InternationalizationContext);
173
181
  // Speaks arrow-key stepping results through the persistent live regions:
174
182
  // stepping programmatically rewrites a plain textbox's value, which screen
175
183
  // readers do not announce on their own (WCAG 4.1.2).
@@ -262,8 +270,8 @@ export function DateTimeInput({
262
270
  }
263
271
  }
264
272
  }
265
- const dateDisplayValue = datePendingInput !== null ? datePendingInput : valueParts.date && /^\d{4}-\d{2}-\d{2}$/.test(valueParts.date) ? plainDateFormat(plainDateFromISO(valueParts.date), DATE_FORMAT_LONG) : '';
266
- const isDateInputValid = datePendingInput === null || !datePendingInput.trim() ? true : parseDateInput(datePendingInput) !== null;
273
+ const dateDisplayValue = datePendingInput !== null ? datePendingInput : valueParts.date && /^\d{4}-\d{2}-\d{2}$/.test(valueParts.date) ? plainDateFormat(plainDateFromISO(valueParts.date), DATE_FORMAT_LONG, locale) : '';
274
+ const isDateInputValid = datePendingInput === null || !datePendingInput.trim() ? true : parseDateInput(datePendingInput, locale) !== null;
267
275
 
268
276
  // --- Time input state ---
269
277
  const [timePendingInput, setTimePendingInput] = useState(null);
@@ -371,14 +379,14 @@ export function DateTimeInput({
371
379
  }
372
380
  const text = e.target.value;
373
381
  setDatePendingInput(text);
374
- const parsed = parseDateInput(text);
382
+ const parsed = parseDateInput(text, locale);
375
383
  if (parsed && plainDateToISO(parsed) !== valueParts.date && !isDateDisabled(parsed)) {
376
384
  const parsedISO = plainDateToISO(parsed);
377
385
  lastFiredDateRef.current = parsedISO;
378
386
  handleDateChange(parsedISO, 'input');
379
387
  calendarRef.current?.navigateTo(parsedISO);
380
388
  }
381
- }, [valueParts.date, isDateDisabled, handleDateChange, isEffectivelyDisabled]);
389
+ }, [valueParts.date, isDateDisabled, handleDateChange, isEffectivelyDisabled, locale]);
382
390
  const commitDatePendingInput = useCallback(() => {
383
391
  if (datePendingInput === null) {
384
392
  return;
@@ -390,7 +398,7 @@ export function DateTimeInput({
390
398
  setDatePendingInput(null);
391
399
  return;
392
400
  }
393
- const parsed = parseDateInput(datePendingInput);
401
+ const parsed = parseDateInput(datePendingInput, locale);
394
402
  if (parsed && !isDateDisabled(parsed)) {
395
403
  const parsedISO = plainDateToISO(parsed);
396
404
  if (parsedISO !== valueParts.date) {
@@ -398,7 +406,7 @@ export function DateTimeInput({
398
406
  }
399
407
  }
400
408
  setDatePendingInput(null);
401
- }, [datePendingInput, value, valueParts.date, fireChange, isDateDisabled, handleDateChange]);
409
+ }, [datePendingInput, value, valueParts.date, fireChange, isDateDisabled, handleDateChange, locale]);
402
410
  const handleDateBlur = useCallback(() => {
403
411
  commitDatePendingInput();
404
412
  }, [commitDatePendingInput]);
@@ -597,7 +605,7 @@ export function DateTimeInput({
597
605
  "aria-disabled": showsDisabledMessage ? 'true' : undefined,
598
606
  readOnly: showsDisabledMessage || undefined,
599
607
  "aria-describedby": ariaDescribedBy,
600
- "aria-required": isRequired === true ? 'true' : undefined,
608
+ "aria-required": isEffectivelyRequired ? 'true' : undefined,
601
609
  "aria-invalid": status?.type === 'error' || !isDateInputValid ? 'true' : undefined,
602
610
  "aria-busy": isBusy || undefined,
603
611
  "aria-expanded": popover.isOpen,
@@ -676,7 +684,7 @@ export function DateTimeInput({
676
684
  label
677
685
  }),
678
686
  "aria-describedby": ariaDescribedBy,
679
- "aria-required": isRequired === true ? 'true' : undefined,
687
+ "aria-required": isEffectivelyRequired ? 'true' : undefined,
680
688
  "aria-invalid": status?.type === 'error' || !isTimeInputValid ? 'true' : undefined,
681
689
  "aria-busy": isBusy || undefined,
682
690
  ...{
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.d.ts","sourceRoot":"","sources":["../../src/Dialog/Dialog.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAML,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAqB5C,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAKhD,OAAO,KAAK,EAAC,gBAAgB,EAAC,MAAM,SAAS,CAAC;AAsB9C;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,gBAAgB,CAAC;AAEnD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,CAAC;AAEzD,4EAA4E;AAC5E,UAAU,mBAAmB;IAC3B,GAAG,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACtB,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED;;;;;GAK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AAO,CAAC;IAE3C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAExB;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAE5B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAEpC;;;;;OAKG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IAExB;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IAEtB;;;OAGG;IACH,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,MAAM,CAAC,EACrB,MAAM,EACN,QAAgB,EAChB,YAAY,EACZ,KAAW,EACX,SAAkB,EAClB,QAAQ,EACR,OAAoB,EACpB,OAAgB,EAChB,OAAO,EACP,QAAQ,EACR,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,WAAW,sCA6Sb;yBA7Te,MAAM"}
@@ -23,7 +23,7 @@ import { isImeKeyEvent } from "../utils/ime.js";
23
23
  import "../theme/tokens.stylex.js";
24
24
  import { colorVars, radiusVars, durationVars, easeVars, shadowVars } from "../theme/tokens.stylex.js";
25
25
  import { container } from "../Layout/container.stylex.js";
26
- import { paddingStyles, containerPaddingInlineVarStyles, containerPaddingBlockStartVarStyles, containerPaddingBlockEndVarStyles, spacingStepToToken } from "../Layout/padding.stylex.js";
26
+ import { paddingStyles, containerPaddingInlineVarStyles, containerPaddingBlockStartVarStyles, containerPaddingBlockEndVarStyles, spacingStepToToken, overlayPaddingReset } from "../Layout/padding.stylex.js";
27
27
  import { mergeProps, mergeRefs } from "../utils/index.js";
28
28
  import { devWarn } from "../utils/devWarning.js";
29
29
  import { DialogContext } from "./DialogContext.js";
@@ -435,7 +435,7 @@ export function Dialog({
435
435
  ...safeProps,
436
436
  ...mergeProps(themeProps('dialog', {
437
437
  variant
438
- }), stylex.props(styles.inlineWrapper, !isFullscreen && dynamicStyles.sizing(width, maxHeight), isFullscreen && styles.fullscreen, xstyle), className, style),
438
+ }), stylex.props(styles.inlineWrapper, overlayPaddingReset.reset, !isFullscreen && dynamicStyles.sizing(width, maxHeight), isFullscreen && styles.fullscreen, xstyle), className, style),
439
439
  "data-testid": props['data-testid'],
440
440
  children: innerContent
441
441
  });
@@ -448,7 +448,7 @@ export function Dialog({
448
448
  ...safeProps,
449
449
  ...mergeProps(themeProps('dialog', {
450
450
  variant
451
- }), focusOutlineProps.focusVisible(styles.dialog, isOpen && styles.open, styles.backdrop, !isFullscreen && dynamicStyles.sizing(width, maxHeight), hasPosition && (() => {
451
+ }), focusOutlineProps.focusVisible(styles.dialog, overlayPaddingReset.reset, isOpen && styles.open, styles.backdrop, !isFullscreen && dynamicStyles.sizing(width, maxHeight), hasPosition && (() => {
452
452
  const o = resolveDialogPositionOffsets(position);
453
453
  return dynamicStyles.position(o.top, o.insetInlineStart, o.insetInlineEnd, o.bottom);
454
454
  })(), isFullscreen && styles.fullscreen, xstyle), className, style),
@@ -1,12 +1,13 @@
1
1
  /**
2
2
  * @file FieldLabel.tsx
3
- * @input Uses React, Icon, IconType, useTranslator
3
+ * @input Uses React, Icon, IconType, useTranslator, FormLayoutContext
4
4
  * @output Exports FieldLabel component, FieldLabelProps
5
5
  * @position Core label implementation; used by Field, CheckboxInput, Switch
6
6
  *
7
7
  * SYNC: When modified, update these files to stay in sync:
8
8
  * - /packages/core/src/Field/Field.doc.mjs (props table, features, implementation notes)
9
9
  * - /packages/core/src/Field/index.ts (exports if types change)
10
+ * - /packages/core/src/FormLayout/FormLayoutContext.ts (defaultOptionality drives the indicator)
10
11
  * - /packages/cli/assets/templates/blocks/components/Field/ (showcase blocks)
11
12
  * - /packages/core/locales/en.json (@astryx.field.required / @astryx.field.optional)
12
13
  */
@@ -1 +1 @@
1
- {"version":3,"file":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AkB,EAClB,UAAkB,EAClB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,aAAa,EACb,SAAS,EACT,KAAK,EACL,MAAM,EACN,GAAG,EACH,GAAG,IAAI,EACR,EAAE,eAAe,+BAsHjB;yBAxIe,UAAU"}
@@ -4,17 +4,18 @@
4
4
 
5
5
  /**
6
6
  * @file FieldLabel.tsx
7
- * @input Uses React, Icon, IconType, useTranslator
7
+ * @input Uses React, Icon, IconType, useTranslator, FormLayoutContext
8
8
  * @output Exports FieldLabel component, FieldLabelProps
9
9
  * @position Core label implementation; used by Field, CheckboxInput, Switch
10
10
  *
11
11
  * SYNC: When modified, update these files to stay in sync:
12
12
  * - /packages/core/src/Field/Field.doc.mjs (props table, features, implementation notes)
13
13
  * - /packages/core/src/Field/index.ts (exports if types change)
14
+ * - /packages/core/src/FormLayout/FormLayoutContext.ts (defaultOptionality drives the indicator)
14
15
  * - /packages/cli/assets/templates/blocks/components/Field/ (showcase blocks)
15
16
  * - /packages/core/locales/en.json (@astryx.field.required / @astryx.field.optional)
16
17
  */
17
- import { useMemo, useRef } from 'react';
18
+ import { use, useMemo, useRef } from 'react';
18
19
  import * as stylex from '@stylexjs/stylex';
19
20
  import { mergeProps } from "../utils/index.js";
20
21
  import "../theme/tokens.stylex.js";
@@ -24,6 +25,7 @@ import { Tooltip } from "../Tooltip/index.js";
24
25
  import { useTranslator } from "../i18n/index.js";
25
26
  import { themeProps } from "../utils/themeProps.js";
26
27
  import { useInputContainer } from "../hooks/index.js";
28
+ import { FormLayoutContext } from "../FormLayout/FormLayoutContext.js";
27
29
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
28
30
  const styles = {
29
31
  label: {
@@ -93,7 +95,23 @@ export function FieldLabel({
93
95
  ...rest
94
96
  }) {
95
97
  const t = useTranslator();
96
- const statusText = isOptional ? t('@astryx.field.optional') : isRequired ? t('@astryx.field.required') : null;
98
+ const {
99
+ defaultOptionality
100
+ } = use(FormLayoutContext);
101
+
102
+ // A form-level `defaultOptionality` means "only the exception is marked": a
103
+ // field that merely restates the form's default shows no indicator, and only
104
+ // a deviation from it does. This is the *visible indicator* only; the
105
+ // matching `aria-required` is resolved on each control (see
106
+ // useResolvedRequired) so the unmarked majority is still announced.
107
+ //
108
+ // defaultOptionality isRequired isOptional
109
+ // 'optional' → required indicator → (matches default, hidden)
110
+ // 'required' → (matches, hidden) → optional indicator
111
+ // unset → required indicator → optional indicator
112
+ const showRequired = isRequired && defaultOptionality !== 'required';
113
+ const showOptional = isOptional && defaultOptionality !== 'optional';
114
+ const statusText = showOptional ? t('@astryx.field.optional') : showRequired ? t('@astryx.field.required') : null;
97
115
 
98
116
  // A group label (e.g. for a radiogroup) must not be a literal `<label>`
99
117
  // element: a `<label>` semantically names a single form control and can't be
@@ -7,7 +7,8 @@
7
7
  * TextInput, NumberInput, TimeInput, DateInput, DateTimeInput,
8
8
  * DateRangeInput, Selector, MultiSelector, Typeahead, Tokenizer, FileInput —
9
9
  * routes it through here, so the glyph is themed in one place via the
10
- * `astryx-input-clear-icon` target.
10
+ * `astryx-input-clear-icon` target and the button wrapper is themed via the
11
+ * `astryx-input-clear-button` target.
11
12
  */
12
13
  import type { ReactNode } from 'react';
13
14
  import * as stylex from '@stylexjs/stylex';
@@ -1 +1 @@
1
- {"version":3,"file":"InputClearButton.d.ts","sourceRoot":"","sources":["../../src/Field/InputClearButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAY3C,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;IAC7B;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,OAAO,EACP,MAAM,EACN,aAAa,GACd,EAAE,qBAAqB,GAAG,SAAS,CAwBnC;yBA7Be,gBAAgB"}
1
+ {"version":3,"file":"InputClearButton.d.ts","sourceRoot":"","sources":["../../src/Field/InputClearButton.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAkD3C,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC1D,MAAM,CAAC,EAAE,MAAM,CAAC,YAAY,CAAC;IAC7B;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,gBAAgB,CAAC,EAC/B,KAAK,EACL,OAAO,EACP,MAAM,EACN,aAAa,GACd,EAAE,qBAAqB,GAAG,SAAS,CA0BnC;yBA/Be,gBAAgB"}
@@ -11,7 +11,8 @@
11
11
  * TextInput, NumberInput, TimeInput, DateInput, DateTimeInput,
12
12
  * DateRangeInput, Selector, MultiSelector, Typeahead, Tokenizer, FileInput —
13
13
  * routes it through here, so the glyph is themed in one place via the
14
- * `astryx-input-clear-icon` target.
14
+ * `astryx-input-clear-icon` target and the button wrapper is themed via the
15
+ * `astryx-input-clear-button` target.
15
16
  */
16
17
  import * as stylex from '@stylexjs/stylex';
17
18
  import { Button } from "../Button/index.js";
@@ -22,6 +23,12 @@ const styles = {
22
23
  button: {
23
24
  kZKoxP: "x1qx5ct2",
24
25
  kmuXW: "x2lah0s",
26
+ kVAEAm: "x1n2onr6",
27
+ "--_input-clear-hit-inset": "xtoycft x181bpwf",
28
+ "--_input-clear-hit-content": "xqxtgf4 xp8r40j",
29
+ k5JduY: "xh3pasq",
30
+ kwXMNM: "x1j6awrg",
31
+ kv0HGH: "xht581f",
25
32
  $$css: true
26
33
  }
27
34
  };
@@ -34,10 +41,14 @@ export function InputClearButton({
34
41
  const {
35
42
  className: iconTargetClassName
36
43
  } = themeProps('input-clear-icon');
44
+ const {
45
+ className: buttonTargetClassName
46
+ } = themeProps('input-clear-button');
37
47
  return /*#__PURE__*/_jsx(Button, {
38
48
  variant: "ghost",
39
49
  size: "sm",
40
50
  label: label,
51
+ className: buttonTargetClassName,
41
52
  icon: /*#__PURE__*/_jsx(Icon, {
42
53
  icon: "close",
43
54
  size: "sm",
@@ -1 +1 @@
1
- {"version":3,"file":"inputStyles.stylex.d.ts","sourceRoot":"","sources":["../../src/Field/inputStyles.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAW3C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyC7B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;EAUlC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;EAyBvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;EAmBvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;EAmBjC,CAAC"}
1
+ {"version":3,"file":"inputStyles.stylex.d.ts","sourceRoot":"","sources":["../../src/Field/inputStyles.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAW3C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0C7B,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;EAUlC,CAAC;AAEH;;;GAGG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;;;;;;;EA4BvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,4BAA4B;;;;;;;;;;EAmBvC,CAAC;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;EAmBjC,CAAC"}
@@ -41,7 +41,7 @@ export const inputWrapperStyles = {
41
41
  k1ekBW: "x12zzom9",
42
42
  kIyJzY: "xuedmi6 x12w9bfk",
43
43
  kAMwcw: "xlr8y92",
44
- kGVxlE: "x1gnnqk1 x12y27fx xuihb5h",
44
+ kGVxlE: "x1gnnqk1 x1xqjsvb xuihb5h",
45
45
  kI3sdo: "x1a2a7pz",
46
46
  $$css: true
47
47
  },
@@ -79,15 +79,15 @@ export const inputStatusBorderStyles = {
79
79
  */
80
80
  export const inputStatusHoverShadowStyles = {
81
81
  warning: {
82
- kGVxlE: "x1gnnqk1 xnoa3fc",
82
+ kGVxlE: "x1gnnqk1 x9156jc",
83
83
  $$css: true
84
84
  },
85
85
  error: {
86
- kGVxlE: "x1gnnqk1 xl68szm",
86
+ kGVxlE: "x1gnnqk1 x1bgmis8",
87
87
  $$css: true
88
88
  },
89
89
  success: {
90
- kGVxlE: "x1gnnqk1 xig9bu2",
90
+ kGVxlE: "x1gnnqk1 x8wp45d",
91
91
  $$css: true
92
92
  }
93
93
  };
@@ -1 +1 @@
1
- {"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../src/FileInput/FileInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AASlB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,eAAe,IAAI,mBAAmB,GACvC,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC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AE,UAAU,GAAG,OAAO,CAAC;IAC5B;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;;;OAIG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,wBAAgB,SAAS,CAAC,EACxB,KAAK,EACL,aAAqB,EACrB,KAAK,EACL,QAAQ,EACR,YAAY,EACZ,MAAM,EACN,UAAkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAkB,EAClB,eAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,MAAM,EAAE,UAAU,EAClB,aAA0B,EAC1B,WAAW,EACX,WAAW,EACX,IAAc,EACd,UAAkB,EAClB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BA+ZhB;yBA1be,SAAS"}
1
+ {"version":3,"file":"FileInput.d.ts","sourceRoot":"","sources":["../../src/FileInput/FileInput.tsx"],"names":[],"mappings":"AAsCA,OAAO,EAGL,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACxB,MAAM,UAAU,CAAC;AASlB,YAAY,EACV,WAAW,IAAI,eAAe,EAC9B,eAAe,IAAI,mBAAmB,GACvC,MAAM,UAAU,CAAC;AAElB,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAyN9C,MAAM,WAAW,cAAe,SAAQ,IAAI,CAC1C,SAAS,EACT,UAAU,GAAG,cAAc,GAAG,OAAO,CACtC;IACC,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB;;OAEG;IACH,KAAK,EAAE,I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AkB,EAClB,OAAO,EACP,QAAQ,EACR,UAAkB,EAClB,eAAe,EACf,UAAkB,EAClB,SAAiB,EACjB,MAAM,EAAE,UAAU,EAClB,aAA0B,EAC1B,WAAW,EACX,WAAW,EACX,IAAc,EACd,UAAkB,EAClB,YAAY,EACZ,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,IAAI,EACR,EAAE,cAAc,+BA+ZhB;yBA1be,SAAS"}
@@ -111,7 +111,7 @@ const styles = {
111
111
  $$css: true
112
112
  },
113
113
  dropzoneHover: {
114
- kGVxlE: "xw6ruzt",
114
+ kGVxlE: "x1v5wwkd",
115
115
  $$css: true
116
116
  },
117
117
  dropzoneActive: {
@@ -142,7 +142,7 @@ const styles = {
142
142
  k1ekBW: "x12zzom9",
143
143
  kIyJzY: "xuedmi6 x12w9bfk",
144
144
  kAMwcw: "xlr8y92",
145
- kGVxlE: "x1gnnqk1 x70dsy8",
145
+ kGVxlE: "x1gnnqk1 x1telqz2",
146
146
  kkrTdU: "x1ypdohk",
147
147
  kZKoxP: "x1ueg155",
148
148
  kI3sdo: "x1a2a7pz",
@@ -6,13 +6,16 @@
6
6
  *
7
7
  * SYNC: When modified, update these files to stay in sync:
8
8
  * - /packages/core/src/FormLayout/FormLayout.test.tsx (tests for new/changed behavior)
9
+ * - /packages/core/src/FormLayout/FormLayoutContext.ts (context value shape)
10
+ * - /packages/core/src/FormLayout/FormLayout.doc.mjs (props table)
9
11
  * - /packages/core/src/FormLayout/index.ts (exports if types change)
12
+ * - /packages/core/src/Field/FieldLabel.tsx (defaultOptionality indicator resolution)
10
13
  * - /apps/storybook/stories/FormLayout.stories.tsx (storybook stories)
11
14
  * - /packages/cli/assets/templates/blocks/components/FormLayout/ (showcase blocks)
12
15
  */
13
16
  import { type ReactNode } from 'react';
14
17
  import type { BaseProps } from '../BaseProps';
15
- import { type FormLayoutDirection } from './FormLayoutContext';
18
+ import { type FormLayoutDirection, type FormOptionality } from './FormLayoutContext';
16
19
  export interface FormLayoutProps extends BaseProps<HTMLDivElement> {
17
20
  /** Ref forwarded to the root element */
18
21
  ref?: React.Ref<HTMLDivElement>;
@@ -33,6 +36,25 @@ export interface FormLayoutProps extends BaseProps<HTMLDivElement> {
33
36
  * @default 'vertical'
34
37
  */
35
38
  direction?: FormLayoutDirection;
39
+ /**
40
+ * Which state the form treats as its default, so only the *exception*
41
+ * carries a visible optional/required indicator. It also resolves each
42
+ * field's `aria-required` so the unmarked majority is still announced
43
+ * correctly — but only `aria-required`, never the native `required`
44
+ * attribute, so a layout default can't switch on browser validation.
45
+ *
46
+ * - `'optional'` — fields read as optional; only a field with `isRequired`
47
+ * shows an indicator (the "required" one).
48
+ * - `'required'` — fields read as required; only a field with `isOptional`
49
+ * shows an indicator (the "optional" one). Fields without `isOptional`
50
+ * expose `aria-required` even though they show no indicator.
51
+ * - unset — today's behavior: `isRequired` and `isOptional` each show their
52
+ * own indicator independently.
53
+ *
54
+ * A field that merely restates the default (e.g. `isOptional` under
55
+ * `'optional'`) shows nothing. An inner `FormLayout` shadows an outer one.
56
+ */
57
+ defaultOptionality?: FormOptionality;
36
58
  }
37
59
  /**
38
60
  * Spatial layout container for form fields.
@@ -52,7 +74,7 @@ export interface FormLayoutProps extends BaseProps<HTMLDivElement> {
52
74
  * </FormLayout>
53
75
  * ```
54
76
  */
55
- export declare function FormLayout({ children, direction, xstyle, className, style, ref, ...props }: FormLayoutProps): import("react").JSX.Element;
77
+ export declare function FormLayout({ children, direction, defaultOptionality, xstyle, className, style, ref, ...props }: FormLayoutProps): import("react").JSX.Element;
56
78
  export declare namespace FormLayout {
57
79
  var displayName: string;
58
80
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FormLayout.d.ts","sourceRoot":"","sources":["../../src/FormLayout/FormLayout.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAU,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC9C,OAAO,KAAK,EAAC,S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EACR,SAAsB,EACtB,kBAAkB,EAClB,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,eAAe,+BA0BjB;yBAnCe,UAAU"}
@@ -10,7 +10,10 @@
10
10
  *
11
11
  * SYNC: When modified, update these files to stay in sync:
12
12
  * - /packages/core/src/FormLayout/FormLayout.test.tsx (tests for new/changed behavior)
13
+ * - /packages/core/src/FormLayout/FormLayoutContext.ts (context value shape)
14
+ * - /packages/core/src/FormLayout/FormLayout.doc.mjs (props table)
13
15
  * - /packages/core/src/FormLayout/index.ts (exports if types change)
16
+ * - /packages/core/src/Field/FieldLabel.tsx (defaultOptionality indicator resolution)
14
17
  * - /apps/storybook/stories/FormLayout.stories.tsx (storybook stories)
15
18
  * - /packages/cli/assets/templates/blocks/components/FormLayout/ (showcase blocks)
16
19
  */
@@ -86,6 +89,7 @@ const styles = {
86
89
  export function FormLayout({
87
90
  children,
88
91
  direction = 'vertical',
92
+ defaultOptionality,
89
93
  xstyle,
90
94
  className,
91
95
  style,
@@ -93,8 +97,9 @@ export function FormLayout({
93
97
  ...props
94
98
  }) {
95
99
  const contextValue = useMemo(() => ({
96
- direction
97
- }), [direction]);
100
+ direction,
101
+ defaultOptionality
102
+ }), [direction, defaultOptionality]);
98
103
  return /*#__PURE__*/_jsx(FormLayoutContext, {
99
104
  value: contextValue,
100
105
  children: /*#__PURE__*/_jsx("div", {
@@ -8,10 +8,23 @@
8
8
  */
9
9
  export type FormLayoutDirection = 'vertical' | 'horizontal' | 'horizontal-labels';
10
10
  /**
11
- * Context for detecting which form layout direction a component is rendered in.
12
- * Children can use this to adapt their rendering based on the parent layout.
11
+ * Which state a form treats as its default, so only the *exception* carries a
12
+ * visible optional/required indicator.
13
+ *
14
+ * - `'optional'` — fields are optional unless a field opts into `isRequired`;
15
+ * only required fields show an indicator.
16
+ * - `'required'` — fields are required unless a field opts into `isOptional`;
17
+ * only optional fields show an indicator.
18
+ */
19
+ export type FormOptionality = 'optional' | 'required';
20
+ /**
21
+ * Context for detecting which form layout a component is rendered in. Children
22
+ * can use this to adapt their rendering based on the parent layout — direction
23
+ * for spatial arrangement, and `defaultOptionality` so a field can suppress the
24
+ * indicator that merely restates the form-wide default.
13
25
  */
14
26
  export declare const FormLayoutContext: import("react").Context<{
15
27
  direction: FormLayoutDirection;
28
+ defaultOptionality?: FormOptionality;
16
29
  }>;
17
30
  //# sourceMappingURL=FormLayoutContext.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FormLayoutContext.d.ts","sourceRoot":"","sources":["../../src/FormLayout/FormLayoutContext.ts"],"names":[],"mappings":"AAeA;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,YAAY,GACZ,mBAAmB,CAAC;AAExB;;;GAGG;AACH,eAAO,MAAM,iBAAiB;eACjB,mBAAmB;EACL,CAAC"}
1
+ {"version":3,"file":"FormLayoutContext.d.ts","sourceRoot":"","sources":["../../src/FormLayout/FormLayoutContext.ts"],"names":[],"mappings":"AAkBA;;;;;;;GAOG;AACH,MAAM,MAAM,mBAAmB,GAC7B,UAAU,GAAG,YAAY,GAAG,mBAAmB,CAAC;AAElD;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,UAAU,CAAC;AAEtD;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB;eACjB,mBAAmB;yBACT,eAAe;EACX,CAAC"}