@codefast/ui 0.3.11 → 0.3.12-canary.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 (246) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +4 -0
  3. package/dist/components/accordion.d.ts +11 -29
  4. package/dist/components/accordion.d.ts.map +1 -0
  5. package/dist/components/accordion.js +10 -37
  6. package/dist/components/alert-dialog.d.ts +25 -60
  7. package/dist/components/alert-dialog.d.ts.map +1 -0
  8. package/dist/components/alert-dialog.js +16 -69
  9. package/dist/components/alert.d.ts +16 -27
  10. package/dist/components/alert.d.ts.map +1 -0
  11. package/dist/components/alert.js +22 -30
  12. package/dist/components/aspect-ratio.d.ts +5 -8
  13. package/dist/components/aspect-ratio.d.ts.map +1 -0
  14. package/dist/components/aspect-ratio.js +5 -7
  15. package/dist/components/avatar.d.ts +7 -17
  16. package/dist/components/avatar.d.ts.map +1 -0
  17. package/dist/components/avatar.js +7 -18
  18. package/dist/components/badge.d.ts +15 -21
  19. package/dist/components/badge.d.ts.map +1 -0
  20. package/dist/components/badge.js +23 -20
  21. package/dist/components/breadcrumb.d.ts +13 -35
  22. package/dist/components/breadcrumb.d.ts.map +1 -0
  23. package/dist/components/breadcrumb.js +13 -49
  24. package/dist/components/button-group.d.ts +15 -29
  25. package/dist/components/button-group.d.ts.map +1 -0
  26. package/dist/components/button-group.js +22 -27
  27. package/dist/components/button.d.ts +26 -35
  28. package/dist/components/button.d.ts.map +1 -0
  29. package/dist/components/button.js +43 -51
  30. package/dist/components/calendar.d.ts +10 -24
  31. package/dist/components/calendar.d.ts.map +1 -0
  32. package/dist/components/calendar.js +75 -92
  33. package/dist/components/card.d.ts +11 -34
  34. package/dist/components/card.d.ts.map +1 -0
  35. package/dist/components/card.js +11 -39
  36. package/dist/components/carousel.d.ts +25 -55
  37. package/dist/components/carousel.d.ts.map +1 -0
  38. package/dist/components/carousel.js +82 -114
  39. package/dist/components/chart.d.ts +37 -72
  40. package/dist/components/chart.d.ts.map +1 -0
  41. package/dist/components/chart.js +161 -150
  42. package/dist/components/checkbox-cards.d.ts +9 -15
  43. package/dist/components/checkbox-cards.d.ts.map +1 -0
  44. package/dist/components/checkbox-cards.js +8 -22
  45. package/dist/components/checkbox-group.d.ts +9 -16
  46. package/dist/components/checkbox-group.d.ts.map +1 -0
  47. package/dist/components/checkbox-group.js +7 -19
  48. package/dist/components/checkbox.d.ts +5 -9
  49. package/dist/components/checkbox.d.ts.map +1 -0
  50. package/dist/components/checkbox.js +6 -14
  51. package/dist/components/collapsible.d.ts +7 -14
  52. package/dist/components/collapsible.d.ts.map +1 -0
  53. package/dist/components/collapsible.js +7 -15
  54. package/dist/components/command.d.ts +24 -55
  55. package/dist/components/command.d.ts.map +1 -0
  56. package/dist/components/command.js +18 -69
  57. package/dist/components/context-menu.d.ts +23 -72
  58. package/dist/components/context-menu.d.ts.map +1 -0
  59. package/dist/components/context-menu.js +21 -89
  60. package/dist/components/dialog.d.ts +23 -53
  61. package/dist/components/dialog.d.ts.map +1 -0
  62. package/dist/components/dialog.js +20 -72
  63. package/dist/components/drawer.d.ts +29 -60
  64. package/dist/components/drawer.d.ts.map +1 -0
  65. package/dist/components/drawer.js +16 -58
  66. package/dist/components/dropdown-menu.d.ts +23 -73
  67. package/dist/components/dropdown-menu.d.ts.map +1 -0
  68. package/dist/components/dropdown-menu.js +21 -96
  69. package/dist/components/empty.d.ts +16 -37
  70. package/dist/components/empty.d.ts.map +1 -0
  71. package/dist/components/empty.js +24 -44
  72. package/dist/components/field.d.ts +26 -63
  73. package/dist/components/field.d.ts.map +1 -0
  74. package/dist/components/field.js +46 -89
  75. package/dist/components/form.d.ts +16 -37
  76. package/dist/components/form.d.ts.map +1 -0
  77. package/dist/components/form.js +50 -66
  78. package/dist/components/hover-card.d.ts +8 -21
  79. package/dist/components/hover-card.d.ts.map +1 -0
  80. package/dist/components/hover-card.js +8 -23
  81. package/dist/components/input-group.d.ts +29 -53
  82. package/dist/components/input-group.d.ts.map +1 -0
  83. package/dist/components/input-group.js +59 -66
  84. package/dist/components/input-number.d.ts +8 -28
  85. package/dist/components/input-number.d.ts.map +1 -0
  86. package/dist/components/input-number.js +14 -55
  87. package/dist/components/input-otp.d.ts +11 -24
  88. package/dist/components/input-otp.d.ts.map +1 -0
  89. package/dist/components/input-otp.js +13 -34
  90. package/dist/components/input-password.d.ts +6 -12
  91. package/dist/components/input-password.d.ts.map +1 -0
  92. package/dist/components/input-password.js +10 -31
  93. package/dist/components/input-search.d.ts +9 -18
  94. package/dist/components/input-search.d.ts.map +1 -0
  95. package/dist/components/input-search.js +16 -44
  96. package/dist/components/input.d.ts +5 -10
  97. package/dist/components/input.d.ts.map +1 -0
  98. package/dist/components/input.js +5 -9
  99. package/dist/components/item.d.ts +33 -69
  100. package/dist/components/item.d.ts.map +1 -0
  101. package/dist/components/item.js +47 -90
  102. package/dist/components/kbd.d.ts +6 -13
  103. package/dist/components/kbd.d.ts.map +1 -0
  104. package/dist/components/kbd.js +6 -13
  105. package/dist/components/label.d.ts +5 -9
  106. package/dist/components/label.d.ts.map +1 -0
  107. package/dist/components/label.js +5 -8
  108. package/dist/components/menubar.d.ts +24 -80
  109. package/dist/components/menubar.d.ts.map +1 -0
  110. package/dist/components/menubar.js +23 -99
  111. package/dist/components/native-select.d.ts +7 -16
  112. package/dist/components/native-select.d.ts.map +1 -0
  113. package/dist/components/native-select.js +7 -25
  114. package/dist/components/navigation-menu.d.ts +13 -36
  115. package/dist/components/navigation-menu.d.ts.map +1 -0
  116. package/dist/components/navigation-menu.js +25 -61
  117. package/dist/components/pagination.d.ts +15 -35
  118. package/dist/components/pagination.d.ts.map +1 -0
  119. package/dist/components/pagination.js +13 -55
  120. package/dist/components/popover.d.ts +9 -24
  121. package/dist/components/popover.d.ts.map +1 -0
  122. package/dist/components/popover.js +9 -27
  123. package/dist/components/progress-circle.d.ts +89 -106
  124. package/dist/components/progress-circle.d.ts.map +1 -0
  125. package/dist/components/progress-circle.js +70 -103
  126. package/dist/components/progress.d.ts +5 -10
  127. package/dist/components/progress.d.ts.map +1 -0
  128. package/dist/components/progress.js +7 -13
  129. package/dist/components/radio-cards.d.ts +5 -10
  130. package/dist/components/radio-cards.d.ts.map +1 -0
  131. package/dist/components/radio-cards.js +7 -21
  132. package/dist/components/radio-group.d.ts +6 -13
  133. package/dist/components/radio-group.d.ts.map +1 -0
  134. package/dist/components/radio-group.js +6 -17
  135. package/dist/components/radio.d.ts +6 -12
  136. package/dist/components/radio.d.ts.map +1 -0
  137. package/dist/components/radio.js +5 -10
  138. package/dist/components/resizable.d.ts +8 -18
  139. package/dist/components/resizable.d.ts.map +1 -0
  140. package/dist/components/resizable.js +7 -21
  141. package/dist/components/scroll-area.d.ts +21 -33
  142. package/dist/components/scroll-area.d.ts.map +1 -0
  143. package/dist/components/scroll-area.js +64 -84
  144. package/dist/components/select.d.ts +17 -50
  145. package/dist/components/select.d.ts.map +1 -0
  146. package/dist/components/select.js +26 -78
  147. package/dist/components/separator.d.ts +20 -29
  148. package/dist/components/separator.d.ts.map +1 -0
  149. package/dist/components/separator.js +27 -36
  150. package/dist/components/sheet.d.ts +30 -62
  151. package/dist/components/sheet.d.ts.map +1 -0
  152. package/dist/components/sheet.js +36 -80
  153. package/dist/components/sidebar.d.ts +67 -160
  154. package/dist/components/sidebar.d.ts.map +1 -0
  155. package/dist/components/sidebar.js +166 -301
  156. package/dist/components/skeleton.d.ts +5 -9
  157. package/dist/components/skeleton.d.ts.map +1 -0
  158. package/dist/components/skeleton.js +5 -8
  159. package/dist/components/slider.d.ts +5 -13
  160. package/dist/components/slider.d.ts.map +1 -0
  161. package/dist/components/slider.js +12 -34
  162. package/dist/components/sonner.d.ts +8 -10
  163. package/dist/components/sonner.d.ts.map +1 -0
  164. package/dist/components/sonner.js +13 -16
  165. package/dist/components/spinner.d.ts +6 -12
  166. package/dist/components/spinner.d.ts.map +1 -0
  167. package/dist/components/spinner.js +20 -33
  168. package/dist/components/switch.d.ts +5 -9
  169. package/dist/components/switch.d.ts.map +1 -0
  170. package/dist/components/switch.js +5 -12
  171. package/dist/components/table.d.ts +12 -37
  172. package/dist/components/table.d.ts.map +1 -0
  173. package/dist/components/table.js +12 -47
  174. package/dist/components/tabs.d.ts +8 -21
  175. package/dist/components/tabs.d.ts.map +1 -0
  176. package/dist/components/tabs.js +8 -23
  177. package/dist/components/textarea.d.ts +5 -9
  178. package/dist/components/textarea.d.ts.map +1 -0
  179. package/dist/components/textarea.js +5 -8
  180. package/dist/components/toggle-group.d.ts +10 -24
  181. package/dist/components/toggle-group.d.ts.map +1 -0
  182. package/dist/components/toggle-group.js +20 -38
  183. package/dist/components/toggle.d.ts +18 -25
  184. package/dist/components/toggle.d.ts.map +1 -0
  185. package/dist/components/toggle.js +24 -29
  186. package/dist/components/tooltip.d.ts +9 -24
  187. package/dist/components/tooltip.d.ts.map +1 -0
  188. package/dist/components/tooltip.js +9 -28
  189. package/dist/hooks/use-animated-value.d.ts +2 -4
  190. package/dist/hooks/use-animated-value.d.ts.map +1 -0
  191. package/dist/hooks/use-animated-value.js +67 -58
  192. package/dist/hooks/use-copy-to-clipboard.d.ts +6 -11
  193. package/dist/hooks/use-copy-to-clipboard.d.ts.map +1 -0
  194. package/dist/hooks/use-copy-to-clipboard.js +42 -39
  195. package/dist/hooks/use-is-mobile.d.ts +2 -4
  196. package/dist/hooks/use-is-mobile.d.ts.map +1 -0
  197. package/dist/hooks/use-is-mobile.js +20 -23
  198. package/dist/hooks/use-media-query.d.ts +2 -4
  199. package/dist/hooks/use-media-query.d.ts.map +1 -0
  200. package/dist/hooks/use-media-query.js +49 -46
  201. package/dist/hooks/use-mutation-observer.d.ts +3 -6
  202. package/dist/hooks/use-mutation-observer.d.ts.map +1 -0
  203. package/dist/hooks/use-mutation-observer.js +33 -34
  204. package/dist/hooks/use-pagination.d.ts +15 -22
  205. package/dist/hooks/use-pagination.d.ts.map +1 -0
  206. package/dist/hooks/use-pagination.js +99 -99
  207. package/dist/index.d.ts +131 -69
  208. package/dist/index.d.ts.map +1 -0
  209. package/dist/index.js +68 -69
  210. package/dist/primitives/checkbox-group.d.ts +84 -105
  211. package/dist/primitives/checkbox-group.d.ts.map +1 -0
  212. package/dist/primitives/checkbox-group.js +91 -105
  213. package/dist/primitives/input-number.d.ts +41 -51
  214. package/dist/primitives/input-number.d.ts.map +1 -0
  215. package/dist/primitives/input-number.js +417 -473
  216. package/dist/primitives/input.d.ts +43 -48
  217. package/dist/primitives/input.d.ts.map +1 -0
  218. package/dist/primitives/input.js +67 -66
  219. package/dist/primitives/progress-circle.d.ts +49 -79
  220. package/dist/primitives/progress-circle.d.ts.map +1 -0
  221. package/dist/primitives/progress-circle.js +134 -149
  222. package/package.json +17 -10
  223. package/{dist → src}/css/preset.css +1 -1
  224. /package/{dist → src}/css/amber.css +0 -0
  225. /package/{dist → src}/css/blue.css +0 -0
  226. /package/{dist → src}/css/cyan.css +0 -0
  227. /package/{dist → src}/css/emerald.css +0 -0
  228. /package/{dist → src}/css/fuchsia.css +0 -0
  229. /package/{dist → src}/css/gray.css +0 -0
  230. /package/{dist → src}/css/green.css +0 -0
  231. /package/{dist → src}/css/indigo.css +0 -0
  232. /package/{dist → src}/css/lime.css +0 -0
  233. /package/{dist → src}/css/neutral.css +0 -0
  234. /package/{dist → src}/css/orange.css +0 -0
  235. /package/{dist → src}/css/pink.css +0 -0
  236. /package/{dist → src}/css/purple.css +0 -0
  237. /package/{dist → src}/css/red.css +0 -0
  238. /package/{dist → src}/css/rose.css +0 -0
  239. /package/{dist → src}/css/sky.css +0 -0
  240. /package/{dist → src}/css/slate.css +0 -0
  241. /package/{dist → src}/css/stone.css +0 -0
  242. /package/{dist → src}/css/style.css +0 -0
  243. /package/{dist → src}/css/teal.css +0 -0
  244. /package/{dist → src}/css/violet.css +0 -0
  245. /package/{dist → src}/css/yellow.css +0 -0
  246. /package/{dist → src}/css/zinc.css +0 -0
