@krelborn/stylesui 0.0.0-stage → 0.8.1

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 (359) 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 +6 -0
  6. package/dist/accessibility/index.d.ts +2 -0
  7. package/dist/collections/index.d.ts +4 -0
  8. package/dist/collections/targetIndexForKey.d.ts +45 -0
  9. package/dist/collections/targetIndexForKey.js +17 -0
  10. package/dist/collections/typeAhead.d.ts +43 -0
  11. package/dist/collections/typeAhead.js +19 -0
  12. package/dist/components/Alert/Alert.css +1 -0
  13. package/dist/components/Alert/Alert.d.ts +47 -0
  14. package/dist/components/Alert/Alert.js +28 -0
  15. package/dist/components/Alert/Alert.module.js +9 -0
  16. package/dist/components/Alert/AlertIcon.d.ts +14 -0
  17. package/dist/components/Alert/AlertIcon.js +43 -0
  18. package/dist/components/Alert/index.d.ts +2 -0
  19. package/dist/components/Avatar/Avatar.css +1 -0
  20. package/dist/components/Avatar/Avatar.d.ts +33 -0
  21. package/dist/components/Avatar/Avatar.js +27 -0
  22. package/dist/components/Avatar/Avatar.module.js +7 -0
  23. package/dist/components/Avatar/index.d.ts +2 -0
  24. package/dist/components/Avatar/initialsOf.d.ts +9 -0
  25. package/dist/components/Avatar/initialsOf.js +10 -0
  26. package/dist/components/AvatarGroup/AvatarGroup.css +1 -0
  27. package/dist/components/AvatarGroup/AvatarGroup.d.ts +30 -0
  28. package/dist/components/AvatarGroup/AvatarGroup.js +34 -0
  29. package/dist/components/AvatarGroup/AvatarGroup.module.js +7 -0
  30. package/dist/components/AvatarGroup/index.d.ts +2 -0
  31. package/dist/components/Badge/Badge.css +1 -0
  32. package/dist/components/Badge/Badge.d.ts +36 -0
  33. package/dist/components/Badge/Badge.js +16 -0
  34. package/dist/components/Badge/Badge.module.js +4 -0
  35. package/dist/components/Badge/index.d.ts +2 -0
  36. package/dist/components/Box/Box.css +1 -0
  37. package/dist/components/Box/Box.d.ts +31 -0
  38. package/dist/components/Box/Box.js +18 -0
  39. package/dist/components/Box/Box.module.js +4 -0
  40. package/dist/components/Box/index.d.ts +2 -0
  41. package/dist/components/Button/Button.css +1 -0
  42. package/dist/components/Button/Button.d.ts +42 -0
  43. package/dist/components/Button/Button.js +29 -0
  44. package/dist/components/Button/Button.module.js +7 -0
  45. package/dist/components/Button/index.d.ts +2 -0
  46. package/dist/components/Card/Card.css +1 -0
  47. package/dist/components/Card/Card.d.ts +24 -0
  48. package/dist/components/Card/Card.js +15 -0
  49. package/dist/components/Card/Card.module.js +4 -0
  50. package/dist/components/Card/index.d.ts +2 -0
  51. package/dist/components/Center/Center.css +1 -0
  52. package/dist/components/Center/Center.d.ts +34 -0
  53. package/dist/components/Center/Center.js +20 -0
  54. package/dist/components/Center/Center.module.js +4 -0
  55. package/dist/components/Center/index.d.ts +2 -0
  56. package/dist/components/Checkbox/Checkbox.d.ts +23 -0
  57. package/dist/components/Checkbox/Checkbox.js +13 -0
  58. package/dist/components/Checkbox/index.d.ts +2 -0
  59. package/dist/components/ChoiceControl/ChoiceControl.css +1 -0
  60. package/dist/components/ChoiceControl/ChoiceControl.d.ts +21 -0
  61. package/dist/components/ChoiceControl/ChoiceControl.js +40 -0
  62. package/dist/components/ChoiceControl/ChoiceControl.module.js +9 -0
  63. package/dist/components/ChoiceControl/index.d.ts +1 -0
  64. package/dist/components/Cluster/Cluster.d.ts +29 -0
  65. package/dist/components/Cluster/Cluster.js +14 -0
  66. package/dist/components/Cluster/index.d.ts +2 -0
  67. package/dist/components/Code/Code.css +1 -0
  68. package/dist/components/Code/Code.d.ts +13 -0
  69. package/dist/components/Code/Code.js +20 -0
  70. package/dist/components/Code/Code.module.js +4 -0
  71. package/dist/components/Code/index.d.ts +2 -0
  72. package/dist/components/Counter/Counter.css +1 -0
  73. package/dist/components/Counter/Counter.d.ts +39 -0
  74. package/dist/components/Counter/Counter.js +19 -0
  75. package/dist/components/Counter/Counter.module.js +4 -0
  76. package/dist/components/Counter/index.d.ts +2 -0
  77. package/dist/components/Cover/Cover.css +1 -0
  78. package/dist/components/Cover/Cover.d.ts +40 -0
  79. package/dist/components/Cover/Cover.js +30 -0
  80. package/dist/components/Cover/Cover.module.js +7 -0
  81. package/dist/components/Cover/index.d.ts +2 -0
  82. package/dist/components/Divider/Divider.css +1 -0
  83. package/dist/components/Divider/Divider.d.ts +25 -0
  84. package/dist/components/Divider/Divider.js +16 -0
  85. package/dist/components/Divider/Divider.module.js +4 -0
  86. package/dist/components/Divider/index.d.ts +2 -0
  87. package/dist/components/Field/Field.css +1 -0
  88. package/dist/components/Field/Field.d.ts +49 -0
  89. package/dist/components/Field/Field.js +48 -0
  90. package/dist/components/Field/Field.module.js +9 -0
  91. package/dist/components/Field/index.d.ts +2 -0
  92. package/dist/components/Fieldset/Fieldset.css +1 -0
  93. package/dist/components/Fieldset/Fieldset.d.ts +35 -0
  94. package/dist/components/Fieldset/Fieldset.js +65 -0
  95. package/dist/components/Fieldset/Fieldset.module.js +9 -0
  96. package/dist/components/Fieldset/index.d.ts +2 -0
  97. package/dist/components/Frame/Frame.css +1 -0
  98. package/dist/components/Frame/Frame.d.ts +23 -0
  99. package/dist/components/Frame/Frame.js +17 -0
  100. package/dist/components/Frame/Frame.module.js +4 -0
  101. package/dist/components/Frame/index.d.ts +2 -0
  102. package/dist/components/Grid/Grid.css +1 -0
  103. package/dist/components/Grid/Grid.d.ts +25 -0
  104. package/dist/components/Grid/Grid.js +23 -0
  105. package/dist/components/Grid/Grid.module.js +4 -0
  106. package/dist/components/Grid/index.d.ts +2 -0
  107. package/dist/components/Heading/Heading.css +1 -0
  108. package/dist/components/Heading/Heading.d.ts +39 -0
  109. package/dist/components/Heading/Heading.js +24 -0
  110. package/dist/components/Heading/Heading.module.js +4 -0
  111. package/dist/components/Heading/index.d.ts +2 -0
  112. package/dist/components/HorizontalFlow/HorizontalFlow.css +1 -0
  113. package/dist/components/HorizontalFlow/HorizontalFlow.d.ts +30 -0
  114. package/dist/components/HorizontalFlow/HorizontalFlow.js +31 -0
  115. package/dist/components/HorizontalFlow/HorizontalFlow.module.js +4 -0
  116. package/dist/components/HorizontalFlow/index.d.ts +2 -0
  117. package/dist/components/Icon/AddIcon.d.ts +11 -0
  118. package/dist/components/Icon/AddIcon.js +22 -0
  119. package/dist/components/Icon/ChevronDownIcon.d.ts +11 -0
  120. package/dist/components/Icon/ChevronDownIcon.js +19 -0
  121. package/dist/components/Icon/CloseIcon.d.ts +12 -0
  122. package/dist/components/Icon/CloseIcon.js +22 -0
  123. package/dist/components/Icon/ColorModeIcon.d.ts +12 -0
  124. package/dist/components/Icon/ColorModeIcon.js +37 -0
  125. package/dist/components/Icon/DeleteIcon.d.ts +11 -0
  126. package/dist/components/Icon/DeleteIcon.js +37 -0
  127. package/dist/components/Icon/Icon.css +1 -0
  128. package/dist/components/Icon/Icon.d.ts +40 -0
  129. package/dist/components/Icon/Icon.js +28 -0
  130. package/dist/components/Icon/Icon.module.js +7 -0
  131. package/dist/components/Icon/InfoIcon.d.ts +11 -0
  132. package/dist/components/Icon/InfoIcon.js +31 -0
  133. package/dist/components/Icon/MoreHorizontalIcon.d.ts +11 -0
  134. package/dist/components/Icon/MoreHorizontalIcon.js +35 -0
  135. package/dist/components/Icon/MoreVerticalIcon.d.ts +11 -0
  136. package/dist/components/Icon/MoreVerticalIcon.js +35 -0
  137. package/dist/components/Icon/PaletteIcon.d.ts +12 -0
  138. package/dist/components/Icon/PaletteIcon.js +49 -0
  139. package/dist/components/Icon/RefreshIcon.d.ts +13 -0
  140. package/dist/components/Icon/RefreshIcon.js +33 -0
  141. package/dist/components/Icon/RemoveIcon.d.ts +11 -0
  142. package/dist/components/Icon/RemoveIcon.js +19 -0
  143. package/dist/components/Icon/SendIcon.d.ts +11 -0
  144. package/dist/components/Icon/SendIcon.js +23 -0
  145. package/dist/components/Icon/index.d.ts +13 -0
  146. package/dist/components/IconButton/IconButton.css +1 -0
  147. package/dist/components/IconButton/IconButton.d.ts +45 -0
  148. package/dist/components/IconButton/IconButton.js +41 -0
  149. package/dist/components/IconButton/IconButton.module.js +8 -0
  150. package/dist/components/IconButton/index.d.ts +2 -0
  151. package/dist/components/Kbd/Kbd.css +1 -0
  152. package/dist/components/Kbd/Kbd.d.ts +13 -0
  153. package/dist/components/Kbd/Kbd.js +20 -0
  154. package/dist/components/Kbd/Kbd.module.js +4 -0
  155. package/dist/components/Kbd/index.d.ts +2 -0
  156. package/dist/components/Link/Link.css +1 -0
  157. package/dist/components/Link/Link.d.ts +52 -0
  158. package/dist/components/Link/Link.js +27 -0
  159. package/dist/components/Link/Link.module.js +4 -0
  160. package/dist/components/Link/index.d.ts +2 -0
  161. package/dist/components/Listbox/Listbox.css +1 -0
  162. package/dist/components/Listbox/Listbox.d.ts +46 -0
  163. package/dist/components/Listbox/Listbox.js +56 -0
  164. package/dist/components/Listbox/Listbox.module.js +7 -0
  165. package/dist/components/Listbox/ListboxContext.d.ts +38 -0
  166. package/dist/components/Listbox/ListboxContext.js +5 -0
  167. package/dist/components/Listbox/ListboxOption.d.ts +31 -0
  168. package/dist/components/Listbox/ListboxOption.js +43 -0
  169. package/dist/components/Listbox/index.d.ts +4 -0
  170. package/dist/components/Listbox/optionId.d.ts +8 -0
  171. package/dist/components/Listbox/optionId.js +7 -0
  172. package/dist/components/Listbox/renderedOptions.d.ts +30 -0
  173. package/dist/components/Listbox/renderedOptions.js +15 -0
  174. package/dist/components/Listbox/useListbox.d.ts +54 -0
  175. package/dist/components/Listbox/useListbox.js +104 -0
  176. package/dist/components/Listbox/useListboxContext.d.ts +9 -0
  177. package/dist/components/Listbox/useListboxContext.js +11 -0
  178. package/dist/components/NavList/NavList.css +1 -0
  179. package/dist/components/NavList/NavList.d.ts +20 -0
  180. package/dist/components/NavList/NavList.js +28 -0
  181. package/dist/components/NavList/NavList.module.js +12 -0
  182. package/dist/components/NavList/NavListGroup.d.ts +25 -0
  183. package/dist/components/NavList/NavListGroup.js +40 -0
  184. package/dist/components/NavList/NavListItem.d.ts +53 -0
  185. package/dist/components/NavList/NavListItem.js +57 -0
  186. package/dist/components/NavList/index.d.ts +6 -0
  187. package/dist/components/Overlay/Overlay.css +1 -0
  188. package/dist/components/Overlay/Overlay.d.ts +33 -0
  189. package/dist/components/Overlay/Overlay.js +36 -0
  190. package/dist/components/Overlay/Overlay.module.js +4 -0
  191. package/dist/components/Overlay/index.d.ts +1 -0
  192. package/dist/components/PageLayout/PageLayout.css +1 -0
  193. package/dist/components/PageLayout/PageLayout.d.ts +26 -0
  194. package/dist/components/PageLayout/PageLayout.js +18 -0
  195. package/dist/components/PageLayout/PageLayout.module.js +4 -0
  196. package/dist/components/PageLayout/index.d.ts +2 -0
  197. package/dist/components/Popover/Popover.css +1 -0
  198. package/dist/components/Popover/Popover.d.ts +52 -0
  199. package/dist/components/Popover/Popover.js +21 -0
  200. package/dist/components/Popover/Popover.module.js +4 -0
  201. package/dist/components/Popover/index.d.ts +4 -0
  202. package/dist/components/Popover/usePopover.d.ts +96 -0
  203. package/dist/components/Popover/usePopover.js +66 -0
  204. package/dist/components/Prose/Prose.css +1 -0
  205. package/dist/components/Prose/Prose.d.ts +50 -0
  206. package/dist/components/Prose/Prose.js +16 -0
  207. package/dist/components/Prose/Prose.module.js +4 -0
  208. package/dist/components/Prose/index.d.ts +2 -0
  209. package/dist/components/Radio/Radio.d.ts +29 -0
  210. package/dist/components/Radio/Radio.js +24 -0
  211. package/dist/components/Radio/index.d.ts +2 -0
  212. package/dist/components/RadioGroup/RadioGroup.css +1 -0
  213. package/dist/components/RadioGroup/RadioGroup.d.ts +58 -0
  214. package/dist/components/RadioGroup/RadioGroup.js +37 -0
  215. package/dist/components/RadioGroup/RadioGroup.module.js +4 -0
  216. package/dist/components/RadioGroup/index.d.ts +2 -0
  217. package/dist/components/RequiredIndicator/RequiredIndicator.css +1 -0
  218. package/dist/components/RequiredIndicator/RequiredIndicator.d.ts +6 -0
  219. package/dist/components/RequiredIndicator/RequiredIndicator.js +16 -0
  220. package/dist/components/RequiredIndicator/RequiredIndicator.module.js +4 -0
  221. package/dist/components/RequiredIndicator/index.d.ts +1 -0
  222. package/dist/components/Row/Row.d.ts +29 -0
  223. package/dist/components/Row/Row.js +14 -0
  224. package/dist/components/Row/index.d.ts +2 -0
  225. package/dist/components/SegmentedControl/Segment.d.ts +24 -0
  226. package/dist/components/SegmentedControl/Segment.js +42 -0
  227. package/dist/components/SegmentedControl/SegmentedControl.css +1 -0
  228. package/dist/components/SegmentedControl/SegmentedControl.d.ts +25 -0
  229. package/dist/components/SegmentedControl/SegmentedControl.js +20 -0
  230. package/dist/components/SegmentedControl/SegmentedControl.module.js +10 -0
  231. package/dist/components/SegmentedControl/index.d.ts +4 -0
  232. package/dist/components/Select/Select.d.ts +27 -0
  233. package/dist/components/Select/Select.js +12 -0
  234. package/dist/components/Select/index.d.ts +2 -0
  235. package/dist/components/Sidebar/Sidebar.css +1 -0
  236. package/dist/components/Sidebar/Sidebar.d.ts +42 -0
  237. package/dist/components/Sidebar/Sidebar.js +24 -0
  238. package/dist/components/Sidebar/Sidebar.module.js +4 -0
  239. package/dist/components/Sidebar/index.d.ts +2 -0
  240. package/dist/components/SkipLink/SkipLink.css +1 -0
  241. package/dist/components/SkipLink/SkipLink.d.ts +20 -0
  242. package/dist/components/SkipLink/SkipLink.js +21 -0
  243. package/dist/components/SkipLink/SkipLink.module.js +4 -0
  244. package/dist/components/SkipLink/index.d.ts +2 -0
  245. package/dist/components/Spinner/Spinner.css +1 -0
  246. package/dist/components/Spinner/Spinner.d.ts +13 -0
  247. package/dist/components/Spinner/Spinner.js +33 -0
  248. package/dist/components/Spinner/Spinner.module.js +8 -0
  249. package/dist/components/Spinner/index.d.ts +1 -0
  250. package/dist/components/Stack/Stack.css +1 -0
  251. package/dist/components/Stack/Stack.d.ts +25 -0
  252. package/dist/components/Stack/Stack.js +21 -0
  253. package/dist/components/Stack/Stack.module.js +4 -0
  254. package/dist/components/Stack/index.d.ts +2 -0
  255. package/dist/components/StatusDot/StatusDot.css +1 -0
  256. package/dist/components/StatusDot/StatusDot.d.ts +57 -0
  257. package/dist/components/StatusDot/StatusDot.js +21 -0
  258. package/dist/components/StatusDot/StatusDot.module.js +4 -0
  259. package/dist/components/StatusDot/index.d.ts +2 -0
  260. package/dist/components/Switch/Switch.d.ts +24 -0
  261. package/dist/components/Switch/Switch.js +13 -0
  262. package/dist/components/Switch/index.d.ts +2 -0
  263. package/dist/components/Switcher/Switcher.css +1 -0
  264. package/dist/components/Switcher/Switcher.d.ts +27 -0
  265. package/dist/components/Switcher/Switcher.js +23 -0
  266. package/dist/components/Switcher/Switcher.module.js +4 -0
  267. package/dist/components/Switcher/index.d.ts +2 -0
  268. package/dist/components/Tabs/Tab.d.ts +26 -0
  269. package/dist/components/Tabs/Tab.js +61 -0
  270. package/dist/components/Tabs/TabList.d.ts +16 -0
  271. package/dist/components/Tabs/TabList.js +23 -0
  272. package/dist/components/Tabs/TabPanel.d.ts +24 -0
  273. package/dist/components/Tabs/TabPanel.js +22 -0
  274. package/dist/components/Tabs/Tabs.css +1 -0
  275. package/dist/components/Tabs/Tabs.d.ts +81 -0
  276. package/dist/components/Tabs/Tabs.js +31 -0
  277. package/dist/components/Tabs/Tabs.module.js +9 -0
  278. package/dist/components/Tabs/TabsContext.d.ts +39 -0
  279. package/dist/components/Tabs/TabsContext.js +5 -0
  280. package/dist/components/Tabs/index.d.ts +8 -0
  281. package/dist/components/Tabs/tabIds.d.ts +16 -0
  282. package/dist/components/Tabs/tabIds.js +10 -0
  283. package/dist/components/Tabs/useTabsContext.d.ts +9 -0
  284. package/dist/components/Tabs/useTabsContext.js +11 -0
  285. package/dist/components/Text/Text.css +1 -0
  286. package/dist/components/Text/Text.d.ts +40 -0
  287. package/dist/components/Text/Text.js +17 -0
  288. package/dist/components/Text/Text.module.js +4 -0
  289. package/dist/components/Text/index.d.ts +2 -0
  290. package/dist/components/TextControl/TextControl.css +1 -0
  291. package/dist/components/TextControl/TextControl.d.ts +22 -0
  292. package/dist/components/TextControl/TextControl.js +23 -0
  293. package/dist/components/TextControl/TextControl.module.js +4 -0
  294. package/dist/components/TextControl/index.d.ts +1 -0
  295. package/dist/components/TextInput/TextInput.d.ts +31 -0
  296. package/dist/components/TextInput/TextInput.js +13 -0
  297. package/dist/components/TextInput/index.d.ts +2 -0
  298. package/dist/components/Textarea/Textarea.d.ts +24 -0
  299. package/dist/components/Textarea/Textarea.js +12 -0
  300. package/dist/components/Textarea/index.d.ts +2 -0
  301. package/dist/components/Theme/Theme.d.ts +46 -0
  302. package/dist/components/Theme/Theme.js +18 -0
  303. package/dist/components/Theme/index.d.ts +2 -0
  304. package/dist/components/Tooltip/Tooltip.css +1 -0
  305. package/dist/components/Tooltip/Tooltip.d.ts +49 -0
  306. package/dist/components/Tooltip/Tooltip.js +22 -0
  307. package/dist/components/Tooltip/Tooltip.module.js +4 -0
  308. package/dist/components/Tooltip/index.d.ts +4 -0
  309. package/dist/components/Tooltip/tooltipCoordinator.d.ts +14 -0
  310. package/dist/components/Tooltip/tooltipCoordinator.js +17 -0
  311. package/dist/components/Tooltip/useTooltip.d.ts +119 -0
  312. package/dist/components/Tooltip/useTooltip.js +74 -0
  313. package/dist/components/VisuallyHidden/VisuallyHidden.css +1 -0
  314. package/dist/components/VisuallyHidden/VisuallyHidden.d.ts +14 -0
  315. package/dist/components/VisuallyHidden/VisuallyHidden.js +20 -0
  316. package/dist/components/VisuallyHidden/VisuallyHidden.module.js +4 -0
  317. package/dist/components/VisuallyHidden/index.d.ts +2 -0
  318. package/dist/errors/MissingContextError.d.ts +11 -0
  319. package/dist/errors/MissingContextError.js +9 -0
  320. package/dist/errors/PopoverRefusedError.d.ts +12 -0
  321. package/dist/errors/PopoverRefusedError.js +9 -0
  322. package/dist/errors/index.d.ts +2 -0
  323. package/dist/forms/ControlSize.d.ts +4 -0
  324. package/dist/forms/FieldContext.d.ts +29 -0
  325. package/dist/forms/FieldContext.js +5 -0
  326. package/dist/forms/RadioGroupContext.d.ts +34 -0
  327. package/dist/forms/RadioGroupContext.js +5 -0
  328. package/dist/forms/hasContent.d.ts +10 -0
  329. package/dist/forms/hasContent.js +7 -0
  330. package/dist/forms/index.d.ts +8 -0
  331. package/dist/forms/useFieldControl.d.ts +36 -0
  332. package/dist/forms/useFieldControl.js +29 -0
  333. package/dist/forms/useRadioGroupItem.d.ts +50 -0
  334. package/dist/forms/useRadioGroupItem.js +27 -0
  335. package/dist/index.d.ts +95 -0
  336. package/dist/index.js +67 -0
  337. package/dist/layout/Space.d.ts +4 -0
  338. package/dist/layout/alignment.d.ts +8 -0
  339. package/dist/layout/index.d.ts +5 -0
  340. package/dist/layout/listRole.d.ts +11 -0
  341. package/dist/layout/listRole.js +6 -0
  342. package/dist/layout/spaceValue.d.ts +8 -0
  343. package/dist/layout/spaceValue.js +6 -0
  344. package/dist/layout/withCustomProperties.d.ts +9 -0
  345. package/dist/layout/withCustomProperties.js +9 -0
  346. package/dist/overlays/OverlayDelay.d.ts +13 -0
  347. package/dist/overlays/OverlayPlacement.d.ts +6 -0
  348. package/dist/overlays/anchorNameFor.d.ts +7 -0
  349. package/dist/overlays/anchorNameFor.js +6 -0
  350. package/dist/overlays/index.d.ts +6 -0
  351. package/dist/overlays/mergeProps.d.ts +13 -0
  352. package/dist/overlays/mergeProps.js +30 -0
  353. package/dist/overlays/syncPopover.d.ts +11 -0
  354. package/dist/overlays/syncPopover.js +25 -0
  355. package/dist/overlays/useOverlay.d.ts +71 -0
  356. package/dist/overlays/useOverlay.js +56 -0
  357. package/dist/styles.css +1 -0
  358. package/fonts/playful.css +3 -0
  359. package/package.json +103 -3
