@nuvia/components 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (243) hide show
  1. package/README.md +96 -0
  2. package/dist/hooks/use-mobile.cjs +44 -0
  3. package/dist/hooks/use-mobile.cjs.map +1 -0
  4. package/dist/hooks/use-mobile.js +22 -0
  5. package/dist/hooks/use-mobile.js.map +1 -0
  6. package/dist/hooks/use-toast.cjs +146 -0
  7. package/dist/hooks/use-toast.cjs.map +1 -0
  8. package/dist/hooks/use-toast.js +122 -0
  9. package/dist/hooks/use-toast.js.map +1 -0
  10. package/dist/index.cjs +4117 -0
  11. package/dist/index.cjs.map +1 -0
  12. package/dist/index.js +3800 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/lib/fonts.cjs +15 -0
  15. package/dist/lib/fonts.cjs.map +1 -0
  16. package/dist/lib/fonts.js +13 -0
  17. package/dist/lib/fonts.js.map +1 -0
  18. package/dist/lib/utils.cjs +18 -0
  19. package/dist/lib/utils.cjs.map +1 -0
  20. package/dist/lib/utils.js +14 -0
  21. package/dist/lib/utils.js.map +1 -0
  22. package/dist/providers/theme.cjs +24 -0
  23. package/dist/providers/theme.cjs.map +1 -0
  24. package/dist/providers/theme.js +22 -0
  25. package/dist/providers/theme.js.map +1 -0
  26. package/dist/ui/accordion.cjs +75 -0
  27. package/dist/ui/accordion.cjs.map +1 -0
  28. package/dist/ui/accordion.js +49 -0
  29. package/dist/ui/accordion.js.map +1 -0
  30. package/dist/ui/alert-dialog.cjs +189 -0
  31. package/dist/ui/alert-dialog.cjs.map +1 -0
  32. package/dist/ui/alert-dialog.js +156 -0
  33. package/dist/ui/alert-dialog.js.map +1 -0
  34. package/dist/ui/alert.cjs +81 -0
  35. package/dist/ui/alert.cjs.map +1 -0
  36. package/dist/ui/alert.js +57 -0
  37. package/dist/ui/alert.js.map +1 -0
  38. package/dist/ui/aspect-ratio.cjs +29 -0
  39. package/dist/ui/aspect-ratio.cjs.map +1 -0
  40. package/dist/ui/aspect-ratio.js +7 -0
  41. package/dist/ui/aspect-ratio.js.map +1 -0
  42. package/dist/ui/auto-complete.cjs +284 -0
  43. package/dist/ui/auto-complete.cjs.map +1 -0
  44. package/dist/ui/auto-complete.js +262 -0
  45. package/dist/ui/auto-complete.js.map +1 -0
  46. package/dist/ui/avatar.cjs +70 -0
  47. package/dist/ui/avatar.cjs.map +1 -0
  48. package/dist/ui/avatar.js +45 -0
  49. package/dist/ui/avatar.js.map +1 -0
  50. package/dist/ui/badge.cjs +34 -0
  51. package/dist/ui/badge.cjs.map +1 -0
  52. package/dist/ui/badge.js +31 -0
  53. package/dist/ui/badge.js.map +1 -0
  54. package/dist/ui/breadcrumb.cjs +120 -0
  55. package/dist/ui/breadcrumb.cjs.map +1 -0
  56. package/dist/ui/breadcrumb.js +92 -0
  57. package/dist/ui/breadcrumb.js.map +1 -0
  58. package/dist/ui/button.cjs +80 -0
  59. package/dist/ui/button.cjs.map +1 -0
  60. package/dist/ui/button.js +57 -0
  61. package/dist/ui/button.js.map +1 -0
  62. package/dist/ui/calendar.cjs +135 -0
  63. package/dist/ui/calendar.cjs.map +1 -0
  64. package/dist/ui/calendar.js +113 -0
  65. package/dist/ui/calendar.js.map +1 -0
  66. package/dist/ui/card.cjs +89 -0
  67. package/dist/ui/card.cjs.map +1 -0
  68. package/dist/ui/card.js +62 -0
  69. package/dist/ui/card.js.map +1 -0
  70. package/dist/ui/carousel.cjs +269 -0
  71. package/dist/ui/carousel.cjs.map +1 -0
  72. package/dist/ui/carousel.js +240 -0
  73. package/dist/ui/carousel.js.map +1 -0
  74. package/dist/ui/chart.cjs +267 -0
  75. package/dist/ui/chart.cjs.map +1 -0
  76. package/dist/ui/chart.js +239 -0
  77. package/dist/ui/chart.js.map +1 -0
  78. package/dist/ui/checkbox.cjs +55 -0
  79. package/dist/ui/checkbox.cjs.map +1 -0
  80. package/dist/ui/checkbox.js +32 -0
  81. package/dist/ui/checkbox.js.map +1 -0
  82. package/dist/ui/chip.cjs +79 -0
  83. package/dist/ui/chip.cjs.map +1 -0
  84. package/dist/ui/chip.js +55 -0
  85. package/dist/ui/chip.js.map +1 -0
  86. package/dist/ui/collapsible.cjs +33 -0
  87. package/dist/ui/collapsible.cjs.map +1 -0
  88. package/dist/ui/collapsible.js +9 -0
  89. package/dist/ui/collapsible.js.map +1 -0
  90. package/dist/ui/combobox.cjs +254 -0
  91. package/dist/ui/combobox.cjs.map +1 -0
  92. package/dist/ui/combobox.js +232 -0
  93. package/dist/ui/combobox.js.map +1 -0
  94. package/dist/ui/command.cjs +199 -0
  95. package/dist/ui/command.cjs.map +1 -0
  96. package/dist/ui/command.js +168 -0
  97. package/dist/ui/command.js.map +1 -0
  98. package/dist/ui/context-menu.cjs +181 -0
  99. package/dist/ui/context-menu.cjs.map +1 -0
  100. package/dist/ui/context-menu.js +144 -0
  101. package/dist/ui/context-menu.js.map +1 -0
  102. package/dist/ui/dialog.cjs +132 -0
  103. package/dist/ui/dialog.cjs.map +1 -0
  104. package/dist/ui/dialog.js +100 -0
  105. package/dist/ui/dialog.js.map +1 -0
  106. package/dist/ui/drawer.cjs +128 -0
  107. package/dist/ui/drawer.cjs.map +1 -0
  108. package/dist/ui/drawer.js +97 -0
  109. package/dist/ui/drawer.js.map +1 -0
  110. package/dist/ui/dropdown-menu.cjs +194 -0
  111. package/dist/ui/dropdown-menu.cjs.map +1 -0
  112. package/dist/ui/dropdown-menu.js +157 -0
  113. package/dist/ui/dropdown-menu.js.map +1 -0
  114. package/dist/ui/form.cjs +179 -0
  115. package/dist/ui/form.cjs.map +1 -0
  116. package/dist/ui/form.js +149 -0
  117. package/dist/ui/form.js.map +1 -0
  118. package/dist/ui/hover-card.cjs +53 -0
  119. package/dist/ui/hover-card.cjs.map +1 -0
  120. package/dist/ui/hover-card.js +28 -0
  121. package/dist/ui/hover-card.js.map +1 -0
  122. package/dist/ui/input-otp.cjs +76 -0
  123. package/dist/ui/input-otp.cjs.map +1 -0
  124. package/dist/ui/input-otp.js +51 -0
  125. package/dist/ui/input-otp.js.map +1 -0
  126. package/dist/ui/input.cjs +51 -0
  127. package/dist/ui/input.cjs.map +1 -0
  128. package/dist/ui/input.js +29 -0
  129. package/dist/ui/input.js.map +1 -0
  130. package/dist/ui/label.cjs +55 -0
  131. package/dist/ui/label.cjs.map +1 -0
  132. package/dist/ui/label.js +32 -0
  133. package/dist/ui/label.js.map +1 -0
  134. package/dist/ui/lottie-animation.cjs +85 -0
  135. package/dist/ui/lottie-animation.cjs.map +1 -0
  136. package/dist/ui/lottie-animation.js +79 -0
  137. package/dist/ui/lottie-animation.js.map +1 -0
  138. package/dist/ui/menubar.cjs +210 -0
  139. package/dist/ui/menubar.cjs.map +1 -0
  140. package/dist/ui/menubar.js +172 -0
  141. package/dist/ui/menubar.js.map +1 -0
  142. package/dist/ui/multi-combobox.cjs +319 -0
  143. package/dist/ui/multi-combobox.cjs.map +1 -0
  144. package/dist/ui/multi-combobox.js +297 -0
  145. package/dist/ui/multi-combobox.js.map +1 -0
  146. package/dist/ui/navigation-menu.cjs +136 -0
  147. package/dist/ui/navigation-menu.cjs.map +1 -0
  148. package/dist/ui/navigation-menu.js +105 -0
  149. package/dist/ui/navigation-menu.js.map +1 -0
  150. package/dist/ui/pagination.cjs +172 -0
  151. package/dist/ui/pagination.cjs.map +1 -0
  152. package/dist/ui/pagination.js +144 -0
  153. package/dist/ui/pagination.js.map +1 -0
  154. package/dist/ui/popover.cjs +55 -0
  155. package/dist/ui/popover.cjs.map +1 -0
  156. package/dist/ui/popover.js +29 -0
  157. package/dist/ui/popover.js.map +1 -0
  158. package/dist/ui/progress.cjs +54 -0
  159. package/dist/ui/progress.cjs.map +1 -0
  160. package/dist/ui/progress.js +31 -0
  161. package/dist/ui/progress.js.map +1 -0
  162. package/dist/ui/radio-group.cjs +62 -0
  163. package/dist/ui/radio-group.cjs.map +1 -0
  164. package/dist/ui/radio-group.js +38 -0
  165. package/dist/ui/radio-group.js.map +1 -0
  166. package/dist/ui/resizable.cjs +65 -0
  167. package/dist/ui/resizable.cjs.map +1 -0
  168. package/dist/ui/resizable.js +41 -0
  169. package/dist/ui/resizable.js.map +1 -0
  170. package/dist/ui/scroll-area.cjs +66 -0
  171. package/dist/ui/scroll-area.cjs.map +1 -0
  172. package/dist/ui/scroll-area.js +42 -0
  173. package/dist/ui/scroll-area.js.map +1 -0
  174. package/dist/ui/select.cjs +152 -0
  175. package/dist/ui/select.cjs.map +1 -0
  176. package/dist/ui/select.js +120 -0
  177. package/dist/ui/select.js.map +1 -0
  178. package/dist/ui/separator.cjs +52 -0
  179. package/dist/ui/separator.cjs.map +1 -0
  180. package/dist/ui/separator.js +29 -0
  181. package/dist/ui/separator.js.map +1 -0
  182. package/dist/ui/sheet.cjs +143 -0
  183. package/dist/ui/sheet.cjs.map +1 -0
  184. package/dist/ui/sheet.js +111 -0
  185. package/dist/ui/sheet.js.map +1 -0
  186. package/dist/ui/sidebar.cjs +816 -0
  187. package/dist/ui/sidebar.cjs.map +1 -0
  188. package/dist/ui/sidebar.js +768 -0
  189. package/dist/ui/sidebar.js.map +1 -0
  190. package/dist/ui/skeleton.cjs +25 -0
  191. package/dist/ui/skeleton.cjs.map +1 -0
  192. package/dist/ui/skeleton.js +23 -0
  193. package/dist/ui/skeleton.js.map +1 -0
  194. package/dist/ui/slider.cjs +51 -0
  195. package/dist/ui/slider.cjs.map +1 -0
  196. package/dist/ui/slider.js +28 -0
  197. package/dist/ui/slider.js.map +1 -0
  198. package/dist/ui/sonner.cjs +46 -0
  199. package/dist/ui/sonner.cjs.map +1 -0
  200. package/dist/ui/sonner.js +41 -0
  201. package/dist/ui/sonner.js.map +1 -0
  202. package/dist/ui/spinner.cjs +83 -0
  203. package/dist/ui/spinner.cjs.map +1 -0
  204. package/dist/ui/spinner.js +81 -0
  205. package/dist/ui/spinner.js.map +1 -0
  206. package/dist/ui/switch.cjs +67 -0
  207. package/dist/ui/switch.cjs.map +1 -0
  208. package/dist/ui/switch.js +44 -0
  209. package/dist/ui/switch.js.map +1 -0
  210. package/dist/ui/table.cjs +118 -0
  211. package/dist/ui/table.cjs.map +1 -0
  212. package/dist/ui/table.js +89 -0
  213. package/dist/ui/table.js.map +1 -0
  214. package/dist/ui/tabs.cjs +79 -0
  215. package/dist/ui/tabs.cjs.map +1 -0
  216. package/dist/ui/tabs.js +53 -0
  217. package/dist/ui/tabs.js.map +1 -0
  218. package/dist/ui/textarea.cjs +48 -0
  219. package/dist/ui/textarea.cjs.map +1 -0
  220. package/dist/ui/textarea.js +26 -0
  221. package/dist/ui/textarea.js.map +1 -0
  222. package/dist/ui/toast.cjs +125 -0
  223. package/dist/ui/toast.cjs.map +1 -0
  224. package/dist/ui/toast.js +96 -0
  225. package/dist/ui/toast.js.map +1 -0
  226. package/dist/ui/toaster.cjs +251 -0
  227. package/dist/ui/toaster.cjs.map +1 -0
  228. package/dist/ui/toaster.js +228 -0
  229. package/dist/ui/toaster.js.map +1 -0
  230. package/dist/ui/toggle-group.cjs +101 -0
  231. package/dist/ui/toggle-group.cjs.map +1 -0
  232. package/dist/ui/toggle-group.js +76 -0
  233. package/dist/ui/toggle-group.js.map +1 -0
  234. package/dist/ui/toggle.cjs +66 -0
  235. package/dist/ui/toggle.cjs.map +1 -0
  236. package/dist/ui/toggle.js +42 -0
  237. package/dist/ui/toggle.js.map +1 -0
  238. package/dist/ui/tooltip.cjs +54 -0
  239. package/dist/ui/tooltip.cjs.map +1 -0
  240. package/dist/ui/tooltip.js +28 -0
  241. package/dist/ui/tooltip.js.map +1 -0
  242. package/package.json +116 -0
  243. package/src/styles/globals.css +529 -0
