@moontra/moonui 2.2.0 → 2.2.2

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 (44) hide show
  1. package/dist/index.d.mts +91 -14
  2. package/dist/index.d.ts +91 -14
  3. package/dist/index.js +1714 -369
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +1546 -371
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +2 -2
  8. package/src/components/ui/alert.tsx +123 -93
  9. package/src/components/ui/avatar.tsx +2 -0
  10. package/src/components/ui/badge.tsx +19 -17
  11. package/src/components/ui/breadcrumb.tsx +2 -0
  12. package/src/components/ui/button.stories.tsx +4 -2
  13. package/src/components/ui/button.tsx +39 -33
  14. package/src/components/ui/calendar.tsx +1 -1
  15. package/src/components/ui/card-input.tsx +231 -0
  16. package/src/components/ui/card.stories.tsx +2 -0
  17. package/src/components/ui/card.tsx +2 -0
  18. package/src/components/ui/data-table.stories.tsx +4 -2
  19. package/src/components/ui/data-table.tsx +7 -7
  20. package/src/components/ui/date-picker.stories.tsx +2 -0
  21. package/src/components/ui/date-picker.tsx +18 -9
  22. package/src/components/ui/draggable-list.tsx +2 -0
  23. package/src/components/ui/index.ts +357 -44
  24. package/src/components/ui/input.stories.tsx +2 -0
  25. package/src/components/ui/input.tsx +2 -0
  26. package/src/components/ui/locked-component.tsx +222 -0
  27. package/src/components/ui/pagination.tsx +2 -0
  28. package/src/components/ui/phone-input.tsx +172 -0
  29. package/src/components/ui/popover-pro.tsx +424 -0
  30. package/src/components/ui/rich-text-editor/index.tsx +2 -1
  31. package/src/components/ui/scroll-area.tsx +48 -0
  32. package/src/components/ui/select.tsx +5 -1
  33. package/src/components/ui/separator.tsx +2 -2
  34. package/src/components/ui/swipeable-card.tsx +2 -0
  35. package/src/components/ui/table.tsx +2 -0
  36. package/src/components/ui/tabs.tsx +2 -0
  37. package/src/components/ui/tags-input.tsx +130 -0
  38. package/src/components/ui/textarea.tsx +2 -0
  39. package/src/components/ui/toast.tsx +2 -0
  40. package/src/index.tsx +4 -46
  41. package/src/lib/performance-profiler.ts +79 -0
  42. package/src/styles/index.css +315 -2
  43. package/src/use-performance-optimizer.ts +26 -26
  44. package/src/use-scroll-animation.ts +5 -7
package/dist/index.js CHANGED
@@ -1,10 +1,12 @@
1
+ 'use client';
2
+
1
3
  'use strict';
2
4
 
3
- var clsx = require('clsx');
4
- var tailwindMerge = require('tailwind-merge');
5
5
  var t = require('react');
6
6
  var AccordionPrimitive = require('@radix-ui/react-accordion');
7
7
  var lucideReact = require('lucide-react');
8
+ var clsx = require('clsx');
9
+ var tailwindMerge = require('tailwind-merge');
8
10
  var jsxRuntime = require('react/jsx-runtime');
9
11
  var classVarianceAuthority = require('class-variance-authority');
10
12
  var AvatarPrimitive = require('@radix-ui/react-avatar');
@@ -57,8 +59,6 @@ var TooltipPrimitive__namespace = /*#__PURE__*/_interopNamespace(TooltipPrimitiv
57
59
  var SwitchPrimitives__namespace = /*#__PURE__*/_interopNamespace(SwitchPrimitives);
58
60
  var ToastPrimitives__namespace = /*#__PURE__*/_interopNamespace(ToastPrimitives);
59
61
 
60
- /** @license MoonUI v1.0.0 - MIT License - https://moonui.dev */
61
-
62
62
  function cn(...inputs) {
63
63
  return tailwindMerge.twMerge(clsx.clsx(inputs));
64
64
  }
@@ -141,7 +141,17 @@ var alertVariants = classVarianceAuthority.cva(
141
141
  }
142
142
  );
