@krelborn/stylesui 0.8.1 → 0.9.0

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 (323) hide show
  1. package/README.md +2 -2
  2. package/dist/accessibility/idSegment.js +1 -2
  3. package/dist/collections/index.d.ts +3 -0
  4. package/dist/collections/optionId.js +6 -0
  5. package/dist/{components/Listbox → collections}/renderedOptions.d.ts +7 -0
  6. package/dist/{components/Listbox → collections}/renderedOptions.js +6 -4
  7. package/dist/collections/targetIndexForKey.js +1 -2
  8. package/dist/collections/typeAhead.js +0 -1
  9. package/dist/components/Accordion/Accordion.css +1 -0
  10. package/dist/components/Accordion/Accordion.d.ts +90 -0
  11. package/dist/components/Accordion/Accordion.js +47 -0
  12. package/dist/components/Accordion/Accordion.module.js +19 -0
  13. package/dist/components/Accordion/AccordionContext.d.ts +40 -0
  14. package/dist/components/Accordion/AccordionContext.js +4 -0
  15. package/dist/components/Accordion/AccordionItem.d.ts +51 -0
  16. package/dist/components/Accordion/AccordionItem.js +69 -0
  17. package/dist/components/Accordion/AccordionToggleContent.d.ts +30 -0
  18. package/dist/components/Accordion/AccordionToggleContent.js +44 -0
  19. package/dist/components/Accordion/accordionIds.d.ts +24 -0
  20. package/dist/components/Accordion/accordionIds.js +12 -0
  21. package/dist/components/Accordion/index.d.ts +4 -0
  22. package/dist/components/Accordion/useAccordionContext.d.ts +9 -0
  23. package/dist/components/Accordion/useAccordionContext.js +10 -0
  24. package/dist/components/Accordion/useFindablePanel.d.ts +25 -0
  25. package/dist/components/Accordion/useFindablePanel.js +36 -0
  26. package/dist/components/Accordion/useFragmentTargetReveal.d.ts +27 -0
  27. package/dist/components/Accordion/useFragmentTargetReveal.js +36 -0
  28. package/dist/components/Accordion/useHasOpened.d.ts +7 -0
  29. package/dist/components/Accordion/useHasOpened.js +7 -0
  30. package/dist/components/Alert/Alert.js +1 -2
  31. package/dist/components/Alert/Alert.module.js +1 -2
  32. package/dist/components/Alert/AlertIcon.js +1 -2
  33. package/dist/components/Avatar/Avatar.js +1 -2
  34. package/dist/components/Avatar/Avatar.module.js +1 -2
  35. package/dist/components/Avatar/initialsOf.js +1 -2
  36. package/dist/components/AvatarGroup/AvatarGroup.js +1 -2
  37. package/dist/components/AvatarGroup/AvatarGroup.module.js +1 -2
  38. package/dist/components/Badge/Badge.js +1 -2
  39. package/dist/components/Badge/Badge.module.js +1 -2
  40. package/dist/components/Box/Box.js +1 -2
  41. package/dist/components/Box/Box.module.js +1 -2
  42. package/dist/components/Button/Button.js +2 -7
  43. package/dist/components/Button/Button.module.js +1 -2
  44. package/dist/components/Card/Card.js +1 -2
  45. package/dist/components/Card/Card.module.js +1 -2
  46. package/dist/components/Center/Center.js +6 -7
  47. package/dist/components/Center/Center.module.js +1 -2
  48. package/dist/components/Checkbox/Checkbox.js +1 -2
  49. package/dist/components/ChoiceControl/ChoiceControl.js +1 -2
  50. package/dist/components/ChoiceControl/ChoiceControl.module.js +1 -2
  51. package/dist/components/Cluster/Cluster.js +1 -2
  52. package/dist/components/Code/Code.js +1 -2
  53. package/dist/components/Code/Code.module.js +1 -2
  54. package/dist/components/Combobox/Autocomplete.d.ts +83 -0
  55. package/dist/components/Combobox/Autocomplete.js +102 -0
  56. package/dist/components/Combobox/Combobox.css +1 -0
  57. package/dist/components/Combobox/Combobox.d.ts +59 -0
  58. package/dist/components/Combobox/Combobox.js +82 -0
  59. package/dist/components/Combobox/Combobox.module.js +17 -0
  60. package/dist/components/Combobox/ComboboxContext.d.ts +88 -0
  61. package/dist/components/Combobox/ComboboxContext.js +4 -0
  62. package/dist/components/Combobox/ComboboxFieldValue.d.ts +17 -0
  63. package/dist/components/Combobox/ComboboxFieldValue.js +33 -0
  64. package/dist/components/Combobox/ComboboxOption.d.ts +51 -0
  65. package/dist/components/Combobox/ComboboxOption.js +74 -0
  66. package/dist/components/Combobox/ComboboxOptionContent.d.ts +32 -0
  67. package/dist/components/Combobox/ComboboxOptionContent.js +51 -0
  68. package/dist/components/Combobox/ComboboxPopup.d.ts +50 -0
  69. package/dist/components/Combobox/ComboboxPopup.js +59 -0
  70. package/dist/components/Combobox/autocompleteKeys.d.ts +31 -0
  71. package/dist/components/Combobox/autocompleteKeys.js +25 -0
  72. package/dist/components/Combobox/comboboxKeys.d.ts +10 -0
  73. package/dist/components/Combobox/comboboxKeys.js +22 -0
  74. package/dist/components/Combobox/containsText.d.ts +9 -0
  75. package/dist/components/Combobox/containsText.js +8 -0
  76. package/dist/components/Combobox/index.d.ts +6 -0
  77. package/dist/components/Combobox/isAltArrow.d.ts +9 -0
  78. package/dist/components/Combobox/isAltArrow.js +5 -0
  79. package/dist/components/Combobox/isOptionShown.d.ts +10 -0
  80. package/dist/components/Combobox/isOptionShown.js +5 -0
  81. package/dist/components/Combobox/useAutocompleteText.d.ts +56 -0
  82. package/dist/components/Combobox/useAutocompleteText.js +27 -0
  83. package/dist/components/Combobox/useComboboxContext.d.ts +9 -0
  84. package/dist/components/Combobox/useComboboxContext.js +10 -0
  85. package/dist/components/Combobox/useComboboxList.d.ts +129 -0
  86. package/dist/components/Combobox/useComboboxList.js +138 -0
  87. package/dist/components/Combobox/useComboboxOption.d.ts +35 -0
  88. package/dist/components/Combobox/useComboboxOption.js +46 -0
  89. package/dist/components/Combobox/useComboboxSelection.d.ts +45 -0
  90. package/dist/components/Combobox/useComboboxSelection.js +17 -0
  91. package/dist/components/Combobox/useResultsAnnouncement.d.ts +23 -0
  92. package/dist/components/Combobox/useResultsAnnouncement.js +24 -0
  93. package/dist/components/ContextMenu/index.d.ts +2 -0
  94. package/dist/components/ContextMenu/useContextMenu.d.ts +112 -0
  95. package/dist/components/ContextMenu/useContextMenu.js +202 -0
  96. package/dist/components/ContextMenu/watchLongPress.d.ts +35 -0
  97. package/dist/components/ContextMenu/watchLongPress.js +38 -0
  98. package/dist/components/Counter/Counter.js +5 -6
  99. package/dist/components/Counter/Counter.module.js +1 -2
  100. package/dist/components/Cover/Cover.js +8 -9
  101. package/dist/components/Cover/Cover.module.js +1 -2
  102. package/dist/components/Divider/Divider.js +1 -2
  103. package/dist/components/Divider/Divider.module.js +1 -2
  104. package/dist/components/Field/Field.js +11 -10
  105. package/dist/components/Field/Field.module.js +1 -2
  106. package/dist/components/Fieldset/Fieldset.js +1 -2
  107. package/dist/components/Fieldset/Fieldset.module.js +1 -2
  108. package/dist/components/Frame/Frame.js +5 -6
  109. package/dist/components/Frame/Frame.module.js +1 -2
  110. package/dist/components/Grid/Grid.js +9 -10
  111. package/dist/components/Grid/Grid.module.js +1 -2
  112. package/dist/components/Heading/Heading.js +1 -2
  113. package/dist/components/Heading/Heading.module.js +1 -2
  114. package/dist/components/HorizontalFlow/HorizontalFlow.js +6 -7
  115. package/dist/components/HorizontalFlow/HorizontalFlow.module.js +1 -2
  116. package/dist/components/Icon/AddIcon.js +1 -2
  117. package/dist/components/Icon/CheckIcon.d.ts +11 -0
  118. package/dist/components/Icon/CheckIcon.js +18 -0
  119. package/dist/components/Icon/ChevronDownIcon.js +1 -2
  120. package/dist/components/Icon/ChevronRightIcon.d.ts +11 -0
  121. package/dist/components/Icon/ChevronRightIcon.js +19 -0
  122. package/dist/components/Icon/CloseIcon.js +1 -2
  123. package/dist/components/Icon/ColorModeIcon.js +1 -2
  124. package/dist/components/Icon/DeleteIcon.js +1 -2
  125. package/dist/components/Icon/Icon.js +1 -2
  126. package/dist/components/Icon/Icon.module.js +1 -2
  127. package/dist/components/Icon/InfoIcon.js +1 -2
  128. package/dist/components/Icon/MenuIcon.d.ts +12 -0
  129. package/dist/components/Icon/MenuIcon.js +28 -0
  130. package/dist/components/Icon/MoreHorizontalIcon.js +1 -2
  131. package/dist/components/Icon/MoreVerticalIcon.js +1 -2
  132. package/dist/components/Icon/PaletteIcon.js +1 -2
  133. package/dist/components/Icon/RefreshIcon.js +1 -2
  134. package/dist/components/Icon/RemoveIcon.js +1 -2
  135. package/dist/components/Icon/SendIcon.js +1 -2
  136. package/dist/components/Icon/index.d.ts +3 -0
  137. package/dist/components/IconButton/IconButton.js +1 -2
  138. package/dist/components/IconButton/IconButton.module.js +1 -2
  139. package/dist/components/Kbd/Kbd.js +1 -2
  140. package/dist/components/Kbd/Kbd.module.js +1 -2
  141. package/dist/components/Link/Link.js +1 -2
  142. package/dist/components/Link/Link.module.js +1 -2
  143. package/dist/components/Listbox/Listbox.js +9 -10
  144. package/dist/components/Listbox/Listbox.module.js +1 -2
  145. package/dist/components/Listbox/ListboxContext.js +1 -2
  146. package/dist/components/Listbox/ListboxOption.js +7 -8
  147. package/dist/components/Listbox/useListbox.js +22 -23
  148. package/dist/components/Listbox/useListboxContext.js +1 -2
  149. package/dist/components/Menu/Menu.d.ts +70 -0
  150. package/dist/components/Menu/Menu.js +76 -0
  151. package/dist/components/Menu/MenuContext.d.ts +29 -0
  152. package/dist/components/Menu/MenuContext.js +4 -0
  153. package/dist/components/Menu/MenuGroup.d.ts +22 -0
  154. package/dist/components/Menu/MenuGroup.js +32 -0
  155. package/dist/components/Menu/MenuItem.d.ts +77 -0
  156. package/dist/components/Menu/MenuItem.js +54 -0
  157. package/dist/components/Menu/MenuItemCheckbox.d.ts +61 -0
  158. package/dist/components/Menu/MenuItemCheckbox.js +37 -0
  159. package/dist/components/Menu/MenuItemRadio.d.ts +47 -0
  160. package/dist/components/Menu/MenuItemRadio.js +39 -0
  161. package/dist/components/Menu/MenuRadioGroup.d.ts +34 -0
  162. package/dist/components/Menu/MenuRadioGroup.js +27 -0
  163. package/dist/components/Menu/MenuRadioGroupContext.d.ts +17 -0
  164. package/dist/components/Menu/MenuRadioGroupContext.js +4 -0
  165. package/dist/components/Menu/MenuSeparator.d.ts +16 -0
  166. package/dist/components/Menu/MenuSeparator.js +20 -0
  167. package/dist/components/Menu/Submenu.d.ts +36 -0
  168. package/dist/components/Menu/Submenu.js +122 -0
  169. package/dist/components/Menu/index.d.ts +18 -0
  170. package/dist/components/Menu/useMenu.d.ts +18 -0
  171. package/dist/components/Menu/useMenu.js +20 -0
  172. package/dist/components/Menu/useMenuButton.d.ts +124 -0
  173. package/dist/components/Menu/useMenuButton.js +92 -0
  174. package/dist/components/Menu/useMenuContext.d.ts +9 -0
  175. package/dist/components/Menu/useMenuContext.js +10 -0
  176. package/dist/components/Menu/useMenuItemContent.d.ts +55 -0
  177. package/dist/components/Menu/useMenuItemContent.js +66 -0
  178. package/dist/components/Menu/useMenuPointer.d.ts +27 -0
  179. package/dist/components/Menu/useMenuPointer.js +56 -0
  180. package/dist/components/Menu/useMenuRadioGroupContext.d.ts +9 -0
  181. package/dist/components/Menu/useMenuRadioGroupContext.js +10 -0
  182. package/dist/components/MenuSurface/MenuSurface.css +1 -0
  183. package/dist/components/MenuSurface/MenuSurface.module.js +16 -0
  184. package/dist/components/Menubar/Menubar.css +1 -0
  185. package/dist/components/Menubar/Menubar.d.ts +23 -0
  186. package/dist/components/Menubar/Menubar.js +67 -0
  187. package/dist/components/Menubar/Menubar.module.js +7 -0
  188. package/dist/components/Menubar/MenubarContext.d.ts +29 -0
  189. package/dist/components/Menubar/MenubarContext.js +4 -0
  190. package/dist/components/Menubar/MenubarMenu.d.ts +26 -0
  191. package/dist/components/Menubar/MenubarMenu.js +88 -0
  192. package/dist/components/Menubar/findOpenMenubarItem.d.ts +7 -0
  193. package/dist/components/Menubar/findOpenMenubarItem.js +6 -0
  194. package/dist/components/Menubar/index.d.ts +4 -0
  195. package/dist/components/Menubar/menubarItems.d.ts +7 -0
  196. package/dist/components/Menubar/menubarItems.js +5 -0
  197. package/dist/components/Menubar/useMenubarContext.d.ts +9 -0
  198. package/dist/components/Menubar/useMenubarContext.js +10 -0
  199. package/dist/components/NavBar/NavBar.css +1 -0
  200. package/dist/components/NavBar/NavBar.d.ts +53 -0
  201. package/dist/components/NavBar/NavBar.js +97 -0
  202. package/dist/components/NavBar/NavBar.module.js +22 -0
  203. package/dist/components/NavBar/NavBarContext.d.ts +21 -0
  204. package/dist/components/NavBar/NavBarContext.js +4 -0
  205. package/dist/components/NavBar/NavBarItem.d.ts +32 -0
  206. package/dist/components/NavBar/NavBarItem.js +18 -0
  207. package/dist/components/NavBar/NavBarMenu.d.ts +32 -0
  208. package/dist/components/NavBar/NavBarMenu.js +84 -0
  209. package/dist/components/NavBar/NavBarMenuGroup.d.ts +25 -0
  210. package/dist/components/NavBar/NavBarMenuGroup.js +40 -0
  211. package/dist/components/NavBar/NavBarMenuItem.d.ts +36 -0
  212. package/dist/components/NavBar/NavBarMenuItem.js +49 -0
  213. package/dist/components/NavBar/index.d.ts +10 -0
  214. package/dist/components/NavBar/isNavBarCollapsed.d.ts +8 -0
  215. package/dist/components/NavBar/isNavBarCollapsed.js +5 -0
  216. package/dist/components/NavBar/leavesPageInPlace.d.ts +12 -0
  217. package/dist/components/NavBar/leavesPageInPlace.js +29 -0
  218. package/dist/components/NavBar/renderNavBarLink.d.ts +12 -0
  219. package/dist/components/NavBar/renderNavBarLink.js +16 -0
  220. package/dist/components/NavBar/useLayoutSwitch.d.ts +26 -0
  221. package/dist/components/NavBar/useLayoutSwitch.js +25 -0
  222. package/dist/components/NavBar/useNavBarContext.d.ts +9 -0
  223. package/dist/components/NavBar/useNavBarContext.js +10 -0
  224. package/dist/components/NavList/NavList.js +1 -2
  225. package/dist/components/NavList/NavList.module.js +1 -2
  226. package/dist/components/NavList/NavListGroup.js +1 -2
  227. package/dist/components/NavList/NavListItem.d.ts +4 -8
  228. package/dist/components/NavList/NavListItem.js +1 -2
  229. package/dist/components/Overlay/Overlay.js +6 -7
  230. package/dist/components/Overlay/Overlay.module.js +1 -2
  231. package/dist/components/PageLayout/PageLayout.js +6 -7
  232. package/dist/components/PageLayout/PageLayout.module.js +1 -2
  233. package/dist/components/Popover/Popover.js +1 -2
  234. package/dist/components/Popover/Popover.module.js +1 -2
  235. package/dist/components/Popover/usePopover.js +44 -39
  236. package/dist/components/Prose/Prose.js +1 -2
  237. package/dist/components/Prose/Prose.module.js +1 -2
  238. package/dist/components/Radio/Radio.js +1 -2
  239. package/dist/components/RadioGroup/RadioGroup.js +5 -6
  240. package/dist/components/RadioGroup/RadioGroup.module.js +1 -2
  241. package/dist/components/RequiredIndicator/RequiredIndicator.js +1 -2
  242. package/dist/components/RequiredIndicator/RequiredIndicator.module.js +1 -2
  243. package/dist/components/Row/Row.js +1 -2
  244. package/dist/components/SegmentedControl/Segment.js +1 -2
  245. package/dist/components/SegmentedControl/SegmentedControl.js +1 -2
  246. package/dist/components/SegmentedControl/SegmentedControl.module.js +1 -2
  247. package/dist/components/Select/Select.js +1 -2
  248. package/dist/components/Sidebar/Sidebar.js +7 -8
  249. package/dist/components/Sidebar/Sidebar.module.js +1 -2
  250. package/dist/components/SkipLink/SkipLink.js +1 -2
  251. package/dist/components/SkipLink/SkipLink.module.js +1 -2
  252. package/dist/components/Spinner/Spinner.js +1 -2
  253. package/dist/components/Spinner/Spinner.module.js +1 -2
  254. package/dist/components/Stack/Stack.js +8 -9
  255. package/dist/components/Stack/Stack.module.js +1 -2
  256. package/dist/components/StatusDot/StatusDot.js +1 -2
  257. package/dist/components/StatusDot/StatusDot.module.js +1 -2
  258. package/dist/components/Switch/Switch.js +1 -2
  259. package/dist/components/Switcher/Switcher.js +9 -10
  260. package/dist/components/Switcher/Switcher.module.js +1 -2
  261. package/dist/components/Tabs/Tab.js +12 -13
  262. package/dist/components/Tabs/TabList.js +1 -2
  263. package/dist/components/Tabs/TabPanel.js +1 -2
  264. package/dist/components/Tabs/Tabs.js +1 -2
  265. package/dist/components/Tabs/Tabs.module.js +1 -2
  266. package/dist/components/Tabs/TabsContext.js +1 -2
  267. package/dist/components/Tabs/tabIds.js +1 -2
  268. package/dist/components/Tabs/useTabsContext.js +1 -2
  269. package/dist/components/Text/Text.js +1 -2
  270. package/dist/components/Text/Text.module.js +1 -2
  271. package/dist/components/TextControl/TextControl.d.ts +3 -3
  272. package/dist/components/TextControl/TextControl.js +14 -10
  273. package/dist/components/TextControl/TextControl.module.js +1 -2
  274. package/dist/components/TextInput/TextInput.js +1 -2
  275. package/dist/components/Textarea/Textarea.js +1 -2
  276. package/dist/components/Theme/Theme.js +1 -2
  277. package/dist/components/Tooltip/Tooltip.js +1 -2
  278. package/dist/components/Tooltip/Tooltip.module.js +1 -2
  279. package/dist/components/Tooltip/tooltipCoordinator.js +1 -2
  280. package/dist/components/Tooltip/useTooltip.js +1 -2
  281. package/dist/components/VisuallyHidden/VisuallyHidden.js +1 -2
  282. package/dist/components/VisuallyHidden/VisuallyHidden.module.js +1 -2
  283. package/dist/errors/MissingContextError.js +1 -2
  284. package/dist/errors/PopoverRefusedError.js +1 -2
  285. package/dist/forms/FieldContext.d.ts +5 -0
  286. package/dist/forms/FieldContext.js +1 -2
  287. package/dist/forms/RadioGroupContext.js +1 -2
  288. package/dist/forms/hasContent.js +1 -2
  289. package/dist/forms/useFieldControl.js +1 -2
  290. package/dist/forms/useRadioGroupItem.js +1 -2
  291. package/dist/index.d.ts +13 -1
  292. package/dist/index.js +90 -65
  293. package/dist/layout/listRole.js +1 -2
  294. package/dist/layout/spaceValue.js +1 -2
  295. package/dist/layout/withCustomProperties.js +1 -2
  296. package/dist/links/LinkOrButtonProps.d.ts +17 -0
  297. package/dist/links/index.d.ts +1 -0
  298. package/dist/menus/closeWhenFocusLeaves.d.ts +9 -0
  299. package/dist/menus/closeWhenFocusLeaves.js +11 -0
  300. package/dist/menus/focusItem.d.ts +6 -0
  301. package/dist/menus/focusItem.js +9 -0
  302. package/dist/menus/focusOnOpening.d.ts +11 -0
  303. package/dist/menus/focusOnOpening.js +11 -0
  304. package/dist/menus/hasModifier.d.ts +7 -0
  305. package/dist/menus/hasModifier.js +5 -0
  306. package/dist/menus/index.d.ts +11 -0
  307. package/dist/menus/itemText.d.ts +8 -0
  308. package/dist/menus/itemText.js +6 -0
  309. package/dist/menus/leaveMenuOnTab.d.ts +9 -0
  310. package/dist/menus/leaveMenuOnTab.js +6 -0
  311. package/dist/menus/pointerIntent.d.ts +36 -0
  312. package/dist/menus/pointerIntent.js +68 -0
  313. package/dist/menus/renderedItems.d.ts +8 -0
  314. package/dist/menus/renderedItems.js +4 -0
  315. package/dist/menus/watchRemovals.d.ts +8 -0
  316. package/dist/menus/watchRemovals.js +23 -0
  317. package/dist/overlays/anchorNameFor.js +1 -2
  318. package/dist/overlays/mergeProps.js +1 -2
  319. package/dist/overlays/syncPopover.js +1 -2
  320. package/dist/overlays/useOverlay.js +2 -9
  321. package/package.json +10 -10
  322. package/dist/components/Listbox/optionId.js +0 -7
  323. /package/dist/{components/Listbox → collections}/optionId.d.ts +0 -0