@@ -0,0 +1,156 @@
1
+ import * as React2 from 'react';
2
+ import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
3
+ import { clsx } from 'clsx';
4
+ import 'sonner';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { Slot } from '@radix-ui/react-slot';
7
+ import { cva } from 'class-variance-authority';
8
+ import { jsx, jsxs } from 'react/jsx-runtime';
9
+
10
+ var cn = (...inputs) => twMerge(clsx(inputs));
11
+ var buttonVariants = cva(
12
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#5A6FC0] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
13
+ {
14
+ variants: {
15
+ variant: {
16
+ default: "bg-foreground-primary-medium text-white shadow hover:bg-primary/90",
17
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
18
+ outline: "border border-input bg-background hover:bg-secondary hover:text-accent-foreground text-foreground-secondary-heavy",
19
+ secondary: "bg-background-secondary-light hover:background-secondary-light/40 text-foreground-secondary-heavy",
20
+ ghost: "text-foreground-secondary-heavy hover:bg-background-secondary-light",
21
+ link: "text-text-links hover:bg-background-secondary-light",
22
+ accent: "bg-accent nuvia-gradient-1 text-white"
23
+ },
24
+ size: {
25
+ default: "h-10 px-4 py-2",
26
+ xs: "h-[30px] px-3 rounded-xl text-xs",
27
+ sm: "h-9 rounded-xl px-3 text-xs",
28
+ lg: "h-12 rounded-xl px-8",
29
+ icon: "h-10 w-10 min-w-10",
30
+ "icon-xs": "h-[30px] w-[30px] min-w-[30px]",
31
+ "icon-sm": "h-9 w-9 min-w-9",
32
+ bullet: "h-8 w-8 min-w-8"
33
+ }
34
+ },
35
+ defaultVariants: {
36
+ variant: "default",
37
+ size: "default"
38
+ }
39
+ }
40
+ );
41
+ var Button = React2.forwardRef(
42
+ ({ className, variant, size, asChild = false, ...props }, ref) => {
43
+ const Comp = asChild ? Slot : "button";
44
+ return /* @__PURE__ */ jsx(
45
+ Comp,
46
+ {
47
+ className: cn(buttonVariants({ variant, size, className })),
48
+ ref,
49
+ ...props
50
+ }
51
+ );
52
+ }
53
+ );
54
+ Button.displayName = "Button";
55
+ var AlertDialog = AlertDialogPrimitive.Root;
56
+ var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
57
+ var AlertDialogPortal = AlertDialogPrimitive.Portal;
58
+ var AlertDialogOverlay = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
59
+ AlertDialogPrimitive.Overlay,
60
+ {
61
+ className: cn(
62
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
63
+ className
64
+ ),
65
+ ...props,
66
+ ref
67
+ }
68
+ ));
69
+ AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
70
+ var AlertDialogContent = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
71
+ /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
72
+ /* @__PURE__ */ jsx(
73
+ AlertDialogPrimitive.Content,
74
+ {
75
+ ref,
76
+ className: cn(
77
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
78
+ className
79
+ ),
80
+ ...props
81
+ }
82
+ )
83
+ ] }));
84
+ AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
85
+ var AlertDialogHeader = ({
86
+ className,
87
+ ...props
88
+ }) => /* @__PURE__ */ jsx(
89
+ "div",
90
+ {
91
+ className: cn(
92
+ "flex flex-col space-y-2 text-center sm:text-left",
93
+ className
94
+ ),
95
+ ...props
96
+ }
97
+ );
98
+ AlertDialogHeader.displayName = "AlertDialogHeader";
99
+ var AlertDialogFooter = ({
100
+ className,
101
+ ...props
102
+ }) => /* @__PURE__ */ jsx(
103
+ "div",
104
+ {
105
+ className: cn(
106
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
107
+ className
108
+ ),
109
+ ...props
110
+ }
111
+ );
112
+ AlertDialogFooter.displayName = "AlertDialogFooter";
113
+ var AlertDialogTitle = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
114
+ AlertDialogPrimitive.Title,
115
+ {
116
+ ref,
117
+ className: cn("text-lg font-semibold", className),
118
+ ...props
119
+ }
120
+ ));
121
+ AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
122
+ var AlertDialogDescription = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
123
+ AlertDialogPrimitive.Description,
124
+ {
125
+ ref,
126
+ className: cn("text-sm text-muted-foreground", className),
127
+ ...props
128
+ }
129
+ ));
130
+ AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
131
+ var AlertDialogAction = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
132
+ AlertDialogPrimitive.Action,
133
+ {
134
+ ref,
135
+ className: cn(buttonVariants(), className),
136
+ ...props
137
+ }
138
+ ));
139
+ AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
140
+ var AlertDialogCancel = React2.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
141
+ AlertDialogPrimitive.Cancel,
142
+ {
143
+ ref,
144
+ className: cn(
145
+ buttonVariants({ variant: "outline" }),
146
+ "mt-2 sm:mt-0",
147
+ className
148
+ ),
149
+ ...props
150
+ }
151
+ ));
152
+ AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
153
+
154
+ export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger };
155
+ //# sourceMappingURL=alert-dialog.js.map
156
+ //# sourceMappingURL=alert-dialog.js.map
@@ -0,0 +1 @@
1
+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A,MAAA,CAAO,WAAA;AAE5D,IAAM,iBAAA,GAA0B,kBAG9B,CAAC,EAAE,WAAW,GAAG,KAAA,EAAM,EAAG,GAAA,qBAC1BA,GAAAA;AAAA,EAAsB,oBAAA,CAAA,MAAA;AAAA,EAArB;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA;AAAA,MACT,cAAA,CAAe,EAAE,OAAA,EAAS,SAAA,EAAW,CAAA;AAAA,MACrC,cAAA;AAAA,MACA;AAAA,KACF;AAAA,IACC,GAAG;AAAA;AACN,CACD;AACD,iBAAA,CAAkB,cAAmC,oBAAA,CAAA,MAAA,CAAO,WAAA","file":"alert-dialog.js","sourcesContent":["import { clsx } from \"clsx\";\nimport type { ClassValue } from \"clsx\";\nimport { toast } from \"sonner\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs));\n\nexport const capitalize = (str: string) =>\n str?.charAt(0)?.toUpperCase() + str?.slice(1);\n\nexport const handleError = (error: { message: string }): void => {\n toast.error(error.message);\n};\n","\"use client\";\n\nimport * as React from \"react\";\nimport { Slot } from \"@radix-ui/react-slot\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-xl text-sm font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[#5A6FC0] disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0\",\n {\n variants: {\n variant: {\n default:\n \"bg-foreground-primary-medium text-white shadow hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-destructive-foreground hover:bg-destructive/90\",\n outline:\n \"border border-input bg-background hover:bg-secondary hover:text-accent-foreground text-foreground-secondary-heavy\",\n secondary:\n \"bg-background-secondary-light hover:background-secondary-light/40 text-foreground-secondary-heavy\",\n ghost:\n \"text-foreground-secondary-heavy hover:bg-background-secondary-light\",\n link: \"text-text-links hover:bg-background-secondary-light\",\n accent: \"bg-accent nuvia-gradient-1 text-white\",\n },\n size: {\n default: \"h-10 px-4 py-2\",\n xs: \"h-[30px] px-3 rounded-xl text-xs\",\n sm: \"h-9 rounded-xl px-3 text-xs\",\n lg: \"h-12 rounded-xl px-8\",\n icon: \"h-10 w-10 min-w-10\",\n \"icon-xs\": \"h-[30px] w-[30px] min-w-[30px]\",\n \"icon-sm\": \"h-9 w-9 min-w-9\",\n bullet: \"h-8 w-8 min-w-8\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\",\n },\n },\n);\n\nexport interface ButtonProps\n extends React.ButtonHTMLAttributes<HTMLButtonElement>,\n VariantProps<typeof buttonVariants> {\n asChild?: boolean;\n}\n\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(\n ({ className, variant, size, asChild = false, ...props }, ref) => {\n const Comp = asChild ? Slot : \"button\";\n return (\n <Comp\n className={cn(buttonVariants({ variant, size, className }))}\n ref={ref}\n {...props}\n />\n );\n },\n);\nButton.displayName = \"Button\";\n\nexport { Button, buttonVariants };\n","\"use client\";\n\nimport * as React from \"react\";\nimport * as AlertDialogPrimitive from \"@radix-ui/react-alert-dialog\";\nimport { cn } from \"../lib/utils\";\nimport { buttonVariants } from \"./button\";\n\nconst AlertDialog = AlertDialogPrimitive.Root;\n\nconst AlertDialogTrigger = AlertDialogPrimitive.Trigger;\n\nconst AlertDialogPortal = AlertDialogPrimitive.Portal;\n\nconst AlertDialogOverlay = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Overlay>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Overlay\n className={cn(\n \"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0\",\n className,\n )}\n {...props}\n ref={ref}\n />\n));\nAlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;\n\nconst AlertDialogContent = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Content>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>\n>(({ className, ...props }, ref) => (\n <AlertDialogPortal>\n <AlertDialogOverlay />\n <AlertDialogPrimitive.Content\n ref={ref}\n className={cn(\n \"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg\",\n className,\n )}\n {...props}\n />\n </AlertDialogPortal>\n));\nAlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;\n\nconst AlertDialogHeader = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col space-y-2 text-center sm:text-left\",\n className,\n )}\n {...props}\n />\n);\nAlertDialogHeader.displayName = \"AlertDialogHeader\";\n\nconst AlertDialogFooter = ({\n className,\n ...props\n}: React.HTMLAttributes<HTMLDivElement>) => (\n <div\n className={cn(\n \"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2\",\n className,\n )}\n {...props}\n />\n);\nAlertDialogFooter.displayName = \"AlertDialogFooter\";\n\nconst AlertDialogTitle = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Title>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Title\n ref={ref}\n className={cn(\"text-lg font-semibold\", className)}\n {...props}\n />\n));\nAlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;\n\nconst AlertDialogDescription = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Description>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Description\n ref={ref}\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n));\nAlertDialogDescription.displayName =\n AlertDialogPrimitive.Description.displayName;\n\nconst AlertDialogAction = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Action>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Action\n ref={ref}\n className={cn(buttonVariants(), className)}\n {...props}\n />\n));\nAlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;\n\nconst AlertDialogCancel = React.forwardRef<\n React.ElementRef<typeof AlertDialogPrimitive.Cancel>,\n React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>\n>(({ className, ...props }, ref) => (\n <AlertDialogPrimitive.Cancel\n ref={ref}\n className={cn(\n buttonVariants({ variant: \"outline\" }),\n \"mt-2 sm:mt-0\",\n className,\n )}\n {...props}\n />\n));\nAlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;\n\nexport {\n AlertDialog,\n AlertDialogPortal,\n AlertDialogOverlay,\n AlertDialogTrigger,\n AlertDialogContent,\n AlertDialogHeader,\n AlertDialogFooter,\n AlertDialogTitle,\n AlertDialogDescription,\n AlertDialogAction,\n AlertDialogCancel,\n};\n"]}
@@ -0,0 +1,81 @@
1
+ 'use strict';
2
+
3
+ var React = require('react');
4
+ var classVarianceAuthority = require('class-variance-authority');
5
+ var clsx = require('clsx');
6
+ require('sonner');
7
+ var tailwindMerge = require('tailwind-merge');
8
+ var jsxRuntime = require('react/jsx-runtime');
9
+
10
+ function _interopNamespace(e) {
11
+ if (e && e.__esModule) return e;
12
+ var n = Object.create(null);
13
+ if (e) {
14
+ Object.keys(e).forEach(function (k) {
15
+ if (k !== 'default') {
16
+ var d = Object.getOwnPropertyDescriptor(e, k);
17
+ Object.defineProperty(n, k, d.get ? d : {
18
+ enumerable: true,
19
+ get: function () { return e[k]; }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n.default = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
29
+
30
+ // src/ui/alert.tsx
31
+ var cn = (...inputs) => tailwindMerge.twMerge(clsx.clsx(inputs));
32
+ var alertVariants = classVarianceAuthority.cva(
33
+ "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
34
+ {
35
+ variants: {
36
+ variant: {
37
+ default: "bg-background text-foreground",
38
+ primary: "bg-primary text-text-brand-primary border-primary-medium bg-background-primary-light",
39
+ destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
40
+ warning: "border-warning-border border bg-warning [&>svg]:text-warning-content [&>h5]:text-warning-foreground"
41
+ }
42
+ },
43
+ defaultVariants: {
44
+ variant: "default"
45
+ }
46
+ }
47
+ );
48
+ var Alert = React__namespace.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
49
+ "div",
50
+ {
51
+ ref,
52
+ role: "alert",
53
+ className: cn(alertVariants({ variant }), className),
54
+ ...props
55
+ }
56
+ ));
57
+ Alert.displayName = "Alert";
58
+ var AlertTitle = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
59
+ "h5",
60
+ {
61
+ ref,
62
+ className: cn("mb-1 font-semibold leading-none tracking-tight", className),
63
+ ...props
64
+ }
65
+ ));
66
+ AlertTitle.displayName = "AlertTitle";
67
+ var AlertDescription = React__namespace.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
68
+ "div",
69
+ {
70
+ ref,
71
+ className: cn("text-sm [&_p]:leading-relaxed", className),
72
+ ...props
73
+ }
74
+ ));
75
+ AlertDescription.displayName = "AlertDescription";
76
+
77
+ exports.Alert = Alert;
78
+ exports.AlertDescription = AlertDescription;
79
+ exports.AlertTitle = AlertTitle;
80
+ //# sourceMappingURL=alert.cjs.map
81
+ //# sourceMappingURL=alert.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/alert.tsx"],"names":["twMerge","clsx","cva","React","jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKO,IAAM,KAAK,CAAA,GAAI,MAAA,KAAiCA,qBAAA,CAAQC,SAAA,CAAK,MAAM,CAAC,CAAA;ACD3E,IAAM,aAAA,GAAgBC,0BAAA;AAAA,EACpB,yKAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,+BAAA;AAAA,QACT,OAAA,EACE,sFAAA;AAAA,QACF,WAAA,EACE,yFAAA;AAAA,QACF,OAAA,EACE;AAAA;AACJ,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ,CAAA;AAEA,IAAM,KAAA,GAAcC,4BAGlB,CAAC,EAAE,WAAW,OAAA,EAAS,GAAG,KAAA,EAAM,EAAG,GAAA,qBACnCC,cAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,IAAA,EAAK,OAAA;AAAA,IACL,WAAW,EAAA,CAAG,aAAA,CAAc,EAAE,OAAA,EAAS,GAAG,SAAS,CAAA;AAAA,IAClD,GAAG;AAAA;AACN,CACD;AACD,KAAA,CAAM,WAAA,GAAc,OAAA;AAEpB,IAAM,UAAA,GAAmBD,4BAGvB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1BC,cAAA;AAAA,EAAC,IAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,gDAAA,EAAkD,SAAS,CAAA;AAAA,IACxE,GAAG;AAAA;AACN,CACD;AACD,UAAA,CAAW,WAAA,GAAc,YAAA;AAEzB,IAAM,gBAAA,GAAyBD,4BAG7B,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1BC,cAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,gBAAA,CAAiB,WAAA,GAAc,kBAAA","file":"alert.cjs","sourcesContent":["import { clsx } from \"clsx\";\nimport type { ClassValue } from \"clsx\";\nimport { toast } from \"sonner\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs));\n\nexport const capitalize = (str: string) =>\n str?.charAt(0)?.toUpperCase() + str?.slice(1);\n\nexport const handleError = (error: { message: string }): void => {\n toast.error(error.message);\n};\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n primary:\n \"bg-primary text-text-brand-primary border-primary-medium bg-background-primary-light\",\n destructive:\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n warning:\n \"border-warning-border border bg-warning [&>svg]:text-warning-content [&>h5]:text-warning-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm [&_p]:leading-relaxed\", className)}\n {...props}\n />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertTitle, AlertDescription };\n"]}
@@ -0,0 +1,57 @@
1
+ import * as React from 'react';
2
+ import { cva } from 'class-variance-authority';
3
+ import { clsx } from 'clsx';
4
+ import 'sonner';
5
+ import { twMerge } from 'tailwind-merge';
6
+ import { jsx } from 'react/jsx-runtime';
7
+
8
+ // src/ui/alert.tsx
9
+ var cn = (...inputs) => twMerge(clsx(inputs));
10
+ var alertVariants = cva(
11
+ "relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
12
+ {
13
+ variants: {
14
+ variant: {
15
+ default: "bg-background text-foreground",
16
+ primary: "bg-primary text-text-brand-primary border-primary-medium bg-background-primary-light",
17
+ destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
18
+ warning: "border-warning-border border bg-warning [&>svg]:text-warning-content [&>h5]:text-warning-foreground"
19
+ }
20
+ },
21
+ defaultVariants: {
22
+ variant: "default"
23
+ }
24
+ }
25
+ );
26
+ var Alert = React.forwardRef(({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
27
+ "div",
28
+ {
29
+ ref,
30
+ role: "alert",
31
+ className: cn(alertVariants({ variant }), className),
32
+ ...props
33
+ }
34
+ ));
35
+ Alert.displayName = "Alert";
36
+ var AlertTitle = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
37
+ "h5",
38
+ {
39
+ ref,
40
+ className: cn("mb-1 font-semibold leading-none tracking-tight", className),
41
+ ...props
42
+ }
43
+ ));
44
+ AlertTitle.displayName = "AlertTitle";
45
+ var AlertDescription = React.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
46
+ "div",
47
+ {
48
+ ref,
49
+ className: cn("text-sm [&_p]:leading-relaxed", className),
50
+ ...props
51
+ }
52
+ ));
53
+ AlertDescription.displayName = "AlertDescription";
54
+
55
+ export { Alert, AlertDescription, AlertTitle };
56
+ //# sourceMappingURL=alert.js.map
57
+ //# sourceMappingURL=alert.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/lib/utils.ts","../../src/ui/alert.tsx"],"names":[],"mappings":";;;;;;;;AAKO,IAAM,KAAK,CAAA,GAAI,MAAA,KAAiC,OAAA,CAAQ,IAAA,CAAK,MAAM,CAAC,CAAA;ACD3E,IAAM,aAAA,GAAgB,GAAA;AAAA,EACpB,yKAAA;AAAA,EACA;AAAA,IACE,QAAA,EAAU;AAAA,MACR,OAAA,EAAS;AAAA,QACP,OAAA,EAAS,+BAAA;AAAA,QACT,OAAA,EACE,sFAAA;AAAA,QACF,WAAA,EACE,yFAAA;AAAA,QACF,OAAA,EACE;AAAA;AACJ,KACF;AAAA,IACA,eAAA,EAAiB;AAAA,MACf,OAAA,EAAS;AAAA;AACX;AAEJ,CAAA;AAEA,IAAM,KAAA,GAAc,iBAGlB,CAAC,EAAE,WAAW,OAAA,EAAS,GAAG,KAAA,EAAM,EAAG,GAAA,qBACnC,GAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,IAAA,EAAK,OAAA;AAAA,IACL,WAAW,EAAA,CAAG,aAAA,CAAc,EAAE,OAAA,EAAS,GAAG,SAAS,CAAA;AAAA,IAClD,GAAG;AAAA;AACN,CACD;AACD,KAAA,CAAM,WAAA,GAAc,OAAA;AAEpB,IAAM,UAAA,GAAmB,iBAGvB,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAAC,IAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,gDAAA,EAAkD,SAAS,CAAA;AAAA,IACxE,GAAG;AAAA;AACN,CACD;AACD,UAAA,CAAW,WAAA,GAAc,YAAA;AAEzB,IAAM,gBAAA,GAAyB,iBAG7B,CAAC,EAAE,WAAW,GAAG,KAAA,IAAS,GAAA,qBAC1B,GAAA;AAAA,EAAC,KAAA;AAAA,EAAA;AAAA,IACC,GAAA;AAAA,IACA,SAAA,EAAW,EAAA,CAAG,+BAAA,EAAiC,SAAS,CAAA;AAAA,IACvD,GAAG;AAAA;AACN,CACD;AACD,gBAAA,CAAiB,WAAA,GAAc,kBAAA","file":"alert.js","sourcesContent":["import { clsx } from \"clsx\";\nimport type { ClassValue } from \"clsx\";\nimport { toast } from \"sonner\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport const cn = (...inputs: ClassValue[]): string => twMerge(clsx(inputs));\n\nexport const capitalize = (str: string) =>\n str?.charAt(0)?.toUpperCase() + str?.slice(1);\n\nexport const handleError = (error: { message: string }): void => {\n toast.error(error.message);\n};\n","import * as React from \"react\";\nimport { cva, type VariantProps } from \"class-variance-authority\";\nimport { cn } from \"../lib/utils\";\n\nconst alertVariants = cva(\n \"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7\",\n {\n variants: {\n variant: {\n default: \"bg-background text-foreground\",\n primary:\n \"bg-primary text-text-brand-primary border-primary-medium bg-background-primary-light\",\n destructive:\n \"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive\",\n warning:\n \"border-warning-border border bg-warning [&>svg]:text-warning-content [&>h5]:text-warning-foreground\",\n },\n },\n defaultVariants: {\n variant: \"default\",\n },\n },\n);\n\nconst Alert = React.forwardRef<\n HTMLDivElement,\n React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>\n>(({ className, variant, ...props }, ref) => (\n <div\n ref={ref}\n role=\"alert\"\n className={cn(alertVariants({ variant }), className)}\n {...props}\n />\n));\nAlert.displayName = \"Alert\";\n\nconst AlertTitle = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLHeadingElement>\n>(({ className, ...props }, ref) => (\n <h5\n ref={ref}\n className={cn(\"mb-1 font-semibold leading-none tracking-tight\", className)}\n {...props}\n />\n));\nAlertTitle.displayName = \"AlertTitle\";\n\nconst AlertDescription = React.forwardRef<\n HTMLParagraphElement,\n React.HTMLAttributes<HTMLParagraphElement>\n>(({ className, ...props }, ref) => (\n <div\n ref={ref}\n className={cn(\"text-sm [&_p]:leading-relaxed\", className)}\n {...props}\n />\n));\nAlertDescription.displayName = \"AlertDescription\";\n\nexport { Alert, AlertTitle, AlertDescription };\n"]}
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ var AspectRatioPrimitive = require('@radix-ui/react-aspect-ratio');
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ var AspectRatioPrimitive__namespace = /*#__PURE__*/_interopNamespace(AspectRatioPrimitive);
24
+
25
+ var AspectRatio = AspectRatioPrimitive__namespace.Root;
26
+
27
+ exports.AspectRatio = AspectRatio;
28
+ //# sourceMappingURL=aspect-ratio.cjs.map
29
+ //# sourceMappingURL=aspect-ratio.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ui/aspect-ratio.tsx"],"names":["AspectRatioPrimitive"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAM,WAAA,GAAmCA,+BAAA,CAAA","file":"aspect-ratio.cjs","sourcesContent":["\"use client\";\n\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\";\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n"]}
@@ -0,0 +1,7 @@
1
+ import * as AspectRatioPrimitive from '@radix-ui/react-aspect-ratio';
2
+
3
+ var AspectRatio = AspectRatioPrimitive.Root;
4
+
5
+ export { AspectRatio };
6
+ //# sourceMappingURL=aspect-ratio.js.map
7
+ //# sourceMappingURL=aspect-ratio.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/ui/aspect-ratio.tsx"],"names":[],"mappings":";;AAIA,IAAM,WAAA,GAAmC,oBAAA,CAAA","file":"aspect-ratio.js","sourcesContent":["\"use client\";\n\nimport * as AspectRatioPrimitive from \"@radix-ui/react-aspect-ratio\";\n\nconst AspectRatio = AspectRatioPrimitive.Root;\n\nexport { AspectRatio };\n"]}
@@ -0,0 +1,284 @@
1
+ 'use strict';
2
+
3
+ var React2 = require('react');
4
+ var clsx = require('clsx');
5
+ require('sonner');
6
+ var tailwindMerge = require('tailwind-merge');
7
+ var reactIcons = require('@radix-ui/react-icons');
8
+ var nextIntl = require('next-intl');
9
+ var jsxRuntime = require('react/jsx-runtime');
10
+
11
+ function _interopNamespace(e) {
12
+ if (e && e.__esModule) return e;
13
+ var n = Object.create(null);
14
+ if (e) {
15
+ Object.keys(e).forEach(function (k) {
16
+ if (k !== 'default') {
17
+ var d = Object.getOwnPropertyDescriptor(e, k);
18
+ Object.defineProperty(n, k, d.get ? d : {
19
+ enumerable: true,
20
+ get: function () { return e[k]; }
21
+ });
22
+ }
23
+ });
24
+ }
25
+ n.default = e;
26
+ return Object.freeze(n);
27
+ }
28
+
29
+ var React2__namespace = /*#__PURE__*/_interopNamespace(React2);
30
+
31
+ var cn = (...inputs) => tailwindMerge.twMerge(clsx.clsx(inputs));
32
+ var Input = React2__namespace.forwardRef(
33
+ ({ className, type, ...props }, ref) => {
34
+ return /* @__PURE__ */ jsxRuntime.jsx(
35
+ "input",
36
+ {
37
+ type,
38
+ className: cn(
39
+ "flex h-10 w-full rounded-xl border border-border bg-transparent px-3 py-1 text-base transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm group-aria-[invalid=true]:border-danger-foreground aria-[invalid=true]:border-danger-foreground",
40
+ className
41
+ ),
42
+ ref,
43
+ ...props
44
+ }
45
+ );
46
+ }
47
+ );
48
+ Input.displayName = "Input";
49
+ var AutoComplete = React2__namespace.forwardRef(({
50
+ id,
51
+ options,
52
+ placeholder,
53
+ emptyMessage,
54
+ inputClassName,
55
+ listClassName,
56
+ allowNewOption,
57
+ disabled,
58
+ value: controlledValue,
59
+ onValueChange,
60
+ onSelect,
61
+ onChange,
62
+ showSuggestions = true,
63
+ characterSenstiveCount = 2,
64
+ isLoading = false,
65
+ // Default to not loading
66
+ closeOptionsOnSelect = true,
67
+ initialSuggestions
68
+ }, ref) => {
69
+ const t = nextIntl.useTranslations("auto-complete");
70
+ const valueRef = React2__namespace.useRef(controlledValue || []);
71
+ const searchValueRef = React2__namespace.useRef("");
72
+ const [showOptions, setShowOptions] = React2__namespace.useState(false);
73
+ const [isHoveringOptions, setIsHoveringOptions] = React2__namespace.useState(false);
74
+ const [optionsToShow, setOptionsToShow] = React2__namespace.useState([]);
75
+ const [showAbove, setShowAbove] = React2__namespace.useState(false);
76
+ const inputRef = React2__namespace.useRef(null);
77
+ const containerRef = React2__namespace.useRef(null);
78
+ const optionsContainerRef = React2__namespace.useRef(null);
79
+ const mobileDetected = React2__namespace.useRef(
80
+ typeof window !== "undefined" && /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(
81
+ navigator.userAgent
82
+ )
83
+ );
84
+ const defaultPlaceholder = isLoading ? "Loading suggestions..." : placeholder || t("select-option");
85
+ const defaultEmptyMessage = emptyMessage || t("no-option-found");
86
+ const checkPosition = React2__namespace.useCallback(() => {
87
+ if (!inputRef.current || !containerRef.current) return;
88
+ const inputRect = inputRef.current.getBoundingClientRect();
89
+ const windowHeight = window.innerHeight;
90
+ const bottomSpace = windowHeight - inputRect.bottom;
91
+ const optionsHeight = 320;
92
+ setShowAbove(bottomSpace < optionsHeight);
93
+ }, []);
94
+ React2__namespace.useEffect(() => {
95
+ if (options?.length && !isLoading) {
96
+ if (!searchValueRef.current) {
97
+ setOptionsToShow(initialSuggestions || options.slice(0, 20));
98
+ } else {
99
+ setOptionsToShow(options.slice(0, 20));
100
+ }
101
+ }
102
+ }, [options, isLoading]);
103
+ React2__namespace.useEffect(() => {
104
+ if (!showOptions) return;
105
+ checkPosition();
106
+ window.addEventListener("resize", checkPosition);
107
+ window.addEventListener("scroll", checkPosition);
108
+ return () => {
109
+ window.removeEventListener("resize", checkPosition);
110
+ window.removeEventListener("scroll", checkPosition);
111
+ };
112
+ }, [showOptions, checkPosition]);
113
+ React2__namespace.useImperativeHandle(ref, () => ({
114
+ querySelector: (selector) => {
115
+ if (selector === "input") return inputRef.current;
116
+ return containerRef.current?.querySelector(selector);
117
+ }
118
+ }));
119
+ const handleInputChange = (e) => {
120
+ const inputValue = e.target.value;
121
+ searchValueRef.current = inputValue;
122
+ if (onChange) {
123
+ onChange(e);
124
+ }
125
+ if (mobileDetected.current) {
126
+ setTimeout(() => {
127
+ const filtered = inputValue ? options.filter((option) => option.label.toLowerCase().includes(inputValue.toLowerCase())) : options;
128
+ setOptionsToShow(filtered.slice(0, 20));
129
+ setShowOptions(true);
130
+ }, 50);
131
+ } else {
132
+ const filtered = inputValue ? options.filter((option) => option.label.toLowerCase().includes(inputValue.toLowerCase())) : options;
133
+ setOptionsToShow(filtered.slice(0, 20));
134
+ setShowOptions(!!inputValue || filtered.length > 0);
135
+ }
136
+ };
137
+ const handleSelect = (selectedValue, selectedLabel) => {
138
+ const currentValue = valueRef.current;
139
+ const newOptionItem = { value: selectedValue, label: selectedLabel };
140
+ const isSelected = currentValue.some((item) => item.value === selectedValue);
141
+ let newValue;
142
+ if (isSelected) {
143
+ newValue = currentValue.filter((item) => item.value !== selectedValue);
144
+ } else {
145
+ newValue = [...currentValue, newOptionItem];
146
+ }
147
+ valueRef.current = newValue;
148
+ if (inputRef.current) {
149
+ inputRef.current.value = "";
150
+ searchValueRef.current = "";
151
+ }
152
+ if (closeOptionsOnSelect) {
153
+ setShowOptions(false);
154
+ }
155
+ if (onValueChange) onValueChange(newValue);
156
+ if (onSelect) onSelect(newValue);
157
+ if (mobileDetected.current && inputRef.current) {
158
+ setTimeout(() => {
159
+ if (inputRef.current) {
160
+ inputRef.current.focus();
161
+ }
162
+ }, 100);
163
+ }
164
+ };
165
+ React2__namespace.useEffect(() => {
166
+ const handleOutsideClick = (e) => {
167
+ if (containerRef.current && !containerRef.current.contains(e.target) && optionsContainerRef.current && !optionsContainerRef.current.contains(e.target)) {
168
+ setShowOptions(false);
169
+ }
170
+ };
171
+ document.addEventListener("mousedown", handleOutsideClick);
172
+ return () => {
173
+ document.removeEventListener("mousedown", handleOutsideClick);
174
+ };
175
+ }, []);
176
+ React2__namespace.useEffect(() => {
177
+ if (controlledValue !== void 0) {
178
+ valueRef.current = controlledValue;
179
+ }
180
+ }, [controlledValue]);
181
+ const selectedValueKeys = valueRef.current.map((item) => item.value);
182
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref: containerRef, className: cn("relative", inputClassName), children: [
183
+ /* @__PURE__ */ jsxRuntime.jsx(
184
+ Input,
185
+ {
186
+ disabled,
187
+ ref: inputRef,
188
+ type: "text",
189
+ id: id || Math.random().toString(36).substring(2, 15),
190
+ placeholder: defaultPlaceholder,
191
+ className: "w-full rounded-xl placeholder:text-sm placeholder:truncate",
192
+ onChange: handleInputChange,
193
+ onBlur: () => {
194
+ if (allowNewOption && searchValueRef.current && !isHoveringOptions) {
195
+ handleSelect(searchValueRef.current, searchValueRef.current);
196
+ setShowOptions(false);
197
+ }
198
+ },
199
+ onKeyDown: (e) => {
200
+ if (e.key === "Enter") {
201
+ if (optionsToShow.length > 0) {
202
+ handleSelect(optionsToShow[0].value, optionsToShow[0].label);
203
+ setShowOptions(false);
204
+ inputRef.current?.blur();
205
+ } else {
206
+ if (allowNewOption) {
207
+ handleSelect(searchValueRef.current, searchValueRef.current);
208
+ setShowOptions(false);
209
+ inputRef.current?.blur();
210
+ }
211
+ }
212
+ }
213
+ },
214
+ onFocus: () => {
215
+ if (mobileDetected.current) {
216
+ setTimeout(() => {
217
+ if (optionsToShow.length === 0 && options.length > 0) {
218
+ setOptionsToShow(options.slice(0, 20));
219
+ }
220
+ setShowOptions(true);
221
+ checkPosition();
222
+ }, 50);
223
+ } else {
224
+ if (optionsToShow.length === 0 && options.length > 0) {
225
+ setOptionsToShow(options.slice(0, 20));
226
+ }
227
+ setShowOptions(true);
228
+ checkPosition();
229
+ }
230
+ }
231
+ }
232
+ ),
233
+ showOptions && showSuggestions && /* @__PURE__ */ jsxRuntime.jsxs(
234
+ "div",
235
+ {
236
+ onMouseEnter: () => setIsHoveringOptions(true),
237
+ onMouseLeave: () => setIsHoveringOptions(false),
238
+ ref: optionsContainerRef,
239
+ className: cn(
240
+ "absolute z-50 max-h-60 w-full overflow-auto rounded-xl bg-background border py-1 shadow-lg",
241
+ showAbove ? "bottom-full mb-1" : "top-full mt-1",
242
+ // Position below with margin top
243
+ listClassName
244
+ ),
245
+ children: [
246
+ searchValueRef.current === "" && !isLoading && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-foreground/75 px-4 py-1 opacity-75", children: t("suggestions") }),
247
+ isLoading ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full px-2 py-2 text-center text-foreground/75 text-sm", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "animate-pulse rounded-xl bg-secondary py-2 dark:bg-secondary/25", children: t("loading-suggestions") }) }) : optionsToShow.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-2 py-1 text-center flex items-center justify-center h-[35px] text-sm text-foreground/75", children: defaultEmptyMessage }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "w-full px-1 flex flex-col gap-1", children: [
248
+ optionsToShow.map((option) => {
249
+ const isSelected = selectedValueKeys.includes(option.value);
250
+ return /* @__PURE__ */ jsxRuntime.jsxs(
251
+ "div",
252
+ {
253
+ className: cn(
254
+ "relative cursor-pointer select-none px-3 py-2 hover:bg-secondary/50 dark:hover:bg-secondary/25 rounded-lg",
255
+ isSelected && "bg-secondary/50 dark:bg-secondary/25"
256
+ ),
257
+ onClick: () => handleSelect(option.value, option.label),
258
+ children: [
259
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: option.label }),
260
+ isSelected && /* @__PURE__ */ jsxRuntime.jsx(reactIcons.CheckIcon, { className: "absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2" })
261
+ ]
262
+ },
263
+ option.label
264
+ );
265
+ }),
266
+ allowNewOption && searchValueRef.current && !optionsToShow.some((option) => option.value === searchValueRef.current) && /* @__PURE__ */ jsxRuntime.jsx(
267
+ "div",
268
+ {
269
+ className: "cursor-pointer select-none px-3 py-2 hover:bg-gray-100",
270
+ onClick: () => handleSelect(searchValueRef.current, searchValueRef.current),
271
+ children: searchValueRef.current
272
+ }
273
+ )
274
+ ] })
275
+ ]
276
+ }
277
+ )
278
+ ] });
279
+ });
280
+ AutoComplete.displayName = "AutoComplete";
281
+
282
+ exports.AutoComplete = AutoComplete;
283
+ //# sourceMappingURL=auto-complete.cjs.map
284
+ //# sourceMappingURL=auto-complete.cjs.map