@moontra/moonui 5.1.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3,7 +3,7 @@
3
3
  import * as React24 from 'react';
4
4
  import React24__default, { useState, useCallback, useEffect } from 'react';
5
5
  import * as AccordionPrimitive from '@radix-ui/react-accordion';
6
- import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, CreditCard, ArrowLeft, ArrowRight, Minus, Search, Calendar as Calendar$1, Clock, ChevronLeft, ChevronRight, Circle, Upload, Dot, ChevronUp, Phone, Bold, Italic, Underline, Strikethrough, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Code, Link, Image, Palette, Undo, Redo, Edit, Eye, Copy, ArrowDown, ArrowUp, ArrowUpDown, CheckCircle, Star, GitFork, ExternalLink, Crown, Lock, Zap, Video, Music, FileText, File } from 'lucide-react';
6
+ import { ChevronDown, Info, AlertCircle, AlertTriangle, Check, X, MoreHorizontal, Loader2, CreditCard, ArrowLeft, ArrowRight, Minus, Search, Calendar as Calendar$1, Clock, ChevronLeft, ChevronRight, Circle, Upload, Dot, ChevronUp, Phone, Bold, Italic, Underline, Strikethrough, AlignLeft, AlignCenter, AlignRight, AlignJustify, List, ListOrdered, Quote, Code, Link, Image, Palette, Undo, Redo, Edit, Eye, CheckCircle, Star, Video, Music, FileText, File, Copy, ArrowDown, ArrowUp, ArrowUpDown, GitFork, ExternalLink, Crown, Lock, Zap } from 'lucide-react';
7
7
  export { Palette, Pipette } from 'lucide-react';
8
8
  import { clsx } from 'clsx';
9
9
  import { twMerge } from 'tailwind-merge';
@@ -11,7 +11,7 @@ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
11
11
  import { cva } from 'class-variance-authority';
12
12
  import * as AvatarPrimitive from '@radix-ui/react-avatar';
13
13
  import { motion, AnimatePresence, useMotionValue, useTransform, animate } from 'framer-motion';
14
- import { isValid, format, isSameMonth, isToday, subMonths, addMonths, isSameDay, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek } from 'date-fns';
14
+ import { isValid, format, isSameMonth, isToday, startOfMonth, endOfMonth, eachDayOfInterval, getDay, startOfWeek, endOfWeek, subMonths, addMonths, isSameDay } from 'date-fns';
15
15
  export { format } from 'date-fns';
16
16
  import useEmblaCarousel from 'embla-carousel-react';
17
17
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
@@ -21,7 +21,7 @@ import * as PopoverPrimitive from '@radix-ui/react-popover';
21
21
  import * as TabsPrimitive from '@radix-ui/react-tabs';
22
22
  import { Command as Command$1 } from 'cmdk';
23
23
  import * as DialogPrimitive from '@radix-ui/react-dialog';
24
- import { useReactTable, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getFilteredRowModel, flexRender } from '@tanstack/react-table';
24
+ import { useReactTable, getFilteredRowModel, getSortedRowModel, getPaginationRowModel, getCoreRowModel, flexRender } from '@tanstack/react-table';
25
25
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
26
  import { OTPInput, OTPInputContext } from 'input-otp';
27
27
  export { REGEXP_ONLY_CHARS, REGEXP_ONLY_DIGITS, REGEXP_ONLY_DIGITS_AND_CHARS } from 'input-otp';
