@krelborn/stylesui 0.0.0-stage → 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 (526) hide show
  1. package/LICENSE +74 -0
  2. package/README.md +129 -2
  3. package/dist/accessibility/RequiredAccessibleName.d.ts +26 -0
  4. package/dist/accessibility/idSegment.d.ts +7 -0
  5. package/dist/accessibility/idSegment.js +5 -0
  6. package/dist/accessibility/index.d.ts +2 -0
  7. package/dist/collections/index.d.ts +7 -0
  8. package/dist/collections/optionId.d.ts +8 -0
  9. package/dist/collections/optionId.js +6 -0
  10. package/dist/collections/renderedOptions.d.ts +37 -0
  11. package/dist/collections/renderedOptions.js +17 -0
  12. package/dist/collections/targetIndexForKey.d.ts +45 -0
  13. package/dist/collections/targetIndexForKey.js +16 -0
  14. package/dist/collections/typeAhead.d.ts +43 -0
  15. package/dist/collections/typeAhead.js +18 -0
  16. package/dist/components/Accordion/Accordion.css +1 -0
  17. package/dist/components/Accordion/Accordion.d.ts +90 -0
  18. package/dist/components/Accordion/Accordion.js +47 -0
  19. package/dist/components/Accordion/Accordion.module.js +19 -0
  20. package/dist/components/Accordion/AccordionContext.d.ts +40 -0
  21. package/dist/components/Accordion/AccordionContext.js +4 -0
  22. package/dist/components/Accordion/AccordionItem.d.ts +51 -0
  23. package/dist/components/Accordion/AccordionItem.js +69 -0
  24. package/dist/components/Accordion/AccordionToggleContent.d.ts +30 -0
  25. package/dist/components/Accordion/AccordionToggleContent.js +44 -0
  26. package/dist/components/Accordion/accordionIds.d.ts +24 -0
  27. package/dist/components/Accordion/accordionIds.js +12 -0
  28. package/dist/components/Accordion/index.d.ts +4 -0
  29. package/dist/components/Accordion/useAccordionContext.d.ts +9 -0
  30. package/dist/components/Accordion/useAccordionContext.js +10 -0
  31. package/dist/components/Accordion/useFindablePanel.d.ts +25 -0
  32. package/dist/components/Accordion/useFindablePanel.js +36 -0
  33. package/dist/components/Accordion/useFragmentTargetReveal.d.ts +27 -0
  34. package/dist/components/Accordion/useFragmentTargetReveal.js +36 -0
  35. package/dist/components/Accordion/useHasOpened.d.ts +7 -0
  36. package/dist/components/Accordion/useHasOpened.js +7 -0
  37. package/dist/components/Alert/Alert.css +1 -0
  38. package/dist/components/Alert/Alert.d.ts +47 -0
  39. package/dist/components/Alert/Alert.js +27 -0
  40. package/dist/components/Alert/Alert.module.js +8 -0
  41. package/dist/components/Alert/AlertIcon.d.ts +14 -0
  42. package/dist/components/Alert/AlertIcon.js +42 -0
  43. package/dist/components/Alert/index.d.ts +2 -0
  44. package/dist/components/Avatar/Avatar.css +1 -0
  45. package/dist/components/Avatar/Avatar.d.ts +33 -0
  46. package/dist/components/Avatar/Avatar.js +26 -0
  47. package/dist/components/Avatar/Avatar.module.js +6 -0
  48. package/dist/components/Avatar/index.d.ts +2 -0
  49. package/dist/components/Avatar/initialsOf.d.ts +9 -0
  50. package/dist/components/Avatar/initialsOf.js +9 -0
  51. package/dist/components/AvatarGroup/AvatarGroup.css +1 -0
  52. package/dist/components/AvatarGroup/AvatarGroup.d.ts +30 -0
  53. package/dist/components/AvatarGroup/AvatarGroup.js +33 -0
  54. package/dist/components/AvatarGroup/AvatarGroup.module.js +6 -0
  55. package/dist/components/AvatarGroup/index.d.ts +2 -0
  56. package/dist/components/Badge/Badge.css +1 -0
  57. package/dist/components/Badge/Badge.d.ts +36 -0
  58. package/dist/components/Badge/Badge.js +15 -0
  59. package/dist/components/Badge/Badge.module.js +3 -0
  60. package/dist/components/Badge/index.d.ts +2 -0
  61. package/dist/components/Box/Box.css +1 -0
  62. package/dist/components/Box/Box.d.ts +31 -0
  63. package/dist/components/Box/Box.js +17 -0
  64. package/dist/components/Box/Box.module.js +3 -0
  65. package/dist/components/Box/index.d.ts +2 -0
  66. package/dist/components/Button/Button.css +1 -0
  67. package/dist/components/Button/Button.d.ts +42 -0
  68. package/dist/components/Button/Button.js +24 -0
  69. package/dist/components/Button/Button.module.js +6 -0
  70. package/dist/components/Button/index.d.ts +2 -0
  71. package/dist/components/Card/Card.css +1 -0
  72. package/dist/components/Card/Card.d.ts +24 -0
  73. package/dist/components/Card/Card.js +14 -0
  74. package/dist/components/Card/Card.module.js +3 -0
  75. package/dist/components/Card/index.d.ts +2 -0
  76. package/dist/components/Center/Center.css +1 -0
  77. package/dist/components/Center/Center.d.ts +34 -0
  78. package/dist/components/Center/Center.js +19 -0
  79. package/dist/components/Center/Center.module.js +3 -0
  80. package/dist/components/Center/index.d.ts +2 -0
  81. package/dist/components/Checkbox/Checkbox.d.ts +23 -0
  82. package/dist/components/Checkbox/Checkbox.js +12 -0
  83. package/dist/components/Checkbox/index.d.ts +2 -0
  84. package/dist/components/ChoiceControl/ChoiceControl.css +1 -0
  85. package/dist/components/ChoiceControl/ChoiceControl.d.ts +21 -0
  86. package/dist/components/ChoiceControl/ChoiceControl.js +39 -0
  87. package/dist/components/ChoiceControl/ChoiceControl.module.js +8 -0
  88. package/dist/components/ChoiceControl/index.d.ts +1 -0
  89. package/dist/components/Cluster/Cluster.d.ts +29 -0
  90. package/dist/components/Cluster/Cluster.js +13 -0
  91. package/dist/components/Cluster/index.d.ts +2 -0
  92. package/dist/components/Code/Code.css +1 -0
  93. package/dist/components/Code/Code.d.ts +13 -0
  94. package/dist/components/Code/Code.js +19 -0
  95. package/dist/components/Code/Code.module.js +3 -0
  96. package/dist/components/Code/index.d.ts +2 -0
  97. package/dist/components/Combobox/Autocomplete.d.ts +83 -0
  98. package/dist/components/Combobox/Autocomplete.js +102 -0
  99. package/dist/components/Combobox/Combobox.css +1 -0
  100. package/dist/components/Combobox/Combobox.d.ts +59 -0
  101. package/dist/components/Combobox/Combobox.js +82 -0
  102. package/dist/components/Combobox/Combobox.module.js +17 -0
  103. package/dist/components/Combobox/ComboboxContext.d.ts +88 -0
  104. package/dist/components/Combobox/ComboboxContext.js +4 -0
  105. package/dist/components/Combobox/ComboboxFieldValue.d.ts +17 -0
  106. package/dist/components/Combobox/ComboboxFieldValue.js +33 -0
  107. package/dist/components/Combobox/ComboboxOption.d.ts +51 -0
  108. package/dist/components/Combobox/ComboboxOption.js +74 -0
  109. package/dist/components/Combobox/ComboboxOptionContent.d.ts +32 -0
  110. package/dist/components/Combobox/ComboboxOptionContent.js +51 -0
  111. package/dist/components/Combobox/ComboboxPopup.d.ts +50 -0
  112. package/dist/components/Combobox/ComboboxPopup.js +59 -0
  113. package/dist/components/Combobox/autocompleteKeys.d.ts +31 -0
  114. package/dist/components/Combobox/autocompleteKeys.js +25 -0
  115. package/dist/components/Combobox/comboboxKeys.d.ts +10 -0
  116. package/dist/components/Combobox/comboboxKeys.js +22 -0
  117. package/dist/components/Combobox/containsText.d.ts +9 -0
  118. package/dist/components/Combobox/containsText.js +8 -0
  119. package/dist/components/Combobox/index.d.ts +6 -0
  120. package/dist/components/Combobox/isAltArrow.d.ts +9 -0
  121. package/dist/components/Combobox/isAltArrow.js +5 -0
  122. package/dist/components/Combobox/isOptionShown.d.ts +10 -0
  123. package/dist/components/Combobox/isOptionShown.js +5 -0
  124. package/dist/components/Combobox/useAutocompleteText.d.ts +56 -0
  125. package/dist/components/Combobox/useAutocompleteText.js +27 -0
  126. package/dist/components/Combobox/useComboboxContext.d.ts +9 -0
  127. package/dist/components/Combobox/useComboboxContext.js +10 -0
  128. package/dist/components/Combobox/useComboboxList.d.ts +129 -0
  129. package/dist/components/Combobox/useComboboxList.js +138 -0
  130. package/dist/components/Combobox/useComboboxOption.d.ts +35 -0
  131. package/dist/components/Combobox/useComboboxOption.js +46 -0
  132. package/dist/components/Combobox/useComboboxSelection.d.ts +45 -0
  133. package/dist/components/Combobox/useComboboxSelection.js +17 -0
  134. package/dist/components/Combobox/useResultsAnnouncement.d.ts +23 -0
  135. package/dist/components/Combobox/useResultsAnnouncement.js +24 -0
  136. package/dist/components/ContextMenu/index.d.ts +2 -0
  137. package/dist/components/ContextMenu/useContextMenu.d.ts +112 -0
  138. package/dist/components/ContextMenu/useContextMenu.js +202 -0
  139. package/dist/components/ContextMenu/watchLongPress.d.ts +35 -0
  140. package/dist/components/ContextMenu/watchLongPress.js +38 -0
  141. package/dist/components/Counter/Counter.css +1 -0
  142. package/dist/components/Counter/Counter.d.ts +39 -0
  143. package/dist/components/Counter/Counter.js +18 -0
  144. package/dist/components/Counter/Counter.module.js +3 -0
  145. package/dist/components/Counter/index.d.ts +2 -0
  146. package/dist/components/Cover/Cover.css +1 -0
  147. package/dist/components/Cover/Cover.d.ts +40 -0
  148. package/dist/components/Cover/Cover.js +29 -0
  149. package/dist/components/Cover/Cover.module.js +6 -0
  150. package/dist/components/Cover/index.d.ts +2 -0
  151. package/dist/components/Divider/Divider.css +1 -0
  152. package/dist/components/Divider/Divider.d.ts +25 -0
  153. package/dist/components/Divider/Divider.js +15 -0
  154. package/dist/components/Divider/Divider.module.js +3 -0
  155. package/dist/components/Divider/index.d.ts +2 -0
  156. package/dist/components/Field/Field.css +1 -0
  157. package/dist/components/Field/Field.d.ts +49 -0
  158. package/dist/components/Field/Field.js +49 -0
  159. package/dist/components/Field/Field.module.js +8 -0
  160. package/dist/components/Field/index.d.ts +2 -0
  161. package/dist/components/Fieldset/Fieldset.css +1 -0
  162. package/dist/components/Fieldset/Fieldset.d.ts +35 -0
  163. package/dist/components/Fieldset/Fieldset.js +64 -0
  164. package/dist/components/Fieldset/Fieldset.module.js +8 -0
  165. package/dist/components/Fieldset/index.d.ts +2 -0
  166. package/dist/components/Frame/Frame.css +1 -0
  167. package/dist/components/Frame/Frame.d.ts +23 -0
  168. package/dist/components/Frame/Frame.js +16 -0
  169. package/dist/components/Frame/Frame.module.js +3 -0
  170. package/dist/components/Frame/index.d.ts +2 -0
  171. package/dist/components/Grid/Grid.css +1 -0
  172. package/dist/components/Grid/Grid.d.ts +25 -0
  173. package/dist/components/Grid/Grid.js +22 -0
  174. package/dist/components/Grid/Grid.module.js +3 -0
  175. package/dist/components/Grid/index.d.ts +2 -0
  176. package/dist/components/Heading/Heading.css +1 -0
  177. package/dist/components/Heading/Heading.d.ts +39 -0
  178. package/dist/components/Heading/Heading.js +23 -0
  179. package/dist/components/Heading/Heading.module.js +3 -0
  180. package/dist/components/Heading/index.d.ts +2 -0
  181. package/dist/components/HorizontalFlow/HorizontalFlow.css +1 -0
  182. package/dist/components/HorizontalFlow/HorizontalFlow.d.ts +30 -0
  183. package/dist/components/HorizontalFlow/HorizontalFlow.js +30 -0
  184. package/dist/components/HorizontalFlow/HorizontalFlow.module.js +3 -0
  185. package/dist/components/HorizontalFlow/index.d.ts +2 -0
  186. package/dist/components/Icon/AddIcon.d.ts +11 -0
  187. package/dist/components/Icon/AddIcon.js +21 -0
  188. package/dist/components/Icon/CheckIcon.d.ts +11 -0
  189. package/dist/components/Icon/CheckIcon.js +18 -0
  190. package/dist/components/Icon/ChevronDownIcon.d.ts +11 -0
  191. package/dist/components/Icon/ChevronDownIcon.js +18 -0
  192. package/dist/components/Icon/ChevronRightIcon.d.ts +11 -0
  193. package/dist/components/Icon/ChevronRightIcon.js +19 -0
  194. package/dist/components/Icon/CloseIcon.d.ts +12 -0
  195. package/dist/components/Icon/CloseIcon.js +21 -0
  196. package/dist/components/Icon/ColorModeIcon.d.ts +12 -0
  197. package/dist/components/Icon/ColorModeIcon.js +36 -0
  198. package/dist/components/Icon/DeleteIcon.d.ts +11 -0
  199. package/dist/components/Icon/DeleteIcon.js +36 -0
  200. package/dist/components/Icon/Icon.css +1 -0
  201. package/dist/components/Icon/Icon.d.ts +40 -0
  202. package/dist/components/Icon/Icon.js +27 -0
  203. package/dist/components/Icon/Icon.module.js +6 -0
  204. package/dist/components/Icon/InfoIcon.d.ts +11 -0
  205. package/dist/components/Icon/InfoIcon.js +30 -0
  206. package/dist/components/Icon/MenuIcon.d.ts +12 -0
  207. package/dist/components/Icon/MenuIcon.js +28 -0
  208. package/dist/components/Icon/MoreHorizontalIcon.d.ts +11 -0
  209. package/dist/components/Icon/MoreHorizontalIcon.js +34 -0
  210. package/dist/components/Icon/MoreVerticalIcon.d.ts +11 -0
  211. package/dist/components/Icon/MoreVerticalIcon.js +34 -0
  212. package/dist/components/Icon/PaletteIcon.d.ts +12 -0
  213. package/dist/components/Icon/PaletteIcon.js +48 -0
  214. package/dist/components/Icon/RefreshIcon.d.ts +13 -0
  215. package/dist/components/Icon/RefreshIcon.js +32 -0
  216. package/dist/components/Icon/RemoveIcon.d.ts +11 -0
  217. package/dist/components/Icon/RemoveIcon.js +18 -0
  218. package/dist/components/Icon/SendIcon.d.ts +11 -0
  219. package/dist/components/Icon/SendIcon.js +22 -0
  220. package/dist/components/Icon/index.d.ts +16 -0
  221. package/dist/components/IconButton/IconButton.css +1 -0
  222. package/dist/components/IconButton/IconButton.d.ts +45 -0
  223. package/dist/components/IconButton/IconButton.js +40 -0
  224. package/dist/components/IconButton/IconButton.module.js +7 -0
  225. package/dist/components/IconButton/index.d.ts +2 -0
  226. package/dist/components/Kbd/Kbd.css +1 -0
  227. package/dist/components/Kbd/Kbd.d.ts +13 -0
  228. package/dist/components/Kbd/Kbd.js +19 -0
  229. package/dist/components/Kbd/Kbd.module.js +3 -0
  230. package/dist/components/Kbd/index.d.ts +2 -0
  231. package/dist/components/Link/Link.css +1 -0
  232. package/dist/components/Link/Link.d.ts +52 -0
  233. package/dist/components/Link/Link.js +26 -0
  234. package/dist/components/Link/Link.module.js +3 -0
  235. package/dist/components/Link/index.d.ts +2 -0
  236. package/dist/components/Listbox/Listbox.css +1 -0
  237. package/dist/components/Listbox/Listbox.d.ts +46 -0
  238. package/dist/components/Listbox/Listbox.js +55 -0
  239. package/dist/components/Listbox/Listbox.module.js +6 -0
  240. package/dist/components/Listbox/ListboxContext.d.ts +38 -0
  241. package/dist/components/Listbox/ListboxContext.js +4 -0
  242. package/dist/components/Listbox/ListboxOption.d.ts +31 -0
  243. package/dist/components/Listbox/ListboxOption.js +42 -0
  244. package/dist/components/Listbox/index.d.ts +4 -0
  245. package/dist/components/Listbox/useListbox.d.ts +54 -0
  246. package/dist/components/Listbox/useListbox.js +103 -0
  247. package/dist/components/Listbox/useListboxContext.d.ts +9 -0
  248. package/dist/components/Listbox/useListboxContext.js +10 -0
  249. package/dist/components/Menu/Menu.d.ts +70 -0
  250. package/dist/components/Menu/Menu.js +76 -0
  251. package/dist/components/Menu/MenuContext.d.ts +29 -0
  252. package/dist/components/Menu/MenuContext.js +4 -0
  253. package/dist/components/Menu/MenuGroup.d.ts +22 -0
  254. package/dist/components/Menu/MenuGroup.js +32 -0
  255. package/dist/components/Menu/MenuItem.d.ts +77 -0
  256. package/dist/components/Menu/MenuItem.js +54 -0
  257. package/dist/components/Menu/MenuItemCheckbox.d.ts +61 -0
  258. package/dist/components/Menu/MenuItemCheckbox.js +37 -0
  259. package/dist/components/Menu/MenuItemRadio.d.ts +47 -0
  260. package/dist/components/Menu/MenuItemRadio.js +39 -0
  261. package/dist/components/Menu/MenuRadioGroup.d.ts +34 -0
  262. package/dist/components/Menu/MenuRadioGroup.js +27 -0
  263. package/dist/components/Menu/MenuRadioGroupContext.d.ts +17 -0
  264. package/dist/components/Menu/MenuRadioGroupContext.js +4 -0
  265. package/dist/components/Menu/MenuSeparator.d.ts +16 -0
  266. package/dist/components/Menu/MenuSeparator.js +20 -0
  267. package/dist/components/Menu/Submenu.d.ts +36 -0
  268. package/dist/components/Menu/Submenu.js +122 -0
  269. package/dist/components/Menu/index.d.ts +18 -0
  270. package/dist/components/Menu/useMenu.d.ts +18 -0
  271. package/dist/components/Menu/useMenu.js +20 -0
  272. package/dist/components/Menu/useMenuButton.d.ts +124 -0
  273. package/dist/components/Menu/useMenuButton.js +92 -0
  274. package/dist/components/Menu/useMenuContext.d.ts +9 -0
  275. package/dist/components/Menu/useMenuContext.js +10 -0
  276. package/dist/components/Menu/useMenuItemContent.d.ts +55 -0
  277. package/dist/components/Menu/useMenuItemContent.js +66 -0
  278. package/dist/components/Menu/useMenuPointer.d.ts +27 -0
  279. package/dist/components/Menu/useMenuPointer.js +56 -0
  280. package/dist/components/Menu/useMenuRadioGroupContext.d.ts +9 -0
  281. package/dist/components/Menu/useMenuRadioGroupContext.js +10 -0
  282. package/dist/components/MenuSurface/MenuSurface.css +1 -0
  283. package/dist/components/MenuSurface/MenuSurface.module.js +16 -0
  284. package/dist/components/Menubar/Menubar.css +1 -0
  285. package/dist/components/Menubar/Menubar.d.ts +23 -0
  286. package/dist/components/Menubar/Menubar.js +67 -0
  287. package/dist/components/Menubar/Menubar.module.js +7 -0
  288. package/dist/components/Menubar/MenubarContext.d.ts +29 -0
  289. package/dist/components/Menubar/MenubarContext.js +4 -0
  290. package/dist/components/Menubar/MenubarMenu.d.ts +26 -0
  291. package/dist/components/Menubar/MenubarMenu.js +88 -0
  292. package/dist/components/Menubar/findOpenMenubarItem.d.ts +7 -0
  293. package/dist/components/Menubar/findOpenMenubarItem.js +6 -0
  294. package/dist/components/Menubar/index.d.ts +4 -0
  295. package/dist/components/Menubar/menubarItems.d.ts +7 -0
  296. package/dist/components/Menubar/menubarItems.js +5 -0
  297. package/dist/components/Menubar/useMenubarContext.d.ts +9 -0
  298. package/dist/components/Menubar/useMenubarContext.js +10 -0
  299. package/dist/components/NavBar/NavBar.css +1 -0
  300. package/dist/components/NavBar/NavBar.d.ts +53 -0
  301. package/dist/components/NavBar/NavBar.js +97 -0
  302. package/dist/components/NavBar/NavBar.module.js +22 -0
  303. package/dist/components/NavBar/NavBarContext.d.ts +21 -0
  304. package/dist/components/NavBar/NavBarContext.js +4 -0
  305. package/dist/components/NavBar/NavBarItem.d.ts +32 -0
  306. package/dist/components/NavBar/NavBarItem.js +18 -0
  307. package/dist/components/NavBar/NavBarMenu.d.ts +32 -0
  308. package/dist/components/NavBar/NavBarMenu.js +84 -0
  309. package/dist/components/NavBar/NavBarMenuGroup.d.ts +25 -0
  310. package/dist/components/NavBar/NavBarMenuGroup.js +40 -0
  311. package/dist/components/NavBar/NavBarMenuItem.d.ts +36 -0
  312. package/dist/components/NavBar/NavBarMenuItem.js +49 -0
  313. package/dist/components/NavBar/index.d.ts +10 -0
  314. package/dist/components/NavBar/isNavBarCollapsed.d.ts +8 -0
  315. package/dist/components/NavBar/isNavBarCollapsed.js +5 -0
  316. package/dist/components/NavBar/leavesPageInPlace.d.ts +12 -0
  317. package/dist/components/NavBar/leavesPageInPlace.js +29 -0
  318. package/dist/components/NavBar/renderNavBarLink.d.ts +12 -0
  319. package/dist/components/NavBar/renderNavBarLink.js +16 -0
  320. package/dist/components/NavBar/useLayoutSwitch.d.ts +26 -0
  321. package/dist/components/NavBar/useLayoutSwitch.js +25 -0
  322. package/dist/components/NavBar/useNavBarContext.d.ts +9 -0
  323. package/dist/components/NavBar/useNavBarContext.js +10 -0
  324. package/dist/components/NavList/NavList.css +1 -0
  325. package/dist/components/NavList/NavList.d.ts +20 -0
  326. package/dist/components/NavList/NavList.js +27 -0
  327. package/dist/components/NavList/NavList.module.js +11 -0
  328. package/dist/components/NavList/NavListGroup.d.ts +25 -0
  329. package/dist/components/NavList/NavListGroup.js +39 -0
  330. package/dist/components/NavList/NavListItem.d.ts +49 -0
  331. package/dist/components/NavList/NavListItem.js +56 -0
  332. package/dist/components/NavList/index.d.ts +6 -0
  333. package/dist/components/Overlay/Overlay.css +1 -0
  334. package/dist/components/Overlay/Overlay.d.ts +33 -0
  335. package/dist/components/Overlay/Overlay.js +35 -0
  336. package/dist/components/Overlay/Overlay.module.js +3 -0
  337. package/dist/components/Overlay/index.d.ts +1 -0
  338. package/dist/components/PageLayout/PageLayout.css +1 -0
  339. package/dist/components/PageLayout/PageLayout.d.ts +26 -0
  340. package/dist/components/PageLayout/PageLayout.js +17 -0
  341. package/dist/components/PageLayout/PageLayout.module.js +3 -0
  342. package/dist/components/PageLayout/index.d.ts +2 -0
  343. package/dist/components/Popover/Popover.css +1 -0
  344. package/dist/components/Popover/Popover.d.ts +52 -0
  345. package/dist/components/Popover/Popover.js +20 -0
  346. package/dist/components/Popover/Popover.module.js +3 -0
  347. package/dist/components/Popover/index.d.ts +4 -0
  348. package/dist/components/Popover/usePopover.d.ts +96 -0
  349. package/dist/components/Popover/usePopover.js +71 -0
  350. package/dist/components/Prose/Prose.css +1 -0
  351. package/dist/components/Prose/Prose.d.ts +50 -0
  352. package/dist/components/Prose/Prose.js +15 -0
  353. package/dist/components/Prose/Prose.module.js +3 -0
  354. package/dist/components/Prose/index.d.ts +2 -0
  355. package/dist/components/Radio/Radio.d.ts +29 -0
  356. package/dist/components/Radio/Radio.js +23 -0
  357. package/dist/components/Radio/index.d.ts +2 -0
  358. package/dist/components/RadioGroup/RadioGroup.css +1 -0
  359. package/dist/components/RadioGroup/RadioGroup.d.ts +58 -0
  360. package/dist/components/RadioGroup/RadioGroup.js +36 -0
  361. package/dist/components/RadioGroup/RadioGroup.module.js +3 -0
  362. package/dist/components/RadioGroup/index.d.ts +2 -0
  363. package/dist/components/RequiredIndicator/RequiredIndicator.css +1 -0
  364. package/dist/components/RequiredIndicator/RequiredIndicator.d.ts +6 -0
  365. package/dist/components/RequiredIndicator/RequiredIndicator.js +15 -0
  366. package/dist/components/RequiredIndicator/RequiredIndicator.module.js +3 -0
  367. package/dist/components/RequiredIndicator/index.d.ts +1 -0
  368. package/dist/components/Row/Row.d.ts +29 -0
  369. package/dist/components/Row/Row.js +13 -0
  370. package/dist/components/Row/index.d.ts +2 -0
  371. package/dist/components/SegmentedControl/Segment.d.ts +24 -0
  372. package/dist/components/SegmentedControl/Segment.js +41 -0
  373. package/dist/components/SegmentedControl/SegmentedControl.css +1 -0
  374. package/dist/components/SegmentedControl/SegmentedControl.d.ts +25 -0
  375. package/dist/components/SegmentedControl/SegmentedControl.js +19 -0
  376. package/dist/components/SegmentedControl/SegmentedControl.module.js +9 -0
  377. package/dist/components/SegmentedControl/index.d.ts +4 -0
  378. package/dist/components/Select/Select.d.ts +27 -0
  379. package/dist/components/Select/Select.js +11 -0
  380. package/dist/components/Select/index.d.ts +2 -0
  381. package/dist/components/Sidebar/Sidebar.css +1 -0
  382. package/dist/components/Sidebar/Sidebar.d.ts +42 -0
  383. package/dist/components/Sidebar/Sidebar.js +23 -0
  384. package/dist/components/Sidebar/Sidebar.module.js +3 -0
  385. package/dist/components/Sidebar/index.d.ts +2 -0
  386. package/dist/components/SkipLink/SkipLink.css +1 -0
  387. package/dist/components/SkipLink/SkipLink.d.ts +20 -0
  388. package/dist/components/SkipLink/SkipLink.js +20 -0
  389. package/dist/components/SkipLink/SkipLink.module.js +3 -0
  390. package/dist/components/SkipLink/index.d.ts +2 -0
  391. package/dist/components/Spinner/Spinner.css +1 -0
  392. package/dist/components/Spinner/Spinner.d.ts +13 -0
  393. package/dist/components/Spinner/Spinner.js +32 -0
  394. package/dist/components/Spinner/Spinner.module.js +7 -0
  395. package/dist/components/Spinner/index.d.ts +1 -0
  396. package/dist/components/Stack/Stack.css +1 -0
  397. package/dist/components/Stack/Stack.d.ts +25 -0
  398. package/dist/components/Stack/Stack.js +20 -0
  399. package/dist/components/Stack/Stack.module.js +3 -0
  400. package/dist/components/Stack/index.d.ts +2 -0
  401. package/dist/components/StatusDot/StatusDot.css +1 -0
  402. package/dist/components/StatusDot/StatusDot.d.ts +57 -0
  403. package/dist/components/StatusDot/StatusDot.js +20 -0
  404. package/dist/components/StatusDot/StatusDot.module.js +3 -0
  405. package/dist/components/StatusDot/index.d.ts +2 -0
  406. package/dist/components/Switch/Switch.d.ts +24 -0
  407. package/dist/components/Switch/Switch.js +12 -0
  408. package/dist/components/Switch/index.d.ts +2 -0
  409. package/dist/components/Switcher/Switcher.css +1 -0
  410. package/dist/components/Switcher/Switcher.d.ts +27 -0
  411. package/dist/components/Switcher/Switcher.js +22 -0
  412. package/dist/components/Switcher/Switcher.module.js +3 -0
  413. package/dist/components/Switcher/index.d.ts +2 -0
  414. package/dist/components/Tabs/Tab.d.ts +26 -0
  415. package/dist/components/Tabs/Tab.js +60 -0
  416. package/dist/components/Tabs/TabList.d.ts +16 -0
  417. package/dist/components/Tabs/TabList.js +22 -0
  418. package/dist/components/Tabs/TabPanel.d.ts +24 -0
  419. package/dist/components/Tabs/TabPanel.js +21 -0
  420. package/dist/components/Tabs/Tabs.css +1 -0
  421. package/dist/components/Tabs/Tabs.d.ts +81 -0
  422. package/dist/components/Tabs/Tabs.js +30 -0
  423. package/dist/components/Tabs/Tabs.module.js +8 -0
  424. package/dist/components/Tabs/TabsContext.d.ts +39 -0
  425. package/dist/components/Tabs/TabsContext.js +4 -0
  426. package/dist/components/Tabs/index.d.ts +8 -0
  427. package/dist/components/Tabs/tabIds.d.ts +16 -0
  428. package/dist/components/Tabs/tabIds.js +9 -0
  429. package/dist/components/Tabs/useTabsContext.d.ts +9 -0
  430. package/dist/components/Tabs/useTabsContext.js +10 -0
  431. package/dist/components/Text/Text.css +1 -0
  432. package/dist/components/Text/Text.d.ts +40 -0
  433. package/dist/components/Text/Text.js +16 -0
  434. package/dist/components/Text/Text.module.js +3 -0
  435. package/dist/components/Text/index.d.ts +2 -0
  436. package/dist/components/TextControl/TextControl.css +1 -0
  437. package/dist/components/TextControl/TextControl.d.ts +22 -0
  438. package/dist/components/TextControl/TextControl.js +27 -0
  439. package/dist/components/TextControl/TextControl.module.js +3 -0
  440. package/dist/components/TextControl/index.d.ts +1 -0
  441. package/dist/components/TextInput/TextInput.d.ts +31 -0
  442. package/dist/components/TextInput/TextInput.js +12 -0
  443. package/dist/components/TextInput/index.d.ts +2 -0
  444. package/dist/components/Textarea/Textarea.d.ts +24 -0
  445. package/dist/components/Textarea/Textarea.js +11 -0
  446. package/dist/components/Textarea/index.d.ts +2 -0
  447. package/dist/components/Theme/Theme.d.ts +46 -0
  448. package/dist/components/Theme/Theme.js +17 -0
  449. package/dist/components/Theme/index.d.ts +2 -0
  450. package/dist/components/Tooltip/Tooltip.css +1 -0
  451. package/dist/components/Tooltip/Tooltip.d.ts +49 -0
  452. package/dist/components/Tooltip/Tooltip.js +21 -0
  453. package/dist/components/Tooltip/Tooltip.module.js +3 -0
  454. package/dist/components/Tooltip/index.d.ts +4 -0
  455. package/dist/components/Tooltip/tooltipCoordinator.d.ts +14 -0
  456. package/dist/components/Tooltip/tooltipCoordinator.js +16 -0
  457. package/dist/components/Tooltip/useTooltip.d.ts +119 -0
  458. package/dist/components/Tooltip/useTooltip.js +73 -0
  459. package/dist/components/VisuallyHidden/VisuallyHidden.css +1 -0
  460. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +14 -0
  461. package/dist/components/VisuallyHidden/VisuallyHidden.js +19 -0
  462. package/dist/components/VisuallyHidden/VisuallyHidden.module.js +3 -0
  463. package/dist/components/VisuallyHidden/index.d.ts +2 -0
  464. package/dist/errors/MissingContextError.d.ts +11 -0
  465. package/dist/errors/MissingContextError.js +8 -0
  466. package/dist/errors/PopoverRefusedError.d.ts +12 -0
  467. package/dist/errors/PopoverRefusedError.js +8 -0
  468. package/dist/errors/index.d.ts +2 -0
  469. package/dist/forms/ControlSize.d.ts +4 -0
  470. package/dist/forms/FieldContext.d.ts +34 -0
  471. package/dist/forms/FieldContext.js +4 -0
  472. package/dist/forms/RadioGroupContext.d.ts +34 -0
  473. package/dist/forms/RadioGroupContext.js +4 -0
  474. package/dist/forms/hasContent.d.ts +10 -0
  475. package/dist/forms/hasContent.js +6 -0
  476. package/dist/forms/index.d.ts +8 -0
  477. package/dist/forms/useFieldControl.d.ts +36 -0
  478. package/dist/forms/useFieldControl.js +28 -0
  479. package/dist/forms/useRadioGroupItem.d.ts +50 -0
  480. package/dist/forms/useRadioGroupItem.js +26 -0
  481. package/dist/index.d.ts +107 -0
  482. package/dist/index.js +92 -0
  483. package/dist/layout/Space.d.ts +4 -0
  484. package/dist/layout/alignment.d.ts +8 -0
  485. package/dist/layout/index.d.ts +5 -0
  486. package/dist/layout/listRole.d.ts +11 -0
  487. package/dist/layout/listRole.js +5 -0
  488. package/dist/layout/spaceValue.d.ts +8 -0
  489. package/dist/layout/spaceValue.js +5 -0
  490. package/dist/layout/withCustomProperties.d.ts +9 -0
  491. package/dist/layout/withCustomProperties.js +8 -0
  492. package/dist/links/LinkOrButtonProps.d.ts +17 -0
  493. package/dist/links/index.d.ts +1 -0
  494. package/dist/menus/closeWhenFocusLeaves.d.ts +9 -0
  495. package/dist/menus/closeWhenFocusLeaves.js +11 -0
  496. package/dist/menus/focusItem.d.ts +6 -0
  497. package/dist/menus/focusItem.js +9 -0
  498. package/dist/menus/focusOnOpening.d.ts +11 -0
  499. package/dist/menus/focusOnOpening.js +11 -0
  500. package/dist/menus/hasModifier.d.ts +7 -0
  501. package/dist/menus/hasModifier.js +5 -0
  502. package/dist/menus/index.d.ts +11 -0
  503. package/dist/menus/itemText.d.ts +8 -0
  504. package/dist/menus/itemText.js +6 -0
  505. package/dist/menus/leaveMenuOnTab.d.ts +9 -0
  506. package/dist/menus/leaveMenuOnTab.js +6 -0
  507. package/dist/menus/pointerIntent.d.ts +36 -0
  508. package/dist/menus/pointerIntent.js +68 -0
  509. package/dist/menus/renderedItems.d.ts +8 -0
  510. package/dist/menus/renderedItems.js +4 -0
  511. package/dist/menus/watchRemovals.d.ts +8 -0
  512. package/dist/menus/watchRemovals.js +23 -0
  513. package/dist/overlays/OverlayDelay.d.ts +13 -0
  514. package/dist/overlays/OverlayPlacement.d.ts +6 -0
  515. package/dist/overlays/anchorNameFor.d.ts +7 -0
  516. package/dist/overlays/anchorNameFor.js +5 -0
  517. package/dist/overlays/index.d.ts +6 -0
  518. package/dist/overlays/mergeProps.d.ts +13 -0
  519. package/dist/overlays/mergeProps.js +29 -0
  520. package/dist/overlays/syncPopover.d.ts +11 -0
  521. package/dist/overlays/syncPopover.js +24 -0
  522. package/dist/overlays/useOverlay.d.ts +71 -0
  523. package/dist/overlays/useOverlay.js +49 -0
  524. package/dist/styles.css +1 -0
  525. package/fonts/playful.css +3 -0
  526. package/package.json +103 -3