@@ -1,29 +1,16 @@
1
- import { ComponentProps, JSX } from "react";
2
- import { OTPInput, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
3
-
4
- //#region src/components/input-otp.d.ts
1
+ import type { ComponentProps, JSX } from "react";
2
+ import { OTPInput } from "input-otp";
5
3
  type InputOTPProps = ComponentProps<typeof OTPInput>;
6
- declare function InputOTP({
7
- className,
8
- containerClassName,
9
- ...props
10
- }: InputOTPProps): JSX.Element;
4
+ declare function InputOTP({ className, containerClassName, ...props }: InputOTPProps): JSX.Element;
11
5
  type InputOTPGroupProps = ComponentProps<"div">;
12
- declare function InputOTPGroup({
13
- className,
14
- ...props
15
- }: InputOTPGroupProps): JSX.Element;
6
+ declare function InputOTPGroup({ className, ...props }: InputOTPGroupProps): JSX.Element;
16
7
  interface InputOTPSlotProps extends ComponentProps<"div"> {
17
- index: number;
8
+ index: number;
18
9
  }
19
- declare function InputOTPSlot({
20
- className,
21
- index,
22
- ...props
23
- }: InputOTPSlotProps): JSX.Element;
10
+ declare function InputOTPSlot({ className, index, ...props }: InputOTPSlotProps): JSX.Element;
24
11
  type InputOTPSeparatorProps = ComponentProps<"div">;
25
- declare function InputOTPSeparator({
26
- ...props
27
- }: InputOTPSeparatorProps): JSX.Element;
28
- //#endregion
29
- export { InputOTP, InputOTPGroup, type InputOTPGroupProps, type InputOTPProps, InputOTPSeparator, type InputOTPSeparatorProps, InputOTPSlot, type InputOTPSlotProps, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS };
12
+ declare function InputOTPSeparator({ ...props }: InputOTPSeparatorProps): JSX.Element;
13
+ export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
14
+ export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
15
+ export type { InputOTPGroupProps, InputOTPProps, InputOTPSeparatorProps, InputOTPSlotProps };
16
+ //# sourceMappingURL=input-otp.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-otp.d.ts","sourceRoot":"","sources":["../../src/components/input-otp.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjD,OAAO,EAAE,QAAQ,EAAmB,MAAM,WAAW,CAAC;AAQtD,KAAK,aAAa,GAAG,cAAc,CAAC,OAAO,QAAQ,CAAC,CAAC;AAErD,iBAAS,QAAQ,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG,GAAG,CAAC,OAAO,CAUzF;AAMD,KAAK,kBAAkB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEhD,iBAAS,aAAa,CAAC,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAS/E;AAMD,UAAU,iBAAkB,SAAQ,cAAc,CAAC,KAAK,CAAC;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,iBAAS,YAAY,CAAC,EAAE,SAAS,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CAsBpF;AAMD,KAAK,sBAAsB,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;AAEpD,iBAAS,iBAAiB,CAAC,EAAE,GAAG,KAAK,EAAE,EAAE,sBAAsB,GAAG,GAAG,CAAC,OAAO,CAM5E;AAMD,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,WAAW,CAAC;AAChG,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,iBAAiB,EAAE,YAAY,EAAE,CAAC;AACpE,YAAY,EAAE,kBAAkB,EAAE,aAAa,EAAE,sBAAsB,EAAE,iBAAiB,EAAE,CAAC"}
@@ -1,46 +1,25 @@
1
1
  "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { cn } from "@codefast/tailwind-variants";
4
+ import { OTPInput, OTPInputContext } from "input-otp";
3
5
  import { MinusIcon } from "lucide-react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
6
  import { use } from "react";
6
- import { OTPInput, OTPInputContext, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
7
- //#region src/components/input-otp.tsx
8
7
  function InputOTP({ className, containerClassName, ...props }) {
9
- return /* @__PURE__ */ jsx(OTPInput, {
10
- "aria-label": "One-time password",
11
- className: cn(className),
12
- containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName),
13
- "data-slot": "input-otp",
14
- ...props
15
- });
8
+ return (_jsx(OTPInput, { "aria-label": "One-time password", className: cn(className), containerClassName: cn("flex items-center gap-2 has-disabled:opacity-50", containerClassName), "data-slot": "input-otp", ...props }));
16
9
  }
17
10
  function InputOTPGroup({ className, ...props }) {
18
- return /* @__PURE__ */ jsx("div", {
19
- className: cn("flex items-center -space-x-px", className),
20
- "data-slot": "input-otp-group",
21
- role: "group",
22
- ...props
23
- });
11
+ return (_jsx("div", { className: cn("flex items-center -space-x-px", className), "data-slot": "input-otp-group", role: "group", ...props }));
24
12
  }
25
13
  function InputOTPSlot({ className, index, ...props }) {
26
- const { char, hasFakeCaret, isActive } = use(OTPInputContext).slots[index];
27
- return /* @__PURE__ */ jsxs("div", {
28
- className: cn("relative flex size-9 items-center justify-center border border-input text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className),
29
- "data-active": isActive,
30
- "data-slot": "input-otp-slot",
31
- ...props,
32
- children: [char, hasFakeCaret ? /* @__PURE__ */ jsx("div", {
33
- className: "pointer-events-none absolute inset-0 flex items-center justify-center",
34
- children: /* @__PURE__ */ jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground animation-duration-1000" })
35
- }) : null]
36
- });
14
+ const inputOTPContext = use(OTPInputContext);
15
+ const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index];
16
+ return (_jsxs("div", { className: cn("relative flex size-9 items-center justify-center border border-input text-sm outline-hidden transition-all not-has-disabled:shadow-xs first:rounded-l-lg last:rounded-r-lg aria-invalid:border-destructive data-[active=true]:z-10 data-[active=true]:border-ring data-[active=true]:ring-3 data-[active=true]:ring-ring/50 data-[active=true]:aria-invalid:border-destructive data-[active=true]:aria-invalid:ring-destructive/20 dark:bg-input/30 dark:data-[active=true]:aria-invalid:ring-destructive/40", className), "data-active": isActive, "data-slot": "input-otp-slot", ...props, children: [char, hasFakeCaret ? (_jsx("div", { className: "pointer-events-none absolute inset-0 flex items-center justify-center", children: _jsx("div", { className: "h-4 w-px animate-caret-blink bg-foreground animation-duration-1000" }) })) : null] }));
37
17
  }
38
18
  function InputOTPSeparator({ ...props }) {
39
- return /* @__PURE__ */ jsx("div", {
40
- "data-slot": "input-otp-separator",
41
- ...props,
42
- children: /* @__PURE__ */ jsx(MinusIcon, {})
43
- });
19
+ return (_jsx("div", { "data-slot": "input-otp-separator", ...props, children: _jsx(MinusIcon, {}) }));
44
20
  }
45
- //#endregion
46
- export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS };
21
+ /* -----------------------------------------------------------------------------
22
+ * Exports
23
+ * -------------------------------------------------------------------------- */
24
+ export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from "input-otp";
25
+ export { InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot };
@@ -1,13 +1,7 @@
1
- import { InputGroupInput } from "./input-group.js";
2
- import { ComponentProps, JSX } from "react";
3
-
4
- //#region src/components/input-password.d.ts
1
+ import type { ComponentProps, JSX } from "react";
2
+ import { InputGroupInput } from "#components/input-group";
5
3
  type InputPasswordProps = Omit<ComponentProps<typeof InputGroupInput>, "type">;