@@ -0,0 +1,27 @@
1
+ import type { RefObject } from "react";
2
+ interface FragmentTargetRevealOptions {
3
+ /**
4
+ * Whether the panel is closed and can be found, so the fragment's target may open it
5
+ */
6
+ findable: boolean;
7
+ /**
8
+ * Called when the page's URL fragment points inside the panel as it mounts
9
+ */
10
+ onMatch: () => void;
11
+ /**
12
+ * Whether the item is open
13
+ */
14
+ open: boolean;
15
+ /**
16
+ * The panel element
17
+ */
18
+ panelRef: RefObject<HTMLElement | null>;
19
+ }
20
+ /**
21
+ * Opens a closed panel when, as it mounts, the page's URL fragment points at an element inside it, and scrolls that
22
+ * element into view once the panel has opened
23
+ *
24
+ * @param options the panel, its state and what to do on a match
25
+ */
26
+ export declare function useFragmentTargetReveal({ findable, onMatch, open, panelRef }: FragmentTargetRevealOptions): void;
27
+ export {};
@@ -0,0 +1,36 @@
1
+ import { useEffect as e, useLayoutEffect as t, useRef as n } from "react";
2
+ import { c as r } from "react/compiler-runtime";
3
+ // src/components/Accordion/useFragmentTargetReveal.ts
4
+ function i(i) {
5
+ let o = r(8), { findable: s, onMatch: c, open: l, panelRef: u } = i, d = n(!1), f = n(null), p, m;
6
+ o[0] !== s || o[1] !== c || o[2] !== u ? (p = () => {
7
+ if (d.current) return;
8
+ d.current = !0;
9
+ let e = a();
10
+ s && e !== null && u.current?.contains(e) === !0 && (f.current = e, c());
11
+ }, m = [
12
+ s,
13
+ c,
14
+ u
15
+ ], o[0] = s, o[1] = c, o[2] = u, o[3] = p, o[4] = m) : (p = o[3], m = o[4]), t(p, m);
16
+ let h, g;
17
+ o[5] === l ? (h = o[6], g = o[7]) : (h = () => {
18
+ l && f.current !== null && (f.current.scrollIntoView(), f.current = null);
19
+ }, g = [l], o[5] = l, o[6] = h, o[7] = g), e(h, g);
20
+ }
21
+ function a() {
22
+ let e = window.location.hash.slice(1);
23
+ return e === "" ? null : o(e) ?? o(s(e));
24
+ }
25
+ function o(e) {
26
+ return document.getElementById(e) ?? Array.from(document.getElementsByName(e)).find((e) => e instanceof HTMLAnchorElement) ?? null;
27
+ }
28
+ function s(e) {
29
+ let t = new TextEncoder().encode(e), n = [];
30
+ for (let e = 0; e < t.length; e++) {
31
+ let r = String.fromCharCode(t[e + 1] ?? 0, t[e + 2] ?? 0);
32
+ t[e] === 37 && /^[\da-f]{2}$/i.test(r) ? (n.push(Number.parseInt(r, 16)), e += 2) : n.push(t[e]);
33
+ }
34
+ return new TextDecoder("utf-8", { ignoreBOM: !0 }).decode(new Uint8Array(n));
35
+ }
36
+ export { i as useFragmentTargetReveal };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Tells whether an item has been open at any time since it mounted
3
+ *
4
+ * @param open whether the item is open now
5
+ * @returns true once the item has opened, including while it is open
6
+ */
7
+ export declare function useHasOpened(open: boolean): boolean;
@@ -0,0 +1,7 @@
1
+ import { useState as e } from "react";
2
+ // src/components/Accordion/useHasOpened.ts
3
+ function t(t) {
4
+ let [n, r] = e(t);
5
+ return t && !n && r(!0), n || t;
6
+ }
7
+ export { t as useHasOpened };
@@ -4,7 +4,7 @@ import n from "./Alert.module.js";
4
4
  import { AlertIcon as r } from "./AlertIcon.js";
