@codefast/ui 0.0.27 → 0.0.29

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 (327) hide show
  1. package/dist/accordion.js +1 -49
  2. package/dist/accordion.js.map +1 -1
  3. package/dist/accordion.mjs +1 -49
  4. package/dist/accordion.mjs.map +1 -1
  5. package/dist/alert-dialog.js +1 -65
  6. package/dist/alert-dialog.js.map +1 -1
  7. package/dist/alert-dialog.mjs +1 -65
  8. package/dist/alert-dialog.mjs.map +1 -1
  9. package/dist/alert.js +1 -33
  10. package/dist/alert.js.map +1 -1
  11. package/dist/alert.mjs +1 -33
  12. package/dist/alert.mjs.map +1 -1
  13. package/dist/animate.plugin.js +2 -0
  14. package/dist/animate.plugin.js.map +1 -0
  15. package/dist/animate.plugin.mjs +2 -0
  16. package/dist/animate.plugin.mjs.map +1 -0
  17. package/dist/aspect-ratio.js +1 -8
  18. package/dist/aspect-ratio.js.map +1 -1
  19. package/dist/aspect-ratio.mjs +1 -8
  20. package/dist/aspect-ratio.mjs.map +1 -1
  21. package/dist/avatar.js +1 -34
  22. package/dist/avatar.js.map +1 -1
  23. package/dist/avatar.mjs +1 -34
  24. package/dist/avatar.mjs.map +1 -1
  25. package/dist/badge.js +1 -26
  26. package/dist/badge.js.map +1 -1
  27. package/dist/badge.mjs +1 -26
  28. package/dist/badge.mjs.map +1 -1
  29. package/dist/blockquote.js +1 -12
  30. package/dist/blockquote.js.map +1 -1
  31. package/dist/blockquote.mjs +1 -12
  32. package/dist/blockquote.mjs.map +1 -1
  33. package/dist/box.js +1 -12
  34. package/dist/box.js.map +1 -1
  35. package/dist/box.mjs +1 -12
  36. package/dist/box.mjs.map +1 -1
  37. package/dist/breadcrumb.js +1 -71
  38. package/dist/breadcrumb.js.map +1 -1
  39. package/dist/breadcrumb.mjs +1 -71
  40. package/dist/breadcrumb.mjs.map +1 -1
  41. package/dist/button.d.mts +1 -1
  42. package/dist/button.d.ts +1 -1
  43. package/dist/button.js +1 -10
  44. package/dist/button.mjs +1 -10
  45. package/dist/calendar.js +1 -70
  46. package/dist/calendar.js.map +1 -1
  47. package/dist/calendar.mjs +1 -70
  48. package/dist/calendar.mjs.map +1 -1
  49. package/dist/card.js +1 -29
  50. package/dist/card.js.map +1 -1
  51. package/dist/card.mjs +1 -29
  52. package/dist/card.mjs.map +1 -1
  53. package/dist/carousel.js +1 -193
  54. package/dist/carousel.js.map +1 -1
  55. package/dist/carousel.mjs +1 -193
  56. package/dist/carousel.mjs.map +1 -1
  57. package/dist/checkbox-cards.js +1 -51
  58. package/dist/checkbox-cards.js.map +1 -1
  59. package/dist/checkbox-cards.mjs +1 -51
  60. package/dist/checkbox-cards.mjs.map +1 -1
  61. package/dist/checkbox-group.js +1 -39
  62. package/dist/checkbox-group.js.map +1 -1
  63. package/dist/checkbox-group.mjs +1 -39
  64. package/dist/checkbox-group.mjs.map +1 -1
  65. package/dist/checkbox-group.primitive.js +1 -18
  66. package/dist/checkbox-group.primitive.mjs +1 -18
  67. package/dist/checkbox.js +1 -26
  68. package/dist/checkbox.js.map +1 -1
  69. package/dist/checkbox.mjs +1 -26
  70. package/dist/checkbox.mjs.map +1 -1
  71. package/dist/chunk-2RQCRE7N.js +2 -0
  72. package/dist/chunk-2RQCRE7N.js.map +1 -0
  73. package/dist/chunk-ATQPXKGH.mjs +2 -0
  74. package/dist/{chunk-JULVZPCS.mjs.map → chunk-ATQPXKGH.mjs.map} +1 -1
  75. package/dist/chunk-CF2GOAXC.mjs +2 -0
  76. package/dist/{chunk-AUQEMOIM.mjs.map → chunk-CF2GOAXC.mjs.map} +1 -1
  77. package/dist/chunk-CHJJRHD2.mjs +2 -0
  78. package/dist/{chunk-TXRIFICH.mjs.map → chunk-CHJJRHD2.mjs.map} +1 -1
  79. package/dist/chunk-CNPQJV2G.js +2 -0
  80. package/dist/chunk-CNPQJV2G.js.map +1 -0
  81. package/dist/chunk-DCN2KICL.js +2 -0
  82. package/dist/chunk-DCN2KICL.js.map +1 -0
  83. package/dist/chunk-HJ4U5JJA.mjs +2 -0
  84. package/dist/chunk-HJ4U5JJA.mjs.map +1 -0
  85. package/dist/chunk-IBJ5USOR.js +2 -0
  86. package/dist/chunk-IBJ5USOR.js.map +1 -0
  87. package/dist/chunk-J5EXNAHZ.js +2 -0
  88. package/dist/chunk-J5EXNAHZ.js.map +1 -0
  89. package/dist/chunk-JTI7KCLO.mjs +2 -0
  90. package/dist/chunk-JTI7KCLO.mjs.map +1 -0
  91. package/dist/chunk-JVGHOCS7.js +2 -0
  92. package/dist/chunk-JVGHOCS7.js.map +1 -0
  93. package/dist/chunk-KICZFOKE.js +2 -0
  94. package/dist/chunk-KICZFOKE.js.map +1 -0
  95. package/dist/chunk-MXVHKLFU.mjs +2 -0
  96. package/dist/{chunk-FGI3JA75.mjs.map → chunk-MXVHKLFU.mjs.map} +1 -1
  97. package/dist/chunk-O7LLHO4I.js +2 -0
  98. package/dist/chunk-O7LLHO4I.js.map +1 -0
  99. package/dist/chunk-QZCQ42BP.js +2 -0
  100. package/dist/chunk-QZCQ42BP.js.map +1 -0
  101. package/dist/chunk-S23IT4G2.js +2 -0
  102. package/dist/chunk-S23IT4G2.js.map +1 -0
  103. package/dist/chunk-TMXZMQRK.mjs +2 -0
  104. package/dist/{chunk-73S45XV3.mjs.map → chunk-TMXZMQRK.mjs.map} +1 -1
  105. package/dist/chunk-VDYNVLXR.mjs +2 -0
  106. package/dist/{chunk-U6VR5RJ5.mjs.map → chunk-VDYNVLXR.mjs.map} +1 -1
  107. package/dist/chunk-XPJZ6WQM.js +2 -0
  108. package/dist/chunk-XPJZ6WQM.js.map +1 -0
  109. package/dist/chunk-YV4UJQ5X.mjs +2 -0
  110. package/dist/{chunk-EWS3N4OZ.mjs.map → chunk-YV4UJQ5X.mjs.map} +1 -1
  111. package/dist/chunk-ZLAYTLRK.mjs +2 -0
  112. package/dist/chunk-ZLAYTLRK.mjs.map +1 -0
  113. package/dist/chunk-ZMVKHU4U.mjs +2 -0
  114. package/dist/{chunk-Q24YJU6W.mjs.map → chunk-ZMVKHU4U.mjs.map} +1 -1
  115. package/dist/code.js +1 -12
  116. package/dist/code.js.map +1 -1
  117. package/dist/code.mjs +1 -12
  118. package/dist/code.mjs.map +1 -1
  119. package/dist/collapsible.js +1 -12
  120. package/dist/collapsible.js.map +1 -1
  121. package/dist/collapsible.mjs +1 -12
  122. package/dist/collapsible.mjs.map +1 -1
  123. package/dist/command.d.mts +15 -15
  124. package/dist/command.d.ts +15 -15
  125. package/dist/command.js +1 -93
  126. package/dist/command.js.map +1 -1
  127. package/dist/command.mjs +1 -93
  128. package/dist/command.mjs.map +1 -1
  129. package/dist/container.js +1 -16
  130. package/dist/container.js.map +1 -1
  131. package/dist/container.mjs +1 -16
  132. package/dist/container.mjs.map +1 -1
  133. package/dist/context-menu.js +1 -153
  134. package/dist/context-menu.js.map +1 -1
  135. package/dist/context-menu.mjs +1 -153
  136. package/dist/context-menu.mjs.map +1 -1
  137. package/dist/data-table.js +1 -235
  138. package/dist/data-table.js.map +1 -1
  139. package/dist/data-table.mjs +1 -235
  140. package/dist/data-table.mjs.map +1 -1
  141. package/dist/dialog.js +1 -22
  142. package/dist/dialog.mjs +1 -22
  143. package/dist/drawer.js +1 -64
  144. package/dist/drawer.js.map +1 -1
  145. package/dist/drawer.mjs +1 -64
  146. package/dist/drawer.mjs.map +1 -1
  147. package/dist/dropdown-menu.js +1 -34
  148. package/dist/dropdown-menu.mjs +1 -34
  149. package/dist/em.js +1 -12
  150. package/dist/em.js.map +1 -1
  151. package/dist/em.mjs +1 -12
  152. package/dist/em.mjs.map +1 -1
  153. package/dist/form.js +1 -91
  154. package/dist/form.js.map +1 -1
  155. package/dist/form.mjs +1 -91
  156. package/dist/form.mjs.map +1 -1
  157. package/dist/heading.js +1 -12
  158. package/dist/heading.js.map +1 -1
  159. package/dist/heading.mjs +1 -12
  160. package/dist/heading.mjs.map +1 -1
  161. package/dist/hover-card.js +1 -35
  162. package/dist/hover-card.js.map +1 -1
  163. package/dist/hover-card.mjs +1 -35
  164. package/dist/hover-card.mjs.map +1 -1
  165. package/dist/input-otp.js +1 -62
  166. package/dist/input-otp.js.map +1 -1
  167. package/dist/input-otp.mjs +1 -62
  168. package/dist/input-otp.mjs.map +1 -1
  169. package/dist/input.js +1 -28
  170. package/dist/input.js.map +1 -1
  171. package/dist/input.mjs +1 -28
  172. package/dist/input.mjs.map +1 -1
  173. package/dist/kbd.js +1 -26
  174. package/dist/kbd.js.map +1 -1
  175. package/dist/kbd.mjs +1 -26
  176. package/dist/kbd.mjs.map +1 -1
  177. package/dist/label.js +1 -8
  178. package/dist/label.mjs +1 -8
  179. package/dist/menubar.js +1 -168
  180. package/dist/menubar.js.map +1 -1
  181. package/dist/menubar.mjs +1 -168
  182. package/dist/menubar.mjs.map +1 -1
  183. package/dist/navigation-menu.js +1 -119
  184. package/dist/navigation-menu.js.map +1 -1
  185. package/dist/navigation-menu.mjs +1 -119
  186. package/dist/navigation-menu.mjs.map +1 -1
  187. package/dist/pagination.js +1 -86
  188. package/dist/pagination.js.map +1 -1
  189. package/dist/pagination.mjs +1 -86
  190. package/dist/pagination.mjs.map +1 -1
  191. package/dist/perspective.plugin.js +2 -0
  192. package/dist/perspective.plugin.js.map +1 -0
  193. package/dist/perspective.plugin.mjs +2 -0
  194. package/dist/perspective.plugin.mjs.map +1 -0
  195. package/dist/popover.js +1 -37
  196. package/dist/popover.js.map +1 -1
  197. package/dist/popover.mjs +1 -37
  198. package/dist/popover.mjs.map +1 -1
  199. package/dist/pre.js +1 -12
  200. package/dist/pre.js.map +1 -1
  201. package/dist/pre.mjs +1 -12
  202. package/dist/pre.mjs.map +1 -1
  203. package/dist/progress.js +1 -30
  204. package/dist/progress.js.map +1 -1
  205. package/dist/progress.mjs +1 -30
  206. package/dist/progress.mjs.map +1 -1
  207. package/dist/quote.js +1 -12
  208. package/dist/quote.js.map +1 -1
  209. package/dist/quote.mjs +1 -12
  210. package/dist/quote.mjs.map +1 -1
  211. package/dist/radio-cards.js +1 -31
  212. package/dist/radio-cards.js.map +1 -1
  213. package/dist/radio-cards.mjs +1 -31
  214. package/dist/radio-cards.mjs.map +1 -1
  215. package/dist/radio-group.js +1 -32
  216. package/dist/radio-group.js.map +1 -1
  217. package/dist/radio-group.mjs +1 -32
  218. package/dist/radio-group.mjs.map +1 -1
  219. package/dist/radio.js +1 -28
  220. package/dist/radio.js.map +1 -1
  221. package/dist/radio.mjs +1 -28
  222. package/dist/radio.mjs.map +1 -1
  223. package/dist/resizable.js +1 -44
  224. package/dist/resizable.js.map +1 -1
  225. package/dist/resizable.mjs +1 -44
  226. package/dist/resizable.mjs.map +1 -1
  227. package/dist/scroll-area.js +1 -38
  228. package/dist/scroll-area.js.map +1 -1
  229. package/dist/scroll-area.mjs +1 -38
  230. package/dist/scroll-area.mjs.map +1 -1
  231. package/dist/section.js +1 -12
  232. package/dist/section.js.map +1 -1
  233. package/dist/section.mjs +1 -12
  234. package/dist/section.mjs.map +1 -1
  235. package/dist/select.js +1 -26
  236. package/dist/select.mjs +1 -26
  237. package/dist/separator.js +1 -25
  238. package/dist/separator.js.map +1 -1
  239. package/dist/separator.mjs +1 -25
  240. package/dist/separator.mjs.map +1 -1
  241. package/dist/sheet.js +1 -64
  242. package/dist/sheet.js.map +1 -1
  243. package/dist/sheet.mjs +1 -64
  244. package/dist/sheet.mjs.map +1 -1
  245. package/dist/skeleton.js +1 -12
  246. package/dist/skeleton.js.map +1 -1
  247. package/dist/skeleton.mjs +1 -12
  248. package/dist/skeleton.mjs.map +1 -1
  249. package/dist/slider.js +1 -32
  250. package/dist/slider.js.map +1 -1
  251. package/dist/slider.mjs +1 -32
  252. package/dist/slider.mjs.map +1 -1
  253. package/dist/sonner.js +1 -29
  254. package/dist/sonner.js.map +1 -1
  255. package/dist/sonner.mjs +1 -29
  256. package/dist/sonner.mjs.map +1 -1
  257. package/dist/spinner.js +1 -7
  258. package/dist/spinner.mjs +1 -7
  259. package/dist/strong.js +1 -12
  260. package/dist/strong.js.map +1 -1
  261. package/dist/strong.mjs +1 -12
  262. package/dist/strong.mjs.map +1 -1
  263. package/dist/switch.js +1 -25
  264. package/dist/switch.js.map +1 -1
  265. package/dist/switch.mjs +1 -25
  266. package/dist/switch.mjs.map +1 -1
  267. package/dist/table.js +1 -50
  268. package/dist/table.js.map +1 -1
  269. package/dist/table.mjs +1 -50
  270. package/dist/table.mjs.map +1 -1
  271. package/dist/tabs.js +1 -52
  272. package/dist/tabs.js.map +1 -1
  273. package/dist/tabs.mjs +1 -52
  274. package/dist/tabs.mjs.map +1 -1
  275. package/dist/tailwind.config.js +1 -383
  276. package/dist/tailwind.config.js.map +1 -1
  277. package/dist/tailwind.config.mjs +1 -383
  278. package/dist/tailwind.config.mjs.map +1 -1
  279. package/dist/text.js +1 -12
  280. package/dist/text.js.map +1 -1
  281. package/dist/text.mjs +1 -12
  282. package/dist/text.mjs.map +1 -1
  283. package/dist/textarea.js +1 -24
  284. package/dist/textarea.js.map +1 -1
  285. package/dist/textarea.mjs +1 -24
  286. package/dist/textarea.mjs.map +1 -1
  287. package/dist/toggle-group.js +1 -56
  288. package/dist/toggle-group.js.map +1 -1
  289. package/dist/toggle-group.mjs +1 -56
  290. package/dist/toggle-group.mjs.map +1 -1
  291. package/dist/toggle.js +1 -10
  292. package/dist/toggle.mjs +1 -10
  293. package/dist/tooltip.js +1 -36
  294. package/dist/tooltip.js.map +1 -1
  295. package/dist/tooltip.mjs +1 -36
  296. package/dist/tooltip.mjs.map +1 -1
  297. package/dist/utils.js +1 -10
  298. package/dist/utils.mjs +1 -10
  299. package/package.json +3 -3
  300. package/dist/chunk-3ZZ3SRTJ.js +0 -148
  301. package/dist/chunk-3ZZ3SRTJ.js.map +0 -1
  302. package/dist/chunk-73S45XV3.mjs +0 -51
  303. package/dist/chunk-AOIW2XNK.js +0 -34
  304. package/dist/chunk-AOIW2XNK.js.map +0 -1
  305. package/dist/chunk-AUQEMOIM.mjs +0 -34
  306. package/dist/chunk-BA3XYBWR.js +0 -120
  307. package/dist/chunk-BA3XYBWR.js.map +0 -1
  308. package/dist/chunk-EWS3N4OZ.mjs +0 -148
  309. package/dist/chunk-FGI3JA75.mjs +0 -25
  310. package/dist/chunk-G3NP7M2N.js +0 -19
  311. package/dist/chunk-G3NP7M2N.js.map +0 -1
  312. package/dist/chunk-IVYGBU4G.js +0 -25
  313. package/dist/chunk-IVYGBU4G.js.map +0 -1
  314. package/dist/chunk-JULVZPCS.mjs +0 -120
  315. package/dist/chunk-MOJNV3XZ.js +0 -120
  316. package/dist/chunk-MOJNV3XZ.js.map +0 -1
  317. package/dist/chunk-Q24YJU6W.mjs +0 -120
  318. package/dist/chunk-TFYKPLNV.js +0 -73
  319. package/dist/chunk-TFYKPLNV.js.map +0 -1
  320. package/dist/chunk-TH24V27M.js +0 -67
  321. package/dist/chunk-TH24V27M.js.map +0 -1
  322. package/dist/chunk-TXRIFICH.mjs +0 -67
  323. package/dist/chunk-U6VR5RJ5.mjs +0 -73
  324. package/dist/chunk-UG3URV2Z.mjs +0 -19
  325. package/dist/chunk-UG3URV2Z.mjs.map +0 -1
  326. package/dist/chunk-Y3DZHPJ5.js +0 -51
  327. package/dist/chunk-Y3DZHPJ5.js.map +0 -1
