@eylulg/ui 0.0.0-stage → 1.1.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 (367) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +328 -2
  3. package/dist/chrome/Anchor.d.ts +3 -0
  4. package/dist/chrome/Anchor.js +14 -0
  5. package/dist/chrome/Anchor.js.map +1 -0
  6. package/dist/chrome/AppShell.d.ts +28 -0
  7. package/dist/chrome/AppShell.js +57 -0
  8. package/dist/chrome/AppShell.js.map +1 -0
  9. package/dist/chrome/BrandLogo.d.ts +13 -0
  10. package/dist/chrome/BrandLogo.js +33 -0
  11. package/dist/chrome/BrandLogo.js.map +1 -0
  12. package/dist/chrome/BrandMark.d.ts +12 -0
  13. package/dist/chrome/BrandMark.js +40 -0
  14. package/dist/chrome/BrandMark.js.map +1 -0
  15. package/dist/chrome/LinkRouter.d.ts +19 -0
  16. package/dist/chrome/LinkRouter.js +28 -0
  17. package/dist/chrome/LinkRouter.js.map +1 -0
  18. package/dist/chrome/MobileMenu.d.ts +19 -0
  19. package/dist/chrome/MobileMenu.js +52 -0
  20. package/dist/chrome/MobileMenu.js.map +1 -0
  21. package/dist/chrome/ProjectSwitcher.d.ts +30 -0
  22. package/dist/chrome/ProjectSwitcher.js +64 -0
  23. package/dist/chrome/ProjectSwitcher.js.map +1 -0
  24. package/dist/chrome/ProjectSwitcherMenu.d.ts +13 -0
  25. package/dist/chrome/ProjectSwitcherMenu.js +50 -0
  26. package/dist/chrome/ProjectSwitcherMenu.js.map +1 -0
  27. package/dist/chrome/SidebarNav.d.ts +34 -0
  28. package/dist/chrome/SidebarNav.js +106 -0
  29. package/dist/chrome/SidebarNav.js.map +1 -0
  30. package/dist/chrome/SiteFooter.d.ts +37 -0
  31. package/dist/chrome/SiteFooter.js +105 -0
  32. package/dist/chrome/SiteFooter.js.map +1 -0
  33. package/dist/chrome/TextSizeToggle.d.ts +11 -0
  34. package/dist/chrome/TextSizeToggle.js +38 -0
  35. package/dist/chrome/TextSizeToggle.js.map +1 -0
  36. package/dist/chrome/ThemeToggle.d.ts +26 -0
  37. package/dist/chrome/ThemeToggle.js +100 -0
  38. package/dist/chrome/ThemeToggle.js.map +1 -0
  39. package/dist/chrome/ThemeToggleMenu.d.ts +16 -0
  40. package/dist/chrome/ThemeToggleMenu.js +42 -0
  41. package/dist/chrome/ThemeToggleMenu.js.map +1 -0
  42. package/dist/chrome/TopNav.d.ts +42 -0
  43. package/dist/chrome/TopNav.js +117 -0
  44. package/dist/chrome/TopNav.js.map +1 -0
  45. package/dist/chrome/brandLogoPath.d.ts +2 -0
  46. package/dist/chrome/brandLogoPath.js +7 -0
  47. package/dist/chrome/brandLogoPath.js.map +1 -0
  48. package/dist/chrome/index.d.ts +28 -0
  49. package/dist/chrome/index.js +15 -0
  50. package/dist/chrome/projects.d.ts +28 -0
  51. package/dist/chrome/projects.js +105 -0
  52. package/dist/chrome/projects.js.map +1 -0
  53. package/dist/chrome/themeChoices.d.ts +6 -0
  54. package/dist/chrome/themeChoices.js +18 -0
  55. package/dist/chrome/themeChoices.js.map +1 -0
  56. package/dist/chrome/themeScript.d.ts +16 -0
  57. package/dist/chrome/themeScript.js +20 -0
  58. package/dist/chrome/themeScript.js.map +1 -0
  59. package/dist/chrome/types.d.ts +17 -0
  60. package/dist/chrome/useTextSize.d.ts +16 -0
  61. package/dist/chrome/useTextSize.js +64 -0
  62. package/dist/chrome/useTextSize.js.map +1 -0
  63. package/dist/chrome/useTheme.d.ts +19 -0
  64. package/dist/chrome/useTheme.js +86 -0
  65. package/dist/chrome/useTheme.js.map +1 -0
  66. package/dist/components/Avatar/Avatar.d.ts +39 -0
  67. package/dist/components/Avatar/Avatar.js +122 -0
  68. package/dist/components/Avatar/Avatar.js.map +1 -0
  69. package/dist/components/Avatar/index.d.ts +2 -0
  70. package/dist/components/Avatar/index.js +2 -0
  71. package/dist/components/Badge/Badge.d.ts +19 -0
  72. package/dist/components/Badge/Badge.js +77 -0
  73. package/dist/components/Badge/Badge.js.map +1 -0
  74. package/dist/components/Badge/index.d.ts +2 -0
  75. package/dist/components/Badge/index.js +2 -0
  76. package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +18 -0
  77. package/dist/components/Breadcrumbs/Breadcrumbs.js +40 -0
  78. package/dist/components/Breadcrumbs/Breadcrumbs.js.map +1 -0
  79. package/dist/components/Breadcrumbs/index.d.ts +2 -0
  80. package/dist/components/Breadcrumbs/index.js +2 -0
  81. package/dist/components/Button/Button.d.ts +39 -0
  82. package/dist/components/Button/Button.js +73 -0
  83. package/dist/components/Button/Button.js.map +1 -0
  84. package/dist/components/Button/buttonStyles.d.ts +21 -0
  85. package/dist/components/Button/buttonStyles.js +32 -0
  86. package/dist/components/Button/buttonStyles.js.map +1 -0
  87. package/dist/components/Button/index.d.ts +2 -0
  88. package/dist/components/Button/index.js +4 -0
  89. package/dist/components/Card/Card.d.ts +47 -0
  90. package/dist/components/Card/Card.js +119 -0
  91. package/dist/components/Card/Card.js.map +1 -0
  92. package/dist/components/Card/index.d.ts +2 -0
  93. package/dist/components/Card/index.js +2 -0
  94. package/dist/components/Chart/BarChart.d.ts +24 -0
  95. package/dist/components/Chart/BarChart.js +327 -0
  96. package/dist/components/Chart/BarChart.js.map +1 -0
  97. package/dist/components/Chart/ChartFrame.d.ts +27 -0
  98. package/dist/components/Chart/ChartFrame.js +80 -0
  99. package/dist/components/Chart/ChartFrame.js.map +1 -0
  100. package/dist/components/Chart/ChartLegend.d.ts +28 -0
  101. package/dist/components/Chart/ChartLegend.js +53 -0
  102. package/dist/components/Chart/ChartLegend.js.map +1 -0
  103. package/dist/components/Chart/ChartTable.d.ts +11 -0
  104. package/dist/components/Chart/ChartTable.js +48 -0
  105. package/dist/components/Chart/ChartTable.js.map +1 -0
  106. package/dist/components/Chart/ChartTooltip.d.ts +33 -0
  107. package/dist/components/Chart/ChartTooltip.js +56 -0
  108. package/dist/components/Chart/ChartTooltip.js.map +1 -0
  109. package/dist/components/Chart/HeatGrid.d.ts +50 -0
  110. package/dist/components/Chart/HeatGrid.js +256 -0
  111. package/dist/components/Chart/HeatGrid.js.map +1 -0
  112. package/dist/components/Chart/LineChart.d.ts +23 -0
  113. package/dist/components/Chart/LineChart.js +248 -0
  114. package/dist/components/Chart/LineChart.js.map +1 -0
  115. package/dist/components/Chart/format.d.ts +24 -0
  116. package/dist/components/Chart/format.js +134 -0
  117. package/dist/components/Chart/format.js.map +1 -0
  118. package/dist/components/Chart/geometry.d.ts +11 -0
  119. package/dist/components/Chart/geometry.js +69 -0
  120. package/dist/components/Chart/geometry.js.map +1 -0
  121. package/dist/components/Chart/index.d.ts +9 -0
  122. package/dist/components/Chart/index.js +6 -0
  123. package/dist/components/Chart/interaction.d.ts +43 -0
  124. package/dist/components/Chart/interaction.js +106 -0
  125. package/dist/components/Chart/interaction.js.map +1 -0
  126. package/dist/components/Chart/labels.d.ts +3 -0
  127. package/dist/components/Chart/labels.js +23 -0
  128. package/dist/components/Chart/labels.js.map +1 -0
  129. package/dist/components/Chart/scale.d.ts +15 -0
  130. package/dist/components/Chart/scale.js +54 -0
  131. package/dist/components/Chart/scale.js.map +1 -0
  132. package/dist/components/Chart/series.d.ts +14 -0
  133. package/dist/components/Chart/series.js +72 -0
  134. package/dist/components/Chart/series.js.map +1 -0
  135. package/dist/components/Chart/summary.d.ts +8 -0
  136. package/dist/components/Chart/summary.js +56 -0
  137. package/dist/components/Chart/summary.js.map +1 -0
  138. package/dist/components/Chart/types.d.ts +50 -0
  139. package/dist/components/Chart/useElementWidth.d.ts +6 -0
  140. package/dist/components/Chart/useElementWidth.js +25 -0
  141. package/dist/components/Chart/useElementWidth.js.map +1 -0
  142. package/dist/components/Checkbox/Checkbox.d.ts +9 -0
  143. package/dist/components/Checkbox/Checkbox.js +36 -0
  144. package/dist/components/Checkbox/Checkbox.js.map +1 -0
  145. package/dist/components/Checkbox/index.d.ts +2 -0
  146. package/dist/components/Checkbox/index.js +2 -0
  147. package/dist/components/CodeBlock/CodeBlock.d.ts +22 -0
  148. package/dist/components/CodeBlock/CodeBlock.js +56 -0
  149. package/dist/components/CodeBlock/CodeBlock.js.map +1 -0
  150. package/dist/components/CodeBlock/index.d.ts +2 -0
  151. package/dist/components/CodeBlock/index.js +2 -0
  152. package/dist/components/Combobox/Combobox.d.ts +34 -0
  153. package/dist/components/Combobox/Combobox.js +106 -0
  154. package/dist/components/Combobox/Combobox.js.map +1 -0
  155. package/dist/components/Combobox/index.d.ts +2 -0
  156. package/dist/components/Combobox/index.js +2 -0
  157. package/dist/components/CommandPalette/CommandPalette.d.ts +74 -0
  158. package/dist/components/CommandPalette/CommandPalette.js +51 -0
  159. package/dist/components/CommandPalette/CommandPalette.js.map +1 -0
  160. package/dist/components/CommandPalette/CommandPaletteOverlay.d.ts +11 -0
  161. package/dist/components/CommandPalette/CommandPaletteOverlay.js +180 -0
  162. package/dist/components/CommandPalette/CommandPaletteOverlay.js.map +1 -0
  163. package/dist/components/CommandPalette/index.d.ts +2 -0
  164. package/dist/components/CommandPalette/index.js +2 -0
  165. package/dist/components/DatePicker/DatePicker.d.ts +25 -0
  166. package/dist/components/DatePicker/DatePicker.js +142 -0
  167. package/dist/components/DatePicker/DatePicker.js.map +1 -0
  168. package/dist/components/DatePicker/index.d.ts +2 -0
  169. package/dist/components/DatePicker/index.js +2 -0
  170. package/dist/components/Dialog/Dialog.d.ts +37 -0
  171. package/dist/components/Dialog/Dialog.js +33 -0
  172. package/dist/components/Dialog/Dialog.js.map +1 -0
  173. package/dist/components/Dialog/DialogOverlay.d.ts +3 -0
  174. package/dist/components/Dialog/DialogOverlay.js +72 -0
  175. package/dist/components/Dialog/DialogOverlay.js.map +1 -0
  176. package/dist/components/Dialog/index.d.ts +2 -0
  177. package/dist/components/Dialog/index.js +2 -0
  178. package/dist/components/Drawer/Drawer.d.ts +36 -0
  179. package/dist/components/Drawer/Drawer.js +33 -0
  180. package/dist/components/Drawer/Drawer.js.map +1 -0
  181. package/dist/components/Drawer/DrawerOverlay.d.ts +3 -0
  182. package/dist/components/Drawer/DrawerOverlay.js +71 -0
  183. package/dist/components/Drawer/DrawerOverlay.js.map +1 -0
  184. package/dist/components/Drawer/index.d.ts +2 -0
  185. package/dist/components/Drawer/index.js +2 -0
  186. package/dist/components/DropdownMenu/DropdownMenu.d.ts +49 -0
  187. package/dist/components/DropdownMenu/DropdownMenu.js +52 -0
  188. package/dist/components/DropdownMenu/DropdownMenu.js.map +1 -0
  189. package/dist/components/DropdownMenu/DropdownMenuParts.d.ts +6 -0
  190. package/dist/components/DropdownMenu/DropdownMenuParts.js +76 -0
  191. package/dist/components/DropdownMenu/DropdownMenuParts.js.map +1 -0
  192. package/dist/components/DropdownMenu/index.d.ts +2 -0
  193. package/dist/components/DropdownMenu/index.js +2 -0
  194. package/dist/components/EmptyState/EmptyState.d.ts +19 -0
  195. package/dist/components/EmptyState/EmptyState.js +51 -0
  196. package/dist/components/EmptyState/EmptyState.js.map +1 -0
  197. package/dist/components/EmptyState/index.d.ts +2 -0
  198. package/dist/components/EmptyState/index.js +2 -0
  199. package/dist/components/FileDropZone/FileDropZone.d.ts +41 -0
  200. package/dist/components/FileDropZone/FileDropZone.js +94 -0
  201. package/dist/components/FileDropZone/FileDropZone.js.map +1 -0
  202. package/dist/components/FileDropZone/index.d.ts +2 -0
  203. package/dist/components/FileDropZone/index.js +2 -0
  204. package/dist/components/IconButton/IconButton.d.ts +17 -0
  205. package/dist/components/IconButton/IconButton.js +37 -0
  206. package/dist/components/IconButton/IconButton.js.map +1 -0
  207. package/dist/components/IconButton/index.d.ts +2 -0
  208. package/dist/components/IconButton/index.js +2 -0
  209. package/dist/components/Input/Input.d.ts +21 -0
  210. package/dist/components/Input/Input.js +43 -0
  211. package/dist/components/Input/Input.js.map +1 -0
  212. package/dist/components/Input/index.d.ts +2 -0
  213. package/dist/components/Input/index.js +2 -0
  214. package/dist/components/Kbd/Kbd.d.ts +16 -0
  215. package/dist/components/Kbd/Kbd.js +35 -0
  216. package/dist/components/Kbd/Kbd.js.map +1 -0
  217. package/dist/components/Kbd/index.d.ts +2 -0
  218. package/dist/components/Kbd/index.js +2 -0
  219. package/dist/components/PageHeader/PageHeader.d.ts +18 -0
  220. package/dist/components/PageHeader/PageHeader.js +45 -0
  221. package/dist/components/PageHeader/PageHeader.js.map +1 -0
  222. package/dist/components/PageHeader/index.d.ts +2 -0
  223. package/dist/components/PageHeader/index.js +2 -0
  224. package/dist/components/Pagination/Pagination.d.ts +32 -0
  225. package/dist/components/Pagination/Pagination.js +124 -0
  226. package/dist/components/Pagination/Pagination.js.map +1 -0
  227. package/dist/components/Pagination/index.d.ts +2 -0
  228. package/dist/components/Pagination/index.js +2 -0
  229. package/dist/components/Popover/Popover.d.ts +27 -0
  230. package/dist/components/Popover/Popover.js +33 -0
  231. package/dist/components/Popover/Popover.js.map +1 -0
  232. package/dist/components/Popover/PopoverOverlay.d.ts +3 -0
  233. package/dist/components/Popover/PopoverOverlay.js +39 -0
  234. package/dist/components/Popover/PopoverOverlay.js.map +1 -0
  235. package/dist/components/Popover/index.d.ts +2 -0
  236. package/dist/components/Popover/index.js +2 -0
  237. package/dist/components/ProgressBar/ProgressBar.d.ts +19 -0
  238. package/dist/components/ProgressBar/ProgressBar.js +52 -0
  239. package/dist/components/ProgressBar/ProgressBar.js.map +1 -0
  240. package/dist/components/ProgressBar/index.d.ts +2 -0
  241. package/dist/components/ProgressBar/index.js +2 -0
  242. package/dist/components/RadioGroup/RadioGroup.d.ts +14 -0
  243. package/dist/components/RadioGroup/RadioGroup.js +46 -0
  244. package/dist/components/RadioGroup/RadioGroup.js.map +1 -0
  245. package/dist/components/RadioGroup/index.d.ts +2 -0
  246. package/dist/components/RadioGroup/index.js +2 -0
  247. package/dist/components/SegmentedControl/SegmentedControl.d.ts +32 -0
  248. package/dist/components/SegmentedControl/SegmentedControl.js +55 -0
  249. package/dist/components/SegmentedControl/SegmentedControl.js.map +1 -0
  250. package/dist/components/SegmentedControl/index.d.ts +2 -0
  251. package/dist/components/SegmentedControl/index.js +2 -0
  252. package/dist/components/Select/Select.d.ts +28 -0
  253. package/dist/components/Select/Select.js +64 -0
  254. package/dist/components/Select/Select.js.map +1 -0
  255. package/dist/components/Select/index.d.ts +2 -0
  256. package/dist/components/Select/index.js +2 -0
  257. package/dist/components/Skeleton/Skeleton.d.ts +13 -0
  258. package/dist/components/Skeleton/Skeleton.js +33 -0
  259. package/dist/components/Skeleton/Skeleton.js.map +1 -0
  260. package/dist/components/Skeleton/index.d.ts +2 -0
  261. package/dist/components/Skeleton/index.js +2 -0
  262. package/dist/components/Spinner/Spinner.d.ts +12 -0
  263. package/dist/components/Spinner/Spinner.js +29 -0
  264. package/dist/components/Spinner/Spinner.js.map +1 -0
  265. package/dist/components/Spinner/index.d.ts +2 -0
  266. package/dist/components/Spinner/index.js +2 -0
  267. package/dist/components/Stat/Stat.d.ts +49 -0
  268. package/dist/components/Stat/Stat.js +125 -0
  269. package/dist/components/Stat/Stat.js.map +1 -0
  270. package/dist/components/Stat/index.d.ts +2 -0
  271. package/dist/components/Stat/index.js +2 -0
  272. package/dist/components/Switch/Switch.d.ts +11 -0
  273. package/dist/components/Switch/Switch.js +39 -0
  274. package/dist/components/Switch/Switch.js.map +1 -0
  275. package/dist/components/Switch/index.d.ts +2 -0
  276. package/dist/components/Switch/index.js +2 -0
  277. package/dist/components/Table/Table.d.ts +41 -0
  278. package/dist/components/Table/Table.js +121 -0
  279. package/dist/components/Table/Table.js.map +1 -0
  280. package/dist/components/Table/index.d.ts +2 -0
  281. package/dist/components/Table/index.js +2 -0
  282. package/dist/components/Tabs/Tabs.d.ts +10 -0
  283. package/dist/components/Tabs/Tabs.js +58 -0
  284. package/dist/components/Tabs/Tabs.js.map +1 -0
  285. package/dist/components/Tabs/index.d.ts +2 -0
  286. package/dist/components/Tabs/index.js +2 -0
  287. package/dist/components/Tag/Tag.d.ts +16 -0
  288. package/dist/components/Tag/Tag.js +48 -0
  289. package/dist/components/Tag/Tag.js.map +1 -0
  290. package/dist/components/Tag/index.d.ts +2 -0
  291. package/dist/components/Tag/index.js +2 -0
  292. package/dist/components/Textarea/Textarea.d.ts +28 -0
  293. package/dist/components/Textarea/Textarea.js +30 -0
  294. package/dist/components/Textarea/Textarea.js.map +1 -0
  295. package/dist/components/Textarea/index.d.ts +2 -0
  296. package/dist/components/Textarea/index.js +2 -0
  297. package/dist/components/Toast/Toast.d.ts +52 -0
  298. package/dist/components/Toast/Toast.js +77 -0
  299. package/dist/components/Toast/Toast.js.map +1 -0
  300. package/dist/components/Toast/ToastItem.d.ts +6 -0
  301. package/dist/components/Toast/ToastItem.js +127 -0
  302. package/dist/components/Toast/ToastItem.js.map +1 -0
  303. package/dist/components/Toast/index.d.ts +2 -0
  304. package/dist/components/Toast/index.js +2 -0
  305. package/dist/components/Tooltip/Tooltip.d.ts +17 -0
  306. package/dist/components/Tooltip/Tooltip.js +38 -0
  307. package/dist/components/Tooltip/Tooltip.js.map +1 -0
  308. package/dist/components/Tooltip/TooltipOverlay.d.ts +5 -0
  309. package/dist/components/Tooltip/TooltipOverlay.js +27 -0
  310. package/dist/components/Tooltip/TooltipOverlay.js.map +1 -0
  311. package/dist/components/Tooltip/index.d.ts +2 -0
  312. package/dist/components/Tooltip/index.js +2 -0
  313. package/dist/fonts.css +21 -0
  314. package/dist/index.d.ts +38 -0
  315. package/dist/index.js +43 -0
  316. package/dist/internal/Field.d.ts +13 -0
  317. package/dist/internal/Field.js +29 -0
  318. package/dist/internal/Field.js.map +1 -0
  319. package/dist/internal/LazyDialogTrigger.d.ts +8 -0
  320. package/dist/internal/LazyDialogTrigger.js +15 -0
  321. package/dist/internal/LazyDialogTrigger.js.map +1 -0
  322. package/dist/internal/PreloadOnIntent.d.ts +15 -0
  323. package/dist/internal/PreloadOnIntent.js +26 -0
  324. package/dist/internal/PreloadOnIntent.js.map +1 -0
  325. package/dist/internal/Spinner.d.ts +3 -0
  326. package/dist/internal/Spinner.js +14 -0
  327. package/dist/internal/Spinner.js.map +1 -0
  328. package/dist/internal/focusRing.d.ts +2 -0
  329. package/dist/internal/focusRing.js +7 -0
  330. package/dist/internal/focusRing.js.map +1 -0
  331. package/dist/internal/lazyModule.d.ts +15 -0
  332. package/dist/internal/lazyModule.js +54 -0
  333. package/dist/internal/lazyModule.js.map +1 -0
  334. package/dist/internal/surfaces.d.ts +8 -0
  335. package/dist/internal/surfaces.js +13 -0
  336. package/dist/internal/surfaces.js.map +1 -0
  337. package/dist/internal/types.d.ts +5 -0
  338. package/dist/internal/useLazyMenuTrigger.d.ts +23 -0
  339. package/dist/internal/useLazyMenuTrigger.js +47 -0
  340. package/dist/internal/useLazyMenuTrigger.js.map +1 -0
  341. package/dist/reset.css +52 -0
  342. package/dist/styles/themes/scales.d.ts +2 -0
  343. package/dist/styles/themes/scales.js +132 -0
  344. package/dist/styles/themes/scales.js.map +1 -0
  345. package/dist/styles/themes/variants.d.ts +41 -0
  346. package/dist/styles/themes/variants.js +180 -0
  347. package/dist/styles/themes/variants.js.map +1 -0
  348. package/dist/styles.css +2 -0
  349. package/dist/theme.css +557 -0
  350. package/dist/themes/all.css +158 -0
  351. package/dist/themes/assistant.css +25 -0
  352. package/dist/themes/control-room.css +25 -0
  353. package/dist/themes/plain-language.css +25 -0
  354. package/dist/themes/portfolio.css +25 -0
  355. package/dist/themes/review.css +25 -0
  356. package/dist/themes/sudoku.css +25 -0
  357. package/dist/themes/tokens.css +25 -0
  358. package/dist/themes/watchlist.css +25 -0
  359. package/dist/themes/workspace.css +25 -0
  360. package/dist/tokens.css +351 -0
  361. package/dist/utils/cx.d.ts +23 -0
  362. package/dist/utils/cx.js +25 -0
  363. package/dist/utils/cx.js.map +1 -0
  364. package/dist/utils/cxLite.d.ts +12 -0
  365. package/dist/utils/cxLite.js +23 -0
  366. package/dist/utils/cxLite.js.map +1 -0
  367. package/package.json +304 -4