5
5
  import { clsx as i } from "clsx";
6
6
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
- //#region src/components/Alert/Alert.tsx
7
+ // src/components/Alert/Alert.tsx
8
8
  function s({ children: s, className: c, icon: l, title: u, tone: d = "info", ...f }) {
9
9
  let p = l !== null && l !== !1;
10
10
  return /* @__PURE__ */ o(t, {
@@ -24,5 +24,4 @@ function s({ children: s, className: c, icon: l, title: u, tone: d = "info", ...
24
24
  })]
25
25
  });
26
26
  }
27
- //#endregion
28
27
  export { s as Alert };
@@ -1,9 +1,8 @@
1
- import './Alert.css';//#region src/components/Alert/Alert.module.css
1
+ import './Alert.css';// src/components/Alert/Alert.module.css
2
2
  var e = "sui-alert-7cYyI", t = "sui-icon-Zg6SB", n = "sui-content-UXnmZ", r = "sui-title-abGgF", i = {
3
3
  alert: e,
4
4
  icon: t,
5
5
  content: n,
6
6
  title: r
7
7
  };
8
- //#endregion
9
8
  export { e as alert, n as content, i as default, t as icon, r as title };
@@ -1,7 +1,7 @@
1
1
  import { Box as e } from "../Box/Box.js";