@@ -958,26 +958,7 @@ var springAnimations = {
958
958
  type: "spring",
959
959
  stiffness: 260,
960
960
  damping: 20
961
- },
962
- // Bouncy spring for playful interactions
963
- bouncy: {
964
- type: "spring",
965
- stiffness: 300,
966
- damping: 15
967
- },
968
- // Stiff spring for quick responses
969
- stiff: {
970
- type: "spring",
971
- stiffness: 400,
972
- damping: 25
973
- },
974
- // Gentle spring for subtle movements
975
- gentle: {
976
- type: "spring",
977
- stiffness: 150,
978
- damping: 15
979
- }
980
- };
961
+ }};
981
962
  var hoverAnimations = {
982
963
  lift: {
983
964
  y: -2,
@@ -990,22 +971,12 @@ var hoverAnimations = {
990
971
  glow: {
991
972
  boxShadow: "0 0 20px rgba(var(--primary), 0.3)",
992
973
  transition: springAnimations.smooth
993
- },
994
- rotate: {
995
- rotate: 2,
996
- transition: springAnimations.bouncy
997
- }
998
- };
974
+ }};
999
975
  var tapAnimations = {
1000
976
  scale: {
1001
977
  scale: 0.95,
1002
978
  transition: { duration: 0.1 }
1003
- },
1004
- depress: {
1005
- y: 1,
1006
- transition: { duration: 0.1 }
1007
- }
1008
- };
979
+ }};
1009
980
  var skeletonAnimation = {
1010
981
  initial: { opacity: 0.5 },
1011
982
  animate: {
@@ -1151,8 +1122,7 @@ function Calendar({
1151
1122
  setCurrentMonth(addMonths(currentMonth, 1));
1152
1123
  };
1153
1124
  const handleDateClick = (date) => {
1154
- if (disabled?.(date))
1155
- return;
1125
+ if (disabled?.(date)) return;
1156
1126
  if (mode === "single") {
1157
1127
  onSelect?.(date);
1158
1128
  } else if (mode === "range") {
@@ -1169,8 +1139,7 @@ function Calendar({
1169
1139
  }
1170
1140
  };
1171
1141
  const isDateSelected = (date) => {
1172
- if (!selected)
1173
- return false;
1142
+ if (!selected) return false;
1174
1143
  if (mode === "single") {
1175
1144
  return isSameDay(date, selected);
1176
1145
  } else if (mode === "range") {
@@ -1183,23 +1152,19 @@ function Calendar({
1183
1152
  return false;
1184
1153
  };
1185
1154
  const isRangeStart = (date) => {
1186
- if (mode !== "range" || !selected)
1187
- return false;
1155
+ if (mode !== "range" || !selected) return false;
1188
1156
  const range = selected;
1189
1157
  return range.from ? isSameDay(date, range.from) : false;
1190
1158
  };
1191
1159
  const isRangeEnd = (date) => {
1192
- if (mode !== "range" || !selected)
1193
- return false;
1160
+ if (mode !== "range" || !selected) return false;
1194
1161
  const range = selected;
1195
1162
  return range.to ? isSameDay(date, range.to) : false;
1196
1163
  };
1197
1164
  const isRangeMiddle = (date) => {
1198
- if (mode !== "range" || !selected)
1199
- return false;
1165
+ if (mode !== "range" || !selected) return false;
1200
1166
  const range = selected;
1201
- if (!range.from || !range.to)
1202
- return false;
1167
+ if (!range.from || !range.to) return false;
1203
1168
  return date > range.from && date < range.to;
1204
1169
  };
1205
1170
  const getDaysInMonth = () => {
@@ -1326,8 +1291,7 @@ var getCardType = (number) => {
1326
1291
  jcb: /^35/
1327
1292
  };
1328
1293
  for (const [type, pattern] of Object.entries(patterns)) {
1329
- if (pattern.test(number))
1330
- return type;
1294
+ if (pattern.test(number)) return type;
1331
1295
  }
1332
1296
  return "unknown";
1333
1297
  };
@@ -1337,10 +1301,8 @@ var formatCardNumber = (value, cardType) => {
1337
1301
  let formatted = "";
1338
1302
  let position = 0;
1339
1303
  for (const group of groups) {
1340
- if (position >= cleaned.length)
1341
- break;
1342
- if (formatted)
1343
- formatted += " ";
1304
+ if (position >= cleaned.length) break;
1305
+ if (formatted) formatted += " ";
1344
1306
  formatted += cleaned.slice(position, position + group);
1345
1307
  position += group;
1346
1308
  }
@@ -1522,8 +1484,7 @@ var Carousel = React24.forwardRef(
1522
1484
  const [canScrollPrev, setCanScrollPrev] = React24.useState(false);
1523
1485
  const [canScrollNext, setCanScrollNext] = React24.useState(false);
1524
1486
  const onSelect = React24.useCallback((emblaApi) => {
1525
- if (!emblaApi)
1526
- return;
1487
+ if (!emblaApi) return;
1527
1488
  setCanScrollPrev(emblaApi.canScrollPrev());
1528
1489
  setCanScrollNext(emblaApi.canScrollNext());
1529
1490
  }, []);
@@ -1548,13 +1509,11 @@ var Carousel = React24.forwardRef(
1548
1509
  [resolvedOrientation, scrollPrev, scrollNext]
1549
1510
  );
1550
1511
  React24.useEffect(() => {
1551
- if (!api || !setApi)
1552
- return;
1512
+ if (!api || !setApi) return;
1553
1513
  setApi(api);
1554
1514
  }, [api, setApi]);
1555
1515
  React24.useEffect(() => {
1556
- if (!api)
1557
- return;
1516
+ if (!api) return;
1558
1517
  onSelect(api);
1559
1518
  api.on("reInit", onSelect);
1560
1519
  api.on("select", onSelect);
@@ -2515,11 +2474,9 @@ var Slider = React24.forwardRef(({
2515
2474
  }
2516
2475
  };
2517
2476
  const handleTrackClick = (event) => {
2518
- if (disabled)
2519
- return;
2477
+ if (disabled) return;
2520
2478
  const track = trackRef.current;
2521
- if (!track)
2522
- return;
2479
+ if (!track) return;
2523
2480
  const rect = track.getBoundingClientRect();
2524
2481
  const percent = (event.clientX - rect.left) / rect.width;
2525
2482
  const rawValue = min + percent * (max - min);
@@ -2530,13 +2487,11 @@ var Slider = React24.forwardRef(({
2530
2487
  handleValueChange(newValues);
2531
2488
  };
2532
2489
  const handleThumbMouseDown = (index) => (event) => {
2533
- if (disabled)
2534
- return;
2490
+ if (disabled) return;
2535
2491
  event.preventDefault();
2536
2492
  const handleMouseMove = (moveEvent) => {
2537
2493
  const track = trackRef.current;
2538
- if (!track)
2539
- return;
2494
+ if (!track) return;
2540
2495
  const rect = track.getBoundingClientRect();
2541
2496
  const percent = (moveEvent.clientX - rect.left) / rect.width;
2542
2497
  const rawValue = min + percent * (max - min);
@@ -2554,8 +2509,7 @@ var Slider = React24.forwardRef(({
2554
2509
  document.addEventListener("mouseup", handleMouseUp);
2555
2510
  };
2556
2511
  const handleThumbKeyDown = (index) => (event) => {
2557
- if (disabled)
2558
- return;
2512
+ if (disabled) return;
2559
2513
  const largeStep = step * 10;
2560
2514
  const current = sliderValue[index];
2561
2515
  let next;
@@ -2692,8 +2646,7 @@ function rgbToHex(r, g, b) {
2692
2646
  }
2693
2647
  function hexToHsl(hex) {
2694
2648
  const rgb = hexToRgb(hex);
2695
- if (!rgb)
2696
- return null;
2649
+ if (!rgb) return null;
2697
2650
  const r = rgb.r / 255;
2698
2651
  const g = rgb.g / 255;
2699
2652
  const b = rgb.b / 255;
@@ -2732,16 +2685,11 @@ function hslToHex(h, s, l) {
2732
2685
  r = g = b = l;
2733
2686
  } else {
2734
2687
  const hue2rgb = (p2, q2, t) => {
2735
- if (t < 0)
2736
- t += 1;
2737
- if (t > 1)
2738
- t -= 1;
2739
- if (t < 1 / 6)
2740
- return p2 + (q2 - p2) * 6 * t;
2741
- if (t < 1 / 2)
2742
- return q2;
2743
- if (t < 2 / 3)
2744
- return p2 + (q2 - p2) * (2 / 3 - t) * 6;
2688
+ if (t < 0) t += 1;
2689
+ if (t > 1) t -= 1;
2690
+ if (t < 1 / 6) return p2 + (q2 - p2) * 6 * t;
2691
+ if (t < 1 / 2) return q2;
2692
+ if (t < 2 / 3) return p2 + (q2 - p2) * (2 / 3 - t) * 6;
2745
2693
  return p2;
2746
2694
  };
2747
2695
  const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
@@ -2858,10 +2806,8 @@ function ColorPicker({
2858
2806
  }
2859
2807
  };
2860
2808
  const formatDisplay = () => {
2861
- if (format4 === "rgb")
2862
- return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;
2863
- if (format4 === "hsl")
2864
- return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;
2809
+ if (format4 === "rgb") return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;
2810
+ if (format4 === "hsl") return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;
2865
2811
  return color;
2866
2812
  };
2867
2813
  return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: setOpen, children: [
@@ -3735,8 +3681,7 @@ TableRow.displayName = "TableRow";
3735
3681
  var TableHead = React24.forwardRef(
3736
3682
  ({ className, sortable, sorted, onSort, align = "left", children, ...props }, ref) => {
3737
3683
  const renderSortIcon = () => {
3738
- if (!sortable)
3739
- return null;
3684
+ if (!sortable) return null;
3740
3685
  if (sorted === "asc") {
3741
3686
  return /* @__PURE__ */ jsx(
3742
3687
  "svg",
@@ -4065,14 +4010,10 @@ var DatePicker = React24.forwardRef(function DatePicker2({
4065
4010
  handleSelect(today);
4066
4011
  };
4067
4012
  const isDateDisabled = (date) => {
4068
- if (minDate && date < minDate)
4069
- return true;
4070
- if (maxDate && date > maxDate)
4071
- return true;
4072
- if (disabledDates?.some((d) => d.toDateString() === date.toDateString()))
4073
- return true;
4074
- if (disabledDaysOfWeek?.includes(date.getDay()))
4075
- return true;
4013
+ if (minDate && date < minDate) return true;
4014
+ if (maxDate && date > maxDate) return true;
4015
+ if (disabledDates?.some((d) => d.toDateString() === date.toDateString())) return true;
4016
+ if (disabledDaysOfWeek?.includes(date.getDay())) return true;
4076
4017
  return false;
4077
4018
  };
4078
4019
  const displayValue = internalDate && isValid(internalDate) ? format(internalDate, formatString) : null;
@@ -4215,8 +4156,7 @@ var DateRangePicker = React24.forwardRef(function DateRangePicker2({
4215
4156
  }
4216
4157
  };
4217
4158
  const displayValue = React24.useMemo(() => {
4218
- if (!internalRange?.from)
4219
- return null;
4159
+ if (!internalRange?.from) return null;
4220
4160
  if (!internalRange?.to) {
4221
4161
  return format(internalRange.from, formatString);
4222
4162
  }
@@ -4460,8 +4400,7 @@ function DraggableList({
4460
4400
  }) {
4461
4401
  const [draggedIndex, setDraggedIndex] = React24.useState(null);
4462
4402
  const handleDragStart = (e, index) => {
4463
- if (disabled)
4464
- return;
4403
+ if (disabled) return;
4465
4404
  setDraggedIndex(index);
4466
4405
  e.dataTransfer.effectAllowed = "move";
4467
4406
  };
@@ -4755,19 +4694,14 @@ var Progress = React24.forwardRef(({
4755
4694
  });
4756
4695
  Progress.displayName = "Progress";
4757
4696
  var getFileIcon = (type) => {
4758
- if (type.startsWith("image/"))
4759
- return /* @__PURE__ */ jsx(Image, { className: "h-4 w-4" });
4760
- if (type.startsWith("video/"))
4761
- return /* @__PURE__ */ jsx(Video, { className: "h-4 w-4" });
4762
- if (type.startsWith("audio/"))
4763
- return /* @__PURE__ */ jsx(Music, { className: "h-4 w-4" });
4764
- if (type.includes("text") || type.includes("document"))
4765
- return /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" });
4697
+ if (type.startsWith("image/")) return /* @__PURE__ */ jsx(Image, { className: "h-4 w-4" });
4698
+ if (type.startsWith("video/")) return /* @__PURE__ */ jsx(Video, { className: "h-4 w-4" });
4699
+ if (type.startsWith("audio/")) return /* @__PURE__ */ jsx(Music, { className: "h-4 w-4" });
4700
+ if (type.includes("text") || type.includes("document")) return /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" });
4766
4701
  return /* @__PURE__ */ jsx(File, { className: "h-4 w-4" });
4767
4702
  };
4768
4703
  var formatFileSize = (bytes) => {
4769
- if (bytes === 0)
4770
- return "0 Bytes";
4704
+ if (bytes === 0) return "0 Bytes";
4771
4705
  const k = 1024;
4772
4706
  const sizes = ["Bytes", "KB", "MB", "GB"];
4773
4707
  const i = Math.floor(Math.log(bytes) / Math.log(k));
@@ -4804,6 +4738,7 @@ var FileItem = ({
4804
4738
  size: "sm",
4805
4739
  className: "h-6 w-6 p-0",
4806
4740
  onClick: () => onRemove(id),
4741
+ "aria-label": `Remove ${file.name}`,
4807
4742
  children: /* @__PURE__ */ jsx(X, { className: "h-3 w-3" })
4808
4743
  }
4809
4744
  )
@@ -4913,7 +4848,7 @@ var FileUpload = React24__default.forwardRef(
4913
4848
  }
4914
4849
  if (onUpload) {
4915
4850
  try {
4916
- await onUpload(validFiles);
4851
+ await onUpload(newUploadedFiles);
4917
4852
  } catch (error2) {
4918
4853
  console.error("Upload failed:", error2);
4919
4854
  setUploadedFiles(
@@ -4927,8 +4862,7 @@ var FileUpload = React24__default.forwardRef(
4927
4862
  const handleDrop = useCallback((e) => {
4928
4863
  e.preventDefault();
4929
4864
  setIsDragOver(false);
4930
- if (disabled)
4931
- return;
4865
+ if (disabled) return;
4932
4866
  const files = e.dataTransfer.files;
4933
4867
  if (files.length > 0) {
4934
4868
  processFiles(files);
@@ -5070,8 +5004,7 @@ var GestureDrawer = React24__default.forwardRef(
5070
5004
  const motionValue = isVertical ? y : x;
5071
5005
  const opacity = useTransform(motionValue, [0, threshold], [1, 0.5]);
5072
5006
  const handleDragEnd = (event, info) => {
5073
- if (!enableSwipeToClose)
5074
- return;
5007
+ if (!enableSwipeToClose) return;
5075
5008
  const offset = isVertical ? info.offset.y : info.offset.x;
5076
5009
  const velocity = isVertical ? info.velocity.y : info.velocity.x;
5077
5010
  let shouldClose = false;
@@ -5112,8 +5045,7 @@ var GestureDrawer = React24__default.forwardRef(
5112
5045
  const getAnimatePosition = () => {
5113
5046
  return isVertical ? { y: 0 } : { x: 0 };
5114
5047
  };
5115
- if (!isOpen)
5116
- return null;
5048
+ if (!isOpen) return null;
5117
5049
  return /* @__PURE__ */ jsxs("div", { className: "fixed inset-0 z-50", children: [
5118
5050
  /* @__PURE__ */ jsx(
5119
5051
  motion.div,
@@ -5405,8 +5337,7 @@ function LockedComponent({
5405
5337
  const [isPreviewActive, setIsPreviewActive] = useState(false);
5406
5338
  const [previewTimeout, setPreviewTimeout] = useState(null);
5407
5339
  const handleMouseEnter = () => {
5408
- if (!showPreview)
5409
- return;
5340
+ if (!showPreview) return;
5410
5341
  setIsPreviewActive(true);
5411
5342
  if (previewTimeout) {
5412
5343
  clearTimeout(previewTimeout);
@@ -5512,7 +5443,6 @@ function ProComponentWrapper({
5512
5443
  nodeEnv: process.env.NODE_ENV === "development",
5513
5444
  nextPublicEnv: process.env.NEXT_PUBLIC_VERCEL_ENV === "development",
5514
5445
  localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local")),
5515
- port: typeof window !== "undefined" && (window.location.port === "3000" || window.location.port === "3001" || window.location.port === "8080"),
5516
5446
  vercelEnv: !process.env.VERCEL,
5517
5447
  ciEnv: !process.env.CI,
5518
5448
  deploymentEnv: !process.env.DEPLOYMENT_ENV
@@ -5593,9 +5523,7 @@ function ProComponentWrapper({
5593
5523
  const isDevelopment = () => {
5594
5524
  const checks = {
5595
5525
  nodeEnv: process.env.NODE_ENV === "development",
5596
- localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local")),
5597
- port: typeof window !== "undefined" && (window.location.port === "3000" || window.location.port === "3001" || window.location.port === "8080")
5598
- };
5526
+ localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local"))};
5599
5527
  if (process.env.VERCEL || process.env.NETLIFY || process.env.RENDER || process.env.RAILWAY_ENVIRONMENT || process.env.FLY_APP_NAME) {
5600
5528
  return false;
5601
5529
  }
@@ -6060,30 +5988,22 @@ var formatPhoneNumber = (value, countryCode) => {
6060
5988
  const cleaned = value.replace(/\D/g, "");
6061
5989
  switch (countryCode) {
6062
5990
  case "+1":
6063
- if (cleaned.length <= 3)
6064
- return cleaned;
6065
- if (cleaned.length <= 6)
6066
- return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
5991
+ if (cleaned.length <= 3) return cleaned;
5992
+ if (cleaned.length <= 6) return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
6067
5993
  return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)}-${cleaned.slice(6, 10)}`;
6068
5994
  case "+44":
6069
- if (cleaned.length <= 4)
6070
- return cleaned;
6071
- if (cleaned.length <= 7)
6072
- return `${cleaned.slice(0, 4)} ${cleaned.slice(4)}`;
5995
+ if (cleaned.length <= 4) return cleaned;
5996
+ if (cleaned.length <= 7) return `${cleaned.slice(0, 4)} ${cleaned.slice(4)}`;
6073
5997
  return `${cleaned.slice(0, 4)} ${cleaned.slice(4, 7)} ${cleaned.slice(7, 11)}`;
6074
5998
  case "+90":
6075
- if (cleaned.length <= 3)
6076
- return cleaned;
6077
- if (cleaned.length <= 6)
6078
- return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
6079
- if (cleaned.length <= 9)
6080
- return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6)}`;
5999
+ if (cleaned.length <= 3) return cleaned;
6000
+ if (cleaned.length <= 6) return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
6001
+ if (cleaned.length <= 9) return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6)}`;
6081
6002
  return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8, 10)}`;
6082
6003
  default:
6083
6004
  let formatted = "";
6084
6005
  for (let i = 0; i < cleaned.length; i++) {
6085
- if (i > 0 && i % 3 === 0)
6086
- formatted += " ";
6006
+ if (i > 0 && i % 3 === 0) formatted += " ";
6087
6007
  formatted += cleaned[i];
6088
6008
  }
6089
6009
  return formatted;
@@ -6093,10 +6013,13 @@ var getMaxLength = (countryCode) => {
6093
6013
  switch (countryCode) {
6094
6014
  case "+1":
6095
6015
  return 10;
6016
+ // US/Canada
6096
6017
  case "+44":
6097
6018
  return 11;
6019
+ // UK
6098
6020
  case "+90":
6099
6021
  return 10;
6022
+ // Turkey
6100
6023
  default:
6101
6024
  return 15;
6102
6025
  }
@@ -6472,8 +6395,7 @@ var ScrollReveal = React24.forwardRef(
6472
6395
  }, ref) => {
6473
6396
  const shouldTriggerOnce = triggerOnce !== void 0 ? triggerOnce : once;
6474
6397
  const animationVariants = React24.useMemo(() => {
6475
- if (variants)
6476
- return variants;
6398
+ if (variants) return variants;
6477
6399
  return createDefaultVariants(direction, distance);
6478
6400
  }, [direction, distance, variants]);
6479
6401
  const transition = React24.useMemo(() => ({
@@ -6572,8 +6494,7 @@ var ScrollRevealItem = React24.forwardRef(
6572
6494
  id
6573
6495
  }, ref) => {
6574
6496
  const animationVariants = React24.useMemo(() => {
6575
- if (variants)
6576
- return variants;
6497
+ if (variants) return variants;
6577
6498
  return createDefaultVariants(direction, distance);
6578
6499
  }, [direction, distance, variants]);
6579
6500
  const transition = React24.useMemo(() => ({
@@ -6898,7 +6819,7 @@ var SimpleEditor = React24__default.forwardRef(
6898
6819
  const [content, setContent] = useState(value);
6899
6820
  const [isPreview, setIsPreview] = useState(false);
6900
6821
  const [sourceContent, setSourceContent] = useState(value);
6901
- useState(null);
6822
+ const [selection, setSelection] = useState(null);
6902
6823
  const editorRef = React24__default.useRef(null);
6903
6824
  const sourceRef = React24__default.useRef(null);
6904
6825
  const [formatState, setFormatState] = useState({
@@ -6927,8 +6848,7 @@ var SimpleEditor = React24__default.forwardRef(
6927
6848
  return null;
6928
6849
  }, []);
6929
6850
  useCallback((range) => {
6930
- if (!range)
6931
- return;
6851
+ if (!range) return;
6932
6852
  const selection2 = window.getSelection();
6933
6853
  if (selection2) {
6934
6854
  selection2.removeAllRanges();
@@ -6936,8 +6856,7 @@ var SimpleEditor = React24__default.forwardRef(
6936
6856
  }
6937
6857
  }, []);
6938
6858
  const executeCommand = useCallback((command, value2) => {
6939
- if (disabled)
6940
- return;
6859
+ if (disabled) return;
6941
6860
  if (editorRef.current) {
6942
6861
  editorRef.current.focus();
6943
6862
  }
@@ -7680,19 +7599,16 @@ var SwipeableCard = React24.forwardRef(
7680
7599
  const [currentX, setCurrentX] = React24.useState(0);
7681
7600
  const [isSwiping, setIsSwiping] = React24.useState(false);
7682
7601
  const handleTouchStart = (e) => {
7683
- if (disabled)
7684
- return;
7602
+ if (disabled) return;
7685
7603
  setStartX(e.touches[0].clientX);
7686
7604
  setIsSwiping(true);
7687
7605
  };
7688
7606
  const handleTouchMove = (e) => {
7689
- if (disabled || !isSwiping)
7690
- return;
7607
+ if (disabled || !isSwiping) return;
7691
7608
  setCurrentX(e.touches[0].clientX);
7692
7609
  };
7693
7610
  const handleTouchEnd = () => {
7694
- if (disabled || !isSwiping)
7695
- return;
7611
+ if (disabled || !isSwiping) return;
7696
7612
  const deltaX = currentX - startX;
7697
7613
  if (Math.abs(deltaX) > threshold) {
7698
7614
  if (deltaX > 0 && onSwipeRight) {
@@ -7832,8 +7748,7 @@ var TagsInput = React24.forwardRef(
7832
7748
  const tagButtonRefs = React24.useRef([]);
7833
7749
  const errorId = React24.useId();
7834
7750
  const focusTag = (index) => {
7835
- if (value.length === 0)
7836
- return;
7751
+ if (value.length === 0) return;
7837
7752
  const clamped = Math.max(0, Math.min(value.length - 1, index));
7838
7753
  tagButtonRefs.current[clamped]?.focus();
7839
7754
  };
@@ -7856,10 +7771,8 @@ var TagsInput = React24.forwardRef(
7856
7771
  break;
7857
7772
  case "ArrowRight":
7858
7773
  e.preventDefault();
7859
- if (index >= value.length - 1)
7860
- innerInputRef.current?.focus();
7861
- else
7862
- focusTag(index + 1);
7774
+ if (index >= value.length - 1) innerInputRef.current?.focus();
7775
+ else focusTag(index + 1);
7863
7776
  break;
7864
7777
  case "Home":
7865
7778
  e.preventDefault();
@@ -7875,10 +7788,8 @@ var TagsInput = React24.forwardRef(
7875
7788
  const remaining = value.length - 1;
7876
7789
  removeTag(index);
7877
7790
  requestAnimationFrame(() => {
7878
- if (remaining > 0)
7879
- focusTag(Math.min(index, remaining - 1));
7880
- else
7881
- innerInputRef.current?.focus();
7791
+ if (remaining > 0) focusTag(Math.min(index, remaining - 1));
7792
+ else innerInputRef.current?.focus();
7882
7793
  });
7883
7794
  break;
7884
7795
  }
@@ -7886,8 +7797,7 @@ var TagsInput = React24.forwardRef(
7886
7797
  };
7887
7798
  const addTag = () => {
7888
7799
  const tag = inputValue.trim();
7889
- if (!tag)
7890
- return;
7800
+ if (!tag) return;
7891
7801
  if (!allowDuplicates && value.includes(tag)) {
7892
7802
  setError("This tag already exists");
7893
7803
  setTimeout(() => setError(""), 2e3);
@@ -7903,8 +7813,7 @@ var TagsInput = React24.forwardRef(
7903
7813
  setError("");
7904
7814
  };
7905
7815
  const removeTag = (index) => {
7906
- if (disabled)
7907
- return;
7816
+ if (disabled) return;
7908
7817
  onChange(value.filter((_, i) => i !== index));
7909
7818
  };
7910
7819
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
@@ -8034,8 +7943,7 @@ var Textarea = React24.forwardRef(
8034
7943
  React24.useImperativeHandle(ref, () => textareaRef.current);
8035
7944
  const adjustHeight = React24.useCallback(() => {
8036
7945
  const textarea = textareaRef.current;
8037
- if (!textarea || !autoResize)
8038
- return;
7946
+ if (!textarea || !autoResize) return;
8039
7947
  textarea.style.height = "auto";
8040
7948
  const newHeight = textarea.scrollHeight;
8041
7949
  if (maxHeight && newHeight > maxHeight) {
@@ -8289,8 +8197,7 @@ function toast({ ...props }) {
8289
8197
  id,
8290
8198
  open: true,
8291
8199
  onOpenChange: (open) => {
8292
- if (!open)
8293
- dismiss();
8200
+ if (!open) dismiss();
8294
8201
  }
8295
8202
  }
8296
8203
  });
@@ -8416,18 +8323,15 @@ var Rating = React24.forwardRef(
8416
8323
  const displayValue = hoverValue !== null ? hoverValue : currentValue;
8417
8324
  const commit = React24.useCallback(
8418
8325
  (next) => {
8419
- if (readOnly)
8420
- return;
8421
- if (!isControlled)
8422
- setInternalValue(next);
8326
+ if (readOnly) return;
8327
+ if (!isControlled) setInternalValue(next);
8423
8328
  onValueChange?.(next);
8424
8329
  },
8425
8330
  [readOnly, isControlled, onValueChange]
8426
8331
  );
8427
8332
  const handleKeyDown = React24.useCallback(
8428
8333
  (event) => {
8429
- if (readOnly)
8430
- return;
8334
+ if (readOnly) return;
8431
8335
  let next = null;
8432
8336
  switch (event.key) {
8433
8337
  case "ArrowRight":
@@ -8736,5 +8640,5 @@ var ToggleGroupItem = React24.forwardRef(({ className, children, variant, size,
8736
8640
  ToggleGroupItem.displayName = "ToggleGroupItem";
8737
8641
 
8738
8642
  export { Accordion, AccordionContent, AccordionItem, AccordionTrigger, Alert, AlertDescription, AlertTitle, AspectRatio, Avatar, AvatarFallback, AvatarGroup, AvatarImage, Badge, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Button, ButtonGroup, Card, CardCVCInput, CardContent, CardDescription, CardExpiryInput, CardFooter, CardHeader, CardNumberInput, CardTitle, CardZipInput, Carousel, CarouselContent, CarouselItem, CarouselNext, CarouselPrevious, Checkbox, CheckboxGroup, CheckboxLabel, CheckboxWithLabel, Collapsible, CollapsibleContent, CollapsibleTrigger, ColorPicker, Command, CommandDialog, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList, CommandSeparator, CommandShortcut, DatePicker, DateRangePicker, DateTimePicker, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogForm, DialogHeader, DialogTitle, DialogTrigger, DraggableList, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, FileUpload, FreeBadge, GestureDrawer, GitHubStarButton, GitHubStars, GradientPicker, Input, InputOTP, InputOTPGroup, InputOTPSeparator, InputOTPSlot, Kbd, Label, LockedComponent, MonthPicker, MoonLogo, MoonLogoAnimated, MoonLogoIcon, Accordion as MoonUIAccordion, AccordionContent as MoonUIAccordionContent, AccordionItem as MoonUIAccordionItem, AccordionTrigger as MoonUIAccordionTrigger, Alert as MoonUIAlert, AlertDescription as MoonUIAlertDescription, AlertTitle as MoonUIAlertTitle, AspectRatio as MoonUIAspectRatio, Avatar as MoonUIAvatar, AvatarFallback as MoonUIAvatarFallback, AvatarGroup as MoonUIAvatarGroup, AvatarImage as MoonUIAvatarImage, Badge as MoonUIBadge, Breadcrumb as MoonUIBreadcrumb, BreadcrumbEllipsis as MoonUIBreadcrumbEllipsis, BreadcrumbItem as MoonUIBreadcrumbItem, BreadcrumbLink as MoonUIBreadcrumbLink, BreadcrumbList as MoonUIBreadcrumbList, BreadcrumbPage as MoonUIBreadcrumbPage, BreadcrumbSeparator as MoonUIBreadcrumbSeparator, Button as MoonUIButton, ButtonGroup as MoonUIButtonGroup, Calendar as MoonUICalendar, Card as MoonUICard, CardCVCInput as MoonUICardCVCInput, CardContent as MoonUICardContent, CardDescription as MoonUICardDescription, CardExpiryInput as MoonUICardExpiryInput, CardFooter as MoonUICardFooter, CardHeader as MoonUICardHeader, CardNumberInput as MoonUICardNumberInput, CardTitle as MoonUICardTitle, CardZipInput as MoonUICardZipInput, Carousel as MoonUICarousel, CarouselContent as MoonUICarouselContent, CarouselItem as MoonUICarouselItem, CarouselNext as MoonUICarouselNext, CarouselPrevious as MoonUICarouselPrevious, Checkbox as MoonUICheckbox, CheckboxGroup as MoonUICheckboxGroup, CheckboxLabel as MoonUICheckboxLabel, CheckboxWithLabel as MoonUICheckboxWithLabel, Collapsible as MoonUICollapsible, CollapsibleContent as MoonUICollapsibleContent, CollapsibleTrigger as MoonUICollapsibleTrigger, ColorPicker as MoonUIColorPicker, Command as MoonUICommand, CommandDialog as MoonUICommandDialog, CommandEmpty as MoonUICommandEmpty, CommandGroup as MoonUICommandGroup, CommandInput as MoonUICommandInput, CommandItem as MoonUICommandItem, CommandList as MoonUICommandList, CommandSeparator as MoonUICommandSeparator, CommandShortcut as MoonUICommandShortcut, DataTableBasic as MoonUIDataTableBasic, DatePicker as MoonUIDatePicker, DateRangePicker as MoonUIDateRangePicker, DateTimePicker as MoonUIDateTimePicker, Dialog as MoonUIDialog, DialogClose as MoonUIDialogClose, DialogContent as MoonUIDialogContent, DialogDescription as MoonUIDialogDescription, DialogFooter as MoonUIDialogFooter, DialogHeader as MoonUIDialogHeader, DialogTitle as MoonUIDialogTitle, DialogTrigger as MoonUIDialogTrigger, DraggableList as MoonUIDraggableList, DropdownMenu as MoonUIDropdownMenu, DropdownMenuCheckboxItem as MoonUIDropdownMenuCheckboxItem, DropdownMenuContent as MoonUIDropdownMenuContent, DropdownMenuGroup as MoonUIDropdownMenuGroup, DropdownMenuItem as MoonUIDropdownMenuItem, DropdownMenuLabel as MoonUIDropdownMenuLabel, DropdownMenuPortal as MoonUIDropdownMenuPortal, DropdownMenuRadioGroup as MoonUIDropdownMenuRadioGroup, DropdownMenuRadioItem as MoonUIDropdownMenuRadioItem, DropdownMenuSeparator as MoonUIDropdownMenuSeparator, DropdownMenuShortcut as MoonUIDropdownMenuShortcut, DropdownMenuSub as MoonUIDropdownMenuSub, DropdownMenuSubContent as MoonUIDropdownMenuSubContent, DropdownMenuSubTrigger as MoonUIDropdownMenuSubTrigger, DropdownMenuTrigger as MoonUIDropdownMenuTrigger, FileUpload as MoonUIFileUpload, FreeBadge as MoonUIFreeBadge, GestureDrawer as MoonUIGestureDrawer, GitHubStars as MoonUIGitHubStars, GradientPicker as MoonUIGradientPicker, Input as MoonUIInput, InputOTP as MoonUIInputOTP, InputOTPGroup as MoonUIInputOTPGroup, InputOTPSeparator as MoonUIInputOTPSeparator, InputOTPSlot as MoonUIInputOTPSlot, Kbd as MoonUIKbd, Label as MoonUILabel, LockedComponent as MoonUILockedComponent, MonthPicker as MoonUIMonthPicker, MoonLogo as MoonUIMoonLogo, Pagination as MoonUIPagination, PaginationContent as MoonUIPaginationContent, PaginationEllipsis as MoonUIPaginationEllipsis, PaginationItem as MoonUIPaginationItem, PaginationLink as MoonUIPaginationLink, PaginationNext as MoonUIPaginationNext, PaginationPrevious as MoonUIPaginationPrevious, PhoneInput as MoonUIPhoneInput, Popover as MoonUIPopover, PopoverContent as MoonUIPopoverContent, PopoverTrigger as MoonUIPopoverTrigger, ProBadge as MoonUIProBadge, ProComponentWrapper as MoonUIProComponentWrapper, Progress as MoonUIProgress, RadioGroup2 as MoonUIRadioGroup, RadioGroupItem as MoonUIRadioGroupItem, RadioItemWithLabel as MoonUIRadioItemWithLabel, RadioLabel as MoonUIRadioLabel, Rating as MoonUIRating, RichTextEditor as MoonUIRichTextEditor, ScrollArea as MoonUIScrollArea, ScrollBar as MoonUIScrollBar, ScrollReveal as MoonUIScrollReveal, ScrollRevealContainer as MoonUIScrollRevealContainer, ScrollRevealItem as MoonUIScrollRevealItem, Select as MoonUISelect, SelectContent as MoonUISelectContent, SelectGroup as MoonUISelectGroup, SelectItem as MoonUISelectItem, SelectLabel as MoonUISelectLabel, SelectScrollDownButton as MoonUISelectScrollDownButton, SelectScrollUpButton as MoonUISelectScrollUpButton, SelectSeparator as MoonUISelectSeparator, SelectTrigger as MoonUISelectTrigger, SelectValue as MoonUISelectValue, Separator3 as MoonUISeparator, SimpleColorPicker as MoonUISimpleColorPicker, SimpleEditor as MoonUISimpleEditor, Skeleton as MoonUISkeleton, SkeletonAvatar as MoonUISkeletonAvatar, SkeletonCard as MoonUISkeletonCard, SkeletonText as MoonUISkeletonText, Slider as MoonUISlider, Spinner as MoonUISpinner, SwipeableCard as MoonUISwipeableCard, Switch as MoonUISwitch, Table as MoonUITable, TableBody as MoonUITableBody, TableCaption as MoonUITableCaption, TableCell as MoonUITableCell, TableFooter as MoonUITableFooter, TableHead as MoonUITableHead, TableHeader as MoonUITableHeader, TableRow as MoonUITableRow, Tabs as MoonUITabs, TabsContent as MoonUITabsContent, TabsList as MoonUITabsList, TabsTrigger as MoonUITabsTrigger, TagsInput as MoonUITagsInput, Textarea as MoonUITextarea, Toast as MoonUIToast, ToastAction as MoonUIToastAction, ToastClose as MoonUIToastClose, ToastDescription as MoonUIToastDescription, ToastProvider as MoonUIToastProvider, ToastTitle as MoonUIToastTitle, ToastViewport as MoonUIToastViewport, Toaster as MoonUIToaster, Toggle as MoonUIToggle, ToggleGroup as MoonUIToggleGroup, ToggleGroupItem as MoonUIToggleGroupItem, Tooltip as MoonUITooltip, TooltipContent as MoonUITooltipContent, TooltipProvider as MoonUITooltipProvider, TooltipTrigger as MoonUITooltipTrigger, Pagination, PaginationContent, PaginationEllipsis, PaginationItem, PaginationLink, PaginationNext, PaginationPrevious, PhoneInput, Popover, PopoverAnchor, PopoverClose, PopoverContent, PopoverFooter, PopoverHeader, PopoverSeparator, PopoverTrigger, ProBadge, ProComponentWrapper, Progress, RadioGroup2 as RadioGroup, RadioGroupItem, RadioItemWithLabel, RadioLabel, Rating, RichTextEditor, ScrollArea, ScrollBar, ScrollReveal, ScrollRevealContainer, ScrollRevealItem, Select, SelectContent, SelectGroup, SelectItem, SelectLabel, SelectScrollDownButton, SelectScrollUpButton, SelectSeparator, SelectTrigger, SelectValue, Separator3 as Separator, SimpleColorPicker, SimpleEditor, SimpleTooltip, Skeleton, SkeletonAvatar, SkeletonCard, SkeletonText, Slider, Spinner, SwipeableCard, Switch, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, TagsInput, Textarea, Toast, ToastAction, ToastClose, ToastDescription, ToastProvider, ToastTitle, ToastViewport, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tooltip, TooltipArrow, TooltipContent, TooltipProvider, TooltipTrigger, aspectRatioVariants, badgeVariants, buttonGroupVariants, buttonVariants, carouselContentVariants, carouselItemVariants, cn, collapsibleContentVariants, collapsibleTriggerVariants, inputOTPSlotVariants, kbdVariants, badgeVariants as moonUIBadgeVariants, buttonGroupVariants as moonUIButtonGroupVariants, buttonVariants as moonUIButtonVariants, carouselContentVariants as moonUICarouselContentVariants, carouselItemVariants as moonUICarouselItemVariants, createSortableHeader as moonUICreateSortableHeader, inputOTPSlotVariants as moonUIInputOTPSlotVariants, kbdVariants as moonUIKbdVariants, ratingVariants as moonUIRatingVariants, skeletonVariants as moonUISkeletonVariants, spinnerVariants as moonUISpinnerVariants, toggleVariants as moonUIToggleVariants, popoverContentVariants, progressVariants, ratingVariants, separatorVariants, skeletonVariants, spinnerVariants, switchVariants, toast, toggleVariants, tooltipVariants, useCarousel, useToast };
8739
- //# sourceMappingURL=out.js.map
8643
+ //# sourceMappingURL=index.mjs.map
8740
8644
  //# sourceMappingURL=index.mjs.map