@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/chunk-2EN7SB2G.global.js +33 -0
- package/dist/chunk-2EN7SB2G.global.js.map +1 -0
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.global.js +8 -8
- package/dist/hooks/index.global.js.map +1 -1
- package/dist/hooks/index.js +1 -1
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -1
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +29 -2
- package/dist/index.d.ts +29 -2
- package/dist/index.global.js +158 -798
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +85 -181
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +82 -178
- package/dist/index.mjs.map +1 -1
- package/dist/lib/theme.d.mts +1 -1
- package/dist/lib/theme.d.ts +1 -1
- package/dist/lib/theme.global.js +7 -20
- package/dist/lib/theme.global.js.map +1 -1
- package/dist/lib/theme.js +6 -11
- package/dist/lib/theme.js.map +1 -1
- package/dist/lib/theme.mjs +6 -11
- package/dist/lib/theme.mjs.map +1 -1
- package/package.json +1 -6
- package/src/components/ui/__tests__/file-upload.test.tsx +69 -0
- package/src/components/ui/date-picker.stories.tsx +41 -35
- package/src/components/ui/file-upload.tsx +39 -5
- package/src/components/ui/index.ts +1 -0
- package/src/styles/tokens.css +18 -4
- package/dist/chunk-VXDFZPDA.global.js +0 -33
- package/dist/chunk-VXDFZPDA.global.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -996,26 +996,7 @@ var springAnimations = {
|
|
|
996
996
|
type: "spring",
|
|
997
997
|
stiffness: 260,
|
|
998
998
|
damping: 20
|
|
999
|
-
}
|
|
1000
|
-
// Bouncy spring for playful interactions
|
|
1001
|
-
bouncy: {
|
|
1002
|
-
type: "spring",
|
|
1003
|
-
stiffness: 300,
|
|
1004
|
-
damping: 15
|
|
1005
|
-
},
|
|
1006
|
-
// Stiff spring for quick responses
|
|
1007
|
-
stiff: {
|
|
1008
|
-
type: "spring",
|
|
1009
|
-
stiffness: 400,
|
|
1010
|
-
damping: 25
|
|
1011
|
-
},
|
|
1012
|
-
// Gentle spring for subtle movements
|
|
1013
|
-
gentle: {
|
|
1014
|
-
type: "spring",
|
|
1015
|
-
stiffness: 150,
|
|
1016
|
-
damping: 15
|
|
1017
|
-
}
|
|
1018
|
-
};
|
|
999
|
+
}};
|
|
1019
1000
|
var hoverAnimations = {
|
|
1020
1001
|
lift: {
|
|
1021
1002
|
y: -2,
|
|
@@ -1028,22 +1009,12 @@ var hoverAnimations = {
|
|
|
1028
1009
|
glow: {
|
|
1029
1010
|
boxShadow: "0 0 20px rgba(var(--primary), 0.3)",
|
|
1030
1011
|
transition: springAnimations.smooth
|
|
1031
|
-
}
|
|
1032
|
-
rotate: {
|
|
1033
|
-
rotate: 2,
|
|
1034
|
-
transition: springAnimations.bouncy
|
|
1035
|
-
}
|
|
1036
|
-
};
|
|
1012
|
+
}};
|
|
1037
1013
|
var tapAnimations = {
|
|
1038
1014
|
scale: {
|
|
1039
1015
|
scale: 0.95,
|
|
1040
1016
|
transition: { duration: 0.1 }
|
|
1041
|
-
}
|
|
1042
|
-
depress: {
|
|
1043
|
-
y: 1,
|
|
1044
|
-
transition: { duration: 0.1 }
|
|
1045
|
-
}
|
|
1046
|
-
};
|
|
1017
|
+
}};
|
|
1047
1018
|
var skeletonAnimation = {
|
|
1048
1019
|
initial: { opacity: 0.5 },
|
|
1049
1020
|
animate: {
|
|
@@ -1189,8 +1160,7 @@ function Calendar({
|
|
|
1189
1160
|
setCurrentMonth(dateFns.addMonths(currentMonth, 1));
|
|
1190
1161
|
};
|
|
1191
1162
|
const handleDateClick = (date) => {
|
|
1192
|
-
if (disabled?.(date))
|
|
1193
|
-
return;
|
|
1163
|
+
if (disabled?.(date)) return;
|
|
1194
1164
|
if (mode === "single") {
|
|
1195
1165
|
onSelect?.(date);
|
|
1196
1166
|
} else if (mode === "range") {
|
|
@@ -1207,8 +1177,7 @@ function Calendar({
|
|
|
1207
1177
|
}
|
|
1208
1178
|
};
|
|
1209
1179
|
const isDateSelected = (date) => {
|
|
1210
|
-
if (!selected)
|
|
1211
|
-
return false;
|
|
1180
|
+
if (!selected) return false;
|
|
1212
1181
|
if (mode === "single") {
|
|
1213
1182
|
return dateFns.isSameDay(date, selected);
|
|
1214
1183
|
} else if (mode === "range") {
|
|
@@ -1221,23 +1190,19 @@ function Calendar({
|
|
|
1221
1190
|
return false;
|
|
1222
1191
|
};
|
|
1223
1192
|
const isRangeStart = (date) => {
|
|
1224
|
-
if (mode !== "range" || !selected)
|
|
1225
|
-
return false;
|
|
1193
|
+
if (mode !== "range" || !selected) return false;
|
|
1226
1194
|
const range = selected;
|
|
1227
1195
|
return range.from ? dateFns.isSameDay(date, range.from) : false;
|
|
1228
1196
|
};
|
|
1229
1197
|
const isRangeEnd = (date) => {
|
|
1230
|
-
if (mode !== "range" || !selected)
|
|
1231
|
-
return false;
|
|
1198
|
+
if (mode !== "range" || !selected) return false;
|
|
1232
1199
|
const range = selected;
|
|
1233
1200
|
return range.to ? dateFns.isSameDay(date, range.to) : false;
|
|
1234
1201
|
};
|
|
1235
1202
|
const isRangeMiddle = (date) => {
|
|
1236
|
-
if (mode !== "range" || !selected)
|
|
1237
|
-
return false;
|
|
1203
|
+
if (mode !== "range" || !selected) return false;
|
|
1238
1204
|
const range = selected;
|
|
1239
|
-
if (!range.from || !range.to)
|
|
1240
|
-
return false;
|
|
1205
|
+
if (!range.from || !range.to) return false;
|
|
1241
1206
|
return date > range.from && date < range.to;
|
|
1242
1207
|
};
|
|
1243
1208
|
const getDaysInMonth = () => {
|
|
@@ -1364,8 +1329,7 @@ var getCardType = (number) => {
|
|
|
1364
1329
|
jcb: /^35/
|
|
1365
1330
|
};
|
|
1366
1331
|
for (const [type, pattern] of Object.entries(patterns)) {
|
|
1367
|
-
if (pattern.test(number))
|
|
1368
|
-
return type;
|
|
1332
|
+
if (pattern.test(number)) return type;
|
|
1369
1333
|
}
|
|
1370
1334
|
return "unknown";
|
|
1371
1335
|
};
|
|
@@ -1375,10 +1339,8 @@ var formatCardNumber = (value, cardType) => {
|
|
|
1375
1339
|
let formatted = "";
|
|
1376
1340
|
let position = 0;
|
|
1377
1341
|
for (const group of groups) {
|
|
1378
|
-
if (position >= cleaned.length)
|
|
1379
|
-
|
|
1380
|
-
if (formatted)
|
|
1381
|
-
formatted += " ";
|
|
1342
|
+
if (position >= cleaned.length) break;
|
|
1343
|
+
if (formatted) formatted += " ";
|
|
1382
1344
|
formatted += cleaned.slice(position, position + group);
|
|
1383
1345
|
position += group;
|
|
1384
1346
|
}
|
|
@@ -1560,8 +1522,7 @@ var Carousel = React24__namespace.forwardRef(
|
|
|
1560
1522
|
const [canScrollPrev, setCanScrollPrev] = React24__namespace.useState(false);
|
|
1561
1523
|
const [canScrollNext, setCanScrollNext] = React24__namespace.useState(false);
|
|
1562
1524
|
const onSelect = React24__namespace.useCallback((emblaApi) => {
|
|
1563
|
-
if (!emblaApi)
|
|
1564
|
-
return;
|
|
1525
|
+
if (!emblaApi) return;
|
|
1565
1526
|
setCanScrollPrev(emblaApi.canScrollPrev());
|
|
1566
1527
|
setCanScrollNext(emblaApi.canScrollNext());
|
|
1567
1528
|
}, []);
|
|
@@ -1586,13 +1547,11 @@ var Carousel = React24__namespace.forwardRef(
|
|
|
1586
1547
|
[resolvedOrientation, scrollPrev, scrollNext]
|
|
1587
1548
|
);
|
|
1588
1549
|
React24__namespace.useEffect(() => {
|
|
1589
|
-
if (!api || !setApi)
|
|
1590
|
-
return;
|
|
1550
|
+
if (!api || !setApi) return;
|
|
1591
1551
|
setApi(api);
|
|
1592
1552
|
}, [api, setApi]);
|
|
1593
1553
|
React24__namespace.useEffect(() => {
|
|
1594
|
-
if (!api)
|
|
1595
|
-
return;
|
|
1554
|
+
if (!api) return;
|
|
1596
1555
|
onSelect(api);
|
|
1597
1556
|
api.on("reInit", onSelect);
|
|
1598
1557
|
api.on("select", onSelect);
|
|
@@ -2553,11 +2512,9 @@ var Slider = React24__namespace.forwardRef(({
|
|
|
2553
2512
|
}
|
|
2554
2513
|
};
|
|
2555
2514
|
const handleTrackClick = (event) => {
|
|
2556
|
-
if (disabled)
|
|
2557
|
-
return;
|
|
2515
|
+
if (disabled) return;
|
|
2558
2516
|
const track = trackRef.current;
|
|
2559
|
-
if (!track)
|
|
2560
|
-
return;
|
|
2517
|
+
if (!track) return;
|
|
2561
2518
|
const rect = track.getBoundingClientRect();
|
|
2562
2519
|
const percent = (event.clientX - rect.left) / rect.width;
|
|
2563
2520
|
const rawValue = min + percent * (max - min);
|
|
@@ -2568,13 +2525,11 @@ var Slider = React24__namespace.forwardRef(({
|
|
|
2568
2525
|
handleValueChange(newValues);
|
|
2569
2526
|
};
|
|
2570
2527
|
const handleThumbMouseDown = (index) => (event) => {
|
|
2571
|
-
if (disabled)
|
|
2572
|
-
return;
|
|
2528
|
+
if (disabled) return;
|
|
2573
2529
|
event.preventDefault();
|
|
2574
2530
|
const handleMouseMove = (moveEvent) => {
|
|
2575
2531
|
const track = trackRef.current;
|
|
2576
|
-
if (!track)
|
|
2577
|
-
return;
|
|
2532
|
+
if (!track) return;
|
|
2578
2533
|
const rect = track.getBoundingClientRect();
|
|
2579
2534
|
const percent = (moveEvent.clientX - rect.left) / rect.width;
|
|
2580
2535
|
const rawValue = min + percent * (max - min);
|
|
@@ -2592,8 +2547,7 @@ var Slider = React24__namespace.forwardRef(({
|
|
|
2592
2547
|
document.addEventListener("mouseup", handleMouseUp);
|
|
2593
2548
|
};
|
|
2594
2549
|
const handleThumbKeyDown = (index) => (event) => {
|
|
2595
|
-
if (disabled)
|
|
2596
|
-
return;
|
|
2550
|
+
if (disabled) return;
|
|
2597
2551
|
const largeStep = step * 10;
|
|
2598
2552
|
const current = sliderValue[index];
|
|
2599
2553
|
let next;
|
|
@@ -2730,8 +2684,7 @@ function rgbToHex(r, g, b) {
|
|
|
2730
2684
|
}
|
|
2731
2685
|
function hexToHsl(hex) {
|
|
2732
2686
|
const rgb = hexToRgb(hex);
|
|
2733
|
-
if (!rgb)
|
|
2734
|
-
return null;
|
|
2687
|
+
if (!rgb) return null;
|
|
2735
2688
|
const r = rgb.r / 255;
|
|
2736
2689
|
const g = rgb.g / 255;
|
|
2737
2690
|
const b = rgb.b / 255;
|
|
@@ -2770,16 +2723,11 @@ function hslToHex(h, s, l) {
|
|
|
2770
2723
|
r = g = b = l;
|
|
2771
2724
|
} else {
|
|
2772
2725
|
const hue2rgb = (p2, q2, t) => {
|
|
2773
|
-
if (t < 0)
|
|
2774
|
-
|
|
2775
|
-
if (t
|
|
2776
|
-
|
|
2777
|
-
if (t <
|
|
2778
|
-
return p2 + (q2 - p2) * 6 * t;
|
|
2779
|
-
if (t < 1 / 2)
|
|
2780
|
-
return q2;
|
|
2781
|
-
if (t < 2 / 3)
|
|
2782
|
-
return p2 + (q2 - p2) * (2 / 3 - t) * 6;
|
|
2726
|
+
if (t < 0) t += 1;
|
|
2727
|
+
if (t > 1) t -= 1;
|
|
2728
|
+
if (t < 1 / 6) return p2 + (q2 - p2) * 6 * t;
|
|
2729
|
+
if (t < 1 / 2) return q2;
|
|
2730
|
+
if (t < 2 / 3) return p2 + (q2 - p2) * (2 / 3 - t) * 6;
|
|
2783
2731
|
return p2;
|
|
2784
2732
|
};
|
|
2785
2733
|
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
@@ -2896,10 +2844,8 @@ function ColorPicker({
|
|
|
2896
2844
|
}
|
|
2897
2845
|
};
|
|
2898
2846
|
const formatDisplay = () => {
|
|
2899
|
-
if (format4 === "rgb")
|
|
2900
|
-
|
|
2901
|
-
if (format4 === "hsl")
|
|
2902
|
-
return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;
|
|
2847
|
+
if (format4 === "rgb") return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;
|
|
2848
|
+
if (format4 === "hsl") return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;
|
|
2903
2849
|
return color;
|
|
2904
2850
|
};
|
|
2905
2851
|
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
@@ -3773,8 +3719,7 @@ TableRow.displayName = "TableRow";
|
|
|
3773
3719
|
var TableHead = React24__namespace.forwardRef(
|
|
3774
3720
|
({ className, sortable, sorted, onSort, align = "left", children, ...props }, ref) => {
|
|
3775
3721
|
const renderSortIcon = () => {
|
|
3776
|
-
if (!sortable)
|
|
3777
|
-
return null;
|
|
3722
|
+
if (!sortable) return null;
|
|
3778
3723
|
if (sorted === "asc") {
|
|
3779
3724
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
3780
3725
|
"svg",
|
|
@@ -4103,14 +4048,10 @@ var DatePicker = React24__namespace.forwardRef(function DatePicker2({
|
|
|
4103
4048
|
handleSelect(today);
|
|
4104
4049
|
};
|
|
4105
4050
|
const isDateDisabled = (date) => {
|
|
4106
|
-
if (minDate && date < minDate)
|
|
4107
|
-
|
|
4108
|
-
if (
|
|
4109
|
-
|
|
4110
|
-
if (disabledDates?.some((d) => d.toDateString() === date.toDateString()))
|
|
4111
|
-
return true;
|
|
4112
|
-
if (disabledDaysOfWeek?.includes(date.getDay()))
|
|
4113
|
-
return true;
|
|
4051
|
+
if (minDate && date < minDate) return true;
|
|
4052
|
+
if (maxDate && date > maxDate) return true;
|
|
4053
|
+
if (disabledDates?.some((d) => d.toDateString() === date.toDateString())) return true;
|
|
4054
|
+
if (disabledDaysOfWeek?.includes(date.getDay())) return true;
|
|
4114
4055
|
return false;
|
|
4115
4056
|
};
|
|
4116
4057
|
const displayValue = internalDate && dateFns.isValid(internalDate) ? dateFns.format(internalDate, formatString) : null;
|
|
@@ -4253,8 +4194,7 @@ var DateRangePicker = React24__namespace.forwardRef(function DateRangePicker2({
|
|
|
4253
4194
|
}
|
|
4254
4195
|
};
|
|
4255
4196
|
const displayValue = React24__namespace.useMemo(() => {
|
|
4256
|
-
if (!internalRange?.from)
|
|
4257
|
-
return null;
|
|
4197
|
+
if (!internalRange?.from) return null;
|
|
4258
4198
|
if (!internalRange?.to) {
|
|
4259
4199
|
return dateFns.format(internalRange.from, formatString);
|
|
4260
4200
|
}
|
|
@@ -4498,8 +4438,7 @@ function DraggableList({
|
|
|
4498
4438
|
}) {
|
|
4499
4439
|
const [draggedIndex, setDraggedIndex] = React24__namespace.useState(null);
|
|
4500
4440
|
const handleDragStart = (e, index) => {
|
|
4501
|
-
if (disabled)
|
|
4502
|
-
return;
|
|
4441
|
+
if (disabled) return;
|
|
4503
4442
|
setDraggedIndex(index);
|
|
4504
4443
|
e.dataTransfer.effectAllowed = "move";
|
|
4505
4444
|
};
|
|
@@ -4793,19 +4732,14 @@ var Progress = React24__namespace.forwardRef(({
|
|
|
4793
4732
|
});
|
|
4794
4733
|
Progress.displayName = "Progress";
|
|
4795
4734
|
var getFileIcon = (type) => {
|
|
4796
|
-
if (type.startsWith("image/"))
|
|
4797
|
-
|
|
4798
|
-
if (type.startsWith("
|
|
4799
|
-
|
|
4800
|
-
if (type.startsWith("audio/"))
|
|
4801
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Music, { className: "h-4 w-4" });
|
|
4802
|
-
if (type.includes("text") || type.includes("document"))
|
|
4803
|
-
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-4 w-4" });
|
|
4735
|
+
if (type.startsWith("image/")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Image, { className: "h-4 w-4" });
|
|
4736
|
+
if (type.startsWith("video/")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Video, { className: "h-4 w-4" });
|
|
4737
|
+
if (type.startsWith("audio/")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Music, { className: "h-4 w-4" });
|
|
4738
|
+
if (type.includes("text") || type.includes("document")) return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-4 w-4" });
|
|
4804
4739
|
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.File, { className: "h-4 w-4" });
|
|
4805
4740
|
};
|
|
4806
4741
|
var formatFileSize = (bytes) => {
|
|
4807
|
-
if (bytes === 0)
|
|
4808
|
-
return "0 Bytes";
|
|
4742
|
+
if (bytes === 0) return "0 Bytes";
|
|
4809
4743
|
const k = 1024;
|
|
4810
4744
|
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
4811
4745
|
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
@@ -4842,6 +4776,7 @@ var FileItem = ({
|
|
|
4842
4776
|
size: "sm",
|
|
4843
4777
|
className: "h-6 w-6 p-0",
|
|
4844
4778
|
onClick: () => onRemove(id),
|
|
4779
|
+
"aria-label": `Remove ${file.name}`,
|
|
4845
4780
|
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "h-3 w-3" })
|
|
4846
4781
|
}
|
|
4847
4782
|
)
|
|
@@ -4951,7 +4886,7 @@ var FileUpload = React24__namespace.default.forwardRef(
|
|
|
4951
4886
|
}
|
|
4952
4887
|
if (onUpload) {
|
|
4953
4888
|
try {
|
|
4954
|
-
await onUpload(
|
|
4889
|
+
await onUpload(newUploadedFiles);
|
|
4955
4890
|
} catch (error2) {
|
|
4956
4891
|
console.error("Upload failed:", error2);
|
|
4957
4892
|
setUploadedFiles(
|
|
@@ -4965,8 +4900,7 @@ var FileUpload = React24__namespace.default.forwardRef(
|
|
|
4965
4900
|
const handleDrop = React24.useCallback((e) => {
|
|
4966
4901
|
e.preventDefault();
|
|
4967
4902
|
setIsDragOver(false);
|
|
4968
|
-
if (disabled)
|
|
4969
|
-
return;
|
|
4903
|
+
if (disabled) return;
|
|
4970
4904
|
const files = e.dataTransfer.files;
|
|
4971
4905
|
if (files.length > 0) {
|
|
4972
4906
|
processFiles(files);
|
|
@@ -5108,8 +5042,7 @@ var GestureDrawer = React24__namespace.default.forwardRef(
|
|
|
5108
5042
|
const motionValue = isVertical ? y : x;
|
|
5109
5043
|
const opacity = framerMotion.useTransform(motionValue, [0, threshold], [1, 0.5]);
|
|
5110
5044
|
const handleDragEnd = (event, info) => {
|
|
5111
|
-
if (!enableSwipeToClose)
|
|
5112
|
-
return;
|
|
5045
|
+
if (!enableSwipeToClose) return;
|
|
5113
5046
|
const offset = isVertical ? info.offset.y : info.offset.x;
|
|
5114
5047
|
const velocity = isVertical ? info.velocity.y : info.velocity.x;
|
|
5115
5048
|
let shouldClose = false;
|
|
@@ -5150,8 +5083,7 @@ var GestureDrawer = React24__namespace.default.forwardRef(
|
|
|
5150
5083
|
const getAnimatePosition = () => {
|
|
5151
5084
|
return isVertical ? { y: 0 } : { x: 0 };
|
|
5152
5085
|
};
|
|
5153
|
-
if (!isOpen)
|
|
5154
|
-
return null;
|
|
5086
|
+
if (!isOpen) return null;
|
|
5155
5087
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-50", children: [
|
|
5156
5088
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5157
5089
|
framerMotion.motion.div,
|
|
@@ -5443,8 +5375,7 @@ function LockedComponent({
|
|
|
5443
5375
|
const [isPreviewActive, setIsPreviewActive] = React24.useState(false);
|
|
5444
5376
|
const [previewTimeout, setPreviewTimeout] = React24.useState(null);
|
|
5445
5377
|
const handleMouseEnter = () => {
|
|
5446
|
-
if (!showPreview)
|
|
5447
|
-
return;
|
|
5378
|
+
if (!showPreview) return;
|
|
5448
5379
|
setIsPreviewActive(true);
|
|
5449
5380
|
if (previewTimeout) {
|
|
5450
5381
|
clearTimeout(previewTimeout);
|
|
@@ -5550,7 +5481,6 @@ function ProComponentWrapper({
|
|
|
5550
5481
|
nodeEnv: process.env.NODE_ENV === "development",
|
|
5551
5482
|
nextPublicEnv: process.env.NEXT_PUBLIC_VERCEL_ENV === "development",
|
|
5552
5483
|
localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local")),
|
|
5553
|
-
port: typeof window !== "undefined" && (window.location.port === "3000" || window.location.port === "3001" || window.location.port === "8080"),
|
|
5554
5484
|
vercelEnv: !process.env.VERCEL,
|
|
5555
5485
|
ciEnv: !process.env.CI,
|
|
5556
5486
|
deploymentEnv: !process.env.DEPLOYMENT_ENV
|
|
@@ -5631,9 +5561,7 @@ function ProComponentWrapper({
|
|
|
5631
5561
|
const isDevelopment = () => {
|
|
5632
5562
|
const checks = {
|
|
5633
5563
|
nodeEnv: process.env.NODE_ENV === "development",
|
|
5634
|
-
localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local"))
|
|
5635
|
-
port: typeof window !== "undefined" && (window.location.port === "3000" || window.location.port === "3001" || window.location.port === "8080")
|
|
5636
|
-
};
|
|
5564
|
+
localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local"))};
|
|
5637
5565
|
if (process.env.VERCEL || process.env.NETLIFY || process.env.RENDER || process.env.RAILWAY_ENVIRONMENT || process.env.FLY_APP_NAME) {
|
|
5638
5566
|
return false;
|
|
5639
5567
|
}
|
|
@@ -6098,30 +6026,22 @@ var formatPhoneNumber = (value, countryCode) => {
|
|
|
6098
6026
|
const cleaned = value.replace(/\D/g, "");
|
|
6099
6027
|
switch (countryCode) {
|
|
6100
6028
|
case "+1":
|
|
6101
|
-
if (cleaned.length <= 3)
|
|
6102
|
-
|
|
6103
|
-
if (cleaned.length <= 6)
|
|
6104
|
-
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
|
|
6029
|
+
if (cleaned.length <= 3) return cleaned;
|
|
6030
|
+
if (cleaned.length <= 6) return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
|
|
6105
6031
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)}-${cleaned.slice(6, 10)}`;
|
|
6106
6032
|
case "+44":
|
|
6107
|
-
if (cleaned.length <= 4)
|
|
6108
|
-
|
|
6109
|
-
if (cleaned.length <= 7)
|
|
6110
|
-
return `${cleaned.slice(0, 4)} ${cleaned.slice(4)}`;
|
|
6033
|
+
if (cleaned.length <= 4) return cleaned;
|
|
6034
|
+
if (cleaned.length <= 7) return `${cleaned.slice(0, 4)} ${cleaned.slice(4)}`;
|
|
6111
6035
|
return `${cleaned.slice(0, 4)} ${cleaned.slice(4, 7)} ${cleaned.slice(7, 11)}`;
|
|
6112
6036
|
case "+90":
|
|
6113
|
-
if (cleaned.length <= 3)
|
|
6114
|
-
|
|
6115
|
-
if (cleaned.length <= 6)
|
|
6116
|
-
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
|
|
6117
|
-
if (cleaned.length <= 9)
|
|
6118
|
-
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6)}`;
|
|
6037
|
+
if (cleaned.length <= 3) return cleaned;
|
|
6038
|
+
if (cleaned.length <= 6) return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
|
|
6039
|
+
if (cleaned.length <= 9) return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6)}`;
|
|
6119
6040
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8, 10)}`;
|
|
6120
6041
|
default:
|
|
6121
6042
|
let formatted = "";
|
|
6122
6043
|
for (let i = 0; i < cleaned.length; i++) {
|
|
6123
|
-
if (i > 0 && i % 3 === 0)
|
|
6124
|
-
formatted += " ";
|
|
6044
|
+
if (i > 0 && i % 3 === 0) formatted += " ";
|
|
6125
6045
|
formatted += cleaned[i];
|
|
6126
6046
|
}
|
|
6127
6047
|
return formatted;
|
|
@@ -6131,10 +6051,13 @@ var getMaxLength = (countryCode) => {
|
|
|
6131
6051
|
switch (countryCode) {
|
|
6132
6052
|
case "+1":
|
|
6133
6053
|
return 10;
|
|
6054
|
+
// US/Canada
|
|
6134
6055
|
case "+44":
|
|
6135
6056
|
return 11;
|
|
6057
|
+
// UK
|
|
6136
6058
|
case "+90":
|
|
6137
6059
|
return 10;
|
|
6060
|
+
// Turkey
|
|
6138
6061
|
default:
|
|
6139
6062
|
return 15;
|
|
6140
6063
|
}
|
|
@@ -6510,8 +6433,7 @@ var ScrollReveal = React24__namespace.forwardRef(
|
|
|
6510
6433
|
}, ref) => {
|
|
6511
6434
|
const shouldTriggerOnce = triggerOnce !== void 0 ? triggerOnce : once;
|
|
6512
6435
|
const animationVariants = React24__namespace.useMemo(() => {
|
|
6513
|
-
if (variants)
|
|
6514
|
-
return variants;
|
|
6436
|
+
if (variants) return variants;
|
|
6515
6437
|
return createDefaultVariants(direction, distance);
|
|
6516
6438
|
}, [direction, distance, variants]);
|
|
6517
6439
|
const transition = React24__namespace.useMemo(() => ({
|
|
@@ -6610,8 +6532,7 @@ var ScrollRevealItem = React24__namespace.forwardRef(
|
|
|
6610
6532
|
id
|
|
6611
6533
|
}, ref) => {
|
|
6612
6534
|
const animationVariants = React24__namespace.useMemo(() => {
|
|
6613
|
-
if (variants)
|
|
6614
|
-
return variants;
|
|
6535
|
+
if (variants) return variants;
|
|
6615
6536
|
return createDefaultVariants(direction, distance);
|
|
6616
6537
|
}, [direction, distance, variants]);
|
|
6617
6538
|
const transition = React24__namespace.useMemo(() => ({
|
|
@@ -6936,7 +6857,7 @@ var SimpleEditor = React24__namespace.default.forwardRef(
|
|
|
6936
6857
|
const [content, setContent] = React24.useState(value);
|
|
6937
6858
|
const [isPreview, setIsPreview] = React24.useState(false);
|
|
6938
6859
|
const [sourceContent, setSourceContent] = React24.useState(value);
|
|
6939
|
-
React24.useState(null);
|
|
6860
|
+
const [selection, setSelection] = React24.useState(null);
|
|
6940
6861
|
const editorRef = React24__namespace.default.useRef(null);
|
|
6941
6862
|
const sourceRef = React24__namespace.default.useRef(null);
|
|
6942
6863
|
const [formatState, setFormatState] = React24.useState({
|
|
@@ -6965,8 +6886,7 @@ var SimpleEditor = React24__namespace.default.forwardRef(
|
|
|
6965
6886
|
return null;
|
|
6966
6887
|
}, []);
|
|
6967
6888
|
React24.useCallback((range) => {
|
|
6968
|
-
if (!range)
|
|
6969
|
-
return;
|
|
6889
|
+
if (!range) return;
|
|
6970
6890
|
const selection2 = window.getSelection();
|
|
6971
6891
|
if (selection2) {
|
|
6972
6892
|
selection2.removeAllRanges();
|
|
@@ -6974,8 +6894,7 @@ var SimpleEditor = React24__namespace.default.forwardRef(
|
|
|
6974
6894
|
}
|
|
6975
6895
|
}, []);
|
|
6976
6896
|
const executeCommand = React24.useCallback((command, value2) => {
|
|
6977
|
-
if (disabled)
|
|
6978
|
-
return;
|
|
6897
|
+
if (disabled) return;
|
|
6979
6898
|
if (editorRef.current) {
|
|
6980
6899
|
editorRef.current.focus();
|
|
6981
6900
|
}
|
|
@@ -7718,19 +7637,16 @@ var SwipeableCard = React24__namespace.forwardRef(
|
|
|
7718
7637
|
const [currentX, setCurrentX] = React24__namespace.useState(0);
|
|
7719
7638
|
const [isSwiping, setIsSwiping] = React24__namespace.useState(false);
|
|
7720
7639
|
const handleTouchStart = (e) => {
|
|
7721
|
-
if (disabled)
|
|
7722
|
-
return;
|
|
7640
|
+
if (disabled) return;
|
|
7723
7641
|
setStartX(e.touches[0].clientX);
|
|
7724
7642
|
setIsSwiping(true);
|
|
7725
7643
|
};
|
|
7726
7644
|
const handleTouchMove = (e) => {
|
|
7727
|
-
if (disabled || !isSwiping)
|
|
7728
|
-
return;
|
|
7645
|
+
if (disabled || !isSwiping) return;
|
|
7729
7646
|
setCurrentX(e.touches[0].clientX);
|
|
7730
7647
|
};
|
|
7731
7648
|
const handleTouchEnd = () => {
|
|
7732
|
-
if (disabled || !isSwiping)
|
|
7733
|
-
return;
|
|
7649
|
+
if (disabled || !isSwiping) return;
|
|
7734
7650
|
const deltaX = currentX - startX;
|
|
7735
7651
|
if (Math.abs(deltaX) > threshold) {
|
|
7736
7652
|
if (deltaX > 0 && onSwipeRight) {
|
|
@@ -7870,8 +7786,7 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7870
7786
|
const tagButtonRefs = React24__namespace.useRef([]);
|
|
7871
7787
|
const errorId = React24__namespace.useId();
|
|
7872
7788
|
const focusTag = (index) => {
|
|
7873
|
-
if (value.length === 0)
|
|
7874
|
-
return;
|
|
7789
|
+
if (value.length === 0) return;
|
|
7875
7790
|
const clamped = Math.max(0, Math.min(value.length - 1, index));
|
|
7876
7791
|
tagButtonRefs.current[clamped]?.focus();
|
|
7877
7792
|
};
|
|
@@ -7894,10 +7809,8 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7894
7809
|
break;
|
|
7895
7810
|
case "ArrowRight":
|
|
7896
7811
|
e.preventDefault();
|
|
7897
|
-
if (index >= value.length - 1)
|
|
7898
|
-
|
|
7899
|
-
else
|
|
7900
|
-
focusTag(index + 1);
|
|
7812
|
+
if (index >= value.length - 1) innerInputRef.current?.focus();
|
|
7813
|
+
else focusTag(index + 1);
|
|
7901
7814
|
break;
|
|
7902
7815
|
case "Home":
|
|
7903
7816
|
e.preventDefault();
|
|
@@ -7913,10 +7826,8 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7913
7826
|
const remaining = value.length - 1;
|
|
7914
7827
|
removeTag(index);
|
|
7915
7828
|
requestAnimationFrame(() => {
|
|
7916
|
-
if (remaining > 0)
|
|
7917
|
-
|
|
7918
|
-
else
|
|
7919
|
-
innerInputRef.current?.focus();
|
|
7829
|
+
if (remaining > 0) focusTag(Math.min(index, remaining - 1));
|
|
7830
|
+
else innerInputRef.current?.focus();
|
|
7920
7831
|
});
|
|
7921
7832
|
break;
|
|
7922
7833
|
}
|
|
@@ -7924,8 +7835,7 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7924
7835
|
};
|
|
7925
7836
|
const addTag = () => {
|
|
7926
7837
|
const tag = inputValue.trim();
|
|
7927
|
-
if (!tag)
|
|
7928
|
-
return;
|
|
7838
|
+
if (!tag) return;
|
|
7929
7839
|
if (!allowDuplicates && value.includes(tag)) {
|
|
7930
7840
|
setError("This tag already exists");
|
|
7931
7841
|
setTimeout(() => setError(""), 2e3);
|
|
@@ -7941,8 +7851,7 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7941
7851
|
setError("");
|
|
7942
7852
|
};
|
|
7943
7853
|
const removeTag = (index) => {
|
|
7944
|
-
if (disabled)
|
|
7945
|
-
return;
|
|
7854
|
+
if (disabled) return;
|
|
7946
7855
|
onChange(value.filter((_, i) => i !== index));
|
|
7947
7856
|
};
|
|
7948
7857
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
@@ -8072,8 +7981,7 @@ var Textarea = React24__namespace.forwardRef(
|
|
|
8072
7981
|
React24__namespace.useImperativeHandle(ref, () => textareaRef.current);
|
|
8073
7982
|
const adjustHeight = React24__namespace.useCallback(() => {
|
|
8074
7983
|
const textarea = textareaRef.current;
|
|
8075
|
-
if (!textarea || !autoResize)
|
|
8076
|
-
return;
|
|
7984
|
+
if (!textarea || !autoResize) return;
|
|
8077
7985
|
textarea.style.height = "auto";
|
|
8078
7986
|
const newHeight = textarea.scrollHeight;
|
|
8079
7987
|
if (maxHeight && newHeight > maxHeight) {
|
|
@@ -8327,8 +8235,7 @@ function toast({ ...props }) {
|
|
|
8327
8235
|
id,
|
|
8328
8236
|
open: true,
|
|
8329
8237
|
onOpenChange: (open) => {
|
|
8330
|
-
if (!open)
|
|
8331
|
-
dismiss();
|
|
8238
|
+
if (!open) dismiss();
|
|
8332
8239
|
}
|
|
8333
8240
|
}
|
|
8334
8241
|
});
|
|
@@ -8454,18 +8361,15 @@ var Rating = React24__namespace.forwardRef(
|
|
|
8454
8361
|
const displayValue = hoverValue !== null ? hoverValue : currentValue;
|
|
8455
8362
|
const commit = React24__namespace.useCallback(
|
|
8456
8363
|
(next) => {
|
|
8457
|
-
if (readOnly)
|
|
8458
|
-
|
|
8459
|
-
if (!isControlled)
|
|
8460
|
-
setInternalValue(next);
|
|
8364
|
+
if (readOnly) return;
|
|
8365
|
+
if (!isControlled) setInternalValue(next);
|
|
8461
8366
|
onValueChange?.(next);
|
|
8462
8367
|
},
|
|
8463
8368
|
[readOnly, isControlled, onValueChange]
|
|
8464
8369
|
);
|
|
8465
8370
|
const handleKeyDown = React24__namespace.useCallback(
|
|
8466
8371
|
(event) => {
|
|
8467
|
-
if (readOnly)
|
|
8468
|
-
return;
|
|
8372
|
+
if (readOnly) return;
|
|
8469
8373
|
let next = null;
|
|
8470
8374
|
switch (event.key) {
|
|
8471
8375
|
case "ArrowRight":
|
|
@@ -8773,27 +8677,27 @@ var ToggleGroupItem = React24__namespace.forwardRef(({ className, children, vari
|
|
|
8773
8677
|
});
|
|
8774
8678
|
ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
8775
8679
|
|
|
8776
|
-
Object.defineProperty(exports,
|
|
8680
|
+
Object.defineProperty(exports, "Palette", {
|
|
8777
8681
|
enumerable: true,
|
|
8778
8682
|
get: function () { return lucideReact.Palette; }
|
|
8779
8683
|
});
|
|
8780
|
-
Object.defineProperty(exports,
|
|
8684
|
+
Object.defineProperty(exports, "Pipette", {
|
|
8781
8685
|
enumerable: true,
|
|
8782
8686
|
get: function () { return lucideReact.Pipette; }
|
|
8783
8687
|
});
|
|
8784
|
-
Object.defineProperty(exports,
|
|
8688
|
+
Object.defineProperty(exports, "format", {
|
|
8785
8689
|
enumerable: true,
|
|
8786
8690
|
get: function () { return dateFns.format; }
|
|
8787
8691
|
});
|
|
8788
|
-
Object.defineProperty(exports,
|
|
8692
|
+
Object.defineProperty(exports, "REGEXP_ONLY_CHARS", {
|
|
8789
8693
|
enumerable: true,
|
|
8790
8694
|
get: function () { return inputOtp.REGEXP_ONLY_CHARS; }
|
|
8791
8695
|
});
|
|
8792
|
-
Object.defineProperty(exports,
|
|
8696
|
+
Object.defineProperty(exports, "REGEXP_ONLY_DIGITS", {
|
|
8793
8697
|
enumerable: true,
|
|
8794
8698
|
get: function () { return inputOtp.REGEXP_ONLY_DIGITS; }
|
|
8795
8699
|
});
|
|
8796
|
-
Object.defineProperty(exports,
|
|
8700
|
+
Object.defineProperty(exports, "REGEXP_ONLY_DIGITS_AND_CHARS", {
|
|
8797
8701
|
enumerable: true,
|
|
8798
8702
|
get: function () { return inputOtp.REGEXP_ONLY_DIGITS_AND_CHARS; }
|
|
8799
8703
|
});
|
|
@@ -9187,5 +9091,5 @@ exports.toggleVariants = toggleVariants;
|
|
|
9187
9091
|
exports.tooltipVariants = tooltipVariants;
|
|
9188
9092
|
exports.useCarousel = useCarousel;
|
|
9189
9093
|
exports.useToast = useToast;
|
|
9190
|
-
//# sourceMappingURL=
|
|
9094
|
+
//# sourceMappingURL=index.js.map
|
|
9191
9095
|
//# sourceMappingURL=index.js.map
|