2
2
  import { c as t } from "react/compiler-runtime";
3
3
  import { jsx as n, jsxs as r } from "react/jsx-runtime";
4
- //#region src/components/Alert/AlertIcon.tsx
4
+ // src/components/Alert/AlertIcon.tsx
5
5
  var i = {
6
6
  danger: "M15 9l-6 6M9 9l6 6",
7
7
  info: "M12 16v-4M12 8h.01",
@@ -39,5 +39,4 @@ function a(a) {
39
39
  children: [c, u]
40
40
  }), o[4] = c, o[5] = u, o[6] = d) : d = o[6], d;
41
41
  }
42
- //#endregion
43
42
  export { a as AlertIcon };
@@ -4,7 +4,7 @@ import { initialsOf as n } from "./initialsOf.js";
4
4
  import { clsx as r } from "clsx";
5
5
  import { useState as i } from "react";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
- //#region src/components/Avatar/Avatar.tsx
7
+ // src/components/Avatar/Avatar.tsx
8
8
  function o({ "aria-label": o, className: s, name: c, size: l = "md", src: u, ...d }) {
9
9
  let [f, p] = i(() => /* @__PURE__ */ new Set()), m = n(c), h = l === "xs" ? Array.from(m)[0] ?? "" : m, g = u !== void 0 && u !== "" && !f.has(u), _ = o === void 0 || o.trim() === "" ? c : o;
10
10
  return /* @__PURE__ */ a(e, {
@@ -23,5 +23,4 @@ function o({ "aria-label": o, className: s, name: c, size: l = "md", src: u, ...
23
23
  }) : h
24
24
  });
25
25
  }