package/dist/dialog.mjs CHANGED
@@ -1,23 +1,2 @@
1
- "use client";
2
- import {
3
- Dialog,
4
- DialogClose,
5
- DialogContent,
6
- DialogDescription,
7
- DialogFooter,
8
- DialogHeader,
9
- DialogTitle,
10
- DialogTrigger
11
- } from "./chunk-TXRIFICH.mjs";
12
- import "./chunk-UG3URV2Z.mjs";
13
- export {
14
- Dialog,
15
- DialogClose,
16
- DialogContent,
17
- DialogDescription,
18
- DialogFooter,
19
- DialogHeader,
20
- DialogTitle,
21
- DialogTrigger
22
- };
1
+ "use client";import{a,b,c,d,e,f,g,h}from"./chunk-CHJJRHD2.mjs";import"./chunk-JTI7KCLO.mjs";export{a as Dialog,c as DialogClose,d as DialogContent,h as DialogDescription,f as DialogFooter,e as DialogHeader,g as DialogTitle,b as DialogTrigger};
23
2
  //# sourceMappingURL=dialog.mjs.map
package/dist/drawer.js CHANGED
@@ -1,65 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
2
-
3
-
4
- var _chunkG3NP7M2Njs = require('./chunk-G3NP7M2N.js');
5
-
6
- // src/drawer.tsx
7
- var _react = require('react'); var React = _interopRequireWildcard(_react);
8
- var _vaul = require('vaul');
9
- var _jsxruntime = require('react/jsx-runtime');
10
- function Drawer({ shouldScaleBackground = true, ...props }) {
11
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _vaul.Drawer.Root, { shouldScaleBackground, ...props });
12
- }
13
- var DrawerTrigger = _vaul.Drawer.Trigger;
14
- var DrawerClose = _vaul.Drawer.Close;
15
- var DrawerContent = React.forwardRef(
16
- ({ className, children, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _vaul.Drawer.Portal, { children: [
17
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _vaul.Drawer.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
18
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
19
- _vaul.Drawer.Content,
20
- {
21
- ref,
22
- className: _chunkG3NP7M2Njs.cn.call(void 0,
23
- "bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",
24
- className
25
- ),
26
- ...props,
27
- children: [
28
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "bg-muted mx-auto mt-4 h-2 w-24 rounded-full" }),
29
- children
30
- ]
31
- }
32
- )
33
- ] })
34
- );
35
- DrawerContent.displayName = "DrawerContent";
36
- function DrawerHeader({ className, ...props }) {
37
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkG3NP7M2Njs.cn.call(void 0, "grid gap-1.5 p-4 text-center sm:text-left", className), ...props });
38
- }
39
- function DrawerFooter({ className, ...props }) {
40
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: _chunkG3NP7M2Njs.cn.call(void 0, "mt-auto flex flex-col gap-2 p-4", className), ...props });
41
- }
42
- var DrawerTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
43
- _vaul.Drawer.Title,
44
- {
45
- ref,
46
- className: _chunkG3NP7M2Njs.cn.call(void 0, "text-lg font-semibold leading-none tracking-tight", className),
47
- ...props
48
- }
49
- ));
50
- DrawerTitle.displayName = _vaul.Drawer.Title.displayName;
51
- var DrawerDescription = React.forwardRef(
52
- ({ className, ...props }, ref) => /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _vaul.Drawer.Description, { ref, className: _chunkG3NP7M2Njs.cn.call(void 0, "text-muted-foreground text-sm", className), ...props })
53
- );
54
- DrawerDescription.displayName = _vaul.Drawer.Description.displayName;
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
- exports.Drawer = Drawer; exports.DrawerClose = DrawerClose; exports.DrawerContent = DrawerContent; exports.DrawerDescription = DrawerDescription; exports.DrawerFooter = DrawerFooter; exports.DrawerHeader = DrawerHeader; exports.DrawerTitle = DrawerTitle; exports.DrawerTrigger = DrawerTrigger;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";var _chunkQZCQ42BPjs = require('./chunk-QZCQ42BP.js');var _react = require('react'); var n = _interopRequireWildcard(_react);var _vaul = require('vaul');var _jsxruntime = require('react/jsx-runtime');function f({shouldScaleBackground:e=!0,...r}){return _jsxruntime.jsx.call(void 0, _vaul.Drawer.Root,{shouldScaleBackground:e,...r})}var P=_vaul.Drawer.Trigger,y= exports.DrawerClose =_vaul.Drawer.Close,D= exports.DrawerContent =n.forwardRef(({className:e,children:r,...i},s)=>_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Portal,{children:[_jsxruntime.jsx.call(void 0, _vaul.Drawer.Overlay,{className:"fixed inset-0 z-50 bg-black/80"}),_jsxruntime.jsxs.call(void 0, _vaul.Drawer.Content,{ref:s,className:_chunkQZCQ42BPjs.b.call(void 0, "bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",e),...i,children:[_jsxruntime.jsx.call(void 0, "div",{className:"bg-muted mx-auto mt-4 h-2 w-24 rounded-full"}),r]})]}));D.displayName="DrawerContent";function d({className:e,...r}){return _jsxruntime.jsx.call(void 0, "div",{className:_chunkQZCQ42BPjs.b.call(void 0, "grid gap-1.5 p-4 text-center sm:text-left",e),...r})}function R({className:e,...r}){return _jsxruntime.jsx.call(void 0, "div",{className:_chunkQZCQ42BPjs.b.call(void 0, "mt-auto flex flex-col gap-2 p-4",e),...r})}var l=n.forwardRef(({className:e,...r},i)=>_jsxruntime.jsx.call(void 0, _vaul.Drawer.Title,{ref:i,className:_chunkQZCQ42BPjs.b.call(void 0, "text-lg font-semibold leading-none tracking-tight",e),...r}));l.displayName=_vaul.Drawer.Title.displayName;var m=n.forwardRef(({className:e,...r},i)=>_jsxruntime.jsx.call(void 0, _vaul.Drawer.Description,{ref:i,className:_chunkQZCQ42BPjs.b.call(void 0, "text-muted-foreground text-sm",e),...r}));m.displayName=_vaul.Drawer.Description.displayName;exports.Drawer = f; exports.DrawerClose = y; exports.DrawerContent = D; exports.DrawerDescription = m; exports.DrawerFooter = R; exports.DrawerHeader = d; exports.DrawerTitle = l; exports.DrawerTrigger = P;
65
2
  //# sourceMappingURL=drawer.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/drawer.tsx"],"names":[],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAUjC,cA4BH,YA5BG;AADT,SAAS,OAAO,EAAE,wBAAwB,MAAM,GAAG,MAAM,GAAmC;AAC1F,SAAO,oBAAC,gBAAgB,MAAhB,EAAqB,uBAA+C,GAAG,OAAO;AACxF;AAOA,IAAM,gBAAgB,gBAAgB;AAOtC,IAAM,cAAc,gBAAgB;AASpC,IAAM,gBAAsB;AAAA,EAC1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,wBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,IACpE;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEJ;AAAA,8BAAC,SAAI,WAAU,+CAA8C;AAAA,UAC5D;AAAA;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,cAAc,cAAc;AAQ5B,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,6CAA6C,SAAS,GAAI,GAAG,OAAO;AAChG;AAQA,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,mCAAmC,SAAS,GAAI,GAAG,OAAO;AACtF;AASA,IAAM,cAAoB,iBAAiD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACnG;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,qDAAqD,SAAS;AAAA,IAC3E,GAAG;AAAA;AACN,CACD;AAED,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B;AAAA,EAC9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,gBAAgB,aAAhB,EAA4B,KAAU,WAAW,GAAG,iCAAiC,SAAS,GAAI,GAAG,OAAO;AAEjH;AAEA,kBAAkB,cAAc,gBAAgB,YAAY","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