@@ -0,0 +1,13 @@
1
+ import type { JSX } from "react";
2
+ import type { IconProps } from "./Icon";
3
+ /**
4
+ * Two arrows chasing round a circle, for reloading or syncing. To show that a refresh is running, make the
5
+ * `IconButton` holding it `busy`, which shows a spinner in its place. It is hidden from assistive technology unless it
6
+ * has a `label`, so inside a button, name the button instead.
7
+ *
8
+ * @example
9
+ * <IconButton busy={isRefreshing} label="Refresh" onClick={refresh}>
10
+ * <RefreshIcon />
11
+ * </IconButton>
12
+ */
13
+ export declare function RefreshIcon(props: IconProps): JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import { Icon as t } from "./Icon.js";
3
+ import { c as n } from "react/compiler-runtime";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/components/Icon/RefreshIcon.tsx
6
+ function a(a) {
7
+ let o = n(6), s, c, l, u;
8
+ o[0] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ r(e, {
9
+ as: "path",
10
+ d: "M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"
11
+ }), c = /* @__PURE__ */ r(e, {
12
+ as: "path",
13
+ d: "M21 3v5h-5"
14
+ }), l = /* @__PURE__ */ r(e, {
15
+ as: "path",
16
+ d: "M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"
17
+ }), u = /* @__PURE__ */ r(e, {
18
+ as: "path",
19
+ d: "M8 16H3v5"
20
+ }), o[0] = s, o[1] = c, o[2] = l, o[3] = u) : (s = o[0], c = o[1], l = o[2], u = o[3]);
21
+ let d;
22
+ return o[4] === a ? d = o[5] : (d = /* @__PURE__ */ i(t, {
23
+ ...a,
24
+ children: [
25
+ s,
26
+ c,
27
+ l,
28
+ u
29
+ ]
30
+ }), o[4] = a, o[5] = d), d;
31
+ }
32
+ //#endregion
33
+ export { a as RefreshIcon };
@@ -0,0 +1,11 @@
1
+ import type { JSX } from "react";
2
+ import type { IconProps } from "./Icon";
3
+ /**
4
+ * A minus sign, for removing something, such as an item from a list, or taking one away from a count. It is hidden from assistive technology unless it has a `label`, so inside a button, name the button instead.
5
+ *
6
+ * @example
7
+ * <IconButton label="Remove item" onClick={removeItem}>
8
+ * <RemoveIcon />
9
+ * </IconButton>
10
+ */
11
+ export declare function RemoveIcon(props: IconProps): JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import { Icon as t } from "./Icon.js";
3
+ import { c as n } from "react/compiler-runtime";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region src/components/Icon/RemoveIcon.tsx
6
+ function i(i) {
7
+ let a = n(3), o;
8
+ a[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ r(e, {
9
+ as: "path",
10
+ d: "M5 12h14"
11
+ }), a[0] = o) : o = a[0];
12
+ let s;
13
+ return a[1] === i ? s = a[2] : (s = /* @__PURE__ */ r(t, {
14
+ ...i,
15
+ children: o
16
+ }), a[1] = i, a[2] = s), s;
17
+ }
18
+ //#endregion
19
+ export { i as RemoveIcon };
@@ -0,0 +1,11 @@
1
+ import type { JSX } from "react";
2
+ import type { IconProps } from "./Icon";
3
+ /**
4
+ * A paper plane pointing along the line, for sending a message. It points the way the text runs, so it is mirrored in right-to-left text. It is hidden from assistive technology unless it has a `label`, so inside a button, name the button instead.
5
+ *
6
+ * @example
7
+ * <IconButton label="Send" type="submit">
8
+ * <SendIcon />
9
+ * </IconButton>
10
+ */
11
+ export declare function SendIcon(props: IconProps): JSX.Element;
@@ -0,0 +1,23 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import { Icon as t } from "./Icon.js";
3
+ import { c as n } from "react/compiler-runtime";
4
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
+ //#region src/components/Icon/SendIcon.tsx
6
+ function a(a) {
7
+ let o = n(4), s, c;
8
+ o[0] === Symbol.for("react.memo_cache_sentinel") ? (s = /* @__PURE__ */ r(e, {
9
+ as: "path",
10
+ d: "M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"
11
+ }), c = /* @__PURE__ */ r(e, {
12
+ as: "path",
13
+ d: "M6 12h16"
14
+ }), o[0] = s, o[1] = c) : (s = o[0], c = o[1]);
15
+ let l;
16
+ return o[2] === a ? l = o[3] : (l = /* @__PURE__ */ i(t, {
17
+ ...a,
18
+ mirrored: !0,
19
+ children: [s, c]
20
+ }), o[2] = a, o[3] = l), l;
21
+ }
22
+ //#endregion
23
+ export { a as SendIcon };
@@ -0,0 +1,13 @@
1
+ export { AddIcon } from "./AddIcon";
2
+ export { ChevronDownIcon } from "./ChevronDownIcon";
3
+ export { CloseIcon } from "./CloseIcon";
4
+ export { ColorModeIcon } from "./ColorModeIcon";
5
+ export { DeleteIcon } from "./DeleteIcon";
6
+ export type { IconProps } from "./Icon";
7
+ export { InfoIcon } from "./InfoIcon";
8
+ export { MoreHorizontalIcon } from "./MoreHorizontalIcon";
9
+ export { MoreVerticalIcon } from "./MoreVerticalIcon";
10
+ export { PaletteIcon } from "./PaletteIcon";
11
+ export { RefreshIcon } from "./RefreshIcon";
12
+ export { RemoveIcon } from "./RemoveIcon";
13
+ export { SendIcon } from "./SendIcon";
@@ -0,0 +1 @@
1
+ .sui-iconButton-JAF-a[data-size]{padding:var(--sui-button-padding-y)}.sui-icon-2DDWy{block-size:1.25em;inline-size:1.25em;display:inline-flex}.sui-icon-2DDWy>svg{block-size:100%;inline-size:100%}.sui-shortcut-LCwpq{margin-inline-start:var(--sui-space-2,.5rem)}
@@ -0,0 +1,45 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ import type { OverlayPlacement } from "../../overlays";
3
+ import type { ButtonProps } from "../Button";
4
+ /**
5
+ * Props for `IconButton`: its own props plus `Button`'s, except the name and children a label replaces
6
+ */
7
+ export interface IconButtonProps extends Omit<ButtonProps, "aria-label" | "aria-labelledby" | "children"> {
8
+ /**
9
+ * Not accepted: `label` names the button
10
+ */
11
+ "aria-label"?: never;
12
+ /**
13
+ * Not accepted: the tooltip names the button
14
+ */
15
+ "aria-labelledby"?: never;
16
+ /**
17
+ * The icon, hidden from assistive technology and sized to 1.25em
18
+ */
19
+ children: ReactNode;
20
+ /**
21
+ * What the button does. It is the tooltip's text and the button's accessible name.
22
+ */
23
+ label: string;
24
+ /**
25
+ * Side of the button the tooltip opens on. Defaults to `top`.
26
+ */
27
+ placement?: OverlayPlacement;
28
+ /**
29
+ * Keyboard shortcut shown after the label in the tooltip, such as "⌘R". It is not part of the name: add
30
+ * `aria-keyshortcuts` (for example `"Meta+R"`) so screen readers announce it.
31
+ */
32
+ shortcut?: string;
33
+ }
34
+ /**
35
+ * A square button showing only an icon, named by a tooltip that shows on hover and keyboard focus. Use a `Button` with
36
+ * text when the label fits. A native `disabled` button cannot take focus, so keyboard users never see its tooltip:
37
+ * prefer `aria-disabled` when they need it. With `aria-disabled` the button still calls `onClick`, so ignore presses
38
+ * there and show the state yourself.
39
+ *
40
+ * @example
41
+ * <IconButton busy={isSyncing} label="Refresh" onClick={refresh} shortcut="⌘R" aria-keyshortcuts="Meta+R">
42
+ * <RefreshIcon />
43
+ * </IconButton>
44
+ */
45
+ export declare function IconButton({ children, className, label, placement, shortcut, variant, ...rest }: IconButtonProps): JSX.Element;
@@ -0,0 +1,41 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import { Button as t } from "../Button/Button.js";
3
+ import { Kbd as n } from "../Kbd/Kbd.js";
4
+ import { Tooltip as r } from "../Tooltip/Tooltip.js";
5
+ import { useTooltip as i } from "../Tooltip/useTooltip.js";
6
+ import a from "./IconButton.module.js";
7
+ import { clsx as o } from "clsx";
8
+ import { useId as s } from "react";
9
+ import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
10
+ //#region src/components/IconButton/IconButton.tsx
11
+ function d({ children: d, className: f, label: p, placement: m = "top", shortcut: h, variant: g = "ghost", ..._ }) {
12
+ let v = i({
13
+ placement: m,
14
+ relationship: "label"
15
+ }), y = s(), b = h !== void 0 && h !== "";
16
+ return /* @__PURE__ */ u(c, { children: [/* @__PURE__ */ l(t, {
17
+ ...v.getTriggerProps(_),
18
+ className: o(a.iconButton, f),
19
+ variant: g,
20
+ "aria-labelledby": y,
21
+ children: /* @__PURE__ */ l(e, {
22
+ as: "span",
23
+ className: a.icon,
24
+ "aria-hidden": !0,
25
+ children: d
26
+ })
27
+ }), /* @__PURE__ */ u(r, {
28
+ ...v.getOverlayProps(),
29
+ children: [/* @__PURE__ */ l(e, {
30
+ as: "span",
31
+ id: y,
32
+ children: p
33
+ }), b && /* @__PURE__ */ l(n, {
34
+ className: a.shortcut,
35
+ "aria-hidden": !0,
36
+ children: h
37
+ })]
38
+ })] });
39
+ }
40
+ //#endregion
41
+ export { d as IconButton };
@@ -0,0 +1,8 @@
1
+ import './IconButton.css';//#region src/components/IconButton/IconButton.module.css
2
+ var e = "sui-iconButton-JAF-a", t = "sui-icon-2DDWy", n = "sui-shortcut-LCwpq", r = {
3
+ iconButton: e,
4
+ icon: t,
5
+ shortcut: n
6
+ };
7
+ //#endregion
8
+ export { r as default, t as icon, e as iconButton, n as shortcut };
@@ -0,0 +1,2 @@
1
+ export { IconButton } from "./IconButton";
2
+ export type { IconButtonProps } from "./IconButton";
@@ -0,0 +1 @@
1
+ .sui-kbd-jgbYx{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}
@@ -0,0 +1,13 @@
1
+ import type { JSX } from "react";
2
+ import type { BoxProps } from "../Box";
3
+ /**
4
+ * Props for `Kbd`: every native `kbd` prop
5
+ */
6
+ export type KbdProps = Omit<BoxProps<"kbd">, "as">;
7
+ /**
8
+ * A key on the keyboard, drawn as a small keycap. Write a combination as one `Kbd` per key.
9
+ *
10
+ * @example
11
+ * <Text as="p">Press <Kbd>⌘</Kbd> <Kbd>K</Kbd> to search.</Text>
12
+ */
13
+ export declare function Kbd({ className, ...rest }: KbdProps): JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import t from "./Kbd.module.js";
3
+ import { clsx as n } from "clsx";
4
+ import { c as r } from "react/compiler-runtime";
5
+ import { jsx as i } from "react/jsx-runtime";
6
+ //#region src/components/Kbd/Kbd.tsx
7
+ function a(a) {
8
+ let o = r(8), s, c;
9
+ o[0] === a ? (s = o[1], c = o[2]) : ({className: s, ...c} = a, o[0] = a, o[1] = s, o[2] = c);
10
+ let l;
11
+ o[3] === s ? l = o[4] : (l = n(t.kbd, s), o[3] = s, o[4] = l);
12
+ let u;
13
+ return o[5] !== c || o[6] !== l ? (u = /* @__PURE__ */ i(e, {
14
+ ...c,
15
+ as: "kbd",
16
+ className: l
17
+ }), o[5] = c, o[6] = l, o[7] = u) : u = o[7], u;
18
+ }
19
+ //#endregion
20
+ export { a as Kbd };
@@ -0,0 +1,4 @@
1
+ import './Kbd.css';//#region src/components/Kbd/Kbd.module.css
2
+ var e = "sui-kbd-jgbYx", t = { kbd: e };
3
+ //#endregion
4
+ export { t as default, e as kbd };
@@ -0,0 +1,2 @@
1
+ export { Kbd } from "./Kbd";
2
+ export type { KbdProps } from "./Kbd";
@@ -0,0 +1 @@
1
+ .sui-link-Ly-e3{box-sizing:border-box;color:var(--sui-link-color,var(--sui-color-primary,#2563eb));font:inherit;text-decoration-line:underline;text-decoration-thickness:var(--sui-border-width,1px);text-underline-offset:.2em}.sui-link-Ly-e3[data-tone=inherit]{color:inherit}.sui-link-Ly-e3[data-underline=always]:hover{text-decoration-thickness:calc(var(--sui-border-width,1px) * 2)}.sui-link-Ly-e3[data-underline=hover]{text-decoration-line:none}.sui-link-Ly-e3[data-underline=hover]:hover,.sui-link-Ly-e3[data-underline=hover]:focus-visible{text-decoration-line:underline}.sui-link-Ly-e3[aria-current]:not([aria-current=false]){font-weight:var(--sui-font-weight-bold,700)}.sui-link-Ly-e3:focus-visible{outline:var(--sui-focus-ring-width,2px) solid var(--sui-color-focus-ring,#3b82f6);outline-offset:2px}
@@ -0,0 +1,52 @@
1
+ import type { ComponentPropsWithRef, JSX, JSXElementConstructor } from "react";
2
+ /**
3
+ * What `Link` can render: an anchor, or a component that renders one, such as a router's link
4
+ */
5
+ export type LinkElement = "a" | JSXElementConstructor<never>;
6
+ /**
7
+ * Link colours: the theme's link colour, or `inherit` to take the surrounding text colour
8
+ */
9
+ export type LinkTone = "inherit" | "primary";
10
+ /**
11
+ * When a link's underline shows. `hover` also shows it on keyboard focus, and is for navigation:
12
+ * in running text a link needs its underline to be told apart from the text around it.
13
+ */
14
+ export type LinkUnderline = "always" | "hover";
15
+ interface LinkOwnProps {
16
+ /**
17
+ * Link colour. Defaults to `primary`.
18
+ */
19
+ tone?: LinkTone;
20
+ /**
21
+ * When the underline shows. Defaults to `always`.
22
+ */
23
+ underline?: LinkUnderline;
24
+ }
25
+ interface LinkElementOwnProps<E extends LinkElement> {
26
+ /**
27
+ * What to render: `a`, or a component that renders an anchor. Defaults to `a`.
28
+ */
29
+ as?: E;
30
+ /**
31
+ * Class names merged with the component's base class.
32
+ */
33
+ className?: string;
34
+ }
35
+ type LinkElementProps<E extends LinkElement> = E extends JSXElementConstructor<infer Props> ? Props : ComponentPropsWithRef<"a">;
36
+ type OmitFromEach<Props, Name extends PropertyKey> = Props extends unknown ? Omit<Props, Name> : never;
37
+ /**
38
+ * Props for `Link`: its own props plus every prop of the anchor or component given in `as`
39
+ */
40
+ export type LinkProps<E extends LinkElement = "a"> = LinkOwnProps & LinkElementOwnProps<E> & OmitFromEach<LinkElementProps<E>, keyof LinkOwnProps | keyof LinkElementOwnProps<E>>;
41
+ /**
42
+ * Themed link. Renders an anchor, or the component given in `as`, such as a router's link. That
43
+ * component must pass `className` and the `data-*` attributes it is given on to its anchor.
44
+ *
45
+ * @example
46
+ * <Link href="/docs">Documentation</Link>
47
+ *
48
+ * @example
49
+ * <Link as={RouterLink} to="/settings" underline="hover">Settings</Link>
50
+ */
51
+ export declare function Link<E extends LinkElement = "a">({ as, className, tone, underline, ...rest }: LinkProps<E>): JSX.Element;
52
+ export {};
@@ -0,0 +1,27 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import t from "./Link.module.js";
3
+ import { clsx as n } from "clsx";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ //#region src/components/Link/Link.tsx
6
+ function i({ as: i, className: a, tone: o = "primary", underline: s = "always", ...c }) {
7
+ let l = {
8
+ className: n(t.link, a),
9
+ "data-tone": o,
10
+ "data-underline": s
11
+ };
12
+ if (i === void 0 || i === "a") {
13
+ let { children: t, ...n } = c;
14
+ return /* @__PURE__ */ r(e, {
15
+ ...n,
16
+ ...l,
17
+ as: "a",
18
+ children: t
19
+ });
20
+ }
21
+ return /* @__PURE__ */ r(i, {
22
+ ...c,
23
+ ...l
24
+ });
25
+ }
26
+ //#endregion
27
+ export { i as Link };
@@ -0,0 +1,4 @@
1
+ import './Link.css';//#region src/components/Link/Link.module.css
2
+ var e = "sui-link-Ly-e3", t = { link: e };
3
+ //#endregion
4
+ export { t as default, e as link };
@@ -0,0 +1,2 @@
1
+ export { Link } from "./Link";
2
+ export type { LinkElement, LinkProps, LinkTone, LinkUnderline } from "./Link";
@@ -0,0 +1 @@
1
+ .sui-listbox-lSHQo{padding:calc(var(--sui-focus-ring-width,2px) + 2px);border-radius:var(--sui-radius-md,4px);font-family:var(--sui-font-body,system-ui, sans-serif);flex-direction:column;gap:2px;display:flex}.sui-listbox-lSHQo:focus-visible{outline:var(--sui-focus-ring-width,2px) solid var(--sui-color-focus-ring,#3b82f6);outline-offset:calc(var(--sui-focus-ring-width,2px) * -1)}.sui-option-sCJLx{padding:var(--sui-space-2,.5rem);border-radius:var(--sui-radius-md,4px);color:var(--sui-color-text,#111827);cursor:default;scroll-margin-block:calc(var(--sui-focus-ring-width,2px) + 2px);-webkit-user-select:none;user-select:none;padding-inline-start:calc(var(--sui-space-2,.5rem) + var(--sui-border-width,1px) * 2);transition:background-color .12s,color .12s;position:relative}.sui-option-sCJLx:before{inset-block:var(--sui-space-1,.25rem);inline-size:calc(var(--sui-border-width,1px) * 2);border-radius:var(--sui-radius-full,9999px);content:"";background-color:#0000;position:absolute;inset-inline-start:0}.sui-option-sCJLx:hover:not([aria-selected=true],[aria-disabled=true]){background-color:var(--sui-color-secondary-subtle,#f3f4f6)}.sui-option-sCJLx[aria-selected=true]{--sui-color-text-muted:currentColor;--sui-status-dot-color:currentColor;background-color:var(--sui-listbox-inactive-selection,var(--sui-color-primary-subtle,#edf5ff));color:var(--sui-listbox-on-inactive-selection,var(--sui-color-primary,#2563eb))}.sui-option-sCJLx[aria-selected=true]:before{background-color:var(--sui-listbox-inactive-selection-bar,var(--sui-color-primary,#2563eb))}.sui-listbox-lSHQo:focus .sui-option-sCJLx[aria-selected=true]{background-color:var(--sui-listbox-selection,var(--sui-color-primary,#2563eb));color:var(--sui-listbox-on-selection,var(--sui-color-on-primary,#fff))}.sui-listbox-lSHQo:focus-visible .sui-option-sCJLx[data-active]:not([aria-selected=true]){outline:var(--sui-focus-ring-width,2px) solid var(--sui-color-focus-ring,#3b82f6);outline-offset:calc(var(--sui-focus-ring-width,2px) * -1)}.sui-option-sCJLx[aria-disabled=true]{cursor:not-allowed}.sui-option-sCJLx[aria-disabled=true]:not([aria-selected=true]){color:color-mix(in srgb, var(--sui-color-text,#111827) 50%, transparent)}:where(.sui-option-sCJLx[aria-disabled=true]:not([aria-selected=true]))>*{color:var(--sui-color-text,#111827);opacity:.5}@media (forced-colors:active){.sui-option-sCJLx[aria-selected=true],.sui-listbox-lSHQo:focus .sui-option-sCJLx[aria-selected=true]{color:highlighttext;forced-color-adjust:none;background-color:highlight}.sui-option-sCJLx[aria-selected=true]:before{background-color:highlight}.sui-option-sCJLx[aria-disabled=true]:not([aria-selected=true]),.sui-option-sCJLx[aria-disabled=true]:not([aria-selected=true]) *{color:graytext}:where(.sui-option-sCJLx[aria-disabled=true]:not([aria-selected=true]))>*{opacity:1}}
@@ -0,0 +1,46 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ import type { RequiredAccessibleName } from "../../accessibility";
3
+ import type { BoxProps } from "../Box";
4
+ interface ListboxOwnProps {
5
+ /**
6
+ * The `ListboxOption`s
7
+ */
8
+ children?: ReactNode;
9
+ /**
10
+ * The option selected at first, which leaves the listbox uncontrolled. Defaults to none.
11
+ */
12
+ defaultValue?: string | null;
13
+ /**
14
+ * Called with an option's value when Enter or a double-click acts on it, such as to open it
15
+ */
16
+ onAction?: (value: string) => void;
17
+ /**
18
+ * Called with the value of the option the user selects
19
+ */
20
+ onValueChange?: (value: string) => void;
21
+ /**
22
+ * The selected option, or null for none, which makes the listbox controlled: update it from `onValueChange`
23
+ */
24
+ value?: string | null;
25
+ }
26
+ /**
27
+ * Props for `Listbox`: its own props, a required `aria-label` or `aria-labelledby`, and every other `div` prop except
28
+ * those the listbox pattern sets
29
+ */
30
+ export type ListboxProps = ListboxOwnProps & RequiredAccessibleName & Omit<BoxProps<"div">, "aria-activedescendant" | "aria-label" | "aria-labelledby" | "as" | "defaultValue" | "role" | "tabIndex" | keyof ListboxOwnProps>;
31
+ /**
32
+ * A list of options with one selected, following the WAI-ARIA listbox pattern, for a list whose selection shows
33
+ * details. It is one tab stop. The arrow keys, Home, End and type-ahead move the selection; Space selects the active
34
+ * option, or joins type-ahead text typed within the last 500ms; Enter or a double-click calls `onAction`. Name it with
35
+ * `aria-label` or `aria-labelledby`. Options hold no interactive content. Your `onKeyDown` runs first; preventing its
36
+ * default stops the listbox handling the key.
37
+ *
38
+ * @example
39
+ * <Listbox aria-label="Needs you" onAction={open} onValueChange={select} value={selectedId}>
40
+ * {pullRequests.map((pullRequest) => (
41
+ * <ListboxOption key={pullRequest.id} value={pullRequest.id}>{pullRequest.title}</ListboxOption>
42
+ * ))}
43
+ * </Listbox>
44
+ */
45
+ export declare function Listbox({ className, defaultValue, onAction, onBlur, onFocus, onKeyDown, onPointerCancel, onPointerDown, onValueChange, value, ...rest }: ListboxProps): JSX.Element;
46
+ export {};
@@ -0,0 +1,56 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import t from "./Listbox.module.js";
3
+ import { ListboxContext as n } from "./ListboxContext.js";
4
+ import { optionId as r } from "./optionId.js";
5
+ import { useListbox as i } from "./useListbox.js";
6
+ import { clsx as a } from "clsx";
7
+ import { jsx as o } from "react/jsx-runtime";
8
+ //#region src/components/Listbox/Listbox.tsx
9
+ function s({ className: s, defaultValue: c = null, onAction: l, onBlur: u, onFocus: d, onKeyDown: f, onPointerCancel: p, onPointerDown: m, onValueChange: h, value: g, ..._ }) {
10
+ let v = i({
11
+ defaultValue: c,
12
+ onAction: l,
13
+ onValueChange: h,
14
+ value: g
15
+ }), { act: y, activeValue: b, baseId: x, choose: S, claim: C, selectedValue: w, setActiveValue: T } = v;
16
+ function E(e) {
17
+ u?.(e), v.handleBlur();
18
+ }
19
+ function D(e) {
20
+ d?.(e), v.handleFocus(e);
21
+ }
22
+ function O(e) {
23
+ f?.(e), e.defaultPrevented || v.handleKeyDown(e);
24
+ }
25
+ function k(e) {
26
+ p?.(e), v.handlePointerCancel();
27
+ }
28
+ function A(e) {
29
+ m?.(e), v.handlePointerDown();
30
+ }
31
+ return /* @__PURE__ */ o(n.Provider, {
32
+ value: {
33
+ act: y,
34
+ activeValue: b,
35
+ baseId: x,
36
+ choose: S,
37
+ claim: C,
38
+ selectedValue: w,
39
+ setActiveValue: T
40
+ },
41
+ children: /* @__PURE__ */ o(e, {
42
+ ..._,
43
+ className: a(t.listbox, s),
44
+ onBlur: E,
45
+ onFocus: D,
46
+ onKeyDown: O,
47
+ onPointerCancel: k,
48
+ onPointerDown: A,
49
+ role: "listbox",
50
+ tabIndex: 0,
51
+ "aria-activedescendant": b === null ? void 0 : r(x, b)
52
+ })
53
+ });
54
+ }
55
+ //#endregion
56
+ export { s as Listbox };
@@ -0,0 +1,7 @@
1
+ import './Listbox.css';//#region src/components/Listbox/Listbox.module.css
2
+ var e = "sui-listbox-lSHQo", t = "sui-option-sCJLx", n = {
3
+ listbox: e,
4
+ option: t
5
+ };
6
+ //#endregion
7
+ export { n as default, e as listbox, t as option };
@@ -0,0 +1,38 @@
1
+ import type { Dispatch, SetStateAction } from "react";
2
+ /**
3
+ * State a `Listbox` shares with its options
4
+ */
5
+ export interface ListboxContextValue {
6
+ /**
7
+ * Acts on an option, as Enter does
8
+ */
9
+ act: (value: string) => void;
10
+ /**
11
+ * The value of the option keyboard focus is on, or null for none
12
+ */
13
+ activeValue: string | null;
14
+ /**
15
+ * The generated id every option id starts with
16
+ */
17
+ baseId: string;
18
+ /**
19
+ * Handles a click on an option: focuses the listbox, makes the option active and selects it unless it is disabled
20
+ */
21
+ choose: (option: HTMLElement, value: string, disabled: boolean) => void;
22
+ /**
23
+ * Makes the option with this value active while the listbox has focus, as a newly selected option does
24
+ */
25
+ claim: (value: string) => void;
26
+ /**
27
+ * The selected option's value, or null for none
28
+ */
29
+ selectedValue: string | null;
30
+ /**
31
+ * Sets the value of the option keyboard focus is on, or null for none
32
+ */
33
+ setActiveValue: Dispatch<SetStateAction<string | null>>;
34
+ }
35
+ /**
36
+ * Carries a `Listbox`'s state to its options; null outside a `Listbox`
37
+ */
38
+ export declare const ListboxContext: import("react").Context<ListboxContextValue | null>;
@@ -0,0 +1,5 @@
1
+ import { createContext as e } from "react";
2
+ //#region src/components/Listbox/ListboxContext.ts
3
+ var t = e(null);
4
+ //#endregion
5
+ export { t as ListboxContext };
@@ -0,0 +1,31 @@
1
+ import type { JSX } from "react";
2
+ import type { BoxProps } from "../Box";
3
+ /**
4
+ * Props for `ListboxOption`: its own props plus every `div` prop except those the listbox pattern sets
5
+ */
6
+ export interface ListboxOptionProps extends Omit<BoxProps<"div">, "aria-disabled" | "aria-selected" | "as" | "id" | "role" | "tabIndex"> {
7
+ /**
8
+ * Whether the option cannot be selected. A disabled option is still reached with the arrow keys, so it is read.
9
+ * Defaults to `false`.
10
+ */
11
+ disabled?: boolean;
12
+ /**
13
+ * The text type-ahead matches. Defaults to the text of the elements the option's `aria-labelledby` names, or to the
14
+ * option's own text when it has none.
15
+ */
16
+ textValue?: string;
17
+ /**
18
+ * The value this option stands for
19
+ */
20
+ value: string;
21
+ }
22
+ /**
23
+ * One option in a `Listbox`. For a rich option, name it with `aria-labelledby` pointing at its title and describe it
24
+ * with `aria-describedby`. Your `onClick` and `onDoubleClick` run first; preventing their default stops the option
25
+ * handling them. To leave an option out, do not render it or give it `hidden`: an option hidden only by CSS can still
26
+ * be reached with the keyboard.
27
+ *
28
+ * @example
29
+ * <ListboxOption aria-describedby={metaId} aria-labelledby={titleId} value={pullRequest.id}>…</ListboxOption>
30
+ */
31
+ export declare function ListboxOption({ className, disabled, onClick, onDoubleClick, textValue, value, ...rest }: ListboxOptionProps): JSX.Element;
@@ -0,0 +1,43 @@
1
+ import { Box as e } from "../Box/Box.js";
2
+ import t from "./Listbox.module.js";
3
+ import { optionId as n } from "./optionId.js";
4
+ import { useListboxContext as r } from "./useListboxContext.js";
5
+ import { clsx as i } from "clsx";
6
+ import { useEffectEvent as a, useLayoutEffect as o } from "react";
7
+ import { jsx as s } from "react/jsx-runtime";
8
+ //#region src/components/Listbox/ListboxOption.tsx
9
+ function c({ className: c, disabled: l = !1, onClick: u, onDoubleClick: d, textValue: f, value: p, ...m }) {
10
+ let h = r("ListboxOption"), { setActiveValue: g } = h, _ = h.activeValue === p, v = h.selectedValue === p, y = a(h.claim);
11
+ o(() => {
12
+ if (_) return () => {
13
+ g((e) => e === p ? null : e);
14
+ };
15
+ }, [
16
+ _,
17
+ g,
18
+ p
19
+ ]), o(() => {
20
+ v && y(p);
21
+ }, [v, p]);
22
+ function b(e) {
23
+ u?.(e), e.defaultPrevented || h.choose(e.currentTarget, p, l);
24
+ }
25
+ function x(e) {
26
+ d?.(e), !e.defaultPrevented && !l && h.act(p);
27
+ }
28
+ return /* @__PURE__ */ s(e, {
29
+ ...m,
30
+ className: i(t.option, c),
31
+ id: n(h.baseId, p),
32
+ onClick: b,
33
+ onDoubleClick: x,
34
+ role: "option",
35
+ "aria-disabled": l ? !0 : void 0,
36
+ "aria-selected": v,
37
+ "data-active": _ ? "" : void 0,
38
+ "data-text-value": f,
39
+ "data-value": p
40
+ });
41
+ }
42
+ //#endregion
43
+ export { c as ListboxOption };
@@ -0,0 +1,4 @@
1
+ export { Listbox } from "./Listbox";
2
+ export type { ListboxProps } from "./Listbox";
3
+ export { ListboxOption } from "./ListboxOption";
4
+ export type { ListboxOptionProps } from "./ListboxOption";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Builds the id of the option for a value
3
+ *
4
+ * @param baseId the `Listbox`'s generated id
5
+ * @param value the option's value
6
+ * @returns an id unique to the value within its `Listbox`, whatever characters the value holds
7
+ */
8
+ export declare function optionId(baseId: string, value: string): string;
@@ -0,0 +1,7 @@
1
+ import { idSegment as e } from "../../accessibility/idSegment.js";
2
+ //#region src/components/Listbox/optionId.ts
3
+ function t(t, n) {
4
+ return `${t}-option-${e(n)}`;
5
+ }
6
+ //#endregion
7
+ export { t as optionId };