26
- //#endregion
27
26
  export { o as Avatar };
@@ -1,7 +1,6 @@
1
- import './Avatar.css';//#region src/components/Avatar/Avatar.module.css
1
+ import './Avatar.css';// src/components/Avatar/Avatar.module.css
2
2
  var e = "sui-avatar-3xMuZ", t = "sui-image-ieqGp", n = {
3
3
  avatar: e,
4
4
  image: t
5
5
  };
6
- //#endregion
7
6
  export { e as avatar, n as default, t as image };
@@ -1,4 +1,4 @@
1
- //#region src/components/Avatar/initialsOf.ts
1
+ // src/components/Avatar/initialsOf.ts
2
2
  function e(e) {
3
3
  let n = e.split(/[^\p{L}\p{M}\p{N}]+/u).filter((e) => e !== "");
4
4
  return n.length === 0 ? "" : (n.length === 1 ? Array.from(n[0]).slice(0, 2) : n.slice(0, 2).map(t)).join("").toUpperCase();
@@ -6,5 +6,4 @@ function e(e) {
6
6
  function t(e) {
7
7
  return String.fromCodePoint(e.codePointAt(0) ?? 0);
8
8
  }
9
- //#endregion
10
9
  export { e as initialsOf };
@@ -5,7 +5,7 @@ import { clsx as r } from "clsx";
5
5
  import { Children as i } from "react";
6
6
  import { c as a } from "react/compiler-runtime";
7
7
  import { Fragment as o, jsx as s, jsxs as c } from "react/jsx-runtime";
8
- //#region src/components/AvatarGroup/AvatarGroup.tsx
8
+ // src/components/AvatarGroup/AvatarGroup.tsx
9
9
  function l(l) {
10
10
  let u = a(28), d, f, p, m;
11
11
  u[0] === l ? (d = u[1], f = u[2], p = u[3], m = u[4]) : ({children: d, className: f, max: p, ...m} = l, u[0] = l, u[1] = d, u[2] = f, u[3] = p, u[4] = m);
@@ -30,5 +30,4 @@ function l(l) {
30
30
  children: [x, S]
31
31
  }), u[20] = h, u[21] = _, u[22] = v, u[23] = y, u[24] = b, u[25] = x, u[26] = S, u[27] = C) : C = u[27], C;
32
32
  }
33
- //#endregion
34
33
  export { l as AvatarGroup };
@@ -1,7 +1,6 @@
1
- import './AvatarGroup.css';//#region src/components/AvatarGroup/AvatarGroup.module.css
1
+ import './AvatarGroup.css';// src/components/AvatarGroup/AvatarGroup.module.css
2
2
  var e = "sui-avatarGroup-P9iv8", t = "sui-overflow-JZIo-", n = {
3
3
  avatarGroup: e,
4
4
  overflow: t
5
5
  };
6
- //#endregion
7
6
  export { e as avatarGroup, n as default, t as overflow };
@@ -2,7 +2,7 @@ import { Box as e } from "../Box/Box.js";
2
2
  import t from "./Badge.module.js";
3
3
  import { clsx as n } from "clsx";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
- //#region src/components/Badge/Badge.tsx
5
+ // src/components/Badge/Badge.tsx
6
6
  function i({ as: i, className: a, tone: o = "neutral", variant: s = "subtle", ...c }) {
7
7
  return /* @__PURE__ */ r(e, {
8
8
  ...c,
@@ -12,5 +12,4 @@ function i({ as: i, className: a, tone: o = "neutral", variant: s = "subtle", ..
12
12
  "data-variant": s
13
13
  });
14
14
  }
15
- //#endregion
16
15
  export { i as Badge };
@@ -1,4 +1,3 @@
1
- import './Badge.css';//#region src/components/Badge/Badge.module.css
1
+ import './Badge.css';// src/components/Badge/Badge.module.css
2
2
  var e = "sui-badge-RsuMz", t = { badge: e };
3
- //#endregion
4
3
  export { e as badge, t as default };
@@ -2,7 +2,7 @@ import e from "./Box.module.js";
2
2
  import { clsx as t } from "clsx";
3
3
  import { c as n } from "react/compiler-runtime";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
- //#region src/components/Box/Box.tsx
5
+ // src/components/Box/Box.tsx
6
6
  function i(i) {
7
7
  let a = n(10), o, s, c;
8
8
  a[0] === i ? (o = a[1], s = a[2], c = a[3]) : ({as: o, className: s, ...c} = i, a[0] = i, a[1] = o, a[2] = s, a[3] = c);
@@ -14,5 +14,4 @@ function i(i) {
14
14
  ...c
15
15
  }), a[6] = l, a[7] = c, a[8] = u, a[9] = d) : d = a[9], d;
16
16
  }