1
+ {"version":3,"sources":["../src/drawer.tsx"],"names":["React","DrawerPrimitive","jsx","jsxs","Drawer","shouldScaleBackground","props","DrawerTrigger","DrawerClose","DrawerContent","className","children","ref","cn","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"],"mappings":"qDAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,OAUjC,cAAAC,EA4BH,QAAAC,MA5BG,oBADT,SAASC,EAAO,CAAE,sBAAAC,EAAwB,GAAM,GAAGC,CAAM,EAAmC,CAC1F,OAAOJ,EAACD,EAAgB,KAAhB,CAAqB,sBAAuBI,EAAwB,GAAGC,EAAO,CACxF,CAOA,IAAMC,EAAgBN,EAAgB,QAOhCO,EAAcP,EAAgB,MAS9BQ,EAAsB,aAC1B,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGL,CAAM,EAAGM,IAClCT,EAACF,EAAgB,OAAhB,CACC,UAAAC,EAACD,EAAgB,QAAhB,CAAwB,UAAU,iCAAiC,EACpEE,EAACF,EAAgB,QAAhB,CACC,IAAKW,EACL,UAAWC,EACT,6FACAH,CACF,EACC,GAAGJ,EAEJ,UAAAJ,EAAC,OAAI,UAAU,8CAA8C,EAC5DS,GACH,GACF,CAEJ,EAEAF,EAAc,YAAc,gBAQ5B,SAASK,EAAa,CAAE,UAAAJ,EAAW,GAAGJ,CAAM,EAAyC,CACnF,OAAOJ,EAAC,OAAI,UAAWW,EAAG,4CAA6CH,CAAS,EAAI,GAAGJ,EAAO,CAChG,CAQA,SAASS,EAAa,CAAE,UAAAL,EAAW,GAAGJ,CAAM,EAAyC,CACnF,OAAOJ,EAAC,OAAI,UAAWW,EAAG,kCAAmCH,CAAS,EAAI,GAAGJ,EAAO,CACtF,CASA,IAAMU,EAAoB,aAAiD,CAAC,CAAE,UAAAN,EAAW,GAAGJ,CAAM,EAAGM,IACnGV,EAACD,EAAgB,MAAhB,CACC,IAAKW,EACL,UAAWC,EAAG,oDAAqDH,CAAS,EAC3E,GAAGJ,EACN,CACD,EAEDU,EAAY,YAAcf,EAAgB,MAAM,YAShD,IAAMgB,EAA0B,aAC9B,CAAC,CAAE,UAAAP,EAAW,GAAGJ,CAAM,EAAGM,IACxBV,EAACD,EAAgB,YAAhB,CAA4B,IAAKW,EAAK,UAAWC,EAAG,gCAAiCH,CAAS,EAAI,GAAGJ,EAAO,CAEjH,EAEAW,EAAkB,YAAchB,EAAgB,YAAY","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"]}
package/dist/drawer.mjs CHANGED
@@ -1,65 +1,2 @@
1
- "use client";
2
- import {
3
- cn
4
- } from "./chunk-UG3URV2Z.mjs";
5
-
6
- // src/drawer.tsx
7
- import * as React from "react";
8
- import { Drawer as DrawerPrimitive } from "vaul";
9
- import { jsx, jsxs } from "react/jsx-runtime";
10
- function Drawer({ shouldScaleBackground = true, ...props }) {
11
- return /* @__PURE__ */ jsx(DrawerPrimitive.Root, { shouldScaleBackground, ...props });
12
- }
13
- var DrawerTrigger = DrawerPrimitive.Trigger;
14
- var DrawerClose = DrawerPrimitive.Close;
15
- var DrawerContent = React.forwardRef(
16
- ({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DrawerPrimitive.Portal, { children: [
17
- /* @__PURE__ */ jsx(DrawerPrimitive.Overlay, { className: "fixed inset-0 z-50 bg-black/80" }),
18
- /* @__PURE__ */ jsxs(
19
- DrawerPrimitive.Content,
20
- {
21
- ref,
22
- className: cn(
23
- "bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",
24
- className
25
- ),
26
- ...props,
27
- children: [
28
- /* @__PURE__ */ jsx("div", { className: "bg-muted mx-auto mt-4 h-2 w-24 rounded-full" }),
29
- children
30
- ]
31
- }
32
- )
33
- ] })
34
- );
35
- DrawerContent.displayName = "DrawerContent";
36
- function DrawerHeader({ className, ...props }) {
37
- return /* @__PURE__ */ jsx("div", { className: cn("grid gap-1.5 p-4 text-center sm:text-left", className), ...props });
38
- }
39
- function DrawerFooter({ className, ...props }) {
40
- return /* @__PURE__ */ jsx("div", { className: cn("mt-auto flex flex-col gap-2 p-4", className), ...props });
41
- }
42
- var DrawerTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
43
- DrawerPrimitive.Title,
44
- {
45
- ref,
46
- className: cn("text-lg font-semibold leading-none tracking-tight", className),
47
- ...props
48
- }
49
- ));
50
- DrawerTitle.displayName = DrawerPrimitive.Title.displayName;
51
- var DrawerDescription = React.forwardRef(
52
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(DrawerPrimitive.Description, { ref, className: cn("text-muted-foreground text-sm", className), ...props })
53
- );
54
- DrawerDescription.displayName = DrawerPrimitive.Description.displayName;
55
- export {
56
- Drawer,
57
- DrawerClose,
58
- DrawerContent,
59
- DrawerDescription,
60
- DrawerFooter,
61
- DrawerHeader,
62
- DrawerTitle,
63
- DrawerTrigger
64
- };
1
+ "use client";import{b as a}from"./chunk-JTI7KCLO.mjs";import*as n from"react";import{Drawer as t}from"vaul";import{jsx as o,jsxs as p}from"react/jsx-runtime";function f({shouldScaleBackground:e=!0,...r}){return o(t.Root,{shouldScaleBackground:e,...r})}var P=t.Trigger,y=t.Close,D=n.forwardRef(({className:e,children:r,...i},s)=>p(t.Portal,{children:[o(t.Overlay,{className:"fixed inset-0 z-50 bg-black/80"}),p(t.Content,{ref:s,className:a("bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border",e),...i,children:[o("div",{className:"bg-muted mx-auto mt-4 h-2 w-24 rounded-full"}),r]})]}));D.displayName="DrawerContent";function d({className:e,...r}){return o("div",{className:a("grid gap-1.5 p-4 text-center sm:text-left",e),...r})}function R({className:e,...r}){return o("div",{className:a("mt-auto flex flex-col gap-2 p-4",e),...r})}var l=n.forwardRef(({className:e,...r},i)=>o(t.Title,{ref:i,className:a("text-lg font-semibold leading-none tracking-tight",e),...r}));l.displayName=t.Title.displayName;var m=n.forwardRef(({className:e,...r},i)=>o(t.Description,{ref:i,className:a("text-muted-foreground text-sm",e),...r}));m.displayName=t.Description.displayName;export{f as Drawer,y as DrawerClose,D as DrawerContent,m as DrawerDescription,R as DrawerFooter,d as DrawerHeader,l as DrawerTitle,P as DrawerTrigger};
65
2
  //# sourceMappingURL=drawer.mjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"],"mappings":";;;;;;AAEA,YAAY,WAAW;AACvB,SAAS,UAAU,uBAAuB;AAUjC,cA4BH,YA5BG;AADT,SAAS,OAAO,EAAE,wBAAwB,MAAM,GAAG,MAAM,GAAmC;AAC1F,SAAO,oBAAC,gBAAgB,MAAhB,EAAqB,uBAA+C,GAAG,OAAO;AACxF;AAOA,IAAM,gBAAgB,gBAAgB;AAOtC,IAAM,cAAc,gBAAgB;AASpC,IAAM,gBAAsB;AAAA,EAC1B,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAClC,qBAAC,gBAAgB,QAAhB,EACC;AAAA,wBAAC,gBAAgB,SAAhB,EAAwB,WAAU,kCAAiC;AAAA,IACpE;AAAA,MAAC,gBAAgB;AAAA,MAAhB;AAAA,QACC;AAAA,QACA,WAAW;AAAA,UACT;AAAA,UACA;AAAA,QACF;AAAA,QACC,GAAG;AAAA,QAEJ;AAAA,8BAAC,SAAI,WAAU,+CAA8C;AAAA,UAC5D;AAAA;AAAA;AAAA,IACH;AAAA,KACF;AAEJ;AAEA,cAAc,cAAc;AAQ5B,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,6CAA6C,SAAS,GAAI,GAAG,OAAO;AAChG;AAQA,SAAS,aAAa,EAAE,WAAW,GAAG,MAAM,GAAyC;AACnF,SAAO,oBAAC,SAAI,WAAW,GAAG,mCAAmC,SAAS,GAAI,GAAG,OAAO;AACtF;AASA,IAAM,cAAoB,iBAAiD,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACnG;AAAA,EAAC,gBAAgB;AAAA,EAAhB;AAAA,IACC;AAAA,IACA,WAAW,GAAG,qDAAqD,SAAS;AAAA,IAC3E,GAAG;AAAA;AACN,CACD;AAED,YAAY,cAAc,gBAAgB,MAAM;AAShD,IAAM,oBAA0B;AAAA,EAC9B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QACxB,oBAAC,gBAAgB,aAAhB,EAA4B,KAAU,WAAW,GAAG,iCAAiC,SAAS,GAAI,GAAG,OAAO;AAEjH;AAEA,kBAAkB,cAAc,gBAAgB,YAAY;","names":[]}