143
143
  var Alert = t__namespace.forwardRef(
144
- ({ className, variant = "default", size, radius, hideIcon = false, closable = false, onClose, children, ...props }, ref) => {
144
+ ({
145
+ className,
146
+ variant = "default",
147
+ size,
148
+ radius,
149
+ hideIcon = false,
150
+ closable = false,
151
+ onClose,
152
+ children,
153
+ ...props
154
+ }, ref) => {
145
155
  const Icon2 = t__namespace.useMemo(() => {
146
156
  switch (variant) {
147
157
  case "success":
@@ -161,7 +171,16 @@ var Alert = t__namespace.forwardRef(
161
171
  {
162
172
  ref,
163
173
  role: "alert",
164
- className: cn("moonui-theme", alertVariants({ variant, size, radius, withClose: closable }), className),
174
+ className: cn(
175
+ "moonui-theme",
176
+ alertVariants({
177
+ variant,
178
+ size,
179
+ radius,
180
+ withClose: closable
181
+ }),
182
+ className
183
+ ),
165
184
  ...props,
166
185
  children: [
167
186
  !hideIcon && /* @__PURE__ */ jsxRuntime.jsx(Icon2, { className: "h-5 w-5" }),
@@ -185,7 +204,11 @@ var AlertTitle = t__namespace.forwardRef(({ className, ...props }, ref) => /* @_
185
204
  "h5",
186
205
  {
187
206
  ref,
188
- className: cn("moonui-theme", "font-semibold leading-tight tracking-tight mb-1", className),
207
+ className: cn(
208
+ "moonui-theme",
209
+ "font-semibold leading-tight tracking-tight mb-1",
210
+ className
211
+ ),
189
212
  ...props
190
213
  }
191
214
  ));
@@ -194,7 +217,11 @@ var AlertDescription = t__namespace.forwardRef(({ className, ...props }, ref) =>
194
217
  "div",
195
218
  {
196
219
  ref,
197
- className: cn("moonui-theme", "text-sm leading-5 text-muted-foreground", className),
220
+ className: cn(
221
+ "moonui-theme",
222
+ "text-sm leading-5 text-muted-foreground",
223
+ className
224
+ ),
198
225
  ...props
199
226
  }
200
227
  ));
@@ -343,7 +370,7 @@ var AvatarGroup = t__namespace.forwardRef(
343
370
  AvatarGroup.displayName = "AvatarGroup";
344
371
  var badgeVariants = classVarianceAuthority.cva(
345
372
  [
346
- "inline-flex items-center gap-1.5",
373
+ "inline-flex items-center justify-center gap-1.5",
347
374
  "font-medium transition-colors duration-200",
348
375
  "border focus:outline-none",
349
376
  "focus-visible:ring-2 focus-visible:ring-offset-1"
@@ -352,23 +379,23 @@ var badgeVariants = classVarianceAuthority.cva(
352
379
  variants: {
353
380
  variant: {
354
381
  primary: [
355
- "border-transparent bg-primary text-primary-foreground",
356
- "hover:bg-primary-hover dark:hover:bg-primary/90",
357
- "focus-visible:ring-primary/30 dark:focus-visible:ring-primary/40",
358
- "dark:bg-primary/90 dark:text-white dark:shadow-inner dark:shadow-primary/10"
382
+ "border-transparent bg-gray-900 text-white",
383
+ "hover:bg-gray-800 dark:hover:bg-gray-700",
384
+ "focus-visible:ring-gray-500/30 dark:focus-visible:ring-gray-400/40",
385
+ "dark:bg-gray-700 dark:text-gray-50 dark:shadow-inner dark:shadow-gray-950/10"
359
386
  ],
360
387
  secondary: [
361
388
  "border-transparent bg-secondary text-secondary-foreground",
362
- "hover:bg-gray-200 dark:hover:bg-gray-700/90",
389
+ "hover:bg-gray-200 dark:hover:bg-gray-600",
363
390
  "focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40",
364
- "dark:bg-gray-800 dark:text-gray-100 dark:shadow-inner dark:shadow-gray-950/10"
391
+ "dark:bg-gray-700/50 dark:text-gray-50 dark:shadow-inner dark:shadow-gray-950/10"
365
392
  ],
366
393
  outline: [
367
- "border-gray-200 dark:border-gray-700",
394
+ "border-gray-200 dark:border-gray-600",
368
395
  "bg-transparent text-foreground",
369
- "hover:border-gray-300 dark:hover:border-gray-600",
396
+ "hover:border-gray-300 dark:hover:border-gray-500",
370
397
  "focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40",
371
- "dark:text-gray-200 dark:bg-transparent dark:backdrop-blur-sm"
398
+ "dark:text-gray-100 dark:bg-transparent dark:backdrop-blur-sm"
372
399
  ],
373
400
  destructive: [
374
401
  "border-transparent bg-error text-white",
@@ -389,11 +416,11 @@ var badgeVariants = classVarianceAuthority.cva(
389
416
  "dark:bg-warning/90 dark:text-gray-900 dark:shadow-inner dark:shadow-warning/10"
390
417
  ],
391
418
  ghost: [
392
- "border-transparent bg-transparent text-foreground",
393
- "hover:bg-gray-100 dark:hover:bg-gray-800/80",
419
+ "border border-gray-200 bg-gray-50/50 text-gray-700",
420
+ "hover:bg-gray-100 dark:hover:bg-gray-800/60",
394
421
  "focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40",
395
- "dark:text-gray-200 dark:backdrop-blur-sm",
396
- "transition-colors duration-200"
422
+ "dark:border-gray-700 dark:bg-gray-800/30 dark:text-gray-300",
423
+ "transition-all duration-200"
397
424
  ],
398
425
  pro: [
399
426
  "border-transparent bg-gradient-to-r from-purple-600 to-pink-600 text-white",
@@ -472,9 +499,9 @@ function Badge({
472
499
  "aria-hidden": "true"
473
500
  }
474
501
  ),
475
- autoLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex shrink-0", children: autoLeftIcon }),
476
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: autoChildren }),
477
- rightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex shrink-0", children: rightIcon }),
502
+ autoLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex shrink-0 items-center", children: autoLeftIcon }),
503
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex items-center", children: autoChildren }),
504
+ rightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex shrink-0 items-center", children: rightIcon }),
478
505
  removable && onRemove && /* @__PURE__ */ jsxRuntime.jsx(
479
506
  "button",
480
507
  {
@@ -685,11 +712,11 @@ var buttonVariants = classVarianceAuthority.cva(
685
712
  "transition-all duration-200"
686
713
  ],
687
714
  secondary: [
688
- "bg-muted text-muted-foreground",
689
- "dark:bg-muted dark:text-muted-foreground",
690
- "hover:bg-muted/80 dark:hover:bg-muted/80",
691
- "active:bg-muted/70 dark:active:bg-muted/70",
692
- "border border-input dark:border-input",
715
+ "bg-gray-100 text-gray-900",
716
+ "dark:bg-gray-800 dark:text-gray-100",
717
+ "hover:bg-gray-200 dark:hover:bg-gray-700",
718
+ "active:bg-gray-300 dark:active:bg-gray-600",
719
+ "border border-gray-200 dark:border-gray-700",
693
720
  "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
694
721
  "shadow-sm hover:shadow-md"
695
722
  ],
@@ -703,10 +730,10 @@ var buttonVariants = classVarianceAuthority.cva(
703
730
  "transition-all duration-200"
704
731
  ],
705
732
  ghost: [
706
- "text-foreground",
707
- "dark:text-foreground",
708
- "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent dark:hover:text-accent-foreground",
709
- "active:bg-accent/80 dark:active:bg-accent/80",
733
+ "text-gray-700",
734
+ "dark:text-gray-300",
735
+ "hover:bg-gray-100 hover:text-gray-900 dark:hover:bg-gray-800 dark:hover:text-gray-100",
736
+ "active:bg-gray-200 dark:active:bg-gray-700",
710
737
  "focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
711
738
  "transition-all duration-200"
712
739
  ],
@@ -736,19 +763,21 @@ var buttonVariants = classVarianceAuthority.cva(
736
763
  "transition-colors duration-200"
737
764
  ],
738
765
  gradient: [
739
- "bg-gradient-to-r from-blue-600 to-purple-600 text-white",
740
- "hover:from-blue-700 hover:to-purple-700",
741
- "active:from-blue-800 active:to-purple-800",
742
- "shadow-lg shadow-purple-500/25",
766
+ "bg-gradient-to-r from-purple-500 to-pink-500 text-white",
767
+ "hover:from-purple-600 hover:to-pink-600",
768
+ "active:from-purple-700 active:to-pink-700",
769
+ "shadow-xl shadow-purple-500/40",
770
+ "hover:shadow-2xl hover:shadow-purple-500/50",
743
771
  "focus-visible:ring-purple-500/50",
744
772
  "transition-all duration-300"
745
773
  ],
746
774
  glow: [
747
- "bg-primary text-primary-foreground",
748
- "shadow-lg shadow-primary/50",
749
- "hover:shadow-xl hover:shadow-primary/60",
750
- "active:shadow-md active:shadow-primary/40",
751
- "focus-visible:ring-primary/50",
775
+ "bg-blue-500 text-white",
776
+ "shadow-[0_0_30px_rgba(59,130,246,0.5)]",
777
+ "hover:shadow-[0_0_40px_rgba(59,130,246,0.7)]",
778
+ "active:shadow-[0_0_20px_rgba(59,130,246,0.4)]",
779
+ "hover:bg-blue-600",
780
+ "focus-visible:ring-blue-500/50",
752
781
  "transition-all duration-300"
753
782
  ],
754
783
  soft: [
@@ -772,29 +801,31 @@ var buttonVariants = classVarianceAuthority.cva(
772
801
  "transition-all duration-200"
773
802
  ],
774
803
  neon: [
775
- "bg-transparent text-primary",
776
- "border-2 border-primary",
777
- "hover:bg-primary hover:text-primary-foreground",
778
- "hover:shadow-[0_0_20px_rgba(var(--primary),0.5)]",
779
- "active:shadow-[0_0_10px_rgba(var(--primary),0.3)]",
780
- "focus-visible:ring-primary/50",
804
+ "bg-transparent text-green-400",
805
+ "border-2 border-green-400",
806
+ "hover:bg-green-400 hover:text-gray-900",
807
+ "hover:shadow-[0_0_30px_rgba(74,222,128,0.6)]",
808
+ "active:shadow-[0_0_15px_rgba(74,222,128,0.4)]",
809
+ "focus-visible:ring-green-400/50",
781
810
  "transition-all duration-300"
782
811
  ]
783
812
  },
784
813
  size: {
785
- xs: "h-7 px-2.5 text-xs rounded-md",
786
- sm: "h-8 px-3 text-sm rounded-md",
787
- md: "h-10 px-4 text-base rounded-lg",
788
- lg: "h-12 px-6 text-lg rounded-lg",
789
- xl: "h-14 px-8 text-xl rounded-xl",
790
- icon: "h-10 w-10 p-2 rounded-lg",
791
- "icon-sm": "h-8 w-8 p-1.5 rounded-md",
792
- "icon-lg": "h-12 w-12 p-3 rounded-xl"
814
+ xs: "h-7 px-2.5 text-xs",
815
+ sm: "h-8 px-3 text-sm",
816
+ md: "h-10 px-4 text-base",
817
+ lg: "h-12 px-6 text-lg",
818
+ xl: "h-14 px-8 text-xl",
819
+ icon: "h-10 w-10 p-2",
820
+ "icon-sm": "h-8 w-8 p-1.5",
821
+ "icon-lg": "h-12 w-12 p-3"
793
822
  },
794
823
  rounded: {
795
- default: "",
824
+ default: "rounded-xl",
796
825
  full: "rounded-full",
797
- none: "rounded-none"
826
+ none: "rounded-none",
827
+ sm: "rounded-lg",
828
+ lg: "rounded-2xl"
798
829
  },
799
830
  fullWidth: {
800
831
  true: "w-full"
@@ -974,32 +1005,6 @@ var tapAnimations = {
974
1005
  transition: { duration: 0.1 }
975
1006
  }
976
1007
  };
977
- var pageTransitions = {
978
- fadeIn: {
979
- initial: { opacity: 0 },
980
- animate: { opacity: 1 },
981
- exit: { opacity: 0 },
982
- transition: { duration: 0.3 }
983
- },
984
- slideUp: {
985
- initial: { opacity: 0, y: 20 },
986
- animate: { opacity: 1, y: 0 },
987
- exit: { opacity: 0, y: -20 },
988
- transition: springAnimations.smooth
989
- },
990
- slideRight: {
991
- initial: { opacity: 0, x: -20 },
992
- animate: { opacity: 1, x: 0 },
993
- exit: { opacity: 0, x: 20 },
994
- transition: springAnimations.smooth
995
- },
996
- scale: {
997
- initial: { opacity: 0, scale: 0.95 },
998
- animate: { opacity: 1, scale: 1 },
999
- exit: { opacity: 0, scale: 1.05 },
1000
- transition: springAnimations.smooth
1001
- }
1002
- };
1003
1008
  var skeletonAnimation = {
1004
1009
  initial: { opacity: 0.5 },
1005
1010
  animate: {
@@ -1114,6 +1119,183 @@ var CardFooter = t__namespace.forwardRef(({ className, ...props }, ref) => /* @_
1114
1119
  }
1115
1120
  ));
1116
1121
  CardFooter.displayName = "CardFooter";
1122
+ var getCardType = (number) => {
1123
+ const patterns = {
1124
+ visa: /^4/,
1125
+ mastercard: /^5[1-5]/,
1126
+ amex: /^3[47]/,
1127
+ discover: /^6(?:011|5)/,
1128
+ diners: /^3(?:0[0-5]|[68])/,
1129
+ jcb: /^35/
1130
+ };
1131
+ for (const [type, pattern] of Object.entries(patterns)) {
1132
+ if (pattern.test(number))
1133
+ return type;
1134
+ }
1135
+ return "unknown";
1136
+ };
1137
+ var formatCardNumber = (value, cardType) => {
1138
+ const cleaned = value.replace(/\s+/g, "");
1139
+ const groups = cardType === "amex" ? [4, 6, 5] : [4, 4, 4, 4];
1140
+ let formatted = "";
1141
+ let position = 0;
1142
+ for (const group of groups) {
1143
+ if (position >= cleaned.length)
1144
+ break;
1145
+ if (formatted)
1146
+ formatted += " ";
1147
+ formatted += cleaned.slice(position, position + group);
1148
+ position += group;
1149
+ }
1150
+ return formatted;
1151
+ };
1152
+ var CardNumberInput = t__namespace.forwardRef(
1153
+ ({ className, value = "", onChange, showIcon = true, size, ...props }, ref) => {
1154
+ const [cardType, setCardType] = t__namespace.useState("unknown");
1155
+ const handleChange = (e) => {
1156
+ const rawValue = e.target.value.replace(/\D/g, "");
1157
+ const detectedType = getCardType(rawValue);
1158
+ setCardType(detectedType);
1159
+ const maxLength = detectedType === "amex" ? 15 : 16;
1160
+ const truncated = rawValue.slice(0, maxLength);
1161
+ const formatted = formatCardNumber(truncated, detectedType);
1162
+ onChange?.(truncated, detectedType);
1163
+ e.target.value = formatted;
1164
+ };
1165
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
1166
+ /* @__PURE__ */ jsxRuntime.jsx(
1167
+ Input,
1168
+ {
1169
+ ref,
1170
+ type: "text",
1171
+ inputMode: "numeric",
1172
+ autoComplete: "cc-number",
1173
+ placeholder: "1234 5678 9012 3456",
1174
+ value: formatCardNumber(value, cardType),
1175
+ onChange: handleChange,
1176
+ className: cn(showIcon && "pl-10", className),
1177
+ ...props
1178
+ }
1179
+ ),
1180
+ showIcon && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" })
1181
+ ] });
1182
+ }
1183
+ );
1184
+ CardNumberInput.displayName = "CardNumberInput";
1185
+ var CardExpiryInput = t__namespace.forwardRef(
1186
+ ({ className, value = "", onChange, size, ...props }, ref) => {
1187
+ const handleChange = (e) => {
1188
+ let rawValue = e.target.value.replace(/\D/g, "");
1189
+ if (rawValue.length >= 2) {
1190
+ const month = parseInt(rawValue.slice(0, 2));
1191
+ if (month > 12) {
1192
+ rawValue = "12" + rawValue.slice(2);
1193
+ } else if (month === 0) {
1194
+ rawValue = "01" + rawValue.slice(2);
1195
+ }
1196
+ }
1197
+ rawValue = rawValue.slice(0, 4);
1198
+ let formatted = rawValue;
1199
+ if (rawValue.length >= 2) {
1200
+ formatted = rawValue.slice(0, 2) + "/" + rawValue.slice(2);
1201
+ }
1202
+ onChange?.(rawValue);
1203
+ e.target.value = formatted;
1204
+ };
1205
+ const formattedValue = value.length >= 2 ? value.slice(0, 2) + "/" + value.slice(2) : value;
1206
+ return /* @__PURE__ */ jsxRuntime.jsx(
1207
+ Input,
1208
+ {
1209
+ ref,
1210
+ type: "text",
1211
+ inputMode: "numeric",
1212
+ autoComplete: "cc-exp",
1213
+ placeholder: "MM/YY",
1214
+ value: formattedValue,
1215
+ onChange: handleChange,
1216
+ className,
1217
+ ...props
1218
+ }
1219
+ );
1220
+ }
1221
+ );
1222
+ CardExpiryInput.displayName = "CardExpiryInput";
1223
+ var CardCVCInput = t__namespace.forwardRef(
1224
+ ({ className, value = "", onChange, cardType = "unknown", size, ...props }, ref) => {
1225
+ const maxLength = cardType === "amex" ? 4 : 3;
1226
+ const handleChange = (e) => {
1227
+ const rawValue = e.target.value.replace(/\D/g, "").slice(0, maxLength);
1228
+ onChange?.(rawValue);
1229
+ };
1230
+ return /* @__PURE__ */ jsxRuntime.jsx(
1231
+ Input,
1232
+ {
1233
+ ref,
1234
+ type: "text",
1235
+ inputMode: "numeric",
1236
+ autoComplete: "cc-csc",
1237
+ placeholder: cardType === "amex" ? "1234" : "123",
1238
+ value,
1239
+ onChange: handleChange,
1240
+ maxLength,
1241
+ className,
1242
+ ...props
1243
+ }
1244
+ );
1245
+ }
1246
+ );
1247
+ CardCVCInput.displayName = "CardCVCInput";
1248
+ var CardZipInput = t__namespace.forwardRef(
1249
+ ({ className, value = "", onChange, format: format4 = "US", size, ...props }, ref) => {
1250
+ const handleChange = (e) => {
1251
+ let rawValue = e.target.value;
1252
+ switch (format4) {
1253
+ case "US":
1254
+ rawValue = rawValue.replace(/\D/g, "").slice(0, 5);
1255
+ break;
1256
+ case "CA":
1257
+ rawValue = rawValue.toUpperCase().replace(/[^A-Z0-9]/g, "").slice(0, 6);
1258
+ if (rawValue.length >= 3) {
1259
+ rawValue = rawValue.slice(0, 3) + " " + rawValue.slice(3);
1260
+ }
1261
+ break;
1262
+ case "UK":
1263
+ rawValue = rawValue.toUpperCase().replace(/[^A-Z0-9\s]/g, "").slice(0, 8);
1264
+ break;
1265
+ default:
1266
+ rawValue = rawValue.slice(0, 10);
1267
+ }
1268
+ onChange?.(rawValue.replace(/\s/g, ""));
1269
+ e.target.value = rawValue;
1270
+ };
1271
+ const getPlaceholder = () => {
1272
+ switch (format4) {
1273
+ case "US":
1274
+ return "12345";
1275
+ case "CA":
1276
+ return "K1A 0B1";
1277
+ case "UK":
1278
+ return "SW1A 1AA";
1279
+ default:
1280
+ return "Postal Code";
1281
+ }
1282
+ };
1283
+ return /* @__PURE__ */ jsxRuntime.jsx(
1284
+ Input,
1285
+ {
1286
+ ref,
1287
+ type: "text",
1288
+ autoComplete: "postal-code",
1289
+ placeholder: getPlaceholder(),
1290
+ value,
1291
+ onChange: handleChange,
1292
+ className,
1293
+ ...props
1294
+ }
1295
+ );
1296
+ }
1297
+ );
1298
+ CardZipInput.displayName = "CardZipInput";
1117
1299
  var checkboxVariants = classVarianceAuthority.cva(
1118
1300
  "peer shrink-0 border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary-foreground",
1119
1301
  {
@@ -1264,7 +1446,7 @@ var CheckboxWithLabel = t__namespace.forwardRef(({
1264
1446
  });
1265
1447
  CheckboxWithLabel.displayName = "CheckboxWithLabel";
1266
1448
 
1267
- // node_modules/@radix-ui/primitive/dist/index.mjs
1449
+ // ../../node_modules/@radix-ui/primitive/dist/index.mjs
1268
1450
  function composeEventHandlers(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
1269
1451
  return function handleEvent(event) {
1270
1452
  originalEventHandler?.(event);
@@ -3081,85 +3263,6 @@ function D(_) {
3081
3263
  function W(_, C, h) {
3082
3264
  return _ = h && h.length > 0 ? `${_ + " " + h.join(" ")}` : _, G(_, C, D(_), D(C), 0, 0, {});
3083
3265
  }
3084
- var NODES2 = [
3085
- "a",
3086
- "button",
3087
- "div",
3088
- "form",
3089
- "h2",
3090
- "h3",
3091
- "img",
3092
- "input",
3093
- "label",
3094
- "li",
3095
- "nav",
3096
- "ol",
3097
- "p",
3098
- "select",
3099
- "span",
3100
- "svg",
3101
- "ul"
3102
- ];
3103
- var Primitive2 = NODES2.reduce((primitive, node) => {
3104
- const Slot = reactSlot.createSlot(`Primitive.${node}`);
3105
- const Node = t__namespace.forwardRef((props, forwardedRef) => {
3106
- const { asChild, ...primitiveProps } = props;
3107
- const Comp = asChild ? Slot : node;
3108
- if (typeof window !== "undefined") {
3109
- window[Symbol.for("radix-ui")] = true;
3110
- }
3111
- return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
3112
- });
3113
- Node.displayName = `Primitive.${node}`;
3114
- return { ...primitive, [node]: Node };
3115
- }, {});
3116
- var useLayoutEffect22 = globalThis?.document ? t__namespace.useLayoutEffect : () => {
3117
- };
3118
-
3119
- // ../../node_modules/@radix-ui/react-id/dist/index.mjs
3120
- var useReactId2 = t__namespace[" useId ".trim().toString()] || (() => void 0);
3121
- var count2 = 0;
3122
- function useId3(deterministicId) {
3123
- const [id, setId] = t__namespace.useState(useReactId2());
3124
- useLayoutEffect22(() => {
3125
- if (!deterministicId)
3126
- setId((reactId) => reactId ?? String(count2++));
3127
- }, [deterministicId]);
3128
- return deterministicId || (id ? `radix-${id}` : "");
3129
- }
3130
- function setRef2(ref, value) {
3131
- if (typeof ref === "function") {
3132
- return ref(value);
3133
- } else if (ref !== null && ref !== void 0) {
3134
- ref.current = value;
3135
- }
3136
- }
3137
- function composeRefs2(...refs) {
3138
- return (node) => {
3139
- let hasCleanup = false;
3140
- const cleanups = refs.map((ref) => {
3141
- const cleanup = setRef2(ref, node);
3142
- if (!hasCleanup && typeof cleanup == "function") {
3143
- hasCleanup = true;
3144
- }
3145
- return cleanup;
3146
- });
3147
- if (hasCleanup) {
3148
- return () => {
3149
- for (let i = 0; i < cleanups.length; i++) {
3150
- const cleanup = cleanups[i];
3151
- if (typeof cleanup == "function") {
3152
- cleanup();
3153
- } else {
3154
- setRef2(refs[i], null);
3155
- }
3156
- }
3157
- };
3158
- }
3159
- };
3160
- }
3161
-
3162
- // ../../node_modules/cmdk/dist/index.mjs
3163
3266
  var N = '[cmdk-group=""]';
3164
3267
  var Y2 = '[cmdk-group-items=""]';
3165
3268
  var be = '[cmdk-group-heading=""]';
@@ -3177,7 +3280,7 @@ var me = t__namespace.forwardRef((r, o) => {
3177
3280
  let n = L(() => {
3178
3281
  var e, a;
3179
3282
  return { search: "", value: (a = (e = r.value) != null ? e : r.defaultValue) != null ? a : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
3180
- }), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r, $2 = useId3(), q = useId3(), _ = useId3(), I = t__namespace.useRef(null), v = ke();
3283
+ }), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r, $2 = useId2(), q = useId2(), _ = useId2(), I = t__namespace.useRef(null), v = ke();
3181
3284
  k2(() => {
3182
3285
  if (R !== void 0) {
3183
3286
  let e = R.trim();
@@ -3292,7 +3395,7 @@ var me = t__namespace.forwardRef((r, o) => {
3292
3395
  var e;
3293
3396
  return Array.from(((e = I.current) == null ? void 0 : e.querySelectorAll(ce)) || []);
3294
3397
  }
3295
- function X7(e) {
3398
+ function X8(e) {
3296
3399
  let s = V()[e];
3297
3400
  s && E.setState("value", s.getAttribute(T));
3298
3401
  }
@@ -3307,12 +3410,12 @@ var me = t__namespace.forwardRef((r, o) => {
3307
3410
  s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
3308
3411
  i ? E.setState("value", i.getAttribute(T)) : Q(e);
3309
3412
  }
3310
- let oe = () => X7(V().length - 1), ie = (e) => {
3413
+ let oe = () => X8(V().length - 1), ie = (e) => {
3311
3414
  e.preventDefault(), e.metaKey ? oe() : e.altKey ? re(1) : Q(1);
3312
3415
  }, se = (e) => {
3313
- e.preventDefault(), e.metaKey ? X7(0) : e.altKey ? re(-1) : Q(-1);
3416
+ e.preventDefault(), e.metaKey ? X8(0) : e.altKey ? re(-1) : Q(-1);
3314
3417
  };
3315
- return t__namespace.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
3418
+ return t__namespace.createElement(Primitive.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
3316
3419
  var s;
3317
3420
  (s = O.onKeyDown) == null || s.call(O, e);
3318
3421
  let a = e.nativeEvent.isComposing || e.keyCode === 229;
@@ -3337,7 +3440,7 @@ var me = t__namespace.forwardRef((r, o) => {
3337
3440
  break;
3338
3441
  }
3339
3442
  case "Home": {
3340
- e.preventDefault(), X7(0);
3443
+ e.preventDefault(), X8(0);
3341
3444
  break;
3342
3445
  }
3343
3446
  case "End": {
@@ -3357,7 +3460,7 @@ var me = t__namespace.forwardRef((r, o) => {
3357
3460
  });
3358
3461
  var he = t__namespace.forwardRef((r, o) => {
3359
3462
  var _, I;
3360
- let n = useId3(), u2 = t__namespace.useRef(null), c = t__namespace.useContext(fe), d = K2(), f = pe(r), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
3463
+ let n = useId2(), u2 = t__namespace.useRef(null), c = t__namespace.useContext(fe), d = K2(), f = pe(r), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
3361
3464
  k2(() => {
3362
3465
  if (!p2)
3363
3466
  return d.item(n, c == null ? void 0 : c.id);
@@ -3378,23 +3481,23 @@ var he = t__namespace.forwardRef((r, o) => {
3378
3481
  if (!x)
3379
3482
  return null;
3380
3483
  let { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r;
3381
- return t__namespace.createElement(Primitive2.div, { ref: composeRefs2(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r.children);
3484
+ return t__namespace.createElement(Primitive.div, { ref: composeRefs(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r.children);
3382
3485
  });
3383
3486
  var Ee = t__namespace.forwardRef((r, o) => {
3384
- let { heading: n, children: u2, forceMount: c, ...d } = r, f = useId3(), p2 = t__namespace.useRef(null), b = t__namespace.useRef(null), m2 = useId3(), R = K2(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
3487
+ let { heading: n, children: u2, forceMount: c, ...d } = r, f = useId2(), p2 = t__namespace.useRef(null), b = t__namespace.useRef(null), m2 = useId2(), R = K2(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
3385
3488
  k2(() => R.group(f), []), ve(f, p2, [r.value, r.heading, b]);
3386
3489
  let C = t__namespace.useMemo(() => ({ id: f, forceMount: c }), [c]);
3387
- return t__namespace.createElement(Primitive2.div, { ref: composeRefs2(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && t__namespace.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B2(r, (S) => t__namespace.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, t__namespace.createElement(fe.Provider, { value: C }, S))));
3490
+ return t__namespace.createElement(Primitive.div, { ref: composeRefs(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && t__namespace.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B2(r, (S) => t__namespace.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, t__namespace.createElement(fe.Provider, { value: C }, S))));
3388
3491
  });
3389
3492
  var ye = t__namespace.forwardRef((r, o) => {
3390
3493
  let { alwaysRender: n, ...u2 } = r, c = t__namespace.useRef(null), d = P((f) => !f.search);
3391
- return !n && !d ? null : t__namespace.createElement(Primitive2.div, { ref: composeRefs2(c, o), ...u2, "cmdk-separator": "", role: "separator" });
3494
+ return !n && !d ? null : t__namespace.createElement(Primitive.div, { ref: composeRefs(c, o), ...u2, "cmdk-separator": "", role: "separator" });
3392
3495
  });
3393
3496
  var Se = t__namespace.forwardRef((r, o) => {
3394
3497
  let { onValueChange: n, ...u2 } = r, c = r.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K2();
3395
3498
  return t__namespace.useEffect(() => {
3396
3499
  r.value != null && d.setState("search", r.value);
3397
- }, [r.value]), t__namespace.createElement(Primitive2.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r.value : f, onChange: (m2) => {
3500
+ }, [r.value]), t__namespace.createElement(Primitive.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r.value : f, onChange: (m2) => {
3398
3501
  c || d.setState("search", m2.target.value), n == null || n(m2.target.value);
3399
3502
  } });
3400
3503
  });
@@ -3412,16 +3515,16 @@ var Ce = t__namespace.forwardRef((r, o) => {
3412
3515
  cancelAnimationFrame(x), C.unobserve(m2);
3413
3516
  };
3414
3517
  }
3415
- }, []), t__namespace.createElement(Primitive2.div, { ref: composeRefs2(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B2(r, (m2) => t__namespace.createElement("div", { ref: composeRefs2(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
3518
+ }, []), t__namespace.createElement(Primitive.div, { ref: composeRefs(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B2(r, (m2) => t__namespace.createElement("div", { ref: composeRefs(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
3416
3519
  });
3417
3520
  var xe = t__namespace.forwardRef((r, o) => {
3418
3521
  let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r;
3419
3522
  return t__namespace.createElement(DialogPrimitive__namespace.Root, { open: n, onOpenChange: u2 }, t__namespace.createElement(DialogPrimitive__namespace.Portal, { container: f }, t__namespace.createElement(DialogPrimitive__namespace.Overlay, { "cmdk-overlay": "", className: c }), t__namespace.createElement(DialogPrimitive__namespace.Content, { "aria-label": r.label, "cmdk-dialog": "", className: d }, t__namespace.createElement(me, { ref: o, ...p2 }))));
3420
3523
  });
3421
- var Ie = t__namespace.forwardRef((r, o) => P((u2) => u2.filtered.count === 0) ? t__namespace.createElement(Primitive2.div, { ref: o, ...r, "cmdk-empty": "", role: "presentation" }) : null);
3524
+ var Ie = t__namespace.forwardRef((r, o) => P((u2) => u2.filtered.count === 0) ? t__namespace.createElement(Primitive.div, { ref: o, ...r, "cmdk-empty": "", role: "presentation" }) : null);
3422
3525
  var Pe = t__namespace.forwardRef((r, o) => {
3423
3526
  let { progress: n, children: u2, label: c = "Loading...", ...d } = r;
3424
- return t__namespace.createElement(Primitive2.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B2(r, (f) => t__namespace.createElement("div", { "aria-hidden": true }, f)));
3527
+ return t__namespace.createElement(Primitive.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B2(r, (f) => t__namespace.createElement("div", { "aria-hidden": true }, f)));
3425
3528
  });
3426
3529
  var _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe });
3427
3530
  function we(r, o) {
@@ -4574,16 +4677,16 @@ var extent = (columnId, _leafRows, childRows) => {
4574
4677
  return [min2, max2];
4575
4678
  };
4576
4679
  var mean = (columnId, leafRows) => {
4577
- let count4 = 0;
4680
+ let count3 = 0;
4578
4681
  let sum2 = 0;
4579
4682
  leafRows.forEach((row) => {
4580
4683
  let value = row.getValue(columnId);
4581
4684
  if (value != null && (value = +value) >= value) {
4582
- ++count4, sum2 += value;
4685
+ ++count3, sum2 += value;
4583
4686
  }
4584
4687
  });
4585
- if (count4)
4586
- return sum2 / count4;
4688
+ if (count3)
4689
+ return sum2 / count3;
4587
4690
  return;
4588
4691
  };
4589
4692
  var median = (columnId, leafRows) => {
@@ -4607,7 +4710,7 @@ var unique = (columnId, leafRows) => {
4607
4710
  var uniqueCount = (columnId, leafRows) => {
4608
4711
  return new Set(leafRows.map((d) => d.getValue(columnId))).size;
4609
4712
  };
4610
- var count3 = (_columnId, leafRows) => {
4713
+ var count2 = (_columnId, leafRows) => {
4611
4714
  return leafRows.length;
4612
4715
  };
4613
4716
  var aggregationFns = {
@@ -4619,7 +4722,7 @@ var aggregationFns = {
4619
4722
  median,
4620
4723
  unique,
4621
4724
  uniqueCount,
4622
- count: count3
4725
+ count: count2
4623
4726
  };
4624
4727
  var ColumnGrouping = {
4625
4728
  getDefaultColumnDef: () => {
@@ -7150,10 +7253,14 @@ var SelectScrollDownButton = t__namespace.forwardRef(({ className, ...props }, r
7150
7253
  }
7151
7254
  ));
7152
7255
  SelectScrollDownButton.displayName = SelectPrimitive__namespace.ScrollDownButton.displayName;
7153
- var SelectContent = t__namespace.forwardRef(({ className, children, position = "item-aligned", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
7256
+ var SelectContent = t__namespace.forwardRef(({ className, children, position = "popper", side = "bottom", sideOffset = 4, align = "start", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(SelectPrimitive__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
7154
7257
  SelectPrimitive__namespace.Content,
7155
7258
  {
7156
7259
  ref,
7260
+ side,
7261
+ sideOffset,
7262
+ align,
7263
+ avoidCollisions: false,
7157
7264
  className: cn(
7158
7265
  [
7159
7266
  "relative z-50 max-h-96 min-w-[8rem] overflow-hidden",
@@ -7732,49 +7839,47 @@ function DataTable({
7732
7839
  title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg font-semibold", children: title }),
7733
7840
  description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground", children: description })
7734
7841
  ] }),
7735
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-4 md:flex-row md:items-center md:justify-between", children: [
7736
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 items-center gap-2", children: [
7737
- enableFiltering && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: customFilter || /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1 max-w-sm", children: [
7738
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
7739
- /* @__PURE__ */ jsxRuntime.jsx(
7740
- Input,
7741
- {
7742
- placeholder: filterPlaceholder,
7743
- value: filterColumn ? table.getColumn(filterColumn)?.getFilterValue() ?? "" : globalFilter,
7744
- onChange: (event) => {
7745
- const value = event.target.value;
7746
- if (filterColumn) {
7747
- table.getColumn(filterColumn)?.setFilterValue(value);
7748
- } else {
7749
- setGlobalFilter(value);
7750
- }
7751
- },
7752
- className: "pl-8"
7753
- }
7754
- ),
7755
- (filterColumn && table.getColumn(filterColumn)?.getFilterValue() || !filterColumn && globalFilter) && /* @__PURE__ */ jsxRuntime.jsx(
7756
- Button,
7757
- {
7758
- variant: "ghost",
7759
- size: "sm",
7760
- className: "absolute right-0 top-0 h-full px-2",
7761
- onClick: () => {
7762
- if (filterColumn) {
7763
- table.getColumn(filterColumn)?.setFilterValue("");
7764
- } else {
7765
- setGlobalFilter("");
7766
- }
7767
- },
7768
- children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
7769
- }
7770
- )
7771
- ] }) }),
7842
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-4", children: [
7843
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 max-w-sm", children: enableFiltering && /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: customFilter || /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
7844
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Search, { className: "absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" }),
7845
+ /* @__PURE__ */ jsxRuntime.jsx(
7846
+ Input,
7847
+ {
7848
+ placeholder: filterPlaceholder,
7849
+ value: filterColumn ? table.getColumn(filterColumn)?.getFilterValue() ?? "" : globalFilter,
7850
+ onChange: (event) => {
7851
+ const value = event.target.value;
7852
+ if (filterColumn) {
7853
+ table.getColumn(filterColumn)?.setFilterValue(value);
7854
+ } else {
7855
+ setGlobalFilter(value);
7856
+ }
7857
+ },
7858
+ className: "pl-8"
7859
+ }
7860
+ ),
7861
+ (filterColumn && table.getColumn(filterColumn)?.getFilterValue() || !filterColumn && globalFilter) && /* @__PURE__ */ jsxRuntime.jsx(
7862
+ Button,
7863
+ {
7864
+ variant: "ghost",
7865
+ size: "sm",
7866
+ className: "absolute right-0 top-0 h-full px-2",
7867
+ onClick: () => {
7868
+ if (filterColumn) {
7869
+ table.getColumn(filterColumn)?.setFilterValue("");
7870
+ } else {
7871
+ setGlobalFilter("");
7872
+ }
7873
+ },
7874
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-4 w-4" })
7875
+ }
7876
+ )
7877
+ ] }) }) }),
7878
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
7772
7879
  enableRowSelection && selectedRows.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(Badge, { variant: "secondary", className: "whitespace-nowrap", children: [
7773
7880
  selectedRows.length,
7774
7881
  " selected"
7775
- ] })
7776
- ] }),
7777
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
7882
+ ] }),
7778
7883
  toolbarActions,
7779
7884
  enableExport && onExport && /* @__PURE__ */ jsxRuntime.jsxs(
7780
7885
  Button,
@@ -8093,7 +8198,7 @@ function Calendar({
8093
8198
  };
8094
8199
  const days = getDaysInMonth();
8095
8200
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("moonui-theme", "p-0", className), children: [
8096
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-6 py-4", children: [
8201
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between px-6 py-4 border-b border-border/50 dark:border-gray-700/50", children: [
8097
8202
  /* @__PURE__ */ jsxRuntime.jsx(
8098
8203
  "button",
8099
8204
  {
@@ -8171,6 +8276,11 @@ function Calendar({
8171
8276
  ] });
8172
8277
  }
8173
8278
  Calendar.displayName = "Calendar";
8279
+ var pageTransitions2 = {
8280
+ initial: { opacity: 0, x: 20 },
8281
+ animate: { opacity: 1, x: 0 },
8282
+ exit: { opacity: 0, x: -20 }
8283
+ };
8174
8284
  var datePickerVariants = classVarianceAuthority.cva(
8175
8285
  "w-full justify-start text-left font-normal",
8176
8286
  {
@@ -8229,9 +8339,10 @@ function DatePicker({
8229
8339
  setInternalDate(value);
8230
8340
  }, [value]);
8231
8341
  const handleSelect = (date) => {
8232
- setInternalDate(date);
8233
- onChange?.(date);
8234
- if (date) {
8342
+ const singleDate = Array.isArray(date) ? date[0] : date && typeof date === "object" && "from" in date ? date.from : date;
8343
+ setInternalDate(singleDate);
8344
+ onChange?.(singleDate);
8345
+ if (singleDate) {
8235
8346
  setOpen(false);
8236
8347
  }
8237
8348
  };
@@ -8333,13 +8444,13 @@ function DatePicker({
8333
8444
  /* @__PURE__ */ jsxRuntime.jsx(
8334
8445
  PopoverContent,
8335
8446
  {
8336
- className: "w-[360px] p-0 shadow-xl rounded-2xl border-0 bg-background/95 backdrop-blur-sm",
8447
+ className: "w-[360px] p-0 shadow-2xl rounded-2xl border border-gray-200 dark:border-gray-700 bg-background/95 backdrop-blur-sm z-[1000]",
8337
8448
  align: "start",
8338
8449
  sideOffset: 12,
8339
8450
  children: /* @__PURE__ */ jsxRuntime.jsxs(
8340
8451
  framerMotion.motion.div,
8341
8452
  {
8342
- ...pageTransitions.fadeIn,
8453
+ ...pageTransitions2,
8343
8454
  className: "rounded-2xl bg-background overflow-hidden",
8344
8455
  children: [
8345
8456
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -8424,7 +8535,7 @@ function DateRangePicker({
8424
8535
  ]
8425
8536
  }
8426
8537
  ) }),
8427
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0 shadow-xl rounded-2xl border-0 bg-background/95 backdrop-blur-sm", align: "start", sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
8538
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-auto p-0 shadow-2xl rounded-2xl border border-gray-200 dark:border-gray-700 bg-background/95 backdrop-blur-sm z-[1000]", align: "start", sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsx(
8428
8539
  Calendar,
8429
8540
  {
8430
8541
  mode: "range",
@@ -8582,7 +8693,7 @@ function MonthPicker({
8582
8693
  ]
8583
8694
  }
8584
8695
  ) }),
8585
- /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3", children: [
8696
+ /* @__PURE__ */ jsxRuntime.jsx(PopoverContent, { className: "w-64 p-0 shadow-2xl border border-gray-200 dark:border-gray-700 bg-background z-[1000]", align: "start", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "p-3", children: [
8586
8697
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between mb-3", children: [
8587
8698
  /* @__PURE__ */ jsxRuntime.jsx(
8588
8699
  Button,
@@ -9361,59 +9472,193 @@ function GitHubStarButton({
9361
9472
  }
9362
9473
  );
9363
9474
  }
9364
- function MoonLogo({
9475
+ function LockedComponent({
9476
+ children,
9477
+ componentName,
9365
9478
  className,
9366
- variant = "default",
9367
- showText = true,
9368
- ...props
9479
+ showPreview = true,
9480
+ previewDuration = 2e3
9369
9481
  }) {
9370
- const logoId = t__namespace.useId();
9371
- const gradientId = `moon-gradient-${logoId}`;
9372
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("moonui-theme", "flex items-center gap-2", className), children: [
9373
- /* @__PURE__ */ jsxRuntime.jsxs(
9374
- "svg",
9375
- {
9376
- width: "32",
9377
- height: "32",
9378
- viewBox: "0 0 32 32",
9379
- fill: "none",
9380
- xmlns: "http://www.w3.org/2000/svg",
9381
- className: "flex-shrink-0",
9382
- ...props,
9383
- children: [
9384
- variant === "gradient" && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
9385
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: "#3B82F6" }),
9386
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "50%", stopColor: "#8B5CF6" }),
9387
- /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: "#EC4899" })
9388
- ] }) }),
9389
- /* @__PURE__ */ jsxRuntime.jsx(
9390
- "circle",
9391
- {
9392
- cx: "16",
9393
- cy: "16",
9394
- r: "14",
9395
- fill: variant === "gradient" ? `url(#${gradientId})` : "currentColor",
9396
- className: variant === "default" ? "fill-primary" : ""
9397
- }
9398
- ),
9399
- /* @__PURE__ */ jsxRuntime.jsx(
9400
- "circle",
9401
- {
9402
- cx: "22",
9403
- cy: "10",
9404
- r: "10",
9405
- fill: "white",
9406
- className: "dark:fill-background"
9407
- }
9408
- )
9409
- ]
9410
- }
9411
- ),
9412
- showText && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xl font-bold", children: [
9413
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: "Moon" }),
9414
- /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: "UI" })
9415
- ] })
9416
- ] });
9482
+ const [isPreviewActive, setIsPreviewActive] = t.useState(false);
9483
+ const [previewTimeout, setPreviewTimeout] = t.useState(null);
9484
+ const handleMouseEnter = () => {
9485
+ if (!showPreview)
9486
+ return;
9487
+ setIsPreviewActive(true);
9488
+ if (previewTimeout) {
9489
+ clearTimeout(previewTimeout);
9490
+ }
9491
+ const timeout = setTimeout(() => {
9492
+ setIsPreviewActive(false);
9493
+ }, previewDuration);
9494
+ setPreviewTimeout(timeout);
9495
+ };
9496
+ const handleMouseLeave = () => {
9497
+ if (previewTimeout) {
9498
+ clearTimeout(previewTimeout);
9499
+ setPreviewTimeout(null);
9500
+ }
9501
+ setIsPreviewActive(false);
9502
+ };
9503
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9504
+ "div",
9505
+ {
9506
+ className: cn(
9507
+ "relative group cursor-pointer transition-all duration-300",
9508
+ className
9509
+ ),
9510
+ onMouseEnter: handleMouseEnter,
9511
+ onMouseLeave: handleMouseLeave,
9512
+ children: [
9513
+ /* @__PURE__ */ jsxRuntime.jsx(
9514
+ "div",
9515
+ {
9516
+ className: cn(
9517
+ "transition-all duration-300",
9518
+ !isPreviewActive && "blur-sm grayscale-[0.3] opacity-60"
9519
+ ),
9520
+ children
9521
+ }
9522
+ ),
9523
+ /* @__PURE__ */ jsxRuntime.jsx(
9524
+ "div",
9525
+ {
9526
+ className: cn(
9527
+ "absolute inset-0 bg-gradient-to-br from-amber-500/10 via-transparent to-purple-500/10",
9528
+ "border-2 border-dashed border-amber-400/30 rounded-lg",
9529
+ "flex items-center justify-center",
9530
+ "transition-all duration-300",
9531
+ isPreviewActive ? "opacity-0" : "opacity-100"
9532
+ ),
9533
+ children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center space-y-3 p-6", children: [
9534
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsxs(
9535
+ Badge,
9536
+ {
9537
+ variant: "secondary",
9538
+ className: "bg-gradient-to-r from-amber-500 to-orange-500 text-white border-0 px-3 py-1",
9539
+ children: [
9540
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Crown, { className: "w-3 h-3 mr-1" }),
9541
+ "PRO ONLY"
9542
+ ]
9543
+ }
9544
+ ) }),
9545
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "p-3 rounded-full bg-amber-100 dark:bg-amber-900/30", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Lock, { className: "w-6 h-6 text-amber-600 dark:text-amber-400" }) }) }),
9546
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-semibold text-gray-900 dark:text-gray-100", children: componentName }),
9547
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-gray-600 dark:text-gray-400 max-w-xs", children: "This premium component is available with Pro subscription" }),
9548
+ /* @__PURE__ */ jsxRuntime.jsxs(
9549
+ Button,
9550
+ {
9551
+ size: "sm",
9552
+ className: "bg-gradient-to-r from-amber-500 to-orange-500 hover:from-amber-600 hover:to-orange-600 border-0",
9553
+ onClick: () => {
9554
+ if (typeof window !== "undefined") {
9555
+ window.location.href = "/pricing";
9556
+ }
9557
+ },
9558
+ children: [
9559
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Zap, { className: "w-4 h-4 mr-2" }),
9560
+ "Upgrade to Pro"
9561
+ ]
9562
+ }
9563
+ )
9564
+ ] })
9565
+ }
9566
+ ),
9567
+ showPreview && !isPreviewActive && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity duration-200", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "bg-black/80 text-white text-xs px-2 py-1 rounded", children: "Hover to preview" }) })
9568
+ ]
9569
+ }
9570
+ );
9571
+ }
9572
+ function ProComponentWrapper({
9573
+ children,
9574
+ componentId,
9575
+ componentName,
9576
+ className,
9577
+ fallback
9578
+ }) {
9579
+ {
9580
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children });
9581
+ }
9582
+ }
9583
+ function ProBadge({ className }) {
9584
+ return /* @__PURE__ */ jsxRuntime.jsxs(
9585
+ Badge,
9586
+ {
9587
+ variant: "secondary",
9588
+ className: cn(
9589
+ "bg-gradient-to-r from-amber-500 to-orange-500 text-white border-0 text-xs",
9590
+ className
9591
+ ),
9592
+ children: [
9593
+ /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Crown, { className: "w-3 h-3 mr-1" }),
9594
+ "PRO"
9595
+ ]
9596
+ }
9597
+ );
9598
+ }
9599
+ function FreeBadge({ className }) {
9600
+ return /* @__PURE__ */ jsxRuntime.jsx(
9601
+ Badge,
9602
+ {
9603
+ variant: "outline",
9604
+ className: cn("border-green-500 text-green-600 dark:text-green-400 text-xs", className),
9605
+ children: "FREE"
9606
+ }
9607
+ );
9608
+ }
9609
+ function MoonLogo({
9610
+ className,
9611
+ variant = "default",
9612
+ showText = true,
9613
+ ...props
9614
+ }) {
9615
+ const logoId = t__namespace.useId();
9616
+ const gradientId = `moon-gradient-${logoId}`;
9617
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("moonui-theme", "flex items-center gap-2", className), children: [
9618
+ /* @__PURE__ */ jsxRuntime.jsxs(
9619
+ "svg",
9620
+ {
9621
+ width: "32",
9622
+ height: "32",
9623
+ viewBox: "0 0 32 32",
9624
+ fill: "none",
9625
+ xmlns: "http://www.w3.org/2000/svg",
9626
+ className: "flex-shrink-0",
9627
+ ...props,
9628
+ children: [
9629
+ variant === "gradient" && /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs("linearGradient", { id: gradientId, x1: "0%", y1: "0%", x2: "100%", y2: "100%", children: [
9630
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "0%", stopColor: "#3B82F6" }),
9631
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "50%", stopColor: "#8B5CF6" }),
9632
+ /* @__PURE__ */ jsxRuntime.jsx("stop", { offset: "100%", stopColor: "#EC4899" })
9633
+ ] }) }),
9634
+ /* @__PURE__ */ jsxRuntime.jsx(
9635
+ "circle",
9636
+ {
9637
+ cx: "16",
9638
+ cy: "16",
9639
+ r: "14",
9640
+ fill: variant === "gradient" ? `url(#${gradientId})` : "currentColor",
9641
+ className: variant === "default" ? "fill-primary" : ""
9642
+ }
9643
+ ),
9644
+ /* @__PURE__ */ jsxRuntime.jsx(
9645
+ "circle",
9646
+ {
9647
+ cx: "22",
9648
+ cy: "10",
9649
+ r: "10",
9650
+ fill: "white",
9651
+ className: "dark:fill-background"
9652
+ }
9653
+ )
9654
+ ]
9655
+ }
9656
+ ),
9657
+ showText && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xl font-bold", children: [
9658
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-foreground", children: "Moon" }),
9659
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-primary", children: "UI" })
9660
+ ] })
9661
+ ] });
9417
9662
  }
9418
9663
  function MoonLogoIcon({
9419
9664
  className,
@@ -9532,6 +9777,141 @@ var PaginationEllipsis = ({
9532
9777
  }
9533
9778
  );
9534
9779
  PaginationEllipsis.displayName = "PaginationEllipsis";
9780
+ var countryCodes = [
9781
+ { code: "+1", country: "US", flag: "\u{1F1FA}\u{1F1F8}", name: "United States" },
9782
+ { code: "+44", country: "GB", flag: "\u{1F1EC}\u{1F1E7}", name: "United Kingdom" },
9783
+ { code: "+49", country: "DE", flag: "\u{1F1E9}\u{1F1EA}", name: "Germany" },
9784
+ { code: "+33", country: "FR", flag: "\u{1F1EB}\u{1F1F7}", name: "France" },
9785
+ { code: "+39", country: "IT", flag: "\u{1F1EE}\u{1F1F9}", name: "Italy" },
9786
+ { code: "+34", country: "ES", flag: "\u{1F1EA}\u{1F1F8}", name: "Spain" },
9787
+ { code: "+31", country: "NL", flag: "\u{1F1F3}\u{1F1F1}", name: "Netherlands" },
9788
+ { code: "+46", country: "SE", flag: "\u{1F1F8}\u{1F1EA}", name: "Sweden" },
9789
+ { code: "+47", country: "NO", flag: "\u{1F1F3}\u{1F1F4}", name: "Norway" },
9790
+ { code: "+45", country: "DK", flag: "\u{1F1E9}\u{1F1F0}", name: "Denmark" },
9791
+ { code: "+358", country: "FI", flag: "\u{1F1EB}\u{1F1EE}", name: "Finland" },
9792
+ { code: "+48", country: "PL", flag: "\u{1F1F5}\u{1F1F1}", name: "Poland" },
9793
+ { code: "+90", country: "TR", flag: "\u{1F1F9}\u{1F1F7}", name: "Turkey" },
9794
+ { code: "+86", country: "CN", flag: "\u{1F1E8}\u{1F1F3}", name: "China" },
9795
+ { code: "+81", country: "JP", flag: "\u{1F1EF}\u{1F1F5}", name: "Japan" },
9796
+ { code: "+82", country: "KR", flag: "\u{1F1F0}\u{1F1F7}", name: "South Korea" },
9797
+ { code: "+91", country: "IN", flag: "\u{1F1EE}\u{1F1F3}", name: "India" },
9798
+ { code: "+61", country: "AU", flag: "\u{1F1E6}\u{1F1FA}", name: "Australia" },
9799
+ { code: "+64", country: "NZ", flag: "\u{1F1F3}\u{1F1FF}", name: "New Zealand" },
9800
+ { code: "+27", country: "ZA", flag: "\u{1F1FF}\u{1F1E6}", name: "South Africa" },
9801
+ { code: "+55", country: "BR", flag: "\u{1F1E7}\u{1F1F7}", name: "Brazil" },
9802
+ { code: "+52", country: "MX", flag: "\u{1F1F2}\u{1F1FD}", name: "Mexico" },
9803
+ { code: "+54", country: "AR", flag: "\u{1F1E6}\u{1F1F7}", name: "Argentina" },
9804
+ { code: "+20", country: "EG", flag: "\u{1F1EA}\u{1F1EC}", name: "Egypt" },
9805
+ { code: "+966", country: "SA", flag: "\u{1F1F8}\u{1F1E6}", name: "Saudi Arabia" },
9806
+ { code: "+971", country: "AE", flag: "\u{1F1E6}\u{1F1EA}", name: "UAE" }
9807
+ ];
9808
+ var formatPhoneNumber = (value, countryCode) => {
9809
+ const cleaned = value.replace(/\D/g, "");
9810
+ switch (countryCode) {
9811
+ case "+1":
9812
+ if (cleaned.length <= 3)
9813
+ return cleaned;
9814
+ if (cleaned.length <= 6)
9815
+ return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
9816
+ return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)}-${cleaned.slice(6, 10)}`;
9817
+ case "+44":
9818
+ if (cleaned.length <= 4)
9819
+ return cleaned;
9820
+ if (cleaned.length <= 7)
9821
+ return `${cleaned.slice(0, 4)} ${cleaned.slice(4)}`;
9822
+ return `${cleaned.slice(0, 4)} ${cleaned.slice(4, 7)} ${cleaned.slice(7, 11)}`;
9823
+ case "+90":
9824
+ if (cleaned.length <= 3)
9825
+ return cleaned;
9826
+ if (cleaned.length <= 6)
9827
+ return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
9828
+ if (cleaned.length <= 9)
9829
+ return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6)}`;
9830
+ return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8, 10)}`;
9831
+ default:
9832
+ let formatted = "";
9833
+ for (let i = 0; i < cleaned.length; i++) {
9834
+ if (i > 0 && i % 3 === 0)
9835
+ formatted += " ";
9836
+ formatted += cleaned[i];
9837
+ }
9838
+ return formatted;
9839
+ }
9840
+ };
9841
+ var getMaxLength = (countryCode) => {
9842
+ switch (countryCode) {
9843
+ case "+1":
9844
+ return 10;
9845
+ case "+44":
9846
+ return 11;
9847
+ case "+90":
9848
+ return 10;
9849
+ default:
9850
+ return 15;
9851
+ }
9852
+ };
9853
+ var PhoneInput = t__namespace.forwardRef(
9854
+ ({
9855
+ className,
9856
+ value = "",
9857
+ onChange,
9858
+ defaultCountry = "+1",
9859
+ showIcon = true,
9860
+ showCountrySelect = true,
9861
+ countries = countryCodes,
9862
+ size,
9863
+ ...props
9864
+ }, ref) => {
9865
+ const [countryCode, setCountryCode] = t__namespace.useState(defaultCountry);
9866
+ const [phoneNumber, setPhoneNumber] = t__namespace.useState(value);
9867
+ const selectedCountry = countries.find((c) => c.code === countryCode) || countries[0];
9868
+ const handlePhoneChange = (e) => {
9869
+ const rawValue = e.target.value.replace(/\D/g, "");
9870
+ const maxLength = getMaxLength(countryCode);
9871
+ const truncated = rawValue.slice(0, maxLength);
9872
+ const formatted = formatPhoneNumber(truncated, countryCode);
9873
+ setPhoneNumber(truncated);
9874
+ onChange?.(truncated, countryCode);
9875
+ e.target.value = formatted;
9876
+ };
9877
+ const handleCountryChange = (newCountryCode) => {
9878
+ setCountryCode(newCountryCode);
9879
+ onChange?.(phoneNumber, newCountryCode);
9880
+ };
9881
+ const formattedValue = formatPhoneNumber(phoneNumber, countryCode);
9882
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative flex gap-2", className), children: [
9883
+ showCountrySelect && /* @__PURE__ */ jsxRuntime.jsxs(Select, { value: countryCode, onValueChange: handleCountryChange, children: [
9884
+ /* @__PURE__ */ jsxRuntime.jsx(SelectTrigger, { className: "w-[120px]", children: /* @__PURE__ */ jsxRuntime.jsx(SelectValue, { children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
9885
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: selectedCountry.flag }),
9886
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: selectedCountry.code })
9887
+ ] }) }) }),
9888
+ /* @__PURE__ */ jsxRuntime.jsx(SelectContent, { children: countries.map((country) => /* @__PURE__ */ jsxRuntime.jsx(SelectItem, { value: country.code, children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
9889
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: country.flag }),
9890
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: country.code }),
9891
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: country.name })
9892
+ ] }) }, country.code)) })
9893
+ ] }),
9894
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative flex-1", children: [
9895
+ /* @__PURE__ */ jsxRuntime.jsx(
9896
+ Input,
9897
+ {
9898
+ ref,
9899
+ type: "tel",
9900
+ inputMode: "numeric",
9901
+ autoComplete: "tel",
9902
+ placeholder: countryCode === "+1" ? "(555) 123-4567" : "123 456 789",
9903
+ value: formattedValue,
9904
+ onChange: handlePhoneChange,
9905
+ className: cn(showIcon && "pl-10", className),
9906
+ ...props
9907
+ }
9908
+ ),
9909
+ showIcon && /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Phone, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" })
9910
+ ] })
9911
+ ] });
9912
+ }
9913
+ );
9914
+ PhoneInput.displayName = "PhoneInput";
9535
9915
  var radioGroupItemVariants = classVarianceAuthority.cva(
9536
9916
  "aspect-square border focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
9537
9917
  {
@@ -9721,6 +10101,767 @@ function RichTextEditor({
9721
10101
  )
9722
10102
  ] });
9723
10103
  }
10104
+ function useCallbackRef(callback) {
10105
+ const callbackRef = t__namespace.useRef(callback);
10106
+ t__namespace.useEffect(() => {
10107
+ callbackRef.current = callback;
10108
+ });
10109
+ return t__namespace.useMemo(() => (...args) => callbackRef.current?.(...args), []);
10110
+ }
10111
+ var DirectionContext = t__namespace.createContext(void 0);
10112
+ function useDirection(localDir) {
10113
+ const globalDir = t__namespace.useContext(DirectionContext);
10114
+ return localDir || globalDir || "ltr";
10115
+ }
10116
+
10117
+ // ../../node_modules/@radix-ui/number/dist/index.mjs
10118
+ function clamp(value, [min2, max2]) {
10119
+ return Math.min(max2, Math.max(min2, value));
10120
+ }
10121
+ function useStateMachine2(initialState, machine) {
10122
+ return t__namespace.useReducer((state, event) => {
10123
+ const nextState = machine[state][event];
10124
+ return nextState ?? state;
10125
+ }, initialState);
10126
+ }
10127
+ var SCROLL_AREA_NAME = "ScrollArea";
10128
+ var [createScrollAreaContext, createScrollAreaScope] = createContextScope(SCROLL_AREA_NAME);
10129
+ var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
10130
+ var ScrollArea = t__namespace.forwardRef(
10131
+ (props, forwardedRef) => {
10132
+ const {
10133
+ __scopeScrollArea,
10134
+ type = "hover",
10135
+ dir,
10136
+ scrollHideDelay = 600,
10137
+ ...scrollAreaProps
10138
+ } = props;
10139
+ const [scrollArea, setScrollArea] = t__namespace.useState(null);
10140
+ const [viewport, setViewport] = t__namespace.useState(null);
10141
+ const [content, setContent] = t__namespace.useState(null);
10142
+ const [scrollbarX, setScrollbarX] = t__namespace.useState(null);
10143
+ const [scrollbarY, setScrollbarY] = t__namespace.useState(null);
10144
+ const [cornerWidth, setCornerWidth] = t__namespace.useState(0);
10145
+ const [cornerHeight, setCornerHeight] = t__namespace.useState(0);
10146
+ const [scrollbarXEnabled, setScrollbarXEnabled] = t__namespace.useState(false);
10147
+ const [scrollbarYEnabled, setScrollbarYEnabled] = t__namespace.useState(false);
10148
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setScrollArea(node));
10149
+ const direction = useDirection(dir);
10150
+ return /* @__PURE__ */ jsxRuntime.jsx(
10151
+ ScrollAreaProvider,
10152
+ {
10153
+ scope: __scopeScrollArea,
10154
+ type,
10155
+ dir: direction,
10156
+ scrollHideDelay,
10157
+ scrollArea,
10158
+ viewport,
10159
+ onViewportChange: setViewport,
10160
+ content,
10161
+ onContentChange: setContent,
10162
+ scrollbarX,
10163
+ onScrollbarXChange: setScrollbarX,
10164
+ scrollbarXEnabled,
10165
+ onScrollbarXEnabledChange: setScrollbarXEnabled,
10166
+ scrollbarY,
10167
+ onScrollbarYChange: setScrollbarY,
10168
+ scrollbarYEnabled,
10169
+ onScrollbarYEnabledChange: setScrollbarYEnabled,
10170
+ onCornerWidthChange: setCornerWidth,
10171
+ onCornerHeightChange: setCornerHeight,
10172
+ children: /* @__PURE__ */ jsxRuntime.jsx(
10173
+ Primitive.div,
10174
+ {
10175
+ dir: direction,
10176
+ ...scrollAreaProps,
10177
+ ref: composedRefs,
10178
+ style: {
10179
+ position: "relative",
10180
+ // Pass corner sizes as CSS vars to reduce re-renders of context consumers
10181
+ ["--radix-scroll-area-corner-width"]: cornerWidth + "px",
10182
+ ["--radix-scroll-area-corner-height"]: cornerHeight + "px",
10183
+ ...props.style
10184
+ }
10185
+ }
10186
+ )
10187
+ }
10188
+ );
10189
+ }
10190
+ );
10191
+ ScrollArea.displayName = SCROLL_AREA_NAME;
10192
+ var VIEWPORT_NAME = "ScrollAreaViewport";
10193
+ var ScrollAreaViewport = t__namespace.forwardRef(
10194
+ (props, forwardedRef) => {
10195
+ const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
10196
+ const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
10197
+ const ref = t__namespace.useRef(null);
10198
+ const composedRefs = useComposedRefs(forwardedRef, ref, context.onViewportChange);
10199
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10200
+ /* @__PURE__ */ jsxRuntime.jsx(
10201
+ "style",
10202
+ {
10203
+ dangerouslySetInnerHTML: {
10204
+ __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`
10205
+ },
10206
+ nonce
10207
+ }
10208
+ ),
10209
+ /* @__PURE__ */ jsxRuntime.jsx(
10210
+ Primitive.div,
10211
+ {
10212
+ "data-radix-scroll-area-viewport": "",
10213
+ ...viewportProps,
10214
+ ref: composedRefs,
10215
+ style: {
10216
+ /**
10217
+ * We don't support `visible` because the intention is to have at least one scrollbar
10218
+ * if this component is used and `visible` will behave like `auto` in that case
10219
+ * https://developer.mozilla.org/en-US/docs/Web/CSS/overflow#description
10220
+ *
10221
+ * We don't handle `auto` because the intention is for the native implementation
10222
+ * to be hidden if using this component. We just want to ensure the node is scrollable
10223
+ * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent
10224
+ * the browser from having to work out whether to render native scrollbars or not,
10225
+ * we tell it to with the intention of hiding them in CSS.
10226
+ */
10227
+ overflowX: context.scrollbarXEnabled ? "scroll" : "hidden",
10228
+ overflowY: context.scrollbarYEnabled ? "scroll" : "hidden",
10229
+ ...props.style
10230
+ },
10231
+ children: /* @__PURE__ */ jsxRuntime.jsx("div", { ref: context.onContentChange, style: { minWidth: "100%", display: "table" }, children })
10232
+ }
10233
+ )
10234
+ ] });
10235
+ }
10236
+ );
10237
+ ScrollAreaViewport.displayName = VIEWPORT_NAME;
10238
+ var SCROLLBAR_NAME = "ScrollAreaScrollbar";
10239
+ var ScrollAreaScrollbar = t__namespace.forwardRef(
10240
+ (props, forwardedRef) => {
10241
+ const { forceMount, ...scrollbarProps } = props;
10242
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10243
+ const { onScrollbarXEnabledChange, onScrollbarYEnabledChange } = context;
10244
+ const isHorizontal = props.orientation === "horizontal";
10245
+ t__namespace.useEffect(() => {
10246
+ isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);
10247
+ return () => {
10248
+ isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);
10249
+ };
10250
+ }, [isHorizontal, onScrollbarXEnabledChange, onScrollbarYEnabledChange]);
10251
+ return context.type === "hover" ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaScrollbarHover, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "scroll" ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaScrollbarScroll, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "auto" ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaScrollbarAuto, { ...scrollbarProps, ref: forwardedRef, forceMount }) : context.type === "always" ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaScrollbarVisible, { ...scrollbarProps, ref: forwardedRef }) : null;
10252
+ }
10253
+ );
10254
+ ScrollAreaScrollbar.displayName = SCROLLBAR_NAME;
10255
+ var ScrollAreaScrollbarHover = t__namespace.forwardRef((props, forwardedRef) => {
10256
+ const { forceMount, ...scrollbarProps } = props;
10257
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10258
+ const [visible, setVisible] = t__namespace.useState(false);
10259
+ t__namespace.useEffect(() => {
10260
+ const scrollArea = context.scrollArea;
10261
+ let hideTimer = 0;
10262
+ if (scrollArea) {
10263
+ const handlePointerEnter = () => {
10264
+ window.clearTimeout(hideTimer);
10265
+ setVisible(true);
10266
+ };
10267
+ const handlePointerLeave = () => {
10268
+ hideTimer = window.setTimeout(() => setVisible(false), context.scrollHideDelay);
10269
+ };
10270
+ scrollArea.addEventListener("pointerenter", handlePointerEnter);
10271
+ scrollArea.addEventListener("pointerleave", handlePointerLeave);
10272
+ return () => {
10273
+ window.clearTimeout(hideTimer);
10274
+ scrollArea.removeEventListener("pointerenter", handlePointerEnter);
10275
+ scrollArea.removeEventListener("pointerleave", handlePointerLeave);
10276
+ };
10277
+ }
10278
+ }, [context.scrollArea, context.scrollHideDelay]);
10279
+ return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
10280
+ ScrollAreaScrollbarAuto,
10281
+ {
10282
+ "data-state": visible ? "visible" : "hidden",
10283
+ ...scrollbarProps,
10284
+ ref: forwardedRef
10285
+ }
10286
+ ) });
10287
+ });
10288
+ var ScrollAreaScrollbarScroll = t__namespace.forwardRef((props, forwardedRef) => {
10289
+ const { forceMount, ...scrollbarProps } = props;
10290
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10291
+ const isHorizontal = props.orientation === "horizontal";
10292
+ const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
10293
+ const [state, send] = useStateMachine2("hidden", {
10294
+ hidden: {
10295
+ SCROLL: "scrolling"
10296
+ },
10297
+ scrolling: {
10298
+ SCROLL_END: "idle",
10299
+ POINTER_ENTER: "interacting"
10300
+ },
10301
+ interacting: {
10302
+ SCROLL: "interacting",
10303
+ POINTER_LEAVE: "idle"
10304
+ },
10305
+ idle: {
10306
+ HIDE: "hidden",
10307
+ SCROLL: "scrolling",
10308
+ POINTER_ENTER: "interacting"
10309
+ }
10310
+ });
10311
+ t__namespace.useEffect(() => {
10312
+ if (state === "idle") {
10313
+ const hideTimer = window.setTimeout(() => send("HIDE"), context.scrollHideDelay);
10314
+ return () => window.clearTimeout(hideTimer);
10315
+ }
10316
+ }, [state, context.scrollHideDelay, send]);
10317
+ t__namespace.useEffect(() => {
10318
+ const viewport = context.viewport;
10319
+ const scrollDirection = isHorizontal ? "scrollLeft" : "scrollTop";
10320
+ if (viewport) {
10321
+ let prevScrollPos = viewport[scrollDirection];
10322
+ const handleScroll = () => {
10323
+ const scrollPos = viewport[scrollDirection];
10324
+ const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;
10325
+ if (hasScrollInDirectionChanged) {
10326
+ send("SCROLL");
10327
+ debounceScrollEnd();
10328
+ }
10329
+ prevScrollPos = scrollPos;
10330
+ };
10331
+ viewport.addEventListener("scroll", handleScroll);
10332
+ return () => viewport.removeEventListener("scroll", handleScroll);
10333
+ }
10334
+ }, [context.viewport, isHorizontal, send, debounceScrollEnd]);
10335
+ return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
10336
+ ScrollAreaScrollbarVisible,
10337
+ {
10338
+ "data-state": state === "hidden" ? "hidden" : "visible",
10339
+ ...scrollbarProps,
10340
+ ref: forwardedRef,
10341
+ onPointerEnter: composeEventHandlers(props.onPointerEnter, () => send("POINTER_ENTER")),
10342
+ onPointerLeave: composeEventHandlers(props.onPointerLeave, () => send("POINTER_LEAVE"))
10343
+ }
10344
+ ) });
10345
+ });
10346
+ var ScrollAreaScrollbarAuto = t__namespace.forwardRef((props, forwardedRef) => {
10347
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10348
+ const { forceMount, ...scrollbarProps } = props;
10349
+ const [visible, setVisible] = t__namespace.useState(false);
10350
+ const isHorizontal = props.orientation === "horizontal";
10351
+ const handleResize = useDebounceCallback(() => {
10352
+ if (context.viewport) {
10353
+ const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;
10354
+ const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;
10355
+ setVisible(isHorizontal ? isOverflowX : isOverflowY);
10356
+ }
10357
+ }, 10);
10358
+ useResizeObserver(context.viewport, handleResize);
10359
+ useResizeObserver(context.content, handleResize);
10360
+ return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
10361
+ ScrollAreaScrollbarVisible,
10362
+ {
10363
+ "data-state": visible ? "visible" : "hidden",
10364
+ ...scrollbarProps,
10365
+ ref: forwardedRef
10366
+ }
10367
+ ) });
10368
+ });
10369
+ var ScrollAreaScrollbarVisible = t__namespace.forwardRef((props, forwardedRef) => {
10370
+ const { orientation = "vertical", ...scrollbarProps } = props;
10371
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10372
+ const thumbRef = t__namespace.useRef(null);
10373
+ const pointerOffsetRef = t__namespace.useRef(0);
10374
+ const [sizes, setSizes] = t__namespace.useState({
10375
+ content: 0,
10376
+ viewport: 0,
10377
+ scrollbar: { size: 0, paddingStart: 0, paddingEnd: 0 }
10378
+ });
10379
+ const thumbRatio = getThumbRatio(sizes.viewport, sizes.content);
10380
+ const commonProps = {
10381
+ ...scrollbarProps,
10382
+ sizes,
10383
+ onSizesChange: setSizes,
10384
+ hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),
10385
+ onThumbChange: (thumb) => thumbRef.current = thumb,
10386
+ onThumbPointerUp: () => pointerOffsetRef.current = 0,
10387
+ onThumbPointerDown: (pointerPos) => pointerOffsetRef.current = pointerPos
10388
+ };
10389
+ function getScrollPosition(pointerPos, dir) {
10390
+ return getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);
10391
+ }
10392
+ if (orientation === "horizontal") {
10393
+ return /* @__PURE__ */ jsxRuntime.jsx(
10394
+ ScrollAreaScrollbarX,
10395
+ {
10396
+ ...commonProps,
10397
+ ref: forwardedRef,
10398
+ onThumbPositionChange: () => {
10399
+ if (context.viewport && thumbRef.current) {
10400
+ const scrollPos = context.viewport.scrollLeft;
10401
+ const offset = getThumbOffsetFromScroll(scrollPos, sizes, context.dir);
10402
+ thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;
10403
+ }
10404
+ },
10405
+ onWheelScroll: (scrollPos) => {
10406
+ if (context.viewport)
10407
+ context.viewport.scrollLeft = scrollPos;
10408
+ },
10409
+ onDragScroll: (pointerPos) => {
10410
+ if (context.viewport) {
10411
+ context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);
10412
+ }
10413
+ }
10414
+ }
10415
+ );
10416
+ }
10417
+ if (orientation === "vertical") {
10418
+ return /* @__PURE__ */ jsxRuntime.jsx(
10419
+ ScrollAreaScrollbarY,
10420
+ {
10421
+ ...commonProps,
10422
+ ref: forwardedRef,
10423
+ onThumbPositionChange: () => {
10424
+ if (context.viewport && thumbRef.current) {
10425
+ const scrollPos = context.viewport.scrollTop;
10426
+ const offset = getThumbOffsetFromScroll(scrollPos, sizes);
10427
+ thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;
10428
+ }
10429
+ },
10430
+ onWheelScroll: (scrollPos) => {
10431
+ if (context.viewport)
10432
+ context.viewport.scrollTop = scrollPos;
10433
+ },
10434
+ onDragScroll: (pointerPos) => {
10435
+ if (context.viewport)
10436
+ context.viewport.scrollTop = getScrollPosition(pointerPos);
10437
+ }
10438
+ }
10439
+ );
10440
+ }
10441
+ return null;
10442
+ });
10443
+ var ScrollAreaScrollbarX = t__namespace.forwardRef((props, forwardedRef) => {
10444
+ const { sizes, onSizesChange, ...scrollbarProps } = props;
10445
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10446
+ const [computedStyle, setComputedStyle] = t__namespace.useState();
10447
+ const ref = t__namespace.useRef(null);
10448
+ const composeRefs2 = useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);
10449
+ t__namespace.useEffect(() => {
10450
+ if (ref.current)
10451
+ setComputedStyle(getComputedStyle(ref.current));
10452
+ }, [ref]);
10453
+ return /* @__PURE__ */ jsxRuntime.jsx(
10454
+ ScrollAreaScrollbarImpl,
10455
+ {
10456
+ "data-orientation": "horizontal",
10457
+ ...scrollbarProps,
10458
+ ref: composeRefs2,
10459
+ sizes,
10460
+ style: {
10461
+ bottom: 0,
10462
+ left: context.dir === "rtl" ? "var(--radix-scroll-area-corner-width)" : 0,
10463
+ right: context.dir === "ltr" ? "var(--radix-scroll-area-corner-width)" : 0,
10464
+ ["--radix-scroll-area-thumb-width"]: getThumbSize(sizes) + "px",
10465
+ ...props.style
10466
+ },
10467
+ onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.x),
10468
+ onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.x),
10469
+ onWheelScroll: (event, maxScrollPos) => {
10470
+ if (context.viewport) {
10471
+ const scrollPos = context.viewport.scrollLeft + event.deltaX;
10472
+ props.onWheelScroll(scrollPos);
10473
+ if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
10474
+ event.preventDefault();
10475
+ }
10476
+ }
10477
+ },
10478
+ onResize: () => {
10479
+ if (ref.current && context.viewport && computedStyle) {
10480
+ onSizesChange({
10481
+ content: context.viewport.scrollWidth,
10482
+ viewport: context.viewport.offsetWidth,
10483
+ scrollbar: {
10484
+ size: ref.current.clientWidth,
10485
+ paddingStart: toInt(computedStyle.paddingLeft),
10486
+ paddingEnd: toInt(computedStyle.paddingRight)
10487
+ }
10488
+ });
10489
+ }
10490
+ }
10491
+ }
10492
+ );
10493
+ });
10494
+ var ScrollAreaScrollbarY = t__namespace.forwardRef((props, forwardedRef) => {
10495
+ const { sizes, onSizesChange, ...scrollbarProps } = props;
10496
+ const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
10497
+ const [computedStyle, setComputedStyle] = t__namespace.useState();
10498
+ const ref = t__namespace.useRef(null);
10499
+ const composeRefs2 = useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);
10500
+ t__namespace.useEffect(() => {
10501
+ if (ref.current)
10502
+ setComputedStyle(getComputedStyle(ref.current));
10503
+ }, [ref]);
10504
+ return /* @__PURE__ */ jsxRuntime.jsx(
10505
+ ScrollAreaScrollbarImpl,
10506
+ {
10507
+ "data-orientation": "vertical",
10508
+ ...scrollbarProps,
10509
+ ref: composeRefs2,
10510
+ sizes,
10511
+ style: {
10512
+ top: 0,
10513
+ right: context.dir === "ltr" ? 0 : void 0,
10514
+ left: context.dir === "rtl" ? 0 : void 0,
10515
+ bottom: "var(--radix-scroll-area-corner-height)",
10516
+ ["--radix-scroll-area-thumb-height"]: getThumbSize(sizes) + "px",
10517
+ ...props.style
10518
+ },
10519
+ onThumbPointerDown: (pointerPos) => props.onThumbPointerDown(pointerPos.y),
10520
+ onDragScroll: (pointerPos) => props.onDragScroll(pointerPos.y),
10521
+ onWheelScroll: (event, maxScrollPos) => {
10522
+ if (context.viewport) {
10523
+ const scrollPos = context.viewport.scrollTop + event.deltaY;
10524
+ props.onWheelScroll(scrollPos);
10525
+ if (isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) {
10526
+ event.preventDefault();
10527
+ }
10528
+ }
10529
+ },
10530
+ onResize: () => {
10531
+ if (ref.current && context.viewport && computedStyle) {
10532
+ onSizesChange({
10533
+ content: context.viewport.scrollHeight,
10534
+ viewport: context.viewport.offsetHeight,
10535
+ scrollbar: {
10536
+ size: ref.current.clientHeight,
10537
+ paddingStart: toInt(computedStyle.paddingTop),
10538
+ paddingEnd: toInt(computedStyle.paddingBottom)
10539
+ }
10540
+ });
10541
+ }
10542
+ }
10543
+ }
10544
+ );
10545
+ });
10546
+ var [ScrollbarProvider, useScrollbarContext] = createScrollAreaContext(SCROLLBAR_NAME);
10547
+ var ScrollAreaScrollbarImpl = t__namespace.forwardRef((props, forwardedRef) => {
10548
+ const {
10549
+ __scopeScrollArea,
10550
+ sizes,
10551
+ hasThumb,
10552
+ onThumbChange,
10553
+ onThumbPointerUp,
10554
+ onThumbPointerDown,
10555
+ onThumbPositionChange,
10556
+ onDragScroll,
10557
+ onWheelScroll,
10558
+ onResize,
10559
+ ...scrollbarProps
10560
+ } = props;
10561
+ const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
10562
+ const [scrollbar, setScrollbar] = t__namespace.useState(null);
10563
+ const composeRefs2 = useComposedRefs(forwardedRef, (node) => setScrollbar(node));
10564
+ const rectRef = t__namespace.useRef(null);
10565
+ const prevWebkitUserSelectRef = t__namespace.useRef("");
10566
+ const viewport = context.viewport;
10567
+ const maxScrollPos = sizes.content - sizes.viewport;
10568
+ const handleWheelScroll = useCallbackRef(onWheelScroll);
10569
+ const handleThumbPositionChange = useCallbackRef(onThumbPositionChange);
10570
+ const handleResize = useDebounceCallback(onResize, 10);
10571
+ function handleDragScroll(event) {
10572
+ if (rectRef.current) {
10573
+ const x = event.clientX - rectRef.current.left;
10574
+ const y = event.clientY - rectRef.current.top;
10575
+ onDragScroll({ x, y });
10576
+ }
10577
+ }
10578
+ t__namespace.useEffect(() => {
10579
+ const handleWheel = (event) => {
10580
+ const element = event.target;
10581
+ const isScrollbarWheel = scrollbar?.contains(element);
10582
+ if (isScrollbarWheel)
10583
+ handleWheelScroll(event, maxScrollPos);
10584
+ };
10585
+ document.addEventListener("wheel", handleWheel, { passive: false });
10586
+ return () => document.removeEventListener("wheel", handleWheel, { passive: false });
10587
+ }, [viewport, scrollbar, maxScrollPos, handleWheelScroll]);
10588
+ t__namespace.useEffect(handleThumbPositionChange, [sizes, handleThumbPositionChange]);
10589
+ useResizeObserver(scrollbar, handleResize);
10590
+ useResizeObserver(context.content, handleResize);
10591
+ return /* @__PURE__ */ jsxRuntime.jsx(
10592
+ ScrollbarProvider,
10593
+ {
10594
+ scope: __scopeScrollArea,
10595
+ scrollbar,
10596
+ hasThumb,
10597
+ onThumbChange: useCallbackRef(onThumbChange),
10598
+ onThumbPointerUp: useCallbackRef(onThumbPointerUp),
10599
+ onThumbPositionChange: handleThumbPositionChange,
10600
+ onThumbPointerDown: useCallbackRef(onThumbPointerDown),
10601
+ children: /* @__PURE__ */ jsxRuntime.jsx(
10602
+ Primitive.div,
10603
+ {
10604
+ ...scrollbarProps,
10605
+ ref: composeRefs2,
10606
+ style: { position: "absolute", ...scrollbarProps.style },
10607
+ onPointerDown: composeEventHandlers(props.onPointerDown, (event) => {
10608
+ const mainPointer = 0;
10609
+ if (event.button === mainPointer) {
10610
+ const element = event.target;
10611
+ element.setPointerCapture(event.pointerId);
10612
+ rectRef.current = scrollbar.getBoundingClientRect();
10613
+ prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;
10614
+ document.body.style.webkitUserSelect = "none";
10615
+ if (context.viewport)
10616
+ context.viewport.style.scrollBehavior = "auto";
10617
+ handleDragScroll(event);
10618
+ }
10619
+ }),
10620
+ onPointerMove: composeEventHandlers(props.onPointerMove, handleDragScroll),
10621
+ onPointerUp: composeEventHandlers(props.onPointerUp, (event) => {
10622
+ const element = event.target;
10623
+ if (element.hasPointerCapture(event.pointerId)) {
10624
+ element.releasePointerCapture(event.pointerId);
10625
+ }
10626
+ document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;
10627
+ if (context.viewport)
10628
+ context.viewport.style.scrollBehavior = "";
10629
+ rectRef.current = null;
10630
+ })
10631
+ }
10632
+ )
10633
+ }
10634
+ );
10635
+ });
10636
+ var THUMB_NAME = "ScrollAreaThumb";
10637
+ var ScrollAreaThumb = t__namespace.forwardRef(
10638
+ (props, forwardedRef) => {
10639
+ const { forceMount, ...thumbProps } = props;
10640
+ const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
10641
+ return /* @__PURE__ */ jsxRuntime.jsx(Presence, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) });
10642
+ }
10643
+ );
10644
+ var ScrollAreaThumbImpl = t__namespace.forwardRef(
10645
+ (props, forwardedRef) => {
10646
+ const { __scopeScrollArea, style, ...thumbProps } = props;
10647
+ const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
10648
+ const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
10649
+ const { onThumbPositionChange } = scrollbarContext;
10650
+ const composedRef = useComposedRefs(
10651
+ forwardedRef,
10652
+ (node) => scrollbarContext.onThumbChange(node)
10653
+ );
10654
+ const removeUnlinkedScrollListenerRef = t__namespace.useRef(void 0);
10655
+ const debounceScrollEnd = useDebounceCallback(() => {
10656
+ if (removeUnlinkedScrollListenerRef.current) {
10657
+ removeUnlinkedScrollListenerRef.current();
10658
+ removeUnlinkedScrollListenerRef.current = void 0;
10659
+ }
10660
+ }, 100);
10661
+ t__namespace.useEffect(() => {
10662
+ const viewport = scrollAreaContext.viewport;
10663
+ if (viewport) {
10664
+ const handleScroll = () => {
10665
+ debounceScrollEnd();
10666
+ if (!removeUnlinkedScrollListenerRef.current) {
10667
+ const listener = addUnlinkedScrollListener(viewport, onThumbPositionChange);
10668
+ removeUnlinkedScrollListenerRef.current = listener;
10669
+ onThumbPositionChange();
10670
+ }
10671
+ };
10672
+ onThumbPositionChange();
10673
+ viewport.addEventListener("scroll", handleScroll);
10674
+ return () => viewport.removeEventListener("scroll", handleScroll);
10675
+ }
10676
+ }, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);
10677
+ return /* @__PURE__ */ jsxRuntime.jsx(
10678
+ Primitive.div,
10679
+ {
10680
+ "data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
10681
+ ...thumbProps,
10682
+ ref: composedRef,
10683
+ style: {
10684
+ width: "var(--radix-scroll-area-thumb-width)",
10685
+ height: "var(--radix-scroll-area-thumb-height)",
10686
+ ...style
10687
+ },
10688
+ onPointerDownCapture: composeEventHandlers(props.onPointerDownCapture, (event) => {
10689
+ const thumb = event.target;
10690
+ const thumbRect = thumb.getBoundingClientRect();
10691
+ const x = event.clientX - thumbRect.left;
10692
+ const y = event.clientY - thumbRect.top;
10693
+ scrollbarContext.onThumbPointerDown({ x, y });
10694
+ }),
10695
+ onPointerUp: composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)
10696
+ }
10697
+ );
10698
+ }
10699
+ );
10700
+ ScrollAreaThumb.displayName = THUMB_NAME;
10701
+ var CORNER_NAME = "ScrollAreaCorner";
10702
+ var ScrollAreaCorner = t__namespace.forwardRef(
10703
+ (props, forwardedRef) => {
10704
+ const context = useScrollAreaContext(CORNER_NAME, props.__scopeScrollArea);
10705
+ const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);
10706
+ const hasCorner = context.type !== "scroll" && hasBothScrollbarsVisible;
10707
+ return hasCorner ? /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaCornerImpl, { ...props, ref: forwardedRef }) : null;
10708
+ }
10709
+ );
10710
+ ScrollAreaCorner.displayName = CORNER_NAME;
10711
+ var ScrollAreaCornerImpl = t__namespace.forwardRef((props, forwardedRef) => {
10712
+ const { __scopeScrollArea, ...cornerProps } = props;
10713
+ const context = useScrollAreaContext(CORNER_NAME, __scopeScrollArea);
10714
+ const [width, setWidth] = t__namespace.useState(0);
10715
+ const [height, setHeight] = t__namespace.useState(0);
10716
+ const hasSize = Boolean(width && height);
10717
+ useResizeObserver(context.scrollbarX, () => {
10718
+ const height2 = context.scrollbarX?.offsetHeight || 0;
10719
+ context.onCornerHeightChange(height2);
10720
+ setHeight(height2);
10721
+ });
10722
+ useResizeObserver(context.scrollbarY, () => {
10723
+ const width2 = context.scrollbarY?.offsetWidth || 0;
10724
+ context.onCornerWidthChange(width2);
10725
+ setWidth(width2);
10726
+ });
10727
+ return hasSize ? /* @__PURE__ */ jsxRuntime.jsx(
10728
+ Primitive.div,
10729
+ {
10730
+ ...cornerProps,
10731
+ ref: forwardedRef,
10732
+ style: {
10733
+ width,
10734
+ height,
10735
+ position: "absolute",
10736
+ right: context.dir === "ltr" ? 0 : void 0,
10737
+ left: context.dir === "rtl" ? 0 : void 0,
10738
+ bottom: 0,
10739
+ ...props.style
10740
+ }
10741
+ }
10742
+ ) : null;
10743
+ });
10744
+ function toInt(value) {
10745
+ return value ? parseInt(value, 10) : 0;
10746
+ }
10747
+ function getThumbRatio(viewportSize, contentSize) {
10748
+ const ratio = viewportSize / contentSize;
10749
+ return isNaN(ratio) ? 0 : ratio;
10750
+ }
10751
+ function getThumbSize(sizes) {
10752
+ const ratio = getThumbRatio(sizes.viewport, sizes.content);
10753
+ const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
10754
+ const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio;
10755
+ return Math.max(thumbSize, 18);
10756
+ }
10757
+ function getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = "ltr") {
10758
+ const thumbSizePx = getThumbSize(sizes);
10759
+ const thumbCenter = thumbSizePx / 2;
10760
+ const offset = pointerOffset || thumbCenter;
10761
+ const thumbOffsetFromEnd = thumbSizePx - offset;
10762
+ const minPointerPos = sizes.scrollbar.paddingStart + offset;
10763
+ const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;
10764
+ const maxScrollPos = sizes.content - sizes.viewport;
10765
+ const scrollRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
10766
+ const interpolate = linearScale([minPointerPos, maxPointerPos], scrollRange);
10767
+ return interpolate(pointerPos);
10768
+ }
10769
+ function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") {
10770
+ const thumbSizePx = getThumbSize(sizes);
10771
+ const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;
10772
+ const scrollbar = sizes.scrollbar.size - scrollbarPadding;
10773
+ const maxScrollPos = sizes.content - sizes.viewport;
10774
+ const maxThumbPos = scrollbar - thumbSizePx;
10775
+ const scrollClampRange = dir === "ltr" ? [0, maxScrollPos] : [maxScrollPos * -1, 0];
10776
+ const scrollWithoutMomentum = clamp(scrollPos, scrollClampRange);
10777
+ const interpolate = linearScale([0, maxScrollPos], [0, maxThumbPos]);
10778
+ return interpolate(scrollWithoutMomentum);
10779
+ }
10780
+ function linearScale(input, output) {
10781
+ return (value) => {
10782
+ if (input[0] === input[1] || output[0] === output[1])
10783
+ return output[0];
10784
+ const ratio = (output[1] - output[0]) / (input[1] - input[0]);
10785
+ return output[0] + ratio * (value - input[0]);
10786
+ };
10787
+ }
10788
+ function isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {
10789
+ return scrollPos > 0 && scrollPos < maxScrollPos;
10790
+ }
10791
+ var addUnlinkedScrollListener = (node, handler = () => {
10792
+ }) => {
10793
+ let prevPosition = { left: node.scrollLeft, top: node.scrollTop };
10794
+ let rAF = 0;
10795
+ (function loop() {
10796
+ const position = { left: node.scrollLeft, top: node.scrollTop };
10797
+ const isHorizontalScroll = prevPosition.left !== position.left;
10798
+ const isVerticalScroll = prevPosition.top !== position.top;
10799
+ if (isHorizontalScroll || isVerticalScroll)
10800
+ handler();
10801
+ prevPosition = position;
10802
+ rAF = window.requestAnimationFrame(loop);
10803
+ })();
10804
+ return () => window.cancelAnimationFrame(rAF);
10805
+ };
10806
+ function useDebounceCallback(callback, delay) {
10807
+ const handleCallback = useCallbackRef(callback);
10808
+ const debounceTimerRef = t__namespace.useRef(0);
10809
+ t__namespace.useEffect(() => () => window.clearTimeout(debounceTimerRef.current), []);
10810
+ return t__namespace.useCallback(() => {
10811
+ window.clearTimeout(debounceTimerRef.current);
10812
+ debounceTimerRef.current = window.setTimeout(handleCallback, delay);
10813
+ }, [handleCallback, delay]);
10814
+ }
10815
+ function useResizeObserver(element, onResize) {
10816
+ const handleResize = useCallbackRef(onResize);
10817
+ useLayoutEffect2(() => {
10818
+ let rAF = 0;
10819
+ if (element) {
10820
+ const resizeObserver = new ResizeObserver(() => {
10821
+ cancelAnimationFrame(rAF);
10822
+ rAF = window.requestAnimationFrame(handleResize);
10823
+ });
10824
+ resizeObserver.observe(element);
10825
+ return () => {
10826
+ window.cancelAnimationFrame(rAF);
10827
+ resizeObserver.unobserve(element);
10828
+ };
10829
+ }
10830
+ }, [element, handleResize]);
10831
+ }
10832
+ var Root12 = ScrollArea;
10833
+ var Viewport2 = ScrollAreaViewport;
10834
+ var Corner = ScrollAreaCorner;
10835
+ var ScrollArea2 = t__namespace.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsxs(
10836
+ Root12,
10837
+ {
10838
+ ref,
10839
+ className: cn("relative overflow-hidden", className),
10840
+ ...props,
10841
+ children: [
10842
+ /* @__PURE__ */ jsxRuntime.jsx(Viewport2, { className: "h-full w-full rounded-[inherit]", children }),
10843
+ /* @__PURE__ */ jsxRuntime.jsx(ScrollBar, {}),
10844
+ /* @__PURE__ */ jsxRuntime.jsx(Corner, {})
10845
+ ]
10846
+ }
10847
+ ));
10848
+ ScrollArea2.displayName = Root12.displayName;
10849
+ var ScrollBar = t__namespace.forwardRef(({ className, orientation = "vertical", ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
10850
+ ScrollAreaScrollbar,
10851
+ {
10852
+ ref,
10853
+ orientation,
10854
+ className: cn(
10855
+ "flex touch-none select-none transition-colors",
10856
+ orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
10857
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
10858
+ className
10859
+ ),
10860
+ ...props,
10861
+ children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaThumb, { className: "relative flex-1 rounded-full bg-border" })
10862
+ }
10863
+ ));
10864
+ ScrollBar.displayName = ScrollAreaScrollbar.displayName;
9724
10865
  var separatorVariants = classVarianceAuthority.cva(
9725
10866
  "shrink-0 bg-border",
9726
10867
  {
@@ -9831,7 +10972,7 @@ var Separator3 = t__namespace.forwardRef(
9831
10972
  {
9832
10973
  ref,
9833
10974
  decorative,
9834
- orientation,
10975
+ orientation: orientation || void 0,
9835
10976
  className: cn(
9836
10977
  separatorVariants({ orientation, variant, size }),
9837
10978
  className
@@ -9841,91 +10982,17 @@ var Separator3 = t__namespace.forwardRef(
9841
10982
  )
9842
10983
  );
9843
10984
  Separator3.displayName = SeparatorPrimitive__namespace.Root.displayName;
9844
-
9845
- // ../../node_modules/@radix-ui/primitive/dist/index.mjs
9846
- function composeEventHandlers2(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
9847
- return function handleEvent(event) {
9848
- originalEventHandler?.(event);
9849
- if (checkForDefaultPrevented === false || !event.defaultPrevented) {
9850
- return ourEventHandler?.(event);
9851
- }
9852
- };
9853
- }
9854
- var useInsertionEffect2 = t__namespace[" useInsertionEffect ".trim().toString()] || useLayoutEffect22;
9855
- function useControllableState2({
9856
- prop,
9857
- defaultProp,
9858
- onChange = () => {
9859
- },
9860
- caller
9861
- }) {
9862
- const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState2({
9863
- defaultProp,
9864
- onChange
9865
- });
9866
- const isControlled = prop !== void 0;
9867
- const value = isControlled ? prop : uncontrolledProp;
9868
- {
9869
- const isControlledRef = t__namespace.useRef(prop !== void 0);
9870
- t__namespace.useEffect(() => {
9871
- const wasControlled = isControlledRef.current;
9872
- if (wasControlled !== isControlled) {
9873
- const from = wasControlled ? "controlled" : "uncontrolled";
9874
- const to = isControlled ? "controlled" : "uncontrolled";
9875
- console.warn(
9876
- `${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
9877
- );
9878
- }
9879
- isControlledRef.current = isControlled;
9880
- }, [isControlled, caller]);
9881
- }
9882
- const setValue = t__namespace.useCallback(
9883
- (nextValue) => {
9884
- if (isControlled) {
9885
- const value2 = isFunction3(nextValue) ? nextValue(prop) : nextValue;
9886
- if (value2 !== prop) {
9887
- onChangeRef.current?.(value2);
9888
- }
9889
- } else {
9890
- setUncontrolledProp(nextValue);
9891
- }
9892
- },
9893
- [isControlled, prop, setUncontrolledProp, onChangeRef]
9894
- );
9895
- return [value, setValue];
9896
- }
9897
- function useUncontrolledState2({
9898
- defaultProp,
9899
- onChange
9900
- }) {
9901
- const [value, setValue] = t__namespace.useState(defaultProp);
9902
- const prevValueRef = t__namespace.useRef(value);
9903
- const onChangeRef = t__namespace.useRef(onChange);
9904
- useInsertionEffect2(() => {
9905
- onChangeRef.current = onChange;
9906
- }, [onChange]);
9907
- t__namespace.useEffect(() => {
9908
- if (prevValueRef.current !== value) {
9909
- onChangeRef.current?.(value);
9910
- prevValueRef.current = value;
9911
- }
9912
- }, [value, prevValueRef]);
9913
- return [value, setValue, onChangeRef];
9914
- }
9915
- function isFunction3(value) {
9916
- return typeof value === "function";
9917
- }
9918
10985
  var NAME = "Toggle";
9919
10986
  var Toggle = t__namespace.forwardRef((props, forwardedRef) => {
9920
10987
  const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;
9921
- const [pressed, setPressed] = useControllableState2({
10988
+ const [pressed, setPressed] = useControllableState({
9922
10989
  prop: pressedProp,
9923
10990
  onChange: onPressedChange,
9924
10991
  defaultProp: defaultPressed ?? false,
9925
10992
  caller: NAME
9926
10993
  });
9927
10994
  return /* @__PURE__ */ jsxRuntime.jsx(
9928
- Primitive2.button,
10995
+ Primitive.button,
9929
10996
  {
9930
10997
  type: "button",
9931
10998
  "aria-pressed": pressed,
@@ -9933,7 +11000,7 @@ var Toggle = t__namespace.forwardRef((props, forwardedRef) => {
9933
11000
  "data-disabled": props.disabled ? "" : void 0,
9934
11001
  ...buttonProps,
9935
11002
  ref: forwardedRef,
9936
- onClick: composeEventHandlers2(props.onClick, () => {
11003
+ onClick: composeEventHandlers(props.onClick, () => {
9937
11004
  if (!props.disabled) {
9938
11005
  setPressed(!pressed);
9939
11006
  }
@@ -9942,7 +11009,7 @@ var Toggle = t__namespace.forwardRef((props, forwardedRef) => {
9942
11009
  );
9943
11010
  });
9944
11011
  Toggle.displayName = NAME;
9945
- var Root13 = Toggle;
11012
+ var Root14 = Toggle;
9946
11013
  var toggleVariants = classVarianceAuthority.cva(
9947
11014
  "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
9948
11015
  {
@@ -9964,14 +11031,14 @@ var toggleVariants = classVarianceAuthority.cva(
9964
11031
  }
9965
11032
  );
9966
11033
  var Toggle2 = t__namespace.forwardRef(({ className, variant, size, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
9967
- Root13,
11034
+ Root14,
9968
11035
  {
9969
11036
  ref,
9970
11037
  className: cn("moonui-theme", toggleVariants({ variant, size, className })),
9971
11038
  ...props
9972
11039
  }
9973
11040
  ));
9974
- Toggle2.displayName = Root13.displayName;
11041
+ Toggle2.displayName = Root14.displayName;
9975
11042
  var TooltipProvider = TooltipPrimitive__namespace.Provider;
9976
11043
  var tooltipVariants = classVarianceAuthority.cva(
9977
11044
  "z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
@@ -10619,7 +11686,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
10619
11686
  );
10620
11687
  SimpleEditor.displayName = "SimpleEditor";
10621
11688
  var CharacterCount = ({ content }) => {
10622
- const [count4, setCount] = t.useState(0);
11689
+ const [count3, setCount] = t.useState(0);
10623
11690
  t.useEffect(() => {
10624
11691
  const getPlainText = (html) => {
10625
11692
  const div = document.createElement("div");
@@ -10629,7 +11696,7 @@ var CharacterCount = ({ content }) => {
10629
11696
  setCount(getPlainText(content).length);
10630
11697
  }, [content]);
10631
11698
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
10632
- count4,
11699
+ count3,
10633
11700
  " characters"
10634
11701
  ] });
10635
11702
  };
@@ -10730,6 +11797,112 @@ var Switch = t__namespace.forwardRef(({ className, size = "md", variant = "prima
10730
11797
  description && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-muted-foreground", children: description })
10731
11798
  ] }));
10732
11799
  Switch.displayName = SwitchPrimitives__namespace.Root.displayName;
11800
+ var TagsInput = t__namespace.forwardRef(
11801
+ ({
11802
+ value = [],
11803
+ onChange,
11804
+ maxTags,
11805
+ variant = "primary",
11806
+ allowDuplicates = false,
11807
+ delimiter = ",",
11808
+ placeholder = "Add tag and press Enter",
11809
+ className,
11810
+ disabled,
11811
+ ...props
11812
+ }, ref) => {
11813
+ const [inputValue, setInputValue] = t__namespace.useState("");
11814
+ const [error, setError] = t__namespace.useState("");
11815
+ const handleKeyDown = (e) => {
11816
+ if (e.key === "Enter" || e.key === delimiter) {
11817
+ e.preventDefault();
11818
+ addTag();
11819
+ } else if (e.key === "Backspace" && inputValue === "" && value.length > 0) {
11820
+ removeTag(value.length - 1);
11821
+ }
11822
+ };
11823
+ const addTag = () => {
11824
+ const tag = inputValue.trim();
11825
+ if (!tag)
11826
+ return;
11827
+ if (!allowDuplicates && value.includes(tag)) {
11828
+ setError("This tag already exists");
11829
+ setTimeout(() => setError(""), 2e3);
11830
+ return;
11831
+ }
11832
+ if (maxTags && value.length >= maxTags) {
11833
+ setError(`Maximum ${maxTags} tags allowed`);
11834
+ setTimeout(() => setError(""), 2e3);
11835
+ return;
11836
+ }
11837
+ onChange([...value, tag]);
11838
+ setInputValue("");
11839
+ setError("");
11840
+ };
11841
+ const removeTag = (index) => {
11842
+ if (disabled)
11843
+ return;
11844
+ onChange(value.filter((_, i) => i !== index));
11845
+ };
11846
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
11847
+ /* @__PURE__ */ jsxRuntime.jsxs(
11848
+ "div",
11849
+ {
11850
+ className: cn(
11851
+ "flex min-h-[2.5rem] w-full flex-wrap gap-2 rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background",
11852
+ "dark:bg-zinc-950/50 dark:border-zinc-800",
11853
+ "focus-within:outline-none focus-within:ring-2 focus-within:ring-ring focus-within:ring-offset-2",
11854
+ disabled && "cursor-not-allowed opacity-50",
11855
+ className
11856
+ ),
11857
+ children: [
11858
+ value.map((tag, index) => /* @__PURE__ */ jsxRuntime.jsxs(
11859
+ Badge,
11860
+ {
11861
+ variant,
11862
+ className: "gap-1 pr-1.5",
11863
+ children: [
11864
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs", children: tag }),
11865
+ !disabled && /* @__PURE__ */ jsxRuntime.jsx(
11866
+ "button",
11867
+ {
11868
+ type: "button",
11869
+ onClick: () => removeTag(index),
11870
+ className: "ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2",
11871
+ children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3 text-muted-foreground hover:text-foreground transition-colors" })
11872
+ }
11873
+ )
11874
+ ]
11875
+ },
11876
+ index
11877
+ )),
11878
+ /* @__PURE__ */ jsxRuntime.jsx(
11879
+ "input",
11880
+ {
11881
+ ref,
11882
+ type: "text",
11883
+ value: inputValue,
11884
+ onChange: (e) => setInputValue(e.target.value),
11885
+ onKeyDown: handleKeyDown,
11886
+ onBlur: addTag,
11887
+ disabled,
11888
+ placeholder: value.length === 0 ? placeholder : "",
11889
+ className: cn(
11890
+ "flex-1 bg-transparent outline-none placeholder:text-muted-foreground",
11891
+ "dark:placeholder:text-zinc-500",
11892
+ "min-w-[120px]",
11893
+ disabled && "cursor-not-allowed"
11894
+ ),
11895
+ ...props
11896
+ }
11897
+ )
11898
+ ]
11899
+ }
11900
+ ),
11901
+ error && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-xs text-destructive", children: error })
11902
+ ] });
11903
+ }
11904
+ );
11905
+ TagsInput.displayName = "TagsInput";
10733
11906
  var Textarea = t__namespace.forwardRef(
10734
11907
  ({
10735
11908
  className,
@@ -10904,6 +12077,8 @@ var reducer = (state, action) => {
10904
12077
  ...state,
10905
12078
  toasts: state.toasts.filter((t2) => t2.id !== action.toastId)
10906
12079
  };
12080
+ default:
12081
+ return state;
10907
12082
  }
10908
12083
  };
10909
12084
  var listeners = [];
@@ -11034,11 +12209,15 @@ exports.BreadcrumbPage = BreadcrumbPage;
11034
12209
  exports.BreadcrumbSeparator = BreadcrumbSeparator;
11035
12210
  exports.Button = Button;
11036
12211
  exports.Card = Card;
12212
+ exports.CardCVCInput = CardCVCInput;
11037
12213
  exports.CardContent = CardContent;
11038
12214
  exports.CardDescription = CardDescription;
12215
+ exports.CardExpiryInput = CardExpiryInput;
11039
12216
  exports.CardFooter = CardFooter;
11040
12217
  exports.CardHeader = CardHeader;
12218
+ exports.CardNumberInput = CardNumberInput;
11041
12219
  exports.CardTitle = CardTitle;
12220
+ exports.CardZipInput = CardZipInput;
11042
12221
  exports.Checkbox = Checkbox;
11043
12222
  exports.CheckboxGroup = CheckboxGroup;
11044
12223
  exports.CheckboxLabel = CheckboxLabel;
@@ -11086,16 +12265,172 @@ exports.DropdownMenuSubContent = DropdownMenuSubContent;
11086
12265
  exports.DropdownMenuSubTrigger = DropdownMenuSubTrigger;
11087
12266
  exports.DropdownMenuTrigger = DropdownMenuTrigger;
11088
12267
  exports.FileUpload = FileUpload;
12268
+ exports.FreeBadge = FreeBadge;
11089
12269
  exports.GestureDrawer = GestureDrawer;
11090
12270
  exports.GitHubStarButton = GitHubStarButton;
11091
12271
  exports.GitHubStars = GitHubStars;
11092
12272
  exports.GradientPicker = GradientPicker;
11093
12273
  exports.Input = Input;
11094
12274
  exports.Label = Label;
12275
+ exports.LockedComponent = LockedComponent;
11095
12276
  exports.MonthPicker = MonthPicker;
11096
12277
  exports.MoonLogo = MoonLogo;
11097
12278
  exports.MoonLogoAnimated = MoonLogoAnimated;
11098
12279
  exports.MoonLogoIcon = MoonLogoIcon;
12280
+ exports.MoonUIAccordion = Accordion;
12281
+ exports.MoonUIAccordionContent = AccordionContent;
12282
+ exports.MoonUIAccordionItem = AccordionItem;
12283
+ exports.MoonUIAccordionTrigger = AccordionTrigger;
12284
+ exports.MoonUIAlert = Alert;
12285
+ exports.MoonUIAlertDescription = AlertDescription;
12286
+ exports.MoonUIAlertTitle = AlertTitle;
12287
+ exports.MoonUIAspectRatio = AspectRatio;
12288
+ exports.MoonUIAvatar = Avatar;
12289
+ exports.MoonUIAvatarFallback = AvatarFallback;
12290
+ exports.MoonUIAvatarGroup = AvatarGroup;
12291
+ exports.MoonUIAvatarImage = AvatarImage;
12292
+ exports.MoonUIBadge = Badge;
12293
+ exports.MoonUIBreadcrumb = Breadcrumb;
12294
+ exports.MoonUIBreadcrumbEllipsis = BreadcrumbEllipsis;
12295
+ exports.MoonUIBreadcrumbItem = BreadcrumbItem;
12296
+ exports.MoonUIBreadcrumbLink = BreadcrumbLink;
12297
+ exports.MoonUIBreadcrumbList = BreadcrumbList;
12298
+ exports.MoonUIBreadcrumbPage = BreadcrumbPage;
12299
+ exports.MoonUIBreadcrumbSeparator = BreadcrumbSeparator;
12300
+ exports.MoonUIButton = Button;
12301
+ exports.MoonUICard = Card;
12302
+ exports.MoonUICardCVCInput = CardCVCInput;
12303
+ exports.MoonUICardContent = CardContent;
12304
+ exports.MoonUICardDescription = CardDescription;
12305
+ exports.MoonUICardExpiryInput = CardExpiryInput;
12306
+ exports.MoonUICardFooter = CardFooter;
12307
+ exports.MoonUICardHeader = CardHeader;
12308
+ exports.MoonUICardNumberInput = CardNumberInput;
12309
+ exports.MoonUICardTitle = CardTitle;
12310
+ exports.MoonUICardZipInput = CardZipInput;
12311
+ exports.MoonUICheckbox = Checkbox;
12312
+ exports.MoonUICheckboxGroup = CheckboxGroup;
12313
+ exports.MoonUICheckboxLabel = CheckboxLabel;
12314
+ exports.MoonUICheckboxWithLabel = CheckboxWithLabel;
12315
+ exports.MoonUICollapsible = Collapsible2;
12316
+ exports.MoonUICollapsibleContent = CollapsibleContent2;
12317
+ exports.MoonUICollapsibleTrigger = CollapsibleTrigger2;
12318
+ exports.MoonUIColorPicker = ColorPicker;
12319
+ exports.MoonUICommand = Command;
12320
+ exports.MoonUICommandDialog = CommandDialog;
12321
+ exports.MoonUICommandEmpty = CommandEmpty;
12322
+ exports.MoonUICommandGroup = CommandGroup;
12323
+ exports.MoonUICommandInput = CommandInput;
12324
+ exports.MoonUICommandItem = CommandItem;
12325
+ exports.MoonUICommandList = CommandList;
12326
+ exports.MoonUICommandSeparator = CommandSeparator;
12327
+ exports.MoonUICommandShortcut = CommandShortcut;
12328
+ exports.MoonUIDataTable = DataTable;
12329
+ exports.MoonUIDatePicker = DatePicker;
12330
+ exports.MoonUIDateRangePicker = DateRangePicker;
12331
+ exports.MoonUIDateTimePicker = DateTimePicker;
12332
+ exports.MoonUIDialog = Dialog;
12333
+ exports.MoonUIDialogClose = DialogClose;
12334
+ exports.MoonUIDialogContent = DialogContent;
12335
+ exports.MoonUIDialogDescription = DialogDescription;
12336
+ exports.MoonUIDialogFooter = DialogFooter;
12337
+ exports.MoonUIDialogHeader = DialogHeader;
12338
+ exports.MoonUIDialogTitle = DialogTitle;
12339
+ exports.MoonUIDialogTrigger = DialogTrigger;
12340
+ exports.MoonUIDraggableList = DraggableList;
12341
+ exports.MoonUIDropdownMenu = DropdownMenu;
12342
+ exports.MoonUIDropdownMenuCheckboxItem = DropdownMenuCheckboxItem;
12343
+ exports.MoonUIDropdownMenuContent = DropdownMenuContent;
12344
+ exports.MoonUIDropdownMenuGroup = DropdownMenuGroup;
12345
+ exports.MoonUIDropdownMenuItem = DropdownMenuItem;
12346
+ exports.MoonUIDropdownMenuLabel = DropdownMenuLabel;
12347
+ exports.MoonUIDropdownMenuPortal = DropdownMenuPortal;
12348
+ exports.MoonUIDropdownMenuRadioGroup = DropdownMenuRadioGroup;
12349
+ exports.MoonUIDropdownMenuRadioItem = DropdownMenuRadioItem;
12350
+ exports.MoonUIDropdownMenuSeparator = DropdownMenuSeparator;
12351
+ exports.MoonUIDropdownMenuShortcut = DropdownMenuShortcut;
12352
+ exports.MoonUIDropdownMenuSub = DropdownMenuSub;
12353
+ exports.MoonUIDropdownMenuSubContent = DropdownMenuSubContent;
12354
+ exports.MoonUIDropdownMenuSubTrigger = DropdownMenuSubTrigger;
12355
+ exports.MoonUIDropdownMenuTrigger = DropdownMenuTrigger;
12356
+ exports.MoonUIFileUpload = FileUpload;
12357
+ exports.MoonUIFreeBadge = FreeBadge;
12358
+ exports.MoonUIGestureDrawer = GestureDrawer;
12359
+ exports.MoonUIGitHubStars = GitHubStars;
12360
+ exports.MoonUIGradientPicker = GradientPicker;
12361
+ exports.MoonUIInput = Input;
12362
+ exports.MoonUILabel = Label;
12363
+ exports.MoonUILockedComponent = LockedComponent;
12364
+ exports.MoonUIMonthPicker = MonthPicker;
12365
+ exports.MoonUIMoonLogo = MoonLogo;
12366
+ exports.MoonUIPagination = Pagination;
12367
+ exports.MoonUIPaginationContent = PaginationContent;
12368
+ exports.MoonUIPaginationEllipsis = PaginationEllipsis;
12369
+ exports.MoonUIPaginationItem = PaginationItem;
12370
+ exports.MoonUIPaginationLink = PaginationLink;
12371
+ exports.MoonUIPaginationNext = PaginationNext;
12372
+ exports.MoonUIPaginationPrevious = PaginationPrevious;
12373
+ exports.MoonUIPhoneInput = PhoneInput;
12374
+ exports.MoonUIPopover = Popover;
12375
+ exports.MoonUIPopoverContent = PopoverContent;
12376
+ exports.MoonUIPopoverTrigger = PopoverTrigger;
12377
+ exports.MoonUIProBadge = ProBadge;
12378
+ exports.MoonUIProComponentWrapper = ProComponentWrapper;
12379
+ exports.MoonUIProgress = Progress;
12380
+ exports.MoonUIRadioGroup = RadioGroup2;
12381
+ exports.MoonUIRadioGroupItem = RadioGroupItem;
12382
+ exports.MoonUIRadioItemWithLabel = RadioItemWithLabel;
12383
+ exports.MoonUIRadioLabel = RadioLabel;
12384
+ exports.MoonUIRichTextEditor = RichTextEditor;
12385
+ exports.MoonUIScrollArea = ScrollArea2;
12386
+ exports.MoonUIScrollBar = ScrollBar;
12387
+ exports.MoonUISelect = Select;
12388
+ exports.MoonUISelectContent = SelectContent;
12389
+ exports.MoonUISelectGroup = SelectGroup;
12390
+ exports.MoonUISelectItem = SelectItem;
12391
+ exports.MoonUISelectLabel = SelectLabel;
12392
+ exports.MoonUISelectScrollDownButton = SelectScrollDownButton;
12393
+ exports.MoonUISelectScrollUpButton = SelectScrollUpButton;
12394
+ exports.MoonUISelectSeparator = SelectSeparator;
12395
+ exports.MoonUISelectTrigger = SelectTrigger;
12396
+ exports.MoonUISelectValue = SelectValue;
12397
+ exports.MoonUISeparator = Separator3;
12398
+ exports.MoonUISimpleColorPicker = SimpleColorPicker;
12399
+ exports.MoonUISimpleEditor = SimpleEditor;
12400
+ exports.MoonUISkeleton = Skeleton;
12401
+ exports.MoonUISkeletonAvatar = SkeletonAvatar;
12402
+ exports.MoonUISkeletonCard = SkeletonCard;
12403
+ exports.MoonUISkeletonText = SkeletonText;
12404
+ exports.MoonUISlider = Slider;
12405
+ exports.MoonUISwipeableCard = SwipeableCard;
12406
+ exports.MoonUISwitch = Switch;
12407
+ exports.MoonUITable = Table;
12408
+ exports.MoonUITableBody = TableBody;
12409
+ exports.MoonUITableCaption = TableCaption;
12410
+ exports.MoonUITableCell = TableCell;
12411
+ exports.MoonUITableFooter = TableFooter;
12412
+ exports.MoonUITableHead = TableHead;
12413
+ exports.MoonUITableHeader = TableHeader;
12414
+ exports.MoonUITableRow = TableRow;
12415
+ exports.MoonUITabs = Tabs;
12416
+ exports.MoonUITabsContent = TabsContent;
12417
+ exports.MoonUITabsList = TabsList;
12418
+ exports.MoonUITabsTrigger = TabsTrigger;
12419
+ exports.MoonUITagsInput = TagsInput;
12420
+ exports.MoonUITextarea = Textarea;
12421
+ exports.MoonUIToast = Toast;
12422
+ exports.MoonUIToastAction = ToastAction;
12423
+ exports.MoonUIToastClose = ToastClose;
12424
+ exports.MoonUIToastDescription = ToastDescription;
12425
+ exports.MoonUIToastProvider = ToastProvider;
12426
+ exports.MoonUIToastTitle = ToastTitle;
12427
+ exports.MoonUIToastViewport = ToastViewport;
12428
+ exports.MoonUIToaster = Toaster;
12429
+ exports.MoonUIToggle = Toggle2;
12430
+ exports.MoonUITooltip = Tooltip;
12431
+ exports.MoonUITooltipContent = TooltipContent;
12432
+ exports.MoonUITooltipProvider = TooltipProvider;
12433
+ exports.MoonUITooltipTrigger = TooltipTrigger;
11099
12434
  exports.Pagination = Pagination;
11100
12435
  exports.PaginationContent = PaginationContent;
11101
12436
  exports.PaginationEllipsis = PaginationEllipsis;
@@ -11103,6 +12438,7 @@ exports.PaginationItem = PaginationItem;
11103
12438
  exports.PaginationLink = PaginationLink;
11104
12439
  exports.PaginationNext = PaginationNext;
11105
12440
  exports.PaginationPrevious = PaginationPrevious;
12441
+ exports.PhoneInput = PhoneInput;
11106
12442
  exports.Popover = Popover;
11107
12443
  exports.PopoverAnchor = PopoverAnchor;
11108
12444
  exports.PopoverClose = PopoverClose;
@@ -11111,12 +12447,16 @@ exports.PopoverFooter = PopoverFooter;
11111
12447
  exports.PopoverHeader = PopoverHeader;
11112
12448
  exports.PopoverSeparator = PopoverSeparator;
11113
12449
  exports.PopoverTrigger = PopoverTrigger;
12450
+ exports.ProBadge = ProBadge;
12451
+ exports.ProComponentWrapper = ProComponentWrapper;
11114
12452
  exports.Progress = Progress;
11115
12453
  exports.RadioGroup = RadioGroup2;
11116
12454
  exports.RadioGroupItem = RadioGroupItem;
11117
12455
  exports.RadioItemWithLabel = RadioItemWithLabel;
11118
12456
  exports.RadioLabel = RadioLabel;
11119
12457
  exports.RichTextEditor = RichTextEditor;
12458
+ exports.ScrollArea = ScrollArea2;
12459
+ exports.ScrollBar = ScrollBar;
11120
12460
  exports.Select = Select;
11121
12461
  exports.SelectContent = SelectContent;
11122
12462
  exports.SelectGroup = SelectGroup;
@@ -11150,6 +12490,7 @@ exports.Tabs = Tabs;
11150
12490
  exports.TabsContent = TabsContent;
11151
12491
  exports.TabsList = TabsList;
11152
12492
  exports.TabsTrigger = TabsTrigger;
12493
+ exports.TagsInput = TagsInput;
11153
12494
  exports.Textarea = Textarea;
11154
12495
  exports.Toast = Toast;
11155
12496
  exports.ToastAction = ToastAction;
@@ -11173,6 +12514,10 @@ exports.collapsibleContentVariants = collapsibleContentVariants;
11173
12514
  exports.collapsibleTriggerVariants = collapsibleTriggerVariants;
11174
12515
  exports.createFilterableColumn = createFilterableColumn;
11175
12516
  exports.createSortableHeader = createSortableHeader;
12517
+ exports.moonUIBadgeVariants = badgeVariants;
12518
+ exports.moonUIButtonVariants = buttonVariants;
12519
+ exports.moonUISkeletonVariants = skeletonVariants;
12520
+ exports.moonUIToggleVariants = toggleVariants;
11176
12521
  exports.popoverContentVariants = popoverContentVariants;
11177
12522
  exports.progressVariants = progressVariants;
11178
12523
  exports.separatorVariants = separatorVariants;