@nocoo/basalt 2.0.2 → 2.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 (300) hide show
  1. package/README.md +134 -15
  2. package/ai/COMPATIBILITY.md +180 -0
  3. package/ai/INTEGRATION.md +1760 -0
  4. package/ai/RECIPES.md +161 -0
  5. package/ai/USAGE.md +99 -0
  6. package/ai/registry.json +38099 -0
  7. package/ai/sources.json +10 -0
  8. package/dist/assets/brand-mark.d.ts +1 -0
  9. package/dist/assets/brand-mark.js +7 -0
  10. package/dist/assets/brand-mark.js.map +1 -0
  11. package/dist/charts/area.d.ts +58 -5
  12. package/dist/charts/area.js +20 -12
  13. package/dist/charts/area.js.map +1 -1
  14. package/dist/charts/bar.d.ts +54 -5
  15. package/dist/charts/bar.js +16 -10
  16. package/dist/charts/bar.js.map +1 -1
  17. package/dist/charts/bullet.d.ts +18 -1
  18. package/dist/charts/bullet.js +6 -3
  19. package/dist/charts/bullet.js.map +1 -1
  20. package/dist/charts/charts.d.ts +58 -5
  21. package/dist/charts/charts.js +13 -2
  22. package/dist/charts/charts.js.map +1 -1
  23. package/dist/charts/config.d.ts +7 -0
  24. package/dist/charts/config.js +5 -1
  25. package/dist/charts/config.js.map +1 -1
  26. package/dist/charts/custom-chart.d.ts +58 -5
  27. package/dist/charts/custom-chart.js +13 -2
  28. package/dist/charts/custom-chart.js.map +1 -1
  29. package/dist/charts/donut.d.ts +18 -1
  30. package/dist/charts/donut.js +6 -3
  31. package/dist/charts/donut.js.map +1 -1
  32. package/dist/charts/frame.d.ts +40 -3
  33. package/dist/charts/frame.js +55 -28
  34. package/dist/charts/frame.js.map +1 -1
  35. package/dist/charts/funnel.d.ts +18 -1
  36. package/dist/charts/funnel.js +5 -1
  37. package/dist/charts/funnel.js.map +1 -1
  38. package/dist/charts/gauge.d.ts +18 -1
  39. package/dist/charts/gauge.js +38 -20
  40. package/dist/charts/gauge.js.map +1 -1
  41. package/dist/charts/grouped-bar.d.ts +54 -5
  42. package/dist/charts/grouped-bar.js +16 -10
  43. package/dist/charts/grouped-bar.js.map +1 -1
  44. package/dist/charts/heatmap-calendar.d.ts +61 -0
  45. package/dist/charts/heatmap-calendar.js +287 -96
  46. package/dist/charts/heatmap-calendar.js.map +1 -1
  47. package/dist/charts/heatmap-matrix.d.ts +99 -0
  48. package/dist/charts/heatmap-matrix.js +249 -0
  49. package/dist/charts/heatmap-matrix.js.map +1 -0
  50. package/dist/charts/line.d.ts +66 -5
  51. package/dist/charts/line.js +37 -30
  52. package/dist/charts/line.js.map +1 -1
  53. package/dist/charts/palette.d.ts +1 -0
  54. package/dist/charts/palette.js +7 -1
  55. package/dist/charts/palette.js.map +1 -1
  56. package/dist/charts/radar.d.ts +18 -1
  57. package/dist/charts/radar.js +26 -19
  58. package/dist/charts/radar.js.map +1 -1
  59. package/dist/charts/sankey.d.ts +18 -1
  60. package/dist/charts/sankey.js +4 -1
  61. package/dist/charts/sankey.js.map +1 -1
  62. package/dist/charts/series.d.ts +5 -7
  63. package/dist/charts/series.js.map +1 -1
  64. package/dist/charts/slot-bar.d.ts +38 -6
  65. package/dist/charts/slot-bar.js +5 -2
  66. package/dist/charts/slot-bar.js.map +1 -1
  67. package/dist/charts/sparkline.d.ts +35 -5
  68. package/dist/charts/sparkline.js +22 -18
  69. package/dist/charts/sparkline.js.map +1 -1
  70. package/dist/charts/stacked-bar.d.ts +58 -5
  71. package/dist/charts/stacked-bar.js +19 -12
  72. package/dist/charts/stacked-bar.js.map +1 -1
  73. package/dist/charts/stat-card.d.ts +51 -1
  74. package/dist/charts/stat-card.js +66 -39
  75. package/dist/charts/stat-card.js.map +1 -1
  76. package/dist/charts/timeline.d.ts +3 -0
  77. package/dist/charts/timeline.js +4 -3
  78. package/dist/charts/timeline.js.map +1 -1
  79. package/dist/charts/timeseries.d.ts +58 -5
  80. package/dist/charts/timeseries.js +13 -2
  81. package/dist/charts/timeseries.js.map +1 -1
  82. package/dist/charts/tooltip.d.ts +57 -0
  83. package/dist/charts/tooltip.js +119 -2
  84. package/dist/charts/tooltip.js.map +1 -1
  85. package/dist/components/accordion.d.ts +117 -2
  86. package/dist/components/accordion.js +20 -13
  87. package/dist/components/accordion.js.map +1 -1
  88. package/dist/components/alert-dialog.d.ts +131 -13
  89. package/dist/components/alert-dialog.js +13 -10
  90. package/dist/components/alert-dialog.js.map +1 -1
  91. package/dist/components/app-header.js +18 -17
  92. package/dist/components/app-header.js.map +1 -1
  93. package/dist/components/app-shell.js +15 -14
  94. package/dist/components/app-shell.js.map +1 -1
  95. package/dist/components/autocomplete.d.ts +4 -0
  96. package/dist/components/autocomplete.js.map +1 -1
  97. package/dist/components/avatar.d.ts +76 -3
  98. package/dist/components/avatar.js.map +1 -1
  99. package/dist/components/badge.d.ts +15 -1
  100. package/dist/components/badge.js +17 -16
  101. package/dist/components/badge.js.map +1 -1
  102. package/dist/components/banner.d.ts +88 -2
  103. package/dist/components/banner.js +41 -40
  104. package/dist/components/banner.js.map +1 -1
  105. package/dist/components/basalt-mark.js +14 -8
  106. package/dist/components/basalt-mark.js.map +1 -1
  107. package/dist/components/battery-meter.d.ts +10 -0
  108. package/dist/components/battery-meter.js +56 -0
  109. package/dist/components/battery-meter.js.map +1 -0
  110. package/dist/components/breadcrumbs.d.ts +27 -7
  111. package/dist/components/breadcrumbs.js +21 -20
  112. package/dist/components/breadcrumbs.js.map +1 -1
  113. package/dist/components/button.d.ts +48 -2
  114. package/dist/components/button.js +87 -36
  115. package/dist/components/button.js.map +1 -1
  116. package/dist/components/chat-bubble.d.ts +24 -0
  117. package/dist/components/chat-bubble.js +26 -0
  118. package/dist/components/chat-bubble.js.map +1 -0
  119. package/dist/components/chat-composer.d.ts +45 -0
  120. package/dist/components/chat-composer.js +74 -0
  121. package/dist/components/chat-composer.js.map +1 -0
  122. package/dist/components/chat-header.d.ts +25 -0
  123. package/dist/components/chat-header.js +34 -0
  124. package/dist/components/chat-header.js.map +1 -0
  125. package/dist/components/chat-inbox.d.ts +33 -0
  126. package/dist/components/chat-inbox.js +44 -0
  127. package/dist/components/chat-inbox.js.map +1 -0
  128. package/dist/components/checkbox.js +84 -53
  129. package/dist/components/checkbox.js.map +1 -1
  130. package/dist/components/clipboard-text.d.ts +13 -2
  131. package/dist/components/clipboard-text.js +4 -4
  132. package/dist/components/clipboard-text.js.map +1 -1
  133. package/dist/components/collapsible.d.ts +58 -15
  134. package/dist/components/collapsible.js.map +1 -1
  135. package/dist/components/command-palette.d.ts +151 -61
  136. package/dist/components/command-palette.js.map +1 -1
  137. package/dist/components/confirm-dialog.d.ts +1 -1
  138. package/dist/components/confirm-dialog.js +6 -4
  139. package/dist/components/confirm-dialog.js.map +1 -1
  140. package/dist/components/context-menu.d.ts +210 -2
  141. package/dist/components/context-menu.js +7 -4
  142. package/dist/components/context-menu.js.map +1 -1
  143. package/dist/components/data-table.d.ts +40 -2
  144. package/dist/components/data-table.js +168 -120
  145. package/dist/components/data-table.js.map +1 -1
  146. package/dist/components/date-picker.d.ts +53 -2
  147. package/dist/components/date-picker.js +387 -219
  148. package/dist/components/date-picker.js.map +1 -1
  149. package/dist/components/delete-resource.d.ts +7 -1
  150. package/dist/components/delete-resource.js +22 -18
  151. package/dist/components/delete-resource.js.map +1 -1
  152. package/dist/components/description-list.js +16 -15
  153. package/dist/components/description-list.js.map +1 -1
  154. package/dist/components/dialog.d.ts +141 -12
  155. package/dist/components/dialog.js +43 -39
  156. package/dist/components/dialog.js.map +1 -1
  157. package/dist/components/dock.d.ts +39 -0
  158. package/dist/components/dock.js +97 -0
  159. package/dist/components/dock.js.map +1 -0
  160. package/dist/components/dropdown-menu.d.ts +229 -15
  161. package/dist/components/dropdown-menu.js +9 -6
  162. package/dist/components/dropdown-menu.js.map +1 -1
  163. package/dist/components/editable-nav-item.d.ts +33 -0
  164. package/dist/components/editable-nav-item.js +90 -0
  165. package/dist/components/editable-nav-item.js.map +1 -0
  166. package/dist/components/empty.d.ts +22 -2
  167. package/dist/components/empty.js +22 -13
  168. package/dist/components/empty.js.map +1 -1
  169. package/dist/components/fab.d.ts +23 -0
  170. package/dist/components/fab.js +25 -0
  171. package/dist/components/fab.js.map +1 -0
  172. package/dist/components/field.js +31 -30
  173. package/dist/components/field.js.map +1 -1
  174. package/dist/components/file-dropzone.d.ts +37 -0
  175. package/dist/components/file-dropzone.js +103 -0
  176. package/dist/components/file-dropzone.js.map +1 -0
  177. package/dist/components/filter-bar.d.ts +34 -0
  178. package/dist/components/filter-bar.js +52 -0
  179. package/dist/components/filter-bar.js.map +1 -0
  180. package/dist/components/flow.js +19 -18
  181. package/dist/components/flow.js.map +1 -1
  182. package/dist/components/grid.d.ts +3 -1
  183. package/dist/components/grid.js.map +1 -1
  184. package/dist/components/hover-card.d.ts +111 -1
  185. package/dist/components/hover-card.js +9 -6
  186. package/dist/components/hover-card.js.map +1 -1
  187. package/dist/components/icon-picker.d.ts +34 -0
  188. package/dist/components/icon-picker.js +77 -0
  189. package/dist/components/icon-picker.js.map +1 -0
  190. package/dist/components/inline-editable.d.ts +46 -0
  191. package/dist/components/inline-editable.js +124 -0
  192. package/dist/components/inline-editable.js.map +1 -0
  193. package/dist/components/input-area.js +3 -3
  194. package/dist/components/input-group.js +7 -7
  195. package/dist/components/input.js +3 -3
  196. package/dist/components/label.js +18 -17
  197. package/dist/components/label.js.map +1 -1
  198. package/dist/components/layer-card.d.ts +10 -2
  199. package/dist/components/layer-card.js +71 -68
  200. package/dist/components/layer-card.js.map +1 -1
  201. package/dist/components/loader.d.ts +10 -2
  202. package/dist/components/loader.js.map +1 -1
  203. package/dist/components/menu-bar.d.ts +174 -6
  204. package/dist/components/menu-bar.js +33 -29
  205. package/dist/components/menu-bar.js.map +1 -1
  206. package/dist/components/meter.d.ts +27 -2
  207. package/dist/components/meter.js.map +1 -1
  208. package/dist/components/multi-select.d.ts +64 -0
  209. package/dist/components/multi-select.js +218 -0
  210. package/dist/components/multi-select.js.map +1 -0
  211. package/dist/components/navigation-menu.d.ts +88 -5
  212. package/dist/components/navigation-menu.js.map +1 -1
  213. package/dist/components/overlay.js +6 -5
  214. package/dist/components/overlay.js.map +1 -1
  215. package/dist/components/page-header.js +23 -21
  216. package/dist/components/page-header.js.map +1 -1
  217. package/dist/components/pagination.js +7 -7
  218. package/dist/components/popover.d.ts +136 -16
  219. package/dist/components/popover.js +32 -28
  220. package/dist/components/popover.js.map +1 -1
  221. package/dist/components/radio.js +38 -37
  222. package/dist/components/radio.js.map +1 -1
  223. package/dist/components/resource-list.d.ts +26 -1
  224. package/dist/components/resource-list.js +28 -15
  225. package/dist/components/resource-list.js.map +1 -1
  226. package/dist/components/responsive-master-detail.d.ts +27 -0
  227. package/dist/components/responsive-master-detail.js +85 -0
  228. package/dist/components/responsive-master-detail.js.map +1 -0
  229. package/dist/components/section-rule.js +23 -22
  230. package/dist/components/section-rule.js.map +1 -1
  231. package/dist/components/select.d.ts +27 -3
  232. package/dist/components/select.js +11 -11
  233. package/dist/components/select.js.map +1 -1
  234. package/dist/components/sheet.d.ts +115 -11
  235. package/dist/components/sheet.js +37 -30
  236. package/dist/components/sheet.js.map +1 -1
  237. package/dist/components/sidebar.d.ts +109 -17
  238. package/dist/components/sidebar.js +109 -108
  239. package/dist/components/sidebar.js.map +1 -1
  240. package/dist/components/skeleton-line.d.ts +22 -2
  241. package/dist/components/skeleton-line.js.map +1 -1
  242. package/dist/components/slider.d.ts +61 -1
  243. package/dist/components/slider.js +31 -15
  244. package/dist/components/slider.js.map +1 -1
  245. package/dist/components/stat-strip.js +16 -15
  246. package/dist/components/stat-strip.js.map +1 -1
  247. package/dist/components/switch.js +78 -47
  248. package/dist/components/switch.js.map +1 -1
  249. package/dist/components/table-of-contents.js +18 -17
  250. package/dist/components/table-of-contents.js.map +1 -1
  251. package/dist/components/table-pager.js +20 -19
  252. package/dist/components/table-pager.js.map +1 -1
  253. package/dist/components/table.d.ts +9 -3
  254. package/dist/components/table.js +19 -18
  255. package/dist/components/table.js.map +1 -1
  256. package/dist/components/tabs.js +29 -22
  257. package/dist/components/tabs.js.map +1 -1
  258. package/dist/components/tag-badge.d.ts +58 -0
  259. package/dist/components/tag-badge.js +72 -0
  260. package/dist/components/tag-badge.js.map +1 -0
  261. package/dist/components/tag-color-picker.d.ts +20 -0
  262. package/dist/components/tag-color-picker.js +42 -0
  263. package/dist/components/tag-color-picker.js.map +1 -0
  264. package/dist/components/text.js +17 -16
  265. package/dist/components/text.js.map +1 -1
  266. package/dist/components/toast.d.ts +173 -3
  267. package/dist/components/toast.js +1 -1
  268. package/dist/components/toast.js.map +1 -1
  269. package/dist/components/toggle-group.d.ts +88 -2
  270. package/dist/components/toggle-group.js +32 -31
  271. package/dist/components/toggle-group.js.map +1 -1
  272. package/dist/components/toggle.d.ts +35 -2
  273. package/dist/components/toggle.js +12 -11
  274. package/dist/components/toggle.js.map +1 -1
  275. package/dist/components/tooltip.d.ts +144 -6
  276. package/dist/components/tooltip.js +9 -6
  277. package/dist/components/tooltip.js.map +1 -1
  278. package/dist/components/typeahead-field.js +193 -132
  279. package/dist/components/typeahead-field.js.map +1 -1
  280. package/dist/components/upload-queue.d.ts +51 -0
  281. package/dist/components/upload-queue.js +116 -0
  282. package/dist/components/upload-queue.js.map +1 -0
  283. package/dist/providers/accent.d.ts +46 -2
  284. package/dist/providers/accent.js +358 -172
  285. package/dist/providers/accent.js.map +1 -1
  286. package/dist/providers/link.d.ts +14 -4
  287. package/dist/providers/link.js.map +1 -1
  288. package/dist/providers/theme.d.ts +38 -2
  289. package/dist/providers/theme.js +160 -27
  290. package/dist/providers/theme.js.map +1 -1
  291. package/dist/styles/base.css +83 -0
  292. package/dist/styles/standalone.css +820 -120
  293. package/dist/styles/tailwind.css +21 -7
  294. package/dist/styles/tokens.css +146 -91
  295. package/dist/utils/control-surface.d.ts +2 -1
  296. package/dist/utils/control-surface.js +4 -4
  297. package/dist/utils/control-surface.js.map +1 -1
  298. package/dist/utils/selection-indicator.js +2 -2
  299. package/dist/utils/selection-indicator.js.map +1 -1
  300. package/package.json +8 -4