1
+ {"version":3,"sources":["../src/drawer.tsx"],"sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport { Drawer as DrawerPrimitive } from \"vaul\";\nimport { cn } from \"./utils\";\n\n/* -----------------------------------------------------------------------------\n * Component: Drawer\n * -------------------------------------------------------------------------- */\n\ntype DrawerProps = React.ComponentProps<typeof DrawerPrimitive.Root>;\n\nfunction Drawer({ shouldScaleBackground = true, ...props }: DrawerProps): React.JSX.Element {\n return <DrawerPrimitive.Root shouldScaleBackground={shouldScaleBackground} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTrigger\n * -------------------------------------------------------------------------- */\n\ntype DrawerTriggerProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Trigger>;\nconst DrawerTrigger = DrawerPrimitive.Trigger;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerClose\n * -------------------------------------------------------------------------- */\n\ntype DrawerCloseProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Close>;\nconst DrawerClose = DrawerPrimitive.Close;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerContent\n * -------------------------------------------------------------------------- */\n\ntype DrawerContentElement = React.ElementRef<typeof DrawerPrimitive.Content>;\ntype DrawerContentProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Content>;\n\nconst DrawerContent = React.forwardRef<DrawerContentElement, DrawerContentProps>(\n ({ className, children, ...props }, ref) => (\n <DrawerPrimitive.Portal>\n <DrawerPrimitive.Overlay className=\"fixed inset-0 z-50 bg-black/80\" />\n <DrawerPrimitive.Content\n ref={ref}\n className={cn(\n \"bg-background fixed inset-x-0 bottom-0 z-50 mt-24 flex h-auto flex-col rounded-t-xl border\",\n className,\n )}\n {...props}\n >\n <div className=\"bg-muted mx-auto mt-4 h-2 w-24 rounded-full\" />\n {children}\n </DrawerPrimitive.Content>\n </DrawerPrimitive.Portal>\n ),\n);\n\nDrawerContent.displayName = \"DrawerContent\";\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerHeader\n * -------------------------------------------------------------------------- */\n\ntype DrawerHeaderProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerHeader({ className, ...props }: DrawerHeaderProps): React.JSX.Element {\n return <div className={cn(\"grid gap-1.5 p-4 text-center sm:text-left\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerFooter\n * -------------------------------------------------------------------------- */\n\ntype DrawerFooterProps = React.HTMLAttributes<HTMLDivElement>;\n\nfunction DrawerFooter({ className, ...props }: DrawerFooterProps): React.JSX.Element {\n return <div className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)} {...props} />;\n}\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerTitle\n * -------------------------------------------------------------------------- */\n\ntype DrawerTitleElement = React.ElementRef<typeof DrawerPrimitive.Title>;\ntype DrawerTitleProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Title>;\n\nconst DrawerTitle = React.forwardRef<DrawerTitleElement, DrawerTitleProps>(({ className, ...props }, ref) => (\n <DrawerPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\n\nDrawerTitle.displayName = DrawerPrimitive.Title.displayName;\n\n/* -----------------------------------------------------------------------------\n * Component: DrawerDescription\n * -------------------------------------------------------------------------- */\n\ntype DrawerDescriptionElement = React.ElementRef<typeof DrawerPrimitive.Description>;\ntype DrawerDescriptionProps = React.ComponentPropsWithoutRef<typeof DrawerPrimitive.Description>;\n\nconst DrawerDescription = React.forwardRef<DrawerDescriptionElement, DrawerDescriptionProps>(\n ({ className, ...props }, ref) => (\n <DrawerPrimitive.Description ref={ref} className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n ),\n);\n\nDrawerDescription.displayName = DrawerPrimitive.Description.displayName;\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n Drawer,\n DrawerTrigger,\n DrawerClose,\n DrawerContent,\n DrawerHeader,\n DrawerFooter,\n DrawerTitle,\n DrawerDescription,\n type DrawerProps,\n type DrawerTriggerProps,\n type DrawerCloseProps,\n type DrawerContentProps,\n type DrawerHeaderProps,\n type DrawerFooterProps,\n type DrawerTitleProps,\n type DrawerDescriptionProps,\n};\n"],"mappings":"sDAEA,UAAYA,MAAW,QACvB,OAAS,UAAUC,MAAuB,OAUjC,cAAAC,EA4BH,QAAAC,MA5BG,oBADT,SAASC,EAAO,CAAE,sBAAAC,EAAwB,GAAM,GAAGC,CAAM,EAAmC,CAC1F,OAAOJ,EAACK,EAAgB,KAAhB,CAAqB,sBAAuBF,EAAwB,GAAGC,EAAO,CACxF,CAOA,IAAME,EAAgBD,EAAgB,QAOhCE,EAAcF,EAAgB,MAS9BG,EAAsB,aAC1B,CAAC,CAAE,UAAAC,EAAW,SAAAC,EAAU,GAAGN,CAAM,EAAGO,IAClCV,EAACI,EAAgB,OAAhB,CACC,UAAAL,EAACK,EAAgB,QAAhB,CAAwB,UAAU,iCAAiC,EACpEJ,EAACI,EAAgB,QAAhB,CACC,IAAKM,EACL,UAAWC,EACT,6FACAH,CACF,EACC,GAAGL,EAEJ,UAAAJ,EAAC,OAAI,UAAU,8CAA8C,EAC5DU,GACH,GACF,CAEJ,EAEAF,EAAc,YAAc,gBAQ5B,SAASK,EAAa,CAAE,UAAAJ,EAAW,GAAGL,CAAM,EAAyC,CACnF,OAAOJ,EAAC,OAAI,UAAWY,EAAG,4CAA6CH,CAAS,EAAI,GAAGL,EAAO,CAChG,CAQA,SAASU,EAAa,CAAE,UAAAL,EAAW,GAAGL,CAAM,EAAyC,CACnF,OAAOJ,EAAC,OAAI,UAAWY,EAAG,kCAAmCH,CAAS,EAAI,GAAGL,EAAO,CACtF,CASA,IAAMW,EAAoB,aAAiD,CAAC,CAAE,UAAAN,EAAW,GAAGL,CAAM,EAAGO,IACnGX,EAACK,EAAgB,MAAhB,CACC,IAAKM,EACL,UAAWC,EAAG,oDAAqDH,CAAS,EAC3E,GAAGL,EACN,CACD,EAEDW,EAAY,YAAcV,EAAgB,MAAM,YAShD,IAAMW,EAA0B,aAC9B,CAAC,CAAE,UAAAP,EAAW,GAAGL,CAAM,EAAGO,IACxBX,EAACK,EAAgB,YAAhB,CAA4B,IAAKM,EAAK,UAAWC,EAAG,gCAAiCH,CAAS,EAAI,GAAGL,EAAO,CAEjH,EAEAY,EAAkB,YAAcX,EAAgB,YAAY","names":["React","DrawerPrimitive","jsx","jsxs","Drawer","shouldScaleBackground","props","DrawerPrimitive","DrawerTrigger","DrawerClose","DrawerContent","className","children","ref","cn","DrawerHeader","DrawerFooter","DrawerTitle","DrawerDescription"]}
@@ -1,35 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";
2
-
3
-
4
-
5
-
6
-
7
-
8
-
9
-
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
- var _chunk3ZZ3SRTJjs = require('./chunk-3ZZ3SRTJ.js');
18
- require('./chunk-G3NP7M2N.js');
19
-
20
-
21
-
22
-
23
-
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
- exports.DropdownMenu = _chunk3ZZ3SRTJjs.DropdownMenu; exports.DropdownMenuCheckboxItem = _chunk3ZZ3SRTJjs.DropdownMenuCheckboxItem; exports.DropdownMenuContent = _chunk3ZZ3SRTJjs.DropdownMenuContent; exports.DropdownMenuGroup = _chunk3ZZ3SRTJjs.DropdownMenuGroup; exports.DropdownMenuItem = _chunk3ZZ3SRTJjs.DropdownMenuItem; exports.DropdownMenuLabel = _chunk3ZZ3SRTJjs.DropdownMenuLabel; exports.DropdownMenuRadioGroup = _chunk3ZZ3SRTJjs.DropdownMenuRadioGroup; exports.DropdownMenuRadioItem = _chunk3ZZ3SRTJjs.DropdownMenuRadioItem; exports.DropdownMenuSeparator = _chunk3ZZ3SRTJjs.DropdownMenuSeparator; exports.DropdownMenuShortcut = _chunk3ZZ3SRTJjs.DropdownMenuShortcut; exports.DropdownMenuSub = _chunk3ZZ3SRTJjs.DropdownMenuSub; exports.DropdownMenuSubContent = _chunk3ZZ3SRTJjs.DropdownMenuSubContent; exports.DropdownMenuSubTrigger = _chunk3ZZ3SRTJjs.DropdownMenuSubTrigger; exports.DropdownMenuTrigger = _chunk3ZZ3SRTJjs.DropdownMenuTrigger;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use client";var _chunkKICZFOKEjs = require('./chunk-KICZFOKE.js');require('./chunk-QZCQ42BP.js');exports.DropdownMenu = _chunkKICZFOKEjs.a; exports.DropdownMenuCheckboxItem = _chunkKICZFOKEjs.j; exports.DropdownMenuContent = _chunkKICZFOKEjs.h; exports.DropdownMenuGroup = _chunkKICZFOKEjs.c; exports.DropdownMenuItem = _chunkKICZFOKEjs.i; exports.DropdownMenuLabel = _chunkKICZFOKEjs.l; exports.DropdownMenuRadioGroup = _chunkKICZFOKEjs.e; exports.DropdownMenuRadioItem = _chunkKICZFOKEjs.k; exports.DropdownMenuSeparator = _chunkKICZFOKEjs.m; exports.DropdownMenuShortcut = _chunkKICZFOKEjs.n; exports.DropdownMenuSub = _chunkKICZFOKEjs.d; exports.DropdownMenuSubContent = _chunkKICZFOKEjs.g; exports.DropdownMenuSubTrigger = _chunkKICZFOKEjs.f; exports.DropdownMenuTrigger = _chunkKICZFOKEjs.b;
35
2
  //# sourceMappingURL=dropdown-menu.js.map