@@ -0,0 +1,52 @@
1
+ "use client";
2
+ import { createLazyModule } from "../../internal/lazyModule.js";
3
+ import { PreloadOnIntent } from "../../internal/PreloadOnIntent.js";
4
+ import { useContext } from "react";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { MenuTrigger, OverlayTriggerStateContext } from "react-aria-components";
7
+ // src/components/DropdownMenu/DropdownMenu.tsx
8
+ var menu = /*#__PURE__*/ createLazyModule(() => import("./DropdownMenuParts.js"));
9
+ /**
10
+ * Wraps a trigger and a DropdownMenuContent. Opens on press, Enter, Space or
11
+ * the arrow keys. Inside, arrow keys move, typing jumps to a matching item,
12
+ * Enter activates and Escape closes and returns focus to the trigger.
13
+ *
14
+ * The menu's code loads the first time it opens, or earlier when the trigger
15
+ * is hovered or focused, so the very first open can take a moment on a slow
16
+ * connection. The trigger works at once.
17
+ */
18
+ function DropdownMenu(props) {
19
+ return /* @__PURE__ */ jsx(PreloadOnIntent, {
20
+ module: menu,
21
+ children: /* @__PURE__ */ jsx(MenuTrigger, { ...props })
22
+ });
23
+ }
24
+ function DropdownMenuContent(props) {
25
+ const triggerState = useContext(OverlayTriggerStateContext);
26
+ const parts = menu.useModule(triggerState?.isOpen ?? false);
27
+ return parts ? /* @__PURE__ */ jsx(parts.DropdownMenuContent, { ...props }) : null;
28
+ }
29
+ function DropdownMenuItem(props) {
30
+ const parts = menu.get();
31
+ return parts ? /* @__PURE__ */ jsx(parts.DropdownMenuItem, { ...props }) : null;
32
+ }
33
+ /**
34
+ * Groups items under an optional heading. Set `selectionMode="multiple"` for
35
+ * checkbox items or `"single"` for a radio style group.
36
+ */
37
+ function DropdownMenuSection(props) {
38
+ const parts = menu.get();
39
+ return parts ? /* @__PURE__ */ jsx(parts.DropdownMenuSection, { ...props }) : null;
40
+ }
41
+ function DropdownMenuSeparator() {
42
+ const parts = menu.get();
43
+ return parts ? /* @__PURE__ */ jsx(parts.DropdownMenuSeparator, {}) : null;
44
+ }
45
+ /** Nests a submenu: pass a DropdownMenuItem and a DropdownMenuContent. */
46
+ function DropdownSubmenu(props) {
47
+ const parts = menu.get();
48
+ return parts ? /* @__PURE__ */ jsx(parts.DropdownSubmenu, { ...props }) : null;
49
+ }
50
+ export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSection, DropdownMenuSeparator, DropdownSubmenu };
51
+
52
+ //# sourceMappingURL=DropdownMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownMenu.js","names":[],"sources":["../../../src/components/DropdownMenu/DropdownMenu.tsx"],"sourcesContent":["import { useContext, type ReactNode } from 'react';\nimport {\n MenuTrigger,\n OverlayTriggerStateContext,\n type MenuItemProps,\n type MenuProps,\n type MenuSectionProps,\n type MenuTriggerProps,\n type PopoverProps,\n type SubmenuTriggerProps,\n} from 'react-aria-components';\nimport { createLazyModule } from '../../internal/lazyModule';\nimport { PreloadOnIntent } from '../../internal/PreloadOnIntent';\nimport type { IconComponent } from '../../internal/types';\n\nexport type DropdownMenuProps = MenuTriggerProps;\n\nexport interface DropdownMenuContentProps<T extends object> extends MenuProps<T> {\n placement?: PopoverProps['placement'];\n /** Class for the floating surface. */\n popoverClassName?: string;\n}\n\nexport interface DropdownMenuItemProps<T extends object = object> extends Omit<\n MenuItemProps<T>,\n 'children'\n> {\n children: ReactNode;\n /** Leading icon component, for example from lucide-react. */\n icon?: IconComponent;\n /**\n * Secondary line under the label. It becomes part of the item's accessible\n * name, which then starts with the label, so the name always contains the\n * visible text (WCAG 2.5.3).\n */\n description?: ReactNode;\n /** Keyboard shortcut hint, such as \"⌘K\". Display only. */\n shortcut?: string;\n /** Destructive styling, for delete and similar actions. */\n isDanger?: boolean;\n}\n\nexport interface DropdownMenuSectionProps<T extends object> extends Omit<\n MenuSectionProps<T>,\n 'children'\n> {\n /** Visible group heading, also the group's accessible name. */\n title?: ReactNode;\n children: ReactNode;\n}\n\nconst menu = /*#__PURE__*/ createLazyModule(() => import('./DropdownMenuParts'));\n\n/**\n * Wraps a trigger and a DropdownMenuContent. Opens on press, Enter, Space or\n * the arrow keys. Inside, arrow keys move, typing jumps to a matching item,\n * Enter activates and Escape closes and returns focus to the trigger.\n *\n * The menu's code loads the first time it opens, or earlier when the trigger\n * is hovered or focused, so the very first open can take a moment on a slow\n * connection. The trigger works at once.\n */\nexport function DropdownMenu(props: DropdownMenuProps) {\n return (\n <PreloadOnIntent module={menu}>\n <MenuTrigger {...props} />\n </PreloadOnIntent>\n );\n}\n\nexport function DropdownMenuContent<T extends object>(props: DropdownMenuContentProps<T>) {\n const triggerState = useContext(OverlayTriggerStateContext);\n const parts = menu.useModule(triggerState?.isOpen ?? false);\n return parts ? <parts.DropdownMenuContent {...props} /> : null;\n}\n\nexport function DropdownMenuItem<T extends object = object>(props: DropdownMenuItemProps<T>) {\n const parts = menu.get();\n return parts ? <parts.DropdownMenuItem {...props} /> : null;\n}\n\n/**\n * Groups items under an optional heading. Set `selectionMode=\"multiple\"` for\n * checkbox items or `\"single\"` for a radio style group.\n */\nexport function DropdownMenuSection<T extends object>(props: DropdownMenuSectionProps<T>) {\n const parts = menu.get();\n return parts ? <parts.DropdownMenuSection {...props} /> : null;\n}\n\nexport function DropdownMenuSeparator() {\n const parts = menu.get();\n return parts ? <parts.DropdownMenuSeparator /> : null;\n}\n\n/** Nests a submenu: pass a DropdownMenuItem and a DropdownMenuContent. */\nexport function DropdownSubmenu(props: SubmenuTriggerProps) {\n const parts = menu.get();\n return parts ? <parts.DropdownSubmenu {...props} /> : null;\n}\n"],"mappings":";;;;;;;AAmDA,IAAM,OAAqB,qCAAuB,OAAO,yBAAsB;;;;;;;;;;AAW/E,SAAgB,aAAa,OAA0B;CACrD,OACE,oBAAC,iBAAD;EAAiB,QAAQ;EACvB,UAAA,oBAAC,aAAD,EAAa,GAAI,MAAQ,CAAA;CACV,CAAA;AAErB;AAEA,SAAgB,oBAAsC,OAAoC;CACxF,MAAM,eAAe,WAAW,0BAA0B;CAC1D,MAAM,QAAQ,KAAK,UAAU,cAAc,UAAU,KAAK;CAC1D,OAAO,QAAQ,oBAAC,MAAM,qBAAP,EAA2B,GAAI,MAAQ,CAAA,IAAI;AAC5D;AAEA,SAAgB,iBAA4C,OAAiC;CAC3F,MAAM,QAAQ,KAAK,IAAI;CACvB,OAAO,QAAQ,oBAAC,MAAM,kBAAP,EAAwB,GAAI,MAAQ,CAAA,IAAI;AACzD;;;;;AAMA,SAAgB,oBAAsC,OAAoC;CACxF,MAAM,QAAQ,KAAK,IAAI;CACvB,OAAO,QAAQ,oBAAC,MAAM,qBAAP,EAA2B,GAAI,MAAQ,CAAA,IAAI;AAC5D;AAEA,SAAgB,wBAAwB;CACtC,MAAM,QAAQ,KAAK,IAAI;CACvB,OAAO,QAAQ,oBAAC,MAAM,uBAAP,CAA8B,CAAA,IAAI;AACnD;;AAGA,SAAgB,gBAAgB,OAA4B;CAC1D,MAAM,QAAQ,KAAK,IAAI;CACvB,OAAO,QAAQ,oBAAC,MAAM,iBAAP,EAAuB,GAAI,MAAQ,CAAA,IAAI;AACxD"}
@@ -0,0 +1,6 @@
1
+ import type { DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuSectionProps } from './DropdownMenu';
2
+ export declare function DropdownMenuContent<T extends object>({ placement, popoverClassName, className, ...props }: DropdownMenuContentProps<T>): import("react").JSX.Element;
3
+ export declare function DropdownMenuItem<T extends object = object>({ children, icon: Icon, description, shortcut, isDanger, className, ...props }: DropdownMenuItemProps<T>): import("react").JSX.Element;
4
+ export declare function DropdownMenuSection<T extends object>({ title, children, className, ...props }: DropdownMenuSectionProps<T>): import("react").JSX.Element;
5
+ export declare function DropdownMenuSeparator(): import("react").JSX.Element;
6
+ export declare const DropdownSubmenu: (props: import("react-aria-components").SubmenuTriggerProps & React.RefAttributes<HTMLDivElement>) => import("react").ReactElement | null;
@@ -0,0 +1,76 @@
1
+ "use client";
2
+ import { listItem, listSeparator, popoverSurface } from "../../internal/surfaces.js";
3
+ import { cx } from "../../utils/cx.js";
4
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
5
+ import { Check, ChevronRight } from "lucide-react";
6
+ import { Header, Keyboard, Menu as Menu$1, MenuItem, MenuSection, Popover, Separator, SubmenuTrigger, Text, composeRenderProps } from "react-aria-components";
7
+ // src/components/DropdownMenu/DropdownMenuParts.tsx
8
+ function DropdownMenuContent({ placement = "bottom start", popoverClassName, className, ...props }) {
9
+ return /* @__PURE__ */ jsx(Popover, {
10
+ placement,
11
+ offset: 4,
12
+ className: cx(popoverSurface, "min-w-48", popoverClassName),
13
+ children: /* @__PURE__ */ jsx(Menu$1, {
14
+ ...props,
15
+ className: composeRenderProps(className, (consumer) => cx("max-h-[inherit] outline-none", consumer))
16
+ })
17
+ });
18
+ }
19
+ function DropdownMenuItem({ children, icon: Icon, description, shortcut, isDanger = false, className, ...props }) {
20
+ const textValue = props.textValue ?? (typeof children === "string" ? children : void 0);
21
+ return /* @__PURE__ */ jsx(MenuItem, {
22
+ ...props,
23
+ textValue,
24
+ className: composeRenderProps(className, (consumer) => cx(listItem, isDanger && "text-error", consumer)),
25
+ children: ({ isSelected, selectionMode, hasSubmenu }) => /* @__PURE__ */ jsxs(Fragment, { children: [
26
+ selectionMode !== "none" && /* @__PURE__ */ jsx("span", {
27
+ className: "flex size-4 shrink-0 items-center justify-center",
28
+ "aria-hidden": "true",
29
+ children: isSelected && /* @__PURE__ */ jsx(Check, { className: "size-4 text-fg-brand" })
30
+ }),
31
+ Icon && /* @__PURE__ */ jsx(Icon, {
32
+ "aria-hidden": "true",
33
+ className: cx("size-4 shrink-0", isDanger ? "text-fg-error" : "text-fg-tertiary")
34
+ }),
35
+ description ? /* @__PURE__ */ jsxs("span", {
36
+ className: "flex min-w-0 flex-1 flex-col",
37
+ children: [/* @__PURE__ */ jsx("span", {
38
+ className: "truncate",
39
+ children
40
+ }), /* @__PURE__ */ jsx("span", {
41
+ className: "truncate text-xs text-tertiary",
42
+ children: description
43
+ })]
44
+ }) : /* @__PURE__ */ jsx(Text, {
45
+ slot: "label",
46
+ className: "min-w-0 flex-1 truncate",
47
+ children
48
+ }),
49
+ shortcut && /* @__PURE__ */ jsx(Keyboard, {
50
+ className: "ml-4 font-mono text-xs text-tertiary",
51
+ children: shortcut
52
+ }),
53
+ hasSubmenu && /* @__PURE__ */ jsx(ChevronRight, {
54
+ "aria-hidden": "true",
55
+ className: "size-4 text-fg-tertiary"
56
+ })
57
+ ] })
58
+ });
59
+ }
60
+ function DropdownMenuSection({ title, children, className, ...props }) {
61
+ return /* @__PURE__ */ jsxs(MenuSection, {
62
+ ...props,
63
+ className: cx("flex flex-col", className),
64
+ children: [title && /* @__PURE__ */ jsx(Header, {
65
+ className: "px-item-x pt-2 pb-1 text-xs font-semibold text-tertiary",
66
+ children: title
67
+ }), children]
68
+ });
69
+ }
70
+ function DropdownMenuSeparator() {
71
+ return /* @__PURE__ */ jsx(Separator, { className: listSeparator });
72
+ }
73
+ var DropdownSubmenu = SubmenuTrigger;
74
+ export { DropdownMenuContent, DropdownMenuItem, DropdownMenuSection, DropdownMenuSeparator, DropdownSubmenu };
75
+
76
+ //# sourceMappingURL=DropdownMenuParts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropdownMenuParts.js","names":["Menu","_Fragment"],"sources":["../../../src/components/DropdownMenu/DropdownMenuParts.tsx"],"sourcesContent":["import { Check, ChevronRight } from 'lucide-react';\nimport {\n Header,\n Keyboard,\n Menu,\n MenuItem,\n MenuSection,\n Popover,\n Separator,\n SubmenuTrigger,\n Text,\n composeRenderProps,\n} from 'react-aria-components';\nimport {\n listItem,\n listSectionHeader,\n listSeparator,\n popoverSurface,\n} from '../../internal/surfaces';\nimport { cx } from '../../utils/cx';\nimport type {\n DropdownMenuContentProps,\n DropdownMenuItemProps,\n DropdownMenuSectionProps,\n} from './DropdownMenu';\n\nexport function DropdownMenuContent<T extends object>({\n placement = 'bottom start',\n popoverClassName,\n className,\n ...props\n}: DropdownMenuContentProps<T>) {\n return (\n <Popover\n placement={placement}\n offset={4}\n className={cx(popoverSurface, 'min-w-48', popoverClassName)}\n >\n <Menu\n {...props}\n className={composeRenderProps(className, (consumer) =>\n cx('max-h-[inherit] outline-none', consumer),\n )}\n />\n </Popover>\n );\n}\n\nexport function DropdownMenuItem<T extends object = object>({\n children,\n icon: Icon,\n description,\n shortcut,\n isDanger = false,\n className,\n ...props\n}: DropdownMenuItemProps<T>) {\n const textValue = props.textValue ?? (typeof children === 'string' ? children : undefined);\n return (\n <MenuItem\n {...props}\n textValue={textValue}\n className={composeRenderProps(className, (consumer) =>\n cx(listItem, isDanger && 'text-error', consumer),\n )}\n >\n {({ isSelected, selectionMode, hasSubmenu }) => (\n <>\n {selectionMode !== 'none' && (\n <span className='flex size-4 shrink-0 items-center justify-center' aria-hidden='true'>\n {isSelected && <Check className='size-4 text-fg-brand' />}\n </span>\n )}\n {Icon && (\n <Icon\n aria-hidden='true'\n className={cx('size-4 shrink-0', isDanger ? 'text-fg-error' : 'text-fg-tertiary')}\n />\n )}\n {description ? (\n <span className='flex min-w-0 flex-1 flex-col'>\n <span className='truncate'>{children}</span>\n <span className='truncate text-xs text-tertiary'>{description}</span>\n </span>\n ) : (\n <Text slot='label' className='min-w-0 flex-1 truncate'>\n {children}\n </Text>\n )}\n {shortcut && (\n <Keyboard className='ml-4 font-mono text-xs text-tertiary'>{shortcut}</Keyboard>\n )}\n {hasSubmenu && <ChevronRight aria-hidden='true' className='size-4 text-fg-tertiary' />}\n </>\n )}\n </MenuItem>\n );\n}\n\nexport function DropdownMenuSection<T extends object>({\n title,\n children,\n className,\n ...props\n}: DropdownMenuSectionProps<T>) {\n return (\n <MenuSection {...props} className={cx('flex flex-col', className)}>\n {title && <Header className={listSectionHeader}>{title}</Header>}\n {children}\n </MenuSection>\n );\n}\n\nexport function DropdownMenuSeparator() {\n return <Separator className={listSeparator} />;\n}\n\nexport const DropdownSubmenu = SubmenuTrigger;\n"],"mappings":";;;;;;;AA0BA,SAAgB,oBAAsC,EACpD,YAAY,gBACZ,kBACA,WACA,GAAG,SAC2B;CAC9B,OACE,oBAAC,SAAD;EACa;EACX,QAAQ;EACR,WAAW,GAAG,gBAAgB,YAAY,gBAAgB;EAE1D,UAAA,oBAACA,QAAD;GACE,GAAI;GACJ,WAAW,mBAAmB,YAAY,aACxC,GAAG,gCAAgC,QAAQ,CAC7C;EACD,CAAA;CACM,CAAA;AAEb;AAEA,SAAgB,iBAA4C,EAC1D,UACA,MAAM,MACN,aACA,UACA,WAAW,OACX,WACA,GAAG,SACwB;CAC3B,MAAM,YAAY,MAAM,cAAc,OAAO,aAAa,WAAW,WAAW,KAAA;CAChF,OACE,oBAAC,UAAD;EACE,GAAI;EACO;EACX,WAAW,mBAAmB,YAAY,aACxC,GAAG,UAAU,YAAY,cAAc,QAAQ,CACjD;EAEE,WAAA,EAAE,YAAY,eAAe,iBAC7B,qBAAAC,UAAA,EAAA,UAAA;GACG,kBAAkB,UACjB,oBAAC,QAAD;IAAM,WAAU;IAAmD,eAAY;IAC5E,UAAA,cAAc,oBAAC,OAAD,EAAO,WAAU,uBAAwB,CAAA;GACpD,CAAA;GAEP,QACC,oBAAC,MAAD;IACE,eAAY;IACZ,WAAW,GAAG,mBAAmB,WAAW,kBAAkB,kBAAkB;GACjF,CAAA;GAEF,cACC,qBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,oBAAC,QAAD;KAAM,WAAU;KAAY;IAAe,CAAA,GAC3C,oBAAC,QAAD;KAAM,WAAU;KAAkC,UAAA;IAAkB,CAAA,CAChE;GAEN,CAAA,IAAA,oBAAC,MAAD;IAAM,MAAK;IAAQ,WAAU;IAC1B;GACG,CAAA;GAEP,YACC,oBAAC,UAAD;IAAU,WAAU;IAAwC,UAAA;GAAmB,CAAA;GAEhF,cAAc,oBAAC,cAAD;IAAc,eAAY;IAAO,WAAU;GAA2B,CAAA;EACrF,EAAA,CAAA;CAEI,CAAA;AAEd;AAEA,SAAgB,oBAAsC,EACpD,OACA,UACA,WACA,GAAG,SAC2B;CAC9B,OACE,qBAAC,aAAD;EAAa,GAAI;EAAO,WAAW,GAAG,iBAAiB,SAAS;EAAhE,UAAA,CACG,SAAS,oBAAC,QAAD;GAAQ,WAAA;GAA+B,UAAA;EAAc,CAAA,GAC9D,QACU;;AAEjB;AAEA,SAAgB,wBAAwB;CACtC,OAAO,oBAAC,WAAD,EAAW,WAAW,cAAgB,CAAA;AAC/C;AAEA,IAAa,kBAAkB"}
@@ -0,0 +1,2 @@
1
+ export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSection, DropdownMenuSeparator, DropdownSubmenu, } from './DropdownMenu';
2
+ export type { DropdownMenuProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuSectionProps, } from './DropdownMenu';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSection, DropdownMenuSeparator, DropdownSubmenu } from "./DropdownMenu.js";
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { IconComponent } from '../../internal/types';
3
+ export type EmptyStateSize = 'sm' | 'md';
4
+ export interface EmptyStateProps {
5
+ title: ReactNode;
6
+ description?: ReactNode;
7
+ /** Decorative icon, for example from lucide-react. */
8
+ icon?: IconComponent;
9
+ /** The main way forward, usually a primary Button. */
10
+ primaryAction?: ReactNode;
11
+ /** An alternative, usually a secondary Button or a link. */
12
+ secondaryAction?: ReactNode;
13
+ /** Use 1 when the empty state is the whole page, such as a 404. */
14
+ headingLevel?: 1 | 2 | 3 | 4;
15
+ size?: EmptyStateSize;
16
+ className?: string;
17
+ }
18
+ /** What to show when a list, search or view has nothing in it yet, and what to do next. */
19
+ export declare function EmptyState({ title, description, icon: Icon, primaryAction, secondaryAction, headingLevel, size, className, }: EmptyStateProps): import("react").JSX.Element;
@@ -0,0 +1,51 @@
1
+ "use client";
2
+ import { cx } from "../../utils/cx.js";
3
+ import { jsx, jsxs } from "react/jsx-runtime";
4
+ // src/components/EmptyState/EmptyState.tsx
5
+ var headings = {
6
+ 1: "h1",
7
+ 2: "h2",
8
+ 3: "h3",
9
+ 4: "h4"
10
+ };
11
+ var sizes = {
12
+ sm: {
13
+ root: "gap-2 py-6",
14
+ icon: "size-10 [&>svg]:size-5",
15
+ title: "text-md"
16
+ },
17
+ md: {
18
+ root: "gap-3 py-12",
19
+ icon: "size-12 [&>svg]:size-6",
20
+ title: "text-lg"
21
+ }
22
+ };
23
+ var iconFrame = "flex items-center justify-center rounded-xl border border-subtle bg-primary text-fg-secondary shadow-xs";
24
+ /** What to show when a list, search or view has nothing in it yet, and what to do next. */
25
+ function EmptyState({ title, description, icon: Icon, primaryAction, secondaryAction, headingLevel = 2, size = "md", className }) {
26
+ const Heading = headings[headingLevel];
27
+ return /* @__PURE__ */ jsxs("div", {
28
+ className: cx("mx-auto flex max-w-md flex-col items-center px-4 text-center", sizes[size].root, className),
29
+ children: [
30
+ Icon && /* @__PURE__ */ jsx("div", {
31
+ className: cx(iconFrame, sizes[size].icon),
32
+ children: /* @__PURE__ */ jsx(Icon, { "aria-hidden": "true" })
33
+ }),
34
+ /* @__PURE__ */ jsx(Heading, {
35
+ className: cx("font-display font-semibold text-primary", sizes[size].title),
36
+ children: title
37
+ }),
38
+ description && /* @__PURE__ */ jsx("p", {
39
+ className: "text-sm text-tertiary",
40
+ children: description
41
+ }),
42
+ (primaryAction ?? secondaryAction) && /* @__PURE__ */ jsxs("div", {
43
+ className: "mt-2 flex flex-wrap items-center justify-center gap-3",
44
+ children: [secondaryAction, primaryAction]
45
+ })
46
+ ]
47
+ });
48
+ }
49
+ export { EmptyState };
50
+
51
+ //# sourceMappingURL=EmptyState.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EmptyState.js","names":[],"sources":["../../../src/components/EmptyState/EmptyState.tsx"],"sourcesContent":["import type { ReactNode } from 'react';\nimport type { IconComponent } from '../../internal/types';\nimport { cx } from '../../utils/cx';\n\nexport type EmptyStateSize = 'sm' | 'md';\n\nexport interface EmptyStateProps {\n title: ReactNode;\n description?: ReactNode;\n /** Decorative icon, for example from lucide-react. */\n icon?: IconComponent;\n /** The main way forward, usually a primary Button. */\n primaryAction?: ReactNode;\n /** An alternative, usually a secondary Button or a link. */\n secondaryAction?: ReactNode;\n /** Use 1 when the empty state is the whole page, such as a 404. */\n headingLevel?: 1 | 2 | 3 | 4;\n size?: EmptyStateSize;\n className?: string;\n}\n\nconst headings = { 1: 'h1', 2: 'h2', 3: 'h3', 4: 'h4' } as const;\n\nconst sizes: Record<EmptyStateSize, { root: string; icon: string; title: string }> = {\n sm: { root: 'gap-2 py-6', icon: 'size-10 [&>svg]:size-5', title: 'text-md' },\n md: { root: 'gap-3 py-12', icon: 'size-12 [&>svg]:size-6', title: 'text-lg' },\n};\n\nconst iconFrame =\n 'flex items-center justify-center rounded-xl border border-subtle bg-primary text-fg-secondary shadow-xs';\n\n/** What to show when a list, search or view has nothing in it yet, and what to do next. */\nexport function EmptyState({\n title,\n description,\n icon: Icon,\n primaryAction,\n secondaryAction,\n headingLevel = 2,\n size = 'md',\n className,\n}: EmptyStateProps) {\n const Heading = headings[headingLevel];\n return (\n <div\n className={cx(\n 'mx-auto flex max-w-md flex-col items-center px-4 text-center',\n sizes[size].root,\n className,\n )}\n >\n {Icon && (\n <div className={cx(iconFrame, sizes[size].icon)}>\n <Icon aria-hidden='true' />\n </div>\n )}\n <Heading className={cx('font-display font-semibold text-primary', sizes[size].title)}>\n {title}\n </Heading>\n {description && <p className='text-sm text-tertiary'>{description}</p>}\n {(primaryAction ?? secondaryAction) && (\n <div className='mt-2 flex flex-wrap items-center justify-center gap-3'>\n {secondaryAction}\n {primaryAction}\n </div>\n )}\n </div>\n );\n}\n"],"mappings":";;;;AAqBA,IAAM,WAAW;CAAE,GAAG;CAAM,GAAG;CAAM,GAAG;CAAM,GAAG;AAAK;AAEtD,IAAM,QAA+E;CACnF,IAAI;EAAE,MAAM;EAAc,MAAM;EAA0B,OAAO;CAAU;CAC3E,IAAI;EAAE,MAAM;EAAe,MAAM;EAA0B,OAAO;CAAU;AAC9E;AAEA,IAAM,YACJ;;AAGF,SAAgB,WAAW,EACzB,OACA,aACA,MAAM,MACN,eACA,iBACA,eAAe,GACf,OAAO,MACP,aACkB;CAClB,MAAM,UAAU,SAAS;CACzB,OACE,qBAAC,OAAD;EACE,WAAW,GACT,gEACA,MAAM,KAAK,CAAC,MACZ,SACF;EALF,UAAA;GAOG,QACC,oBAAC,OAAD;IAAK,WAAW,GAAG,WAAW,MAAM,KAAK,CAAC,IAAI;IAC5C,UAAA,oBAAC,MAAD,EAAM,eAAY,OAAQ,CAAA;GACvB,CAAA;GAEP,oBAAC,SAAD;IAAS,WAAW,GAAG,2CAA2C,MAAM,KAAK,CAAC,KAAK;IAChF,UAAA;GACM,CAAA;GACR,eAAe,oBAAC,KAAD;IAAG,WAAU;IAAyB,UAAA;GAAe,CAAA;IACnE,iBAAiB,oBACjB,qBAAC,OAAD;IAAK,WAAU;IAAf,UAAA,CACG,iBACA,aACE;;EAEJ;;AAET"}
@@ -0,0 +1,2 @@
1
+ export { EmptyState } from './EmptyState';
2
+ export type { EmptyStateProps, EmptyStateSize } from './EmptyState';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { EmptyState } from "./EmptyState.js";
@@ -0,0 +1,41 @@
1
+ import type { ReactNode } from 'react';
2
+ export interface FileDropZoneProps {
3
+ /** What the area is for, such as "Drop a JSON file here". Also its accessible name. */
4
+ label: ReactNode;
5
+ /** Constraints before the user errs, such as "JSON, up to 2 MB". */
6
+ hint?: ReactNode;
7
+ /** Text of the button that opens the file picker. Start with a verb. */
8
+ buttonLabel?: string;
9
+ /**
10
+ * Accepted files: extensions (".json"), MIME types ("application/json") or
11
+ * wildcards ("image/*"). Applied to the picker and to dropped files.
12
+ */
13
+ acceptedFileTypes?: readonly string[];
14
+ allowsMultiple?: boolean;
15
+ isDisabled?: boolean;
16
+ /** Files the user chose or dropped that match `acceptedFileTypes`. */
17
+ onSelect: (files: File[]) => void;
18
+ /** Files that were dropped or picked but not accepted: a wrong type, or extra files when only one is allowed. */
19
+ onReject?: (files: File[]) => void;
20
+ className?: string;
21
+ }
22
+ /**
23
+ * Whether a file matches an `accept` style list: extensions, MIME types or
24
+ * wildcards. An empty or missing list accepts everything.
25
+ */
26
+ export declare function acceptsFile(file: Pick<File, 'name' | 'type'>, accepted?: readonly string[]): boolean;
27
+ /**
28
+ * Splits files into those to keep and those to refuse: files that do not
29
+ * match `accepted`, and, when only one file is allowed, every match after the first.
30
+ */
31
+ export declare function sortFiles(files: File[], accepted: readonly string[] | undefined, multiple: boolean): {
32
+ selected: File[];
33
+ rejected: File[];
34
+ };
35
+ /**
36
+ * A drop area with a button that opens the file picker, so files can be added
37
+ * by dragging or by keyboard. React Aria's DropZone and FileTrigger do the
38
+ * work; this adds the look, type checking and a single `onSelect`. It holds no
39
+ * file list: show what was chosen next to it.
40
+ */
41
+ export declare function FileDropZone({ label, hint, buttonLabel, acceptedFileTypes, allowsMultiple, isDisabled, onSelect, onReject, className, }: FileDropZoneProps): import("react").JSX.Element;
@@ -0,0 +1,94 @@
1
+ "use client";
2
+ import { focusRing } from "../../internal/focusRing.js";
3
+ import { cx } from "../../utils/cx.js";
4
+ import { Button as Button$1 } from "../Button/Button.js";
5
+ import { jsx, jsxs } from "react/jsx-runtime";
6
+ import { Upload } from "lucide-react";
7
+ import { DropZone, FileTrigger, Text, isFileDropItem } from "react-aria-components";
8
+ // src/components/FileDropZone/FileDropZone.tsx
9
+ var zone = [
10
+ "flex flex-col items-center gap-2 rounded-lg border-2 border-dashed border-control bg-primary p-card text-center transition-colors",
11
+ "data-drop-target:border-brand data-drop-target:bg-brand-subtle",
12
+ "data-disabled:cursor-not-allowed data-disabled:border-disabled data-disabled:bg-disabled",
13
+ focusRing
14
+ ].join(" ");
15
+ /**
16
+ * Whether a file matches an `accept` style list: extensions, MIME types or
17
+ * wildcards. An empty or missing list accepts everything.
18
+ */
19
+ function acceptsFile(file, accepted) {
20
+ if (!accepted || accepted.length === 0) return true;
21
+ const name = file.name.toLowerCase();
22
+ return accepted.some((pattern) => {
23
+ const rule = pattern.trim().toLowerCase();
24
+ if (rule.startsWith(".")) return name.endsWith(rule);
25
+ if (rule.endsWith("/*")) return file.type.toLowerCase().startsWith(rule.slice(0, -1));
26
+ return file.type.toLowerCase() === rule;
27
+ });
28
+ }
29
+ /**
30
+ * Splits files into those to keep and those to refuse: files that do not
31
+ * match `accepted`, and, when only one file is allowed, every match after the first.
32
+ */
33
+ function sortFiles(files, accepted, multiple) {
34
+ const matching = files.filter((file) => acceptsFile(file, accepted));
35
+ const selected = multiple ? matching : matching.slice(0, 1);
36
+ return {
37
+ selected,
38
+ rejected: files.filter((file) => !selected.includes(file))
39
+ };
40
+ }
41
+ /**
42
+ * A drop area with a button that opens the file picker, so files can be added
43
+ * by dragging or by keyboard. React Aria's DropZone and FileTrigger do the
44
+ * work; this adds the look, type checking and a single `onSelect`. It holds no
45
+ * file list: show what was chosen next to it.
46
+ */
47
+ function FileDropZone({ label, hint, buttonLabel = "Choose file", acceptedFileTypes, allowsMultiple = false, isDisabled = false, onSelect, onReject, className }) {
48
+ function route(files) {
49
+ const { selected, rejected } = sortFiles(files, acceptedFileTypes, allowsMultiple);
50
+ if (selected.length > 0) onSelect(selected);
51
+ if (rejected.length > 0) onReject?.(rejected);
52
+ }
53
+ async function handleDrop(event) {
54
+ const items = event.items.filter(isFileDropItem);
55
+ route(await Promise.all(items.map((item) => item.getFile())));
56
+ }
57
+ function handleSelect(files) {
58
+ route(files ? [...files] : []);
59
+ }
60
+ return /* @__PURE__ */ jsxs(DropZone, {
61
+ isDisabled,
62
+ onDrop: handleDrop,
63
+ className: cx(zone, className),
64
+ children: [
65
+ /* @__PURE__ */ jsx(Upload, {
66
+ "aria-hidden": "true",
67
+ className: "size-6 text-fg-tertiary"
68
+ }),
69
+ /* @__PURE__ */ jsx(Text, {
70
+ slot: "label",
71
+ className: "text-sm font-medium text-primary",
72
+ children: label
73
+ }),
74
+ hint && /* @__PURE__ */ jsx("span", {
75
+ className: "text-sm text-tertiary",
76
+ children: hint
77
+ }),
78
+ /* @__PURE__ */ jsx(FileTrigger, {
79
+ acceptedFileTypes,
80
+ allowsMultiple,
81
+ onSelect: handleSelect,
82
+ children: /* @__PURE__ */ jsx(Button$1, {
83
+ variant: "secondary",
84
+ size: "sm",
85
+ isDisabled,
86
+ children: buttonLabel
87
+ })
88
+ })
89
+ ]
90
+ });
91
+ }
92
+ export { FileDropZone, acceptsFile, sortFiles };
93
+
94
+ //# sourceMappingURL=FileDropZone.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FileDropZone.js","names":["Button"],"sources":["../../../src/components/FileDropZone/FileDropZone.tsx"],"sourcesContent":["import { Upload } from 'lucide-react';\nimport type { ReactNode } from 'react';\nimport {\n DropZone,\n FileTrigger,\n Text,\n isFileDropItem,\n type DropZoneProps,\n} from 'react-aria-components';\nimport { focusRing } from '../../internal/focusRing';\nimport { cx } from '../../utils/cx';\nimport { Button } from '../Button/Button';\n\nexport interface FileDropZoneProps {\n /** What the area is for, such as \"Drop a JSON file here\". Also its accessible name. */\n label: ReactNode;\n /** Constraints before the user errs, such as \"JSON, up to 2 MB\". */\n hint?: ReactNode;\n /** Text of the button that opens the file picker. Start with a verb. */\n buttonLabel?: string;\n /**\n * Accepted files: extensions (\".json\"), MIME types (\"application/json\") or\n * wildcards (\"image/*\"). Applied to the picker and to dropped files.\n */\n acceptedFileTypes?: readonly string[];\n allowsMultiple?: boolean;\n isDisabled?: boolean;\n /** Files the user chose or dropped that match `acceptedFileTypes`. */\n onSelect: (files: File[]) => void;\n /** Files that were dropped or picked but not accepted: a wrong type, or extra files when only one is allowed. */\n onReject?: (files: File[]) => void;\n className?: string;\n}\n\nconst zone = [\n 'flex flex-col items-center gap-2 rounded-lg border-2 border-dashed border-control bg-primary p-card text-center transition-colors',\n 'data-drop-target:border-brand data-drop-target:bg-brand-subtle',\n 'data-disabled:cursor-not-allowed data-disabled:border-disabled data-disabled:bg-disabled',\n focusRing,\n].join(' ');\n\n/**\n * Whether a file matches an `accept` style list: extensions, MIME types or\n * wildcards. An empty or missing list accepts everything.\n */\nexport function acceptsFile(file: Pick<File, 'name' | 'type'>, accepted?: readonly string[]) {\n if (!accepted || accepted.length === 0) return true;\n const name = file.name.toLowerCase();\n return accepted.some((pattern) => {\n const rule = pattern.trim().toLowerCase();\n if (rule.startsWith('.')) return name.endsWith(rule);\n if (rule.endsWith('/*')) return file.type.toLowerCase().startsWith(rule.slice(0, -1));\n return file.type.toLowerCase() === rule;\n });\n}\n\n/**\n * Splits files into those to keep and those to refuse: files that do not\n * match `accepted`, and, when only one file is allowed, every match after the first.\n */\nexport function sortFiles(\n files: File[],\n accepted: readonly string[] | undefined,\n multiple: boolean,\n) {\n const matching = files.filter((file) => acceptsFile(file, accepted));\n const selected = multiple ? matching : matching.slice(0, 1);\n const rejected = files.filter((file) => !selected.includes(file));\n return { selected, rejected };\n}\n\n/**\n * A drop area with a button that opens the file picker, so files can be added\n * by dragging or by keyboard. React Aria's DropZone and FileTrigger do the\n * work; this adds the look, type checking and a single `onSelect`. It holds no\n * file list: show what was chosen next to it.\n */\nexport function FileDropZone({\n label,\n hint,\n buttonLabel = 'Choose file',\n acceptedFileTypes,\n allowsMultiple = false,\n isDisabled = false,\n onSelect,\n onReject,\n className,\n}: FileDropZoneProps) {\n function route(files: File[]) {\n const { selected, rejected } = sortFiles(files, acceptedFileTypes, allowsMultiple);\n if (selected.length > 0) onSelect(selected);\n if (rejected.length > 0) onReject?.(rejected);\n }\n\n async function handleDrop(event: Parameters<NonNullable<DropZoneProps['onDrop']>>[0]) {\n const items = event.items.filter(isFileDropItem);\n route(await Promise.all(items.map((item) => item.getFile())));\n }\n\n function handleSelect(files: FileList | null) {\n route(files ? [...files] : []);\n }\n\n return (\n <DropZone isDisabled={isDisabled} onDrop={handleDrop} className={cx(zone, className)}>\n <Upload aria-hidden='true' className='size-6 text-fg-tertiary' />\n <Text slot='label' className='text-sm font-medium text-primary'>\n {label}\n </Text>\n {hint && <span className='text-sm text-tertiary'>{hint}</span>}\n <FileTrigger\n acceptedFileTypes={acceptedFileTypes}\n allowsMultiple={allowsMultiple}\n onSelect={handleSelect}\n >\n <Button variant='secondary' size='sm' isDisabled={isDisabled}>\n {buttonLabel}\n </Button>\n </FileTrigger>\n </DropZone>\n );\n}\n"],"mappings":";;;;;;;;AAkCA,IAAM,OAAO;CACX;CACA;CACA;CACA;AACF,CAAC,CAAC,KAAK,GAAG;;;;;AAMV,SAAgB,YAAY,MAAmC,UAA8B;CAC3F,IAAI,CAAC,YAAY,SAAS,WAAW,GAAG,OAAO;CAC/C,MAAM,OAAO,KAAK,KAAK,YAAY;CACnC,OAAO,SAAS,MAAM,YAAY;EAChC,MAAM,OAAO,QAAQ,KAAK,CAAC,CAAC,YAAY;EACxC,IAAI,KAAK,WAAW,GAAG,GAAG,OAAO,KAAK,SAAS,IAAI;EACnD,IAAI,KAAK,SAAS,IAAI,GAAG,OAAO,KAAK,KAAK,YAAY,CAAC,CAAC,WAAW,KAAK,MAAM,GAAG,EAAE,CAAC;EACpF,OAAO,KAAK,KAAK,YAAY,MAAM;CACrC,CAAC;AACH;;;;;AAMA,SAAgB,UACd,OACA,UACA,UACA;CACA,MAAM,WAAW,MAAM,QAAQ,SAAS,YAAY,MAAM,QAAQ,CAAC;CACnE,MAAM,WAAW,WAAW,WAAW,SAAS,MAAM,GAAG,CAAC;CAE1D,OAAO;EAAE;EAAU,UADF,MAAM,QAAQ,SAAS,CAAC,SAAS,SAAS,IAAI,CAC5C;CAAS;AAC9B;;;;;;;AAQA,SAAgB,aAAa,EAC3B,OACA,MACA,cAAc,eACd,mBACA,iBAAiB,OACjB,aAAa,OACb,UACA,UACA,aACoB;CACpB,SAAS,MAAM,OAAe;EAC5B,MAAM,EAAE,UAAU,aAAa,UAAU,OAAO,mBAAmB,cAAc;EACjF,IAAI,SAAS,SAAS,GAAG,SAAS,QAAQ;EAC1C,IAAI,SAAS,SAAS,GAAG,WAAW,QAAQ;CAC9C;CAEA,eAAe,WAAW,OAA4D;EACpF,MAAM,QAAQ,MAAM,MAAM,OAAO,cAAc;EAC/C,MAAM,MAAM,QAAQ,IAAI,MAAM,KAAK,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC;CAC9D;CAEA,SAAS,aAAa,OAAwB;EAC5C,MAAM,QAAQ,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC;CAC/B;CAEA,OACE,qBAAC,UAAD;EAAsB;EAAY,QAAQ;EAAY,WAAW,GAAG,MAAM,SAAS;EAAnF,UAAA;GACE,oBAAC,QAAD;IAAQ,eAAY;IAAO,WAAU;GAA2B,CAAA;GAChE,oBAAC,MAAD;IAAM,MAAK;IAAQ,WAAU;IAC1B,UAAA;GACG,CAAA;GACL,QAAQ,oBAAC,QAAD;IAAM,WAAU;IAAyB,UAAA;GAAW,CAAA;GAC7D,oBAAC,aAAD;IACqB;IACH;IAChB,UAAU;IAEV,UAAA,oBAACA,UAAD;KAAQ,SAAQ;KAAY,MAAK;KAAiB;KAC/C,UAAA;IACK,CAAA;GACG,CAAA;EACL;;AAEd"}
@@ -0,0 +1,2 @@
1
+ export { FileDropZone } from './FileDropZone';
2
+ export type { FileDropZoneProps } from './FileDropZone';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { FileDropZone } from "./FileDropZone.js";
@@ -0,0 +1,17 @@
1
+ import type { Ref } from 'react';
2
+ import { type ButtonProps as AriaButtonProps } from 'react-aria-components';
3
+ import type { IconComponent } from '../../internal/types';
4
+ import { type ButtonVariant } from '../Button/buttonStyles';
5
+ export type IconButtonSize = 'sm' | 'md' | 'lg';
6
+ export interface IconButtonProps extends Omit<AriaButtonProps, 'children' | 'isPending'> {
7
+ /** The icon to render. */
8
+ icon: IconComponent;
9
+ /** Required: an icon alone has no accessible name. */
10
+ 'aria-label': string;
11
+ variant?: ButtonVariant;
12
+ size?: IconButtonSize;
13
+ isLoading?: boolean;
14
+ /** Ref to the button element, for example to return focus to it. */
15
+ ref?: Ref<HTMLButtonElement>;
16
+ }
17
+ export declare function IconButton({ icon: Icon, variant, size, isLoading, ref, className, ...props }: IconButtonProps): import("react").JSX.Element;
@@ -0,0 +1,37 @@
1
+ "use client";
2
+ import { Spinner } from "../../internal/Spinner.js";
3
+ import { cx } from "../../utils/cx.js";
4
+ import { buttonBase, buttonVariants } from "../Button/buttonStyles.js";
5
+ import { jsx } from "react/jsx-runtime";
6
+ import { Button, composeRenderProps } from "react-aria-components";
7
+ // src/components/IconButton/IconButton.tsx
8
+ var sizes = {
9
+ sm: {
10
+ button: "size-control-sm",
11
+ icon: "size-4"
12
+ },
13
+ md: {
14
+ button: "size-control-md",
15
+ icon: "size-5"
16
+ },
17
+ lg: {
18
+ button: "size-control-lg",
19
+ icon: "size-5"
20
+ }
21
+ };
22
+ function IconButton({ icon: Icon, variant = "secondary", size = "md", isLoading = false, ref, className, ...props }) {
23
+ return /* @__PURE__ */ jsx(Button, {
24
+ ...props,
25
+ ref,
26
+ isPending: isLoading,
27
+ "data-variant": variant,
28
+ className: composeRenderProps(className, (consumer) => cx(buttonBase, buttonVariants[variant], "p-0", sizes[size].button, consumer)),
29
+ children: ({ isPending }) => isPending ? /* @__PURE__ */ jsx(Spinner, { className: sizes[size].icon }) : /* @__PURE__ */ jsx(Icon, {
30
+ "aria-hidden": "true",
31
+ className: sizes[size].icon
32
+ })
33
+ });
34
+ }
35
+ export { IconButton };
36
+
37
+ //# sourceMappingURL=IconButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"IconButton.js","names":["AriaButton"],"sources":["../../../src/components/IconButton/IconButton.tsx"],"sourcesContent":["import type { Ref } from 'react';\nimport {\n Button as AriaButton,\n composeRenderProps,\n type ButtonProps as AriaButtonProps,\n} from 'react-aria-components';\nimport { Spinner } from '../../internal/Spinner';\nimport type { IconComponent } from '../../internal/types';\nimport { cx } from '../../utils/cx';\nimport { buttonBase, buttonVariants, type ButtonVariant } from '../Button/buttonStyles';\n\nexport type IconButtonSize = 'sm' | 'md' | 'lg';\n\nexport interface IconButtonProps extends Omit<AriaButtonProps, 'children' | 'isPending'> {\n /** The icon to render. */\n icon: IconComponent;\n /** Required: an icon alone has no accessible name. */\n 'aria-label': string;\n variant?: ButtonVariant;\n size?: IconButtonSize;\n isLoading?: boolean;\n /** Ref to the button element, for example to return focus to it. */\n ref?: Ref<HTMLButtonElement>;\n}\n\nconst sizes: Record<IconButtonSize, { button: string; icon: string }> = {\n sm: { button: 'size-control-sm', icon: 'size-4' },\n md: { button: 'size-control-md', icon: 'size-5' },\n lg: { button: 'size-control-lg', icon: 'size-5' },\n};\n\nexport function IconButton({\n icon: Icon,\n variant = 'secondary',\n size = 'md',\n isLoading = false,\n ref,\n className,\n ...props\n}: IconButtonProps) {\n return (\n <AriaButton\n {...props}\n ref={ref}\n isPending={isLoading}\n data-variant={variant}\n className={composeRenderProps(className, (consumer) =>\n cx(buttonBase, buttonVariants[variant], 'p-0', sizes[size].button, consumer),\n )}\n >\n {({ isPending }) =>\n isPending ? (\n <Spinner className={sizes[size].icon} />\n ) : (\n <Icon aria-hidden='true' className={sizes[size].icon} />\n )\n }\n </AriaButton>\n );\n}\n"],"mappings":";;;;;;;AAyBA,IAAM,QAAkE;CACtE,IAAI;EAAE,QAAQ;EAAmB,MAAM;CAAS;CAChD,IAAI;EAAE,QAAQ;EAAmB,MAAM;CAAS;CAChD,IAAI;EAAE,QAAQ;EAAmB,MAAM;CAAS;AAClD;AAEA,SAAgB,WAAW,EACzB,MAAM,MACN,UAAU,aACV,OAAO,MACP,YAAY,OACZ,KACA,WACA,GAAG,SACe;CAClB,OACE,oBAACA,QAAD;EACE,GAAI;EACC;EACL,WAAW;EACX,gBAAc;EACd,WAAW,mBAAmB,YAAY,aACxC,GAAG,YAAY,eAAe,UAAU,OAAO,MAAM,KAAK,CAAC,QAAQ,QAAQ,CAC7E;EAEE,WAAA,EAAE,gBACF,YACE,oBAAC,SAAD,EAAS,WAAW,MAAM,KAAK,CAAC,KAAO,CAAA,IAEvC,oBAAC,MAAD;GAAM,eAAY;GAAO,WAAW,MAAM,KAAK,CAAC;EAAO,CAAA;CAGjD,CAAA;AAEhB"}
@@ -0,0 +1,2 @@
1
+ export { IconButton } from './IconButton';
2
+ export type { IconButtonProps, IconButtonSize } from './IconButton';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { IconButton } from "./IconButton.js";
@@ -0,0 +1,21 @@
1
+ import type { ReactNode, Ref } from 'react';
2
+ import { type TextFieldProps } from 'react-aria-components';
3
+ import type { IconComponent } from '../../internal/types';
4
+ export type InputSize = 'sm' | 'md';
5
+ export interface InputProps extends Omit<TextFieldProps, 'children'> {
6
+ /** Visible label. If omitted, pass `aria-label` instead. */
7
+ label?: ReactNode;
8
+ /** Helper text below the field, linked with aria-describedby. */
9
+ hint?: ReactNode;
10
+ /** Error text. Setting it also marks the field invalid. */
11
+ errorMessage?: string;
12
+ placeholder?: string;
13
+ size?: InputSize;
14
+ iconLeading?: IconComponent;
15
+ iconTrailing?: IconComponent;
16
+ /** Class applied to the native input element. */
17
+ inputClassName?: string;
18
+ /** Ref to the native input element, not the wrapper. */
19
+ ref?: Ref<HTMLInputElement>;
20
+ }
21
+ export declare function Input({ label, hint, errorMessage, placeholder, size, iconLeading: IconLeading, iconTrailing: IconTrailing, inputClassName, ref, className, isInvalid, ...props }: InputProps): import("react").JSX.Element;
@@ -0,0 +1,43 @@
1
+ "use client";
2
+ import { FieldErrorMessage, FieldHint, FieldLabel } from "../../internal/Field.js";
3
+ import { cx } from "../../utils/cx.js";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Group, Input, TextField, composeRenderProps } from "react-aria-components";
6
+ // src/components/Input/Input.tsx
7
+ var sizes = {
8
+ sm: "h-control-sm text-sm",
9
+ md: "h-control-md text-md"
10
+ };
11
+ function Input$1({ label, hint, errorMessage, placeholder, size = "md", iconLeading: IconLeading, iconTrailing: IconTrailing, inputClassName, ref, className, isInvalid, ...props }) {
12
+ return /* @__PURE__ */ jsxs(TextField, {
13
+ ...props,
14
+ isInvalid: isInvalid ?? Boolean(errorMessage),
15
+ className: composeRenderProps(className, (consumer) => cx("flex flex-col gap-1.5", consumer)),
16
+ children: [
17
+ label && /* @__PURE__ */ jsx(FieldLabel, { children: label }),
18
+ /* @__PURE__ */ jsxs(Group, {
19
+ className: cx("flex items-center gap-2 rounded-md border border-control bg-primary px-3 shadow-xs transition-shadow", "data-disabled:cursor-not-allowed data-disabled:border-disabled data-disabled:bg-disabled", "data-invalid:border-error", "data-focus-within:border-brand data-focus-within:ring-4 data-focus-within:ring-focus/25", "data-invalid:data-focus-within:border-error data-invalid:data-focus-within:ring-error/25", sizes[size]),
20
+ children: [
21
+ IconLeading && /* @__PURE__ */ jsx(IconLeading, {
22
+ "aria-hidden": "true",
23
+ className: "size-4 shrink-0 text-fg-tertiary"
24
+ }),
25
+ /* @__PURE__ */ jsx(Input, {
26
+ ref,
27
+ placeholder,
28
+ className: cx("min-w-0 flex-1 bg-transparent text-primary outline-none placeholder:text-placeholder", "disabled:cursor-not-allowed disabled:text-disabled", inputClassName)
29
+ }),
30
+ IconTrailing && /* @__PURE__ */ jsx(IconTrailing, {
31
+ "aria-hidden": "true",
32
+ className: "size-4 shrink-0 text-fg-tertiary"
33
+ })
34
+ ]
35
+ }),
36
+ hint && !errorMessage && /* @__PURE__ */ jsx(FieldHint, { children: hint }),
37
+ /* @__PURE__ */ jsx(FieldErrorMessage, { children: errorMessage })
38
+ ]
39
+ });
40
+ }
41
+ export { Input$1 as Input };
42
+
43
+ //# sourceMappingURL=Input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Input.js","names":["Input","AriaInput"],"sources":["../../../src/components/Input/Input.tsx"],"sourcesContent":["import type { ReactNode, Ref } from 'react';\nimport {\n Group,\n Input as AriaInput,\n TextField,\n composeRenderProps,\n type TextFieldProps,\n} from 'react-aria-components';\nimport { FieldErrorMessage, FieldHint, FieldLabel } from '../../internal/Field';\nimport type { IconComponent } from '../../internal/types';\nimport { cx } from '../../utils/cx';\n\nexport type InputSize = 'sm' | 'md';\n\nexport interface InputProps extends Omit<TextFieldProps, 'children'> {\n /** Visible label. If omitted, pass `aria-label` instead. */\n label?: ReactNode;\n /** Helper text below the field, linked with aria-describedby. */\n hint?: ReactNode;\n /** Error text. Setting it also marks the field invalid. */\n errorMessage?: string;\n placeholder?: string;\n size?: InputSize;\n iconLeading?: IconComponent;\n iconTrailing?: IconComponent;\n /** Class applied to the native input element. */\n inputClassName?: string;\n /** Ref to the native input element, not the wrapper. */\n ref?: Ref<HTMLInputElement>;\n}\n\nconst sizes: Record<InputSize, string> = {\n sm: 'h-control-sm text-sm',\n md: 'h-control-md text-md',\n};\n\nexport function Input({\n label,\n hint,\n errorMessage,\n placeholder,\n size = 'md',\n iconLeading: IconLeading,\n iconTrailing: IconTrailing,\n inputClassName,\n ref,\n className,\n isInvalid,\n ...props\n}: InputProps) {\n return (\n <TextField\n {...props}\n isInvalid={isInvalid ?? Boolean(errorMessage)}\n className={composeRenderProps(className, (consumer) => cx('flex flex-col gap-1.5', consumer))}\n >\n {label && <FieldLabel>{label}</FieldLabel>}\n <Group\n className={cx(\n 'flex items-center gap-2 rounded-md border border-control bg-primary px-3 shadow-xs transition-shadow',\n 'data-disabled:cursor-not-allowed data-disabled:border-disabled data-disabled:bg-disabled',\n 'data-invalid:border-error',\n 'data-focus-within:border-brand data-focus-within:ring-4 data-focus-within:ring-focus/25',\n 'data-invalid:data-focus-within:border-error data-invalid:data-focus-within:ring-error/25',\n sizes[size],\n )}\n >\n {IconLeading && (\n <IconLeading aria-hidden='true' className='size-4 shrink-0 text-fg-tertiary' />\n )}\n <AriaInput\n ref={ref}\n placeholder={placeholder}\n className={cx(\n 'min-w-0 flex-1 bg-transparent text-primary outline-none placeholder:text-placeholder',\n 'disabled:cursor-not-allowed disabled:text-disabled',\n inputClassName,\n )}\n />\n {IconTrailing && (\n <IconTrailing aria-hidden='true' className='size-4 shrink-0 text-fg-tertiary' />\n )}\n </Group>\n {hint && !errorMessage && <FieldHint>{hint}</FieldHint>}\n <FieldErrorMessage>{errorMessage}</FieldErrorMessage>\n </TextField>\n );\n}\n"],"mappings":";;;;;;AA+BA,IAAM,QAAmC;CACvC,IAAI;CACJ,IAAI;AACN;AAEA,SAAgBA,QAAM,EACpB,OACA,MACA,cACA,aACA,OAAO,MACP,aAAa,aACb,cAAc,cACd,gBACA,KACA,WACA,WACA,GAAG,SACU;CACb,OACE,qBAAC,WAAD;EACE,GAAI;EACJ,WAAW,aAAa,QAAQ,YAAY;EAC5C,WAAW,mBAAmB,YAAY,aAAa,GAAG,yBAAyB,QAAQ,CAAC;EAH9F,UAAA;GAKG,SAAS,oBAAC,YAAD,EAAA,UAAa,MAAkB,CAAA;GACzC,qBAAC,OAAD;IACE,WAAW,GACT,wGACA,4FACA,6BACA,2FACA,4FACA,MAAM,KACR;IARF,UAAA;KAUG,eACC,oBAAC,aAAD;MAAa,eAAY;MAAO,WAAU;KAAoC,CAAA;KAEhF,oBAACC,OAAD;MACO;MACQ;MACb,WAAW,GACT,wFACA,sDACA,cACF;KACD,CAAA;KACA,gBACC,oBAAC,cAAD;MAAc,eAAY;MAAO,WAAU;KAAoC,CAAA;IAE5E;;GACN,QAAQ,CAAC,gBAAgB,oBAAC,WAAD,EAAA,UAAY,KAAgB,CAAA;GACtD,oBAAC,mBAAD,EAAA,UAAoB,aAAgC,CAAA;EAC3C;;AAEf"}
@@ -0,0 +1,2 @@
1
+ export { Input } from './Input';
2
+ export type { InputProps, InputSize } from './Input';
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ export { Input } from "./Input.js";
@@ -0,0 +1,16 @@
1
+ import type { HTMLAttributes } from 'react';
2
+ export interface KbdProps extends HTMLAttributes<HTMLElement> {
3
+ /** Keys of a combination, such as ['⌘', 'K']. Each renders as its own key. */
4
+ keys?: string[];
5
+ /**
6
+ * Draw the keys as generated content instead of text and hide them from
7
+ * assistive technology. Use it for a shortcut hint inside a control, so the
8
+ * hint is not counted as the control's visible label (WCAG 2.5.3).
9
+ */
10
+ decorative?: boolean;
11
+ }
12
+ /**
13
+ * A keyboard key or combination. Pass `keys` for a combination: the keys are
14
+ * nested in an outer kbd, as the HTML spec describes for key sequences.
15
+ */
16
+ export declare function Kbd({ keys, decorative, children, className, ...props }: KbdProps): import("react").JSX.Element;