@inui/design-system 0.0.0-stage → 1.22.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 (312) hide show
  1. package/README.md +360 -2
  2. package/dist/components/ui/accordion.d.ts +44 -0
  3. package/dist/components/ui/accordion.d.ts.map +1 -0
  4. package/dist/components/ui/accordion.js +86 -0
  5. package/dist/components/ui/accordion.js.map +1 -0
  6. package/dist/components/ui/ai-avatar.d.ts +46 -0
  7. package/dist/components/ui/ai-avatar.d.ts.map +1 -0
  8. package/dist/components/ui/ai-avatar.js +43 -0
  9. package/dist/components/ui/ai-avatar.js.map +1 -0
  10. package/dist/components/ui/ai-label.d.ts +118 -0
  11. package/dist/components/ui/ai-label.d.ts.map +1 -0
  12. package/dist/components/ui/ai-label.js +184 -0
  13. package/dist/components/ui/ai-label.js.map +1 -0
  14. package/dist/components/ui/ai-sparkle.d.ts +91 -0
  15. package/dist/components/ui/ai-sparkle.d.ts.map +1 -0
  16. package/dist/components/ui/ai-sparkle.js +200 -0
  17. package/dist/components/ui/ai-sparkle.js.map +1 -0
  18. package/dist/components/ui/alert-dialog.d.ts +79 -0
  19. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  20. package/dist/components/ui/alert-dialog.js +147 -0
  21. package/dist/components/ui/alert-dialog.js.map +1 -0
  22. package/dist/components/ui/alert.d.ts +71 -0
  23. package/dist/components/ui/alert.d.ts.map +1 -0
  24. package/dist/components/ui/alert.js +108 -0
  25. package/dist/components/ui/alert.js.map +1 -0
  26. package/dist/components/ui/aspect-ratio.d.ts +30 -0
  27. package/dist/components/ui/aspect-ratio.d.ts.map +1 -0
  28. package/dist/components/ui/aspect-ratio.js +40 -0
  29. package/dist/components/ui/aspect-ratio.js.map +1 -0
  30. package/dist/components/ui/attachment.d.ts +74 -0
  31. package/dist/components/ui/attachment.d.ts.map +1 -0
  32. package/dist/components/ui/attachment.js +142 -0
  33. package/dist/components/ui/attachment.js.map +1 -0
  34. package/dist/components/ui/avatar.d.ts +82 -0
  35. package/dist/components/ui/avatar.d.ts.map +1 -0
  36. package/dist/components/ui/avatar.js +123 -0
  37. package/dist/components/ui/avatar.js.map +1 -0
  38. package/dist/components/ui/badge.d.ts +130 -0
  39. package/dist/components/ui/badge.d.ts.map +1 -0
  40. package/dist/components/ui/badge.js +226 -0
  41. package/dist/components/ui/badge.js.map +1 -0
  42. package/dist/components/ui/breadcrumb.d.ts +43 -0
  43. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  44. package/dist/components/ui/breadcrumb.js +98 -0
  45. package/dist/components/ui/breadcrumb.js.map +1 -0
  46. package/dist/components/ui/browser-tabs.d.ts +218 -0
  47. package/dist/components/ui/browser-tabs.d.ts.map +1 -0
  48. package/dist/components/ui/browser-tabs.js +528 -0
  49. package/dist/components/ui/browser-tabs.js.map +1 -0
  50. package/dist/components/ui/bubble.d.ts +80 -0
  51. package/dist/components/ui/bubble.d.ts.map +1 -0
  52. package/dist/components/ui/bubble.js +235 -0
  53. package/dist/components/ui/bubble.js.map +1 -0
  54. package/dist/components/ui/button-group.d.ts +60 -0
  55. package/dist/components/ui/button-group.d.ts.map +1 -0
  56. package/dist/components/ui/button-group.js +89 -0
  57. package/dist/components/ui/button-group.js.map +1 -0
  58. package/dist/components/ui/button.d.ts +157 -0
  59. package/dist/components/ui/button.d.ts.map +1 -0
  60. package/dist/components/ui/button.js +144 -0
  61. package/dist/components/ui/button.js.map +1 -0
  62. package/dist/components/ui/calendar.d.ts +57 -0
  63. package/dist/components/ui/calendar.d.ts.map +1 -0
  64. package/dist/components/ui/calendar.js +163 -0
  65. package/dist/components/ui/calendar.js.map +1 -0
  66. package/dist/components/ui/card.d.ts +96 -0
  67. package/dist/components/ui/card.d.ts.map +1 -0
  68. package/dist/components/ui/card.js +131 -0
  69. package/dist/components/ui/card.js.map +1 -0
  70. package/dist/components/ui/carousel.d.ts +86 -0
  71. package/dist/components/ui/carousel.d.ts.map +1 -0
  72. package/dist/components/ui/carousel.js +207 -0
  73. package/dist/components/ui/carousel.js.map +1 -0
  74. package/dist/components/ui/checkbox.d.ts +54 -0
  75. package/dist/components/ui/checkbox.d.ts.map +1 -0
  76. package/dist/components/ui/checkbox.js +78 -0
  77. package/dist/components/ui/checkbox.js.map +1 -0
  78. package/dist/components/ui/collapsible.d.ts +45 -0
  79. package/dist/components/ui/collapsible.d.ts.map +1 -0
  80. package/dist/components/ui/collapsible.js +65 -0
  81. package/dist/components/ui/collapsible.js.map +1 -0
  82. package/dist/components/ui/combobox.d.ts +111 -0
  83. package/dist/components/ui/combobox.d.ts.map +1 -0
  84. package/dist/components/ui/combobox.js +264 -0
  85. package/dist/components/ui/combobox.js.map +1 -0
  86. package/dist/components/ui/command.d.ts +71 -0
  87. package/dist/components/ui/command.d.ts.map +1 -0
  88. package/dist/components/ui/command.js +133 -0
  89. package/dist/components/ui/command.js.map +1 -0
  90. package/dist/components/ui/context-menu.d.ts +70 -0
  91. package/dist/components/ui/context-menu.d.ts.map +1 -0
  92. package/dist/components/ui/context-menu.js +163 -0
  93. package/dist/components/ui/context-menu.js.map +1 -0
  94. package/dist/components/ui/count-badge.d.ts +40 -0
  95. package/dist/components/ui/count-badge.d.ts.map +1 -0
  96. package/dist/components/ui/count-badge.js +43 -0
  97. package/dist/components/ui/count-badge.js.map +1 -0
  98. package/dist/components/ui/data-table.d.ts +1026 -0
  99. package/dist/components/ui/data-table.d.ts.map +1 -0
  100. package/dist/components/ui/data-table.js +3423 -0
  101. package/dist/components/ui/data-table.js.map +1 -0
  102. package/dist/components/ui/dialog.d.ts +73 -0
  103. package/dist/components/ui/dialog.d.ts.map +1 -0
  104. package/dist/components/ui/dialog.js +145 -0
  105. package/dist/components/ui/dialog.js.map +1 -0
  106. package/dist/components/ui/direction.d.ts +35 -0
  107. package/dist/components/ui/direction.d.ts.map +1 -0
  108. package/dist/components/ui/direction.js +35 -0
  109. package/dist/components/ui/direction.js.map +1 -0
  110. package/dist/components/ui/drawer.d.ts +53 -0
  111. package/dist/components/ui/drawer.d.ts.map +1 -0
  112. package/dist/components/ui/drawer.js +115 -0
  113. package/dist/components/ui/drawer.js.map +1 -0
  114. package/dist/components/ui/dropdown-menu.d.ts +75 -0
  115. package/dist/components/ui/dropdown-menu.d.ts.map +1 -0
  116. package/dist/components/ui/dropdown-menu.js +173 -0
  117. package/dist/components/ui/dropdown-menu.js.map +1 -0
  118. package/dist/components/ui/dropzone.d.ts +141 -0
  119. package/dist/components/ui/dropzone.d.ts.map +1 -0
  120. package/dist/components/ui/dropzone.js +257 -0
  121. package/dist/components/ui/dropzone.js.map +1 -0
  122. package/dist/components/ui/empty.d.ts +94 -0
  123. package/dist/components/ui/empty.d.ts.map +1 -0
  124. package/dist/components/ui/empty.js +149 -0
  125. package/dist/components/ui/empty.js.map +1 -0
  126. package/dist/components/ui/field.d.ts +122 -0
  127. package/dist/components/ui/field.d.ts.map +1 -0
  128. package/dist/components/ui/field.js +254 -0
  129. package/dist/components/ui/field.js.map +1 -0
  130. package/dist/components/ui/hover-card.d.ts +51 -0
  131. package/dist/components/ui/hover-card.d.ts.map +1 -0
  132. package/dist/components/ui/hover-card.js +101 -0
  133. package/dist/components/ui/hover-card.js.map +1 -0
  134. package/dist/components/ui/input-group.d.ts +62 -0
  135. package/dist/components/ui/input-group.d.ts.map +1 -0
  136. package/dist/components/ui/input-group.js +115 -0
  137. package/dist/components/ui/input-group.js.map +1 -0
  138. package/dist/components/ui/input-otp.d.ts +52 -0
  139. package/dist/components/ui/input-otp.d.ts.map +1 -0
  140. package/dist/components/ui/input-otp.js +89 -0
  141. package/dist/components/ui/input-otp.js.map +1 -0
  142. package/dist/components/ui/input.d.ts +47 -0
  143. package/dist/components/ui/input.d.ts.map +1 -0
  144. package/dist/components/ui/input.js +47 -0
  145. package/dist/components/ui/input.js.map +1 -0
  146. package/dist/components/ui/item.d.ts +74 -0
  147. package/dist/components/ui/item.d.ts.map +1 -0
  148. package/dist/components/ui/item.js +176 -0
  149. package/dist/components/ui/item.js.map +1 -0
  150. package/dist/components/ui/kbd.d.ts +41 -0
  151. package/dist/components/ui/kbd.d.ts.map +1 -0
  152. package/dist/components/ui/kbd.js +58 -0
  153. package/dist/components/ui/kbd.js.map +1 -0
  154. package/dist/components/ui/key-value-pair.d.ts +56 -0
  155. package/dist/components/ui/key-value-pair.d.ts.map +1 -0
  156. package/dist/components/ui/key-value-pair.js +110 -0
  157. package/dist/components/ui/key-value-pair.js.map +1 -0
  158. package/dist/components/ui/label.d.ts +83 -0
  159. package/dist/components/ui/label.d.ts.map +1 -0
  160. package/dist/components/ui/label.js +85 -0
  161. package/dist/components/ui/label.js.map +1 -0
  162. package/dist/components/ui/marker.d.ts +54 -0
  163. package/dist/components/ui/marker.d.ts.map +1 -0
  164. package/dist/components/ui/marker.js +79 -0
  165. package/dist/components/ui/marker.js.map +1 -0
  166. package/dist/components/ui/menubar.d.ts +72 -0
  167. package/dist/components/ui/menubar.d.ts.map +1 -0
  168. package/dist/components/ui/menubar.js +174 -0
  169. package/dist/components/ui/menubar.js.map +1 -0
  170. package/dist/components/ui/message-scroller.d.ts +53 -0
  171. package/dist/components/ui/message-scroller.d.ts.map +1 -0
  172. package/dist/components/ui/message-scroller.js +95 -0
  173. package/dist/components/ui/message-scroller.js.map +1 -0
  174. package/dist/components/ui/message.d.ts +63 -0
  175. package/dist/components/ui/message.d.ts.map +1 -0
  176. package/dist/components/ui/message.js +92 -0
  177. package/dist/components/ui/message.js.map +1 -0
  178. package/dist/components/ui/meta-list.d.ts +55 -0
  179. package/dist/components/ui/meta-list.d.ts.map +1 -0
  180. package/dist/components/ui/meta-list.js +75 -0
  181. package/dist/components/ui/meta-list.js.map +1 -0
  182. package/dist/components/ui/native-select.d.ts +51 -0
  183. package/dist/components/ui/native-select.d.ts.map +1 -0
  184. package/dist/components/ui/native-select.js +75 -0
  185. package/dist/components/ui/native-select.js.map +1 -0
  186. package/dist/components/ui/navigation-menu.d.ts +56 -0
  187. package/dist/components/ui/navigation-menu.d.ts.map +1 -0
  188. package/dist/components/ui/navigation-menu.js +116 -0
  189. package/dist/components/ui/navigation-menu.js.map +1 -0
  190. package/dist/components/ui/page-header.d.ts +223 -0
  191. package/dist/components/ui/page-header.d.ts.map +1 -0
  192. package/dist/components/ui/page-header.js +233 -0
  193. package/dist/components/ui/page-header.js.map +1 -0
  194. package/dist/components/ui/pagination.d.ts +68 -0
  195. package/dist/components/ui/pagination.d.ts.map +1 -0
  196. package/dist/components/ui/pagination.js +145 -0
  197. package/dist/components/ui/pagination.js.map +1 -0
  198. package/dist/components/ui/popover.d.ts +61 -0
  199. package/dist/components/ui/popover.d.ts.map +1 -0
  200. package/dist/components/ui/popover.js +144 -0
  201. package/dist/components/ui/popover.js.map +1 -0
  202. package/dist/components/ui/progress.d.ts +35 -0
  203. package/dist/components/ui/progress.d.ts.map +1 -0
  204. package/dist/components/ui/progress.js +46 -0
  205. package/dist/components/ui/progress.js.map +1 -0
  206. package/dist/components/ui/questionnaire.d.ts +92 -0
  207. package/dist/components/ui/questionnaire.d.ts.map +1 -0
  208. package/dist/components/ui/questionnaire.js +277 -0
  209. package/dist/components/ui/questionnaire.js.map +1 -0
  210. package/dist/components/ui/radio-group.d.ts +50 -0
  211. package/dist/components/ui/radio-group.d.ts.map +1 -0
  212. package/dist/components/ui/radio-group.js +65 -0
  213. package/dist/components/ui/radio-group.js.map +1 -0
  214. package/dist/components/ui/resizable.d.ts +44 -0
  215. package/dist/components/ui/resizable.d.ts.map +1 -0
  216. package/dist/components/ui/resizable.js +73 -0
  217. package/dist/components/ui/resizable.js.map +1 -0
  218. package/dist/components/ui/scroll-area.d.ts +55 -0
  219. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  220. package/dist/components/ui/scroll-area.js +72 -0
  221. package/dist/components/ui/scroll-area.js.map +1 -0
  222. package/dist/components/ui/select.d.ts +274 -0
  223. package/dist/components/ui/select.d.ts.map +1 -0
  224. package/dist/components/ui/select.js +609 -0
  225. package/dist/components/ui/select.js.map +1 -0
  226. package/dist/components/ui/separator.d.ts +31 -0
  227. package/dist/components/ui/separator.d.ts.map +1 -0
  228. package/dist/components/ui/separator.js +38 -0
  229. package/dist/components/ui/separator.js.map +1 -0
  230. package/dist/components/ui/sheet.d.ts +59 -0
  231. package/dist/components/ui/sheet.d.ts.map +1 -0
  232. package/dist/components/ui/sheet.js +128 -0
  233. package/dist/components/ui/sheet.js.map +1 -0
  234. package/dist/components/ui/sidebar.d.ts +166 -0
  235. package/dist/components/ui/sidebar.d.ts.map +1 -0
  236. package/dist/components/ui/sidebar.js +512 -0
  237. package/dist/components/ui/sidebar.js.map +1 -0
  238. package/dist/components/ui/skeleton.d.ts +35 -0
  239. package/dist/components/ui/skeleton.d.ts.map +1 -0
  240. package/dist/components/ui/skeleton.js +46 -0
  241. package/dist/components/ui/skeleton.js.map +1 -0
  242. package/dist/components/ui/slider.d.ts +39 -0
  243. package/dist/components/ui/slider.d.ts.map +1 -0
  244. package/dist/components/ui/slider.js +75 -0
  245. package/dist/components/ui/slider.js.map +1 -0
  246. package/dist/components/ui/sonner.d.ts +56 -0
  247. package/dist/components/ui/sonner.d.ts.map +1 -0
  248. package/dist/components/ui/sonner.js +96 -0
  249. package/dist/components/ui/sonner.js.map +1 -0
  250. package/dist/components/ui/spinner.d.ts +37 -0
  251. package/dist/components/ui/spinner.d.ts.map +1 -0
  252. package/dist/components/ui/spinner.js +51 -0
  253. package/dist/components/ui/spinner.js.map +1 -0
  254. package/dist/components/ui/stepper.d.ts +84 -0
  255. package/dist/components/ui/stepper.d.ts.map +1 -0
  256. package/dist/components/ui/stepper.js +145 -0
  257. package/dist/components/ui/stepper.js.map +1 -0
  258. package/dist/components/ui/switch.d.ts +36 -0
  259. package/dist/components/ui/switch.d.ts.map +1 -0
  260. package/dist/components/ui/switch.js +44 -0
  261. package/dist/components/ui/switch.js.map +1 -0
  262. package/dist/components/ui/table.d.ts +80 -0
  263. package/dist/components/ui/table.d.ts.map +1 -0
  264. package/dist/components/ui/table.js +130 -0
  265. package/dist/components/ui/table.js.map +1 -0
  266. package/dist/components/ui/tabs.d.ts +87 -0
  267. package/dist/components/ui/tabs.d.ts.map +1 -0
  268. package/dist/components/ui/tabs.js +128 -0
  269. package/dist/components/ui/tabs.js.map +1 -0
  270. package/dist/components/ui/textarea.d.ts +35 -0
  271. package/dist/components/ui/textarea.d.ts.map +1 -0
  272. package/dist/components/ui/textarea.js +38 -0
  273. package/dist/components/ui/textarea.js.map +1 -0
  274. package/dist/components/ui/time-picker.d.ts +58 -0
  275. package/dist/components/ui/time-picker.d.ts.map +1 -0
  276. package/dist/components/ui/time-picker.js +188 -0
  277. package/dist/components/ui/time-picker.js.map +1 -0
  278. package/dist/components/ui/toggle-group.d.ts +52 -0
  279. package/dist/components/ui/toggle-group.d.ts.map +1 -0
  280. package/dist/components/ui/toggle-group.js +94 -0
  281. package/dist/components/ui/toggle-group.js.map +1 -0
  282. package/dist/components/ui/toggle.d.ts +50 -0
  283. package/dist/components/ui/toggle.d.ts.map +1 -0
  284. package/dist/components/ui/toggle.js +70 -0
  285. package/dist/components/ui/toggle.js.map +1 -0
  286. package/dist/components/ui/tooltip.d.ts +51 -0
  287. package/dist/components/ui/tooltip.d.ts.map +1 -0
  288. package/dist/components/ui/tooltip.js +78 -0
  289. package/dist/components/ui/tooltip.js.map +1 -0
  290. package/dist/hooks/use-dark-mode.d.ts +2 -0
  291. package/dist/hooks/use-dark-mode.d.ts.map +1 -0
  292. package/dist/hooks/use-dark-mode.js +36 -0
  293. package/dist/hooks/use-dark-mode.js.map +1 -0
  294. package/dist/hooks/use-mobile.d.ts +2 -0
  295. package/dist/hooks/use-mobile.d.ts.map +1 -0
  296. package/dist/hooks/use-mobile.js +20 -0
  297. package/dist/hooks/use-mobile.js.map +1 -0
  298. package/dist/index.d.ts +88 -0
  299. package/dist/index.d.ts.map +1 -0
  300. package/dist/index.js +77 -0
  301. package/dist/lib/scope.d.ts +64 -0
  302. package/dist/lib/scope.d.ts.map +1 -0
  303. package/dist/lib/scope.js +74 -0
  304. package/dist/lib/scope.js.map +1 -0
  305. package/dist/lib/utils.d.ts +3 -0
  306. package/dist/lib/utils.d.ts.map +1 -0
  307. package/dist/lib/utils.js +11 -0
  308. package/dist/lib/utils.js.map +1 -0
  309. package/dist/styles.css +2 -0
  310. package/dist/theme-tokens.css +537 -0
  311. package/dist/theme.css +417 -0
  312. package/package.json +103 -3
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Dialog — modal window that interrupts the current task with focused content.
3
+ *
4
+ * Backdrop overlay, centered content panel, and a built-in focus trap.
5
+ * Escape and backdrop click both dismiss it. Built on the Radix Dialog
6
+ * primitive; always renders a close button unless `showCloseButton={false}`
7
+ * and caps content at `@sm:max-w-sm` — a container query, not a viewport
8
+ * one: Dialog portals into a single body-level container (`getPortalContainer`
9
+ * in `@/lib/scope`, `container-type: inline-size`), so this tracks that
10
+ * container's actual width instead of the raw browser window, which matters
11
+ * anywhere the host visually constrains it narrower than the real viewport.
12
+ */
13
+ import * as React from "react";
14
+ import { Dialog as DialogPrimitive } from "radix-ui";
15
+ declare function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>): React.JSX.Element;
16
+ declare function DialogTrigger({ ...props }: React.ComponentProps<typeof DialogPrimitive.Trigger>): React.JSX.Element;
17
+ declare function DialogPortal({ ...props }: React.ComponentProps<typeof DialogPrimitive.Portal>): React.JSX.Element;
18
+ declare function DialogClose({ ...props }: React.ComponentProps<typeof DialogPrimitive.Close>): React.JSX.Element;
19
+ declare function DialogOverlay({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Overlay>): React.JSX.Element;
20
+ declare function DialogContent({ className, children, showCloseButton, ...props }: React.ComponentProps<typeof DialogPrimitive.Content> & {
21
+ showCloseButton?: boolean;
22
+ }): React.JSX.Element;
23
+ declare function DialogHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
24
+ declare function DialogFooter({ className, showCloseButton, children, ...props }: React.ComponentProps<"div"> & {
25
+ showCloseButton?: boolean;
26
+ }): React.JSX.Element;
27
+ declare function DialogTitle({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Title>): React.JSX.Element;
28
+ declare function DialogDescription({ className, ...props }: React.ComponentProps<typeof DialogPrimitive.Description>): React.JSX.Element;
29
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, };
30
+ /**
31
+ * WHEN TO USE
32
+ * - A focused input or detail that interrupts the current task — forms, confirmations, previews
33
+ * - Content the user must address before returning to what they were doing
34
+ *
35
+ * NOT WHEN
36
+ * - Destructive or irreversible confirmations — use AlertDialog (no backdrop-click dismiss, forces an explicit choice)
37
+ * - A side panel that keeps page context visible behind it — use Sheet
38
+ * - Lightweight info anchored to a trigger — use Popover
39
+ *
40
+ * KEY RULES
41
+ * - Dismissible by Escape and backdrop click — never route irreversible actions through it
42
+ * - `showCloseButton` defaults to true; set false only when DialogFooter supplies its own close action
43
+ * - DialogFooter can render its own close button via `showCloseButton`, or take children directly for custom actions
44
+ * - Content caps at `@sm:max-w-sm` (a container query against the shared portal container, not the viewport) — wide content needs a `className` override, not a different component
45
+ * - A third, unrelated CTA (e.g. "Save as draft" alongside Cancel/Save) goes first in
46
+ * DialogFooter with `className="sm:mr-auto"` — the auto margin pushes Cancel/Confirm to the
47
+ * far end as their own tight gap-1 pair, while creating a wide, gap-2-equivalent separation
48
+ * from the tertiary action. No extra prop needed; DialogFooter's own `flex gap-1` already
49
+ * supports this via plain flex mechanics.
50
+ *
51
+ * USAGE
52
+ * <Dialog>
53
+ * <DialogTrigger asChild><Button variant="outline">Edit profile</Button></DialogTrigger>
54
+ * <DialogContent>
55
+ * <DialogHeader>
56
+ * <DialogTitle>Edit profile</DialogTitle>
57
+ * <DialogDescription>Make changes here. Click save when done.</DialogDescription>
58
+ * </DialogHeader>
59
+ * <DialogFooter>
60
+ * <DialogClose asChild><Button variant="outline">Cancel</Button></DialogClose>
61
+ * <Button>Save changes</Button>
62
+ * </DialogFooter>
63
+ * </DialogContent>
64
+ * </Dialog>
65
+ *
66
+ * // A third, unrelated action set apart from the Cancel/Save pair
67
+ * <DialogFooter>
68
+ * <Button variant="ghost" className="sm:mr-auto">Save as draft</Button>
69
+ * <DialogClose asChild><Button variant="outline">Cancel</Button></DialogClose>
70
+ * <Button>Publish</Button>
71
+ * </DialogFooter>
72
+ */
73
+ //# sourceMappingURL=dialog.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAOpD,iBAAS,MAAM,CAAC,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAEnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAQrD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAWtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,eAAsB,EACtB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,GAAG;IACxD,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBA8BA;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAQzE;AAED,iBAAS,YAAY,CAAC,EACpB,SAAS,EACT,eAAuB,EACvB,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/B,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B,qBAuBA;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAW1D;AAED,OAAO,EACL,MAAM,EACN,WAAW,EACX,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,WAAW,EACX,aAAa,GACd,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG"}
@@ -0,0 +1,145 @@
1
+ "use client";
2
+ import { cn } from "../../lib/utils.js";
3
+ import { getPortalContainer } from "../../lib/scope.js";
4
+ import { Button } from "./button.js";
5
+ import "react";
6
+ import { Dialog as Dialog$1 } from "radix-ui";
7
+ import { XIcon } from "lucide-react";
8
+ import { jsx, jsxs } from "react/jsx-runtime";
9
+ //#region src/components/ui/dialog.tsx
10
+ function Dialog({ ...props }) {
11
+ return /* @__PURE__ */ jsx(Dialog$1.Root, {
12
+ "data-slot": "dialog",
13
+ ...props
14
+ });
15
+ }
16
+ function DialogTrigger({ ...props }) {
17
+ return /* @__PURE__ */ jsx(Dialog$1.Trigger, {
18
+ "data-slot": "dialog-trigger",
19
+ ...props
20
+ });
21
+ }
22
+ function DialogPortal({ ...props }) {
23
+ return /* @__PURE__ */ jsx(Dialog$1.Portal, {
24
+ "data-slot": "dialog-portal",
25
+ container: getPortalContainer(),
26
+ ...props
27
+ });
28
+ }
29
+ function DialogClose({ ...props }) {
30
+ return /* @__PURE__ */ jsx(Dialog$1.Close, {
31
+ "data-slot": "dialog-close",
32
+ ...props
33
+ });
34
+ }
35
+ function DialogOverlay({ className, ...props }) {
36
+ return /* @__PURE__ */ jsx(Dialog$1.Overlay, {
37
+ "data-slot": "dialog-overlay",
38
+ className: cn("fixed inset-0 isolate z-50 bg-black/10 duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 supports-backdrop-filter:backdrop-blur-xs", className),
39
+ ...props
40
+ });
41
+ }
42
+ function DialogContent({ className, children, showCloseButton = true, ...props }) {
43
+ return /* @__PURE__ */ jsxs(DialogPortal, { children: [/* @__PURE__ */ jsx(DialogOverlay, {}), /* @__PURE__ */ jsxs(Dialog$1.Content, {
44
+ "data-slot": "dialog-content",
45
+ className: cn("fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 @sm:max-w-sm", className),
46
+ ...props,
47
+ children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
48
+ "data-slot": "dialog-close",
49
+ asChild: true,
50
+ children: /* @__PURE__ */ jsxs(Button, {
51
+ variant: "ghost",
52
+ className: "absolute top-2 right-2",
53
+ size: "sm",
54
+ iconOnly: true,
55
+ "aria-label": "Close",
56
+ children: [/* @__PURE__ */ jsx(XIcon, {}), /* @__PURE__ */ jsx("span", {
57
+ className: "sr-only",
58
+ children: "Close"
59
+ })]
60
+ })
61
+ })]
62
+ })] });
63
+ }
64
+ function DialogHeader({ className, ...props }) {
65
+ return /* @__PURE__ */ jsx("div", {
66
+ "data-slot": "dialog-header",
67
+ className: cn("flex flex-col gap-2", className),
68
+ ...props
69
+ });
70
+ }
71
+ function DialogFooter({ className, showCloseButton = false, children, ...props }) {
72
+ return /* @__PURE__ */ jsxs("div", {
73
+ "data-slot": "dialog-footer",
74
+ className: cn("-mx-4 -mb-4 flex flex-col-reverse gap-1 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end", className),
75
+ ...props,
76
+ children: [children, showCloseButton && /* @__PURE__ */ jsx(Dialog$1.Close, {
77
+ asChild: true,
78
+ children: /* @__PURE__ */ jsx(Button, {
79
+ variant: "outline",
80
+ children: "Close"
81
+ })
82
+ })]
83
+ });
84
+ }
85
+ function DialogTitle({ className, ...props }) {
86
+ return /* @__PURE__ */ jsx(Dialog$1.Title, {
87
+ "data-slot": "dialog-title",
88
+ className: cn("text-base leading-none font-medium", className),
89
+ ...props
90
+ });
91
+ }
92
+ function DialogDescription({ className, ...props }) {
93
+ return /* @__PURE__ */ jsx(Dialog$1.Description, {
94
+ "data-slot": "dialog-description",
95
+ className: cn("text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground", className),
96
+ ...props
97
+ });
98
+ }
99
+ /**
100
+ * WHEN TO USE
101
+ * - A focused input or detail that interrupts the current task — forms, confirmations, previews
102
+ * - Content the user must address before returning to what they were doing
103
+ *
104
+ * NOT WHEN
105
+ * - Destructive or irreversible confirmations — use AlertDialog (no backdrop-click dismiss, forces an explicit choice)
106
+ * - A side panel that keeps page context visible behind it — use Sheet
107
+ * - Lightweight info anchored to a trigger — use Popover
108
+ *
109
+ * KEY RULES
110
+ * - Dismissible by Escape and backdrop click — never route irreversible actions through it
111
+ * - `showCloseButton` defaults to true; set false only when DialogFooter supplies its own close action
112
+ * - DialogFooter can render its own close button via `showCloseButton`, or take children directly for custom actions
113
+ * - Content caps at `@sm:max-w-sm` (a container query against the shared portal container, not the viewport) — wide content needs a `className` override, not a different component
114
+ * - A third, unrelated CTA (e.g. "Save as draft" alongside Cancel/Save) goes first in
115
+ * DialogFooter with `className="sm:mr-auto"` — the auto margin pushes Cancel/Confirm to the
116
+ * far end as their own tight gap-1 pair, while creating a wide, gap-2-equivalent separation
117
+ * from the tertiary action. No extra prop needed; DialogFooter's own `flex gap-1` already
118
+ * supports this via plain flex mechanics.
119
+ *
120
+ * USAGE
121
+ * <Dialog>
122
+ * <DialogTrigger asChild><Button variant="outline">Edit profile</Button></DialogTrigger>
123
+ * <DialogContent>
124
+ * <DialogHeader>
125
+ * <DialogTitle>Edit profile</DialogTitle>
126
+ * <DialogDescription>Make changes here. Click save when done.</DialogDescription>
127
+ * </DialogHeader>
128
+ * <DialogFooter>
129
+ * <DialogClose asChild><Button variant="outline">Cancel</Button></DialogClose>
130
+ * <Button>Save changes</Button>
131
+ * </DialogFooter>
132
+ * </DialogContent>
133
+ * </Dialog>
134
+ *
135
+ * // A third, unrelated action set apart from the Cancel/Save pair
136
+ * <DialogFooter>
137
+ * <Button variant="ghost" className="sm:mr-auto">Save as draft</Button>
138
+ * <DialogClose asChild><Button variant="outline">Cancel</Button></DialogClose>
139
+ * <Button>Publish</Button>
140
+ * </DialogFooter>
141
+ */
142
+ //#endregion
143
+ export { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
144
+
145
+ //# sourceMappingURL=dialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dialog.js","names":[],"sources":["../../../src/components/ui/dialog.tsx"],"sourcesContent":["\"use client\"\n\n/**\n * Dialog — modal window that interrupts the current task with focused content.\n *\n * Backdrop overlay, centered content panel, and a built-in focus trap.\n * Escape and backdrop click both dismiss it. Built on the Radix Dialog\n * primitive; always renders a close button unless `showCloseButton={false}`\n * and caps content at `@sm:max-w-sm` — a container query, not a viewport\n * one: Dialog portals into a single body-level container (`getPortalContainer`\n * in `@/lib/scope`, `container-type: inline-size`), so this tracks that\n * container's actual width instead of the raw browser window, which matters\n * anywhere the host visually constrains it narrower than the real viewport.\n */\n\nimport * as React from \"react\"\nimport { Dialog as DialogPrimitive } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\nimport { getPortalContainer } from \"@/lib/scope\"\nimport { Button } from \"@/components/ui/button\"\nimport { XIcon } from \"lucide-react\"\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return (\n <DialogPrimitive.Portal\n data-slot=\"dialog-portal\"\n container={getPortalContainer()}\n {...props}\n />\n )\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 isolate z-50 bg-black/10 duration-100 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0 supports-backdrop-filter:backdrop-blur-xs\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean\n}) {\n return (\n <DialogPortal>\n <DialogOverlay />\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 @sm:max-w-sm\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close data-slot=\"dialog-close\" asChild>\n <Button\n variant=\"ghost\"\n className=\"absolute top-2 right-2\"\n size=\"sm\"\n iconOnly\n aria-label=\"Close\"\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </Button>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </DialogPortal>\n )\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogFooter({\n className,\n showCloseButton = false,\n children,\n ...props\n}: React.ComponentProps<\"div\"> & {\n showCloseButton?: boolean\n}) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n // gap-1, not gap-2 — the footer's buttons resolve one decision\n // together (Cancel/Confirm), a tight cluster, not independent\n // items (see the action-grouping convention: gap-1 inside a\n // decision cluster, gap-2 only between that cluster and something\n // unrelated beside it).\n \"-mx-4 -mb-4 flex flex-col-reverse gap-1 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end\",\n className\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close asChild>\n <Button variant=\"outline\">Close</Button>\n </DialogPrimitive.Close>\n )}\n </div>\n )\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-base leading-none font-medium\", className)}\n {...props}\n />\n )\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\n \"text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n}\n\n/**\n * WHEN TO USE\n * - A focused input or detail that interrupts the current task — forms, confirmations, previews\n * - Content the user must address before returning to what they were doing\n *\n * NOT WHEN\n * - Destructive or irreversible confirmations — use AlertDialog (no backdrop-click dismiss, forces an explicit choice)\n * - A side panel that keeps page context visible behind it — use Sheet\n * - Lightweight info anchored to a trigger — use Popover\n *\n * KEY RULES\n * - Dismissible by Escape and backdrop click — never route irreversible actions through it\n * - `showCloseButton` defaults to true; set false only when DialogFooter supplies its own close action\n * - DialogFooter can render its own close button via `showCloseButton`, or take children directly for custom actions\n * - Content caps at `@sm:max-w-sm` (a container query against the shared portal container, not the viewport) — wide content needs a `className` override, not a different component\n * - A third, unrelated CTA (e.g. \"Save as draft\" alongside Cancel/Save) goes first in\n * DialogFooter with `className=\"sm:mr-auto\"` — the auto margin pushes Cancel/Confirm to the\n * far end as their own tight gap-1 pair, while creating a wide, gap-2-equivalent separation\n * from the tertiary action. No extra prop needed; DialogFooter's own `flex gap-1` already\n * supports this via plain flex mechanics.\n *\n * USAGE\n * <Dialog>\n * <DialogTrigger asChild><Button variant=\"outline\">Edit profile</Button></DialogTrigger>\n * <DialogContent>\n * <DialogHeader>\n * <DialogTitle>Edit profile</DialogTitle>\n * <DialogDescription>Make changes here. Click save when done.</DialogDescription>\n * </DialogHeader>\n * <DialogFooter>\n * <DialogClose asChild><Button variant=\"outline\">Cancel</Button></DialogClose>\n * <Button>Save changes</Button>\n * </DialogFooter>\n * </DialogContent>\n * </Dialog>\n *\n * // A third, unrelated action set apart from the Cancel/Save pair\n * <DialogFooter>\n * <Button variant=\"ghost\" className=\"sm:mr-auto\">Save as draft</Button>\n * <DialogClose asChild><Button variant=\"outline\">Cancel</Button></DialogClose>\n * <Button>Publish</Button>\n * </DialogFooter>\n */\n"],"mappings":";;;;;;;;;AAuBA,SAAS,OAAO,EACd,GAAG,SACiD;CACpD,OAAO,oBAAC,SAAgB,MAAjB;EAAsB,aAAU;EAAS,GAAI;CAAQ,CAAA;AAC9D;AAEA,SAAS,cAAc,EACrB,GAAG,SACoD;CACvD,OAAO,oBAAC,SAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aAAa,EACpB,GAAG,SACmD;CACtD,OACE,oBAAC,SAAgB,QAAjB;EACE,aAAU;EACV,WAAW,mBAAmB;EAC9B,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,GAAG,SACkD;CACrD,OAAO,oBAAC,SAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,oBAAC,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,yNACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cAAc,EACrB,WACA,UACA,kBAAkB,MAClB,GAAG,SAGF;CACD,OACE,qBAAC,cAAD,EAAA,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAAC,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,2ZACA,SACF;EACA,GAAI;EANN,UAAA,CAQG,UACA,mBACC,oBAAC,SAAgB,OAAjB;GAAuB,aAAU;GAAe,SAAA;GAC9C,UAAA,qBAAC,QAAD;IACE,SAAQ;IACR,WAAU;IACV,MAAK;IACL,UAAA;IACA,cAAW;IALb,UAAA,CAOE,oBAAC,OAAD,CAAQ,CAAA,GACR,oBAAC,QAAD;KAAM,WAAU;KAAU,UAAA;IAAW,CAAA,CAC/B;;EACa,CAAA,CAEF;CACb,CAAA,CAAA,EAAA,CAAA;AAElB;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAAG,uBAAuB,SAAS;EAC9C,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EACpB,WACA,kBAAkB,OAClB,UACA,GAAG,SAGF;CACD,OACE,qBAAC,OAAD;EACE,aAAU;EACV,WAAW,GAMT,4GACA,SACF;EACA,GAAI;EAXN,UAAA,CAaG,UACA,mBACC,oBAAC,SAAgB,OAAjB;GAAuB,SAAA;GACrB,UAAA,oBAAC,QAAD;IAAQ,SAAQ;IAAU,UAAA;GAAa,CAAA;EAClB,CAAA,CAEtB;;AAET;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,oBAAC,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,sCAAsC,SAAS;EAC7D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAAC,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GACT,sGACA,SACF;EACA,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,35 @@
1
+ /**
2
+ * DirectionProvider — tells Radix primitives the reading direction (LTR/RTL).
3
+ *
4
+ * Thin re-export of radix-ui's Direction.DirectionProvider. Purely behavioral
5
+ * — it flips keyboard navigation and popover/menu alignment for every Radix
6
+ * primitive underneath it (Select, DropdownMenu, Tabs, etc.), but renders no
7
+ * DOM and applies no visual styling itself.
8
+ */
9
+ import * as React from "react";
10
+ import { Direction } from "radix-ui";
11
+ declare function DirectionProvider({ dir, direction, children, }: React.ComponentProps<typeof Direction.DirectionProvider> & {
12
+ direction?: React.ComponentProps<typeof Direction.DirectionProvider>["dir"];
13
+ }): React.JSX.Element;
14
+ declare const useDirection: typeof Direction.useDirection;
15
+ export { DirectionProvider, useDirection };
16
+ /**
17
+ * WHEN TO USE
18
+ * - RTL locales — wrap the app (or the RTL subtree) so Radix-based components flip correctly
19
+ *
20
+ * NOT WHEN
21
+ * - LTR-only applications — omit entirely, LTR is the default with no provider
22
+ * - Visual/layout mirroring — this changes primitive behavior only; still set `dir` on a real
23
+ * DOM ancestor (e.g. <html dir="rtl">) for CSS, and use logical spacing utilities (ps-, pe-) instead of left/right
24
+ *
25
+ * KEY RULES
26
+ * - Accepts `dir` or `direction` (alias for `dir`) — both map to the same "ltr" | "rtl" value
27
+ * - No default: an ancestor with no DirectionProvider falls back to each primitive's own dir detection (typically the DOM's dir attribute)
28
+ * - useDirection() reads the current value inside any descendant for custom RTL-aware logic
29
+ *
30
+ * USAGE
31
+ * <DirectionProvider dir="rtl">
32
+ * <App />
33
+ * </DirectionProvider>
34
+ */
35
+ //# sourceMappingURL=direction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direction.d.ts","sourceRoot":"","sources":["../../../src/components/ui/direction.tsx"],"names":[],"mappings":"AAEA;;;;;;;GAOG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAA;AAEpC,iBAAS,iBAAiB,CAAC,EACzB,GAAG,EACH,SAAS,EACT,QAAQ,GACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,iBAAiB,CAAC,GAAG;IAC5D,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,iBAAiB,CAAC,CAAC,KAAK,CAAC,CAAA;CAC5E,qBAMA;AAED,QAAA,MAAM,YAAY,+BAAyB,CAAA;AAE3C,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAA;AAE1C;;;;;;;;;;;;;;;;;;GAkBG"}
@@ -0,0 +1,35 @@
1
+ "use client";
2
+ import "react";
3
+ import { Direction } from "radix-ui";
4
+ import { jsx } from "react/jsx-runtime";
5
+ //#region src/components/ui/direction.tsx
6
+ function DirectionProvider({ dir, direction, children }) {
7
+ return /* @__PURE__ */ jsx(Direction.DirectionProvider, {
8
+ dir: direction ?? dir,
9
+ children
10
+ });
11
+ }
12
+ var useDirection = Direction.useDirection;
13
+ /**
14
+ * WHEN TO USE
15
+ * - RTL locales — wrap the app (or the RTL subtree) so Radix-based components flip correctly
16
+ *
17
+ * NOT WHEN
18
+ * - LTR-only applications — omit entirely, LTR is the default with no provider
19
+ * - Visual/layout mirroring — this changes primitive behavior only; still set `dir` on a real
20
+ * DOM ancestor (e.g. <html dir="rtl">) for CSS, and use logical spacing utilities (ps-, pe-) instead of left/right
21
+ *
22
+ * KEY RULES
23
+ * - Accepts `dir` or `direction` (alias for `dir`) — both map to the same "ltr" | "rtl" value
24
+ * - No default: an ancestor with no DirectionProvider falls back to each primitive's own dir detection (typically the DOM's dir attribute)
25
+ * - useDirection() reads the current value inside any descendant for custom RTL-aware logic
26
+ *
27
+ * USAGE
28
+ * <DirectionProvider dir="rtl">
29
+ * <App />
30
+ * </DirectionProvider>
31
+ */
32
+ //#endregion
33
+ export { DirectionProvider, useDirection };
34
+
35
+ //# sourceMappingURL=direction.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"direction.js","names":[],"sources":["../../../src/components/ui/direction.tsx"],"sourcesContent":["\"use client\"\n\n/**\n * DirectionProvider — tells Radix primitives the reading direction (LTR/RTL).\n *\n * Thin re-export of radix-ui's Direction.DirectionProvider. Purely behavioral\n * — it flips keyboard navigation and popover/menu alignment for every Radix\n * primitive underneath it (Select, DropdownMenu, Tabs, etc.), but renders no\n * DOM and applies no visual styling itself.\n */\n\nimport * as React from \"react\"\nimport { Direction } from \"radix-ui\"\n\nfunction DirectionProvider({\n dir,\n direction,\n children,\n}: React.ComponentProps<typeof Direction.DirectionProvider> & {\n direction?: React.ComponentProps<typeof Direction.DirectionProvider>[\"dir\"]\n}) {\n return (\n <Direction.DirectionProvider dir={direction ?? dir}>\n {children}\n </Direction.DirectionProvider>\n )\n}\n\nconst useDirection = Direction.useDirection\n\nexport { DirectionProvider, useDirection }\n\n/**\n * WHEN TO USE\n * - RTL locales — wrap the app (or the RTL subtree) so Radix-based components flip correctly\n *\n * NOT WHEN\n * - LTR-only applications — omit entirely, LTR is the default with no provider\n * - Visual/layout mirroring — this changes primitive behavior only; still set `dir` on a real\n * DOM ancestor (e.g. <html dir=\"rtl\">) for CSS, and use logical spacing utilities (ps-, pe-) instead of left/right\n *\n * KEY RULES\n * - Accepts `dir` or `direction` (alias for `dir`) — both map to the same \"ltr\" | \"rtl\" value\n * - No default: an ancestor with no DirectionProvider falls back to each primitive's own dir detection (typically the DOM's dir attribute)\n * - useDirection() reads the current value inside any descendant for custom RTL-aware logic\n *\n * USAGE\n * <DirectionProvider dir=\"rtl\">\n * <App />\n * </DirectionProvider>\n */\n"],"mappings":";;;;;AAcA,SAAS,kBAAkB,EACzB,KACA,WACA,YAGC;CACD,OACE,oBAAC,UAAU,mBAAX;EAA6B,KAAK,aAAa;EAC5C;CAC0B,CAAA;AAEjC;AAEA,IAAM,eAAe,UAAU"}
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Drawer — draggable edge-anchored sheet for mobile-first overlays
3
+ *
4
+ * Built on vaul, so behavior (swipe-to-dismiss, drag handle) follows vaul's
5
+ * API.
6
+ */
7
+ import * as React from "react";
8
+ import { Drawer as DrawerPrimitive } from "vaul";
9
+ declare function Drawer({ autoFocus, ...props }: React.ComponentProps<typeof DrawerPrimitive.Root>): React.JSX.Element;
10
+ declare function DrawerTrigger({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Trigger>): React.JSX.Element;
11
+ declare function DrawerPortal({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Portal>): React.JSX.Element;
12
+ declare function DrawerClose({ ...props }: React.ComponentProps<typeof DrawerPrimitive.Close>): React.JSX.Element;
13
+ declare function DrawerOverlay({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Overlay>): React.JSX.Element;
14
+ declare function DrawerContent({ className, children, ...props }: React.ComponentProps<typeof DrawerPrimitive.Content>): React.JSX.Element;
15
+ declare function DrawerHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
16
+ declare function DrawerFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
17
+ declare function DrawerTitle({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Title>): React.JSX.Element;
18
+ declare function DrawerDescription({ className, ...props }: React.ComponentProps<typeof DrawerPrimitive.Description>): React.JSX.Element;
19
+ export { Drawer, DrawerPortal, DrawerOverlay, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription, };
20
+ /**
21
+ * WHEN TO USE
22
+ * - Mobile-first action sheets, pickers, and confirmations that benefit from being draggable
23
+ * - Bottom/side sheets the user can dismiss by swiping, not just tapping a close button
24
+ *
25
+ * NOT WHEN
26
+ * - Desktop side panels — use Sheet (non-draggable, fixed-position)
27
+ * - Centered modal interruptions — use Dialog
28
+ *
29
+ * KEY RULES
30
+ * - `direction` on `Drawer` sets which edge it slides from: "top" | "right" | "bottom" | "left" (default bottom)
31
+ * - Put `asChild` on `DrawerTrigger` / `DrawerClose` to render your own element instead of an extra wrapping button
32
+ * - `DrawerContent` renders its own `DrawerPortal` + `DrawerOverlay` — don't nest it in another portal
33
+ * - The drag handle (the small bar at the top of the panel) is only shown for `direction="bottom"`
34
+ * - Left/right drawers cap width at `@sm:max-w-sm` (a container query against the shared portal container — see Dialog's own doc comment for why); top/bottom drawers cap height at `max-h-[80vh]`
35
+ *
36
+ * USAGE
37
+ * <Drawer>
38
+ * <DrawerTrigger asChild><Button variant="outline">Open drawer</Button></DrawerTrigger>
39
+ * <DrawerContent>
40
+ * <DrawerHeader>
41
+ * <DrawerTitle>Are you sure?</DrawerTitle>
42
+ * <DrawerDescription>This action cannot be undone.</DrawerDescription>
43
+ * </DrawerHeader>
44
+ * <DrawerFooter>
45
+ * <Button>Confirm</Button>
46
+ * <DrawerClose asChild><Button variant="outline">Cancel</Button></DrawerClose>
47
+ * </DrawerFooter>
48
+ * </DrawerContent>
49
+ * </Drawer>
50
+ *
51
+ * <Drawer direction="right"> ... </Drawer> // slides in from the right edge instead of the bottom
52
+ */
53
+ //# sourceMappingURL=drawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawer.d.ts","sourceRoot":"","sources":["../../../src/components/ui/drawer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,MAAM,CAAA;AAKhD,iBAAS,MAAM,CAAC,EACd,SAAgB,EAChB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,IAAI,CAAC,qBAQnD;AAED,iBAAS,aAAa,CAAC,EACrB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAEtD;AAED,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,MAAM,CAAC,qBAQrD;AAED,iBAAS,WAAW,CAAC,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAEpD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAWtD;AAED,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,OAAO,CAAC,qBAiBtD;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAWzE;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,KAAK,CAAC,cAAc,CAAC,KAAK,CAAC,qBAUzE;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,KAAK,CAAC,qBAQpD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,WAAW,CAAC,qBAQ1D;AAED,OAAO,EACL,MAAM,EACN,YAAY,EACZ,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG"}
@@ -0,0 +1,115 @@
1
+ import { cn } from "../../lib/utils.js";
2
+ import { getPortalContainer } from "../../lib/scope.js";
3
+ import "react";
4
+ import { jsx, jsxs } from "react/jsx-runtime";
5
+ import { Drawer as Drawer$1 } from "vaul";
6
+ //#region src/components/ui/drawer.tsx
7
+ function Drawer({ autoFocus = true, ...props }) {
8
+ return /* @__PURE__ */ jsx(Drawer$1.Root, {
9
+ "data-slot": "drawer",
10
+ autoFocus,
11
+ ...props
12
+ });
13
+ }
14
+ function DrawerTrigger({ ...props }) {
15
+ return /* @__PURE__ */ jsx(Drawer$1.Trigger, {
16
+ "data-slot": "drawer-trigger",
17
+ ...props
18
+ });
19
+ }
20
+ function DrawerPortal({ ...props }) {
21
+ return /* @__PURE__ */ jsx(Drawer$1.Portal, {
22
+ "data-slot": "drawer-portal",
23
+ container: getPortalContainer(),
24
+ ...props
25
+ });
26
+ }
27
+ function DrawerClose({ ...props }) {
28
+ return /* @__PURE__ */ jsx(Drawer$1.Close, {
29
+ "data-slot": "drawer-close",
30
+ ...props
31
+ });
32
+ }
33
+ function DrawerOverlay({ className, ...props }) {
34
+ return /* @__PURE__ */ jsx(Drawer$1.Overlay, {
35
+ "data-slot": "drawer-overlay",
36
+ className: cn("fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0", className),
37
+ ...props
38
+ });
39
+ }
40
+ function DrawerContent({ className, children, ...props }) {
41
+ return /* @__PURE__ */ jsxs(DrawerPortal, {
42
+ "data-slot": "drawer-portal",
43
+ children: [/* @__PURE__ */ jsx(DrawerOverlay, {}), /* @__PURE__ */ jsxs(Drawer$1.Content, {
44
+ "data-slot": "drawer-content",
45
+ className: cn("group/drawer-content fixed z-50 flex h-auto flex-col bg-popover text-sm text-popover-foreground data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:@sm:max-w-sm data-[vaul-drawer-direction=right]:@sm:max-w-sm", className),
46
+ ...props,
47
+ children: [/* @__PURE__ */ jsx("div", { className: "mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block" }), children]
48
+ })]
49
+ });
50
+ }
51
+ function DrawerHeader({ className, ...props }) {
52
+ return /* @__PURE__ */ jsx("div", {
53
+ "data-slot": "drawer-header",
54
+ className: cn("flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-left", className),
55
+ ...props
56
+ });
57
+ }
58
+ function DrawerFooter({ className, ...props }) {
59
+ return /* @__PURE__ */ jsx("div", {
60
+ "data-slot": "drawer-footer",
61
+ className: cn("mt-auto flex flex-col gap-1 p-4", className),
62
+ ...props
63
+ });
64
+ }
65
+ function DrawerTitle({ className, ...props }) {
66
+ return /* @__PURE__ */ jsx(Drawer$1.Title, {
67
+ "data-slot": "drawer-title",
68
+ className: cn("text-base font-medium text-foreground", className),
69
+ ...props
70
+ });
71
+ }
72
+ function DrawerDescription({ className, ...props }) {
73
+ return /* @__PURE__ */ jsx(Drawer$1.Description, {
74
+ "data-slot": "drawer-description",
75
+ className: cn("text-sm text-muted-foreground", className),
76
+ ...props
77
+ });
78
+ }
79
+ /**
80
+ * WHEN TO USE
81
+ * - Mobile-first action sheets, pickers, and confirmations that benefit from being draggable
82
+ * - Bottom/side sheets the user can dismiss by swiping, not just tapping a close button
83
+ *
84
+ * NOT WHEN
85
+ * - Desktop side panels — use Sheet (non-draggable, fixed-position)
86
+ * - Centered modal interruptions — use Dialog
87
+ *
88
+ * KEY RULES
89
+ * - `direction` on `Drawer` sets which edge it slides from: "top" | "right" | "bottom" | "left" (default bottom)
90
+ * - Put `asChild` on `DrawerTrigger` / `DrawerClose` to render your own element instead of an extra wrapping button
91
+ * - `DrawerContent` renders its own `DrawerPortal` + `DrawerOverlay` — don't nest it in another portal
92
+ * - The drag handle (the small bar at the top of the panel) is only shown for `direction="bottom"`
93
+ * - Left/right drawers cap width at `@sm:max-w-sm` (a container query against the shared portal container — see Dialog's own doc comment for why); top/bottom drawers cap height at `max-h-[80vh]`
94
+ *
95
+ * USAGE
96
+ * <Drawer>
97
+ * <DrawerTrigger asChild><Button variant="outline">Open drawer</Button></DrawerTrigger>
98
+ * <DrawerContent>
99
+ * <DrawerHeader>
100
+ * <DrawerTitle>Are you sure?</DrawerTitle>
101
+ * <DrawerDescription>This action cannot be undone.</DrawerDescription>
102
+ * </DrawerHeader>
103
+ * <DrawerFooter>
104
+ * <Button>Confirm</Button>
105
+ * <DrawerClose asChild><Button variant="outline">Cancel</Button></DrawerClose>
106
+ * </DrawerFooter>
107
+ * </DrawerContent>
108
+ * </Drawer>
109
+ *
110
+ * <Drawer direction="right"> ... </Drawer> // slides in from the right edge instead of the bottom
111
+ */
112
+ //#endregion
113
+ export { Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger };
114
+
115
+ //# sourceMappingURL=drawer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drawer.js","names":[],"sources":["../../../src/components/ui/drawer.tsx"],"sourcesContent":["/**\n * Drawer — draggable edge-anchored sheet for mobile-first overlays\n *\n * Built on vaul, so behavior (swipe-to-dismiss, drag handle) follows vaul's\n * API.\n */\n\nimport * as React from \"react\"\nimport { Drawer as DrawerPrimitive } from \"vaul\"\n\nimport { cn } from \"@/lib/utils\"\nimport { getPortalContainer } from \"@/lib/scope\"\n\nfunction Drawer({\n autoFocus = true,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Root>) {\n // vaul defaults autoFocus to false, which suppresses Radix FocusScope's\n // mount-autofocus routine entirely — focus never moves into the drawer on\n // open, and the escape-focus re-trap has nothing to redirect to since it\n // never recorded a \"last focused element inside\" in the first place.\n // Defaulting true here restores the APG Dialog pattern's baseline\n // (opening a dialog moves focus inside it); still overridable.\n return <DrawerPrimitive.Root data-slot=\"drawer\" autoFocus={autoFocus} {...props} />\n}\n\nfunction DrawerTrigger({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Trigger>) {\n return <DrawerPrimitive.Trigger data-slot=\"drawer-trigger\" {...props} />\n}\n\nfunction DrawerPortal({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Portal>) {\n return (\n <DrawerPrimitive.Portal\n data-slot=\"drawer-portal\"\n container={getPortalContainer()}\n {...props}\n />\n )\n}\n\nfunction DrawerClose({\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Close>) {\n return <DrawerPrimitive.Close data-slot=\"drawer-close\" {...props} />\n}\n\nfunction DrawerOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Overlay>) {\n return (\n <DrawerPrimitive.Overlay\n data-slot=\"drawer-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 supports-backdrop-filter:backdrop-blur-xs data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=closed]:animate-out data-[state=closed]:fade-out-0\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerContent({\n className,\n children,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Content>) {\n return (\n <DrawerPortal data-slot=\"drawer-portal\">\n <DrawerOverlay />\n <DrawerPrimitive.Content\n data-slot=\"drawer-content\"\n className={cn(\n \"group/drawer-content fixed z-50 flex h-auto flex-col bg-popover text-sm text-popover-foreground data-[vaul-drawer-direction=bottom]:inset-x-0 data-[vaul-drawer-direction=bottom]:bottom-0 data-[vaul-drawer-direction=bottom]:mt-24 data-[vaul-drawer-direction=bottom]:max-h-[80vh] data-[vaul-drawer-direction=bottom]:rounded-t-xl data-[vaul-drawer-direction=bottom]:border-t data-[vaul-drawer-direction=left]:inset-y-0 data-[vaul-drawer-direction=left]:left-0 data-[vaul-drawer-direction=left]:w-3/4 data-[vaul-drawer-direction=left]:rounded-r-xl data-[vaul-drawer-direction=left]:border-r data-[vaul-drawer-direction=right]:inset-y-0 data-[vaul-drawer-direction=right]:right-0 data-[vaul-drawer-direction=right]:w-3/4 data-[vaul-drawer-direction=right]:rounded-l-xl data-[vaul-drawer-direction=right]:border-l data-[vaul-drawer-direction=top]:inset-x-0 data-[vaul-drawer-direction=top]:top-0 data-[vaul-drawer-direction=top]:mb-24 data-[vaul-drawer-direction=top]:max-h-[80vh] data-[vaul-drawer-direction=top]:rounded-b-xl data-[vaul-drawer-direction=top]:border-b data-[vaul-drawer-direction=left]:@sm:max-w-sm data-[vaul-drawer-direction=right]:@sm:max-w-sm\",\n className\n )}\n {...props}\n >\n <div className=\"mx-auto mt-4 hidden h-1 w-[100px] shrink-0 rounded-full bg-muted group-data-[vaul-drawer-direction=bottom]/drawer-content:block\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPortal>\n )\n}\n\nfunction DrawerHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-header\"\n className={cn(\n \"flex flex-col gap-0.5 p-4 group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center group-data-[vaul-drawer-direction=top]/drawer-content:text-center md:gap-0.5 md:text-left\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction DrawerFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"drawer-footer\"\n // gap-1, not gap-2 — same action-grouping convention as DialogFooter:\n // the footer's buttons resolve one decision together, a tight cluster.\n className={cn(\"mt-auto flex flex-col gap-1 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Title>) {\n return (\n <DrawerPrimitive.Title\n data-slot=\"drawer-title\"\n className={cn(\"text-base font-medium text-foreground\", className)}\n {...props}\n />\n )\n}\n\nfunction DrawerDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DrawerPrimitive.Description>) {\n return (\n <DrawerPrimitive.Description\n data-slot=\"drawer-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Drawer,\n DrawerPortal,\n DrawerOverlay,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n}\n\n/**\n * WHEN TO USE\n * - Mobile-first action sheets, pickers, and confirmations that benefit from being draggable\n * - Bottom/side sheets the user can dismiss by swiping, not just tapping a close button\n *\n * NOT WHEN\n * - Desktop side panels — use Sheet (non-draggable, fixed-position)\n * - Centered modal interruptions — use Dialog\n *\n * KEY RULES\n * - `direction` on `Drawer` sets which edge it slides from: \"top\" | \"right\" | \"bottom\" | \"left\" (default bottom)\n * - Put `asChild` on `DrawerTrigger` / `DrawerClose` to render your own element instead of an extra wrapping button\n * - `DrawerContent` renders its own `DrawerPortal` + `DrawerOverlay` — don't nest it in another portal\n * - The drag handle (the small bar at the top of the panel) is only shown for `direction=\"bottom\"`\n * - Left/right drawers cap width at `@sm:max-w-sm` (a container query against the shared portal container — see Dialog's own doc comment for why); top/bottom drawers cap height at `max-h-[80vh]`\n *\n * USAGE\n * <Drawer>\n * <DrawerTrigger asChild><Button variant=\"outline\">Open drawer</Button></DrawerTrigger>\n * <DrawerContent>\n * <DrawerHeader>\n * <DrawerTitle>Are you sure?</DrawerTitle>\n * <DrawerDescription>This action cannot be undone.</DrawerDescription>\n * </DrawerHeader>\n * <DrawerFooter>\n * <Button>Confirm</Button>\n * <DrawerClose asChild><Button variant=\"outline\">Cancel</Button></DrawerClose>\n * </DrawerFooter>\n * </DrawerContent>\n * </Drawer>\n *\n * <Drawer direction=\"right\"> ... </Drawer> // slides in from the right edge instead of the bottom\n */\n"],"mappings":";;;;;;AAaA,SAAS,OAAO,EACd,YAAY,MACZ,GAAG,SACiD;CAOpD,OAAO,oBAAC,SAAgB,MAAjB;EAAsB,aAAU;EAAoB;EAAW,GAAI;CAAQ,CAAA;AACpF;AAEA,SAAS,cAAc,EACrB,GAAG,SACoD;CACvD,OAAO,oBAAC,SAAgB,SAAjB;EAAyB,aAAU;EAAiB,GAAI;CAAQ,CAAA;AACzE;AAEA,SAAS,aAAa,EACpB,GAAG,SACmD;CACtD,OACE,oBAAC,SAAgB,QAAjB;EACE,aAAU;EACV,WAAW,mBAAmB;EAC9B,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,GAAG,SACkD;CACrD,OAAO,oBAAC,SAAgB,OAAjB;EAAuB,aAAU;EAAe,GAAI;CAAQ,CAAA;AACrE;AAEA,SAAS,cAAc,EACrB,WACA,GAAG,SACoD;CACvD,OACE,oBAAC,SAAgB,SAAjB;EACE,aAAU;EACV,WAAW,GACT,oMACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,cAAc,EACrB,WACA,UACA,GAAG,SACoD;CACvD,OACE,qBAAC,cAAD;EAAc,aAAU;EAAxB,UAAA,CACE,oBAAC,eAAD,CAAgB,CAAA,GAChB,qBAAC,SAAgB,SAAjB;GACE,aAAU;GACV,WAAW,GACT,yoCACA,SACF;GACA,GAAI;GANN,UAAA,CAQE,oBAAC,OAAD,EAAK,WAAU,kIAAmI,CAAA,GACjJ,QACsB;EACb,CAAA,CAAA;;AAElB;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EACV,WAAW,GACT,4LACA,SACF;EACA,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,aAAa,EAAE,WAAW,GAAG,SAAsC;CAC1E,OACE,oBAAC,OAAD;EACE,aAAU;EAGV,WAAW,GAAG,mCAAmC,SAAS;EAC1D,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,YAAY,EACnB,WACA,GAAG,SACkD;CACrD,OACE,oBAAC,SAAgB,OAAjB;EACE,aAAU;EACV,WAAW,GAAG,yCAAyC,SAAS;EAChE,GAAI;CACL,CAAA;AAEL;AAEA,SAAS,kBAAkB,EACzB,WACA,GAAG,SACwD;CAC3D,OACE,oBAAC,SAAgB,aAAjB;EACE,aAAU;EACV,WAAW,GAAG,iCAAiC,SAAS;EACxD,GAAI;CACL,CAAA;AAEL"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * DropdownMenu — menu of actions or options opened from a trigger element
3
+ *
4
+ * Built on the Radix DropdownMenu primitive (Root/Trigger/Content/Item/...),
5
+ * styled with MMDS popover/accent tokens, with a `variant="destructive"`
6
+ * styling hook on DropdownMenuItem for dangerous entries.
7
+ */
8
+ import * as React from "react";
9
+ import { DropdownMenu as DropdownMenuPrimitive } from "radix-ui";
10
+ declare function DropdownMenu({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Root>): React.JSX.Element;
11
+ declare function DropdownMenuPortal({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Portal>): React.JSX.Element;
12
+ declare function DropdownMenuTrigger({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Trigger>): React.JSX.Element;
13
+ declare function DropdownMenuContent({ className, align, sideOffset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Content>): React.JSX.Element;
14
+ declare function DropdownMenuGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Group>): React.JSX.Element;
15
+ declare function DropdownMenuItem({ className, inset, variant, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
16
+ inset?: boolean;
17
+ variant?: "default" | "destructive";
18
+ }): React.JSX.Element;
19
+ declare function DropdownMenuCheckboxItem({ className, children, checked, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.CheckboxItem> & {
20
+ inset?: boolean;
21
+ }): React.JSX.Element;
22
+ declare function DropdownMenuRadioGroup({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioGroup>): React.JSX.Element;
23
+ declare function DropdownMenuRadioItem({ className, children, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.RadioItem> & {
24
+ inset?: boolean;
25
+ }): React.JSX.Element;
26
+ declare function DropdownMenuLabel({ className, inset, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Label> & {
27
+ inset?: boolean;
28
+ }): React.JSX.Element;
29
+ declare function DropdownMenuSeparator({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Separator>): React.JSX.Element;
30
+ declare function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
31
+ declare function DropdownMenuSub({ ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.Sub>): React.JSX.Element;
32
+ declare function DropdownMenuSubTrigger({ className, inset, children, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubTrigger> & {
33
+ inset?: boolean;
34
+ }): React.JSX.Element;
35
+ declare function DropdownMenuSubContent({ className, ...props }: React.ComponentProps<typeof DropdownMenuPrimitive.SubContent>): React.JSX.Element;
36
+ export { DropdownMenu, DropdownMenuPortal, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuGroup, DropdownMenuLabel, DropdownMenuItem, DropdownMenuCheckboxItem, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubTrigger, DropdownMenuSubContent, };
37
+ /**
38
+ * WHEN TO USE
39
+ * - Secondary or tertiary actions on a row or entity, behind a "..." overflow trigger
40
+ * - View/appearance toggles via DropdownMenuCheckboxItem, or a single-select list via
41
+ * DropdownMenuRadioGroup + DropdownMenuRadioItem
42
+ * - Actions that benefit from grouping (DropdownMenuGroup/Label/Separator), keyboard shortcut
43
+ * hints (DropdownMenuShortcut), or nested submenus (DropdownMenuSub)
44
+ *
45
+ * NOT WHEN
46
+ * - The action is a page's primary action — use Button directly
47
+ * - The user is picking a value for a form field — use Select
48
+ * - The menu opens on right-click rather than a click trigger — use ContextMenu
49
+ *
50
+ * KEY RULES
51
+ * - DropdownMenuItem accepts variant="default" | "destructive"; use "destructive" for
52
+ * irreversible entries (delete, log out, remove) instead of custom text-color classes
53
+ * - Wrap DropdownMenuTrigger's child in asChild so the trigger renders as that element
54
+ * (e.g. a Button) rather than being wrapped in an extra <button>
55
+ * - DropdownMenuContent defaults to align="start" and sideOffset={4}; width is controlled
56
+ * via className (e.g. "w-56"), not a prop
57
+ * - DropdownMenuCheckboxItem/RadioItem are controlled — checked/value and their onChange
58
+ * handlers must be wired by the caller, they hold no internal state
59
+ *
60
+ * USAGE
61
+ * <DropdownMenu>
62
+ * <DropdownMenuTrigger asChild><Button variant="outline">Open menu</Button></DropdownMenuTrigger>
63
+ * <DropdownMenuContent className="w-56">
64
+ * <DropdownMenuLabel>My account</DropdownMenuLabel>
65
+ * <DropdownMenuSeparator />
66
+ * <DropdownMenuItem><UserIcon />Profile<DropdownMenuShortcut>⇧⌘P</DropdownMenuShortcut></DropdownMenuItem>
67
+ * <DropdownMenuItem variant="destructive"><LogOutIcon />Log out</DropdownMenuItem>
68
+ * </DropdownMenuContent>
69
+ * </DropdownMenu>
70
+ *
71
+ * <DropdownMenuCheckboxItem checked={showStatus} onCheckedChange={setShowStatus}>
72
+ * Status bar
73
+ * </DropdownMenuCheckboxItem>
74
+ */
75
+ //# sourceMappingURL=dropdown-menu.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dropdown-menu.d.ts","sourceRoot":"","sources":["../../../src/components/ui/dropdown-menu.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,YAAY,IAAI,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAMhE,iBAAS,YAAY,CAAC,EACpB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,qBAEzD;AAED,iBAAS,kBAAkB,CAAC,EAC1B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,MAAM,CAAC,qBAQ3D;AAED,iBAAS,mBAAmB,CAAC,EAC3B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAO5D;AAED,iBAAS,mBAAmB,CAAC,EAC3B,SAAS,EACT,KAAe,EACf,UAAc,EACd,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,OAAO,CAAC,qBAe5D;AAED,iBAAS,iBAAiB,CAAC,EACzB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,qBAI1D;AAED,iBAAS,gBAAgB,CAAC,EACxB,SAAS,EACT,KAAK,EACL,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG;IAC3D,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAA;CACpC,qBAaA;AAED,iBAAS,wBAAwB,CAAC,EAChC,SAAS,EACT,QAAQ,EACR,OAAO,EACP,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,YAAY,CAAC,GAAG;IACnE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,qBAuBA;AAED,iBAAS,sBAAsB,CAAC,EAC9B,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,qBAO/D;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,QAAQ,EACR,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,SAAS,CAAC,GAAG;IAChE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,qBAsBA;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,KAAK,EACL,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,KAAK,CAAC,GAAG;IAC5D,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,qBAYA;AAED,iBAAS,qBAAqB,CAAC,EAC7B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,SAAS,CAAC,qBAQ9D;AAED,iBAAS,oBAAoB,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,qBAW9B;AAED,iBAAS,eAAe,CAAC,EACvB,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,GAAG,CAAC,qBAExD;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,KAAK,EACL,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,GAAG;IACjE,KAAK,CAAC,EAAE,OAAO,CAAA;CAChB,qBAeA;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,qBAAqB,CAAC,UAAU,CAAC,qBAW/D;AAED,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,wBAAwB,EACxB,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,eAAe,EACf,sBAAsB,EACtB,sBAAsB,GACvB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG"}