6
- declare function InputPassword({
7
- className,
8
- disabled,
9
- readOnly,
10
- ...props
11
- }: InputPasswordProps): JSX.Element;
12
- //#endregion
13
- export { InputPassword, type InputPasswordProps };
4
+ declare function InputPassword({ className, disabled, readOnly, ...props }: InputPasswordProps): JSX.Element;
5
+ export { InputPassword };
6
+ export type { InputPasswordProps };
7
+ //# sourceMappingURL=input-password.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-password.d.ts","sourceRoot":"","sources":["../../src/components/input-password.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAqB,MAAM,OAAO,CAAC;AAKpE,OAAO,EAAgC,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAMxF,KAAK,kBAAkB,GAAG,IAAI,CAAC,cAAc,CAAC,OAAO,eAAe,CAAC,EAAE,MAAM,CAAC,CAAC;AAE/E,iBAAS,aAAa,CAAC,EACrB,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,GAAG,KAAK,EACT,EAAE,kBAAkB,GAAG,GAAG,CAAC,OAAO,CAmClC;AAMD,OAAO,EAAE,aAAa,EAAE,CAAC;AACzB,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
@@ -1,37 +1,16 @@
1
1
  "use client";
2
- import { InputGroup, InputGroupButton, InputGroupInput } from "./input-group.js";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { EyeIcon, EyeOffIcon } from "lucide-react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
5
4
  import { useCallback, useState } from "react";