17
- //#endregion
18
17
  export { i as Box };
@@ -1,4 +1,3 @@
1
- import './Box.css';//#region src/components/Box/Box.module.css
1
+ import './Box.css';// src/components/Box/Box.module.css
2
2
  var e = "sui-box-Wgbf3", t = { box: e };
3
- //#endregion
4
3
  export { e as box, t as default };
@@ -3,14 +3,10 @@ import { Spinner as t } from "../Spinner/Spinner.js";
3
3
  import n from "./Button.module.js";
4
4
  import { clsx as r } from "clsx";
5
5
  import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- //#region src/components/Button/Button.tsx
6
+ // src/components/Button/Button.tsx
7
7
  function o({ "aria-disabled": o, busy: s = !1, children: c, className: l, onClick: u, size: d = "md", type: f = "button", variant: p = "primary", ...m }) {
8
8
  function h(e) {
9
- if (s) {
10
- e.preventDefault();
11
- return;
12
- }
13
- u?.(e);
9
+ s ? e.preventDefault() : u?.(e);
14
10
  }
15
11
  return /* @__PURE__ */ a(e, {
16
12
  ...m,
@@ -25,5 +21,4 @@ function o({ "aria-disabled": o, busy: s = !1, children: c, className: l, onClic
25
21
  children: [c, s && /* @__PURE__ */ i(t, { className: n.spinner })]
26
22
  });
27
23
  }
28
- //#endregion
29
24
  export { o as Button };
@@ -1,7 +1,6 @@
1
- import './Button.css';//#region src/components/Button/Button.module.css
1
+ import './Button.css';// src/components/Button/Button.module.css
2
2
  var e = "sui-button-2ZuB7", t = "sui-spinner-ZExvW", n = {
3
3
  button: e,
4
4
  spinner: t
5
5
  };
6
- //#endregion
7
6
  export { e as button, n as default, t as spinner };
@@ -2,7 +2,7 @@ import { Box as e } from "../Box/Box.js";
2
2
  import t from "./Card.module.js";
3
3
  import { clsx as n } from "clsx";
4
4
  import { jsx as r } from "react/jsx-runtime";
5
- //#region src/components/Card/Card.tsx
5
+ // src/components/Card/Card.tsx
6
6
  function i({ as: i, className: a, padding: o = "md", ...s }) {
7
7
  return /* @__PURE__ */ r(e, {
8
8
  ...s,
@@ -11,5 +11,4 @@ function i({ as: i, className: a, padding: o = "md", ...s }) {
11
11
  "data-padding": o
12
12
  });
13
13
  }
14
- //#endregion
15
14
  export { i as Card };
@@ -1,4 +1,3 @@
1
- import './Card.css';//#region src/components/Card/Card.module.css
1
+ import './Card.css';// src/components/Card/Card.module.css
2
2
  var e = "sui-card-Cb1o4", t = { card: e };
3
- //#endregion
4
3
  export { e as card, t as default };
@@ -1,20 +1,19 @@
1
- import { Box as e } from "../Box/Box.js";
2
- import { spaceValue as t } from "../../layout/spaceValue.js";
3
- import { withCustomProperties as n } from "../../layout/withCustomProperties.js";
1
+ import { spaceValue as e } from "../../layout/spaceValue.js";
2
+ import { withCustomProperties as t } from "../../layout/withCustomProperties.js";
3
+ import { Box as n } from "../Box/Box.js";
4
4
  import r from "./Center.module.js";
5
5
  import { clsx as i } from "clsx";
6
6
  import { jsx as a } from "react/jsx-runtime";
7
- //#region src/components/Center/Center.tsx
7
+ // src/components/Center/Center.tsx
8
8
  function o({ as: o, className: s, gutter: c = 4, intrinsic: l = !1, width: u = "content", ...d }) {
9
9
  let { style: f, ...p } = d;
10
- return /* @__PURE__ */ a(e, {
10
+ return /* @__PURE__ */ a(n, {
11
11
  ...p,
12
12
  as: o,
13
13
  className: i(r.center, s),
14
- style: n({ "--sui-center-gutter": t(c) }, f),
14
+ style: t({ "--sui-center-gutter": e(c) }, f),
15
15
  "data-intrinsic": l ? "" : void 0,
16
16
  "data-width": u
17
17
  });
18
18
  }
19
- //#endregion
20
19
  export { o as Center };
@@ -1,4 +1,3 @@
1
- import './Center.css';//#region src/components/Center/Center.module.css
1
+ import './Center.css';// src/components/Center/Center.module.css
2
2
  var e = "sui-center-Pu1Pf", t = { center: e };
3
- //#endregion
4
3
  export { e as center, t as default };
@@ -1,7 +1,7 @@
1
1
  import { ChoiceControl as e } from "../ChoiceControl/ChoiceControl.js";
2
2
  import { c as t } from "react/compiler-runtime";
3
3
  import { jsx as n } from "react/jsx-runtime";
4
- //#region src/components/Checkbox/Checkbox.tsx
4
+ // src/components/Checkbox/Checkbox.tsx
5
5
  function r(r) {
6
6
  let i = t(2), a;
7
7
  return i[0] === r ? a = i[1] : (a = /* @__PURE__ */ n(e, {
@@ -9,5 +9,4 @@ function r(r) {
9
9
  kind: "checkbox"
10
10
  }), i[0] = r, i[1] = a), a;
11
11
  }
12
- //#endregion
13
12
  export { r as Checkbox };
@@ -6,7 +6,7 @@ import i from "./ChoiceControl.module.js";
6
6
  import { clsx as a } from "clsx";
7
7
  import { c as o } from "react/compiler-runtime";
8
8
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
9
- //#region src/components/ChoiceControl/ChoiceControl.tsx
9
+ // src/components/ChoiceControl/ChoiceControl.tsx
10
10
  function l(l) {
11
11
  let u = o(31), d, f, p, m, h, g;
12
12
  u[0] === l ? (d = u[1], f = u[2], p = u[3], m = u[4], h = u[5], g = u[6]) : ({children: d, className: f, kind: m, role: h, style: g, ...p} = l, u[0] = l, u[1] = d, u[2] = f, u[3] = p, u[4] = m, u[5] = h, u[6] = g);
@@ -36,5 +36,4 @@ function l(l) {
36
36
  children: [w, T]
37
37
  }), u[23] = v, u[24] = m, u[25] = g, u[26] = b, u[27] = x, u[28] = w, u[29] = T, u[30] = E) : E = u[30], E;
38
38
  }
39
- //#endregion
40
39
  export { l as ChoiceControl };
@@ -1,9 +1,8 @@
1
- import './ChoiceControl.css';//#region src/components/ChoiceControl/ChoiceControl.module.css
1
+ import './ChoiceControl.css';// src/components/ChoiceControl/ChoiceControl.module.css
2
2
  var e = "sui-choiceControl-aSGqz", t = "sui-withText-bNY-W", n = "sui-input-DF-cI", r = "sui-text-4-Caz", i = {
3
3
  choiceControl: e,
4
4
  withText: t,
5
5
  input: n,
6
6
  text: r
7
7
  };
8
- //#endregion
9
8
  export { e as choiceControl, i as default, n as input, r as text, t as withText };
@@ -1,6 +1,6 @@
1
1
  import { HorizontalFlow as e } from "../HorizontalFlow/HorizontalFlow.js";
2
2
  import { jsx as t } from "react/jsx-runtime";
3
- //#region src/components/Cluster/Cluster.tsx
3
+ // src/components/Cluster/Cluster.tsx
4
4
  function n({ align: n = "center", gap: r = 2, justify: i = "start", ...a }) {
5
5
  return /* @__PURE__ */ t(e, {
6
6
  ...a,
@@ -10,5 +10,4 @@ function n({ align: n = "center", gap: r = 2, justify: i = "start", ...a }) {
10
10
  wrap: !0
11
11
  });
12
12
  }
13
- //#endregion
14
13
  export { n as Cluster };
@@ -3,7 +3,7 @@ import t from "./Code.module.js";
3
3
  import { clsx as n } from "clsx";
4
4
  import { c as r } from "react/compiler-runtime";
5
5
  import { jsx as i } from "react/jsx-runtime";
6
- //#region src/components/Code/Code.tsx
6
+ // src/components/Code/Code.tsx
7
7
  function a(a) {
8
8
  let o = r(8), s, c;
9
9
  o[0] === a ? (s = o[1], c = o[2]) : ({className: s, ...c} = a, o[0] = a, o[1] = s, o[2] = c);
@@ -16,5 +16,4 @@ function a(a) {
16
16
  className: l
17
17
  }), o[5] = c, o[6] = l, o[7] = u) : u = o[7], u;
18
18
  }
19
- //#endregion
20
19
  export { a as Code };
@@ -1,4 +1,3 @@
1
- import './Code.css';//#region src/components/Code/Code.module.css
1
+ import './Code.css';// src/components/Code/Code.module.css
2
2
  var e = "sui-code-arLxg", t = { code: e };
3
- //#endregion
4
3
  export { e as code, t as default };
@@ -0,0 +1,83 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ import type { ControlSize } from "../../forms";
3
+ import type { BoxProps } from "../Box";
4
+ import type { ComboboxFilter } from "./ComboboxContext";
5
+ import type { ComboboxPlacement } from "./ComboboxPopup";
6
+ interface AutocompleteOwnProps {
7
+ /**
8
+ * The `ComboboxOption`s
9
+ */
10
+ children?: ReactNode;
11
+ /**
12
+ * The text the input starts with when `inputValue` is not given. Defaults to the selected option's text.
13
+ */
14
+ defaultInputValue?: string;
15
+ /**
16
+ * The option selected at first, which leaves the selection uncontrolled. Defaults to none.
17
+ */
18
+ defaultValue?: string | null;
19
+ /**
20
+ * Whether an option shows for the typed text. Defaults to the option's text containing it, ignoring case and
21
+ * accents. Null shows every option rendered, for a list filtered elsewhere, such as on a server; typing then makes no
22
+ * option active, since the options for the text are still to come.
23
+ */
24
+ filter?: ComboboxFilter | null;
25
+ /**
26
+ * The text in the input, which makes it controlled: update it from `onInputValueChange`
27
+ */
28
+ inputValue?: string;
29
+ /**
30
+ * Adds a hidden input that submits the selected value with a form under this name
31
+ */
32
+ name?: string;
33
+ /**
34
+ * Called with the text as the user types, with an option's text when they commit it, and with the selected
35
+ * option's text, or none, when focus leaves
36
+ */
37
+ onInputValueChange?: (inputValue: string) => void;
38
+ /**
39
+ * Called with the value of the option the user commits, or null when they clear the input with Escape
40
+ */
41
+ onValueChange?: (value: string | null) => void;
42
+ /**
43
+ * Where the list opens. It flips to the other side when there is no room. Defaults to `bottom-start`.
44
+ */
45
+ placement?: ComboboxPlacement;
46
+ /**
47
+ * What the live region says, and the empty list shows, for a number of matching options. Defaults to English:
48
+ * "No results", "1 result", "12 results".
49
+ */
50
+ resultsLabel?: (count: number) => string;
51
+ /**
52
+ * Height of the input, matching the `Button` sizes. Takes the place of the native `size` attribute. Defaults to
53
+ * `md`.
54
+ */
55
+ size?: ControlSize;
56
+ /**
57
+ * The selected option, or null for none, which makes the selection controlled: update it from `onValueChange`
58
+ */
59
+ value?: string | null;
60
+ }
61
+ /**
62
+ * Props for `Autocomplete`: its own props plus every `input` prop except those the combobox pattern sets
63
+ */
64
+ export interface AutocompleteProps extends AutocompleteOwnProps, Omit<BoxProps<"input">, "aria-activedescendant" | "aria-autocomplete" | "aria-controls" | "aria-expanded" | "as" | "children" | "dangerouslySetInnerHTML" | "defaultValue" | "role" | "size" | "type" | "value" | keyof AutocompleteOwnProps> {
65
+ }
66
+ /**
67
+ * A text input that filters a list of options as the user types, following the WAI-ARIA combobox pattern with list
68
+ * autocomplete, to choose one of many options by typing part of its name. Typing opens the list and makes the first
69
+ * match active; the arrow keys move through it; Enter or a click chooses an option, putting its text in the input;
70
+ * Escape closes the list, and then clears the input. Only an option can be the value: when focus leaves, the input shows
71
+ * the selected option's text again. The number of matches is announced once typing pauses. Inside a `Field` it takes
72
+ * its label, description, error, and required and disabled state from the field; outside one, give it an `aria-label`.
73
+ *
74
+ * @example
75
+ * <Field label="Country">
76
+ * <Autocomplete name="country" onValueChange={setCountry} value={country}>
77
+ * <ComboboxOption value="fr">France</ComboboxOption>
78
+ * <ComboboxOption value="jp">Japan</ComboboxOption>
79
+ * </Autocomplete>
80
+ * </Field>
81
+ */
82
+ export declare function Autocomplete({ children, className, defaultInputValue, defaultValue, filter, inputValue, name, onInputValueChange, onValueChange, placement, resultsLabel, size, value, ...rest }: AutocompleteProps): JSX.Element;
83
+ export {};
@@ -0,0 +1,102 @@
1
+ import { useFieldControl as e } from "../../forms/useFieldControl.js";
2
+ import { anchorNameFor as t } from "../../overlays/anchorNameFor.js";
3
+ import { mergeProps as n } from "../../overlays/mergeProps.js";
4
+ import { Box as r } from "../Box/Box.js";
5
+ import { ChevronDownIcon as i } from "../Icon/ChevronDownIcon.js";
6
+ import { TextControl as a } from "../TextControl/TextControl.js";
7
+ import { VisuallyHidden as o } from "../VisuallyHidden/VisuallyHidden.js";
8
+ import s from "./Combobox.module.js";
9
+ import { ComboboxPopup as c } from "./ComboboxPopup.js";
10
+ import { handleAutocompleteKey as l } from "./autocompleteKeys.js";
11
+ import { containsText as u } from "./containsText.js";
12
+ import { useAutocompleteText as d } from "./useAutocompleteText.js";
13
+ import { useComboboxList as f } from "./useComboboxList.js";
14
+ import { useComboboxSelection as p } from "./useComboboxSelection.js";
15
+ import { useResultsAnnouncement as m } from "./useResultsAnnouncement.js";
16
+ import { clsx as h } from "clsx";
17
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
18
+ // src/components/Combobox/Autocomplete.tsx
19
+ function y({ children: y, className: x, defaultInputValue: S, defaultValue: C = null, filter: w = u, inputValue: T, name: E, onInputValueChange: D, onValueChange: O, placement: k = "bottom-start", resultsLabel: A = b, size: j = "md", value: M, ...N }) {
20
+ let P = e(N), F = p({
21
+ defaultValue: C,
22
+ onValueChange: O,
23
+ value: M
24
+ }), I = d({
25
+ defaultInputValue: S,
26
+ inputValue: T,
27
+ onInputValueChange: D,
28
+ selectedText: F.selectedContent?.text
29
+ }), L = f({
30
+ controlId: P.id,
31
+ filter: w,
32
+ onCommit: I.commit,
33
+ query: I.query,
34
+ selection: F
35
+ }), { announceCount: R, announcement: z } = m(A, L.countShown, L.open), B = I.shown, V = { anchorName: t(L.listId) }, H = N.readOnly === !0;
36
+ function U(e) {
37
+ let t = e.currentTarget.value;
38
+ I.edit(t), L.openList("none", "keyboard"), L.matchFirst(), R();
39
+ }
40
+ function W(e) {
41
+ let t = {
42
+ commit: I.commit,
43
+ editing: I.editing,
44
+ shown: B
45
+ };
46
+ !e.defaultPrevented && !H && l(e, L, t) && e.preventDefault();
47
+ }
48
+ function G(e) {
49
+ e.defaultPrevented || H || L.open || L.openList("none", "pointer");
50
+ }
51
+ function K(e) {
52
+ L.close(), e.currentTarget.ownerDocument.hasFocus() && I.restore();
53
+ }
54
+ return /* @__PURE__ */ v(g, { children: [
55
+ /* @__PURE__ */ v(r, {
56
+ as: "span",
57
+ className: s.inputFrame,
58
+ "data-disabled": P.disabled === !0 ? "" : void 0,
59
+ "data-size": j,
60
+ children: [/* @__PURE__ */ _(a, {
61
+ autoComplete: "off",
62
+ ...n(N, {
63
+ onBlur: K,
64
+ onChange: U,
65
+ onClick: G,
66
+ onKeyDown: W,
67
+ style: V
68
+ }),
69
+ as: "input",
70
+ className: h(s.input, x),
71
+ id: L.controlId,
72
+ role: "combobox",
73
+ size: j,
74
+ type: "text",
75
+ value: B,
76
+ "aria-activedescendant": L.activeDescendant,
77
+ "aria-autocomplete": "list",
78
+ "aria-controls": L.listId,
79
+ "aria-expanded": L.open
80
+ }), /* @__PURE__ */ _(i, { className: s.chevron })]
81
+ }),
82
+ /* @__PURE__ */ _(c, {
83
+ "aria-label": N["aria-label"],
84
+ "aria-labelledby": N["aria-labelledby"],
85
+ disabled: P.disabled,
86
+ emptyMessage: A(0),
87
+ form: N.form,
88
+ list: L,
89
+ name: E,
90
+ placement: k,
91
+ children: y
92
+ }),
93
+ /* @__PURE__ */ _(o, {
94
+ "aria-live": "polite",
95
+ children: z
96
+ })
97
+ ] });
98
+ }
99
+ function b(e) {
100
+ return e === 0 ? "No results" : e === 1 ? "1 result" : `${e} results`;
101
+ }
102
+ export { y as Autocomplete };
@@ -0,0 +1 @@
1
+ .sui-field-BenH0{align-items:center;gap:var(--sui-space-2,.5rem);text-align:start;cursor:default;min-inline-size:0;display:inline-flex}.sui-placeholder-NQX-b,.sui-fieldLabel-zBN6l{text-overflow:ellipsis;white-space:nowrap;flex:1;min-inline-size:0;overflow:hidden}.sui-placeholder-NQX-b{color:var(--sui-color-text-muted,#4b5563)}.sui-fieldLeading-4y-j7{flex:none;align-items:center;block-size:1lh;display:flex}.sui-chevron-NVqyn{flex:none;transition:rotate .12s}[aria-expanded=true]+.sui-chevron-NVqyn,[aria-expanded=true]>.sui-chevron-NVqyn{rotate:180deg}.sui-inputFrame-mYx2Q{--_sui-combobox-chevron-inset:var(--sui-space-4,1rem);align-items:center;display:inline-grid}.sui-inputFrame-mYx2Q[data-size=sm]{--_sui-combobox-chevron-inset:var(--sui-space-3,.75rem)}.sui-inputFrame-mYx2Q[data-size=lg]{--_sui-combobox-chevron-inset:var(--sui-space-6,1.5rem)}.sui-inputFrame-mYx2Q>*{grid-area:1/1}.sui-inputFrame-mYx2Q .sui-input--HTv1{padding-inline-end:calc(var(--_sui-combobox-chevron-inset) + 1em + var(--sui-space-2,.5rem))}.sui-inputFrame-mYx2Q .sui-chevron-NVqyn{color:var(--sui-color-text,#111827);pointer-events:none;justify-self:end;margin-inline-end:var(--_sui-combobox-chevron-inset)}.sui-inputFrame-mYx2Q[data-disabled] .sui-chevron-NVqyn{opacity:.5}.sui-popup-rsvuH:popover-open{min-inline-size:max(12rem, anchor-size(width));max-inline-size:min(max(20rem, anchor-size(width)), 100vw - var(--sui-space-2,.5rem) * 2);overflow:hidden}.sui-listbox-2wSrg{--_sui-menu-leading-column:calc(1rem + var(--sui-space-2,.5rem));overscroll-behavior:contain;flex-direction:column;flex:auto;gap:1px;min-block-size:0;display:flex;overflow-y:auto}.sui-option-vhhn5[hidden]{display:none}.sui-option-vhhn5 .sui-check-9yQbP{color:var(--_sui-menu-ink)}.sui-optionLeading-kXakJ{opacity:var(--_sui-menu-part-opacity,1);flex:none;align-items:center;display:flex}.sui-empty-Ahw5K{min-block-size:2rem;padding:var(--sui-space-1,.25rem) var(--sui-space-2,.5rem);color:var(--sui-color-text-muted,#4b5563);align-items:center;display:none}.sui-listbox-2wSrg[data-empty]+.sui-empty-Ahw5K{display:flex}