@astryxdesign/core 0.4.0 → 0.4.1-canary.1ce0b4c

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 (271) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/dist/AspectRatio/AspectRatio.d.ts.map +1 -1
  3. package/dist/AspectRatio/AspectRatio.js +1 -2
  4. package/dist/AspectRatio/index.d.ts.map +1 -1
  5. package/dist/AspectRatio/index.js +1 -2
  6. package/dist/Badge/Badge.d.ts.map +1 -1
  7. package/dist/Badge/Badge.js +1 -2
  8. package/dist/Badge/index.d.ts.map +1 -1
  9. package/dist/Badge/index.js +1 -2
  10. package/dist/Banner/Banner.d.ts +3 -0
  11. package/dist/Banner/Banner.d.ts.map +1 -1
  12. package/dist/Banner/Banner.js +17 -3
  13. package/dist/Blockquote/Blockquote.d.ts.map +1 -1
  14. package/dist/Blockquote/Blockquote.js +1 -2
  15. package/dist/Blockquote/index.d.ts.map +1 -1
  16. package/dist/Blockquote/index.js +1 -2
  17. package/dist/Button/Button.d.ts.map +1 -1
  18. package/dist/Button/Button.js +11 -9
  19. package/dist/Card/Card.d.ts.map +1 -1
  20. package/dist/Card/Card.js +1 -2
  21. package/dist/Card/index.d.ts.map +1 -1
  22. package/dist/Card/index.js +1 -2
  23. package/dist/Center/Center.d.ts.map +1 -1
  24. package/dist/Center/Center.js +1 -2
  25. package/dist/Center/index.d.ts.map +1 -1
  26. package/dist/Center/index.js +1 -2
  27. package/dist/Code/Code.d.ts.map +1 -1
  28. package/dist/Code/Code.js +1 -2
  29. package/dist/CommandPalette/CommandPalette.d.ts.map +1 -1
  30. package/dist/CommandPalette/CommandPalette.js +5 -0
  31. package/dist/ComplexSelector/ComplexSelector.d.ts.map +1 -1
  32. package/dist/ComplexSelector/ComplexSelector.js +7 -8
  33. package/dist/DateInput/DateInput.d.ts.map +1 -1
  34. package/dist/DateInput/DateInput.js +23 -10
  35. package/dist/DateRangeInput/DateRangeInput.d.ts.map +1 -1
  36. package/dist/DateRangeInput/DateRangeInput.js +44 -16
  37. package/dist/DateTimeInput/DateTimeInput.d.ts.map +1 -1
  38. package/dist/DateTimeInput/DateTimeInput.js +32 -13
  39. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts +1 -1
  40. package/dist/DropdownMenu/DropdownMenuRadioGroup.d.ts.map +1 -1
  41. package/dist/DropdownMenu/DropdownMenuRadioGroup.js +10 -3
  42. package/dist/Field/PanelSearchInput.d.ts +81 -0
  43. package/dist/Field/PanelSearchInput.d.ts.map +1 -0
  44. package/dist/Field/PanelSearchInput.js +151 -0
  45. package/dist/FileInput/FileInput.d.ts.map +1 -1
  46. package/dist/FileInput/FileInput.js +21 -10
  47. package/dist/Grid/Grid.d.ts.map +1 -1
  48. package/dist/Grid/Grid.js +1 -2
  49. package/dist/Grid/index.d.ts.map +1 -1
  50. package/dist/Grid/index.js +1 -2
  51. package/dist/HoverCard/HoverCard.d.ts +1 -1
  52. package/dist/HoverCard/HoverCard.d.ts.map +1 -1
  53. package/dist/HoverCard/HoverCard.js +5 -13
  54. package/dist/HoverCard/useHoverCard.d.ts.map +1 -1
  55. package/dist/HoverCard/useHoverCard.js +6 -5
  56. package/dist/Icon/globalIconRegistry.d.ts +5 -4
  57. package/dist/Icon/globalIconRegistry.d.ts.map +1 -1
  58. package/dist/Icon/globalIconRegistry.js +5 -4
  59. package/dist/Indicator/index.d.ts +1 -1
  60. package/dist/Indicator/index.d.ts.map +1 -1
  61. package/dist/Indicator/types.d.ts +10 -0
  62. package/dist/Indicator/types.d.ts.map +1 -1
  63. package/dist/InputGroup/groupStyles.d.ts.map +1 -1
  64. package/dist/InputGroup/groupStyles.js +7 -2
  65. package/dist/Layer/layerHost.d.ts +24 -0
  66. package/dist/Layer/layerHost.d.ts.map +1 -0
  67. package/dist/Layer/layerHost.js +79 -0
  68. package/dist/Layer/useLayer.d.ts +14 -6
  69. package/dist/Layer/useLayer.d.ts.map +1 -1
  70. package/dist/Layer/useLayer.js +155 -29
  71. package/dist/Lightbox/Lightbox.d.ts.map +1 -1
  72. package/dist/Lightbox/Lightbox.js +24 -50
  73. package/dist/MultiSelector/MultiSelector.d.ts +8 -1
  74. package/dist/MultiSelector/MultiSelector.d.ts.map +1 -1
  75. package/dist/MultiSelector/MultiSelector.js +134 -102
  76. package/dist/NavItem/navItemStyles.stylex.d.ts +17 -5
  77. package/dist/NavItem/navItemStyles.stylex.d.ts.map +1 -1
  78. package/dist/NavItem/navItemStyles.stylex.js +11 -5
  79. package/dist/Popover/usePopover.d.ts +15 -0
  80. package/dist/Popover/usePopover.d.ts.map +1 -1
  81. package/dist/Popover/usePopover.js +14 -2
  82. package/dist/ProgressBar/ProgressBar.d.ts.map +1 -1
  83. package/dist/ProgressBar/ProgressBar.js +2 -3
  84. package/dist/Section/Section.d.ts.map +1 -1
  85. package/dist/Section/Section.js +1 -2
  86. package/dist/Section/index.d.ts.map +1 -1
  87. package/dist/Section/index.js +1 -2
  88. package/dist/Selector/Selector.d.ts +10 -0
  89. package/dist/Selector/Selector.d.ts.map +1 -1
  90. package/dist/Selector/Selector.js +135 -95
  91. package/dist/SideNav/SideNav.d.ts +7 -9
  92. package/dist/SideNav/SideNav.d.ts.map +1 -1
  93. package/dist/SideNav/SideNav.js +32 -5
  94. package/dist/SideNav/SideNavCollapseButton.d.ts +25 -9
  95. package/dist/SideNav/SideNavCollapseButton.d.ts.map +1 -1
  96. package/dist/SideNav/SideNavCollapseButton.js +39 -15
  97. package/dist/SideNav/SideNavCollapseContext.d.ts +21 -0
  98. package/dist/SideNav/SideNavCollapseContext.d.ts.map +1 -1
  99. package/dist/SideNav/SideNavCollapseContext.js +16 -2
  100. package/dist/SideNav/SideNavHeading.d.ts.map +1 -1
  101. package/dist/SideNav/SideNavHeading.js +70 -24
  102. package/dist/SideNav/SideNavItem.d.ts +7 -2
  103. package/dist/SideNav/SideNavItem.d.ts.map +1 -1
  104. package/dist/SideNav/SideNavItem.js +114 -75
  105. package/dist/SideNav/SideNavSection.d.ts.map +1 -1
  106. package/dist/SideNav/SideNavSection.js +7 -16
  107. package/dist/SideNav/index.d.ts +1 -1
  108. package/dist/SideNav/index.d.ts.map +1 -1
  109. package/dist/Skeleton/Skeleton.d.ts.map +1 -1
  110. package/dist/Skeleton/Skeleton.js +1 -2
  111. package/dist/Skeleton/index.d.ts.map +1 -1
  112. package/dist/Skeleton/index.js +1 -2
  113. package/dist/Slider/Slider.d.ts.map +1 -1
  114. package/dist/Slider/Slider.js +2 -6
  115. package/dist/Switch/Switch.d.ts.map +1 -1
  116. package/dist/Switch/Switch.js +3 -3
  117. package/dist/Table/TableRow.d.ts +1 -1
  118. package/dist/Table/TableRow.d.ts.map +1 -1
  119. package/dist/Table/TableRow.js +4 -2
  120. package/dist/TimeInput/TimeInput.d.ts.map +1 -1
  121. package/dist/TimeInput/TimeInput.js +7 -2
  122. package/dist/Timestamp/Timestamp.d.ts.map +1 -1
  123. package/dist/Timestamp/Timestamp.js +14 -3
  124. package/dist/Timestamp/formatInstant.d.ts +11 -1
  125. package/dist/Timestamp/formatInstant.d.ts.map +1 -1
  126. package/dist/Timestamp/formatInstant.js +3 -1
  127. package/dist/TopNav/TopNavMegaMenu.js +1 -1
  128. package/dist/TopNav/TopNavMegaMenuItem.js +1 -1
  129. package/dist/TopNav/TopNavMenu.d.ts.map +1 -1
  130. package/dist/TopNav/TopNavMenu.js +2 -2
  131. package/dist/VisuallyHidden/VisuallyHidden.d.ts.map +1 -1
  132. package/dist/VisuallyHidden/VisuallyHidden.js +1 -2
  133. package/dist/VisuallyHidden/index.d.ts.map +1 -1
  134. package/dist/VisuallyHidden/index.js +1 -2
  135. package/dist/astryx.css +23 -24
  136. package/dist/astryx.umd.js +48 -48
  137. package/dist/astryx.umd.js.map +4 -4
  138. package/dist/hooks/index.d.ts +1 -1
  139. package/dist/hooks/index.d.ts.map +1 -1
  140. package/dist/hooks/index.js +1 -1
  141. package/dist/hooks/useFocusTrap.d.ts.map +1 -1
  142. package/dist/hooks/useFocusTrap.js +16 -2
  143. package/dist/hooks/useInputStatusIcon.d.ts.map +1 -1
  144. package/dist/hooks/useInputStatusIcon.js +17 -4
  145. package/dist/theme/defineTheme.d.ts +2 -2
  146. package/dist/theme/defineTheme.d.ts.map +1 -1
  147. package/dist/theme/defineTheme.js +2 -1
  148. package/dist/theme/index.d.ts +1 -1
  149. package/dist/theme/index.d.ts.map +1 -1
  150. package/dist/theme/index.js +1 -1
  151. package/dist/theme/tokens.stylex.d.ts +12 -0
  152. package/dist/theme/tokens.stylex.d.ts.map +1 -1
  153. package/dist/theme/tokens.stylex.js +23 -0
  154. package/dist/utils/focusOutline.stylex.d.ts +34 -19
  155. package/dist/utils/focusOutline.stylex.d.ts.map +1 -1
  156. package/dist/utils/focusOutline.stylex.js +46 -33
  157. package/dist/utils/index.d.ts +1 -0
  158. package/dist/utils/index.d.ts.map +1 -1
  159. package/dist/utils/index.js +5 -1
  160. package/dist/utils/interactionModality.d.ts +34 -0
  161. package/dist/utils/interactionModality.d.ts.map +1 -0
  162. package/dist/utils/interactionModality.js +70 -0
  163. package/locales/en.json +44 -0
  164. package/locales/pseudo.json +33 -0
  165. package/package.json +3 -3
  166. package/src/AppShell/AppShell.doc.mjs +3 -0
  167. package/src/AspectRatio/AspectRatio.tsx +0 -2
  168. package/src/AspectRatio/index.ts +0 -2
  169. package/src/Badge/Badge.tsx +0 -2
  170. package/src/Badge/index.ts +0 -2
  171. package/src/Banner/Banner.test.tsx +58 -1
  172. package/src/Banner/Banner.tsx +24 -5
  173. package/src/Blockquote/Blockquote.tsx +0 -2
  174. package/src/Blockquote/index.ts +0 -2
  175. package/src/Button/Button.doc.mjs +2 -2
  176. package/src/Button/Button.tsx +10 -7
  177. package/src/ButtonGroup/ButtonGroup.test.tsx +7 -4
  178. package/src/Card/Card.tsx +0 -2
  179. package/src/Card/index.ts +0 -2
  180. package/src/Center/Center.tsx +0 -2
  181. package/src/Center/index.ts +0 -2
  182. package/src/CheckboxInput/CheckboxInput.test.tsx +8 -3
  183. package/src/Code/Code.tsx +0 -2
  184. package/src/CommandPalette/CommandPalette.test.tsx +54 -0
  185. package/src/CommandPalette/CommandPalette.tsx +5 -0
  186. package/src/ComplexSelector/ComplexSelector.test.tsx +15 -6
  187. package/src/ComplexSelector/ComplexSelector.tsx +6 -10
  188. package/src/DateInput/DateInput.test.tsx +19 -0
  189. package/src/DateInput/DateInput.tsx +3 -6
  190. package/src/DateRangeInput/DateRangeInput.tsx +3 -9
  191. package/src/DateTimeInput/DateTimeInput.test.tsx +79 -1
  192. package/src/DateTimeInput/DateTimeInput.tsx +23 -9
  193. package/src/DropdownMenu/DropdownMenuRadioGroup.tsx +2 -1
  194. package/src/Field/PanelSearchInput.tsx +271 -0
  195. package/src/FileInput/FileInput.tsx +21 -8
  196. package/src/Grid/Grid.tsx +0 -2
  197. package/src/Grid/index.ts +0 -2
  198. package/src/HoverCard/HoverCard.doc.mjs +3 -3
  199. package/src/HoverCard/HoverCard.test.tsx +283 -55
  200. package/src/HoverCard/HoverCard.tsx +5 -13
  201. package/src/HoverCard/useHoverCard.tsx +8 -11
  202. package/src/Icon/globalIconRegistry.tsx +5 -4
  203. package/src/Indicator/Indicator.doc.mjs +1 -1
  204. package/src/Indicator/index.ts +1 -0
  205. package/src/Indicator/types.ts +11 -0
  206. package/src/InputGroup/groupStyles.ts +7 -8
  207. package/src/Layer/layerHost.test.ts +99 -0
  208. package/src/Layer/layerHost.ts +141 -0
  209. package/src/Layer/useLayer.doc.mjs +14 -4
  210. package/src/Layer/useLayer.test.tsx +318 -7
  211. package/src/Layer/useLayer.tsx +229 -35
  212. package/src/Lightbox/Lightbox.tsx +2 -11
  213. package/src/MultiSelector/MultiSelector.doc.mjs +9 -0
  214. package/src/MultiSelector/MultiSelector.test.tsx +135 -5
  215. package/src/MultiSelector/MultiSelector.tsx +170 -127
  216. package/src/NavItem/navItemStyles.stylex.ts +31 -5
  217. package/src/Popover/Popover.doc.mjs +2 -0
  218. package/src/Popover/usePopover.tsx +37 -4
  219. package/src/ProgressBar/ProgressBar.tsx +2 -8
  220. package/src/Section/Section.tsx +0 -2
  221. package/src/Section/index.ts +0 -2
  222. package/src/Selector/Selector.doc.mjs +10 -0
  223. package/src/Selector/Selector.test.tsx +386 -2
  224. package/src/Selector/Selector.tsx +182 -122
  225. package/src/SideNav/SideNav.doc.mjs +13 -4
  226. package/src/SideNav/SideNav.test.tsx +771 -2
  227. package/src/SideNav/SideNav.tsx +37 -16
  228. package/src/SideNav/SideNavCollapseButton.doc.mjs +28 -6
  229. package/src/SideNav/SideNavCollapseButton.tsx +67 -15
  230. package/src/SideNav/SideNavCollapseContext.ts +29 -9
  231. package/src/SideNav/SideNavHeading.tsx +28 -10
  232. package/src/SideNav/SideNavItem.doc.mjs +13 -0
  233. package/src/SideNav/SideNavItem.tsx +92 -84
  234. package/src/SideNav/SideNavSection.tsx +6 -20
  235. package/src/SideNav/index.ts +2 -0
  236. package/src/Skeleton/Skeleton.tsx +0 -2
  237. package/src/Skeleton/index.ts +0 -2
  238. package/src/Slider/Slider.tsx +2 -11
  239. package/src/Switch/Switch.tsx +10 -2
  240. package/src/Table/Table.test.tsx +31 -0
  241. package/src/Table/TableRow.tsx +6 -0
  242. package/src/Text/Text.doc.mjs +1 -1
  243. package/src/TimeInput/TimeInput.test.tsx +54 -0
  244. package/src/TimeInput/TimeInput.tsx +17 -2
  245. package/src/Timestamp/Timestamp.test.tsx +125 -30
  246. package/src/Timestamp/Timestamp.tsx +14 -2
  247. package/src/Timestamp/formatInstant.ts +16 -1
  248. package/src/Toolbar/Toolbar.test.tsx +14 -14
  249. package/src/TopNav/TopNavMegaMenu.doc.mjs +5 -0
  250. package/src/TopNav/TopNavMegaMenu.test.tsx +43 -0
  251. package/src/TopNav/TopNavMegaMenu.tsx +4 -1
  252. package/src/TopNav/TopNavMegaMenuItem.tsx +1 -1
  253. package/src/TopNav/TopNavMenu.test.tsx +41 -0
  254. package/src/TopNav/TopNavMenu.tsx +8 -2
  255. package/src/TreeList/TreeList.test.tsx +3 -2
  256. package/src/VisuallyHidden/VisuallyHidden.tsx +0 -2
  257. package/src/VisuallyHidden/index.ts +0 -2
  258. package/src/hooks/index.ts +5 -1
  259. package/src/hooks/useFocusTrap.test.tsx +16 -0
  260. package/src/hooks/useFocusTrap.ts +20 -2
  261. package/src/hooks/useInputStatusIcon.tsx +8 -8
  262. package/src/serverSafeComponents.test.ts +665 -0
  263. package/src/theme/defineTheme.ts +3 -0
  264. package/src/theme/generateThemeRules.test.ts +17 -0
  265. package/src/theme/index.ts +2 -0
  266. package/src/theme/themingTargets.test.ts +152 -26
  267. package/src/theme/tokens.stylex.ts +18 -0
  268. package/src/theme/tokens.test.ts +37 -0
  269. package/src/utils/focusOutline.stylex.ts +37 -23
  270. package/src/utils/index.ts +4 -0
  271. package/src/utils/interactionModality.ts +74 -0