@@ -1 +1 @@
1
- {"version":3,"file":"popover.js","names":[],"sources":["../../src/components/popover.tsx"],"sourcesContent":["import * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { MENU_GAP, OVERLAY_LAYER, OVERLAY_MOTION } from \"./overlay\";\n\nexport const POPOVER_SIDES = [\"top\", \"bottom\", \"left\", \"right\"] as const;\nexport type PopoverSide = (typeof POPOVER_SIDES)[number];\n\nexport type PopoverProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>,\n\t\"open\" | \"defaultOpen\" | \"onOpenChange\"\n> & {\n\t/**\n\t * The controlled open state.\n\t */\n\topen?: boolean;\n\t/**\n\t * The uncontrolled initial open state.\n\t * @default false\n\t */\n\tdefaultOpen?: boolean;\n\t/**\n\t * Called when the open state changes.\n\t */\n\tonOpenChange?: (open: boolean) => void;\n};\nexport const Popover: React.FC<PopoverProps> = PopoverPrimitive.Root;\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\nexport const PopoverClose = PopoverPrimitive.Close;\n\nexport type PopoverContentProps = React.ComponentPropsWithoutRef<\n\ttypeof PopoverPrimitive.Content\n> & {\n\t/**\n\t * Show the pointing arrow.\n\t * @default true\n\t */\n\tarrow?: boolean;\n};\n\nexport const PopoverContent = React.forwardRef<\n\tReact.ElementRef<typeof PopoverPrimitive.Content>,\n\tPopoverContentProps\n>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\talign = \"center\",\n\t\t\tside = \"bottom\",\n\t\t\tsideOffset = MENU_GAP,\n\t\t\tarrow = true,\n\t\t\tchildren,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<PopoverPrimitive.Portal>\n\t\t\t<PopoverPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\talign={align}\n\t\t\t\tside={side}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={cn(\n\t\t\t\t\tOVERLAY_LAYER,\n\t\t\t\t\tOVERLAY_MOTION,\n\t\t\t\t\t\"rounded-basalt-md border border-basalt-border bg-basalt-popover px-4 py-3 text-sm text-basalt-popover-foreground shadow-md outline-hidden\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t\t{arrow ? (\n\t\t\t\t\t<PopoverPrimitive.Arrow asChild width={20} height={10}>\n\t\t\t\t\t\t<ArrowSvg />\n\t\t\t\t\t</PopoverPrimitive.Arrow>\n\t\t\t\t) : null}\n\t\t\t</PopoverPrimitive.Content>\n\t\t</PopoverPrimitive.Portal>\n\t),\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport const PopoverTitle = React.forwardRef<\n\tHTMLHeadingElement,\n\tReact.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n\t<h2\n\t\tref={ref}\n\t\tclassName={cn(\"m-0 text-base font-medium leading-6 text-basalt-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nPopoverTitle.displayName = \"PopoverTitle\";\n\nexport const PopoverDescription = React.forwardRef<\n\tHTMLParagraphElement,\n\tReact.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n\t<p\n\t\tref={ref}\n\t\tclassName={cn(\"m-0 text-base leading-6 text-basalt-muted-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nPopoverDescription.displayName = \"PopoverDescription\";\n\nfunction ArrowSvg(props: React.ComponentProps<\"svg\">) {\n\treturn (\n\t\t<svg width={20} height={10} aria-hidden {...props}>\n\t\t\t<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 20 10\" preserveAspectRatio=\"none\" aria-hidden>\n\t\t\t\t<path\n\t\t\t\t\td=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n\t\t\t\t\tclassName=\"fill-basalt-popover\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\"\n\t\t\t\t\tclassName=\"fill-basalt-border\"\n\t\t\t\t/>\n\t\t\t</svg>\n\t\t</svg>\n\t);\n}\n"],"mappings":";;;;;;;AAKA,IAAa,IAAgB;CAAC;CAAO;CAAU;CAAQ;AAAO,GAqBjD,IAAkC,EAAiB,MACnD,IAAiB,EAAiB,SAClC,IAAe,EAAiB,OAYhC,IAAiB,EAAM,YAKlC,EACC,cACA,WAAQ,UACR,UAAO,UACP,gBAAA,GACA,WAAQ,IACR,aACA,GAAG,KAEJ,MAEA,kBAAC,EAAiB,QAAlB,EAAA,UACC,kBAAC,EAAiB,SAAlB;CACM;CACE;CACD;CACM;CACZ,WAAW,EACV,GACA,GACA,6IACA,CACD;CACA,GAAI;CAXL,UAAA,CAaE,GACA,IACA,kBAAC,EAAiB,OAAlB;EAAwB,SAAA;EAAQ,OAAO;EAAI,QAAQ;EAClD,UAAA,kBAAC,GAAD,CAAW,CAAA;CACY,CAAA,IACrB,IACqB;AACF,CAAA,EAAA,CAAA,CAE3B;AACA,EAAe,cAAc,EAAiB,QAAQ;AAEtD,IAAa,IAAe,EAAM,YAG/B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,MAAD;CACM;CACL,WAAW,EAAG,8DAA8D,CAAS;CACrF,GAAI;AACJ,CAAA,CACD;AACD,EAAa,cAAc;AAE3B,IAAa,IAAqB,EAAM,YAGrC,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,KAAD;CACM;CACL,WAAW,EAAG,wDAAwD,CAAS;CAC/E,GAAI;AACJ,CAAA,CACD;AACD,EAAmB,cAAc;AAEjC,SAAS,EAAS,GAAoC;CACrD,OACC,kBAAC,OAAD;EAAK,OAAO;EAAI,QAAQ;EAAI,eAAA;EAAY,GAAI;EAC3C,UAAA,kBAAC,OAAD;GAAK,OAAM;GAAO,QAAO;GAAO,SAAQ;GAAY,qBAAoB;GAAO,eAAA;GAA/E,UAAA,CACC,kBAAC,QAAD;IACC,GAAE;IACF,WAAU;GACV,CAAA,GACD,kBAAC,QAAD;IACC,GAAE;IACF,WAAU;GACV,CAAA,CACG;;CACD,CAAA;AAEP"}
1
+ {"version":3,"file":"popover.js","names":[],"sources":["../../src/components/popover.tsx"],"sourcesContent":["import * as PopoverPrimitive from \"@radix-ui/react-popover\";\nimport { Slottable } from \"@radix-ui/react-slot\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { MENU_GAP, OVERLAY_LAYER, OVERLAY_MOTION } from \"./overlay\";\n\nexport const POPOVER_SIDES = [\"top\", \"bottom\", \"left\", \"right\"] as const;\nexport type PopoverSide = (typeof POPOVER_SIDES)[number];\n\ntype RadixPopoverProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Root>;\ntype RadixPopoverTriggerProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Trigger>;\ntype RadixPopoverCloseProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Close>;\ntype RadixPopoverContentProps = React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>;\n\nexport interface PopoverProps\n\textends Omit<RadixPopoverProps, \"children\" | \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"modal\"> {\n\t/**\n\t * Popover structure elements, typically PopoverTrigger and PopoverContent.\n\t */\n\tchildren?: React.ReactNode;\n\t/**\n\t * Controlled open state of the popover.\n\t */\n\topen?: RadixPopoverProps[\"open\"];\n\t/**\n\t * Uncontrolled initial open state of the popover.\n\t * @default false\n\t */\n\tdefaultOpen?: RadixPopoverProps[\"defaultOpen\"];\n\t/**\n\t * Callback called when the open state changes.\n\t */\n\tonOpenChange?: RadixPopoverProps[\"onOpenChange\"];\n\t/**\n\t * Whether the popover renders modally, preventing outside interaction and hiding background content from screen readers.\n\t * @default false\n\t */\n\tmodal?: RadixPopoverProps[\"modal\"];\n}\n\nexport const Popover: React.FC<PopoverProps> = PopoverPrimitive.Root;\n\nexport interface PopoverTriggerProps extends Omit<RadixPopoverTriggerProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * PopoverTrigger forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixPopoverTriggerProps[\"asChild\"];\n}\n\nexport const PopoverTrigger = PopoverPrimitive.Trigger;\n\nexport interface PopoverCloseProps extends Omit<RadixPopoverCloseProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * PopoverClose forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixPopoverCloseProps[\"asChild\"];\n}\n\nexport const PopoverClose = PopoverPrimitive.Close;\n\nexport interface PopoverContentProps\n\textends Omit<\n\t\tRadixPopoverContentProps,\n\t\t| \"side\"\n\t\t| \"sideOffset\"\n\t\t| \"align\"\n\t\t| \"alignOffset\"\n\t\t| \"avoidCollisions\"\n\t\t| \"collisionBoundary\"\n\t\t| \"collisionPadding\"\n\t\t| \"arrowPadding\"\n\t\t| \"sticky\"\n\t\t| \"hideWhenDetached\"\n\t\t| \"updatePositionStrategy\"\n\t\t| \"forceMount\"\n\t\t| \"asChild\"\n\t\t| \"onOpenAutoFocus\"\n\t\t| \"onCloseAutoFocus\"\n\t\t| \"onEscapeKeyDown\"\n\t\t| \"onPointerDownOutside\"\n\t\t| \"onFocusOutside\"\n\t\t| \"onInteractOutside\"\n\t> {\n\t/**\n\t * Preferred placement side relative to trigger.\n\t * @default \"bottom\"\n\t */\n\tside?: RadixPopoverContentProps[\"side\"];\n\t/**\n\t * Distance in pixels between trigger and floating content panel.\n\t * @default 8\n\t */\n\tsideOffset?: RadixPopoverContentProps[\"sideOffset\"];\n\t/**\n\t * Preferred alignment along the side axis.\n\t * @default \"center\"\n\t */\n\talign?: RadixPopoverContentProps[\"align\"];\n\t/**\n\t * Offset in pixels from the start or end alignment position.\n\t * @default 0\n\t */\n\talignOffset?: RadixPopoverContentProps[\"alignOffset\"];\n\t/**\n\t * Whether to reposition content to avoid viewport boundary collisions.\n\t * @default true\n\t */\n\tavoidCollisions?: RadixPopoverContentProps[\"avoidCollisions\"];\n\t/**\n\t * Element or elements bounding boundary collision calculations.\n\t * @default []\n\t */\n\tcollisionBoundary?: RadixPopoverContentProps[\"collisionBoundary\"];\n\t/**\n\t * Virtual padding from collision boundaries in pixels.\n\t * @default 0\n\t */\n\tcollisionPadding?: RadixPopoverContentProps[\"collisionPadding\"];\n\t/**\n\t * Padding in pixels between popper arrow and floating panel edge.\n\t * @default 0\n\t */\n\tarrowPadding?: RadixPopoverContentProps[\"arrowPadding\"];\n\t/**\n\t * Sticky positioning behavior along the align axis when overflowing.\n\t * @default \"partial\"\n\t */\n\tsticky?: RadixPopoverContentProps[\"sticky\"];\n\t/**\n\t * Whether to hide content completely when trigger is fully occluded.\n\t * @default false\n\t */\n\thideWhenDetached?: RadixPopoverContentProps[\"hideWhenDetached\"];\n\t/**\n\t * Strategy used to calculate and update popper position.\n\t * @default \"optimized\"\n\t */\n\tupdatePositionStrategy?: RadixPopoverContentProps[\"updatePositionStrategy\"];\n\t/**\n\t * Force mounting content in DOM for external animation controls.\n\t * When forceMount is true, the content remains mounted even when closed.\n\t * The caller is responsible for visibility transitions and unmounting after animation completes.\n\t * Note: Keeping modal content forceMounted may isolate background interactions until unmounted.\n\t */\n\tforceMount?: true;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * PopoverContent forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixPopoverContentProps[\"asChild\"];\n\t/**\n\t * Callback fired when auto-focusing on open. Can be prevented.\n\t */\n\tonOpenAutoFocus?: RadixPopoverContentProps[\"onOpenAutoFocus\"];\n\t/**\n\t * Callback fired when auto-focusing on close. Can be prevented.\n\t */\n\tonCloseAutoFocus?: RadixPopoverContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Callback fired when the Escape key is down on the dismissable layer. Can be prevented.\n\t */\n\tonEscapeKeyDown?: RadixPopoverContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Callback fired when a pointerdown event happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonPointerDownOutside?: RadixPopoverContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Callback fired when focus moves outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonFocusOutside?: RadixPopoverContentProps[\"onFocusOutside\"];\n\t/**\n\t * Callback fired when an interaction (pointerdown or focus) happens outside the bounds of the dismissable layer. Can be prevented.\n\t */\n\tonInteractOutside?: RadixPopoverContentProps[\"onInteractOutside\"];\n\t/**\n\t * Show the pointing arrow.\n\t * @default true\n\t */\n\tarrow?: boolean;\n}\n\nexport const PopoverContent = React.forwardRef<\n\tReact.ElementRef<typeof PopoverPrimitive.Content>,\n\tPopoverContentProps\n>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\talign = \"center\",\n\t\t\tside = \"bottom\",\n\t\t\tsideOffset = MENU_GAP,\n\t\t\tarrow = true,\n\t\t\tchildren,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => (\n\t\t<PopoverPrimitive.Portal forceMount={props.forceMount}>\n\t\t\t<PopoverPrimitive.Content\n\t\t\t\tref={ref}\n\t\t\t\talign={align}\n\t\t\t\tside={side}\n\t\t\t\tsideOffset={sideOffset}\n\t\t\t\tclassName={cn(\n\t\t\t\t\tOVERLAY_LAYER,\n\t\t\t\t\tOVERLAY_MOTION,\n\t\t\t\t\t\"rounded-basalt-md border border-basalt-border bg-basalt-popover px-4 py-3 text-sm text-basalt-popover-foreground shadow-md outline-hidden\",\n\t\t\t\t\tclassName,\n\t\t\t\t)}\n\t\t\t\t{...props}\n\t\t\t>\n\t\t\t\t<Slottable>{children}</Slottable>\n\t\t\t\t{arrow ? (\n\t\t\t\t\t<PopoverPrimitive.Arrow asChild width={20} height={10}>\n\t\t\t\t\t\t<ArrowSvg />\n\t\t\t\t\t</PopoverPrimitive.Arrow>\n\t\t\t\t) : null}\n\t\t\t</PopoverPrimitive.Content>\n\t\t</PopoverPrimitive.Portal>\n\t),\n);\nPopoverContent.displayName = PopoverPrimitive.Content.displayName;\n\nexport interface PopoverTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {}\n\nexport const PopoverTitle = React.forwardRef<HTMLHeadingElement, PopoverTitleProps>(\n\t({ className, ...props }, ref) => (\n\t\t<h2\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"m-0 text-base font-medium leading-6 text-basalt-foreground\", className)}\n\t\t\t{...props}\n\t\t/>\n\t),\n);\nPopoverTitle.displayName = \"PopoverTitle\";\n\nexport interface PopoverDescriptionProps extends React.HTMLAttributes<HTMLParagraphElement> {}\n\nexport const PopoverDescription = React.forwardRef<HTMLParagraphElement, PopoverDescriptionProps>(\n\t({ className, ...props }, ref) => (\n\t\t<p\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"m-0 text-base leading-6 text-basalt-muted-foreground\", className)}\n\t\t\t{...props}\n\t\t/>\n\t),\n);\nPopoverDescription.displayName = \"PopoverDescription\";\n\nfunction ArrowSvg(props: React.ComponentProps<\"svg\">) {\n\treturn (\n\t\t<svg width={20} height={10} aria-hidden {...props}>\n\t\t\t<svg width=\"100%\" height=\"100%\" viewBox=\"0 0 20 10\" preserveAspectRatio=\"none\" aria-hidden>\n\t\t\t\t<path\n\t\t\t\t\td=\"M9.66437 2.60207L4.80758 6.97318C4.07308 7.63423 3.11989 8 2.13172 8H0V10H20V8H18.5349C17.5468 8 16.5936 7.63423 15.8591 6.97318L11.0023 2.60207C10.622 2.2598 10.0447 2.25979 9.66437 2.60207Z\"\n\t\t\t\t\tclassName=\"fill-basalt-popover\"\n\t\t\t\t/>\n\t\t\t\t<path\n\t\t\t\t\td=\"M8.99542 1.85876C9.75604 1.17425 10.9106 1.17422 11.6713 1.85878L16.5281 6.22989C17.0789 6.72568 17.7938 7.00001 18.5349 7.00001L15.89 7L11.0023 2.60207C10.622 2.2598 10.0447 2.2598 9.66436 2.60207L4.77734 7L2.13171 7.00001C2.87284 7.00001 3.58774 6.72568 4.13861 6.22989L8.99542 1.85876Z\"\n\t\t\t\t\tclassName=\"fill-basalt-border\"\n\t\t\t\t/>\n\t\t\t</svg>\n\t\t</svg>\n\t);\n}\n"],"mappings":";;;;;;;;AAMA,IAAa,IAAgB;CAAC;CAAO;CAAU;CAAQ;AAAO,GAkCjD,IAAkC,EAAiB,MAWnD,IAAiB,EAAiB,SAWlC,IAAe,EAAiB,OA4HhC,IAAiB,EAAM,YAKlC,EACC,cACA,WAAQ,UACR,UAAO,UACP,gBAAA,GACA,WAAQ,IACR,aACA,GAAG,KAEJ,MAEA,kBAAC,EAAiB,QAAlB;CAAyB,YAAY,EAAM;CAC1C,UAAA,kBAAC,EAAiB,SAAlB;EACM;EACE;EACD;EACM;EACZ,WAAW,EACV,GACA,GACA,6IACA,CACD;EACA,GAAI;EAXL,UAAA,CAaC,kBAAC,GAAD,EAAY,YAAoB,CAAA,GAC/B,IACA,kBAAC,EAAiB,OAAlB;GAAwB,SAAA;GAAQ,OAAO;GAAI,QAAQ;GAClD,UAAA,kBAAC,GAAD,CAAW,CAAA;EACY,CAAA,IACrB,IACqB;;AACF,CAAA,CAE3B;AACA,EAAe,cAAc,EAAiB,QAAQ;AAItD,IAAa,IAAe,EAAM,YAChC,EAAE,cAAW,GAAG,KAAS,MACzB,kBAAC,MAAD;CACM;CACL,WAAW,EAAG,8DAA8D,CAAS;CACrF,GAAI;AACJ,CAAA,CAEH;AACA,EAAa,cAAc;AAI3B,IAAa,IAAqB,EAAM,YACtC,EAAE,cAAW,GAAG,KAAS,MACzB,kBAAC,KAAD;CACM;CACL,WAAW,EAAG,wDAAwD,CAAS;CAC/E,GAAI;AACJ,CAAA,CAEH;AACA,EAAmB,cAAc;AAEjC,SAAS,EAAS,GAAoC;CACrD,OACC,kBAAC,OAAD;EAAK,OAAO;EAAI,QAAQ;EAAI,eAAA;EAAY,GAAI;EAC3C,UAAA,kBAAC,OAAD;GAAK,OAAM;GAAO,QAAO;GAAO,SAAQ;GAAY,qBAAoB;GAAO,eAAA;GAA/E,UAAA,CACC,kBAAC,QAAD;IACC,GAAE;IACF,WAAU;GACV,CAAA,GACD,kBAAC,QAAD;IACC,GAAE;IACF,WAAU;GACV,CAAA,CACG;;CACD,CAAA;AAEP"}
@@ -1,47 +1,48 @@
1
1
  "use client";