@@ -1,35 +1,2 @@
1
- "use client";
2
- import {
3
- DropdownMenu,
4
- DropdownMenuCheckboxItem,
5
- DropdownMenuContent,
6
- DropdownMenuGroup,
7
- DropdownMenuItem,
8
- DropdownMenuLabel,
9
- DropdownMenuRadioGroup,
10
- DropdownMenuRadioItem,
11
- DropdownMenuSeparator,
12
- DropdownMenuShortcut,
13
- DropdownMenuSub,
14
- DropdownMenuSubContent,
15
- DropdownMenuSubTrigger,
16
- DropdownMenuTrigger
17
- } from "./chunk-EWS3N4OZ.mjs";
18
- import "./chunk-UG3URV2Z.mjs";
19
- export {
20
- DropdownMenu,
21
- DropdownMenuCheckboxItem,
22
- DropdownMenuContent,
23
- DropdownMenuGroup,
24
- DropdownMenuItem,
25
- DropdownMenuLabel,
26
- DropdownMenuRadioGroup,
27
- DropdownMenuRadioItem,
28
- DropdownMenuSeparator,
29
- DropdownMenuShortcut,
30
- DropdownMenuSub,
31
- DropdownMenuSubContent,
32
- DropdownMenuSubTrigger,
33
- DropdownMenuTrigger
34
- };
1
+ "use client";import{a,b,c,d,e,f,g,h,i,j,k,l,m,n}from"./chunk-YV4UJQ5X.mjs";import"./chunk-JTI7KCLO.mjs";export{a as DropdownMenu,j as DropdownMenuCheckboxItem,h as DropdownMenuContent,c as DropdownMenuGroup,i as DropdownMenuItem,l as DropdownMenuLabel,e as DropdownMenuRadioGroup,k as DropdownMenuRadioItem,m as DropdownMenuSeparator,n as DropdownMenuShortcut,d as DropdownMenuSub,g as DropdownMenuSubContent,f as DropdownMenuSubTrigger,b as DropdownMenuTrigger};
35
2
  //# sourceMappingURL=dropdown-menu.mjs.map