@@ -0,0 +1,96 @@
1
+ import type { CSSProperties, RefObject } from "react";
2
+ import type { OverlayPlacement } from "../../overlays";
3
+ import type { PopoverOverlayProps } from "./Popover";
4
+ /**
5
+ * Options for `usePopover`
6
+ */
7
+ export interface UsePopoverOptions {
8
+ /**
9
+ * Whether the popover starts open when uncontrolled. Defaults to `false`.
10
+ */
11
+ defaultOpen?: boolean;
12
+ /**
13
+ * Element to focus when the popover opens, such as the safe choice in a confirmation. Without one, focus stays where
14
+ * it is.
15
+ */
16
+ initialFocus?: RefObject<HTMLElement | null>;
17
+ /**
18
+ * Called with the new open state when the popover opens or closes; when controlled, also with `true` when the user
19
+ * asks to open it
20
+ */
21
+ onOpenChange?: (open: boolean) => void;
22
+ /**
23
+ * Controls whether the popover is open. The hook then cancels openings and reports them through `onOpenChange`; a
24
+ * close the browser makes is reported after it happens, and the popover shows again if `open` stays true. Only one
25
+ * popover can be open at a time, so two held open this way keep closing each other.
26
+ */
27
+ open?: boolean;
28
+ /**
29
+ * Side of the trigger the popover opens on. It flips to the opposite side when there is no room. Defaults to
30
+ * `bottom`.
31
+ */
32
+ placement?: OverlayPlacement;
33
+ }
34
+ /**
35
+ * Props `getTriggerProps` sets on the trigger
36
+ */
37
+ interface PopoverTriggerProps {
38
+ /**
39
+ * The popover's id
40
+ */
41
+ "aria-controls": string;
42
+ /**
43
+ * Whether the popover is open
44
+ */
45
+ "aria-expanded": boolean;
46
+ /**
47
+ * The popover's id, which makes the button open and close it without script
48
+ */
49
+ popoverTarget: string;
50
+ /**
51
+ * Names the trigger as the popover's anchor
52
+ */
53
+ style: CSSProperties;
54
+ }
55
+ /**
56
+ * Prop getters for a popover's trigger and the `Popover`, whether it is open, and a way to close it
57
+ */
58
+ export interface UsePopoverResult {
59
+ /**
60
+ * Closes the popover: hides it when uncontrolled, and reports `false` through `onOpenChange` either way. Focus moves
61
+ * as when the browser closes it, and also to the trigger when it is lost to the page as the popover hides, as Safari
62
+ * loses it when a button is clicked. Focus the caller moves elsewhere stays there.
63
+ */
64
+ close: () => void;
65
+ /**
66
+ * Returns the props to spread on the `Popover`, merged with any given
67
+ */
68
+ getOverlayProps: <Props extends object>(props?: Props & Partial<PopoverOverlayProps>) => Omit<Props, keyof PopoverOverlayProps> & PopoverOverlayProps;
69
+ /**
70
+ * Returns the props to spread on the trigger, which must be a button, merged with any given: where both set a
71
+ * handler, both run, the given one first, and `style` objects merge
72
+ */
73
+ getTriggerProps: <Props extends object>(props?: Props & Partial<PopoverTriggerProps>) => Omit<Props, keyof PopoverTriggerProps> & PopoverTriggerProps;
74
+ /**
75
+ * Whether the popover is open
76
+ */
77
+ open: boolean;
78
+ }
79
+ /**
80
+ * Connects a `Popover` to the button that opens it. Clicking the button toggles the popover, and Escape or a click
81
+ * outside closes it, all handled by the browser. Opening another popover closes this one. When the popover closes with
82
+ * focus inside it, the browser returns focus to whatever had it before the popover opened, usually the button; where
83
+ * the browser leaves focus on the page or in the hidden popover, as Safari does, the hook moves it to the button. A
84
+ * click outside leaves focus where the click put it.
85
+ *
86
+ * @param options open state, the change callback, placement and the element to focus on opening
87
+ * @returns prop getters for the trigger and the `Popover`, whether it is open, and `close`
88
+ *
89
+ * @example
90
+ * const popover = usePopover({ placement: "top" });
91
+ *
92
+ * <Button {...popover.getTriggerProps()} variant="ghost">2 problems</Button>
93
+ * <Popover {...popover.getOverlayProps()}>…</Popover>
94
+ */
95
+ export declare function usePopover({ defaultOpen, initialFocus, onOpenChange, open: controlledOpen, placement, }?: UsePopoverOptions): UsePopoverResult;
96
+ export {};
@@ -0,0 +1,71 @@
1
+ import { anchorNameFor as e } from "../../overlays/anchorNameFor.js";
2
+ import { mergeProps as t } from "../../overlays/mergeProps.js";
3
+ import { syncPopover as n } from "../../overlays/syncPopover.js";
4
+ import { useEffect as r, useId as i, useRef as a, useState as o } from "react";
5
+ // src/components/Popover/usePopover.ts
6
+ function s({ defaultOpen: s = !1, initialFocus: d, onOpenChange: f, open: p, placement: m = "bottom" } = {}) {
7
+ let h = i(), [g, _] = o(s), [v, y] = o(0), b = a(null), x = a(!1), S = a(!1), C = p !== void 0, w = p ?? g, T = e(h);
8
+ r(() => {
9
+ let e = b.current;
10
+ if (v !== 0 && w && e !== null && e.isConnected) return n(e, !0);
11
+ }, [w, v]);
12
+ function E(e) {
13
+ C || _(e), f?.(e);
14
+ }
15
+ function D(e) {
16
+ if (!c(e)) {
17
+ if (e.newState === "closed") {
18
+ let t = e.currentTarget;
19
+ x.current = t.contains(t.ownerDocument.activeElement) || S.current && u(t.ownerDocument);
20
+ }
21
+ S.current = !1, C && !w && e.newState === "open" && (e.preventDefault(), f?.(!0));
22
+ }
23
+ }
24
+ function O(e) {
25
+ if (c(e)) return;
26
+ let t = e.newState === "open";
27
+ t ? d?.current?.focus() : x.current && (x.current = !1, l(e.currentTarget)), t !== w && (E(t), C && (b.current = e.currentTarget, y((e) => e + 1)));
28
+ }
29
+ function k() {
30
+ w && (S.current = !0, E(!1));
31
+ }
32
+ let A = {
33
+ anchorName: T,
34
+ id: h,
35
+ onBeforeToggle: D,
36
+ onToggle: O,
37
+ open: w,
38
+ placement: m
39
+ }, j = {
40
+ "aria-controls": h,
41
+ "aria-expanded": w,
42
+ popoverTarget: h,
43
+ style: { anchorName: T }
44
+ };
45
+ function M(e) {
46
+ return t(e, A);
47
+ }
48
+ function N(e) {
49
+ return t(e, j);
50
+ }
51
+ return {
52
+ close: k,
53
+ getOverlayProps: M,
54
+ getTriggerProps: N,
55
+ open: w
56
+ };
57
+ }
58
+ function c(e) {
59
+ return e.target !== e.currentTarget;
60
+ }
61
+ function l(e) {
62
+ (u(e.ownerDocument) || e.contains(e.ownerDocument.activeElement)) && d(e)?.focus();
63
+ }
64
+ function u(e) {
65
+ return e.activeElement === null || e.activeElement === e.body;
66
+ }
67
+ function d(e) {
68
+ let t = e.ownerDocument.querySelectorAll("[popovertarget]");
69
+ return Array.from(t).find((t) => t.getAttribute("popovertarget") === e.id && !e.contains(t)) ?? null;
70
+ }
71
+ export { s as usePopover };
@@ -0,0 +1 @@
1
+ .sui-prose-Obc4t{--sui-prose-font-size:var(--sui-font-size-md,1rem);--sui-prose-flow:var(--sui-space-4,1rem);color:var(--sui-color-text,#111827);font-family:var(--sui-font-body,system-ui, sans-serif);font-size:var(--sui-prose-font-size);line-height:var(--sui-prose-line-height,var(--sui-line-height-normal,1.5));overflow-wrap:anywhere}.sui-prose-Obc4t[data-size=sm]{--sui-prose-font-size:var(--sui-font-size-sm,.875rem)}.sui-prose-Obc4t[data-size=lg]{--sui-prose-font-size:var(--sui-font-size-lg,1.125rem)}:where(.sui-prose-Obc4t) p,:where(.sui-prose-Obc4t) ul,:where(.sui-prose-Obc4t) ol,:where(.sui-prose-Obc4t) blockquote,:where(.sui-prose-Obc4t) pre,:where(.sui-prose-Obc4t) figure,:where(.sui-prose-Obc4t) table,:where(.sui-prose-Obc4t) hr{margin:var(--sui-prose-flow) 0 0}:where(.sui-prose-Obc4t) h1,:where(.sui-prose-Obc4t) h2,:where(.sui-prose-Obc4t) h3,:where(.sui-prose-Obc4t) h4,:where(.sui-prose-Obc4t) h5,:where(.sui-prose-Obc4t) h6{margin:calc(var(--sui-prose-flow) * 2) 0 0;font-family:var(--sui-font-heading,system-ui, sans-serif);font-weight:var(--sui-font-weight-bold,700);line-height:var(--sui-line-height-tight,1.25)}:where(.sui-prose-Obc4t) h1{font-size:var(--sui-font-size-3xl,1.875rem)}:where(.sui-prose-Obc4t) h2{font-size:var(--sui-font-size-2xl,1.5rem)}:where(.sui-prose-Obc4t) h3{font-size:var(--sui-font-size-xl,1.25rem)}:where(.sui-prose-Obc4t) h4{font-size:var(--sui-font-size-lg,1.125rem)}:where(.sui-prose-Obc4t) h5{font-size:var(--sui-font-size-md,1rem)}:where(.sui-prose-Obc4t) h6{font-size:var(--sui-font-size-sm,.875rem)}:where(.sui-prose-Obc4t) li{margin-block-start:calc(var(--sui-prose-flow) / 4)}:where(.sui-prose-Obc4t) figcaption{color:var(--sui-color-text-muted,#4b5563);margin-block-start:calc(var(--sui-prose-flow) / 2);font-size:.875em}:where(.sui-prose-Obc4t) p:where(:first-child),:where(.sui-prose-Obc4t) ul:where(:first-child),:where(.sui-prose-Obc4t) ol:where(:first-child),:where(.sui-prose-Obc4t) blockquote:where(:first-child),:where(.sui-prose-Obc4t) pre:where(:first-child),:where(.sui-prose-Obc4t) figure:where(:first-child),:where(.sui-prose-Obc4t) table:where(:first-child),:where(.sui-prose-Obc4t) hr:where(:first-child),:where(.sui-prose-Obc4t) h1:where(:first-child),:where(.sui-prose-Obc4t) h2:where(:first-child),:where(.sui-prose-Obc4t) h3:where(:first-child),:where(.sui-prose-Obc4t) h4:where(:first-child),:where(.sui-prose-Obc4t) h5:where(:first-child),:where(.sui-prose-Obc4t) h6:where(:first-child),:where(.sui-prose-Obc4t) li:where(:first-child),:where(.sui-prose-Obc4t) figcaption:where(:first-child){margin-block-start:0}:where(.sui-prose-Obc4t) a{color:var(--sui-link-color,var(--sui-color-primary,#2563eb));text-decoration-line:underline;text-decoration-thickness:var(--sui-border-width,1px);text-underline-offset:.2em}:where(.sui-prose-Obc4t) a:where(:hover){text-decoration-thickness:calc(var(--sui-border-width,1px) * 2)}:where(.sui-prose-Obc4t) a:where(:focus-visible){outline:var(--sui-focus-ring-width,2px) solid var(--sui-color-focus-ring,#3b82f6);outline-offset:2px}:where(.sui-prose-Obc4t) ul,:where(.sui-prose-Obc4t) ol{padding-inline-start:var(--sui-space-6,1.5rem)}:where(.sui-prose-Obc4t) ul:where(:not([type])),:where(.sui-prose-Obc4t) ol:where(:not([type])){list-style-type:revert}:where(.sui-prose-Obc4t) blockquote{border-inline-start:calc(var(--sui-border-width,1px) * 3) solid var(--sui-color-border,#d1d5db);color:var(--sui-color-text-muted,#4b5563);padding-inline-start:var(--sui-space-4,1rem)}:where(.sui-prose-Obc4t) hr{border:0;border-block-start:var(--sui-border-width,1px) solid var(--sui-color-border,#d1d5db)}:where(.sui-prose-Obc4t) code{padding:0 var(--sui-space-1,.25rem);border-radius:var(--sui-radius-sm,2px);background-color:var(--sui-color-sunken,#f3f4f6);font-family:var(--sui-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);font-size:.875em}:where(.sui-prose-Obc4t) kbd{padding:0 var(--sui-space-1,.25rem);border:var(--sui-border-width,1px) solid var(--sui-color-border,#d1d5db);border-block-end-width:calc(var(--sui-border-width,1px) * 2);border-radius:var(--sui-radius-sm,2px);background-color:var(--sui-color-sunken,#f3f4f6);color:var(--sui-color-text,#111827);font-family:var(--sui-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);white-space:nowrap;font-size:.875em}:where(.sui-prose-Obc4t) pre{padding:var(--sui-space-4,1rem);border-radius:var(--sui-radius-md,4px);background-color:var(--sui-color-sunken,#f3f4f6);font-family:var(--sui-font-mono,ui-monospace, SFMono-Regular, Menlo, monospace);font-size:.875em;line-height:var(--sui-line-height-normal,1.5);overflow-wrap:anywhere;white-space:pre-wrap}:where(.sui-prose-Obc4t[data-code-overflow=scroll]) pre{white-space:pre;overflow-x:auto}:where(.sui-prose-Obc4t) pre code{font-size:inherit;background-color:#0000;border-radius:0;padding:0}:where(.sui-prose-Obc4t) img{block-size:auto;max-inline-size:100%}:where(.sui-prose-Obc4t) table{border-collapse:collapse;overflow-wrap:break-word;inline-size:max-content;max-inline-size:100%;display:block;overflow:auto}:where(.sui-prose-Obc4t) pre:where(:focus-visible),:where(.sui-prose-Obc4t) table:where(:focus-visible){outline:var(--sui-focus-ring-width,2px) solid var(--sui-color-focus-ring,#3b82f6);outline-offset:2px}:where(.sui-prose-Obc4t) th,:where(.sui-prose-Obc4t) td{padding:var(--sui-space-2,.5rem) var(--sui-space-3,.75rem);border:var(--sui-border-width,1px) solid var(--sui-color-border,#d1d5db)}:where(.sui-prose-Obc4t) th{background-color:var(--sui-color-sunken,#f3f4f6);font-weight:var(--sui-font-weight-bold,700)}
@@ -0,0 +1,50 @@
1
+ import type { JSX } from "react";
2
+ import type { BoxElement, BoxProps } from "../Box";
3
+ /**
4
+ * Body text sizes of prose, mapped to the `--sui-font-size-*` tokens
5
+ */
6
+ export type ProseSize = "sm" | "md" | "lg";
7
+ /**
8
+ * What a code block in prose does with a line wider than the column
9
+ */
10
+ export type ProseCodeOverflow = "wrap" | "scroll";
11
+ interface ProseOwnProps {
12
+ /**
13
+ * What a code block does with a line wider than the column: `wrap` breaks it onto the next line,
14
+ * and `scroll` keeps it whole and scrolls the block sideways, so wrapping cannot break indentation
15
+ * or a diagram drawn in text. Defaults to `wrap`.
16
+ */
17
+ codeOverflow?: ProseCodeOverflow;
18
+ /**
19
+ * Body text size. Defaults to `md`.
20
+ */
21
+ size?: ProseSize;
22
+ }
23
+ /**
24
+ * Props for `Prose`: its own props plus every prop supported by the element given in `as`
25
+ */
26
+ export type ProseProps<E extends BoxElement = "div"> = ProseOwnProps & Omit<BoxProps<E>, keyof ProseOwnProps>;
27
+ /**
28
+ * Styles the raw HTML inside it: headings, paragraphs, links, lists, quotes, code, images, figures
29
+ * and tables. It is for content that cannot be written one component per element, such as rendered
30
+ * markdown or CMS output.
31
+ *
32
+ * A StylesUI component inside prose keeps its own styles. Two things are still styled as prose: a
33
+ * raw element inside that component, and, for the properties it does not set itself, a component
34
+ * rendered through `as` as an element prose styles, such as `<Text as="code">`.
35
+ *
36
+ * A table wider than the column scrolls sideways inside its own box, as does a code block when
37
+ * `codeOverflow` is `scroll`; give each one that scrolls `tabIndex={0}` so a keyboard can scroll it.
38
+ * Set `--sui-prose-line-height` on the prose or an ancestor to space out long lines of text. Code
39
+ * keeps `--sui-line-height-normal`.
40
+ *
41
+ * @example
42
+ * <Prose as="article" size="lg">
43
+ * <h2>Release notes</h2>
44
+ * <p>
45
+ * Read the <a href="#changelog">changelog</a> before you upgrade.
46
+ * </p>
47
+ * </Prose>
48
+ */
49
+ export declare function Prose<E extends BoxElement = "div">({ as, className, codeOverflow, size, ...rest }: ProseProps<E>): JSX.Element;
50
+ export {};
@@ -0,0 +1,15 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import t from "./Prose.module.js";
3
+ import { clsx as n } from "clsx";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ // src/components/Prose/Prose.tsx
6
+ function i({ as: i, className: a, codeOverflow: o = "wrap", size: s = "md", ...c }) {
7
+ return /* @__PURE__ */ r(e, {
8
+ ...c,
9
+ as: i,
10
+ className: n(t.prose, a),
11
+ "data-code-overflow": o,
12
+ "data-size": s
13
+ });
14
+ }
15
+ export { i as Prose };
@@ -0,0 +1,3 @@
1
+ import './Prose.css';// src/components/Prose/Prose.module.css
2
+ var e = "sui-prose-Obc4t", t = { prose: e };
3
+ export { t as default, e as prose };
@@ -0,0 +1,2 @@
1
+ export { Prose } from "./Prose";
2
+ export type { ProseCodeOverflow, ProseProps, ProseSize } from "./Prose";
@@ -0,0 +1,29 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ import type { BoxProps } from "../Box";
3
+ /**
4
+ * Props for `Radio`: its own props plus every native input prop. `className` and `style` go to the wrapping
5
+ * label; `ref` and every other prop go to the input.
6
+ */
7
+ export interface RadioProps extends Omit<BoxProps<"input">, "as" | "children" | "dangerouslySetInnerHTML" | "type" | "value"> {
8
+ /**
9
+ * Label shown beside the button, which names the radio. Without it, give the radio an accessible name, for
10
+ * example with `aria-label`. It is inline content, as a `label` holds: a child laid out as a block drops below the
11
+ * button, so put a description after the radio, padded by `var(--sui-space-6)`.
12
+ */
13
+ children?: ReactNode;
14
+ /**
15
+ * The value this radio stands for: what a form submits when it is selected, and what a `RadioGroup` reports
16
+ * and matches against its own value
17
+ */
18
+ value: string;
19
+ }
20
+ /**
21
+ * Themed native radio button inside the label that names it. On its own it is a plain native radio: radios
22
+ * that share a `name` allow one selection. Inside a `RadioGroup` it takes its `name` and `required` state from
23
+ * the group, its selection from the group's `value` or `defaultValue`, and reports its `value` to the group's
24
+ * `onValueChange` after its own `onChange`.
25
+ *
26
+ * @example
27
+ * <Radio name="plan" value="monthly">Pay monthly</Radio>
28
+ */
29
+ export declare function Radio({ children, onChange, value, ...rest }: RadioProps): JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { useRadioGroupItem as e } from "../../forms/useRadioGroupItem.js";
2
+ import { ChoiceControl as t } from "../ChoiceControl/ChoiceControl.js";
3
+ import { c as n } from "react/compiler-runtime";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ // src/components/Radio/Radio.tsx
6
+ function i(i) {
7
+ let a = n(13), o, s, c, l;
8
+ a[0] === i ? (o = a[1], s = a[2], c = a[3], l = a[4]) : ({children: o, onChange: s, value: l, ...c} = i, a[0] = i, a[1] = o, a[2] = s, a[3] = c, a[4] = l);
9
+ let u;
10
+ a[5] !== s || a[6] !== l ? (u = {
11
+ onChange: s,
12
+ value: l
13
+ }, a[5] = s, a[6] = l, a[7] = u) : u = a[7];
14
+ let d = e(u), f;
15
+ return a[8] !== o || a[9] !== d || a[10] !== c || a[11] !== l ? (f = /* @__PURE__ */ r(t, {
16
+ ...c,
17
+ ...d,
18
+ kind: "radio",
19
+ value: l,
20
+ children: o
21
+ }), a[8] = o, a[9] = d, a[10] = c, a[11] = l, a[12] = f) : f = a[12], f;
22
+ }
23
+ export { i as Radio };
@@ -0,0 +1,2 @@
1
+ export { Radio } from "./Radio";
2
+ export type { RadioProps } from "./Radio";
@@ -0,0 +1 @@
1
+ .sui-radioGroup-pO2pz{--sui-radio-group-gap:var(--sui-space-2,.5rem);gap:var(--sui-radio-group-gap);display:flex}.sui-radioGroup-pO2pz[data-orientation=vertical]{flex-direction:column}.sui-radioGroup-pO2pz[data-orientation=horizontal]{gap:var(--sui-radio-group-gap) var(--sui-space-4,1rem);flex-flow:wrap}
@@ -0,0 +1,58 @@
1
+ import type { JSX } from "react";
2
+ import type { FieldsetProps } from "../Fieldset";
3
+ /**
4
+ * Direction a group lays its radios out: `vertical` in a column, `horizontal` in a row that wraps
5
+ */
6
+ export type RadioGroupOrientation = "horizontal" | "vertical";
7
+ /**
8
+ * Props for `RadioGroup`: its own props plus every native fieldset prop
9
+ */
10
+ export interface RadioGroupProps extends Omit<FieldsetProps, "aria-invalid" | "aria-required" | "defaultValue" | "name" | "role"> {
11
+ /**
12
+ * Not accepted: an `error` marks the group invalid
13
+ */
14
+ "aria-invalid"?: never;
15
+ /**
16
+ * Not accepted: `required` marks the group required
17
+ */
18
+ "aria-required"?: never;
19
+ /**
20
+ * The value selected at first. It leaves the group uncontrolled, so the radios keep the user's choices.
21
+ */
22
+ defaultValue?: string;
23
+ /**
24
+ * Name every radio submits its value under. Defaults to a generated name that is unique to the group.
25
+ */
26
+ name?: string;
27
+ /**
28
+ * Called with the value of the radio the user selects, after that radio's own `onChange`
29
+ */
30
+ onValueChange?: (value: string) => void;
31
+ /**
32
+ * How the radios are laid out. Defaults to `vertical`.
33
+ */
34
+ orientation?: RadioGroupOrientation;
35
+ /**
36
+ * Whether one radio must be selected. It marks the group and every radio required and adds an asterisk
37
+ * to the label. Defaults to `false`.
38
+ */
39
+ required?: boolean;
40
+ /**
41
+ * The selected value, which makes the group controlled: the selection follows it, so update it from
42
+ * `onValueChange`. Give a value that matches no radio to select none.
43
+ */
44
+ value?: string;
45
+ }
46
+ /**
47
+ * Groups `Radio` components under a label so they share a name and one selection. The label names the group,
48
+ * `description` and `error` are linked to it, and an `error` marks the group and its radios invalid. The
49
+ * native `disabled` prop disables every radio. The group holds no state of its own: it is uncontrolled with
50
+ * `defaultValue` and controlled with `value`.
51
+ *
52
+ * @example
53
+ * <RadioGroup defaultValue="monthly" label="Billing" onValueChange={setBilling}>
54
+ * <Radio value="monthly">Pay monthly</Radio>
55
+ * <Radio value="yearly">Pay yearly</Radio>
56
+ * </RadioGroup>
57
+ */
58
+ export declare function RadioGroup({ children, defaultValue, error, label, name, onValueChange, orientation, required, value, ...rest }: RadioGroupProps): JSX.Element;
@@ -0,0 +1,36 @@
1
+ import { hasContent as e } from "../../forms/hasContent.js";
2
+ import { RadioGroupContext as t } from "../../forms/RadioGroupContext.js";
3
+ import { Box as n } from "../Box/Box.js";
4
+ import { Fieldset as r } from "../Fieldset/Fieldset.js";
5
+ import { RequiredIndicator as i } from "../RequiredIndicator/RequiredIndicator.js";
6
+ import a from "./RadioGroup.module.js";
7
+ import { useId as o } from "react";
8
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
9
+ // src/components/RadioGroup/RadioGroup.tsx
10
+ function u({ children: u, defaultValue: d, error: f, label: p, name: m, onValueChange: h, orientation: g = "vertical", required: _ = !1, value: v, ...y }) {
11
+ let b = o(), x = e(f);
12
+ return /* @__PURE__ */ c(t.Provider, {
13
+ value: {
14
+ defaultValue: d,
15
+ invalid: x,
16
+ name: m ?? b,
17
+ onValueChange: h,
18
+ required: _,
19
+ value: v
20
+ },
21
+ children: /* @__PURE__ */ c(r, {
22
+ ...y,
23
+ error: f,
24
+ label: _ ? /* @__PURE__ */ l(s, { children: [p, /* @__PURE__ */ c(i, {})] }) : p,
25
+ role: "radiogroup",
26
+ "aria-invalid": x ? !0 : void 0,
27
+ "aria-required": _ ? !0 : void 0,
28
+ children: /* @__PURE__ */ c(n, {
29
+ className: a.radioGroup,
30
+ "data-orientation": g,
31
+ children: u
32
+ })
33
+ })
34
+ });
35
+ }
36
+ export { u as RadioGroup };
@@ -0,0 +1,3 @@
1
+ import './RadioGroup.css';// src/components/RadioGroup/RadioGroup.module.css
2
+ var e = "sui-radioGroup-pO2pz", t = { radioGroup: e };
3
+ export { t as default, e as radioGroup };
@@ -0,0 +1,2 @@
1
+ export { RadioGroup } from "./RadioGroup";
2
+ export type { RadioGroupOrientation, RadioGroupProps } from "./RadioGroup";
@@ -0,0 +1 @@
1
+ .sui-requiredIndicator-11-gH{color:var(--sui-color-danger-text,#b91c1c);margin-inline-start:var(--sui-space-1,.25rem)}
@@ -0,0 +1,6 @@
1
+ import type { JSX } from "react";
2
+ /**
3
+ * Asterisk that marks a required field's label. Hidden from assistive technology, since the control itself is
4
+ * marked required.
5
+ */
6
+ export declare function RequiredIndicator(): JSX.Element;
@@ -0,0 +1,15 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import t from "./RequiredIndicator.module.js";
3
+ import { c as n } from "react/compiler-runtime";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ // src/components/RequiredIndicator/RequiredIndicator.tsx
6
+ function i() {
7
+ let i = n(1), a;
8
+ return i[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ r(e, {
9
+ as: "span",
10
+ className: t.requiredIndicator,
11
+ "aria-hidden": "true",
12
+ children: "*"
13
+ }), i[0] = a) : a = i[0], a;
14
+ }
15
+ export { i as RequiredIndicator };
@@ -0,0 +1,3 @@
1
+ import './RequiredIndicator.css';// src/components/RequiredIndicator/RequiredIndicator.module.css
2
+ var e = "sui-requiredIndicator-11-gH", t = { requiredIndicator: e };
3
+ export { t as default, e as requiredIndicator };
@@ -0,0 +1 @@
1
+ export { RequiredIndicator } from "./RequiredIndicator";
@@ -0,0 +1,29 @@
1
+ import type { JSX } from "react";
2
+ import type { Alignment, Justification, Space } from "../../layout";
3
+ import type { BoxElement, BoxProps } from "../Box";
4
+ interface RowOwnProps {
5
+ /**
6
+ * Cross-axis placement of children. Defaults to `center`.
7
+ */
8
+ align?: Alignment;
9
+ /**
10
+ * Space between children. Defaults to `2`.
11
+ */
12
+ gap?: Space;
13
+ /**
14
+ * Main-axis distribution of children. Defaults to `start`.
15
+ */
16
+ justify?: Justification;
17
+ }
18
+ /**
19
+ * Props for `Row`: its own props plus every prop supported by the element given in `as`
20
+ */
21
+ export type RowProps<E extends BoxElement = "div"> = RowOwnProps & Omit<BoxProps<E>, keyof RowOwnProps>;
22
+ /**
23
+ * Horizontal flow that keeps its children on one line. Use `Cluster` when they should wrap.
24
+ *
25
+ * @example
26
+ * <Row as="header" justify="between">...</Row>
27
+ */
28
+ export declare function Row<E extends BoxElement = "div">({ align, gap, justify, ...rest }: RowProps<E>): JSX.Element;
29
+ export {};
@@ -0,0 +1,13 @@
1
+ import { HorizontalFlow as e } from "../HorizontalFlow/HorizontalFlow.js";
2
+ import { jsx as t } from "react/jsx-runtime";
3
+ // src/components/Row/Row.tsx
4
+ function n({ align: n = "center", gap: r = 2, justify: i = "start", ...a }) {
5
+ return /* @__PURE__ */ t(e, {
6
+ ...a,
7
+ align: n,
8
+ gap: r,
9
+ justify: i,
10
+ wrap: !1
11
+ });
12
+ }
13
+ export { n as Row };
@@ -0,0 +1,2 @@
1
+ export { Row } from "./Row";
2
+ export type { RowProps } from "./Row";
@@ -0,0 +1,24 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ import type { BoxProps } from "../Box";
3
+ /**
4
+ * Props for `Segment`: its own props plus every native input prop. `className` and `style` go to the label; `ref`
5
+ * and every other prop go to the input.
6
+ */
7
+ export interface SegmentProps extends Omit<BoxProps<"input">, "as" | "children" | "dangerouslySetInnerHTML" | "type" | "value"> {
8
+ /**
9
+ * The segment's label, which names it. Without it, give the segment an accessible name, for example with
10
+ * `aria-label`.
11
+ */
12
+ children?: ReactNode;
13
+ /**
14
+ * The value this segment stands for, which the `SegmentedControl` reports and a form submits
15
+ */
16
+ value: string;
17
+ }
18
+ /**
19
+ * One choice in a `SegmentedControl`: a native radio drawn as a joined button
20
+ *
21
+ * @example
22
+ * <Segment value="dark">Dark</Segment>
23
+ */
24
+ export declare function Segment({ children, className, onChange, style, value, ...rest }: SegmentProps): JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { useRadioGroupItem as e } from "../../forms/useRadioGroupItem.js";
2
+ import { Box as t } from "../Box/Box.js";
3
+ import n from "./SegmentedControl.module.js";
4
+ import { clsx as r } from "clsx";
5
+ import { c as i } from "react/compiler-runtime";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ // src/components/SegmentedControl/Segment.tsx
8
+ function s(s) {
9
+ let c = i(23), l, u, d, f, p, m;
10
+ c[0] === s ? (l = c[1], u = c[2], d = c[3], f = c[4], p = c[5], m = c[6]) : ({children: l, className: u, onChange: d, style: p, value: m, ...f} = s, c[0] = s, c[1] = l, c[2] = u, c[3] = d, c[4] = f, c[5] = p, c[6] = m);
11
+ let h;
12
+ c[7] !== d || c[8] !== m ? (h = {
13
+ onChange: d,
14
+ value: m
15
+ }, c[7] = d, c[8] = m, c[9] = h) : h = c[9];
16
+ let g = e(h), _;
17
+ c[10] === u ? _ = c[11] : (_ = r(n.segment, u), c[10] = u, c[11] = _);
18
+ let v;
19
+ c[12] !== g || c[13] !== f || c[14] !== m ? (v = /* @__PURE__ */ a(t, {
20
+ ...f,
21
+ ...g,
22
+ as: "input",
23
+ className: n.input,
24
+ type: "radio",
25
+ value: m
26
+ }), c[12] = g, c[13] = f, c[14] = m, c[15] = v) : v = c[15];
27
+ let y;
28
+ c[16] === l ? y = c[17] : (y = /* @__PURE__ */ a(t, {
29
+ as: "span",
30
+ className: n.text,
31
+ children: l
32
+ }), c[16] = l, c[17] = y);
33
+ let b;
34
+ return c[18] !== p || c[19] !== _ || c[20] !== v || c[21] !== y ? (b = /* @__PURE__ */ o(t, {
35
+ as: "label",
36
+ className: _,
37
+ style: p,
38
+ children: [v, y]
39
+ }), c[18] = p, c[19] = _, c[20] = v, c[21] = y, c[22] = b) : b = c[22], b;
40
+ }
41
+ export { s as Segment };
@@ -0,0 +1 @@
1
+ .sui-track-wz5iS{--sui-segmented-control-inset:2px;--sui-segmented-control-depth:var(--sui-control-depth,0px);--sui-segment-padding-x:var(--sui-space-4,1rem);--sui-segment-padding-y:var(--sui-space-2,.5rem);--sui-segment-font-size:var(--sui-font-size-md,1rem);gap:var(--sui-segmented-control-inset);padding:var(--sui-segmented-control-inset);border:var(--sui-border-width,1px) solid var(--sui-color-input-border,#6b7280);border-radius:var(--sui-radius-control,4px);padding-block-end:calc(var(--sui-segmented-control-inset) + var(--sui-segmented-control-depth));display:inline-flex}.sui-track-wz5iS[data-size=sm]{--sui-segment-padding-x:var(--sui-space-3,.75rem);--sui-segment-padding-y:var(--sui-space-1,.25rem);--sui-segment-font-size:var(--sui-font-size-sm,.875rem)}.sui-track-wz5iS[data-size=lg]{--sui-segment-padding-x:var(--sui-space-6,1.5rem);--sui-segment-padding-y:var(--sui-space-3,.75rem);--sui-segment-font-size:var(--sui-font-size-lg,1.125rem)}.sui-segmentedControl-ocGwO[aria-invalid=true] .sui-track-wz5iS{border-color:var(--sui-color-danger-text,#b91c1c)}.sui-segment-cu-EL{padding:calc(var(--sui-segment-padding-y,var(--sui-space-2,.5rem)) - var(--sui-segmented-control-inset,2px)) calc(var(--sui-segment-padding-x,var(--sui-space-4,1rem)) - var(--sui-segmented-control-inset,2px));color:var(--sui-color-text,#111827);font-family:var(--sui-font-body,system-ui, sans-serif);font-size:var(--sui-segment-font-size,var(--sui-font-size-md,1rem));font-weight:var(--sui-font-weight-control,500);line-height:var(--sui-line-height-tight,1.25);place-items:center;display:inline-grid;position:relative}.sui-input-IEP3u{border:var(--sui-border-width,1px) solid transparent;border-radius:calc(var(--sui-radius-control,4px) - var(--sui-segmented-control-inset,2px));cursor:pointer;appearance:none;background-color:#0000;margin:0;transition:background-color .12s,border-color .12s,box-shadow .12s ease-out;position:absolute;inset:0}.sui-text-5WlQL{pointer-events:none;transition:color .12s;position:relative}.sui-input-IEP3u:hover:not(:checked,:disabled){background-color:var(--sui-color-secondary-subtle,#f3f4f6)}.sui-input-IEP3u:checked{border-color:var(--sui-color-control-border,transparent);background-color:var(--sui-color-primary,#2563eb);box-shadow:0 var(--sui-segmented-control-depth,var(--sui-control-depth,0px)) 0 var(--sui-color-shadow,transparent);transition:background-color .12s ease, border-color .12s ease, box-shadow var(--sui-motion-spring,.12s ease-out)}.sui-input-IEP3u:checked+.sui-text-5WlQL{color:var(--sui-color-on-primary,#fff)}.sui-input-IEP3u:focus-visible{outline:var(--sui-focus-ring-width,2px) solid var(--sui-color-focus-ring,#3b82f6);outline-offset:2px}.sui-input-IEP3u:disabled,.sui-input-IEP3u:disabled+.sui-text-5WlQL{cursor:not-allowed;opacity:.5}@media (prefers-reduced-motion:reduce){.sui-input-IEP3u,.sui-input-IEP3u:checked{transition:background-color .12s,border-color .12s}}@media (forced-colors:active){.sui-input-IEP3u:checked{background-color:highlight;border-color:highlight}.sui-input-IEP3u:checked+.sui-text-5WlQL{color:highlighttext;forced-color-adjust:none}}
@@ -0,0 +1,25 @@
1
+ import type { JSX } from "react";
2
+ import type { ControlSize } from "../../forms";
3
+ import type { RadioGroupProps } from "../RadioGroup";
4
+ /**
5
+ * Props for `SegmentedControl`: `RadioGroup`'s props except `orientation`, plus `size`
6
+ */
7
+ export interface SegmentedControlProps extends Omit<RadioGroupProps, "orientation"> {
8
+ /**
9
+ * Height of the control, matching the `Button` sizes. Defaults to `md`.
10
+ */
11
+ size?: ControlSize;
12
+ }
13
+ /**
14
+ * Chooses one value from a few, drawn as a row of joined `Segment`s. It is a `RadioGroup`, so it takes the same
15
+ * label, description, error and value props, and works with the keyboard and in a form as native radios do. To switch
16
+ * between views rather than choose a value, use pill `Tabs`.
17
+ *
18
+ * @example
19
+ * <SegmentedControl defaultValue="system" label="Appearance" onValueChange={setAppearance}>
20
+ * <Segment value="light">Light</Segment>
21
+ * <Segment value="dark">Dark</Segment>
22
+ * <Segment value="system">System</Segment>
23
+ * </SegmentedControl>
24
+ */
25
+ export declare function SegmentedControl({ children, className, size, ...rest }: SegmentedControlProps): JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import { RadioGroup as t } from "../RadioGroup/RadioGroup.js";
3
+ import n from "./SegmentedControl.module.js";
4
+ import { clsx as r } from "clsx";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ // src/components/SegmentedControl/SegmentedControl.tsx
7
+ function a({ children: a, className: o, size: s = "md", ...c }) {
8
+ return /* @__PURE__ */ i(t, {
9
+ ...c,
10
+ className: r(n.segmentedControl, o),
11
+ orientation: "horizontal",
12
+ children: /* @__PURE__ */ i(e, {
13
+ className: n.track,
14
+ "data-size": s,
15
+ children: a
16
+ })
17
+ });
18
+ }
19
+ export { a as SegmentedControl };
@@ -0,0 +1,9 @@
1
+ import './SegmentedControl.css';// src/components/SegmentedControl/SegmentedControl.module.css
2
+ var e = "sui-track-wz5iS", t = "sui-segmentedControl-ocGwO", n = "sui-segment-cu-EL", r = "sui-input-IEP3u", i = "sui-text-5WlQL", a = {
3
+ track: e,
4
+ segmentedControl: t,
5
+ segment: n,
6
+ input: r,
7
+ text: i
8
+ };
9
+ export { a as default, r as input, n as segment, t as segmentedControl, i as text, e as track };
@@ -0,0 +1,4 @@
1
+ export { Segment } from "./Segment";
2
+ export type { SegmentProps } from "./Segment";
3
+ export { SegmentedControl } from "./SegmentedControl";
4
+ export type { SegmentedControlProps } from "./SegmentedControl";