@@ -23,17 +23,18 @@ import { Icon, renderIconSlot } from "../Icon/index.js";
23
23
  import { Field, InputClearButton, inputStatusBorderStyles, inputStatusHoverShadowStyles, inputWrapperStyles } from "../Field/index.js";
24
24
  import { Divider } from "../Divider/index.js";
25
25
  import { Spinner } from "../Spinner/index.js";
26
- import { TextInput } from "../TextInput/index.js";
26
+ import { PanelSearchInput } from "../Field/PanelSearchInput.js";
27
27
  import { CheckboxInput } from "../CheckboxInput/index.js";
28
28
  import { Badge } from "../Badge/index.js";
29
29
  import "../theme/tokens.stylex.js";
30
- import { colorVars, sizeVars, spacingVars, radiusVars, durationVars, easeVars, typographyVars, fontWeightVars, typeScaleVars, borderVars } from "../theme/tokens.stylex.js";
30
+ import { colorVars, sizeVars, spacingVars, radiusVars, durationVars, easeVars, typographyVars, fontWeightVars, typeScaleVars } from "../theme/tokens.stylex.js";
31
31
  import { isOptionData, isDivider, isSection, normalizeOption, getSelectableOptions } from "../Selector/utils.js";
32
32
  import { useMultiCombobox } from "./hooks.js";