package/dist/em.js CHANGED
@@ -1,13 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }// src/em.tsx
2
- var _react = require('react'); var React = _interopRequireWildcard(_react);
3
- var _reactslot = require('@radix-ui/react-slot');
4
- var _jsxruntime = require('react/jsx-runtime');
5
- var Em = React.forwardRef(({ asChild, ...props }, ref) => {
6
- const Component = asChild ? _reactslot.Slot : "em";
7
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, Component, { ref, ...props });
8
- });
9
- Em.displayName = "Em";
10
-
11
-
12
- exports.Em = Em;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }var _react = require('react'); var e = _interopRequireWildcard(_react);var _reactslot = require('@radix-ui/react-slot');var _jsxruntime = require('react/jsx-runtime');var r=e.forwardRef(({asChild:t,...m},o)=>_jsxruntime.jsx.call(void 0, t?_reactslot.Slot:"em",{ref:o,...m}));r.displayName="Em";exports.Em = r;
13
2
  //# sourceMappingURL=em.js.map
package/dist/em.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/em.tsx"],"names":[],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAeZ;AAHT,IAAM,KAAW,iBAA+B,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC9E,QAAM,YAAY,UAAU,OAAO;AAEnC,SAAO,oBAAC,aAAU,KAAW,GAAG,OAAO;AACzC,CAAC;AAED,GAAG,cAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : \"em\";\n\n return <Component ref={ref} {...props} />;\n});\n\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"]}
1
+ {"version":3,"sources":["../src/em.tsx"],"names":["React","Slot","jsx","Em","asChild","props","ref"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAeZ,cAAAC,MAAA,oBAHT,IAAMC,EAAW,aAA+B,CAAC,CAAE,QAAAC,EAAS,GAAGC,CAAM,EAAGC,IAG/DJ,EAFWE,EAAUH,EAAO,KAE3B,CAAU,IAAKK,EAAM,GAAGD,EAAO,CACxC,EAEDF,EAAG,YAAc","sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : \"em\";\n\n return <Component ref={ref} {...props} />;\n});\n\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"]}
package/dist/em.mjs CHANGED
@@ -1,13 +1,2 @@
1
- // src/em.tsx
2
- import * as React from "react";
3
- import { Slot } from "@radix-ui/react-slot";
4
- import { jsx } from "react/jsx-runtime";
5
- var Em = React.forwardRef(({ asChild, ...props }, ref) => {
6
- const Component = asChild ? Slot : "em";
7
- return /* @__PURE__ */ jsx(Component, { ref, ...props });
8
- });
9
- Em.displayName = "Em";
10
- export {
11
- Em
12
- };
1
+ import*as e from"react";import{Slot as n}from"@radix-ui/react-slot";import{jsx as p}from"react/jsx-runtime";var r=e.forwardRef(({asChild:t,...m},o)=>p(t?n:"em",{ref:o,...m}));r.displayName="Em";export{r as Em};
13
2
  //# sourceMappingURL=em.mjs.map
