@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
package/dist/index.js CHANGED
@@ -1,67 +1,92 @@
1
- import { Box as e } from "./components/Box/Box.js";
2
- import { Alert as t } from "./components/Alert/Alert.js";
3
- import { Avatar as n } from "./components/Avatar/Avatar.js";
4
- import { VisuallyHidden as r } from "./components/VisuallyHidden/VisuallyHidden.js";
1
+ import { Accordion as e } from "./components/Accordion/Accordion.js";
2
+ import { AccordionItem as t } from "./components/Accordion/AccordionItem.js";
3
+ import { Alert as n } from "./components/Alert/Alert.js";
4
+ import { Avatar as r } from "./components/Avatar/Avatar.js";
5
5
  import { AvatarGroup as i } from "./components/AvatarGroup/AvatarGroup.js";
6
6
  import { Badge as a } from "./components/Badge/Badge.js";
7
- import { Button as o } from "./components/Button/Button.js";
8
- import { Card as s } from "./components/Card/Card.js";
9
- import { Center as c } from "./components/Center/Center.js";
10
- import { Checkbox as l } from "./components/Checkbox/Checkbox.js";
11
- import { Cluster as u } from "./components/Cluster/Cluster.js";
12
- import { Code as d } from "./components/Code/Code.js";
13
- import { Counter as f } from "./components/Counter/Counter.js";
14
- import { Cover as p } from "./components/Cover/Cover.js";
15
- import { Divider as m } from "./components/Divider/Divider.js";
16
- import { Field as h } from "./components/Field/Field.js";
17
- import { Fieldset as g } from "./components/Fieldset/Fieldset.js";
18
- import { Frame as _ } from "./components/Frame/Frame.js";
19
- import { Grid as v } from "./components/Grid/Grid.js";
20
- import { Heading as y } from "./components/Heading/Heading.js";
21
- import { AddIcon as b } from "./components/Icon/AddIcon.js";
22
- import { ChevronDownIcon as x } from "./components/Icon/ChevronDownIcon.js";
23
- import { CloseIcon as S } from "./components/Icon/CloseIcon.js";
24
- import { ColorModeIcon as C } from "./components/Icon/ColorModeIcon.js";
25
- import { DeleteIcon as w } from "./components/Icon/DeleteIcon.js";
26
- import { InfoIcon as T } from "./components/Icon/InfoIcon.js";
27
- import { MoreHorizontalIcon as E } from "./components/Icon/MoreHorizontalIcon.js";
28
- import { MoreVerticalIcon as D } from "./components/Icon/MoreVerticalIcon.js";
29
- import { PaletteIcon as O } from "./components/Icon/PaletteIcon.js";
30
- import { RefreshIcon as k } from "./components/Icon/RefreshIcon.js";
31
- import { RemoveIcon as A } from "./components/Icon/RemoveIcon.js";
32
- import { SendIcon as j } from "./components/Icon/SendIcon.js";
33
- import { Kbd as M } from "./components/Kbd/Kbd.js";
34
- import { Tooltip as N } from "./components/Tooltip/Tooltip.js";
35
- import { useTooltip as P } from "./components/Tooltip/useTooltip.js";
36
- import { IconButton as F } from "./components/IconButton/IconButton.js";
37
- import { Link as I } from "./components/Link/Link.js";
38
- import { Listbox as L } from "./components/Listbox/Listbox.js";
39
- import { ListboxOption as R } from "./components/Listbox/ListboxOption.js";
40
- import { NavList as z } from "./components/NavList/NavList.js";
41
- import { NavListGroup as B } from "./components/NavList/NavListGroup.js";
42
- import { NavListItem as V } from "./components/NavList/NavListItem.js";
43
- import { PageLayout as H } from "./components/PageLayout/PageLayout.js";
44
- import { Popover as U } from "./components/Popover/Popover.js";
45
- import { usePopover as W } from "./components/Popover/usePopover.js";
46
- import { Prose as G } from "./components/Prose/Prose.js";
47
- import { Radio as K } from "./components/Radio/Radio.js";
48
- import { RadioGroup as q } from "./components/RadioGroup/RadioGroup.js";
49
- import { Row as J } from "./components/Row/Row.js";
50
- import { Segment as Y } from "./components/SegmentedControl/Segment.js";
51
- import { SegmentedControl as X } from "./components/SegmentedControl/SegmentedControl.js";
52
- import { Select as Z } from "./components/Select/Select.js";
53
- import { Sidebar as Q } from "./components/Sidebar/Sidebar.js";
54
- import { SkipLink as $ } from "./components/SkipLink/SkipLink.js";
55
- import { Stack as ee } from "./components/Stack/Stack.js";
56
- import { StatusDot as te } from "./components/StatusDot/StatusDot.js";
57
- import { Switch as ne } from "./components/Switch/Switch.js";
58
- import { Switcher as re } from "./components/Switcher/Switcher.js";
59
- import { Tab as ie } from "./components/Tabs/Tab.js";
60
- import { TabList as ae } from "./components/Tabs/TabList.js";
61
- import { TabPanel as oe } from "./components/Tabs/TabPanel.js";
62
- import { Tabs as se } from "./components/Tabs/Tabs.js";
63
- import { Text as ce } from "./components/Text/Text.js";
64
- import { Textarea as le } from "./components/Textarea/Textarea.js";
65
- import { TextInput as ue } from "./components/TextInput/TextInput.js";
66
- import { Theme as de } from "./components/Theme/Theme.js";
67
- export { b as AddIcon, t as Alert, n as Avatar, i as AvatarGroup, a as Badge, e as Box, o as Button, s as Card, c as Center, l as Checkbox, x as ChevronDownIcon, S as CloseIcon, u as Cluster, d as Code, C as ColorModeIcon, f as Counter, p as Cover, w as DeleteIcon, m as Divider, h as Field, g as Fieldset, _ as Frame, v as Grid, y as Heading, F as IconButton, T as InfoIcon, M as Kbd, I as Link, L as Listbox, R as ListboxOption, E as MoreHorizontalIcon, D as MoreVerticalIcon, z as NavList, B as NavListGroup, V as NavListItem, H as PageLayout, O as PaletteIcon, U as Popover, G as Prose, K as Radio, q as RadioGroup, k as RefreshIcon, A as RemoveIcon, J as Row, Y as Segment, X as SegmentedControl, Z as Select, j as SendIcon, Q as Sidebar, $ as SkipLink, ee as Stack, te as StatusDot, ne as Switch, re as Switcher, ie as Tab, ae as TabList, oe as TabPanel, se as Tabs, ce as Text, ue as TextInput, le as Textarea, de as Theme, N as Tooltip, r as VisuallyHidden, W as usePopover, P as useTooltip };
7
+ import { Box as o } from "./components/Box/Box.js";
8
+ import { Button as s } from "./components/Button/Button.js";
9
+ import { Card as c } from "./components/Card/Card.js";
10
+ import { Center as l } from "./components/Center/Center.js";
11
+ import { Checkbox as u } from "./components/Checkbox/Checkbox.js";
12
+ import { Cluster as d } from "./components/Cluster/Cluster.js";
13
+ import { Code as f } from "./components/Code/Code.js";
14
+ import { Autocomplete as p } from "./components/Combobox/Autocomplete.js";
15
+ import { Combobox as m } from "./components/Combobox/Combobox.js";
16
+ import { ComboboxOption as h } from "./components/Combobox/ComboboxOption.js";
17
+ import { useContextMenu as g } from "./components/ContextMenu/useContextMenu.js";
18
+ import { Counter as _ } from "./components/Counter/Counter.js";
19
+ import { Cover as v } from "./components/Cover/Cover.js";
20
+ import { Divider as y } from "./components/Divider/Divider.js";
21
+ import { Field as b } from "./components/Field/Field.js";
22
+ import { Fieldset as x } from "./components/Fieldset/Fieldset.js";
23
+ import { Frame as S } from "./components/Frame/Frame.js";
24
+ import { Grid as C } from "./components/Grid/Grid.js";
25
+ import { Heading as w } from "./components/Heading/Heading.js";
26
+ import { AddIcon as T } from "./components/Icon/AddIcon.js";
27
+ import { CheckIcon as E } from "./components/Icon/CheckIcon.js";
28
+ import { ChevronDownIcon as D } from "./components/Icon/ChevronDownIcon.js";
29
+ import { ChevronRightIcon as O } from "./components/Icon/ChevronRightIcon.js";
30
+ import { CloseIcon as k } from "./components/Icon/CloseIcon.js";
31
+ import { ColorModeIcon as A } from "./components/Icon/ColorModeIcon.js";
32
+ import { DeleteIcon as j } from "./components/Icon/DeleteIcon.js";
33
+ import { InfoIcon as M } from "./components/Icon/InfoIcon.js";
34
+ import { MenuIcon as N } from "./components/Icon/MenuIcon.js";
35
+ import { MoreHorizontalIcon as P } from "./components/Icon/MoreHorizontalIcon.js";
36
+ import { MoreVerticalIcon as F } from "./components/Icon/MoreVerticalIcon.js";
37
+ import { PaletteIcon as I } from "./components/Icon/PaletteIcon.js";
38
+ import { RefreshIcon as L } from "./components/Icon/RefreshIcon.js";
39
+ import { RemoveIcon as R } from "./components/Icon/RemoveIcon.js";
40
+ import { SendIcon as z } from "./components/Icon/SendIcon.js";
41
+ import { IconButton as B } from "./components/IconButton/IconButton.js";
42
+ import { Kbd as V } from "./components/Kbd/Kbd.js";
43
+ import { Link as H } from "./components/Link/Link.js";
44
+ import { Listbox as U } from "./components/Listbox/Listbox.js";
45
+ import { ListboxOption as W } from "./components/Listbox/ListboxOption.js";
46
+ import { Menu as G } from "./components/Menu/Menu.js";
47
+ import { MenuGroup as K } from "./components/Menu/MenuGroup.js";
48
+ import { MenuItem as q } from "./components/Menu/MenuItem.js";
49
+ import { MenuItemCheckbox as J } from "./components/Menu/MenuItemCheckbox.js";
50
+ import { MenuItemRadio as Y } from "./components/Menu/MenuItemRadio.js";
51
+ import { MenuRadioGroup as X } from "./components/Menu/MenuRadioGroup.js";
52
+ import { MenuSeparator as Z } from "./components/Menu/MenuSeparator.js";
53
+ import { Submenu as Q } from "./components/Menu/Submenu.js";
54
+ import { useMenu as $ } from "./components/Menu/useMenu.js";
55
+ import { Menubar as ee } from "./components/Menubar/Menubar.js";
56
+ import { MenubarMenu as te } from "./components/Menubar/MenubarMenu.js";
57
+ import { NavBar as ne } from "./components/NavBar/NavBar.js";
58
+ import { NavBarItem as re } from "./components/NavBar/NavBarItem.js";
59
+ import { NavBarMenu as ie } from "./components/NavBar/NavBarMenu.js";
60
+ import { NavBarMenuGroup as ae } from "./components/NavBar/NavBarMenuGroup.js";
61
+ import { NavBarMenuItem as oe } from "./components/NavBar/NavBarMenuItem.js";
62
+ import { NavList as se } from "./components/NavList/NavList.js";
63
+ import { NavListGroup as ce } from "./components/NavList/NavListGroup.js";
64
+ import { NavListItem as le } from "./components/NavList/NavListItem.js";
65
+ import { PageLayout as ue } from "./components/PageLayout/PageLayout.js";
66
+ import { Popover as de } from "./components/Popover/Popover.js";
67
+ import { usePopover as fe } from "./components/Popover/usePopover.js";
68
+ import { Prose as pe } from "./components/Prose/Prose.js";
69
+ import { Radio as me } from "./components/Radio/Radio.js";
70
+ import { RadioGroup as he } from "./components/RadioGroup/RadioGroup.js";
71
+ import { Row as ge } from "./components/Row/Row.js";
72
+ import { Segment as _e } from "./components/SegmentedControl/Segment.js";
73
+ import { SegmentedControl as ve } from "./components/SegmentedControl/SegmentedControl.js";
74
+ import { Select as ye } from "./components/Select/Select.js";
75
+ import { Sidebar as be } from "./components/Sidebar/Sidebar.js";
76
+ import { SkipLink as xe } from "./components/SkipLink/SkipLink.js";
77
+ import { Stack as Se } from "./components/Stack/Stack.js";
78
+ import { StatusDot as Ce } from "./components/StatusDot/StatusDot.js";
79
+ import { Switch as we } from "./components/Switch/Switch.js";
80
+ import { Switcher as Te } from "./components/Switcher/Switcher.js";
81
+ import { Tab as Ee } from "./components/Tabs/Tab.js";
82
+ import { TabList as De } from "./components/Tabs/TabList.js";
83
+ import { TabPanel as Oe } from "./components/Tabs/TabPanel.js";
84
+ import { Tabs as ke } from "./components/Tabs/Tabs.js";
85
+ import { Text as Ae } from "./components/Text/Text.js";
86
+ import { Textarea as je } from "./components/Textarea/Textarea.js";
87
+ import { TextInput as Me } from "./components/TextInput/TextInput.js";
88
+ import { Theme as Ne } from "./components/Theme/Theme.js";
89
+ import { Tooltip as Pe } from "./components/Tooltip/Tooltip.js";
90
+ import { useTooltip as Fe } from "./components/Tooltip/useTooltip.js";
91
+ import { VisuallyHidden as Ie } from "./components/VisuallyHidden/VisuallyHidden.js";
92
+ export { e as Accordion, t as AccordionItem, T as AddIcon, n as Alert, p as Autocomplete, r as Avatar, i as AvatarGroup, a as Badge, o as Box, s as Button, c as Card, l as Center, E as CheckIcon, u as Checkbox, D as ChevronDownIcon, O as ChevronRightIcon, k as CloseIcon, d as Cluster, f as Code, A as ColorModeIcon, m as Combobox, h as ComboboxOption, _ as Counter, v as Cover, j as DeleteIcon, y as Divider, b as Field, x as Fieldset, S as Frame, C as Grid, w as Heading, B as IconButton, M as InfoIcon, V as Kbd, H as Link, U as Listbox, W as ListboxOption, G as Menu, K as MenuGroup, N as MenuIcon, q as MenuItem, J as MenuItemCheckbox, Y as MenuItemRadio, X as MenuRadioGroup, Z as MenuSeparator, ee as Menubar, te as MenubarMenu, P as MoreHorizontalIcon, F as MoreVerticalIcon, ne as NavBar, re as NavBarItem, ie as NavBarMenu, ae as NavBarMenuGroup, oe as NavBarMenuItem, se as NavList, ce as NavListGroup, le as NavListItem, ue as PageLayout, I as PaletteIcon, de as Popover, pe as Prose, me as Radio, he as RadioGroup, L as RefreshIcon, R as RemoveIcon, ge as Row, _e as Segment, ve as SegmentedControl, ye as Select, z as SendIcon, be as Sidebar, xe as SkipLink, Se as Stack, Ce as StatusDot, Q as Submenu, we as Switch, Te as Switcher, Ee as Tab, De as TabList, Oe as TabPanel, ke as Tabs, Ae as Text, Me as TextInput, je as Textarea, Ne as Theme, Pe as Tooltip, Ie as VisuallyHidden, g as useContextMenu, $ as useMenu, fe as usePopover, Fe as useTooltip };
@@ -1,6 +1,5 @@
1
- //#region src/layout/listRole.ts
1
+ // src/layout/listRole.ts
2
2
  function e(e, t) {
3
3
  return t === void 0 && (e === "ul" || e === "ol") ? "list" : t;
4
4
  }