2
2
  import { cn as e } from "../utils/cn.js";
3
- import { FOCUS_RING as t } from "./overlay.js";
4
- import * as n from "react";
5
- import { Circle as r } from "lucide-react";
6
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
7
- import * as o from "@radix-ui/react-radio-group";
3
+ import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
4
+ import { FOCUS_RING as n } from "./overlay.js";
5
+ import * as r from "react";
6
+ import { Circle as i } from "lucide-react";
7
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
8
+ import * as s from "@radix-ui/react-radio-group";
8
9
  //#region src/components/radio.tsx
9
- var s = {
10
+ var c = {
10
11
  sm: "h-3 w-3",
11
12
  default: "h-4 w-4"
12
- }, c = {
13
+ }, l = {
13
14
  sm: "h-1.5 w-1.5 fill-current text-current",
14
15
  default: "h-2.5 w-2.5 fill-current text-current"
15
- }, l = n.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i("legend", {
16
+ }, u = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a("legend", {
16
17
  ref: r,
17
18
  className: e("text-sm font-medium text-basalt-foreground", t),
18
19
  ...n
19
20
  }));
20
- l.displayName = "Radio.Legend";
21
- var u = n.forwardRef(({ className: t, error: r, disabled: s = !1, children: c, "aria-describedby": u, "aria-invalid": d, "aria-labelledby": f, ...p }, m) => {
22
- let h = n.useId(), g = !!r, _ = `${h}-error`, v = `${h}-legend`, y = [], b = [];
23
- n.Children.forEach(c, (e) => {
24
- if (n.isValidElement(e) && e.type === l) {
21
+ u.displayName = "Radio.Legend";
22
+ var d = r.forwardRef(({ className: t, error: n, disabled: i = !1, children: c, "aria-describedby": l, "aria-invalid": d, "aria-labelledby": f, ...p }, m) => {
23
+ let h = r.useId(), g = !!n, _ = `${h}-error`, v = `${h}-legend`, y = [], b = [];
24
+ r.Children.forEach(c, (e) => {
25
+ if (r.isValidElement(e) && e.type === u) {
25
26
  y.push(e);
26
27
  return;
27
28
  }
28
29
  b.push(e);
29
30
  });
30
31
  let x = y.map((e, t) => {
31
- let r = e.props.id ?? (t === 0 ? v : `${v}-${t}`);
32
- return n.cloneElement(e, {
33
- key: r,
34
- id: r
32
+ let n = e.props.id ?? (t === 0 ? v : `${v}-${t}`);
33
+ return r.cloneElement(e, {
34
+ key: n,
35
+ id: n
35
36
  });
36
- }), S = [x.map((e) => e.props.id).filter(Boolean).join(" "), f].filter(Boolean).join(" ") || void 0, C = [g ? _ : null, u].filter(Boolean).join(" ") || void 0;
37
- return /* @__PURE__ */ a("fieldset", {
38
- disabled: s,
37
+ }), S = [x.map((e) => e.props.id).filter(Boolean).join(" "), f].filter(Boolean).join(" ") || void 0, C = [g ? _ : null, l].filter(Boolean).join(" ") || void 0;
38
+ return /* @__PURE__ */ o("fieldset", {
39
+ disabled: i,
39
40
  className: "flex flex-col gap-2",
40
41
  children: [
41
42
  x,
42
- /* @__PURE__ */ i(o.Root, {
43
+ /* @__PURE__ */ a(s.Root, {
43
44
  ref: m,
44
- disabled: s,
45
+ disabled: i,
45
46
  className: e("grid gap-2", t),
46
47
  ...p,
47
48
  "aria-labelledby": S,
@@ -49,32 +50,32 @@ var u = n.forwardRef(({ className: t, error: r, disabled: s = !1, children: c, "
49
50
  "aria-invalid": g ? !0 : d,
50
51
  children: b
51
52
  }),
52
- g ? /* @__PURE__ */ i("p", {
53
+ g ? /* @__PURE__ */ a("p", {
53
54
  id: _,
54
55
  className: "text-xs text-basalt-destructive",
55
56
  role: "alert",
56
- children: r
57
+ children: n
57
58
  }) : null
58
59
  ]
59
60
  });
60
61
  });
61
- u.displayName = "Radio.Group";
62
- var d = n.forwardRef(({ className: n, size: a = "default", ...l }, u) => /* @__PURE__ */ i(o.Item, {
63
- ref: u,
64
- className: e("aspect-square shrink-0 rounded-full border border-basalt-primary text-basalt-primary disabled:cursor-not-allowed disabled:opacity-50", s[a], t, n),
65
- ...l,
66
- children: /* @__PURE__ */ i(o.Indicator, {
62
+ d.displayName = "Radio.Group";
63
+ var f = r.forwardRef(({ className: r, size: o = "default", ...u }, d) => /* @__PURE__ */ a(s.Item, {
64
+ ref: d,
65
+ className: e(t, "aspect-square shrink-0 rounded-full border border-basalt-primary text-basalt-primary disabled:cursor-not-allowed disabled:opacity-50", c[o], n, r),
66
+ ...u,
67
+ children: /* @__PURE__ */ a(s.Indicator, {
67
68
  className: "flex items-center justify-center",
68
- children: /* @__PURE__ */ i(r, { className: c[a] })
69
+ children: /* @__PURE__ */ a(i, { className: l[o] })
69
70
  })
70
71
  }));
71
- d.displayName = o.Item.displayName;
72
- var f = Object.assign(d, {
73
- Group: u,
74
- Legend: l,
75
- Item: d
72
+ f.displayName = s.Item.displayName;
73
+ var p = Object.assign(f, {
74
+ Group: d,
75
+ Legend: u,
76
+ Item: f
76
77
  });
77
78
  //#endregion
78
- export { f as Radio, u as RadioGroup };
79
+ export { p as Radio, d as RadioGroup };
79
80
 
80
81
  //# sourceMappingURL=radio.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"radio.js","names":[],"sources":["../../src/components/radio.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { FOCUS_RING } from \"./overlay\";\n\nexport type RadioSize = \"sm\" | \"default\";\n\nconst RADIO_SIZE_CLASS: Record<RadioSize, string> = {\n\tsm: \"h-3 w-3\",\n\tdefault: \"h-4 w-4\",\n};\n\nconst RADIO_INDICATOR_CLASS: Record<RadioSize, string> = {\n\tsm: \"h-1.5 w-1.5 fill-current text-current\",\n\tdefault: \"h-2.5 w-2.5 fill-current text-current\",\n};\n\nexport type RadioGroupProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>,\n\t\"disabled\" | \"value\" | \"defaultValue\" | \"onValueChange\"\n> & {\n\t/**\n\t * The controlled selected value.\n\t */\n\tvalue?: string;\n\t/**\n\t * The initially selected value.\n\t */\n\tdefaultValue?: string;\n\t/**\n\t * Called when the selected value changes.\n\t */\n\tonValueChange?: (value: string) => void;\n\t/**\n\t * Marks the group invalid and shows alert copy.\n\t */\n\terror?: React.ReactNode;\n\t/**\n\t * Disable every item in the group.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n};\n\nexport type RadioLegendProps = React.ComponentPropsWithoutRef<\"legend\">;\n\nexport type RadioProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n\t\"value\"\n> & {\n\t/**\n\t * The value associated with the radio item.\n\t */\n\tvalue: string;\n\t/**\n\t * The visual size of the radio.\n\t * @default default\n\t */\n\tsize?: RadioSize;\n};\n\nconst RadioLegend = React.forwardRef<HTMLLegendElement, RadioLegendProps>(\n\t({ className, ...props }, ref) => (\n\t\t<legend\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"text-sm font-medium text-basalt-foreground\", className)}\n\t\t\t{...props}\n\t\t/>\n\t),\n);\nRadioLegend.displayName = \"Radio.Legend\";\n\nexport const RadioGroup = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Root>,\n\tRadioGroupProps\n>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\terror,\n\t\t\tdisabled = false,\n\t\t\tchildren,\n\t\t\t\"aria-describedby\": describedBy,\n\t\t\t\"aria-invalid\": ariaInvalid,\n\t\t\t\"aria-labelledby\": labelledBy,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst generatedId = React.useId();\n\t\tconst invalid = Boolean(error);\n\t\tconst errorId = `${generatedId}-error`;\n\t\tconst defaultLegendId = `${generatedId}-legend`;\n\t\tconst legends: React.ReactElement<RadioLegendProps>[] = [];\n\t\tconst items: React.ReactNode[] = [];\n\t\tReact.Children.forEach(children, (child) => {\n\t\t\tif (React.isValidElement(child) && child.type === RadioLegend) {\n\t\t\t\tlegends.push(child as React.ReactElement<RadioLegendProps>);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\titems.push(child);\n\t\t});\n\t\tconst labeledLegends = legends.map((legend, index) => {\n\t\t\tconst legendId =\n\t\t\t\tlegend.props.id ?? (index === 0 ? defaultLegendId : `${defaultLegendId}-${index}`);\n\t\t\treturn React.cloneElement(legend, { key: legendId, id: legendId });\n\t\t});\n\t\tconst legendIds = labeledLegends\n\t\t\t.map((legend) => legend.props.id)\n\t\t\t.filter(Boolean)\n\t\t\t.join(\" \");\n\t\tconst mergedLabelledBy = [legendIds, labelledBy].filter(Boolean).join(\" \") || undefined;\n\t\tconst mergedDescribedBy =\n\t\t\t[invalid ? errorId : null, describedBy].filter(Boolean).join(\" \") || undefined;\n\t\treturn (\n\t\t\t<fieldset disabled={disabled} className=\"flex flex-col gap-2\">\n\t\t\t\t{labeledLegends}\n\t\t\t\t<RadioGroupPrimitive.Root\n\t\t\t\t\tref={ref}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tclassName={cn(\"grid gap-2\", className)}\n\t\t\t\t\t{...props}\n\t\t\t\t\taria-labelledby={mergedLabelledBy}\n\t\t\t\t\taria-describedby={mergedDescribedBy}\n\t\t\t\t\taria-invalid={invalid ? true : ariaInvalid}\n\t\t\t\t>\n\t\t\t\t\t{items}\n\t\t\t\t</RadioGroupPrimitive.Root>\n\t\t\t\t{invalid ? (\n\t\t\t\t\t<p id={errorId} className=\"text-xs text-basalt-destructive\" role=\"alert\">\n\t\t\t\t\t\t{error}\n\t\t\t\t\t</p>\n\t\t\t\t) : null}\n\t\t\t</fieldset>\n\t\t);\n\t},\n);\nRadioGroup.displayName = \"Radio.Group\";\n\nconst RadioRoot = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Item>, RadioProps>(\n\t({ className, size = \"default\", ...props }, ref) => (\n\t\t<RadioGroupPrimitive.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\t\"aspect-square shrink-0 rounded-full border border-basalt-primary text-basalt-primary disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\tRADIO_SIZE_CLASS[size],\n\t\t\t\tFOCUS_RING,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n\t\t\t\t<Circle className={RADIO_INDICATOR_CLASS[size]} />\n\t\t\t</RadioGroupPrimitive.Indicator>\n\t\t</RadioGroupPrimitive.Item>\n\t),\n);\nRadioRoot.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport const Radio = Object.assign(RadioRoot, {\n\tGroup: RadioGroup,\n\tLegend: RadioLegend,\n\tItem: RadioRoot,\n});\n"],"mappings":";;;;;;;;AAQA,IAAM,IAA8C;CACnD,IAAI;CACJ,SAAS;AACV,GAEM,IAAmD;CACxD,IAAI;CACJ,SAAS;AACV,GA8CM,IAAc,EAAM,YACxB,EAAE,cAAW,GAAG,KAAS,MACzB,kBAAC,UAAD;CACM;CACL,WAAW,EAAG,8CAA8C,CAAS;CACrE,GAAI;AACJ,CAAA,CAEH;AACA,EAAY,cAAc;AAE1B,IAAa,IAAa,EAAM,YAK9B,EACC,cACA,UACA,cAAW,IACX,aACA,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,GAAG,KAEJ,MACI;CACJ,IAAM,IAAc,EAAM,MAAM,GAC1B,IAAU,EAAQ,GAClB,IAAU,GAAG,EAAY,SACzB,IAAkB,GAAG,EAAY,UACjC,IAAkD,CAAC,GACnD,IAA2B,CAAC;CAClC,EAAM,SAAS,QAAQ,IAAW,MAAU;EAC3C,IAAI,EAAM,eAAe,CAAK,KAAK,EAAM,SAAS,GAAa;GAC9D,EAAQ,KAAK,CAA6C;GAC1D;EACD;EACA,EAAM,KAAK,CAAK;CACjB,CAAC;CACD,IAAM,IAAiB,EAAQ,KAAK,GAAQ,MAAU;EACrD,IAAM,IACL,EAAO,MAAM,OAAO,MAAU,IAAI,IAAkB,GAAG,EAAgB,GAAG;EAC3E,OAAO,EAAM,aAAa,GAAQ;GAAE,KAAK;GAAU,IAAI;EAAS,CAAC;CAClE,CAAC,GAKK,IAAmB,CAJP,EAChB,KAAK,MAAW,EAAO,MAAM,EAAE,CAAC,CAChC,OAAO,OAAO,CAAC,CACf,KAAK,GACmB,GAAW,CAAU,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA,GACxE,IACL,CAAC,IAAU,IAAU,MAAM,CAAW,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;CACtE,OACC,kBAAC,YAAD;EAAoB;EAAU,WAAU;EAAxC,UAAA;GACE;GACD,kBAAC,EAAoB,MAArB;IACM;IACK;IACV,WAAW,EAAG,cAAc,CAAS;IACrC,GAAI;IACJ,mBAAiB;IACjB,oBAAkB;IAClB,gBAAc,IAAU,KAAO;IAE9B,UAAA;GACwB,CAAA;GACzB,IACA,kBAAC,KAAD;IAAG,IAAI;IAAS,WAAU;IAAkC,MAAK;IAC/D,UAAA;GACC,CAAA,IACA;EACK;;AAEZ,CACD;AACA,EAAW,cAAc;AAEzB,IAAM,IAAY,EAAM,YACtB,EAAE,cAAW,UAAO,WAAW,GAAG,KAAS,MAC3C,kBAAC,EAAoB,MAArB;CACM;CACL,WAAW,EACV,wIACA,EAAiB,IACjB,GACA,CACD;CACA,GAAI;CAEJ,UAAA,kBAAC,EAAoB,WAArB;EAA+B,WAAU;EACxC,UAAA,kBAAC,GAAD,EAAQ,WAAW,EAAsB,GAAQ,CAAA;CACnB,CAAA;AACN,CAAA,CAE5B;AACA,EAAU,cAAc,EAAoB,KAAK;AAEjD,IAAa,IAAQ,OAAO,OAAO,GAAW;CAC7C,OAAO;CACP,QAAQ;CACR,MAAM;AACP,CAAC"}
1
+ {"version":3,"file":"radio.js","names":[],"sources":["../../src/components/radio.tsx"],"sourcesContent":["import * as RadioGroupPrimitive from \"@radix-ui/react-radio-group\";\nimport { Circle } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { FOCUS_RING } from \"./overlay\";\n\nexport type RadioSize = \"sm\" | \"default\";\n\nconst RADIO_SIZE_CLASS: Record<RadioSize, string> = {\n\tsm: \"h-3 w-3\",\n\tdefault: \"h-4 w-4\",\n};\n\nconst RADIO_INDICATOR_CLASS: Record<RadioSize, string> = {\n\tsm: \"h-1.5 w-1.5 fill-current text-current\",\n\tdefault: \"h-2.5 w-2.5 fill-current text-current\",\n};\n\nexport type RadioGroupProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>,\n\t\"disabled\" | \"value\" | \"defaultValue\" | \"onValueChange\"\n> & {\n\t/**\n\t * The controlled selected value.\n\t */\n\tvalue?: string;\n\t/**\n\t * The initially selected value.\n\t */\n\tdefaultValue?: string;\n\t/**\n\t * Called when the selected value changes.\n\t */\n\tonValueChange?: (value: string) => void;\n\t/**\n\t * Marks the group invalid and shows alert copy.\n\t */\n\terror?: React.ReactNode;\n\t/**\n\t * Disable every item in the group.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n};\n\nexport type RadioLegendProps = React.ComponentPropsWithoutRef<\"legend\">;\n\nexport type RadioProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>,\n\t\"value\"\n> & {\n\t/**\n\t * The value associated with the radio item.\n\t */\n\tvalue: string;\n\t/**\n\t * The visual size of the radio.\n\t * @default default\n\t */\n\tsize?: RadioSize;\n};\n\nconst RadioLegend = React.forwardRef<HTMLLegendElement, RadioLegendProps>(\n\t({ className, ...props }, ref) => (\n\t\t<legend\n\t\t\tref={ref}\n\t\t\tclassName={cn(\"text-sm font-medium text-basalt-foreground\", className)}\n\t\t\t{...props}\n\t\t/>\n\t),\n);\nRadioLegend.displayName = \"Radio.Legend\";\n\nexport const RadioGroup = React.forwardRef<\n\tReact.ElementRef<typeof RadioGroupPrimitive.Root>,\n\tRadioGroupProps\n>(\n\t(\n\t\t{\n\t\t\tclassName,\n\t\t\terror,\n\t\t\tdisabled = false,\n\t\t\tchildren,\n\t\t\t\"aria-describedby\": describedBy,\n\t\t\t\"aria-invalid\": ariaInvalid,\n\t\t\t\"aria-labelledby\": labelledBy,\n\t\t\t...props\n\t\t},\n\t\tref,\n\t) => {\n\t\tconst generatedId = React.useId();\n\t\tconst invalid = Boolean(error);\n\t\tconst errorId = `${generatedId}-error`;\n\t\tconst defaultLegendId = `${generatedId}-legend`;\n\t\tconst legends: React.ReactElement<RadioLegendProps>[] = [];\n\t\tconst items: React.ReactNode[] = [];\n\t\tReact.Children.forEach(children, (child) => {\n\t\t\tif (React.isValidElement(child) && child.type === RadioLegend) {\n\t\t\t\tlegends.push(child as React.ReactElement<RadioLegendProps>);\n\t\t\t\treturn;\n\t\t\t}\n\t\t\titems.push(child);\n\t\t});\n\t\tconst labeledLegends = legends.map((legend, index) => {\n\t\t\tconst legendId =\n\t\t\t\tlegend.props.id ?? (index === 0 ? defaultLegendId : `${defaultLegendId}-${index}`);\n\t\t\treturn React.cloneElement(legend, { key: legendId, id: legendId });\n\t\t});\n\t\tconst legendIds = labeledLegends\n\t\t\t.map((legend) => legend.props.id)\n\t\t\t.filter(Boolean)\n\t\t\t.join(\" \");\n\t\tconst mergedLabelledBy = [legendIds, labelledBy].filter(Boolean).join(\" \") || undefined;\n\t\tconst mergedDescribedBy =\n\t\t\t[invalid ? errorId : null, describedBy].filter(Boolean).join(\" \") || undefined;\n\t\treturn (\n\t\t\t<fieldset disabled={disabled} className=\"flex flex-col gap-2\">\n\t\t\t\t{labeledLegends}\n\t\t\t\t<RadioGroupPrimitive.Root\n\t\t\t\t\tref={ref}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tclassName={cn(\"grid gap-2\", className)}\n\t\t\t\t\t{...props}\n\t\t\t\t\taria-labelledby={mergedLabelledBy}\n\t\t\t\t\taria-describedby={mergedDescribedBy}\n\t\t\t\t\taria-invalid={invalid ? true : ariaInvalid}\n\t\t\t\t>\n\t\t\t\t\t{items}\n\t\t\t\t</RadioGroupPrimitive.Root>\n\t\t\t\t{invalid ? (\n\t\t\t\t\t<p id={errorId} className=\"text-xs text-basalt-destructive\" role=\"alert\">\n\t\t\t\t\t\t{error}\n\t\t\t\t\t</p>\n\t\t\t\t) : null}\n\t\t\t</fieldset>\n\t\t);\n\t},\n);\nRadioGroup.displayName = \"Radio.Group\";\n\nconst RadioRoot = React.forwardRef<React.ElementRef<typeof RadioGroupPrimitive.Item>, RadioProps>(\n\t({ className, size = \"default\", ...props }, ref) => (\n\t\t<RadioGroupPrimitive.Item\n\t\t\tref={ref}\n\t\t\tclassName={cn(\n\t\t\t\tBASALT_UI_CLASS,\n\t\t\t\t\"aspect-square shrink-0 rounded-full border border-basalt-primary text-basalt-primary disabled:cursor-not-allowed disabled:opacity-50\",\n\t\t\t\tRADIO_SIZE_CLASS[size],\n\t\t\t\tFOCUS_RING,\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<RadioGroupPrimitive.Indicator className=\"flex items-center justify-center\">\n\t\t\t\t<Circle className={RADIO_INDICATOR_CLASS[size]} />\n\t\t\t</RadioGroupPrimitive.Indicator>\n\t\t</RadioGroupPrimitive.Item>\n\t),\n);\nRadioRoot.displayName = RadioGroupPrimitive.Item.displayName;\n\nexport const Radio = Object.assign(RadioRoot, {\n\tGroup: RadioGroup,\n\tLegend: RadioLegend,\n\tItem: RadioRoot,\n});\n"],"mappings":";;;;;;;;;AASA,IAAM,IAA8C;CACnD,IAAI;CACJ,SAAS;AACV,GAEM,IAAmD;CACxD,IAAI;CACJ,SAAS;AACV,GA8CM,IAAc,EAAM,YACxB,EAAE,cAAW,GAAG,KAAS,MACzB,kBAAC,UAAD;CACM;CACL,WAAW,EAAG,8CAA8C,CAAS;CACrE,GAAI;AACJ,CAAA,CAEH;AACA,EAAY,cAAc;AAE1B,IAAa,IAAa,EAAM,YAK9B,EACC,cACA,UACA,cAAW,IACX,aACA,oBAAoB,GACpB,gBAAgB,GAChB,mBAAmB,GACnB,GAAG,KAEJ,MACI;CACJ,IAAM,IAAc,EAAM,MAAM,GAC1B,IAAU,EAAQ,GAClB,IAAU,GAAG,EAAY,SACzB,IAAkB,GAAG,EAAY,UACjC,IAAkD,CAAC,GACnD,IAA2B,CAAC;CAClC,EAAM,SAAS,QAAQ,IAAW,MAAU;EAC3C,IAAI,EAAM,eAAe,CAAK,KAAK,EAAM,SAAS,GAAa;GAC9D,EAAQ,KAAK,CAA6C;GAC1D;EACD;EACA,EAAM,KAAK,CAAK;CACjB,CAAC;CACD,IAAM,IAAiB,EAAQ,KAAK,GAAQ,MAAU;EACrD,IAAM,IACL,EAAO,MAAM,OAAO,MAAU,IAAI,IAAkB,GAAG,EAAgB,GAAG;EAC3E,OAAO,EAAM,aAAa,GAAQ;GAAE,KAAK;GAAU,IAAI;EAAS,CAAC;CAClE,CAAC,GAKK,IAAmB,CAJP,EAChB,KAAK,MAAW,EAAO,MAAM,EAAE,CAAC,CAChC,OAAO,OAAO,CAAC,CACf,KAAK,GACmB,GAAW,CAAU,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA,GACxE,IACL,CAAC,IAAU,IAAU,MAAM,CAAW,CAAC,CAAC,OAAO,OAAO,CAAC,CAAC,KAAK,GAAG,KAAK,KAAA;CACtE,OACC,kBAAC,YAAD;EAAoB;EAAU,WAAU;EAAxC,UAAA;GACE;GACD,kBAAC,EAAoB,MAArB;IACM;IACK;IACV,WAAW,EAAG,cAAc,CAAS;IACrC,GAAI;IACJ,mBAAiB;IACjB,oBAAkB;IAClB,gBAAc,IAAU,KAAO;IAE9B,UAAA;GACwB,CAAA;GACzB,IACA,kBAAC,KAAD;IAAG,IAAI;IAAS,WAAU;IAAkC,MAAK;IAC/D,UAAA;GACC,CAAA,IACA;EACK;;AAEZ,CACD;AACA,EAAW,cAAc;AAEzB,IAAM,IAAY,EAAM,YACtB,EAAE,cAAW,UAAO,WAAW,GAAG,KAAS,MAC3C,kBAAC,EAAoB,MAArB;CACM;CACL,WAAW,EACV,GACA,wIACA,EAAiB,IACjB,GACA,CACD;CACA,GAAI;CAEJ,UAAA,kBAAC,EAAoB,WAArB;EAA+B,WAAU;EACxC,UAAA,kBAAC,GAAD,EAAQ,WAAW,EAAsB,GAAQ,CAAA;CACnB,CAAA;AACN,CAAA,CAE5B;AACA,EAAU,cAAc,EAAoB,KAAK;AAEjD,IAAa,IAAQ,OAAO,OAAO,GAAW;CAC7C,OAAO;CACP,QAAQ;CACR,MAAM;AACP,CAAC"}
@@ -1,3 +1,4 @@
1
+ import type { ReactNode } from "react";
1
2
  export type ResourceListRow = {
2
3
  name: string;
3
4
  status: string;
@@ -6,5 +7,29 @@ export type ResourceListProps = {
6
7
  title: string;
7
8
  description?: string;
8
9
  data: ResourceListRow[];
10
+ /** Custom heading; falls back to PageHeader. */
11
+ header?: ReactNode;
12
+ /** Search and primary actions below the heading. */
13
+ toolbar?: ReactNode;
14
+ /** Active filters and their controls. */
15
+ filters?: ReactNode;
16
+ /** Selection-dependent actions. */
17
+ bulkActions?: ReactNode;
18
+ /** State content replacing the results; undefined falls through to children/data. */
19
+ state?: ReactNode;
20
+ /** Custom results such as a typed DataTable. */
21
+ children?: ReactNode;
22
+ /** Pagination or result summary after the results. */
23
+ footer?: ReactNode;
24
+ /** Classes for the root region. */
25
+ className?: string;
26
+ /** Show the default table loading state. @default false */
27
+ loading?: boolean;
28
+ /** Content shown when default data is empty. */
29
+ empty?: ReactNode;
30
+ /** Default table error content. */
31
+ error?: ReactNode;
32
+ /** Retry callback for the default table. */
33
+ onRetry?: () => void;
9
34
  };
10
- export declare function ResourceList({ title, description, data }: ResourceListProps): import("react").JSX.Element;
35
+ export declare function ResourceList({ title, description, data, header, toolbar, filters, bulkActions, state, children, footer, className, loading, empty, error, onRetry, }: ResourceListProps): import("react").JSX.Element;
@@ -1,9 +1,10 @@
1
1
  "use client";
2
- import { DataTable as e } from "./data-table.js";
3
- import { PageHeader as t } from "./page-header.js";
4
- import { jsx as n, jsxs as r } from "react/jsx-runtime";
2
+ import { cn as e } from "../utils/cn.js";
3
+ import { DataTable as t } from "./data-table.js";
4
+ import { PageHeader as n } from "./page-header.js";
5
+ import { jsx as r, jsxs as i } from "react/jsx-runtime";
5
6
  //#region src/components/resource-list.tsx
6
- var i = [{
7
+ var a = [{
7
8
  id: "name",
8
9
  header: "Name",
9
10
  accessor: (e) => e.name
@@ -12,19 +13,31 @@ var i = [{
12
13
  header: "Status",
13
14
  accessor: (e) => e.status
14
15
  }];
15
- function a({ title: a, description: o, data: s }) {
16
- return /* @__PURE__ */ r("div", {
17
- className: "space-y-4",
18
- children: [/* @__PURE__ */ n(t, {
19
- title: a,
20
- description: o
21
- }), /* @__PURE__ */ n(e, {
22
- data: s,
23
- columns: i
24
- })]
16
+ function o({ title: o, description: s, data: c, header: l, toolbar: u, filters: d, bulkActions: f, state: p, children: m, footer: h, className: g, loading: _, empty: v, error: y, onRetry: b }) {
17
+ return /* @__PURE__ */ i("div", {
18
+ className: e("min-w-0 space-y-4", g),
19
+ children: [
20
+ l ?? /* @__PURE__ */ r(n, {
21
+ title: o,
22
+ description: s
23
+ }),
24
+ u == null ? null : /* @__PURE__ */ r("div", { children: u }),
25
+ d == null ? null : /* @__PURE__ */ r("div", { children: d }),
26
+ f == null ? null : /* @__PURE__ */ r("div", { children: f }),
27
+ p ?? m ?? /* @__PURE__ */ r(t, {
28
+ data: c,
29
+ columns: a,
30
+ loading: _,
31
+ empty: v,
32
+ error: y,
33
+ onRetry: b,
34
+ "aria-label": o
35
+ }),
36
+ h == null ? null : /* @__PURE__ */ r("div", { children: h })
37
+ ]
25
38
  });
26
39
  }
27
40
  //#endregion
28
- export { a as ResourceList };
41
+ export { o as ResourceList };
29
42
 
30
43
  //# sourceMappingURL=resource-list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"resource-list.js","names":[],"sources":["../../src/components/resource-list.tsx"],"sourcesContent":["import { DataTable, type DataTableColumn } from \"./data-table\";\nimport { PageHeader } from \"./page-header\";\n\nexport type ResourceListRow = {\n\tname: string;\n\tstatus: string;\n};\n\nexport type ResourceListProps = {\n\ttitle: string;\n\tdescription?: string;\n\tdata: ResourceListRow[];\n};\n\nconst COLUMNS: DataTableColumn<ResourceListRow>[] = [\n\t{ id: \"name\", header: \"Name\", accessor: (row) => row.name },\n\t{ id: \"status\", header: \"Status\", accessor: (row) => row.status },\n];\n\nexport function ResourceList({ title, description, data }: ResourceListProps) {\n\treturn (\n\t\t<div className=\"space-y-4\">\n\t\t\t<PageHeader title={title} description={description} />\n\t\t\t<DataTable data={data} columns={COLUMNS} />\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;AAcA,IAAM,IAA8C,CACnD;CAAE,IAAI;CAAQ,QAAQ;CAAQ,WAAW,MAAQ,EAAI;AAAK,GAC1D;CAAE,IAAI;CAAU,QAAQ;CAAU,WAAW,MAAQ,EAAI;AAAO,CACjE;AAEA,SAAgB,EAAa,EAAE,UAAO,gBAAa,WAA2B;CAC7E,OACC,kBAAC,OAAD;EAAK,WAAU;EAAf,UAAA,CACC,kBAAC,GAAD;GAAmB;GAAoB;EAAc,CAAA,GACrD,kBAAC,GAAD;GAAiB;GAAM,SAAS;EAAU,CAAA,CACtC;;AAEP"}
1
+ {"version":3,"file":"resource-list.js","names":[],"sources":["../../src/components/resource-list.tsx"],"sourcesContent":["import type { ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { DataTable, type DataTableColumn } from \"./data-table\";\nimport { PageHeader } from \"./page-header\";\n\nexport type ResourceListRow = {\n\tname: string;\n\tstatus: string;\n};\n\nexport type ResourceListProps = {\n\ttitle: string;\n\tdescription?: string;\n\tdata: ResourceListRow[];\n\t/** Custom heading; falls back to PageHeader. */\n\theader?: ReactNode;\n\t/** Search and primary actions below the heading. */\n\ttoolbar?: ReactNode;\n\t/** Active filters and their controls. */\n\tfilters?: ReactNode;\n\t/** Selection-dependent actions. */\n\tbulkActions?: ReactNode;\n\t/** State content replacing the results; undefined falls through to children/data. */\n\tstate?: ReactNode;\n\t/** Custom results such as a typed DataTable. */\n\tchildren?: ReactNode;\n\t/** Pagination or result summary after the results. */\n\tfooter?: ReactNode;\n\t/** Classes for the root region. */\n\tclassName?: string;\n\t/** Show the default table loading state. @default false */\n\tloading?: boolean;\n\t/** Content shown when default data is empty. */\n\tempty?: ReactNode;\n\t/** Default table error content. */\n\terror?: ReactNode;\n\t/** Retry callback for the default table. */\n\tonRetry?: () => void;\n};\n\nconst COLUMNS: DataTableColumn<ResourceListRow>[] = [\n\t{ id: \"name\", header: \"Name\", accessor: (row) => row.name },\n\t{ id: \"status\", header: \"Status\", accessor: (row) => row.status },\n];\n\nexport function ResourceList({\n\ttitle,\n\tdescription,\n\tdata,\n\theader,\n\ttoolbar,\n\tfilters,\n\tbulkActions,\n\tstate,\n\tchildren,\n\tfooter,\n\tclassName,\n\tloading,\n\tempty,\n\terror,\n\tonRetry,\n}: ResourceListProps) {\n\treturn (\n\t\t<div className={cn(\"min-w-0 space-y-4\", className)}>\n\t\t\t{header ?? <PageHeader title={title} description={description} />}\n\t\t\t{toolbar != null ? <div>{toolbar}</div> : null}\n\t\t\t{filters != null ? <div>{filters}</div> : null}\n\t\t\t{bulkActions != null ? <div>{bulkActions}</div> : null}\n\t\t\t{state ?? children ?? (\n\t\t\t\t<DataTable\n\t\t\t\t\tdata={data}\n\t\t\t\t\tcolumns={COLUMNS}\n\t\t\t\t\tloading={loading}\n\t\t\t\t\tempty={empty}\n\t\t\t\t\terror={error}\n\t\t\t\t\tonRetry={onRetry}\n\t\t\t\t\taria-label={title}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{footer != null ? <div>{footer}</div> : null}\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;AAwCA,IAAM,IAA8C,CACnD;CAAE,IAAI;CAAQ,QAAQ;CAAQ,WAAW,MAAQ,EAAI;AAAK,GAC1D;CAAE,IAAI;CAAU,QAAQ;CAAU,WAAW,MAAQ,EAAI;AAAO,CACjE;AAEA,SAAgB,EAAa,EAC5B,UACA,gBACA,SACA,WACA,YACA,YACA,gBACA,UACA,aACA,WACA,cACA,YACA,UACA,UACA,cACqB;CACrB,OACC,kBAAC,OAAD;EAAK,WAAW,EAAG,qBAAqB,CAAS;EAAjD,UAAA;GACE,KAAU,kBAAC,GAAD;IAAmB;IAAoB;GAAc,CAAA;GAC/D,KAAW,OAA8B,OAAvB,kBAAC,OAAD,EAAA,UAAM,EAAa,CAAA;GACrC,KAAW,OAA8B,OAAvB,kBAAC,OAAD,EAAA,UAAM,EAAa,CAAA;GACrC,KAAe,OAAkC,OAA3B,kBAAC,OAAD,EAAA,UAAM,EAAiB,CAAA;GAC7C,KAAS,KACT,kBAAC,GAAD;IACO;IACN,SAAS;IACA;IACF;IACA;IACE;IACT,cAAY;GACZ,CAAA;GAED,KAAU,OAA6B,OAAtB,kBAAC,OAAD,EAAA,UAAM,EAAY,CAAA;EAChC;;AAEP"}
@@ -0,0 +1,27 @@
1
+ import { type ReactNode } from "react";
2
+ export interface ResponsiveMasterDetailProps {
3
+ /** Accessible name of the composition. */
4
+ label: string;
5
+ /** Application-rendered list; selection, routing and data remain outside. */
6
+ list: ReactNode;
7
+ /** Application-rendered detail content. */
8
+ children: ReactNode;
9
+ /** Controlled detail visibility. */
10
+ detailOpen: boolean;
11
+ /** Requests opening/closing the detail; the caller accepts the change. */
12
+ onDetailOpenChange: (open: boolean) => void;
13
+ /** Current selection identity, used to focus newly selected mobile details. */
14
+ selectedId?: string | null;
15
+ /** List region name. @default "Items" */
16
+ listLabel?: string;
17
+ /** Detail region name. @default "Details" */
18
+ detailLabel?: string;
19
+ /** Mobile return action text. @default "Back to items" */
20
+ backLabel?: string;
21
+ /** Desktop detail placeholder while no item is open. */
22
+ empty?: ReactNode;
23
+ /** Additional root classes; provide application-specific height/scrolling here. */
24
+ className?: string;
25
+ }
26
+ /** Two columns at 768px and above; one visible, focusable pane below it. Not a modal. */
27
+ export declare function ResponsiveMasterDetail({ label, list, children, detailOpen, onDetailOpenChange, selectedId, listLabel, detailLabel, backLabel, empty, className, }: ResponsiveMasterDetailProps): import("react").JSX.Element;
@@ -0,0 +1,85 @@
1
+ "use client";
2
+ import { cn as e } from "../utils/cn.js";
3
+ import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
4
+ import { Button as n } from "./button.js";
5
+ import { useEffect as r, useLayoutEffect as i, useRef as a, useState as o } from "react";
6
+ import { ArrowLeft as s } from "lucide-react";
7
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
+ //#region src/components/responsive-master-detail.tsx
9
+ function u({ label: u, list: d, children: f, detailOpen: p, onDetailOpenChange: m, selectedId: h, listLabel: g = "Items", detailLabel: _ = "Details", backLabel: v = "Back to items", empty: y = /* @__PURE__ */ c("p", {
10
+ className: "p-6 text-sm text-basalt-muted-foreground",
11
+ children: "Choose an item to see its details."
12
+ }), className: b }) {
13
+ let [x, S] = o(!1), C = a(null), w = a(null), T = a(null), E = a({
14
+ compact: !1,
15
+ detailOpen: !1,
16
+ selectedId: h
17
+ });
18
+ return r(() => {
19
+ let e = window.matchMedia("(max-width: 767px)"), t = () => S(e.matches);
20
+ return t(), e.addEventListener("change", t), () => e.removeEventListener("change", t);
21
+ }, []), i(() => {
22
+ let e = E.current;
23
+ if (x && p && (!e.compact || !e.detailOpen || e.selectedId !== h) && w.current?.focus(), x && !p && e.detailOpen) {
24
+ let e = T.current;
25
+ e?.isConnected && !e.closest("[hidden], [inert]") ? e.focus() : C.current?.focus();
26
+ }
27
+ E.current = {
28
+ compact: x,
29
+ detailOpen: p,
30
+ selectedId: h
31
+ };
32
+ }, [
33
+ x,
34
+ p,
35
+ h
36
+ ]), /* @__PURE__ */ l("div", {
37
+ role: "group",
38
+ "aria-label": u,
39
+ className: e(t, "grid min-w-0 grid-cols-1 overflow-hidden rounded-basalt-lg border border-basalt-border md:grid-cols-[minmax(12rem,20rem)_minmax(0,1fr)]", b),
40
+ children: [/* @__PURE__ */ c("section", {
41
+ ref: C,
42
+ "aria-label": g,
43
+ tabIndex: -1,
44
+ hidden: x && p,
45
+ inert: x && p,
46
+ className: e("min-w-0 bg-basalt-card focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-basalt-ring md:border-r md:border-basalt-border", p && "hidden md:block"),
47
+ onFocusCapture: (e) => {
48
+ T.current = e.target;
49
+ },
50
+ onPointerDownCapture: (e) => {
51
+ let t = e.target.closest("button, a[href], input, [tabindex]");
52
+ t && (T.current = t);
53
+ },
54
+ children: d
55
+ }), /* @__PURE__ */ l("section", {
56
+ ref: w,
57
+ "aria-label": _,
58
+ tabIndex: -1,
59
+ hidden: x && !p,
60
+ inert: x && !p,
61
+ className: e("min-w-0 bg-basalt-background focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-basalt-ring", !p && "hidden md:block"),
62
+ children: [
63
+ x && p && /* @__PURE__ */ c("div", {
64
+ className: "border-b border-basalt-border p-2",
65
+ children: /* @__PURE__ */ l(n, {
66
+ size: "sm",
67
+ variant: "ghost",
68
+ onClick: () => m(!1),
69
+ children: [/* @__PURE__ */ c(s, {}), v]
70
+ })
71
+ }),
72
+ /* @__PURE__ */ c("div", {
73
+ hidden: !p,
74
+ inert: !p,
75
+ children: f
76
+ }),
77
+ !p && y
78
+ ]
79
+ })]
80
+ });
81
+ }
82
+ //#endregion
83
+ export { u as ResponsiveMasterDetail };
84
+
85
+ //# sourceMappingURL=responsive-master-detail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"responsive-master-detail.js","names":[],"sources":["../../src/components/responsive-master-detail.tsx"],"sourcesContent":["import { ArrowLeft } from \"lucide-react\";\nimport { type ReactNode, useEffect, useLayoutEffect, useRef, useState } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { Button } from \"./button\";\n\nexport interface ResponsiveMasterDetailProps {\n\t/** Accessible name of the composition. */\n\tlabel: string;\n\t/** Application-rendered list; selection, routing and data remain outside. */\n\tlist: ReactNode;\n\t/** Application-rendered detail content. */\n\tchildren: ReactNode;\n\t/** Controlled detail visibility. */\n\tdetailOpen: boolean;\n\t/** Requests opening/closing the detail; the caller accepts the change. */\n\tonDetailOpenChange: (open: boolean) => void;\n\t/** Current selection identity, used to focus newly selected mobile details. */\n\tselectedId?: string | null;\n\t/** List region name. @default \"Items\" */\n\tlistLabel?: string;\n\t/** Detail region name. @default \"Details\" */\n\tdetailLabel?: string;\n\t/** Mobile return action text. @default \"Back to items\" */\n\tbackLabel?: string;\n\t/** Desktop detail placeholder while no item is open. */\n\tempty?: ReactNode;\n\t/** Additional root classes; provide application-specific height/scrolling here. */\n\tclassName?: string;\n}\n/** Two columns at 768px and above; one visible, focusable pane below it. Not a modal. */\nexport function ResponsiveMasterDetail({\n\tlabel,\n\tlist,\n\tchildren,\n\tdetailOpen,\n\tonDetailOpenChange,\n\tselectedId,\n\tlistLabel = \"Items\",\n\tdetailLabel = \"Details\",\n\tbackLabel = \"Back to items\",\n\tempty = (\n\t\t<p className=\"p-6 text-sm text-basalt-muted-foreground\">Choose an item to see its details.</p>\n\t),\n\tclassName,\n}: ResponsiveMasterDetailProps) {\n\tconst [compact, setCompact] = useState(false);\n\tconst listRegion = useRef<HTMLElement>(null);\n\tconst detailRegion = useRef<HTMLElement>(null);\n\tconst opener = useRef<HTMLElement | null>(null);\n\tconst previous = useRef({ compact: false, detailOpen: false, selectedId });\n\tuseEffect(() => {\n\t\tconst query = window.matchMedia(\"(max-width: 767px)\");\n\t\tconst update = () => setCompact(query.matches);\n\t\tupdate();\n\t\tquery.addEventListener(\"change\", update);\n\t\treturn () => query.removeEventListener(\"change\", update);\n\t}, []);\n\tuseLayoutEffect(() => {\n\t\tconst before = previous.current;\n\t\tif (\n\t\t\tcompact &&\n\t\t\tdetailOpen &&\n\t\t\t(!before.compact || !before.detailOpen || before.selectedId !== selectedId)\n\t\t)\n\t\t\tdetailRegion.current?.focus();\n\t\tif (compact && !detailOpen && before.detailOpen) {\n\t\t\tconst target = opener.current;\n\t\t\tif (target?.isConnected && !target.closest(\"[hidden], [inert]\")) target.focus();\n\t\t\telse listRegion.current?.focus();\n\t\t}\n\t\tprevious.current = { compact, detailOpen, selectedId };\n\t}, [compact, detailOpen, selectedId]);\n\treturn (\n\t\t<div\n\t\t\trole=\"group\"\n\t\t\taria-label={label}\n\t\t\tclassName={cn(\n\t\t\t\tBASALT_UI_CLASS,\n\t\t\t\t\"grid min-w-0 grid-cols-1 overflow-hidden rounded-basalt-lg border border-basalt-border md:grid-cols-[minmax(12rem,20rem)_minmax(0,1fr)]\",\n\t\t\t\tclassName,\n\t\t\t)}\n\t\t>\n\t\t\t<section\n\t\t\t\tref={listRegion}\n\t\t\t\taria-label={listLabel}\n\t\t\t\ttabIndex={-1}\n\t\t\t\thidden={compact && detailOpen}\n\t\t\t\tinert={compact && detailOpen}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"min-w-0 bg-basalt-card focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-basalt-ring md:border-r md:border-basalt-border\",\n\t\t\t\t\tdetailOpen && \"hidden md:block\",\n\t\t\t\t)}\n\t\t\t\tonFocusCapture={(event) => {\n\t\t\t\t\topener.current = event.target;\n\t\t\t\t}}\n\t\t\t\tonPointerDownCapture={(event) => {\n\t\t\t\t\tconst target = (event.target as Element).closest<HTMLElement>(\n\t\t\t\t\t\t\"button, a[href], input, [tabindex]\",\n\t\t\t\t\t);\n\t\t\t\t\tif (target) opener.current = target;\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t{list}\n\t\t\t</section>\n\t\t\t<section\n\t\t\t\tref={detailRegion}\n\t\t\t\taria-label={detailLabel}\n\t\t\t\ttabIndex={-1}\n\t\t\t\thidden={compact && !detailOpen}\n\t\t\t\tinert={compact && !detailOpen}\n\t\t\t\tclassName={cn(\n\t\t\t\t\t\"min-w-0 bg-basalt-background focus-visible:outline-2 focus-visible:-outline-offset-2 focus-visible:outline-basalt-ring\",\n\t\t\t\t\t!detailOpen && \"hidden md:block\",\n\t\t\t\t)}\n\t\t\t>\n\t\t\t\t{compact && detailOpen && (\n\t\t\t\t\t<div className=\"border-b border-basalt-border p-2\">\n\t\t\t\t\t\t<Button size=\"sm\" variant=\"ghost\" onClick={() => onDetailOpenChange(false)}>\n\t\t\t\t\t\t\t<ArrowLeft />\n\t\t\t\t\t\t\t{backLabel}\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t</div>\n\t\t\t\t)}\n\t\t\t\t<div hidden={!detailOpen} inert={!detailOpen}>\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t\t{!detailOpen && empty}\n\t\t\t</section>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AA+BA,SAAgB,EAAuB,EACtC,UACA,SACA,aACA,eACA,uBACA,eACA,eAAY,SACZ,iBAAc,WACd,eAAY,iBACZ,WACC,kBAAC,KAAD;CAAG,WAAU;CAA2C,UAAA;AAAqC,CAAA,GAE9F,gBAC+B;CAC/B,IAAM,CAAC,GAAS,KAAc,EAAS,EAAK,GACtC,IAAa,EAAoB,IAAI,GACrC,IAAe,EAAoB,IAAI,GACvC,IAAS,EAA2B,IAAI,GACxC,IAAW,EAAO;EAAE,SAAS;EAAO,YAAY;EAAO;CAAW,CAAC;CAuBzE,OAtBA,QAAgB;EACf,IAAM,IAAQ,OAAO,WAAW,oBAAoB,GAC9C,UAAe,EAAW,EAAM,OAAO;EAG7C,OAFA,EAAO,GACP,EAAM,iBAAiB,UAAU,CAAM,SAC1B,EAAM,oBAAoB,UAAU,CAAM;CACxD,GAAG,CAAC,CAAC,GACL,QAAsB;EACrB,IAAM,IAAS,EAAS;EAOxB,IALC,KACA,MACC,CAAC,EAAO,WAAW,CAAC,EAAO,cAAc,EAAO,eAAe,MAEhE,EAAa,SAAS,MAAM,GACzB,KAAW,CAAC,KAAc,EAAO,YAAY;GAChD,IAAM,IAAS,EAAO;GACtB,AAAI,GAAQ,eAAe,CAAC,EAAO,QAAQ,mBAAmB,IAAG,EAAO,MAAM,IACzE,EAAW,SAAS,MAAM;EAChC;EACA,EAAS,UAAU;GAAE;GAAS;GAAY;EAAW;CACtD,GAAG;EAAC;EAAS;EAAY;CAAU,CAAC,GAEnC,kBAAC,OAAD;EACC,MAAK;EACL,cAAY;EACZ,WAAW,EACV,GACA,2IACA,CACD;EAPD,UAAA,CASC,kBAAC,WAAD;GACC,KAAK;GACL,cAAY;GACZ,UAAU;GACV,QAAQ,KAAW;GACnB,OAAO,KAAW;GAClB,WAAW,EACV,wJACA,KAAc,iBACf;GACA,iBAAiB,MAAU;IAC1B,EAAO,UAAU,EAAM;GACxB;GACA,uBAAuB,MAAU;IAChC,IAAM,IAAU,EAAM,OAAmB,QACxC,oCACD;IACA,AAAI,MAAQ,EAAO,UAAU;GAC9B;GAEC,UAAA;EACO,CAAA,GACT,kBAAC,WAAD;GACC,KAAK;GACL,cAAY;GACZ,UAAU;GACV,QAAQ,KAAW,CAAC;GACpB,OAAO,KAAW,CAAC;GACnB,WAAW,EACV,0HACA,CAAC,KAAc,iBAChB;GATD,UAAA;IAWE,KAAW,KACX,kBAAC,OAAD;KAAK,WAAU;KACd,UAAA,kBAAC,GAAD;MAAQ,MAAK;MAAK,SAAQ;MAAQ,eAAe,EAAmB,EAAK;MAAzE,UAAA,CACC,kBAAC,GAAD,CAAY,CAAA,GACX,CACM;;IACJ,CAAA;IAEN,kBAAC,OAAD;KAAK,QAAQ,CAAC;KAAY,OAAO,CAAC;KAChC;IACG,CAAA;IACJ,CAAC,KAAc;GACR;EACL,CAAA,CAAA;;AAEP"}
@@ -1,44 +1,45 @@
1
1
  "use client";
2
2
  import { cn as e } from "../utils/cn.js";
3
- import { Tooltip as t, TooltipContent as n, TooltipProvider as r, TooltipTrigger as i } from "./tooltip.js";
4
- import { Info as a } from "lucide-react";
5
- import { jsx as o, jsxs as s } from "react/jsx-runtime";
3
+ import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
4
+ import { Tooltip as n, TooltipContent as r, TooltipProvider as i, TooltipTrigger as a } from "./tooltip.js";
5
+ import { Info as o } from "lucide-react";
6
+ import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
7
  //#region src/components/section-rule.tsx
7
- function c({ title: c, hint: l, actions: u, className: d, children: f, ...p }) {
8
- return /* @__PURE__ */ s("section", {
9
- className: e("space-y-3", d),
10
- ...p,
11
- children: [/* @__PURE__ */ s("div", {
12
- className: "flex items-center gap-3",
8
+ function l({ title: l, hint: u, actions: d, className: f, children: p, ...m }) {
9
+ return /* @__PURE__ */ c("section", {
10
+ className: e(t, "space-y-3", f),
11
+ ...m,
12
+ children: [/* @__PURE__ */ c("div", {
13
+ className: "flex flex-wrap items-center gap-3",
13
14
  children: [
14
- /* @__PURE__ */ s("div", {
15
+ /* @__PURE__ */ c("div", {
15
16
  className: "flex min-w-0 items-center gap-1.5",
16
- children: [/* @__PURE__ */ o("h2", {
17
+ children: [/* @__PURE__ */ s("h2", {
17
18
  className: "text-xs font-medium tracking-wider text-basalt-muted-foreground uppercase",
18
- children: c
19
- }), l ? /* @__PURE__ */ o(r, { children: /* @__PURE__ */ s(t, { children: [/* @__PURE__ */ o(i, {
19
+ children: l
20
+ }), u ? /* @__PURE__ */ s(i, { children: /* @__PURE__ */ c(n, { children: [/* @__PURE__ */ s(a, {
20
21
  asChild: !0,
21
- children: /* @__PURE__ */ o("button", {
22
+ children: /* @__PURE__ */ s("button", {
22
23
  type: "button",
23
24
  "aria-label": "More information",
24
25
  className: "inline-flex size-4 shrink-0 items-center justify-center text-basalt-muted-foreground hover:text-basalt-foreground",
25
- children: /* @__PURE__ */ o(a, { className: "size-3.5" })
26
+ children: /* @__PURE__ */ s(o, { className: "size-3.5" })
26
27
  })
27
- }), /* @__PURE__ */ o(n, { children: l })] }) }) : null]
28
+ }), /* @__PURE__ */ s(r, { children: u })] }) }) : null]
28
29
  }),
29
- /* @__PURE__ */ o("div", {
30
+ /* @__PURE__ */ s("div", {
30
31
  className: "h-px min-w-4 flex-1 border-t border-dashed border-basalt-border",
31
32
  "aria-hidden": "true"
32
33
  }),
33
- u ? /* @__PURE__ */ o("div", {
34
- className: "flex shrink-0 flex-wrap items-center justify-end gap-2",
35
- children: u
34
+ d ? /* @__PURE__ */ s("div", {
35
+ className: "flex min-w-0 max-w-full shrink-0 flex-wrap items-center justify-end gap-2",
36
+ children: d
36
37
  }) : null
37
38
  ]
38
- }), f]
39
+ }), p]
39
40
  });
40
41
  }
41
42
  //#endregion
42
- export { c as SectionRule };
43
+ export { l as SectionRule };
43
44
 
44
45
  //# sourceMappingURL=section-rule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"section-rule.js","names":[],"sources":["../../src/components/section-rule.tsx"],"sourcesContent":["import { Info } from \"lucide-react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"./tooltip\";\n\nexport type SectionRuleProps = Omit<HTMLAttributes<HTMLElement>, \"title\"> & {\n\t/** Section title shown before the dashed rule. */\n\ttitle: ReactNode;\n\t/** Info tooltip beside the title. */\n\thint?: ReactNode;\n\t/** Actions on the right of the dashed rule. */\n\tactions?: ReactNode;\n};\n\nexport function SectionRule({\n\ttitle,\n\thint,\n\tactions,\n\tclassName,\n\tchildren,\n\t...props\n}: SectionRuleProps) {\n\treturn (\n\t\t<section className={cn(\"space-y-3\", className)} {...props}>\n\t\t\t<div className=\"flex items-center gap-3\">\n\t\t\t\t<div className=\"flex min-w-0 items-center gap-1.5\">\n\t\t\t\t\t<h2 className=\"text-xs font-medium tracking-wider text-basalt-muted-foreground uppercase\">\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</h2>\n\t\t\t\t\t{hint ? (\n\t\t\t\t\t\t<TooltipProvider>\n\t\t\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\taria-label=\"More information\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"inline-flex size-4 shrink-0 items-center justify-center text-basalt-muted-foreground hover:text-basalt-foreground\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Info className=\"size-3.5\" />\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t\t\t<TooltipContent>{hint}</TooltipContent>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t</TooltipProvider>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"h-px min-w-4 flex-1 border-t border-dashed border-basalt-border\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t{actions ? (\n\t\t\t\t\t<div className=\"flex shrink-0 flex-wrap items-center justify-end gap-2\">{actions}</div>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n"],"mappings":";;;;;;AAcA,SAAgB,EAAY,EAC3B,UACA,SACA,YACA,cACA,aACA,GAAG,KACiB;CACpB,OACC,kBAAC,WAAD;EAAS,WAAW,EAAG,aAAa,CAAS;EAAG,GAAI;EAApD,UAAA,CACC,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACC,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACC,kBAAC,MAAD;MAAI,WAAU;MACZ,UAAA;KACE,CAAA,GACH,IACA,kBAAC,GAAD,EAAA,UACC,kBAAC,GAAD,EAAA,UAAA,CACC,kBAAC,GAAD;MAAgB,SAAA;MACf,UAAA,kBAAC,UAAD;OACC,MAAK;OACL,cAAW;OACX,WAAU;OAEV,UAAA,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;MACrB,CAAA;KACO,CAAA,GAChB,kBAAC,GAAD,EAAA,UAAiB,EAAqB,CAAA,CAC9B,EAAA,CAAA,EACO,CAAA,IACd,IACA;;IACL,kBAAC,OAAD;KACC,WAAU;KACV,eAAY;IACZ,CAAA;IACA,IACA,kBAAC,OAAD;KAAK,WAAU;KAA0D,UAAA;IAAa,CAAA,IACnF;GACA;EACJ,CAAA,GAAA,CACO;;AAEX"}
1
+ {"version":3,"file":"section-rule.js","names":[],"sources":["../../src/components/section-rule.tsx"],"sourcesContent":["import { Info } from \"lucide-react\";\nimport type { HTMLAttributes, ReactNode } from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from \"./tooltip\";\n\nexport type SectionRuleProps = Omit<HTMLAttributes<HTMLElement>, \"title\"> & {\n\t/** Section title shown before the dashed rule. */\n\ttitle: ReactNode;\n\t/** Info tooltip beside the title. */\n\thint?: ReactNode;\n\t/** Actions on the right of the dashed rule. */\n\tactions?: ReactNode;\n};\n\nexport function SectionRule({\n\ttitle,\n\thint,\n\tactions,\n\tclassName,\n\tchildren,\n\t...props\n}: SectionRuleProps) {\n\treturn (\n\t\t<section className={cn(BASALT_UI_CLASS, \"space-y-3\", className)} {...props}>\n\t\t\t<div className=\"flex flex-wrap items-center gap-3\">\n\t\t\t\t<div className=\"flex min-w-0 items-center gap-1.5\">\n\t\t\t\t\t<h2 className=\"text-xs font-medium tracking-wider text-basalt-muted-foreground uppercase\">\n\t\t\t\t\t\t{title}\n\t\t\t\t\t</h2>\n\t\t\t\t\t{hint ? (\n\t\t\t\t\t\t<TooltipProvider>\n\t\t\t\t\t\t\t<Tooltip>\n\t\t\t\t\t\t\t\t<TooltipTrigger asChild>\n\t\t\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\t\t\taria-label=\"More information\"\n\t\t\t\t\t\t\t\t\t\tclassName=\"inline-flex size-4 shrink-0 items-center justify-center text-basalt-muted-foreground hover:text-basalt-foreground\"\n\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t<Info className=\"size-3.5\" />\n\t\t\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t\t\t</TooltipTrigger>\n\t\t\t\t\t\t\t\t<TooltipContent>{hint}</TooltipContent>\n\t\t\t\t\t\t\t</Tooltip>\n\t\t\t\t\t\t</TooltipProvider>\n\t\t\t\t\t) : null}\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"h-px min-w-4 flex-1 border-t border-dashed border-basalt-border\"\n\t\t\t\t\taria-hidden=\"true\"\n\t\t\t\t/>\n\t\t\t\t{actions ? (\n\t\t\t\t\t<div className=\"flex min-w-0 max-w-full shrink-0 flex-wrap items-center justify-end gap-2\">\n\t\t\t\t\t\t{actions}\n\t\t\t\t\t</div>\n\t\t\t\t) : null}\n\t\t\t</div>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n"],"mappings":";;;;;;;AAeA,SAAgB,EAAY,EAC3B,UACA,SACA,YACA,cACA,aACA,GAAG,KACiB;CACpB,OACC,kBAAC,WAAD;EAAS,WAAW,EAAG,GAAiB,aAAa,CAAS;EAAG,GAAI;EAArE,UAAA,CACC,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA;IACC,kBAAC,OAAD;KAAK,WAAU;KAAf,UAAA,CACC,kBAAC,MAAD;MAAI,WAAU;MACZ,UAAA;KACE,CAAA,GACH,IACA,kBAAC,GAAD,EAAA,UACC,kBAAC,GAAD,EAAA,UAAA,CACC,kBAAC,GAAD;MAAgB,SAAA;MACf,UAAA,kBAAC,UAAD;OACC,MAAK;OACL,cAAW;OACX,WAAU;OAEV,UAAA,kBAAC,GAAD,EAAM,WAAU,WAAY,CAAA;MACrB,CAAA;KACO,CAAA,GAChB,kBAAC,GAAD,EAAA,UAAiB,EAAqB,CAAA,CAC9B,EAAA,CAAA,EACO,CAAA,IACd,IACA;;IACL,kBAAC,OAAD;KACC,WAAU;KACV,eAAY;IACZ,CAAA;IACA,IACA,kBAAC,OAAD;KAAK,WAAU;KACb,UAAA;IACG,CAAA,IACF;GACA;EACJ,CAAA,GAAA,CACO;;AAEX"}
@@ -22,7 +22,15 @@ export type SelectValueProps = Omit<React.ComponentPropsWithoutRef<typeof Select
22
22
  placeholder?: React.ReactNode;
23
23
  };
24
24
  export declare const SelectValue: React.ForwardRefExoticComponent<SelectValueProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Value>>>;
25
- export type SelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;
25
+ type RadixSelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;
26
+ export type SelectGroupProps = Omit<RadixSelectGroupProps, "asChild"> & {
27
+ /**
28
+ * Change the default rendered div element to the child element, merging props and behavior.
29
+ * Group forwards ref to HTMLDivElement and inherits native div attributes.
30
+ * @default false
31
+ */
32
+ asChild?: RadixSelectGroupProps["asChild"];
33
+ };
26
34
  export declare const SelectGroup: React.ForwardRefExoticComponent<SelectGroupProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Group>>>;
27
35
  export type SelectSize = "sm" | "default" | "lg";
28
36
  export type SelectTriggerProps = Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>, "disabled"> & {
@@ -59,8 +67,23 @@ export declare const SelectTrigger: React.ForwardRefExoticComponent<Omit<Omit<Se
59
67
  */
60
68
  disabled?: boolean;
61
69
  } & React.RefAttributes<HTMLButtonElement>>;
62
- export type SelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;
63
- export declare const SelectLabel: React.ForwardRefExoticComponent<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
70
+ type RadixSelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;
71
+ export type SelectLabelProps = Omit<RadixSelectLabelProps, "asChild"> & {
72
+ /**
73
+ * Change the default rendered div element to the child element, merging props and behavior.
74
+ * Label forwards ref to HTMLDivElement and inherits native div attributes.
75
+ * @default false
76
+ */
77
+ asChild?: RadixSelectLabelProps["asChild"];
78
+ };
79
+ export declare const SelectLabel: React.ForwardRefExoticComponent<Omit<Omit<SelectPrimitive.SelectLabelProps & React.RefAttributes<HTMLDivElement>, "ref">, "asChild"> & {
80
+ /**
81
+ * Change the default rendered div element to the child element, merging props and behavior.
82
+ * Label forwards ref to HTMLDivElement and inherits native div attributes.
83
+ * @default false
84
+ */
85
+ asChild?: RadixSelectLabelProps["asChild"];
86
+ } & React.RefAttributes<HTMLDivElement>>;
64
87
  export type SelectContentProps = Omit<React.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>, "position" | "sideOffset"> & {
65
88
  /**
66
89
  * The positioning mode for the select content.
@@ -97,3 +120,4 @@ export declare const SelectItem: React.ForwardRefExoticComponent<Omit<Omit<Selec
97
120
  */
98
121
  value: string;
99
122
  } & React.RefAttributes<HTMLDivElement>>;
123
+ export {};