package/dist/em.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/em.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : \"em\";\n\n return <Component ref={ref} {...props} />;\n});\n\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"],"mappings":";AAAA,YAAY,WAAW;AACvB,SAAS,YAAY;AAeZ;AAHT,IAAM,KAAW,iBAA+B,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ;AAC9E,QAAM,YAAY,UAAU,OAAO;AAEnC,SAAO,oBAAC,aAAU,KAAW,GAAG,OAAO;AACzC,CAAC;AAED,GAAG,cAAc;","names":[]}
1
+ {"version":3,"sources":["../src/em.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\n\n/* -----------------------------------------------------------------------------\n * Component: Em\n * -------------------------------------------------------------------------- */\n\ntype EmElement = HTMLElement;\n\ninterface EmProps extends React.HTMLAttributes<HTMLElement> {\n asChild?: boolean;\n}\n\nconst Em = React.forwardRef<EmElement, EmProps>(({ asChild, ...props }, ref) => {\n const Component = asChild ? Slot : \"em\";\n\n return <Component ref={ref} {...props} />;\n});\n\nEm.displayName = \"Em\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport { Em, type EmProps };\n"],"mappings":"AAAA,UAAYA,MAAW,QACvB,OAAS,QAAAC,MAAY,uBAeZ,cAAAC,MAAA,oBAHT,IAAMC,EAAW,aAA+B,CAAC,CAAE,QAAAC,EAAS,GAAGC,CAAM,EAAGC,IAG/DJ,EAFWE,EAAUH,EAAO,KAE3B,CAAU,IAAKK,EAAM,GAAGD,EAAO,CACxC,EAEDF,EAAG,YAAc","names":["React","Slot","jsx","Em","asChild","props","ref"]}
package/dist/form.js CHANGED
@@ -1,92 +1,2 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";
2
-
3
-
4
- var _chunkIVYGBU4Gjs = require('./chunk-IVYGBU4G.js');
5
-
6
-
7
- var _chunkG3NP7M2Njs = require('./chunk-G3NP7M2N.js');
8
-
9
- // src/form.tsx
10
- var _react = require('react'); var React = _interopRequireWildcard(_react);
11
- var _reactslot = require('@radix-ui/react-slot');
12
-
13
-
14
-
15
-
16
- var _reacthookform = require('react-hook-form');
17
- var _jsxruntime = require('react/jsx-runtime');
18
- var FormFieldContext = React.createContext(null);
19
- var FormItemContext = React.createContext(null);
20
- var useFormField = () => {
21
- const fieldContext = React.useContext(FormFieldContext);
22
- const itemContext = React.useContext(FormItemContext);
23
- const { getFieldState, formState } = _reacthookform.useFormContext.call(void 0, );
24
- if (!fieldContext || !itemContext) {
25
- throw new Error("useFormField should be used within <FormField>");
26
- }
27
- const fieldState = getFieldState(fieldContext.name, formState);
28
- const { id } = itemContext;
29
- return {
30
- id,
31
- name: fieldContext.name,
32
- formItemId: `form-item-${id}`,
33
- formDescriptionId: `form-item-description-${id}`,
34
- formMessageId: `form-item-message-${id}`,
35
- ...fieldState
36
- };
37
- };
38
- var Form = _reacthookform.FormProvider;
39
- function FormField({ ...props }) {
40
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FormFieldContext.Provider, { value: { name: props.name }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _reacthookform.Controller, { ...props }) });
41
- }
42
- var FormItem = React.forwardRef(({ className, ...props }, ref) => {
43
- const id = React.useId();
44
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, FormItemContext.Provider, { value: { id }, children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { ref, className: _chunkG3NP7M2Njs.cn.call(void 0, "space-y-2", className), ...props }) });
45
- });
46
- FormItem.displayName = "FormItem";
47
- var FormLabel = React.forwardRef(({ className, ...props }, ref) => {
48
- const { error, formItemId } = useFormField();
49
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkIVYGBU4Gjs.Label, { ref, className: _chunkG3NP7M2Njs.cn.call(void 0, error && "text-destructive", className), htmlFor: formItemId, ...props });
50
- });
51
- FormLabel.displayName = "FormLabel";
52
- var FormControl = React.forwardRef(({ ...props }, ref) => {
53
- const { error, formItemId, formDescriptionId, formMessageId } = useFormField();
54
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
55
- _reactslot.Slot,
56
- {
57
- ref,
58
- id: formItemId,
59
- "aria-describedby": !error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`,
60
- "aria-invalid": Boolean(error),
61
- ...props
62
- }
63
- );
64
- });
65
- FormControl.displayName = "FormControl";
66
- var FormDescription = React.forwardRef(
67
- ({ className, ...props }, ref) => {
68
- const { formDescriptionId } = useFormField();
69
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { ref, id: formDescriptionId, className: _chunkG3NP7M2Njs.cn.call(void 0, "text-muted-foreground text-[0.8rem]", className), ...props });
70
- }
71
- );
72
- FormDescription.displayName = "FormDescription";
73
- var FormMessage = React.forwardRef(({ className, children, ...props }, ref) => {
74
- const { error, formMessageId } = useFormField();
75
- const body = error ? String(error.message) : children;
76
- if (!body) {
77
- return null;
78
- }
79
- return /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "p", { ref, id: formMessageId, className: _chunkG3NP7M2Njs.cn.call(void 0, "text-destructive text-[0.8rem] font-medium", className), ...props, children: body });
80
- });
81
- FormMessage.displayName = "FormMessage";
82
-
83
-
84
-
85
-
86
-
87
-
88
-
89
-
90
-
91
- exports.Form = Form; exports.FormControl = FormControl; exports.FormDescription = FormDescription; exports.FormField = FormField; exports.FormItem = FormItem; exports.FormLabel = FormLabel; exports.FormMessage = FormMessage; exports.useFormField = useFormField;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }"use client";var _chunkO7LLHO4Ijs = require('./chunk-O7LLHO4I.js');var _chunkQZCQ42BPjs = require('./chunk-QZCQ42BP.js');var _react = require('react'); var t = _interopRequireWildcard(_react);var _reactslot = require('@radix-ui/react-slot');var _reacthookform = require('react-hook-form');var _jsxruntime = require('react/jsx-runtime');var p=t.createContext(null),c=t.createContext(null),n= exports.useFormField =()=>{let e=t.useContext(p),r=t.useContext(c),{getFieldState:o,formState:m}=_reacthookform.useFormContext.call(void 0, );if(!e||!r)throw new Error("useFormField should be used within <FormField>");let a=o(e.name,m),{id:i}=r;return{id:i,name:e.name,formItemId:`form-item-${i}`,formDescriptionId:`form-item-description-${i}`,formMessageId:`form-item-message-${i}`,...a}},M= exports.Form =_reacthookform.FormProvider;function h({...e}){return _jsxruntime.jsx.call(void 0, p.Provider,{value:{name:e.name},children:_jsxruntime.jsx.call(void 0, _reacthookform.Controller,{...e})})}var R=t.forwardRef(({className:e,...r},o)=>{let m=t.useId();return _jsxruntime.jsx.call(void 0, c.Provider,{value:{id:m},children:_jsxruntime.jsx.call(void 0, "div",{ref:o,className:_chunkQZCQ42BPjs.b.call(void 0, "space-y-2",e),...r})})});R.displayName="FormItem";var C=t.forwardRef(({className:e,...r},o)=>{let{error:m,formItemId:a}=n();return _jsxruntime.jsx.call(void 0, _chunkO7LLHO4Ijs.a,{ref:o,className:_chunkQZCQ42BPjs.b.call(void 0, m&&"text-destructive",e),htmlFor:a,...r})});C.displayName="FormLabel";var I=t.forwardRef(({...e},r)=>{let{error:o,formItemId:m,formDescriptionId:a,formMessageId:i}=n();return _jsxruntime.jsx.call(void 0, _reactslot.Slot,{ref:r,id:m,"aria-describedby":o?`${a} ${i}`:a,"aria-invalid":!!o,...e})});I.displayName="FormControl";var g=t.forwardRef(({className:e,...r},o)=>{let{formDescriptionId:m}=n();return _jsxruntime.jsx.call(void 0, "p",{ref:o,id:m,className:_chunkQZCQ42BPjs.b.call(void 0, "text-muted-foreground text-[0.8rem]",e),...r})});g.displayName="FormDescription";var x=t.forwardRef(({className:e,children:r,...o},m)=>{let{error:a,formMessageId:i}=n(),d=a?String(a.message):r;return d?_jsxruntime.jsx.call(void 0, "p",{ref:m,id:i,className:_chunkQZCQ42BPjs.b.call(void 0, "text-destructive text-[0.8rem] font-medium",e),...o,children:d}):null});x.displayName="FormMessage";exports.Form = M; exports.FormControl = I; exports.FormDescription = g; exports.FormField = h; exports.FormItem = R; exports.FormLabel = C; exports.FormMessage = x; exports.useFormField = n;
92
2
  //# sourceMappingURL=form.js.map
package/dist/form.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/form.tsx"],"names":[],"mappings":";;;;;;;;;AAEA,YAAY,WAAW;AAEvB,SAAS,YAAY;AACrB;AAAA,EACE;AAAA,EAKA;AAAA,EACA;AAAA,OACK;AA+ED;AA5DN,IAAM,mBAAyB,oBAA4C,IAAI;AAE/E,IAAM,kBAAwB,oBAA2C,IAAI;AAE7E,IAAM,eAAe,MAWhB;AACH,QAAM,eAAqB,iBAAW,gBAAgB;AACtD,QAAM,cAAoB,iBAAW,eAAe;AACpD,QAAM,EAAE,eAAe,UAAU,IAAI,eAAe;AAEpD,MAAI,CAAC,gBAAgB,CAAC,aAAa;AACjC,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AAEA,QAAM,aAAa,cAAc,aAAa,MAAM,SAAS;AAE7D,QAAM,EAAE,GAAG,IAAI;AAEf,SAAO;AAAA,IACL;AAAA,IACA,MAAM,aAAa;AAAA,IACnB,YAAY,aAAa,EAAE;AAAA,IAC3B,mBAAmB,yBAAyB,EAAE;AAAA,IAC9C,eAAe,qBAAqB,EAAE;AAAA,IACtC,GAAG;AAAA,EACL;AACF;AAOA,IAAM,OAAO;AAWb,SAAS,UAGP,EAAE,GAAG,MAAM,GAA2D;AACtE,SACE,oBAAC,iBAAiB,UAAjB,EAA0B,OAAO,EAAE,MAAM,MAAM,KAAK,GACnD,8BAAC,cAAY,GAAG,OAAO,GACzB;AAEJ;AASA,IAAM,WAAiB,iBAA2C,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAClG,QAAM,KAAW,YAAM;AAEvB,SACE,oBAAC,gBAAgB,UAAhB,EAAyB,OAAO,EAAE,GAAG,GACpC,8BAAC,SAAI,KAAU,WAAW,GAAG,aAAa,SAAS,GAAI,GAAG,OAAO,GACnE;AAEJ,CAAC;AAED,SAAS,cAAc;AASvB,IAAM,YAAkB,iBAA6C,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AACrG,QAAM,EAAE,OAAO,WAAW,IAAI,aAAa;AAE3C,SAAO,oBAAC,SAAM,KAAU,WAAW,GAAG,SAAS,oBAAoB,SAAS,GAAG,SAAS,YAAa,GAAG,OAAO;AACjH,CAAC;AAED,UAAU,cAAc;AASxB,IAAM,cAAoB,iBAAiD,CAAC,EAAE,GAAG,MAAM,GAAG,QAAQ;AAChG,QAAM,EAAE,OAAO,YAAY,mBAAmB,cAAc,IAAI,aAAa;AAE7E,SACE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,IAAI;AAAA,MACJ,oBAAkB,CAAC,QAAQ,oBAAoB,GAAG,iBAAiB,IAAI,aAAa;AAAA,MACpF,gBAAc,QAAQ,KAAK;AAAA,MAC1B,GAAG;AAAA;AAAA,EACN;AAEJ,CAAC;AAED,YAAY,cAAc;AAS1B,IAAM,kBAAwB;AAAA,EAC5B,CAAC,EAAE,WAAW,GAAG,MAAM,GAAG,QAAQ;AAChC,UAAM,EAAE,kBAAkB,IAAI,aAAa;AAE3C,WACE,oBAAC,OAAE,KAAU,IAAI,mBAAmB,WAAW,GAAG,uCAAuC,SAAS,GAAI,GAAG,OAAO;AAAA,EAEpH;AACF;AAEA,gBAAgB,cAAc;AAS9B,IAAM,cAAoB,iBAAiD,CAAC,EAAE,WAAW,UAAU,GAAG,MAAM,GAAG,QAAQ;AACrH,QAAM,EAAE,OAAO,cAAc,IAAI,aAAa;AAC9C,QAAM,OAAO,QAAQ,OAAO,MAAM,OAAO,IAAI;AAE7C,MAAI,CAAC,MAAM;AACT,WAAO;AAAA,EACT;AAEA,SACE,oBAAC,OAAE,KAAU,IAAI,eAAe,WAAW,GAAG,8CAA8C,SAAS,GAAI,GAAG,OACzG,gBACH;AAEJ,CAAC;AAED,YAAY,cAAc","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\";\nimport { cn } from \"./utils\";\nimport { Label } from \"./label\";\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n error?: FieldError | undefined;\n id: string;\n name: string;\n formItemId: string;\n formDescriptionId: string;\n formMessageId: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n});\n\nFormItem.displayName = \"FormItem\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && \"text-destructive\", className)} htmlFor={formItemId} {...props} />;\n});\n\nFormLabel.displayName = \"FormLabel\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\n\nFormControl.displayName = \"FormControl\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p ref={ref} id={formDescriptionId} className={cn(\"text-muted-foreground text-[0.8rem]\", className)} {...props} />\n );\n },\n);\n\nFormDescription.displayName = \"FormDescription\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn(\"text-destructive text-[0.8rem] font-medium\", className)} {...props}>\n {body}\n </p>\n );\n});\n\nFormMessage.displayName = \"FormMessage\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"]}
1
+ {"version":3,"sources":["../src/form.tsx"],"names":["React","Slot","Controller","FormProvider","useFormContext","jsx","FormFieldContext","FormItemContext","useFormField","fieldContext","itemContext","getFieldState","formState","fieldState","id","Form","FormField","props","FormItem","className","ref","cn","FormLabel","error","formItemId","Label","FormControl","formDescriptionId","formMessageId","FormDescription","FormMessage","children","body"],"mappings":"6FAEA,UAAYA,MAAW,QAEvB,OAAS,QAAAC,MAAY,uBACrB,OACE,cAAAC,EAKA,gBAAAC,EACA,kBAAAC,MACK,kBA+ED,cAAAC,MAAA,oBA5DN,IAAMC,EAAyB,gBAA4C,IAAI,EAEzEC,EAAwB,gBAA2C,IAAI,EAEvEC,EAAe,IAWhB,CACH,IAAMC,EAAqB,aAAWH,CAAgB,EAChDI,EAAoB,aAAWH,CAAe,EAC9C,CAAE,cAAAI,EAAe,UAAAC,CAAU,EAAIR,EAAe,EAEpD,GAAI,CAACK,GAAgB,CAACC,EACpB,MAAM,IAAI,MAAM,gDAAgD,EAGlE,IAAMG,EAAaF,EAAcF,EAAa,KAAMG,CAAS,EAEvD,CAAE,GAAAE,CAAG,EAAIJ,EAEf,MAAO,CACL,GAAAI,EACA,KAAML,EAAa,KACnB,WAAY,aAAaK,CAAE,GAC3B,kBAAmB,yBAAyBA,CAAE,GAC9C,cAAe,qBAAqBA,CAAE,GACtC,GAAGD,CACL,CACF,EAOME,EAAOZ,EAWb,SAASa,EAGP,CAAE,GAAGC,CAAM,EAA2D,CACtE,OACEZ,EAACC,EAAiB,SAAjB,CAA0B,MAAO,CAAE,KAAMW,EAAM,IAAK,EACnD,SAAAZ,EAACH,EAAA,CAAY,GAAGe,EAAO,EACzB,CAEJ,CASA,IAAMC,EAAiB,aAA2C,CAAC,CAAE,UAAAC,EAAW,GAAGF,CAAM,EAAGG,IAAQ,CAClG,IAAMN,EAAW,QAAM,EAEvB,OACET,EAACE,EAAgB,SAAhB,CAAyB,MAAO,CAAE,GAAAO,CAAG,EACpC,SAAAT,EAAC,OAAI,IAAKe,EAAK,UAAWC,EAAG,YAAaF,CAAS,EAAI,GAAGF,EAAO,EACnE,CAEJ,CAAC,EAEDC,EAAS,YAAc,WASvB,IAAMI,EAAkB,aAA6C,CAAC,CAAE,UAAAH,EAAW,GAAGF,CAAM,EAAGG,IAAQ,CACrG,GAAM,CAAE,MAAAG,EAAO,WAAAC,CAAW,EAAIhB,EAAa,EAE3C,OAAOH,EAACoB,EAAA,CAAM,IAAKL,EAAK,UAAWC,EAAGE,GAAS,mBAAoBJ,CAAS,EAAG,QAASK,EAAa,GAAGP,EAAO,CACjH,CAAC,EAEDK,EAAU,YAAc,YASxB,IAAMI,EAAoB,aAAiD,CAAC,CAAE,GAAGT,CAAM,EAAGG,IAAQ,CAChG,GAAM,CAAE,MAAAG,EAAO,WAAAC,EAAY,kBAAAG,EAAmB,cAAAC,CAAc,EAAIpB,EAAa,EAE7E,OACEH,EAACJ,EAAA,CACC,IAAKmB,EACL,GAAII,EACJ,mBAAmBD,EAA4B,GAAGI,CAAiB,IAAIC,CAAa,GAAzDD,EAC3B,eAAc,EAAQJ,EACrB,GAAGN,EACN,CAEJ,CAAC,EAEDS,EAAY,YAAc,cAS1B,IAAMG,EAAwB,aAC5B,CAAC,CAAE,UAAAV,EAAW,GAAGF,CAAM,EAAGG,IAAQ,CAChC,GAAM,CAAE,kBAAAO,CAAkB,EAAInB,EAAa,EAE3C,OACEH,EAAC,KAAE,IAAKe,EAAK,GAAIO,EAAmB,UAAWN,EAAG,sCAAuCF,CAAS,EAAI,GAAGF,EAAO,CAEpH,CACF,EAEAY,EAAgB,YAAc,kBAS9B,IAAMC,EAAoB,aAAiD,CAAC,CAAE,UAAAX,EAAW,SAAAY,EAAU,GAAGd,CAAM,EAAGG,IAAQ,CACrH,GAAM,CAAE,MAAAG,EAAO,cAAAK,CAAc,EAAIpB,EAAa,EACxCwB,EAAOT,EAAQ,OAAOA,EAAM,OAAO,EAAIQ,EAE7C,OAAKC,EAKH3B,EAAC,KAAE,IAAKe,EAAK,GAAIQ,EAAe,UAAWP,EAAG,6CAA8CF,CAAS,EAAI,GAAGF,EACzG,SAAAe,EACH,EANO,IAQX,CAAC,EAEDF,EAAY,YAAc","sourcesContent":["\"use client\";\n\nimport * as React from \"react\";\nimport type * as LabelPrimitive from \"@radix-ui/react-label\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport {\n Controller,\n type ControllerProps,\n type FieldError,\n type FieldPath,\n type FieldValues,\n FormProvider,\n useFormContext,\n} from \"react-hook-form\";\nimport { cn } from \"./utils\";\nimport { Label } from \"./label\";\n\n/* -----------------------------------------------------------------------------\n * Context: Form\n * -------------------------------------------------------------------------- */\n\ninterface FormFieldContextValue<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> {\n name: TName;\n}\n\ninterface FormItemContextValue {\n id: string;\n}\n\nconst FormFieldContext = React.createContext<FormFieldContextValue | null>(null);\n\nconst FormItemContext = React.createContext<FormItemContextValue | null>(null);\n\nconst useFormField = (): {\n invalid: boolean;\n isDirty: boolean;\n isTouched: boolean;\n isValidating: boolean;\n error?: FieldError | undefined;\n id: string;\n name: string;\n formItemId: string;\n formDescriptionId: string;\n formMessageId: string;\n} => {\n const fieldContext = React.useContext(FormFieldContext);\n const itemContext = React.useContext(FormItemContext);\n const { getFieldState, formState } = useFormContext();\n\n if (!fieldContext || !itemContext) {\n throw new Error(\"useFormField should be used within <FormField>\");\n }\n\n const fieldState = getFieldState(fieldContext.name, formState);\n\n const { id } = itemContext;\n\n return {\n id,\n name: fieldContext.name,\n formItemId: `form-item-${id}`,\n formDescriptionId: `form-item-description-${id}`,\n formMessageId: `form-item-message-${id}`,\n ...fieldState,\n };\n};\n\n/* -----------------------------------------------------------------------------\n * Component: Form\n * -------------------------------------------------------------------------- */\n\ntype FormProps = React.ComponentProps<typeof FormProvider>;\nconst Form = FormProvider;\n\n/* -----------------------------------------------------------------------------\n * Component: FormField\n * -------------------------------------------------------------------------- */\n\ntype FormFieldProps<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n> = ControllerProps<TFieldValues, TName>;\n\nfunction FormField<\n TFieldValues extends FieldValues = FieldValues,\n TName extends FieldPath<TFieldValues> = FieldPath<TFieldValues>,\n>({ ...props }: FormFieldProps<TFieldValues, TName>): React.JSX.Element {\n return (\n <FormFieldContext.Provider value={{ name: props.name }}>\n <Controller {...props} />\n </FormFieldContext.Provider>\n );\n}\n\n/* -----------------------------------------------------------------------------\n * Component: FormItem\n * -------------------------------------------------------------------------- */\n\ntype FormItemElement = HTMLDivElement;\ntype FormItemProps = React.HTMLAttributes<HTMLDivElement>;\n\nconst FormItem = React.forwardRef<FormItemElement, FormItemProps>(({ className, ...props }, ref) => {\n const id = React.useId();\n\n return (\n <FormItemContext.Provider value={{ id }}>\n <div ref={ref} className={cn(\"space-y-2\", className)} {...props} />\n </FormItemContext.Provider>\n );\n});\n\nFormItem.displayName = \"FormItem\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormLabel\n * -------------------------------------------------------------------------- */\n\ntype FormFieldElement = React.ElementRef<typeof LabelPrimitive.Root>;\ntype FormLabelProps = React.ComponentPropsWithoutRef<typeof LabelPrimitive.Root>;\n\nconst FormLabel = React.forwardRef<FormFieldElement, FormLabelProps>(({ className, ...props }, ref) => {\n const { error, formItemId } = useFormField();\n\n return <Label ref={ref} className={cn(error && \"text-destructive\", className)} htmlFor={formItemId} {...props} />;\n});\n\nFormLabel.displayName = \"FormLabel\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormControl\n * -------------------------------------------------------------------------- */\n\ntype FormControlElement = React.ElementRef<typeof Slot>;\ntype FormControlProps = React.ComponentPropsWithoutRef<typeof Slot>;\n\nconst FormControl = React.forwardRef<FormControlElement, FormControlProps>(({ ...props }, ref) => {\n const { error, formItemId, formDescriptionId, formMessageId } = useFormField();\n\n return (\n <Slot\n ref={ref}\n id={formItemId}\n aria-describedby={!error ? formDescriptionId : `${formDescriptionId} ${formMessageId}`}\n aria-invalid={Boolean(error)}\n {...props}\n />\n );\n});\n\nFormControl.displayName = \"FormControl\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormDescription\n * -------------------------------------------------------------------------- */\n\ntype FormDescriptionElement = HTMLParagraphElement;\ntype FormDescriptionProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormDescription = React.forwardRef<FormDescriptionElement, FormDescriptionProps>(\n ({ className, ...props }, ref) => {\n const { formDescriptionId } = useFormField();\n\n return (\n <p ref={ref} id={formDescriptionId} className={cn(\"text-muted-foreground text-[0.8rem]\", className)} {...props} />\n );\n },\n);\n\nFormDescription.displayName = \"FormDescription\";\n\n/* -----------------------------------------------------------------------------\n * Component: FormMessage\n * -------------------------------------------------------------------------- */\n\ntype FormMessageElement = HTMLParagraphElement;\ntype FormMessageProps = React.HTMLAttributes<HTMLParagraphElement>;\n\nconst FormMessage = React.forwardRef<FormMessageElement, FormMessageProps>(({ className, children, ...props }, ref) => {\n const { error, formMessageId } = useFormField();\n const body = error ? String(error.message) : children;\n\n if (!body) {\n return null;\n }\n\n return (\n <p ref={ref} id={formMessageId} className={cn(\"text-destructive text-[0.8rem] font-medium\", className)} {...props}>\n {body}\n </p>\n );\n});\n\nFormMessage.displayName = \"FormMessage\";\n\n/* -----------------------------------------------------------------------------\n * Exports\n * -------------------------------------------------------------------------- */\n\nexport {\n useFormField,\n Form,\n FormItem,\n FormLabel,\n FormControl,\n FormDescription,\n FormMessage,\n FormField,\n type FormProps,\n type FormItemProps,\n type FormLabelProps,\n type FormControlProps,\n type FormDescriptionProps,\n type FormMessageProps,\n type FormFieldProps,\n};\n"]}