5
- //#endregion
6
5
  export { e as listRole };
@@ -1,6 +1,5 @@
1
- //#region src/layout/spaceValue.ts
1
+ // src/layout/spaceValue.ts
2
2
  function e(e) {
3
3
  return e === 0 ? "0px" : `var(--sui-space-${e}, ${e * .25}rem)`;
4
4
  }
5
- //#endregion
6
5
  export { e as spaceValue };
@@ -1,9 +1,8 @@
1
- //#region src/layout/withCustomProperties.ts
1
+ // src/layout/withCustomProperties.ts
2
2
  function e(e, t) {
3
3
  return {
4
4
  ...e,
5
5
  ...t
6
6
  };
7
7
  }
8
- //#endregion
9
8
  export { e as withCustomProperties };
@@ -0,0 +1,17 @@
1
+ import type { ComponentPropsWithRef, JSXElementConstructor } from "react";
2
+ /**
3
+ * What a link-or-button component can render: a link, a button, or a component that renders an anchor, such as a
4
+ * router's link
5
+ */
6
+ export type LinkOrButtonElement = "a" | "button" | JSXElementConstructor<never>;
7
+ type PropsOnlyOn<Element extends "a" | "button", Other extends "a" | "button"> = {
8
+ [Name in Exclude<keyof ComponentPropsWithRef<Element>, keyof ComponentPropsWithRef<Other>>]?: never;
9
+ };
10
+ type ElementProps<E extends LinkOrButtonElement> = E extends JSXElementConstructor<infer Props> ? Props : E extends "button" ? ComponentPropsWithRef<"button"> & PropsOnlyOn<"a", "button"> : ComponentPropsWithRef<"a"> & PropsOnlyOn<"button", "a">;
11
+ type OmitFromEach<Props, Name extends PropertyKey> = Props extends unknown ? Omit<Props, Name> : never;
12
+ /**
13
+ * The props of the link, button or component given in `as`, less the names a component sets itself. When `as` may be
14
+ * either a link or a button, only props both accept are allowed.
15
+ */
16
+ export type LinkOrButtonProps<E extends LinkOrButtonElement, Omitted extends PropertyKey> = OmitFromEach<ElementProps<E>, Omitted>;
17
+ export {};
@@ -0,0 +1 @@
1
+ export type { LinkOrButtonElement, LinkOrButtonProps } from "./LinkOrButtonProps";
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Hides an open menu when focus moves out of it, as a light dismiss would, leaving focus where it went
3
+ *
4
+ * @param menu the menu that lost focus
5
+ * @param relatedTarget the element taking focus, or `null` when focus is between elements or lost with an item that
6
+ * was removed, in which case the menu waits a task to see where it lands
7
+ * @param staysOn whether focus on an element outside the menu keeps it open, such as on its trigger
8
+ */
9
+ export declare function closeWhenFocusLeaves(menu: HTMLElement, relatedTarget: Element | null, staysOn: (focused: Element) => boolean): void;
@@ -0,0 +1,11 @@
1
+ import { syncPopover as e } from "../overlays/syncPopover.js";
2
+ // src/menus/closeWhenFocusLeaves.ts
3
+ function t(e, t, r) {
4
+ e.matches(":popover-open") && (t === null ? setTimeout(() => {
5
+ n(e, e.ownerDocument.activeElement, r);
6
+ }, 0) : n(e, t, r));
7
+ }
8
+ function n(t, n, r) {
9
+ (n === null || !t.contains(n) && !r(n)) && t.matches(":popover-open") && e(t, !1);
10
+ }
11
+ export { t as closeWhenFocusLeaves };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Moves focus to a menu item and scrolls it into view within the menu, as far as it needs and no further
3
+ *
4
+ * @param item the item to focus
5
+ */
6
+ export declare function focusItem(item: HTMLElement): void;
@@ -0,0 +1,9 @@
1
+ // src/menus/focusItem.ts
2
+ var e = {
3
+ block: "nearest",
4
+ container: "nearest"
5
+ };
6
+ function t(t) {
7
+ t.focus({ preventScroll: !0 }), t.scrollIntoView(e);
8
+ }
9
+ export { t as focusItem };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Where focus goes as a menu opens: its first or last item, or the menu itself
3
+ */
4
+ export type OpeningFocus = "first" | "last" | "menu";
5
+ /**
6
+ * Moves focus into a menu that has just opened
7
+ *
8
+ * @param menu the menu element
9
+ * @param openingFocus where focus goes; a menu with no items takes it itself
10
+ */
11
+ export declare function focusOnOpening(menu: HTMLElement, openingFocus: OpeningFocus): void;
@@ -0,0 +1,11 @@
1
+ import { renderedItems as e } from "./renderedItems.js";
2
+ // src/menus/focusOnOpening.ts
3
+ function t(t, n) {
4
+ let r = e(t);
5
+ ({
6
+ first: r.at(0),
7
+ last: r.at(-1),
8
+ menu: t
9
+ }[n] ?? t).focus();
10
+ }
11
+ export { t as focusOnOpening };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Whether a key was pressed with Alt, Ctrl or Meta, which leaves it to the browser and the app
3
+ *
4
+ * @param event the key event
5
+ * @returns true when any of the three was held
6
+ */
7
+ export declare function hasModifier(event: Pick<KeyboardEvent, "altKey" | "ctrlKey" | "metaKey">): boolean;
@@ -0,0 +1,5 @@
1
+ // src/menus/hasModifier.ts
2
+ function e(e) {
3
+ return e.altKey || e.ctrlKey || e.metaKey;
4
+ }
5
+ export { e as hasModifier };
@@ -0,0 +1,11 @@
1
+ export { closeWhenFocusLeaves } from "./closeWhenFocusLeaves";
2
+ export { focusItem } from "./focusItem";
3
+ export { focusOnOpening } from "./focusOnOpening";
4
+ export type { OpeningFocus } from "./focusOnOpening";
5
+ export { hasModifier } from "./hasModifier";
6
+ export { itemText } from "./itemText";
7
+ export { leaveMenuOnTab } from "./leaveMenuOnTab";
8
+ export { graceTriangle, isInsideTriangle } from "./pointerIntent";
9
+ export type { Point, Triangle } from "./pointerIntent";
10
+ export { renderedItems } from "./renderedItems";
11
+ export { watchRemovals } from "./watchRemovals";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Reads the text type-ahead matches for a menu item
3
+ *
4
+ * @param item the item element
5
+ * @returns the text of the elements its `aria-labelledby` names, joined by spaces, so a description or shortcut is
6
+ * left out; its own text when it names none in its document
7
+ */
8
+ export declare function itemText(item: HTMLElement): string;
@@ -0,0 +1,6 @@
1
+ // src/menus/itemText.ts
2
+ function e(e) {
3
+ let t = (e.getAttribute("aria-labelledby") ?? "").split(/\s+/).map((t) => e.ownerDocument.getElementById(t)).filter((e) => e !== null);
4
+ return t.length === 0 ? e.textContent ?? "" : t.map((e) => e.textContent).join(" ");
5
+ }
6
+ export { e as itemText };
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Closes a menu on Tab or Shift+Tab, moving focus back to where the menu was opened from. Tab then moves on from
3
+ * there, as though the menu were not there, and Shift+Tab stops there.
4
+ *
5
+ * @param event the key event the menu received
6
+ * @param returnTo the element focus goes back to; with none, the key is left alone
7
+ * @param close closes the menu
8
+ */
9
+ export declare function leaveMenuOnTab(event: Pick<KeyboardEvent, "altKey" | "ctrlKey" | "defaultPrevented" | "key" | "metaKey" | "preventDefault" | "shiftKey">, returnTo: HTMLElement | null, close: () => void): void;
@@ -0,0 +1,6 @@
1
+ import { hasModifier as e } from "./hasModifier.js";
2
+ // src/menus/leaveMenuOnTab.ts
3
+ function t(t, n, r) {
4
+ t.key !== "Tab" || n === null || t.defaultPrevented || e(t) || (t.shiftKey && t.preventDefault(), n.focus(), r());
5
+ }
6
+ export { t as leaveMenuOnTab };
@@ -0,0 +1,36 @@
1
+ /**
2
+ * A point in viewport coordinates, as a pointer event's `clientX` and `clientY` give it
3
+ */
4
+ export interface Point {
5
+ /**
6
+ * Distance from the viewport's left edge
7
+ */
8
+ x: number;
9
+ /**
10
+ * Distance from the viewport's top edge
11
+ */
12
+ y: number;
13
+ }
14
+ /**
15
+ * Three corners of a triangle
16
+ */
17
+ export type Triangle = readonly [Point, Point, Point];
18
+ /**
19
+ * The triangle a pointer crosses on its way from a submenu's item into the submenu, so moving diagonally over the
20
+ * items between does not close it
21
+ *
22
+ * @param exit where the pointer left the submenu's item
23
+ * @param submenu the submenu's bounds
24
+ * @returns the triangle from just behind the exit point to the two corners of the submenu's side facing it: its
25
+ * nearer side when the submenu sits beside the exit point, else its top or bottom
26
+ */
27
+ export declare function graceTriangle(exit: Point, { bottom, left, right, top }: DOMRectReadOnly): Triangle;
28
+ /**
29
+ * Whether a point is inside a triangle or on its edge
30
+ *
31
+ * @param point the point
32
+ * @param triangle the triangle
33
+ * @returns true when the point is inside or on an edge; false for a flat triangle, such as one to a submenu that has no
34
+ * size
35
+ */
36
+ export declare function isInsideTriangle(point: Point, [first, second, third]: Triangle): boolean;
@@ -0,0 +1,68 @@
1
+ function e(e, { bottom: t, left: n, right: r, top: i }) {
2
+ return e.x <= n ? [
3
+ {
4
+ x: e.x - 5,
5
+ y: e.y
6
+ },
7
+ {
8
+ x: n,
9
+ y: i
10
+ },
11
+ {
12
+ x: n,
13
+ y: t
14
+ }
15
+ ] : e.x >= r ? [
16
+ {
17
+ x: e.x + 5,
18
+ y: e.y
19
+ },
20
+ {
21
+ x: r,
22
+ y: i
23
+ },
24
+ {
25
+ x: r,
26
+ y: t
27
+ }
28
+ ] : e.y <= i ? [
29
+ {
30
+ x: e.x,
31
+ y: e.y - 5
32
+ },
33
+ {
34
+ x: n,
35
+ y: i
36
+ },
37
+ {
38
+ x: r,
39
+ y: i
40
+ }
41
+ ] : [
42
+ {
43
+ x: e.x,
44
+ y: e.y + 5
45
+ },
46
+ {
47
+ x: n,
48
+ y: t
49
+ },
50
+ {
51
+ x: r,
52
+ y: t
53
+ }
54
+ ];
55
+ }
56
+ function t(e, [t, r, i]) {
57
+ if (n(t, r, i) === 0) return !1;
58
+ let a = [
59
+ n(t, r, e),
60
+ n(r, i, e),
61
+ n(i, t, e)
62
+ ];
63
+ return a.every((e) => e >= 0) || a.every((e) => e <= 0);
64
+ }
65
+ function n(e, t, n) {
66
+ return (t.x - e.x) * (n.y - e.y) - (t.y - e.y) * (n.x - e.x);
67
+ }
68
+ export { e as graceTriangle, t as isInsideTriangle };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Reads the items a menu renders
3
+ *
4
+ * @param menu the menu element
5
+ * @returns the menu's own items that are not hidden or inert, in document order, leaving out the items of any menu
6
+ * nested inside it
7
+ */
8
+ export declare function renderedItems(menu: HTMLElement): HTMLElement[];
@@ -0,0 +1,4 @@
1
+ function e(e) {
2
+ return Array.from(e.querySelectorAll("[role=\"menuitem\"], [role=\"menuitemcheckbox\"], [role=\"menuitemradio\"]")).filter((t) => t.parentElement?.closest("[role=\"menu\"]") === e && t.closest("[hidden], [inert]") === null);
3
+ }
4
+ export { e as renderedItems };
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Keeps focus inside a menu when the focused item is removed from it or from one of its submenus, by moving focus to
3
+ * the innermost menu that held the item and is still open
4
+ *
5
+ * @param menu the open menu
6
+ * @returns a function that stops watching, to call when the menu closes
7
+ */
8
+ export declare function watchRemovals(menu: HTMLElement): () => void;
@@ -0,0 +1,23 @@
1
+ // src/menus/watchRemovals.ts
2
+ function e(e) {
3
+ let n = null, r = [];
4
+ function i(i) {
5
+ n = i.target instanceof Element ? i.target : null, r = n === null ? [] : t(n, e);
6
+ }
7
+ let a = new MutationObserver(() => {
8
+ let t = e.ownerDocument.activeElement, i = t === null || t === e.ownerDocument.body, a = n !== null && !e.contains(n);
9
+ i && a && e.matches(":popover-open") && (r.find((e) => e.isConnected && e.matches(":popover-open")) ?? e).focus();
10
+ });
11
+ return e.addEventListener("focusin", i), a.observe(e, {
12
+ childList: !0,
13
+ subtree: !0
14
+ }), () => {
15
+ e.removeEventListener("focusin", i), a.disconnect();
16
+ };
17
+ }
18
+ function t(e, t) {
19
+ let n = [], r = e.closest("[role=\"menu\"]");
20
+ for (; r !== null && t.contains(r);) n.push(r), r = r.parentElement?.closest("[role=\"menu\"]") ?? null;
21
+ return n;
22
+ }
23
+ export { e as watchRemovals };
@@ -1,6 +1,5 @@
1
- //#region src/overlays/anchorNameFor.ts
1
+ // src/overlays/anchorNameFor.ts
2
2
  function e(e) {
3
3
  return `--sui-overlay-${e.replace(/[^\w-]/g, "")}`;
4
4
  }