33
33
  import { getInputARIA, mergeProps } from "../utils/index.js";
34
34
  import { useAnnounce } from "../hooks/useAnnounce.js";
35
35
  import { useSize } from "../SizeContext/SizeContext.js";
36
36
  import { themeProps } from "../utils/themeProps.js";
37
+ import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
37
38
  import { stableClassName } from "../naming.js";
38
39
  import { groupStyles } from "../InputGroup/groupStyles.js";
39
40
  import { useInputGroup } from "../InputGroup/InputGroupContext.js";
@@ -86,8 +87,6 @@ const styles = {
86
87
  kKwaWg: "x1ilzqfv xq8i9tn",
87
88
  kGVxlE: "x1gnnqk1 x1irk71m x15ysqaf",
88
89
  k63SB2: "x1e4wzip",
89
- kI3sdo: "x1a2a7pz x1irc7jg",
90
- kInvED: "x1wfwxd8 xscfbxq",
91
90
  k1ekBW: "xrafxwg",
92
91
  k3aq6I: "x3oybdh xk4oym4",
93
92
  $$css: true
@@ -97,6 +96,20 @@ const styles = {
97
96
  k3aq6I: "x1c071of x1pdlv7q",
98
97
  $$css: true
99
98
  },
99
+ statusButton: {
100
+ k1xSpc: "x78zum5",
101
+ kGNEyG: "x6s0dn4",
102
+ kjj79g: "xl56j7k",
103
+ kmVPX3: "x1717udv",
104
+ kogj98: "x1ghz6dp",
105
+ kMzoRj: "xc342km",
106
+ ksu8eU: "xng3xce",
107
+ kWkggS: "xjbqb8w",
108
+ kMwMTN: "x1heor9g",
109
+ kkrTdU: "x1ypdohk",
110
+ kaIpWk: "xh6dtrn",
111
+ $$css: true
112
+ },
100
113
  popover: {
101
114
  k7Eaqz: "xrzjruh",
102
115
  $$css: true
@@ -108,10 +121,6 @@ const styles = {
108
121
  kkrTdU: "x1ypdohk",
109
122
  $$css: true
110
123
  },
111
- sectionDivider: {
112
- kqGvvJ: "xsq74q5",
113
- $$css: true
114
- },
115
124
  divider: {
116
125
  kqGvvJ: "xsq74q5",
117
126
  $$css: true
@@ -268,6 +277,7 @@ export function MultiSelector({
268
277
  triggerDisplay = 'count',
269
278
  maxBadges = 3,
270
279
  renderOption,
280
+ indicatorPosition = 'start',
271
281
  isDefaultOpen = false,
272
282
  'data-testid': testId,
273
283
  htmlName,
@@ -292,7 +302,7 @@ export function MultiSelector({
292
302
  const searchRef = useRef(null);
293
303
  const inputGroup = useInputGroup();
294
304
  const [searchQuery, setSearchQuery] = useState('');
295
- // A typed query shows TextInput's built-in clear (✕) button, which becomes
305
+ // A typed query shows the search row's clear (✕) button, which becomes
296
306
  // the next tab stop after the search input.
297
307
  const hasQuery = searchQuery.length > 0;
298
308
 
@@ -409,7 +419,10 @@ export function MultiSelector({
409
419
  hasAutoFocus: false,
410
420
  // The popup's own role="listbox" is the exposed semantics; the trigger
411
421
  // keeps DOM focus, so wrapping it in a modal dialog would misrepresent it.
412
- role: 'none'
422
+ role: 'none',
423
+ // The theme target belongs on the SURFACE that paints the popup, which
424
+ // `usePopover` owns — not on the scrolling list inside it.
425
+ surfaceTarget: 'multi-selector-popup'
413
426
  });
414
427
 
415
428
  // Open dropdown on mount when isDefaultOpen is true
@@ -615,13 +628,36 @@ export function MultiSelector({
615
628
  if (!hasSearch) {
616
629
  return null;
617
630
  }
618
- return /*#__PURE__*/_jsx("div", {
619
- ...{
620
- className: "x78zum5 x6s0dn4 xf314gf xu0wf1k"
621
- },
622
- onKeyDown: e => {
623
- // The clear (✕) button lives inside the TextInput, after the input in
624
- // DOM order. When it is focused and the user tabs forward there is
631
+ return /*#__PURE__*/_jsx(PanelSearchInput, {
632
+ ref: searchRef,
633
+ id: searchId
634
+ // The search row is the panel's header: a magnifier, a borderless
635
+ // input, and the shared clear (✕) button. It deliberately does NOT
636
+ // render a bordered TextInput — the popup is already a bordered
637
+ // surface, and a field inside it drew a second box within that box.
638
+ ,
639
+ label: t('@astryx.multiSelector.searchOptions')
640
+ // Same accessible name the TextInput's built-in clear produced
641
+ // ("Clear Search options"), so the affordance keeps its name while its
642
+ // chrome changes.
643
+ ,
644
+ clearLabel: t('@astryx.textInput.clearLabel', {
645
+ label: t('@astryx.multiSelector.searchOptions')
646
+ }),
647
+ ...themeProps('multi-selector-search'),
648
+ // When hasSearch is set, focus moves into this input on open, so it —
649
+ // not the trigger — must be the combobox reporting the highlighted
650
+ // option via aria-activedescendant (comboboxes-4).
651
+ role: "combobox",
652
+ "aria-expanded": popover.isOpen,
653
+ "aria-controls": listboxId,
654
+ "aria-autocomplete": "list",
655
+ "aria-activedescendant": popover.isOpen && highlightedIndex >= 0 ? getItemId(highlightedIndex) : undefined,
656
+ value: searchQuery,
657
+ onValueChange: handleSearchChange,
658
+ onContainerKeyDown: e => {
659
+ // The clear (✕) button lives inside the row, after the input in DOM
660
+ // order. When it is focused and the user tabs forward there is
625
661
  // nothing else in the popup, so dismiss it (Shift+Tab returns to the
626
662
  // input natively). Key events originating on the input are handled on
627
663
  // the input below; ignore them here so we don't double-dismiss.
@@ -632,54 +668,23 @@ export function MultiSelector({
632
668
  onKeyDown(e);
633
669
  }
634
670
  },
635
- children: /*#__PURE__*/_jsx(TextInput, {
636
- ref: searchRef,
637
- id: searchId
638
- // The search field IS a TextInput: the leading magnifier is its
639
- // `startIcon` and the trailing clear (✕) is its built-in `hasClear`
640
- // (which resets the value and refocuses the input). We add no bespoke
641
- // affordance chrome — the field just looks and behaves like every
642
- // other Astryx input.
643
- ,
644
- label: t('@astryx.multiSelector.searchOptions'),
645
- isLabelHidden: true,
646
- startIcon: "search",
647
- hasClear: true,
648
- size: "sm"
649
- // Fill the dropdown's width (minus the wrapper's inline padding) so
650
- // the field is flush end-to-end rather than sized to its content.
651
- ,
652
- width: "100%"
653
- // When hasSearch is set, focus moves into this input on open, so it —
654
- // not the trigger — must be the combobox reporting the highlighted
655
- // option via aria-activedescendant (comboboxes-4). role + aria-* pass
656
- // through to the underlying <input> via BaseProps.
657
- ,
658
- role: "combobox",
659
- "aria-expanded": popover.isOpen,
660
- "aria-controls": listboxId,
661
- "aria-autocomplete": "list",
662
- "aria-activedescendant": popover.isOpen && highlightedIndex >= 0 ? getItemId(highlightedIndex) : undefined,
663
- value: searchQuery,
664
- onChange: handleSearchChange,
665
- onKeyDown: e => {
666
- // Arrow keys navigate options; Enter toggles; Escape closes.
667
- // Space and Home/End are left to the input (type a space / move
668
- // the caret) per the APG editable combobox; PageUp/PageDown are
669
- // the sanctioned substitute for jumping to the first/last option.
670
- if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'PageUp' || e.key === 'PageDown' || e.key === 'Enter' || e.key === 'Escape') {
671
- onKeyDown(e);
672
- return;
673
- }
674
- // Tab: when a query is showing the clear (✕) button, forward-tab
675
- // moves focus to it (keeping the popup open) so the affordance is
676
- // keyboard-reachable. Every other Tab dismisses the popup as usual.
677
- if (e.key === 'Tab' && (e.shiftKey || !hasQuery)) {
678
- onKeyDown(e);
679
- }
680
- },
681
- placeholder: searchPlaceholder
682
- })
671
+ onKeyDown: e => {
672
+ // Arrow keys navigate options; Enter toggles; Escape closes.
673
+ // Space and Home/End are left to the input (type a space / move
674
+ // the caret) per the APG editable combobox; PageUp/PageDown are
675
+ // the sanctioned substitute for jumping to the first/last option.
676
+ if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'PageUp' || e.key === 'PageDown' || e.key === 'Enter' || e.key === 'Escape') {
677
+ onKeyDown(e);
678
+ return;
679
+ }
680
+ // Tab: when a query is showing the clear (✕) button, forward-tab
681
+ // moves focus to it (keeping the popup open) so the affordance is
682
+ // keyboard-reachable. Every other Tab dismisses the popup as usual.
683
+ if (e.key === 'Tab' && (e.shiftKey || !hasQuery)) {
684
+ onKeyDown(e);
685
+ }
686
+ },
687
+ placeholder: searchPlaceholder
683
688
  });
684
689
  }, [hasSearch, searchId, listboxId, searchQuery, hasQuery, searchPlaceholder, handleSearchChange, onKeyDown, popover.isOpen, highlightedIndex, getItemId, t]);
685
690
 
@@ -693,6 +698,25 @@ export function MultiSelector({
693
698
  // checkbox is inert/decorative, so the indeterminate state must be
694
699
  // conveyed through the option's accessible name (WCAG 4.1.2).
695
700
  const isPartiallySelected = isSelectAll && selectAllState === 'indeterminate';
701
+ const checkbox = /*#__PURE__*/_jsx("div", {
702
+ inert: true,
703
+ ...{
704
+ 0: {
705
+ className: "x47corl x78zum5 x2lah0s"
706
+ },
707
+ 1: {
708
+ className: "x47corl x78zum5 x2lah0s xvc5jky"
709
+ }
710
+ }[!!(indicatorPosition === 'end') << 0],
711
+ children: /*#__PURE__*/_jsx(CheckboxInput, {
712
+ label: "",
713
+ isLabelHidden: true,
714
+ value: checkboxValue,
715
+ onChange: () => {},
716
+ isDisabled: item.disabled,
717
+ size: size === 'lg' ? 'md' : size
718
+ })
719
+ });
696
720
  return /*#__PURE__*/_jsxs("div", {
697
721
  id: getItemId(flatIndex),
698
722
  role: "option",
@@ -718,27 +742,14 @@ export function MultiSelector({
718
742
  selected: isSelected ? 'selected' : null,
719
743
  disabled: item.disabled ? 'disabled' : null
720
744
  }), stylex.props(styles.item, isSelectAll ? selectAllSizeStyles[size] : itemSizeStyles[size], isSelectAll && styles.selectAllWrapper, isHighlighted && styles.itemHighlighted, item.disabled && styles.itemDisabled)),
721
- children: [/*#__PURE__*/_jsx("div", {
722
- inert: true,
723
- ...{
724
- className: "x47corl x78zum5 x2lah0s"
725
- },
726
- children: /*#__PURE__*/_jsx(CheckboxInput, {
727
- label: "",
728
- isLabelHidden: true,
729
- value: checkboxValue,
730
- onChange: () => {},
731
- isDisabled: item.disabled,
732
- size: size === 'lg' ? 'md' : size
733
- })
734
- }), renderOption && !isSelectAll ? renderOption(item) : /*#__PURE__*/_jsx("span", {
745
+ children: [indicatorPosition === 'start' && checkbox, renderOption && !isSelectAll ? renderOption(item) : /*#__PURE__*/_jsx("span", {
735
746
  ...{
736
747
  className: "xeuugli xb3r6kr xlyipyv xuxw1ft"
737
748
  },
738
749
  children: item.label ?? item.value
739
- })]
750
+ }), indicatorPosition === 'end' && checkbox]
740
751
  }, item.value);
741
- }, [renderOption, highlightedIndex, optimisticValue, allEnabledSelected, selectAllState, selectAllLabel, getItemId, handleNavigableToggle, onItemMouseEnter, size, t]);
752
+ }, [renderOption, indicatorPosition, highlightedIndex, optimisticValue, allEnabledSelected, selectAllState, selectAllLabel, getItemId, handleNavigableToggle, onItemMouseEnter, size, t]);
742
753
 
743
754
  // Render all options. Uses sortedItems as the single source of truth for
744
755
  // item order — no independent sorting here. Structural elements (dividers,
@@ -750,12 +761,11 @@ export function MultiSelector({
750
761
  // Number of real items (excluding the select-all sentinel)
751
762
  const realItemCount = hasSelectAll ? sortedItems.length - 1 : sortedItems.length;
752
763
 
753
- // Show select-all only when there are real items to select
764
+ // Show select-all only when there are real items to select. It reads as
765
+ // the first row of the list, not a section of its own — no divider under
766
+ // it (the checkbox column already lines it up with the options below).
754
767
  if (hasSelectAll && realItemCount > 0) {
755
768
  elements.push(renderItem(sortedItems[0], 0));
756
- elements.push(/*#__PURE__*/_jsx(Divider, {
757
- xstyle: styles.divider
758
- }, "select-all-divider"));
759
769
  cursor = 1;
760
770
  } else if (hasSelectAll) {
761
771
  // Skip the select-all sentinel when there are no real items
@@ -813,16 +823,21 @@ export function MultiSelector({
813
823
  sectionItems.push(renderItem(sortedItems[cursor], cursor));
814
824
  cursor++;
815
825
  }
816
- if (option.title) {
817
- elements.push(/*#__PURE__*/_jsx(Divider, {
818
- label: option.title,
819
- xstyle: styles.sectionDivider
820
- }, `section-divider-${i}`));
821
- }
822
- elements.push(/*#__PURE__*/_jsx("div", {
826
+ // The heading lives INSIDE the group and is aria-hidden: the group
827
+ // already carries the title as its accessible name, so exposing the
828
+ // text again would announce it twice. This also keeps role="listbox"'s
829
+ // children to option/group only — the old labeled Divider sat in the
830
+ // listbox as a stray role="separator".
831
+ elements.push(/*#__PURE__*/_jsxs("div", {
823
832
  role: "group",
824
833
  "aria-label": option.title,
825
- children: sectionItems
834
+ children: [option.title && /*#__PURE__*/_jsx("div", {
835
+ "aria-hidden": "true",
836
+ ...mergeProps(themeProps('multi-selector-section-heading'), {
837
+ className: "xu0wf1k xf314gf x9ynric x141an7d x1ltkj2j xv1l7n4 x87ps6o"
838
+ }),
839
+ children: option.title
840
+ }), sectionItems]
826
841
  }, `section-${i}`));
827
842
  } else if (isOptionData(option)) {
828
843
  if (!isSearching || optionMatchesQuery(normalizeOption(option), searchQuery)) {
@@ -854,7 +869,7 @@ export function MultiSelector({
854
869
  size,
855
870
  status: status?.type ?? null,
856
871
  disabled: isDisabled ? 'disabled' : null
857
- }), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === 'ghost' && styles.triggerGhost, isDisabled && inputWrapperStyles.disabled, variant === 'ghost' && isDisabled && styles.triggerGhostDisabled, optimisticValue.length === 0 && styles.triggerPlaceholder, variant !== 'ghost' && status && inputStatusBorderStyles[status.type], variant !== 'ghost' && status && !isDisabled && inputStatusHoverShadowStyles[status.type], variant !== 'ghost' && inputGroup && groupStyles.inGroup, xstyle), className, style),
872
+ }), stylex.props(inputWrapperStyles.base, styles.triggerContainer, sizeStyles[size], variant === 'ghost' && styles.triggerGhost, variant === 'ghost' && focusOutlineStyles.focusWithin, isDisabled && inputWrapperStyles.disabled, variant === 'ghost' && isDisabled && styles.triggerGhostDisabled, optimisticValue.length === 0 && styles.triggerPlaceholder, variant !== 'ghost' && status && inputStatusBorderStyles[status.type], variant !== 'ghost' && status && !isDisabled && inputStatusHoverShadowStyles[status.type], variant !== 'ghost' && inputGroup && groupStyles.inGroup, xstyle), className, style),
858
873
  children: [startIcon && renderIconSlot(startIcon, {
859
874
  size: 'sm',
860
875
  color: 'secondary'
@@ -918,9 +933,7 @@ export function MultiSelector({
918
933
  "aria-label": t(STATUS_BUTTON_LABEL_KEY[status.type]),
919
934
  "aria-describedby": statusTooltip.describedBy,
920
935
  onClick: e => e.stopPropagation(),
921
- ...{
922
- className: "x78zum5 x6s0dn4 xl56j7k x1717udv x1ghz6dp xc342km xng3xce xjbqb8w x1heor9g x1ypdohk xh6dtrn x1a2a7pz x1p25gnr x1y3gkto"
923
- },
936
+ ...stylex.props(focusOutlineStyles.focusVisible, styles.statusButton),
924
937
  children: /*#__PURE__*/_jsx(Icon, {
925
938
  icon: STATUS_ICON_MAP[status.type],
926
939
  size: "sm",
@@ -951,17 +964,36 @@ export function MultiSelector({
951
964
  state: popover.isOpen ? 'expanded' : 'collapsed'
952
965
  })
953
966
  })]
954
- }), popover.render(/*#__PURE__*/_jsxs("div", {
955
- ...mergeProps(themeProps('multi-selector-popup'), {
967
+ }), popover.render(hasSearch ?
968
+ /*#__PURE__*/
969
+ // With a search row the panel splits: the header stays put while the
970
+ // options scroll under it, so the field does not slide out of reach
971
+ // in a long list. Without one the panel is a single scroll container,
972
+ // exactly as before.
973
+ _jsxs("div", {
974
+ children: [renderSearch(), /*#__PURE__*/_jsx(Divider, {}), /*#__PURE__*/_jsx("div", {
975
+ ...{
976
+ className: "x9f619 xuyqlj2 x1odjw0f x9epnlk"
977
+ },
978
+ children: /*#__PURE__*/_jsx("div", {
979
+ id: listboxId,
980
+ role: "listbox",
981
+ "aria-multiselectable": "true",
982
+ "aria-labelledby": triggerId,
983
+ children: renderOptions()
984
+ })
985
+ })]
986
+ }) : /*#__PURE__*/_jsx("div", {
987
+ ...{
956
988
  className: "x9f619 xuyqlj2 x1odjw0f x9epnlk"
957
- }),
958
- children: [renderSearch(), /*#__PURE__*/_jsx("div", {
989
+ },
990
+ children: /*#__PURE__*/_jsx("div", {
959
991
  id: listboxId,
960
992
  role: "listbox",
961
993
  "aria-multiselectable": "true",
962
994
  "aria-labelledby": triggerId,
963
995
  children: renderOptions()
964
- })]
996
+ })
965
997
  }), {
966
998
  placement: 'below',
967
999
  alignment: 'start',
@@ -9,8 +9,13 @@
9
9
  * disabled state) so all nav-like components stay in sync — especially important
10
10
  * when TopNav items render inside MobileNav drawers alongside SideNav items.
11
11
  *
12
- * Individual components layer their own overrides (e.g. collapsed mode, indentation,
13
- * focus outlines) via stylex.props composition.
12
+ * Individual components layer their own overrides (e.g. collapsed mode,
13
+ * indentation) via stylex.props composition.
14
+ *
15
+ * The focus ring is not defined here. Compose
16
+ * `focusOutlineProps.focusVisible` (utils/focusOutline.stylex.ts) at the call
17
+ * site, on whichever element actually takes focus — in a split-action row that
18
+ * is the link and the toggle, not the row that contains them.
14
19
  */
15
20
  export type NavItemSize = 'sm' | 'md' | 'lg';
16
21
  import * as stylex from '@stylexjs/stylex';
@@ -63,15 +68,22 @@ export declare const navItemStyles: Readonly<{
63
68
  }>;
64
69
  }>;
65
70
  readonly selected: Readonly<{
66
- readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))">;
71
+ readonly backgroundColor: stylex.StyleXClassNameFor<"backgroundColor", "light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))" | "Highlight">;
72
+ readonly color: stylex.StyleXClassNameFor<"color", "HighlightText" | null>;
67
73
  readonly fontWeight: stylex.StyleXClassNameFor<"fontWeight", "500">;
68
74
  readonly ':hover': stylex.StyleXClassNameFor<":hover", {
69
75
  readonly '@media (hover: hover)': {
70
- readonly backgroundColor: stylex.StyleXVar<"light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))">;
76
+ readonly backgroundColor: {
77
+ readonly default: stylex.StyleXVar<"light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))">;
78
+ readonly '@media (forced-colors: active)': "Highlight";
79
+ };
71
80
  };
72
81
  }>;
73
82
  readonly ':active': stylex.StyleXClassNameFor<":active", {
74
- readonly backgroundColor: stylex.StyleXVar<"light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))">;
83
+ readonly backgroundColor: {
84
+ readonly default: stylex.StyleXVar<"light-dark(rgba(5, 54, 89, 0.1), rgba(223, 226, 229, 0.2))">;
85
+ readonly '@media (forced-colors: active)': "Highlight";
86
+ };
75
87
  }>;
76
88
  }>;
77
89
  readonly disabled: Readonly<{
@@ -1 +1 @@
1
- {"version":3,"file":"navItemStyles.stylex.d.ts","sourceRoot":"","sources":["../../src/NavItem/navItemStyles.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AAEH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAU3C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAuExB,CAAC"}
1
+ {"version":3,"file":"navItemStyles.stylex.d.ts","sourceRoot":"","sources":["../../src/NavItem/navItemStyles.stylex.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,MAAM,MAAM,WAAW,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAE7C,OAAO,KAAK,MAAM,MAAM,kBAAkB,CAAC;AAU3C;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA4FxB,CAAC"}
@@ -11,8 +11,13 @@
11
11
  * disabled state) so all nav-like components stay in sync — especially important
12
12
  * when TopNav items render inside MobileNav drawers alongside SideNav items.
13
13
  *
14
- * Individual components layer their own overrides (e.g. collapsed mode, indentation,
15
- * focus outlines) via stylex.props composition.
14
+ * Individual components layer their own overrides (e.g. collapsed mode,
15
+ * indentation) via stylex.props composition.
16
+ *
17
+ * The focus ring is not defined here. Compose
18
+ * `focusOutlineProps.focusVisible` (utils/focusOutline.stylex.ts) at the call
19
+ * site, on whichever element actually takes focus — in a split-action row that
20
+ * is the link and the toggle, not the row that contains them.
16
21
  */
17
22
 
18
23
  import * as stylex from '@stylexjs/stylex';
@@ -63,10 +68,11 @@ export const navItemStyles = {
63
68
  $$css: true
64
69
  },
65
70
  selected: {
66
- kWkggS: "x17x4s8c",
71
+ kWkggS: "x17x4s8c x1jzqe4",
72
+ kMwMTN: "x1k5gbb1",
67
73
  k63SB2: "x1e4wzip",
68
- kHE3J0: "x1sua13m",
69
- kSReZ0: "xjtnuge",
74
+ kHE3J0: "x1sua13m x1jawyga",
75
+ kSReZ0: "xjtnuge x1vo6n7o",
70
76
  $$css: true
71
77
  },
72
78
  disabled: {
@@ -109,6 +109,21 @@ export interface UsePopoverOptions {
109
109
  * @default true
110
110
  */
111
111
  hasSurface?: boolean;
112
+ /**
113
+ * Theme-target name stamped on the popup SURFACE — the element that paints
114
+ * the background, radius and elevation — without the `astryx-` prefix
115
+ * (e.g. `'complex-selector-popup'`).
116
+ *
117
+ * The surface is created here, not by the calling component, so a component
118
+ * that wants its popup themeable cannot reach it on its own: a target it
119
+ * renders itself lands on its content INSIDE the surface, where a background
120
+ * or radius rule paints the wrong box. Name the surface through this option
121
+ * and document the class in the component's `theming.targets`.
122
+ *
123
+ * The shared `astryx-popover-surface` class is always present alongside it,
124
+ * so a theme can style every popup surface at once.
125
+ */
126
+ surfaceTarget?: string;
112
127
  }
113
128
  /**
114
129
  * Return type for usePopover
@@ -1 +1 @@
1
- {"version":3,"file":"usePopover.d.ts","sourceRoot":"","sources":["../../src/Popover/usePopover.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,EAAiC,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAE5E,OAAO,EAAW,KAAK,kBAAkB,EAAC,MAAM,mBAAmB,CAAC;AAEpE,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,kBAAkB,CAAC;AA6DnD;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IAEpB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,YAAY,CAAC;IAEtB;;;OAGG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B;;;;;;;;;;OAUG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAE3B;;;O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ACH,UAAU,EAAE,CAAC,EAAE,EAAE,WAAW,GAAG,IAAI,KAAK,IAAI,CAAC;IAE7C;;;;OAIG;IACH,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAC;IAEnD;;;OAGG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;OAIG;IACH,IAAI,EAAE,CAAC,OAAO,CAAC,EAAE;QAAC,aAAa,CAAC,EAAE,OAAO,CAAA;KAAC,KAAK,IAAI,CAAC;IAEpD;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,MAAM,EAAE,MAAM,IAAI,CAAC;IAEnB;;OAEG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;;;;;;;;;;OAWG;IACH,MAAM,EAAE,CAAC,QAAQ,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,kBAAkB,KAAK,SAAS,CAAC;IAEvE;;OAEG;IACH,YAAY,EAAE;QACZ,eAAe,EAAE,QAAQ,GAAG,MAAM,CAAC;QACnC,eAAe,EAAE,OAAO,CAAC;QACzB,eAAe,EAAE,MAAM,CAAC;KACzB,CAAC;CACH;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,UAAU,CAAC,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CA2K5E"}
@@ -24,6 +24,9 @@ import { Button } from "../Button/index.js";
24
24
  import { rtlStyles } from "../utils/index.js";
25
25
  import { useTranslator } from "../i18n/index.js";
26
26
  import { useDevWarning } from "../hooks/useDevWarning.js";
27
+ import { mergeProps } from "../utils/mergeProps.js";
28
+ import { themeProps } from "../utils/themeProps.js";
29
+ import { stableClassName } from "../naming.js";
27
30
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
31
  const styles = {
29
32
  surface: {
@@ -107,6 +110,7 @@ export function usePopover(options = {}) {
107
110
  hasEscapeDismiss = true,
108
111
  hasAutoFocus = true,
109
112
  hasSurface = true,
113
+ surfaceTarget,
110
114
  hasCloseButton = true,
111
115
  closeButtonLabel: closeButtonLabelFromProps,
112
116
  dialogLabel,
@@ -188,12 +192,20 @@ export function usePopover(options = {}) {
188
192
 
189
193
  // Wrapped render function that includes surface styles and optional hidden close button
190
194
  const render = useCallback((children, props) => {
195
+ // `mergeProps` is positional — a third OBJECT argument is read as
196
+ // `style`, not as more props — so the surface's classes are composed
197
+ // into one props object before merging with the StyleX result.
198
+ const surfaceProps = themeProps('popover-surface');
199
+ const surfaceClassName = surfaceTarget != null ? `${surfaceProps.className} ${stableClassName(surfaceTarget)}` : surfaceProps.className;
191
200
  return layer.render(/*#__PURE__*/_jsxs("div", {
192
201
  ref: contentRef,
193
202
  role: role === 'dialog' ? 'dialog' : undefined,
194
203
  "aria-modal": role === 'dialog' && isModal ? true : undefined,
195
204
  "aria-label": role === 'dialog' ? dialogLabel : undefined,
196
- ...stylex.props(styles.contentWrapper, hasSurface && styles.surface, xstyle),
205
+ ...mergeProps({
206
+ ...surfaceProps,
207
+ className: surfaceClassName
208
+ }, stylex.props(styles.contentWrapper, hasSurface && styles.surface, xstyle)),
197
209
  children: [children, hasCloseButton && /*#__PURE__*/_jsx("div", {
198
210
  ...stylex.props(styles.closeButtonWrapper, rtlStyles.centerInline('100%')),
199
211
  children: /*#__PURE__*/_jsx(Button, {
@@ -206,7 +218,7 @@ export function usePopover(options = {}) {
206
218
  ...props,
207
219
  xstyle: props?.xstyle
208
220
  });
209
- }, [layer, hasCloseButton, hasSurface, closeButtonLabel, contentRef, dialogLabel, role, isModal, xstyle]);
221
+ }, [layer, hasCloseButton, hasSurface, surfaceTarget, closeButtonLabel, contentRef, dialogLabel, role, isModal, xstyle]);
210
222
  return {
211
223
  triggerRef,
212
224
  contentRef,
@@ -1 +1 @@
1
- {"version":3,"file":"ProgressBar.d.ts","sourceRoot":"","sources":["../../src/ProgressBar/Progress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;;OAUG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC,eAAe,CAAC,CAAC;IACvC;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAwOD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,WAAW,CAAC,EAC1B,KAAS,EACT,GAAS,EACT,KAAK,EACL,aAAqB,EACrB,aAAqB,EACrB,gBAA0C,EAC1C,OAAkB,EAClB,eAAuB,EACvB,UAAkB,EAClB,KAAK,EACL,MAAM,EACN,SAAS,EACT,KAAK,EACL,aAAa,EAAE,UAAU,EACzB,GAAG,EACH,GAAG,IAAI,EACR,EAAE,gBAAgB,+BAoKlB;yBArLe,WAAW"}
@@ -21,6 +21,7 @@ import * as stylex from '@stylexjs/stylex';
21
21
  import "../theme/tokens.stylex.js";
22
22
  import { colorVars, spacingVars, radiusVars, fontWeightVars, durationVars, easeVars, typeScaleVars } from "../theme/tokens.stylex.js";
23
23
  import { mergeProps } from "../utils/index.js";
24
+ import { focusOutlineStyles } from "../utils/focusOutline.stylex.js";
24
25
  import { themeProps } from "../utils/themeProps.js";
25
26
  import { VisuallyHidden } from "../VisuallyHidden/index.js";
26
27
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -90,8 +91,6 @@ const styles = {
90
91
  k87sOh: "xwa60dl",
91
92
  kzqmXN: "x63cpjl",
92
93
  kZKoxP: "xhovv34",
93
- kI3sdo: "x1a2a7pz x17nn4n9",
94
- kInvED: "x1wfwxd8 x7s97pk",
95
94
  k3aq6I: "x11lhmoz xoffwj3",
96
95
  $$css: true
97
96
  }
@@ -366,7 +365,7 @@ export function ProgressBar({
366
365
  ...mergeProps(themeProps('progressbar-mark', {
367
366
  variant: fillVariant,
368
367
  placement: mark.isOnFill ? 'fill' : 'track'
369
- }), stylex.props(styles.mark, mark.isOnFill ? markOnFillStyles[fillVariant] : isDisabled ? markOnTrackStyles.trackDisabled : markOnTrackStyles.track)),
368
+ }), stylex.props(focusOutlineStyles.focusVisible, styles.mark, mark.isOnFill ? markOnFillStyles[fillVariant] : isDisabled ? markOnTrackStyles.trackDisabled : markOnTrackStyles.track)),
370
369
  style: {
371
370
  insetInlineStart: `${mark.pct}%`
372
371
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Section.d.ts","sourceRoot":"","sources":["../../src/Section/Section.tsx"],"names":[],"mappings":"AAIA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGrC,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,cAAc,CAAC;AAY5C,OAAO,KAAK,EAAC,SAAS,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAG3D,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,iBAAiB,CAAC;AAiFrD,MAAM,WAAW,YAAa,SAAQ,SAAS,CAAC,WAAW,CAAC;IAC1D,GAAG,CAAC,EAAE,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;IAC7B;;;;;;OAMG;IACH,OAAO,CAAC,EAAE,cAAc,CAAC;IAEzB;;;OAGG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,SAAS,CAAC;IAEnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;OAGG;IACH,SAAS,CAAC,EAAE,SAAS,CAAC;IAEtB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,CAAC;IAErB;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,OAAO,GAAG,KAAK,CAAC,EAAE,CAAC;IAElD;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;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AAG,KAAK,CAAC,EAAE,CAAC;IAElD;;;;OAIG;IACH,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB;;;;;OAKG;IACH,YAAY,CAAC,EAAE,WAAW,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,OAAO,CAAC,EACtB,OAAmB,EACnB,KAAK,EACL,MAAM,EACN,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,MAAM,EACN,SAAS,EACT,KAAK,EACL,GAAG,EACH,GAAG,KAAK,EACT,EAAE,YAAY,+BA0Ed;yBAzFe,OAAO"}
@@ -1,7 +1,5 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- 'use client';
4
-
5
3
  /**
6
4
  * @file Section.tsx
7
5
  * @input Uses container utility, StyleX
@@ -14,6 +12,7 @@
14
12
  * - /apps/storybook/stories/Section.stories.tsx (storybook stories)
15
13
  * - /packages/cli/assets/templates/blocks/components/Section/ (showcase blocks)
16
14
  */
15
+
17
16
  import * as stylex from '@stylexjs/stylex';
18
17
  import "../theme/tokens.stylex.js";
19
18
  import { colorVars } from "../theme/tokens.stylex.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Section/index.ts"],"names":[],"mappings":"AAIA;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,EAAE,IAAI,CAAC;CACb;AAED,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,YAAY,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Section/index.ts"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,IAAI,CAAC;IACd,WAAW,EAAE,IAAI,CAAC;IAClB,KAAK,EAAE,IAAI,CAAC;CACb;AAED,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,YAAY,EAAC,YAAY,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC"}
@@ -1,7 +1,5 @@
1
1
  // Copyright (c) Meta Platforms, Inc. and affiliates.
2
2
 
3
- 'use client';
4
-
5
3
  /**
6
4
  * @file index.ts
7
5
  * @input Imports Section component
@@ -24,4 +22,5 @@
24
22
  * }
25
23
  * ```
26
24
  */
25
+
27
26
  export { Section } from "./Section.js";
@@ -14,6 +14,7 @@
14
14
  */
15
15
  import React, { type ReactNode } from 'react';
16
16
  import { type IconType } from '../Icon';
17
+ import type { IndicatorPosition } from '../Indicator';
17
18
  import { type FieldStatusVariant } from '../Field';
18
19
  import type { LayerPlacement } from '../Layer/useLayer';
19
20
  import type { SelectorOptionType, SelectorOptionData } from './types';
@@ -144,6 +145,15 @@ interface SelectorPropsBase<T extends SelectorOptionType = SelectorOptionType> e
144
145
  * Only called for selectable options (not dividers/sections).
145
146
  */
146
147
  renderOption?: (option: SelectorOptionData) => ReactNode;
148
+ /**
149
+ * Which edge of the option row carries the selected mark. `start` reserves a
150
+ * mark column ahead of every label so they stay aligned, the way a native
151
+ * menu does; `end` is the house convention shared with Typeahead and
152
+ * CommandPalette.
153
+ *
154
+ * @default 'end'
155
+ */
156
+ indicatorPosition?: IndicatorPosition;
147
157
  /**
148
158
  * Whether to show a search input for filtering options.
149
159
  * @default false