@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,7 +1,7 @@
1
1
  "use client";
2
2
  import { cn as e } from "../utils/cn.js";
3
- import { FOCUS_BORDER as t, overlayItemClass as n, overlayPanelClass as r } from "./overlay.js";
4
- import { controlSurfaceClass as i } from "../utils/control-surface.js";
3
+ import { controlSurfaceClass as t } from "../utils/control-surface.js";
4
+ import { FOCUS_BORDER as n, overlayItemClass as r, overlayPanelClass as i } from "./overlay.js";
5
5
  import * as a from "react";
6
6
  import { Check as o, ChevronDown as s } from "lucide-react";
7
7
  import { jsx as c, jsxs as l } from "react/jsx-runtime";
@@ -11,13 +11,13 @@ var d = u.Root, f = u.Value, p = u.Group, m = {
11
11
  sm: "h-8 px-2.5 text-xs",
12
12
  default: "h-9 px-3 text-sm",
13
13
  lg: "h-10 px-4 text-base"
14
- }, h = a.forwardRef(({ className: n, children: r, size: a = "default", loading: o = !1, disabled: d = !1, ...f }, p) => /* @__PURE__ */ l(u.Trigger, {
14
+ }, h = a.forwardRef(({ className: r, children: i, size: a = "default", loading: o = !1, disabled: d = !1, ...f }, p) => /* @__PURE__ */ l(u.Trigger, {
15
15
  ref: p,
16
16
  ...f,
17
17
  disabled: d || o,
18
18
  "aria-busy": o || void 0,
19
- className: i(e("flex w-full items-center justify-between", m[a], t, "aria-invalid:border-basalt-destructive aria-invalid:focus-visible:border-basalt-destructive", n)),
20
- children: [r, /* @__PURE__ */ c(s, { className: "h-4 w-4 opacity-50" })]
19
+ className: t(e("flex w-full items-center justify-between", m[a], n, "aria-invalid:border-basalt-destructive aria-invalid:focus-visible:border-basalt-destructive", r)),
20
+ children: [i, /* @__PURE__ */ c(s, { className: "h-4 w-4 opacity-50" })]
21
21
  }));
22
22
  h.displayName = u.Trigger.displayName;
23
23
  var g = a.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ c(u.Label, {
@@ -26,20 +26,20 @@ var g = a.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ c(u.Label, {
26
26
  ...n
27
27
  }));
28
28
  g.displayName = u.Label.displayName;
29
- var _ = a.forwardRef(({ className: t, children: n, position: i = "popper", sideOffset: a = 4, ...o }, s) => /* @__PURE__ */ c(u.Portal, { children: /* @__PURE__ */ c(u.Content, {
29
+ var _ = a.forwardRef(({ className: t, children: n, position: r = "popper", sideOffset: a = 4, ...o }, s) => /* @__PURE__ */ c(u.Portal, { children: /* @__PURE__ */ c(u.Content, {
30
30
  ref: s,
31
- position: i,
31
+ position: r,
32
32
  sideOffset: a,
33
- className: r(e(i === "popper" && "w-[var(--radix-select-trigger-width)]", t)),
33
+ className: i(e(r === "popper" && "w-[var(--radix-select-trigger-width)]", t)),
34
34
  ...o,
35
35
  children: /* @__PURE__ */ c(u.Viewport, { children: n })
36
36
  }) }));
37
37
  _.displayName = u.Content.displayName;
38
- var v = a.forwardRef(({ className: t, children: r, ...i }, a) => /* @__PURE__ */ l(u.Item, {
38
+ var v = a.forwardRef(({ className: t, children: n, ...i }, a) => /* @__PURE__ */ l(u.Item, {
39
39
  ref: a,
40
- className: n(e("relative pr-8 outline-hidden hover:bg-basalt-accent focus-visible:bg-basalt-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:hover:bg-transparent", t)),
40
+ className: r(e("relative pr-8 outline-hidden hover:bg-basalt-accent focus-visible:bg-basalt-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:hover:bg-transparent", t)),
41
41
  ...i,
42
- children: [/* @__PURE__ */ c(u.ItemText, { children: r }), /* @__PURE__ */ c(u.ItemIndicator, {
42
+ children: [/* @__PURE__ */ c(u.ItemText, { children: n }), /* @__PURE__ */ c(u.ItemIndicator, {
43
43
  className: "absolute right-2",
44
44
  children: /* @__PURE__ */ c(o, { className: "h-3.5 w-3.5" })
45
45
  })]
@@ -1 +1 @@
1
- {"version":3,"file":"select.js","names":[],"sources":["../../src/components/select.tsx"],"sourcesContent":["import * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { Check, ChevronDown } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { controlSurfaceClass } from \"../utils/control-surface\";\nimport { FOCUS_BORDER, OVERLAY_GAP, overlayItemClass, overlayPanelClass } from \"./overlay\";\n\nexport type SelectProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>,\n\t\"value\" | \"defaultValue\" | \"onValueChange\"\n> & {\n\t/**\n\t * The controlled value of the select.\n\t */\n\tvalue?: string;\n\t/**\n\t * The uncontrolled initial value of the select.\n\t */\n\tdefaultValue?: string;\n\t/**\n\t * Called when the selected value changes.\n\t */\n\tonValueChange?: (value: string) => void;\n};\nexport const Select: React.FC<SelectProps> = SelectPrimitive.Root;\n\nexport type SelectValueProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>,\n\t\"placeholder\"\n> & {\n\t/**\n\t * Content shown when no value is selected.\n\t */\n\tplaceholder?: React.ReactNode;\n};\nexport const SelectValue: React.ForwardRefExoticComponent<\n\tSelectValueProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Value>>\n> = SelectPrimitive.Value;\n\nexport type SelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;\nexport const SelectGroup: React.ForwardRefExoticComponent<\n\tSelectGroupProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Group>>\n> = SelectPrimitive.Group;\n\nexport type SelectSize = \"sm\" | \"default\" | \"lg\";\n\nconst SELECT_SIZE_CLASS: Record<SelectSize, string> = {\n\tsm: \"h-8 px-2.5 text-xs\",\n\tdefault: \"h-9 px-3 text-sm\",\n\tlg: \"h-10 px-4 text-base\",\n};\n\nexport type SelectTriggerProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n\t\"disabled\"\n> & {\n\t/**\n\t * The visual size of the trigger.\n\t * @default default\n\t */\n\tsize?: SelectSize;\n\t/**\n\t * Disable the trigger and mark it busy.\n\t * @default false\n\t */\n\tloading?: boolean;\n\t/**\n\t * Disable the trigger.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n};\n\nexport const SelectTrigger = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Trigger>,\n\tSelectTriggerProps\n>(({ className, children, size = \"default\", loading = false, disabled = false, ...props }, ref) => (\n\t<SelectPrimitive.Trigger\n\t\tref={ref}\n\t\t{...props}\n\t\tdisabled={disabled || loading}\n\t\taria-busy={loading || undefined}\n\t\tclassName={controlSurfaceClass(\n\t\t\tcn(\n\t\t\t\t\"flex w-full items-center justify-between\",\n\t\t\t\tSELECT_SIZE_CLASS[size],\n\t\t\t\tFOCUS_BORDER,\n\t\t\t\t\"aria-invalid:border-basalt-destructive aria-invalid:focus-visible:border-basalt-destructive\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t)}\n\t>\n\t\t{children}\n\t\t<ChevronDown className=\"h-4 w-4 opacity-50\" />\n\t</SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\nexport type SelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;\n\nexport const SelectLabel = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Label>,\n\tSelectLabelProps\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.Label\n\t\tref={ref}\n\t\tclassName={cn(\"px-2 py-1.5 text-xs text-basalt-muted-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nexport type SelectContentProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>,\n\t\"position\" | \"sideOffset\"\n> & {\n\t/**\n\t * The positioning mode for the select content.\n\t * @default popper\n\t */\n\tposition?: \"item-aligned\" | \"popper\";\n\t/**\n\t * The distance between the trigger and the select content.\n\t * @default 4\n\t */\n\tsideOffset?: number;\n};\n\nexport const SelectContent = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Content>,\n\tSelectContentProps\n>(({ className, children, position = \"popper\", sideOffset = OVERLAY_GAP, ...props }, ref) => (\n\t<SelectPrimitive.Portal>\n\t\t<SelectPrimitive.Content\n\t\t\tref={ref}\n\t\t\tposition={position}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={overlayPanelClass(\n\t\t\t\tcn(position === \"popper\" && \"w-[var(--radix-select-trigger-width)]\", className),\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SelectPrimitive.Viewport>{children}</SelectPrimitive.Viewport>\n\t\t</SelectPrimitive.Content>\n\t</SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nexport type SelectItemProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>,\n\t\"value\"\n> & {\n\t/**\n\t * The value associated with the select item.\n\t */\n\tvalue: string;\n};\n\nexport const SelectItem = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Item>,\n\tSelectItemProps\n>(({ className, children, ...props }, ref) => (\n\t<SelectPrimitive.Item\n\t\tref={ref}\n\t\tclassName={overlayItemClass(\n\t\t\tcn(\n\t\t\t\t\"relative pr-8 outline-hidden hover:bg-basalt-accent focus-visible:bg-basalt-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:hover:bg-transparent\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t<SelectPrimitive.ItemIndicator className=\"absolute right-2\">\n\t\t\t<Check className=\"h-3.5 w-3.5\" />\n\t\t</SelectPrimitive.ItemIndicator>\n\t</SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n"],"mappings":";;;;;;;;;AAwBA,IAAa,IAAgC,EAAgB,MAWhD,IAET,EAAgB,OAGP,IAET,EAAgB,OAId,IAAgD;CACrD,IAAI;CACJ,SAAS;CACT,IAAI;AACL,GAuBa,IAAgB,EAAM,YAGhC,EAAE,cAAW,aAAU,UAAO,WAAW,aAAU,IAAO,cAAW,IAAO,GAAG,KAAS,MAC1F,kBAAC,EAAgB,SAAjB;CACM;CACL,GAAI;CACJ,UAAU,KAAY;CACtB,aAAW,KAAW,KAAA;CACtB,WAAW,EACV,EACC,4CACA,EAAkB,IAClB,GACA,+FACA,CACD,CACD;CAbD,UAAA,CAeE,GACD,kBAAC,GAAD,EAAa,WAAU,qBAAsB,CAAA,CACrB;AACzB,CAAA,CAAA;AACD,EAAc,cAAc,EAAgB,QAAQ;AAIpD,IAAa,IAAc,EAAM,YAG9B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAgB,OAAjB;CACM;CACL,WAAW,EAAG,oDAAoD,CAAS;CAC3E,GAAI;AACJ,CAAA,CACD;AACD,EAAY,cAAc,EAAgB,MAAM;AAkBhD,IAAa,IAAgB,EAAM,YAGhC,EAAE,cAAW,aAAU,cAAW,UAAU,gBAAA,GAA0B,GAAG,KAAS,MACpF,kBAAC,EAAgB,QAAjB,EAAA,UACC,kBAAC,EAAgB,SAAjB;CACM;CACK;CACE;CACZ,WAAW,EACV,EAAG,MAAa,YAAY,yCAAyC,CAAS,CAC/E;CACA,GAAI;CAEJ,UAAA,kBAAC,EAAgB,UAAjB,EAA2B,YAAmC,CAAA;AACtC,CAAA,EACF,CAAA,CACxB;AACD,EAAc,cAAc,EAAgB,QAAQ;AAYpD,IAAa,IAAa,EAAM,YAG7B,EAAE,cAAW,aAAU,GAAG,KAAS,MACrC,kBAAC,EAAgB,MAAjB;CACM;CACL,WAAW,EACV,EACC,0LACA,CACD,CACD;CACA,GAAI;CARL,UAAA,CAUC,kBAAC,EAAgB,UAAjB,EAA2B,YAAmC,CAAA,GAC9D,kBAAC,EAAgB,eAAjB;EAA+B,WAAU;EACxC,UAAA,kBAAC,GAAD,EAAO,WAAU,cAAe,CAAA;CACF,CAAA,CACV;AACtB,CAAA,CAAA;AACD,EAAW,cAAc,EAAgB,KAAK"}
1
+ {"version":3,"file":"select.js","names":[],"sources":["../../src/components/select.tsx"],"sourcesContent":["import * as SelectPrimitive from \"@radix-ui/react-select\";\nimport { Check, ChevronDown } from \"lucide-react\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { controlSurfaceClass } from \"../utils/control-surface\";\nimport { FOCUS_BORDER, OVERLAY_GAP, overlayItemClass, overlayPanelClass } from \"./overlay\";\n\nexport type SelectProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Root>,\n\t\"value\" | \"defaultValue\" | \"onValueChange\"\n> & {\n\t/**\n\t * The controlled value of the select.\n\t */\n\tvalue?: string;\n\t/**\n\t * The uncontrolled initial value of the select.\n\t */\n\tdefaultValue?: string;\n\t/**\n\t * Called when the selected value changes.\n\t */\n\tonValueChange?: (value: string) => void;\n};\nexport const Select: React.FC<SelectProps> = SelectPrimitive.Root;\n\nexport type SelectValueProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Value>,\n\t\"placeholder\"\n> & {\n\t/**\n\t * Content shown when no value is selected.\n\t */\n\tplaceholder?: React.ReactNode;\n};\nexport const SelectValue: React.ForwardRefExoticComponent<\n\tSelectValueProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Value>>\n> = SelectPrimitive.Value;\n\ntype RadixSelectGroupProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Group>;\nexport type SelectGroupProps = Omit<RadixSelectGroupProps, \"asChild\"> & {\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Group forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixSelectGroupProps[\"asChild\"];\n};\nexport const SelectGroup: React.ForwardRefExoticComponent<\n\tSelectGroupProps & React.RefAttributes<React.ElementRef<typeof SelectPrimitive.Group>>\n> = SelectPrimitive.Group;\n\nexport type SelectSize = \"sm\" | \"default\" | \"lg\";\n\nconst SELECT_SIZE_CLASS: Record<SelectSize, string> = {\n\tsm: \"h-8 px-2.5 text-xs\",\n\tdefault: \"h-9 px-3 text-sm\",\n\tlg: \"h-10 px-4 text-base\",\n};\n\nexport type SelectTriggerProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Trigger>,\n\t\"disabled\"\n> & {\n\t/**\n\t * The visual size of the trigger.\n\t * @default default\n\t */\n\tsize?: SelectSize;\n\t/**\n\t * Disable the trigger and mark it busy.\n\t * @default false\n\t */\n\tloading?: boolean;\n\t/**\n\t * Disable the trigger.\n\t * @default false\n\t */\n\tdisabled?: boolean;\n};\n\nexport const SelectTrigger = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Trigger>,\n\tSelectTriggerProps\n>(({ className, children, size = \"default\", loading = false, disabled = false, ...props }, ref) => (\n\t<SelectPrimitive.Trigger\n\t\tref={ref}\n\t\t{...props}\n\t\tdisabled={disabled || loading}\n\t\taria-busy={loading || undefined}\n\t\tclassName={controlSurfaceClass(\n\t\t\tcn(\n\t\t\t\t\"flex w-full items-center justify-between\",\n\t\t\t\tSELECT_SIZE_CLASS[size],\n\t\t\t\tFOCUS_BORDER,\n\t\t\t\t\"aria-invalid:border-basalt-destructive aria-invalid:focus-visible:border-basalt-destructive\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t)}\n\t>\n\t\t{children}\n\t\t<ChevronDown className=\"h-4 w-4 opacity-50\" />\n\t</SelectPrimitive.Trigger>\n));\nSelectTrigger.displayName = SelectPrimitive.Trigger.displayName;\n\ntype RadixSelectLabelProps = React.ComponentPropsWithoutRef<typeof SelectPrimitive.Label>;\nexport type SelectLabelProps = Omit<RadixSelectLabelProps, \"asChild\"> & {\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Label forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixSelectLabelProps[\"asChild\"];\n};\n\nexport const SelectLabel = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Label>,\n\tSelectLabelProps\n>(({ className, ...props }, ref) => (\n\t<SelectPrimitive.Label\n\t\tref={ref}\n\t\tclassName={cn(\"px-2 py-1.5 text-xs text-basalt-muted-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nSelectLabel.displayName = SelectPrimitive.Label.displayName;\n\nexport type SelectContentProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Content>,\n\t\"position\" | \"sideOffset\"\n> & {\n\t/**\n\t * The positioning mode for the select content.\n\t * @default popper\n\t */\n\tposition?: \"item-aligned\" | \"popper\";\n\t/**\n\t * The distance between the trigger and the select content.\n\t * @default 4\n\t */\n\tsideOffset?: number;\n};\n\nexport const SelectContent = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Content>,\n\tSelectContentProps\n>(({ className, children, position = \"popper\", sideOffset = OVERLAY_GAP, ...props }, ref) => (\n\t<SelectPrimitive.Portal>\n\t\t<SelectPrimitive.Content\n\t\t\tref={ref}\n\t\t\tposition={position}\n\t\t\tsideOffset={sideOffset}\n\t\t\tclassName={overlayPanelClass(\n\t\t\t\tcn(position === \"popper\" && \"w-[var(--radix-select-trigger-width)]\", className),\n\t\t\t)}\n\t\t\t{...props}\n\t\t>\n\t\t\t<SelectPrimitive.Viewport>{children}</SelectPrimitive.Viewport>\n\t\t</SelectPrimitive.Content>\n\t</SelectPrimitive.Portal>\n));\nSelectContent.displayName = SelectPrimitive.Content.displayName;\n\nexport type SelectItemProps = Omit<\n\tReact.ComponentPropsWithoutRef<typeof SelectPrimitive.Item>,\n\t\"value\"\n> & {\n\t/**\n\t * The value associated with the select item.\n\t */\n\tvalue: string;\n};\n\nexport const SelectItem = React.forwardRef<\n\tReact.ElementRef<typeof SelectPrimitive.Item>,\n\tSelectItemProps\n>(({ className, children, ...props }, ref) => (\n\t<SelectPrimitive.Item\n\t\tref={ref}\n\t\tclassName={overlayItemClass(\n\t\t\tcn(\n\t\t\t\t\"relative pr-8 outline-hidden hover:bg-basalt-accent focus-visible:bg-basalt-accent data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[disabled]:hover:bg-transparent\",\n\t\t\t\tclassName,\n\t\t\t),\n\t\t)}\n\t\t{...props}\n\t>\n\t\t<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>\n\t\t<SelectPrimitive.ItemIndicator className=\"absolute right-2\">\n\t\t\t<Check className=\"h-3.5 w-3.5\" />\n\t\t</SelectPrimitive.ItemIndicator>\n\t</SelectPrimitive.Item>\n));\nSelectItem.displayName = SelectPrimitive.Item.displayName;\n"],"mappings":";;;;;;;;;AAwBA,IAAa,IAAgC,EAAgB,MAWhD,IAET,EAAgB,OAWP,IAET,EAAgB,OAId,IAAgD;CACrD,IAAI;CACJ,SAAS;CACT,IAAI;AACL,GAuBa,IAAgB,EAAM,YAGhC,EAAE,cAAW,aAAU,UAAO,WAAW,aAAU,IAAO,cAAW,IAAO,GAAG,KAAS,MAC1F,kBAAC,EAAgB,SAAjB;CACM;CACL,GAAI;CACJ,UAAU,KAAY;CACtB,aAAW,KAAW,KAAA;CACtB,WAAW,EACV,EACC,4CACA,EAAkB,IAClB,GACA,+FACA,CACD,CACD;CAbD,UAAA,CAeE,GACD,kBAAC,GAAD,EAAa,WAAU,qBAAsB,CAAA,CACrB;AACzB,CAAA,CAAA;AACD,EAAc,cAAc,EAAgB,QAAQ;AAYpD,IAAa,IAAc,EAAM,YAG9B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAgB,OAAjB;CACM;CACL,WAAW,EAAG,oDAAoD,CAAS;CAC3E,GAAI;AACJ,CAAA,CACD;AACD,EAAY,cAAc,EAAgB,MAAM;AAkBhD,IAAa,IAAgB,EAAM,YAGhC,EAAE,cAAW,aAAU,cAAW,UAAU,gBAAA,GAA0B,GAAG,KAAS,MACpF,kBAAC,EAAgB,QAAjB,EAAA,UACC,kBAAC,EAAgB,SAAjB;CACM;CACK;CACE;CACZ,WAAW,EACV,EAAG,MAAa,YAAY,yCAAyC,CAAS,CAC/E;CACA,GAAI;CAEJ,UAAA,kBAAC,EAAgB,UAAjB,EAA2B,YAAmC,CAAA;AACtC,CAAA,EACF,CAAA,CACxB;AACD,EAAc,cAAc,EAAgB,QAAQ;AAYpD,IAAa,IAAa,EAAM,YAG7B,EAAE,cAAW,aAAU,GAAG,KAAS,MACrC,kBAAC,EAAgB,MAAjB;CACM;CACL,WAAW,EACV,EACC,0LACA,CACD,CACD;CACA,GAAI;CARL,UAAA,CAUC,kBAAC,EAAgB,UAAjB,EAA2B,YAAmC,CAAA,GAC9D,kBAAC,EAAgB,eAAjB;EAA+B,WAAU;EACxC,UAAA,kBAAC,GAAD,EAAO,WAAU,cAAe,CAAA;CACF,CAAA,CACV;AACtB,CAAA,CAAA;AACD,EAAW,cAAc,EAAgB,KAAK"}
@@ -1,25 +1,129 @@
1
1
  import * as DialogPrimitive from "@radix-ui/react-dialog";
2
2
  import * as React from "react";
3
- export declare const Sheet: React.FC<DialogPrimitive.DialogProps>;
3
+ type RadixDialogProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;
4
+ type RadixDialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;
5
+ type RadixDialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;
6
+ type RadixDialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;
7
+ type RadixDialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;
8
+ type RadixDialogDescriptionProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>;
9
+ export interface SheetProps extends Omit<RadixDialogProps, "open" | "defaultOpen" | "onOpenChange" | "modal"> {
10
+ /**
11
+ * Controlled open state of the sheet drawer.
12
+ */
13
+ open?: RadixDialogProps["open"];
14
+ /**
15
+ * Uncontrolled default open state of the sheet on initial render.
16
+ * @default false
17
+ */
18
+ defaultOpen?: RadixDialogProps["defaultOpen"];
19
+ /**
20
+ * Callback invoked when the open state changes.
21
+ */
22
+ onOpenChange?: RadixDialogProps["onOpenChange"];
23
+ /**
24
+ * Whether the sheet renders modally, preventing outside interaction and hiding background content from screen readers.
25
+ * @default true
26
+ */
27
+ modal?: RadixDialogProps["modal"];
28
+ }
29
+ export declare const Sheet: React.FC<SheetProps>;
30
+ export interface SheetTriggerProps extends Omit<RadixDialogTriggerProps, "asChild"> {
31
+ /**
32
+ * Change the default rendered button element to the child element, merging props and behavior.
33
+ * Trigger forwards ref to HTMLButtonElement and inherits native button attributes.
34
+ * @default false
35
+ */
36
+ asChild?: RadixDialogTriggerProps["asChild"];
37
+ }
4
38
  export declare const SheetTrigger: React.ForwardRefExoticComponent<DialogPrimitive.DialogTriggerProps & React.RefAttributes<HTMLButtonElement>>;
39
+ export interface SheetCloseProps extends Omit<RadixDialogCloseProps, "asChild"> {
40
+ /**
41
+ * Change the default rendered button element to the child element, merging props and behavior.
42
+ * Close forwards ref to HTMLButtonElement and inherits native button attributes.
43
+ * @default false
44
+ */
45
+ asChild?: RadixDialogCloseProps["asChild"];
46
+ }
5
47
  export declare const SheetClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
6
- export declare const SheetTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
7
- export declare const SheetDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
48
+ export interface SheetTitleProps extends Omit<RadixDialogTitleProps, "asChild"> {
49
+ /**
50
+ * Change the default rendered heading element to the child element, merging props and behavior.
51
+ * Title forwards ref to HTMLHeadingElement and inherits native h2 attributes.
52
+ * @default false
53
+ */
54
+ asChild?: RadixDialogTitleProps["asChild"];
55
+ }
56
+ export declare const SheetTitle: React.ForwardRefExoticComponent<SheetTitleProps & React.RefAttributes<HTMLHeadingElement>>;
57
+ export interface SheetDescriptionProps extends Omit<RadixDialogDescriptionProps, "asChild"> {
58
+ /**
59
+ * Change the default rendered paragraph element to the child element, merging props and behavior.
60
+ * Description forwards ref to HTMLParagraphElement and inherits native p attributes.
61
+ * @default false
62
+ */
63
+ asChild?: RadixDialogDescriptionProps["asChild"];
64
+ }
65
+ export declare const SheetDescription: React.ForwardRefExoticComponent<SheetDescriptionProps & React.RefAttributes<HTMLParagraphElement>>;
8
66
  declare const SIDE: {
9
- readonly right: "fixed inset-y-0 right-0 box-border flex h-full w-80 flex-col gap-3 border-l border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg";
10
- readonly left: "fixed inset-y-0 left-0 box-border flex h-full w-80 flex-col gap-3 border-r border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg";
11
- readonly top: "fixed inset-x-0 top-0 box-border flex h-80 w-full flex-col gap-3 border-b border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg";
12
- readonly bottom: "fixed inset-x-0 bottom-0 box-border flex h-80 w-full flex-col gap-3 border-t border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg";
67
+ readonly right: "fixed inset-y-0 right-0 basalt-ui flex h-full w-80 flex-col gap-3 border-l border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg";
68
+ readonly left: "fixed inset-y-0 left-0 basalt-ui flex h-full w-80 flex-col gap-3 border-r border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg";
69
+ readonly top: "fixed inset-x-0 top-0 basalt-ui flex h-80 w-full flex-col gap-3 border-b border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg";
70
+ readonly bottom: "fixed inset-x-0 bottom-0 basalt-ui flex h-80 w-full flex-col gap-3 border-t border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg";
13
71
  };
14
72
  export type SheetSide = keyof typeof SIDE;
15
- export declare const SheetContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
73
+ export interface SheetContentProps extends Omit<RadixDialogContentProps, "side" | "asChild" | "forceMount" | "trapFocus" | "onOpenAutoFocus" | "onCloseAutoFocus" | "onEscapeKeyDown" | "onPointerDownOutside" | "onFocusOutside" | "onInteractOutside"> {
74
+ /**
75
+ * Edge of the screen where the drawer panel is positioned and anchored.
76
+ * @default "right"
77
+ */
16
78
  side?: SheetSide;
17
- } & React.RefAttributes<HTMLDivElement>>;
18
- export declare function SheetHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
79
+ /**
80
+ * Change the default rendered div element to the child element, merging props and behavior.
81
+ * Content forwards ref to HTMLDivElement and inherits native div attributes.
82
+ * @default false
83
+ */
84
+ asChild?: RadixDialogContentProps["asChild"];
85
+ /**
86
+ * Force mounting content in DOM for external animation controls.
87
+ * When forceMount is true, the content remains mounted even when closed.
88
+ * The caller is responsible for visibility transitions and unmounting after animation completes.
89
+ * Note: Keeping modal content forceMounted may isolate background interactions until unmounted.
90
+ */
91
+ forceMount?: RadixDialogContentProps["forceMount"];
92
+ /**
93
+ * Event handler called when auto-focusing the first element on open. Can be prevented with event.preventDefault().
94
+ */
95
+ onOpenAutoFocus?: RadixDialogContentProps["onOpenAutoFocus"];
96
+ /**
97
+ * Event handler called when restoring focus on close. Can be prevented with event.preventDefault().
98
+ */
99
+ onCloseAutoFocus?: RadixDialogContentProps["onCloseAutoFocus"];
100
+ /**
101
+ * Event handler called when the Escape key is pressed. Can be prevented with event.preventDefault().
102
+ */
103
+ onEscapeKeyDown?: RadixDialogContentProps["onEscapeKeyDown"];
104
+ /**
105
+ * Event handler called when a pointer event occurs outside the sheet bounds.
106
+ */
107
+ onPointerDownOutside?: RadixDialogContentProps["onPointerDownOutside"];
108
+ /**
109
+ * Event handler called when focus moves outside the sheet bounds.
110
+ */
111
+ onFocusOutside?: RadixDialogContentProps["onFocusOutside"];
112
+ /**
113
+ * Event handler called when any interaction (pointer or focus) occurs outside the sheet bounds.
114
+ */
115
+ onInteractOutside?: RadixDialogContentProps["onInteractOutside"];
116
+ }
117
+ export declare const SheetContent: React.ForwardRefExoticComponent<SheetContentProps & React.RefAttributes<HTMLDivElement>>;
118
+ export interface SheetHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
119
+ }
120
+ export declare function SheetHeader({ className, ...props }: SheetHeaderProps): React.JSX.Element;
19
121
  export declare namespace SheetHeader {
20
122
  var displayName: string;
21
123
  }
22
- export declare function SheetFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
124
+ export interface SheetFooterProps extends React.HTMLAttributes<HTMLDivElement> {
125
+ }
126
+ export declare function SheetFooter({ className, ...props }: SheetFooterProps): React.JSX.Element;
23
127
  export declare namespace SheetFooter {
24
128
  var displayName: string;
25
129
  }
@@ -1,50 +1,57 @@
1
1
  "use client";
2
2
  import { cn as e } from "../utils/cn.js";
3
- import { OVERLAY_LAYER as t, OVERLAY_MOTION as n } from "./overlay.js";
4
- import * as r from "react";
5
- import { jsx as i, jsxs as a } from "react/jsx-runtime";
6
- import * as o from "@radix-ui/react-dialog";
3
+ import { BASALT_UI_CLASS as t } from "../utils/control-surface.js";
4
+ import { OVERLAY_LAYER as n, OVERLAY_MOTION as r } from "./overlay.js";
5
+ import * as i from "react";
6
+ import { jsx as a, jsxs as o } from "react/jsx-runtime";
7
+ import * as s from "@radix-ui/react-dialog";
7
8
  //#region src/components/sheet.tsx
8
- var s = o.Root, c = o.Trigger, l = o.Close, u = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Title, {
9
+ var c = s.Root, l = s.Trigger, u = s.Close, d = i.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(s.Title, {
9
10
  ref: r,
10
11
  className: e("text-lg font-semibold leading-none tracking-tight", t),
11
12
  ...n
12
13
  }));
13
- u.displayName = o.Title.displayName;
14
- var d = r.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ i(o.Description, {
14
+ d.displayName = s.Title.displayName;
15
+ var f = i.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ a(s.Description, {
15
16
  ref: r,
16
17
  className: e("text-sm text-basalt-muted-foreground", t),
17
18
  ...n
18
19
  }));
19
- d.displayName = o.Description.displayName;
20
- var f = {
21
- right: "fixed inset-y-0 right-0 box-border flex h-full w-80 flex-col gap-3 border-l border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg",
22
- left: "fixed inset-y-0 left-0 box-border flex h-full w-80 flex-col gap-3 border-r border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg",
23
- top: "fixed inset-x-0 top-0 box-border flex h-80 w-full flex-col gap-3 border-b border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg",
24
- bottom: "fixed inset-x-0 bottom-0 box-border flex h-80 w-full flex-col gap-3 border-t border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg"
25
- }, p = r.forwardRef(({ className: r, side: s = "right", children: c, ...l }, u) => /* @__PURE__ */ a(o.Portal, { children: [/* @__PURE__ */ i(o.Overlay, { className: e("fixed inset-0 bg-black/50 backdrop-blur-xs", t, n) }), /* @__PURE__ */ i(o.Content, {
26
- ref: u,
27
- "data-basalt-surface-root": "",
28
- className: e(t, n, f[s], r),
29
- ...l,
30
- style: {
31
- boxSizing: "border-box",
32
- ...l.style
33
- },
34
- children: c
35
- })] }));
36
- p.displayName = "SheetContent";
37
- var m = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
20
+ f.displayName = s.Description.displayName;
21
+ var p = {
22
+ right: `fixed inset-y-0 right-0 ${t} flex h-full w-80 flex-col gap-3 border-l border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,
23
+ left: `fixed inset-y-0 left-0 ${t} flex h-full w-80 flex-col gap-3 border-r border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,
24
+ top: `fixed inset-x-0 top-0 ${t} flex h-80 w-full flex-col gap-3 border-b border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,
25
+ bottom: `fixed inset-x-0 bottom-0 ${t} flex h-80 w-full flex-col gap-3 border-t border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`
26
+ }, m = i.forwardRef(({ className: t, side: i = "right", children: c, ...l }, u) => /* @__PURE__ */ o(s.Portal, {
27
+ forceMount: l.forceMount,
28
+ children: [/* @__PURE__ */ a(s.Overlay, {
29
+ forceMount: l.forceMount,
30
+ className: e("fixed inset-0 bg-black/50 backdrop-blur-xs", n, r)
31
+ }), /* @__PURE__ */ a(s.Content, {
32
+ ref: u,
33
+ "data-basalt-surface-root": "",
34
+ className: e(n, r, p[i], t),
35
+ ...l,
36
+ style: {
37
+ boxSizing: "border-box",
38
+ ...l.style
39
+ },
40
+ children: c
41
+ })]
42
+ }));
43
+ m.displayName = "SheetContent";
44
+ var h = ({ className: t, ...n }) => /* @__PURE__ */ a("div", {
38
45
  className: e("flex flex-col space-y-2 text-left", t),
39
46
  ...n
40
47
  });
41
- m.displayName = "SheetHeader";
42
- var h = ({ className: t, ...n }) => /* @__PURE__ */ i("div", {
48
+ h.displayName = "SheetHeader";
49
+ var g = ({ className: t, ...n }) => /* @__PURE__ */ a("div", {
43
50
  className: e("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end", t),
44
51
  ...n
45
52
  });
46
- h.displayName = "SheetFooter";
53
+ g.displayName = "SheetFooter";
47
54
  //#endregion
48
- export { s as Sheet, l as SheetClose, p as SheetContent, d as SheetDescription, h as SheetFooter, m as SheetHeader, u as SheetTitle, c as SheetTrigger };
55
+ export { c as Sheet, u as SheetClose, m as SheetContent, f as SheetDescription, g as SheetFooter, h as SheetHeader, d as SheetTitle, l as SheetTrigger };
49
56
 
50
57
  //# sourceMappingURL=sheet.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sheet.js","names":[],"sources":["../../src/components/sheet.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { OVERLAY_LAYER, OVERLAY_MOTION } from \"./overlay\";\n\nexport const Sheet = DialogPrimitive.Root;\nexport const SheetTrigger = DialogPrimitive.Trigger;\nexport const SheetClose = DialogPrimitive.Close;\nexport const SheetTitle = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Title>,\n\tReact.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n\t\t{...props}\n\t/>\n));\nSheetTitle.displayName = DialogPrimitive.Title.displayName;\n\nexport const SheetDescription = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Description>,\n\tReact.ComponentPropsWithoutRef<typeof DialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cn(\"text-sm text-basalt-muted-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nSheetDescription.displayName = DialogPrimitive.Description.displayName;\n\nconst SIDE = {\n\tright:\n\t\t\"fixed inset-y-0 right-0 box-border flex h-full w-80 flex-col gap-3 border-l border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg\",\n\tleft: \"fixed inset-y-0 left-0 box-border flex h-full w-80 flex-col gap-3 border-r border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg\",\n\ttop: \"fixed inset-x-0 top-0 box-border flex h-80 w-full flex-col gap-3 border-b border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg\",\n\tbottom:\n\t\t\"fixed inset-x-0 bottom-0 box-border flex h-80 w-full flex-col gap-3 border-t border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg\",\n} as const;\n\nexport type SheetSide = keyof typeof SIDE;\n\nexport const SheetContent = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Content>,\n\tReact.ComponentPropsWithoutRef<typeof DialogPrimitive.Content> & { side?: SheetSide }\n>(({ className, side = \"right\", children, ...props }, ref) => (\n\t<DialogPrimitive.Portal>\n\t\t<DialogPrimitive.Overlay\n\t\t\tclassName={cn(\"fixed inset-0 bg-black/50 backdrop-blur-xs\", OVERLAY_LAYER, OVERLAY_MOTION)}\n\t\t/>\n\t\t<DialogPrimitive.Content\n\t\t\tref={ref}\n\t\t\tdata-basalt-surface-root=\"\"\n\t\t\tclassName={cn(OVERLAY_LAYER, OVERLAY_MOTION, SIDE[side], className)}\n\t\t\t{...props}\n\t\t\tstyle={{ boxSizing: \"border-box\", ...props.style }}\n\t\t>\n\t\t\t{children}\n\t\t</DialogPrimitive.Content>\n\t</DialogPrimitive.Portal>\n));\nSheetContent.displayName = \"SheetContent\";\n\nexport const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div className={cn(\"flex flex-col space-y-2 text-left\", className)} {...props} />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nexport const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (\n\t<div\n\t\tclassName={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t\t{...props}\n\t/>\n);\nSheetFooter.displayName = \"SheetFooter\";\n"],"mappings":";;;;;;;AAKA,IAAa,IAAQ,EAAgB,MACxB,IAAe,EAAgB,SAC/B,IAAa,EAAgB,OAC7B,IAAa,EAAM,YAG7B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAgB,OAAjB;CACM;CACL,WAAW,EAAG,qDAAqD,CAAS;CAC5E,GAAI;AACJ,CAAA,CACD;AACD,EAAW,cAAc,EAAgB,MAAM;AAE/C,IAAa,IAAmB,EAAM,YAGnC,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAgB,aAAjB;CACM;CACL,WAAW,EAAG,wCAAwC,CAAS;CAC/D,GAAI;AACJ,CAAA,CACD;AACD,EAAiB,cAAc,EAAgB,YAAY;AAE3D,IAAM,IAAO;CACZ,OACC;CACD,MAAM;CACN,KAAK;CACL,QACC;AACF,GAIa,IAAe,EAAM,YAG/B,EAAE,cAAW,UAAO,SAAS,aAAU,GAAG,KAAS,MACrD,kBAAC,EAAgB,QAAjB,EAAA,UAAA,CACC,kBAAC,EAAgB,SAAjB,EACC,WAAW,EAAG,8CAA8C,GAAe,CAAc,EACzF,CAAA,GACD,kBAAC,EAAgB,SAAjB;CACM;CACL,4BAAyB;CACzB,WAAW,EAAG,GAAe,GAAgB,EAAK,IAAO,CAAS;CAClE,GAAI;CACJ,OAAO;EAAE,WAAW;EAAc,GAAG,EAAM;CAAM;CAEhD;AACuB,CAAA,CACF,EAAA,CAAA,CACxB;AACD,EAAa,cAAc;AAE3B,IAAa,KAAe,EAAE,cAAW,GAAG,QAC3C,kBAAC,OAAD;CAAK,WAAW,EAAG,qCAAqC,CAAS;CAAG,GAAI;AAAQ,CAAA;AAEjF,EAAY,cAAc;AAE1B,IAAa,KAAe,EAAE,cAAW,GAAG,QAC3C,kBAAC,OAAD;CACC,WAAW,EAAG,0DAA0D,CAAS;CACjF,GAAI;AACJ,CAAA;AAEF,EAAY,cAAc"}
1
+ {"version":3,"file":"sheet.js","names":[],"sources":["../../src/components/sheet.tsx"],"sourcesContent":["import * as DialogPrimitive from \"@radix-ui/react-dialog\";\nimport * as React from \"react\";\nimport { cn } from \"../utils/cn\";\nimport { BASALT_UI_CLASS } from \"../utils/control-surface\";\nimport { OVERLAY_LAYER, OVERLAY_MOTION } from \"./overlay\";\n\ntype RadixDialogProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Root>;\ntype RadixDialogTriggerProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Trigger>;\ntype RadixDialogCloseProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Close>;\ntype RadixDialogContentProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Content>;\ntype RadixDialogTitleProps = React.ComponentPropsWithoutRef<typeof DialogPrimitive.Title>;\ntype RadixDialogDescriptionProps = React.ComponentPropsWithoutRef<\n\ttypeof DialogPrimitive.Description\n>;\n\nexport interface SheetProps\n\textends Omit<RadixDialogProps, \"open\" | \"defaultOpen\" | \"onOpenChange\" | \"modal\"> {\n\t/**\n\t * Controlled open state of the sheet drawer.\n\t */\n\topen?: RadixDialogProps[\"open\"];\n\t/**\n\t * Uncontrolled default open state of the sheet on initial render.\n\t * @default false\n\t */\n\tdefaultOpen?: RadixDialogProps[\"defaultOpen\"];\n\t/**\n\t * Callback invoked when the open state changes.\n\t */\n\tonOpenChange?: RadixDialogProps[\"onOpenChange\"];\n\t/**\n\t * Whether the sheet renders modally, preventing outside interaction and hiding background content from screen readers.\n\t * @default true\n\t */\n\tmodal?: RadixDialogProps[\"modal\"];\n}\n\nexport const Sheet: React.FC<SheetProps> = DialogPrimitive.Root;\n\nexport interface SheetTriggerProps extends Omit<RadixDialogTriggerProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * Trigger forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogTriggerProps[\"asChild\"];\n}\n\nexport const SheetTrigger = DialogPrimitive.Trigger;\n\nexport interface SheetCloseProps extends Omit<RadixDialogCloseProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered button element to the child element, merging props and behavior.\n\t * Close forwards ref to HTMLButtonElement and inherits native button attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogCloseProps[\"asChild\"];\n}\n\nexport const SheetClose = DialogPrimitive.Close;\n\nexport interface SheetTitleProps extends Omit<RadixDialogTitleProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered heading element to the child element, merging props and behavior.\n\t * Title forwards ref to HTMLHeadingElement and inherits native h2 attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogTitleProps[\"asChild\"];\n}\n\nexport const SheetTitle = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Title>,\n\tSheetTitleProps\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Title\n\t\tref={ref}\n\t\tclassName={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n\t\t{...props}\n\t/>\n));\nSheetTitle.displayName = DialogPrimitive.Title.displayName;\n\nexport interface SheetDescriptionProps extends Omit<RadixDialogDescriptionProps, \"asChild\"> {\n\t/**\n\t * Change the default rendered paragraph element to the child element, merging props and behavior.\n\t * Description forwards ref to HTMLParagraphElement and inherits native p attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogDescriptionProps[\"asChild\"];\n}\n\nexport const SheetDescription = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Description>,\n\tSheetDescriptionProps\n>(({ className, ...props }, ref) => (\n\t<DialogPrimitive.Description\n\t\tref={ref}\n\t\tclassName={cn(\"text-sm text-basalt-muted-foreground\", className)}\n\t\t{...props}\n\t/>\n));\nSheetDescription.displayName = DialogPrimitive.Description.displayName;\n\nconst SIDE = {\n\tright: `fixed inset-y-0 right-0 ${BASALT_UI_CLASS} flex h-full w-80 flex-col gap-3 border-l border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,\n\tleft: `fixed inset-y-0 left-0 ${BASALT_UI_CLASS} flex h-full w-80 flex-col gap-3 border-r border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,\n\ttop: `fixed inset-x-0 top-0 ${BASALT_UI_CLASS} flex h-80 w-full flex-col gap-3 border-b border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,\n\tbottom: `fixed inset-x-0 bottom-0 ${BASALT_UI_CLASS} flex h-80 w-full flex-col gap-3 border-t border-basalt-border p-6 text-sm text-basalt-foreground shadow-lg`,\n} as const;\n\nexport type SheetSide = keyof typeof SIDE;\n\nexport interface SheetContentProps\n\textends Omit<\n\t\tRadixDialogContentProps,\n\t\t| \"side\"\n\t\t| \"asChild\"\n\t\t| \"forceMount\"\n\t\t| \"trapFocus\"\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 * Edge of the screen where the drawer panel is positioned and anchored.\n\t * @default \"right\"\n\t */\n\tside?: SheetSide;\n\t/**\n\t * Change the default rendered div element to the child element, merging props and behavior.\n\t * Content forwards ref to HTMLDivElement and inherits native div attributes.\n\t * @default false\n\t */\n\tasChild?: RadixDialogContentProps[\"asChild\"];\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?: RadixDialogContentProps[\"forceMount\"];\n\t/**\n\t * Event handler called when auto-focusing the first element on open. Can be prevented with event.preventDefault().\n\t */\n\tonOpenAutoFocus?: RadixDialogContentProps[\"onOpenAutoFocus\"];\n\t/**\n\t * Event handler called when restoring focus on close. Can be prevented with event.preventDefault().\n\t */\n\tonCloseAutoFocus?: RadixDialogContentProps[\"onCloseAutoFocus\"];\n\t/**\n\t * Event handler called when the Escape key is pressed. Can be prevented with event.preventDefault().\n\t */\n\tonEscapeKeyDown?: RadixDialogContentProps[\"onEscapeKeyDown\"];\n\t/**\n\t * Event handler called when a pointer event occurs outside the sheet bounds.\n\t */\n\tonPointerDownOutside?: RadixDialogContentProps[\"onPointerDownOutside\"];\n\t/**\n\t * Event handler called when focus moves outside the sheet bounds.\n\t */\n\tonFocusOutside?: RadixDialogContentProps[\"onFocusOutside\"];\n\t/**\n\t * Event handler called when any interaction (pointer or focus) occurs outside the sheet bounds.\n\t */\n\tonInteractOutside?: RadixDialogContentProps[\"onInteractOutside\"];\n}\n\nexport const SheetContent = React.forwardRef<\n\tReact.ElementRef<typeof DialogPrimitive.Content>,\n\tSheetContentProps\n>(({ className, side = \"right\", children, ...props }, ref) => (\n\t<DialogPrimitive.Portal forceMount={props.forceMount}>\n\t\t<DialogPrimitive.Overlay\n\t\t\tforceMount={props.forceMount}\n\t\t\tclassName={cn(\"fixed inset-0 bg-black/50 backdrop-blur-xs\", OVERLAY_LAYER, OVERLAY_MOTION)}\n\t\t/>\n\t\t<DialogPrimitive.Content\n\t\t\tref={ref}\n\t\t\tdata-basalt-surface-root=\"\"\n\t\t\tclassName={cn(OVERLAY_LAYER, OVERLAY_MOTION, SIDE[side], className)}\n\t\t\t{...props}\n\t\t\tstyle={{ boxSizing: \"border-box\", ...props.style }}\n\t\t>\n\t\t\t{children}\n\t\t</DialogPrimitive.Content>\n\t</DialogPrimitive.Portal>\n));\nSheetContent.displayName = \"SheetContent\";\n\nexport interface SheetHeaderProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const SheetHeader = ({ className, ...props }: SheetHeaderProps) => (\n\t<div className={cn(\"flex flex-col space-y-2 text-left\", className)} {...props} />\n);\nSheetHeader.displayName = \"SheetHeader\";\n\nexport interface SheetFooterProps extends React.HTMLAttributes<HTMLDivElement> {}\n\nexport const SheetFooter = ({ className, ...props }: SheetFooterProps) => (\n\t<div\n\t\tclassName={cn(\"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\", className)}\n\t\t{...props}\n\t/>\n);\nSheetFooter.displayName = \"SheetFooter\";\n"],"mappings":";;;;;;;;AAqCA,IAAa,IAA8B,EAAgB,MAW9C,IAAe,EAAgB,SAW/B,IAAa,EAAgB,OAW7B,IAAa,EAAM,YAG7B,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAgB,OAAjB;CACM;CACL,WAAW,EAAG,qDAAqD,CAAS;CAC5E,GAAI;AACJ,CAAA,CACD;AACD,EAAW,cAAc,EAAgB,MAAM;AAW/C,IAAa,IAAmB,EAAM,YAGnC,EAAE,cAAW,GAAG,KAAS,MAC3B,kBAAC,EAAgB,aAAjB;CACM;CACL,WAAW,EAAG,wCAAwC,CAAS;CAC/D,GAAI;AACJ,CAAA,CACD;AACD,EAAiB,cAAc,EAAgB,YAAY;AAE3D,IAAM,IAAO;CACZ,OAAO,2BAA2B,EAAgB;CAClD,MAAM,0BAA0B,EAAgB;CAChD,KAAK,yBAAyB,EAAgB;CAC9C,QAAQ,4BAA4B,EAAgB;AACrD,GA8Da,IAAe,EAAM,YAG/B,EAAE,cAAW,UAAO,SAAS,aAAU,GAAG,KAAS,MACrD,kBAAC,EAAgB,QAAjB;CAAwB,YAAY,EAAM;CAA1C,UAAA,CACC,kBAAC,EAAgB,SAAjB;EACC,YAAY,EAAM;EAClB,WAAW,EAAG,8CAA8C,GAAe,CAAc;CACzF,CAAA,GACD,kBAAC,EAAgB,SAAjB;EACM;EACL,4BAAyB;EACzB,WAAW,EAAG,GAAe,GAAgB,EAAK,IAAO,CAAS;EAClE,GAAI;EACJ,OAAO;GAAE,WAAW;GAAc,GAAG,EAAM;EAAM;EAEhD;CACuB,CAAA,CACF;AACxB,CAAA,CAAA;AACD,EAAa,cAAc;AAI3B,IAAa,KAAe,EAAE,cAAW,GAAG,QAC3C,kBAAC,OAAD;CAAK,WAAW,EAAG,qCAAqC,CAAS;CAAG,GAAI;AAAQ,CAAA;AAEjF,EAAY,cAAc;AAI1B,IAAa,KAAe,EAAE,cAAW,GAAG,QAC3C,kBAAC,OAAD;CACC,WAAW,EAAG,0DAA0D,CAAS;CACjF,GAAI;AACJ,CAAA;AAEF,EAAY,cAAc"}
@@ -1,18 +1,55 @@
1
1
  import { type ButtonHTMLAttributes, type HTMLAttributes, type ReactNode, type RefObject } from "react";
2
2
  export type SidebarSide = "left" | "right";
3
- type SidebarContextValue = {
3
+ export interface SidebarContextValue {
4
+ /**
5
+ * Whether the sidebar is currently collapsed.
6
+ */
4
7
  collapsed: boolean;
8
+ /**
9
+ * Callback to update the collapsed state.
10
+ */
5
11
  setCollapsed: (next: boolean) => void;
12
+ /**
13
+ * Which edge the sidebar occupies.
14
+ */
6
15
  side: SidebarSide;
16
+ /**
17
+ * Whether the sidebar is currently displaying a loading skeleton.
18
+ */
7
19
  loading: boolean;
20
+ /**
21
+ * Whether the sidebar rail expands on pointer hover.
22
+ */
8
23
  peek: boolean;
24
+ /**
25
+ * Whether the sidebar is actively hovering in peek preview mode.
26
+ */
9
27
  peeking: boolean;
28
+ /**
29
+ * Callback to update the peek preview state.
30
+ */
10
31
  setPeeking: (next: boolean) => void;
32
+ /**
33
+ * Whether the sidebar is rendering as a modal overlay drawer instead of in-flow layout chrome.
34
+ */
11
35
  overlay: boolean;
36
+ /**
37
+ * Current expanded width in pixels, clamped between 180 and 400.
38
+ */
12
39
  width: number;
40
+ /**
41
+ * Callback to update the sidebar width. Value is clamped between 180 and 400 pixels.
42
+ */
13
43
  setWidth: (next: number) => void;
44
+ /**
45
+ * Reference to the last active element that held focus before opening the sidebar drawer.
46
+ */
14
47
  lastFocusRef: RefObject<HTMLElement | null>;
15
- };
48
+ }
49
+ /**
50
+ * Accesses the sidebar context value. Must be used within a `SidebarProvider`; throws an error if called outside.
51
+ * Returns the active sidebar state and control callbacks.
52
+ */
16
53
  export declare function useSidebar(): SidebarContextValue;
17
54
  export type SidebarProviderProps = {
18
55
  /**
@@ -49,7 +86,7 @@ export type SidebarProviderProps = {
49
86
  */
50
87
  overlay?: boolean;
51
88
  /**
52
- * Expanded width in pixels.
89
+ * Initial expanded width in pixels, clamped between 180 and 400.
53
90
  * @default 260
54
91
  */
55
92
  defaultWidth?: number;
@@ -67,12 +104,26 @@ export type SidebarProps = HTMLAttributes<HTMLElement> & {
67
104
  collapsed?: boolean;
68
105
  };
69
106
  export declare function Sidebar({ collapsed: collapsedProp, className, children, onMouseEnter, onMouseLeave, style, ...props }: SidebarProps): import("react").JSX.Element;
70
- export declare function SidebarHeader({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
71
- export declare function SidebarSearch({ shortcut, className, children, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
107
+ export interface SidebarHeaderProps extends HTMLAttributes<HTMLDivElement> {
108
+ }
109
+ export declare function SidebarHeader({ className, ...props }: SidebarHeaderProps): import("react").JSX.Element;
110
+ /**
111
+ * Props for `SidebarSearch`. Renders a native `<button>` element and accepts all standard button HTML attributes and click handlers.
112
+ */
113
+ export interface SidebarSearchProps extends ButtonHTMLAttributes<HTMLButtonElement> {
114
+ /**
115
+ * Shortcut key display label rendered inside the trailing kbd tag. Note: this is a visual label only and does not register a global keyboard shortcut.
116
+ * @default "⌘K"
117
+ */
72
118
  shortcut?: string;
73
- }): import("react").JSX.Element;
74
- export declare function SidebarNav({ className, ...props }: HTMLAttributes<HTMLElement>): import("react").JSX.Element;
75
- export declare function SidebarPartition({ className, ...props }: HTMLAttributes<HTMLParagraphElement>): import("react").JSX.Element;
119
+ }
120
+ export declare function SidebarSearch({ shortcut, className, children, ...props }: SidebarSearchProps): import("react").JSX.Element;
121
+ export interface SidebarNavProps extends HTMLAttributes<HTMLElement> {
122
+ }
123
+ export declare function SidebarNav({ className, ...props }: SidebarNavProps): import("react").JSX.Element;
124
+ export interface SidebarPartitionProps extends HTMLAttributes<HTMLParagraphElement> {
125
+ }
126
+ export declare function SidebarPartition({ className, ...props }: SidebarPartitionProps): import("react").JSX.Element;
76
127
  export type SidebarItemProps = ButtonHTMLAttributes<HTMLButtonElement> & {
77
128
  /**
78
129
  * Mark the item as the current page.
@@ -81,21 +132,62 @@ export type SidebarItemProps = ButtonHTMLAttributes<HTMLButtonElement> & {
81
132
  active?: boolean;
82
133
  };
83
134
  export declare function SidebarItem({ active, className, ...props }: SidebarItemProps): import("react").JSX.Element;
84
- export declare function SidebarIconItem({ active, className, ...props }: ButtonHTMLAttributes<HTMLButtonElement> & {
135
+ /**
136
+ * Props for `SidebarIconItem`. Accepts standard button HTML attributes. The caller is responsible for providing accessible labeling via `aria-label` or `aria-labelledby` as icon buttons do not automatically generate accessible names.
137
+ */
138
+ export interface SidebarIconItemProps extends ButtonHTMLAttributes<HTMLButtonElement> {
139
+ /**
140
+ * Mark the icon button as active page item.
141
+ * @default false
142
+ */
85
143
  active?: boolean;
86
- }): import("react").JSX.Element;
87
- export declare function SidebarGroup({ label, defaultOpen, children, }: {
144
+ }
145
+ export declare function SidebarIconItem({ active, className, ...props }: SidebarIconItemProps): import("react").JSX.Element;
146
+ /**
147
+ * Props for `SidebarGroup`. Uncontrolled collapsible section that accepts only the documented properties. It does not accept controlled open props or arbitrary DOM attributes.
148
+ */
149
+ export interface SidebarGroupProps {
150
+ /**
151
+ * Section label displayed on the group trigger.
152
+ */
88
153
  label: ReactNode;
154
+ /**
155
+ * Uncontrolled initial open state for the collapsible group.
156
+ * @default true
157
+ */
89
158
  defaultOpen?: boolean;
159
+ /**
160
+ * Navigation items rendered inside the group.
161
+ */
90
162
  children: ReactNode;
91
- }): import("react").JSX.Element;
92
- export declare function SidebarFooter({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
93
- export declare function SidebarUser({ name, email, avatar, action, className, }: {
163
+ }
164
+ export declare function SidebarGroup({ label, defaultOpen, children }: SidebarGroupProps): import("react").JSX.Element;
165
+ export interface SidebarFooterProps extends HTMLAttributes<HTMLDivElement> {
166
+ }
167
+ export declare function SidebarFooter({ className, ...props }: SidebarFooterProps): import("react").JSX.Element;
168
+ export interface SidebarUserProps {
169
+ /**
170
+ * User display name.
171
+ */
94
172
  name: ReactNode;
173
+ /**
174
+ * Optional user email or secondary text.
175
+ */
95
176
  email?: ReactNode;
177
+ /**
178
+ * Avatar element slot.
179
+ */
96
180
  avatar?: ReactNode;
181
+ /**
182
+ * Trailing action slot (e.g. settings or logout button).
183
+ */
97
184
  action?: ReactNode;
185
+ /**
186
+ * Additional CSS class name.
187
+ */
98
188
  className?: string;
99
- }): import("react").JSX.Element;
100
- export declare function ContentIsland({ className, ...props }: HTMLAttributes<HTMLDivElement>): import("react").JSX.Element;
101
- export {};
189
+ }
190
+ export declare function SidebarUser({ name, email, avatar, action, className }: SidebarUserProps): import("react").JSX.Element;
191
+ export interface ContentIslandProps extends HTMLAttributes<HTMLDivElement> {
192
+ }
193
+ export declare function ContentIsland({ className, ...props }: ContentIslandProps): import("react").JSX.Element;