5
- //#endregion
6
5
  export { e as anchorNameFor };
@@ -1,4 +1,4 @@
1
- //#region src/overlays/mergeProps.ts
1
+ // src/overlays/mergeProps.ts
2
2
  var e = /* @__PURE__ */ new Set(["aria-describedby", "aria-labelledby"]), t = /^--[-\w\u{80}-\u{10FFFF}]+$/u;
3
3
  function n(e, t) {
4
4
  let n = { ...e };
@@ -26,5 +26,4 @@ function o(e) {
26
26
  function s(e) {
27
27
  return typeof e == "object" && !!e;
28
28
  }
29
- //#endregion
30
29
  export { n as mergeProps };
@@ -1,5 +1,5 @@
1
1
  import { PopoverRefusedError as e } from "../errors/PopoverRefusedError.js";
2
- //#region src/overlays/syncPopover.ts
2
+ // src/overlays/syncPopover.ts
3
3
  function t(t, r) {
4
4
  if (n(t, r) === null) return () => {};
5
5
  let i = setTimeout(() => {
@@ -21,5 +21,4 @@ function n(e, t) {
21
21
  }
22
22
  return null;
23
23
  }
24
- //#endregion
25
24
  export { t as syncPopover };
@@ -1,6 +1,6 @@
1
1
  import { anchorNameFor as e } from "./anchorNameFor.js";
2
2
  import { useEffect as t, useEffectEvent as n, useId as r, useRef as i, useState as a } from "react";
3
- //#region src/overlays/useOverlay.ts
3
+ // src/overlays/useOverlay.ts
4
4
  function o({ defaultOpen: o, delay: s, onOpenChange: c, open: l }) {
5
5
  let u = r(), [d, f] = a(o), p = i(void 0), m = l ?? d;
6
6
  function h() {
@@ -10,13 +10,7 @@ function o({ defaultOpen: o, delay: s, onOpenChange: c, open: l }) {
10
10
  l === void 0 && f(e), c?.(e);
11
11
  }
12
12
  function _(e, t) {
13
- if (h(), e !== m) {
14
- if (t <= 0) {
15
- g(e);
16
- return;
17
- }
18
- v(e, t);
19
- }
13
+ h(), e !== m && (t <= 0 ? g(e) : v(e, t));
20
14
  }
21
15
  function v(e, t) {
22
16
  p.current = setTimeout(() => {
@@ -52,5 +46,4 @@ function o({ defaultOpen: o, delay: s, onOpenChange: c, open: l }) {
52
46
  showAfterTask: y
53
47
  };
54
48
  }
55
- //#endregion
56
49
  export { o as useOverlay };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krelborn/stylesui",
3
- "version": "0.8.1",
3
+ "version": "0.9.0",
4
4
  "description": "Tree-shakable React 19 component library styled with CSS modules and custom properties, with themes, palettes, light and dark modes, and accessibility tests against WCAG 2.2 AA.",
5
5
  "keywords": [
6
6
  "accessibility",
@@ -54,10 +54,10 @@
54
54
  "devDependencies": {
55
55
  "@babel/core": "^8.0.6",
56
56
  "@rolldown/plugin-babel": "^0.2.4",
57
- "@storybook/addon-a11y": "^10.6.0",
58
- "@storybook/addon-docs": "^10.6.0",
59
- "@storybook/addon-vitest": "^10.6.0",
60
- "@storybook/react-vite": "^10.6.0",
57
+ "@storybook/addon-a11y": "^10.6.7",
58
+ "@storybook/addon-docs": "^10.6.7",
59
+ "@storybook/addon-vitest": "^10.6.7",
60
+ "@storybook/react-vite": "^10.6.7",
61
61
  "@testing-library/dom": "^10.4.2",
62
62
  "@testing-library/jest-dom": "^7.0.1",
63
63
  "@testing-library/react": "^16.3.3",
@@ -67,10 +67,10 @@
67
67
  "@types/react": "^19.3.0",
68
68
  "@types/react-dom": "^19.3.0",
69
69
  "@vitejs/plugin-react": "^6.1.1",
70
- "@vitest/browser-playwright": "^5.0.1",
70
+ "@vitest/browser-playwright": "^5.1.0",
71
71
  "babel-plugin-react-compiler": "^1.0.0",
72
72
  "husky": "^9.1.7",
73
- "jsdom": "^30.1.1",
73
+ "jsdom": "^31.0.1",
74
74
  "lint-staged": "^17.5.1",
75
75
  "lucide-static": "^1.54.0",
76
76
  "oxfmt": "^0.70.0",
@@ -78,11 +78,11 @@
78
78
  "playwright": "^1.63.0",
79
79
  "react": "^19.3.0",
80
80
  "react-dom": "^19.3.0",
81
- "storybook": "^10.6.0",
81
+ "storybook": "^10.6.7",
82
82
  "typescript": "~7.0.2",
83
- "vite": "^8.3.1",
83
+ "vite": "^8.3.8",
84
84
  "vite-plugin-lib-inject-css": "^2.2.2",
85
- "vitest": "^5.0.1"
85
+ "vitest": "^5.1.0"
86
86
  },
87
87
  "peerDependencies": {
88
88
  "react": "^19.2.0",