6
- //#region src/components/input-password.tsx
5
+ import { InputGroup, InputGroupButton, InputGroupInput } from "#components/input-group";
7
6
  function InputPassword({ className, disabled, readOnly, ...props }) {
8
- const [type, setType] = useState("password");
9
- const togglePasswordVisibility = useCallback(() => {
10
- setType((previous) => previous === "password" ? "text" : "password");
11
- }, []);
12
- return /* @__PURE__ */ jsxs(InputGroup, {
13
- className,
14
- "data-disabled": disabled ? "true" : void 0,
15
- "data-slot": "input-password",
16
- children: [/* @__PURE__ */ jsx(InputGroupInput, {
17
- autoCapitalize: "none",
18
- "data-slot": "input-password-item",
19
- disabled,
20
- readOnly,
21
- type,
22
- ...props
23
- }), /* @__PURE__ */ jsx(InputGroupButton, {
24
- "aria-label": type === "password" ? "Show password" : "Hide password",
25
- className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
26
- "data-slot": "input-password-toggle",
27
- disabled,
28
- size: "icon-sm",
29
- type: "button",
30
- variant: "ghost",
31
- onClick: togglePasswordVisibility,
32
- children: type === "password" ? /* @__PURE__ */ jsx(EyeOffIcon, {}) : /* @__PURE__ */ jsx(EyeIcon, {})
33
- })]
34
- });
7
+ const [type, setType] = useState("password");
8
+ const togglePasswordVisibility = useCallback(() => {
9
+ setType((previous) => (previous === "password" ? "text" : "password"));
10
+ }, []);
11
+ return (_jsxs(InputGroup, { className: className, "data-disabled": disabled ? "true" : undefined, "data-slot": "input-password", children: [_jsx(InputGroupInput, { autoCapitalize: "none", "data-slot": "input-password-item", disabled: disabled, readOnly: readOnly, type: type, ...props }), _jsx(InputGroupButton, { "aria-label": type === "password" ? "Show password" : "Hide password", className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input", "data-slot": "input-password-toggle", disabled: disabled, size: "icon-sm", type: "button", variant: "ghost", onClick: togglePasswordVisibility, children: type === "password" ? _jsx(EyeOffIcon, {}) : _jsx(EyeIcon, {}) })] }));
35
12
  }
36
- //#endregion
13
+ /* -----------------------------------------------------------------------------
14
+ * Exports
15
+ * -------------------------------------------------------------------------- */
37
16
  export { InputPassword };
@@ -1,20 +1,11 @@
1
- import { InputGroupInput } from "./input-group.js";
2
- import { ComponentProps, JSX } from "react";
3
-
4
- //#region src/components/input-search.d.ts
1
+ import type { ComponentProps, JSX } from "react";
2
+ import { InputGroupInput } from "#components/input-group";
5
3
  interface InputSearchProps extends Omit<ComponentProps<typeof InputGroupInput>, "defaultValue" | "onChange" | "type" | "value"> {
6
- defaultValue?: string;
7
- onChange?: (value?: string) => void;
8
- value?: string;
4
+ defaultValue?: string;
5
+ onChange?: (value?: string) => void;
6
+ value?: string;
9
7
  }
10
- declare function InputSearch({
11
- className,
12
- defaultValue,
13
- disabled,
14
- onChange,
15
- readOnly,
16
- value: valueProperty,
17
- ...props
18
- }: InputSearchProps): JSX.Element;
19
- //#endregion
20
- export { InputSearch, type InputSearchProps };
8
+ declare function InputSearch({ className, defaultValue, disabled, onChange, readOnly, value: valueProperty, ...props }: InputSearchProps): JSX.Element;
9
+ export { InputSearch };
10
+ export type { InputSearchProps };
11
+ //# sourceMappingURL=input-search.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input-search.d.ts","sourceRoot":"","sources":["../../src/components/input-search.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjD,OAAO,EAIL,eAAe,EAChB,MAAM,yBAAyB,CAAC;AAMjC,UAAU,gBAAiB,SAAQ,IAAI,CACrC,cAAc,CAAC,OAAO,eAAe,CAAC,EACtC,cAAc,GAAG,UAAU,GAAG,MAAM,GAAG,OAAO,CAC/C;IACC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,iBAAS,WAAW,CAAC,EACnB,SAAS,EACT,YAAY,EACZ,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,KAAK,EAAE,aAAa,EACpB,GAAG,KAAK,EACT,EAAE,gBAAgB,GAAG,GAAG,CAAC,OAAO,CA4ChC;AAMD,OAAO,EAAE,WAAW,EAAE,CAAC;AACvB,YAAY,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,49 +1,21 @@
1
1
  "use client";
2
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "./input-group.js";
3
- import { SearchIcon, XIcon } from "lucide-react";
4
- import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
3
  import { useControllableState } from "@radix-ui/react-use-controllable-state";
6
- //#region src/components/input-search.tsx
4
+ import { SearchIcon, XIcon } from "lucide-react";
5
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, } from "#components/input-group";
7
6
  function InputSearch({ className, defaultValue, disabled, onChange, readOnly, value: valueProperty, ...props }) {
8
- const [value, setValue] = useControllableState({
9
- defaultProp: defaultValue,
10
- onChange,
11
- prop: valueProperty
12
- });
13
- return /* @__PURE__ */ jsxs(InputGroup, {
14
- className,
15
- "data-disabled": disabled ? "true" : void 0,
16
- "data-slot": "input-search",
17
- children: [
18
- /* @__PURE__ */ jsx(InputGroupAddon, {
19
- align: "inline-start",
20
- children: /* @__PURE__ */ jsx(SearchIcon, {})
21
- }),
22
- /* @__PURE__ */ jsx(InputGroupInput, {
23
- "data-slot": "input-search-item",
24
- disabled,
25
- readOnly,
26
- type: "search",
27
- value: value ?? "",
28
- onChange: (event) => {
29
- setValue(event.target.value);
30
- },
31
- ...props
32
- }),
33
- value ? /* @__PURE__ */ jsx(InputGroupButton, {
34
- "aria-label": "Clear search",
35
- className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input",
36
- "data-slot": "input-search-clear",
37
- disabled: disabled ?? readOnly,
38
- size: "icon-sm",
39
- variant: "ghost",
40
- onClick: () => {
41
- setValue("");
42
- },
43
- children: /* @__PURE__ */ jsx(XIcon, {})
44
- }) : null
45
- ]
46
- });
7
+ const [value, setValue] = useControllableState({
8
+ defaultProp: defaultValue,
9
+ onChange,
10
+ prop: valueProperty,
11
+ });
12
+ return (_jsxs(InputGroup, { className: className, "data-disabled": disabled ? "true" : undefined, "data-slot": "input-search", children: [_jsx(InputGroupAddon, { align: "inline-start", children: _jsx(SearchIcon, {}) }), _jsx(InputGroupInput, { "data-slot": "input-search-item", disabled: disabled, readOnly: readOnly, type: "search", value: value ?? "", onChange: (event) => {
13
+ setValue(event.target.value);
14
+ }, ...props }), value ? (_jsx(InputGroupButton, { "aria-label": "Clear search", className: "rounded-full focus-visible:ring-0 focus-visible:not-disabled:bg-input", "data-slot": "input-search-clear", disabled: disabled ?? readOnly, size: "icon-sm", variant: "ghost", onClick: () => {
15
+ setValue("");
16
+ }, children: _jsx(XIcon, {}) })) : null] }));
47
17
  }
48
- //#endregion
18
+ /* -----------------------------------------------------------------------------
19
+ * Exports
20
+ * -------------------------------------------------------------------------- */
49
21
  export { InputSearch };
@@ -1,11 +1,6 @@
1
- import { ComponentProps, JSX } from "react";
2
-
3
- //#region src/components/input.d.ts
1
+ import type { ComponentProps, JSX } from "react";
4
2
  type InputProps = ComponentProps<"input">;
5
- declare function Input({
6
- className,
7
- type,
8
- ...props
9
- }: InputProps): JSX.Element;
10
- //#endregion
11
- export { Input, type InputProps };
3
+ declare function Input({ className, type, ...props }: InputProps): JSX.Element;
4
+ export { Input };
5
+ export type { InputProps };
6
+ //# sourceMappingURL=input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"input.d.ts","sourceRoot":"","sources":["../../src/components/input.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAQjD,KAAK,UAAU,GAAG,cAAc,CAAC,OAAO,CAAC,CAAC;AAE1C,iBAAS,KAAK,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,GAAG,GAAG,CAAC,OAAO,CAcrE;AAMD,OAAO,EAAE,KAAK,EAAE,CAAC;AACjB,YAAY,EAAE,UAAU,EAAE,CAAC"}
@@ -1,14 +1,10 @@
1
1
  "use client";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { cn } from "@codefast/tailwind-variants";
3
- import { jsx } from "react/jsx-runtime";
4
- //#region src/components/input.tsx
5
4
  function Input({ className, type, ...props }) {
6
- return /* @__PURE__ */ jsx("input", {
7
- className: cn("h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className),
8
- "data-slot": "input",
9
- type,
10
- ...props
11
- });
5
+ return (_jsx("input", { className: cn("h-9 w-full min-w-0 rounded-lg border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50", "aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40", className), "data-slot": "input", type: type, ...props }));
12
6
  }
13
- //#endregion
7
+ /* -----------------------------------------------------------------------------
8
+ * Exports
9
+ * -------------------------------------------------------------------------- */
14
10
  export { Input };
@@ -1,82 +1,46 @@
1
- import { Separator } from "./separator.js";
2
- import * as _$_codefast_tailwind_variants0 from "@codefast/tailwind-variants";
3
- import { VariantProps } from "@codefast/tailwind-variants";
4
- import { ComponentProps, JSX } from "react";
5
-
6
- //#region src/components/item.d.ts
7
- declare const itemVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
8
- size: {
9
- default: string;
10
- sm: string;
11
- };
12
- variant: {
13
- default: string;
14
- muted: string;
15
- outline: string;
16
- };
1
+ import type { VariantProps } from "@codefast/tailwind-variants";
2
+ import type { ComponentProps, JSX } from "react";
3
+ import { Separator } from "#components/separator";
4
+ declare const itemVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
5
+ size: {
6
+ default: string;
7
+ sm: string;
8
+ };
9
+ variant: {
10
+ default: string;
11
+ muted: string;
12
+ outline: string;
13
+ };
17
14
  }, Record<string, never>>;
18
- declare const itemMediaVariants: _$_codefast_tailwind_variants0.VariantFunctionType<{
19
- variant: {
20
- default: string;
21
- icon: string;
22
- image: string;
23
- };
15
+ declare const itemMediaVariants: import("@codefast/tailwind-variants").VariantFunctionType<{
16
+ variant: {
17
+ default: string;
18
+ icon: string;
19
+ image: string;
20
+ };
24
21
  }, Record<string, never>>;
25
22
  type ItemGroupProps = ComponentProps<"div">;
26
- declare function ItemGroup({
27
- className,
28
- ...props
29
- }: ItemGroupProps): JSX.Element;
23
+ declare function ItemGroup({ className, ...props }: ItemGroupProps): JSX.Element;
30
24
  type ItemSeparatorProps = ComponentProps<typeof Separator>;
31
- declare function ItemSeparator({
32
- className,
33
- ...props
34
- }: ItemSeparatorProps): JSX.Element;
25
+ declare function ItemSeparator({ className, ...props }: ItemSeparatorProps): JSX.Element;
35
26
  type ItemProps = ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
36
- asChild?: boolean;
27
+ asChild?: boolean;
37
28
  };
38
- declare function Item({
39
- asChild,
40
- className,
41
- size,
42
- variant,
43
- ...props
44
- }: ItemProps): JSX.Element;
29
+ declare function Item({ asChild, className, size, variant, ...props }: ItemProps): JSX.Element;
45
30
  type ItemMediaProps = ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>;
46
- declare function ItemMedia({
47
- className,
48
- variant,
49
- ...props
50
- }: ItemMediaProps): JSX.Element;
31
+ declare function ItemMedia({ className, variant, ...props }: ItemMediaProps): JSX.Element;
51
32
  type ItemContentProps = ComponentProps<"div">;
52
- declare function ItemContent({
53
- className,
54
- ...props
55
- }: ItemContentProps): JSX.Element;
33
+ declare function ItemContent({ className, ...props }: ItemContentProps): JSX.Element;
56
34
  type ItemTitleProps = ComponentProps<"div">;
57
- declare function ItemTitle({
58
- className,
59
- ...props
60
- }: ItemTitleProps): JSX.Element;
35
+ declare function ItemTitle({ className, ...props }: ItemTitleProps): JSX.Element;
61
36
  type ItemDescriptionProps = ComponentProps<"p">;
62
- declare function ItemDescription({
63
- className,
64
- ...props
65
- }: ItemDescriptionProps): JSX.Element;
37
+ declare function ItemDescription({ className, ...props }: ItemDescriptionProps): JSX.Element;
66
38
  type ItemActionsProps = ComponentProps<"div">;
67
- declare function ItemActions({
68
- className,
69
- ...props
70
- }: ItemActionsProps): JSX.Element;
39
+ declare function ItemActions({ className, ...props }: ItemActionsProps): JSX.Element;
71
40
  type ItemHeaderProps = ComponentProps<"div">;
72
- declare function ItemHeader({
73
- className,
74
- ...props
75
- }: ItemHeaderProps): JSX.Element;
41
+ declare function ItemHeader({ className, ...props }: ItemHeaderProps): JSX.Element;
76
42
  type ItemFooterProps = ComponentProps<"div">;
77
- declare function ItemFooter({
78
- className,
79
- ...props
80
- }: ItemFooterProps): JSX.Element;
81
- //#endregion
82
- export { Item, ItemActions, type ItemActionsProps, ItemContent, type ItemContentProps, ItemDescription, type ItemDescriptionProps, ItemFooter, type ItemFooterProps, ItemGroup, type ItemGroupProps, ItemHeader, type ItemHeaderProps, ItemMedia, type ItemMediaProps, type ItemProps, ItemSeparator, type ItemSeparatorProps, ItemTitle, type ItemTitleProps, itemMediaVariants, itemVariants };
43
+ declare function ItemFooter({ className, ...props }: ItemFooterProps): JSX.Element;
44
+ export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, itemMediaVariants, ItemSeparator, ItemTitle, itemVariants, };
45
+ export type { ItemActionsProps, ItemContentProps, ItemDescriptionProps, ItemFooterProps, ItemGroupProps, ItemHeaderProps, ItemMediaProps, ItemProps, ItemSeparatorProps, ItemTitleProps, };
46
+ //# sourceMappingURL=item.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"item.d.ts","sourceRoot":"","sources":["../../src/components/item.tsx"],"names":[],"mappings":"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"}
@@ -1,116 +1,73 @@
1
- import { Separator } from "./separator.js";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { cn, tv } from "@codefast/tailwind-variants";
3
3
  import { Slot } from "@radix-ui/react-slot";
4
- import { jsx } from "react/jsx-runtime";
5
- //#region src/components/item.tsx
4
+ import { Separator } from "#components/separator";
5
+ /* -----------------------------------------------------------------------------
6
+ * Variants: Item
7
+ * -------------------------------------------------------------------------- */
6
8
  const itemVariants = tv({
7
- base: cn("group/item flex flex-wrap items-center rounded-lg border border-transparent text-sm outline-hidden transition-colors duration-100", "[a]:transition-colors [a]:hover:bg-accent/50", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50"),
8
- defaultVariants: {
9
- size: "default",
10
- variant: "default"
11
- },
12
- variants: {
13
- size: {
14
- default: "gap-4 p-4",
15
- sm: "gap-2.5 px-4 py-3"
16
- },
17
- variant: {
18
- default: "bg-transparent",
19
- muted: "bg-muted/50",
20
- outline: "border-border"
21
- }
22
- }
9
+ base: cn("group/item flex flex-wrap items-center rounded-lg border border-transparent text-sm outline-hidden transition-colors duration-100", "[a]:transition-colors [a]:hover:bg-accent/50", "focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50"),
10
+ defaultVariants: {
11
+ size: "default",
12
+ variant: "default",
13
+ },
14
+ variants: {
15
+ size: {
16
+ default: "gap-4 p-4",
17
+ sm: "gap-2.5 px-4 py-3",
18
+ },
19
+ variant: {
20
+ default: "bg-transparent",
21
+ muted: "bg-muted/50",
22
+ outline: "border-border",
23
+ },
24
+ },
23
25
  });
24
26
  const itemMediaVariants = tv({
25
- base: cn("flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start", "group-has-[[data-slot=item-description]]/item:translate-y-0.5 [&_svg]:pointer-events-none"),
26
- defaultVariants: { variant: "default" },
27
- variants: { variant: {
28
- default: "bg-transparent",
29
- icon: "size-8 shrink-0 rounded-md border bg-muted [&_svg:not([class*='size-'])]:size-4",
30
- image: "size-10 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover"
31
- } }
27
+ base: cn("flex shrink-0 items-center justify-center gap-2 group-has-[[data-slot=item-description]]/item:self-start", "group-has-[[data-slot=item-description]]/item:translate-y-0.5 [&_svg]:pointer-events-none"),
28
+ defaultVariants: {
29
+ variant: "default",
30
+ },
31
+ variants: {
32
+ variant: {
33
+ default: "bg-transparent",
34
+ icon: "size-8 shrink-0 rounded-md border bg-muted [&_svg:not([class*='size-'])]:size-4",
35
+ image: "size-10 shrink-0 overflow-hidden rounded-md [&_img]:size-full [&_img]:object-cover",
36
+ },
37
+ },
32
38
  });
33
39
  function ItemGroup({ className, ...props }) {
34
- return /* @__PURE__ */ jsx("div", {
35
- className: cn("group/item-group flex flex-col", className),
36
- "data-slot": "item-group",
37
- role: "list",
38
- ...props
39
- });
40
+ return (_jsx("div", { className: cn("group/item-group flex flex-col", className), "data-slot": "item-group", role: "list", ...props }));
40
41
  }
41
42
  function ItemSeparator({ className, ...props }) {
42
- return /* @__PURE__ */ jsx(Separator, {
43
- className: cn("my-0", className),
44
- "data-slot": "item-separator",
45
- orientation: "horizontal",
46
- ...props
47
- });
43
+ return (_jsx(Separator, { className: cn("my-0", className), "data-slot": "item-separator", orientation: "horizontal", ...props }));
48
44
  }
49
45
  function Item({ asChild = false, className, size = "default", variant = "default", ...props }) {
50
- return /* @__PURE__ */ jsx(asChild ? Slot : "div", {
51
- className: itemVariants({
52
- className,
53
- size,
54
- variant
55
- }),
56
- "data-size": size,
57
- "data-slot": "item",
58
- "data-variant": variant,
59
- ...props
60
- });
46
+ const Component = asChild ? Slot : "div";
47
+ return (_jsx(Component, { className: itemVariants({ className, size, variant }), "data-size": size, "data-slot": "item", "data-variant": variant, ...props }));
61
48
  }
62
49
  function ItemMedia({ className, variant = "default", ...props }) {
63
- return /* @__PURE__ */ jsx("div", {
64
- className: itemMediaVariants({
65
- className,
66
- variant
67
- }),
68
- "data-slot": "item-media",
69
- "data-variant": variant,
70
- ...props
71
- });
50
+ return (_jsx("div", { className: itemMediaVariants({ className, variant }), "data-slot": "item-media", "data-variant": variant, ...props }));
72
51
  }
73
52
  function ItemContent({ className, ...props }) {
74
- return /* @__PURE__ */ jsx("div", {
75
- className: cn("flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none", className),
76
- "data-slot": "item-content",
77
- ...props
78
- });
53
+ return (_jsx("div", { className: cn("flex flex-1 flex-col gap-1 [&+[data-slot=item-content]]:flex-none", className), "data-slot": "item-content", ...props }));
79
54
  }
80
55
  function ItemTitle({ className, ...props }) {
81
- return /* @__PURE__ */ jsx("div", {
82
- className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium", className),
83
- "data-slot": "item-title",
84
- ...props
85
- });
56
+ return (_jsx("div", { className: cn("flex w-fit items-center gap-2 text-sm leading-snug font-medium", className), "data-slot": "item-title", ...props }));
86
57
  }
87
58
  function ItemDescription({ className, ...props }) {
88
- return /* @__PURE__ */ jsx("p", {
89
- className: cn("line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className),
90
- "data-slot": "item-description",
91
- ...props
92
- });
59
+ return (_jsx("p", { className: cn("line-clamp-2 text-sm leading-normal font-normal text-balance text-muted-foreground", "[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary", className), "data-slot": "item-description", ...props }));
93
60
  }
94
61
  function ItemActions({ className, ...props }) {
95
- return /* @__PURE__ */ jsx("div", {
96
- className: cn("flex items-center gap-2", className),
97
- "data-slot": "item-actions",
98
- ...props
99
- });
62
+ return (_jsx("div", { className: cn("flex items-center gap-2", className), "data-slot": "item-actions", ...props }));
100
63
  }
101
64
  function ItemHeader({ className, ...props }) {
102
- return /* @__PURE__ */ jsx("div", {
103
- className: cn("flex basis-full items-center justify-between gap-2", className),
104
- "data-slot": "item-header",
105
- ...props
106
- });
65
+ return (_jsx("div", { className: cn("flex basis-full items-center justify-between gap-2", className), "data-slot": "item-header", ...props }));
107
66
  }
108
67
  function ItemFooter({ className, ...props }) {
109
- return /* @__PURE__ */ jsx("div", {
110
- className: cn("flex basis-full items-center justify-between gap-2", className),
111
- "data-slot": "item-footer",
112
- ...props
113
- });
68
+ return (_jsx("div", { className: cn("flex basis-full items-center justify-between gap-2", className), "data-slot": "item-footer", ...props }));
114
69
  }
115
- //#endregion
116
- export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, ItemSeparator, ItemTitle, itemMediaVariants, itemVariants };
70
+ /* -----------------------------------------------------------------------------
71
+ * Exports
72
+ * -------------------------------------------------------------------------- */
73
+ export { Item, ItemActions, ItemContent, ItemDescription, ItemFooter, ItemGroup, ItemHeader, ItemMedia, itemMediaVariants, ItemSeparator, ItemTitle, itemVariants, };