@moontra/moonui 6.0.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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.global.js +154 -481
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +83 -180
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +80 -177
- 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/date-picker.stories.tsx +41 -35
- 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));
|
|
@@ -4966,8 +4900,7 @@ var FileUpload = React24__namespace.default.forwardRef(
|
|
|
4966
4900
|
const handleDrop = React24.useCallback((e) => {
|
|
4967
4901
|
e.preventDefault();
|
|
4968
4902
|
setIsDragOver(false);
|
|
4969
|
-
if (disabled)
|
|
4970
|
-
return;
|
|
4903
|
+
if (disabled) return;
|
|
4971
4904
|
const files = e.dataTransfer.files;
|
|
4972
4905
|
if (files.length > 0) {
|
|
4973
4906
|
processFiles(files);
|
|
@@ -5109,8 +5042,7 @@ var GestureDrawer = React24__namespace.default.forwardRef(
|
|
|
5109
5042
|
const motionValue = isVertical ? y : x;
|
|
5110
5043
|
const opacity = framerMotion.useTransform(motionValue, [0, threshold], [1, 0.5]);
|
|
5111
5044
|
const handleDragEnd = (event, info) => {
|
|
5112
|
-
if (!enableSwipeToClose)
|
|
5113
|
-
return;
|
|
5045
|
+
if (!enableSwipeToClose) return;
|
|
5114
5046
|
const offset = isVertical ? info.offset.y : info.offset.x;
|
|
5115
5047
|
const velocity = isVertical ? info.velocity.y : info.velocity.x;
|
|
5116
5048
|
let shouldClose = false;
|
|
@@ -5151,8 +5083,7 @@ var GestureDrawer = React24__namespace.default.forwardRef(
|
|
|
5151
5083
|
const getAnimatePosition = () => {
|
|
5152
5084
|
return isVertical ? { y: 0 } : { x: 0 };
|
|
5153
5085
|
};
|
|
5154
|
-
if (!isOpen)
|
|
5155
|
-
return null;
|
|
5086
|
+
if (!isOpen) return null;
|
|
5156
5087
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-50", children: [
|
|
5157
5088
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5158
5089
|
framerMotion.motion.div,
|
|
@@ -5444,8 +5375,7 @@ function LockedComponent({
|
|
|
5444
5375
|
const [isPreviewActive, setIsPreviewActive] = React24.useState(false);
|
|
5445
5376
|
const [previewTimeout, setPreviewTimeout] = React24.useState(null);
|
|
5446
5377
|
const handleMouseEnter = () => {
|
|
5447
|
-
if (!showPreview)
|
|
5448
|
-
return;
|
|
5378
|
+
if (!showPreview) return;
|
|
5449
5379
|
setIsPreviewActive(true);
|
|
5450
5380
|
if (previewTimeout) {
|
|
5451
5381
|
clearTimeout(previewTimeout);
|
|
@@ -5551,7 +5481,6 @@ function ProComponentWrapper({
|
|
|
5551
5481
|
nodeEnv: process.env.NODE_ENV === "development",
|
|
5552
5482
|
nextPublicEnv: process.env.NEXT_PUBLIC_VERCEL_ENV === "development",
|
|
5553
5483
|
localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local")),
|
|
5554
|
-
port: typeof window !== "undefined" && (window.location.port === "3000" || window.location.port === "3001" || window.location.port === "8080"),
|
|
5555
5484
|
vercelEnv: !process.env.VERCEL,
|
|
5556
5485
|
ciEnv: !process.env.CI,
|
|
5557
5486
|
deploymentEnv: !process.env.DEPLOYMENT_ENV
|
|
@@ -5632,9 +5561,7 @@ function ProComponentWrapper({
|
|
|
5632
5561
|
const isDevelopment = () => {
|
|
5633
5562
|
const checks = {
|
|
5634
5563
|
nodeEnv: process.env.NODE_ENV === "development",
|
|
5635
|
-
localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local"))
|
|
5636
|
-
port: typeof window !== "undefined" && (window.location.port === "3000" || window.location.port === "3001" || window.location.port === "8080")
|
|
5637
|
-
};
|
|
5564
|
+
localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local"))};
|
|
5638
5565
|
if (process.env.VERCEL || process.env.NETLIFY || process.env.RENDER || process.env.RAILWAY_ENVIRONMENT || process.env.FLY_APP_NAME) {
|
|
5639
5566
|
return false;
|
|
5640
5567
|
}
|
|
@@ -6099,30 +6026,22 @@ var formatPhoneNumber = (value, countryCode) => {
|
|
|
6099
6026
|
const cleaned = value.replace(/\D/g, "");
|
|
6100
6027
|
switch (countryCode) {
|
|
6101
6028
|
case "+1":
|
|
6102
|
-
if (cleaned.length <= 3)
|
|
6103
|
-
|
|
6104
|
-
if (cleaned.length <= 6)
|
|
6105
|
-
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)}`;
|
|
6106
6031
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)}-${cleaned.slice(6, 10)}`;
|
|
6107
6032
|
case "+44":
|
|
6108
|
-
if (cleaned.length <= 4)
|
|
6109
|
-
|
|
6110
|
-
if (cleaned.length <= 7)
|
|
6111
|
-
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)}`;
|
|
6112
6035
|
return `${cleaned.slice(0, 4)} ${cleaned.slice(4, 7)} ${cleaned.slice(7, 11)}`;
|
|
6113
6036
|
case "+90":
|
|
6114
|
-
if (cleaned.length <= 3)
|
|
6115
|
-
|
|
6116
|
-
if (cleaned.length <= 6)
|
|
6117
|
-
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
|
|
6118
|
-
if (cleaned.length <= 9)
|
|
6119
|
-
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)}`;
|
|
6120
6040
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8, 10)}`;
|
|
6121
6041
|
default:
|
|
6122
6042
|
let formatted = "";
|
|
6123
6043
|
for (let i = 0; i < cleaned.length; i++) {
|
|
6124
|
-
if (i > 0 && i % 3 === 0)
|
|
6125
|
-
formatted += " ";
|
|
6044
|
+
if (i > 0 && i % 3 === 0) formatted += " ";
|
|
6126
6045
|
formatted += cleaned[i];
|
|
6127
6046
|
}
|
|
6128
6047
|
return formatted;
|
|
@@ -6132,10 +6051,13 @@ var getMaxLength = (countryCode) => {
|
|
|
6132
6051
|
switch (countryCode) {
|
|
6133
6052
|
case "+1":
|
|
6134
6053
|
return 10;
|
|
6054
|
+
// US/Canada
|
|
6135
6055
|
case "+44":
|
|
6136
6056
|
return 11;
|
|
6057
|
+
// UK
|
|
6137
6058
|
case "+90":
|
|
6138
6059
|
return 10;
|
|
6060
|
+
// Turkey
|
|
6139
6061
|
default:
|
|
6140
6062
|
return 15;
|
|
6141
6063
|
}
|
|
@@ -6511,8 +6433,7 @@ var ScrollReveal = React24__namespace.forwardRef(
|
|
|
6511
6433
|
}, ref) => {
|
|
6512
6434
|
const shouldTriggerOnce = triggerOnce !== void 0 ? triggerOnce : once;
|
|
6513
6435
|
const animationVariants = React24__namespace.useMemo(() => {
|
|
6514
|
-
if (variants)
|
|
6515
|
-
return variants;
|
|
6436
|
+
if (variants) return variants;
|
|
6516
6437
|
return createDefaultVariants(direction, distance);
|
|
6517
6438
|
}, [direction, distance, variants]);
|
|
6518
6439
|
const transition = React24__namespace.useMemo(() => ({
|
|
@@ -6611,8 +6532,7 @@ var ScrollRevealItem = React24__namespace.forwardRef(
|
|
|
6611
6532
|
id
|
|
6612
6533
|
}, ref) => {
|
|
6613
6534
|
const animationVariants = React24__namespace.useMemo(() => {
|
|
6614
|
-
if (variants)
|
|
6615
|
-
return variants;
|
|
6535
|
+
if (variants) return variants;
|
|
6616
6536
|
return createDefaultVariants(direction, distance);
|
|
6617
6537
|
}, [direction, distance, variants]);
|
|
6618
6538
|
const transition = React24__namespace.useMemo(() => ({
|
|
@@ -6937,7 +6857,7 @@ var SimpleEditor = React24__namespace.default.forwardRef(
|
|
|
6937
6857
|
const [content, setContent] = React24.useState(value);
|
|
6938
6858
|
const [isPreview, setIsPreview] = React24.useState(false);
|
|
6939
6859
|
const [sourceContent, setSourceContent] = React24.useState(value);
|
|
6940
|
-
React24.useState(null);
|
|
6860
|
+
const [selection, setSelection] = React24.useState(null);
|
|
6941
6861
|
const editorRef = React24__namespace.default.useRef(null);
|
|
6942
6862
|
const sourceRef = React24__namespace.default.useRef(null);
|
|
6943
6863
|
const [formatState, setFormatState] = React24.useState({
|
|
@@ -6966,8 +6886,7 @@ var SimpleEditor = React24__namespace.default.forwardRef(
|
|
|
6966
6886
|
return null;
|
|
6967
6887
|
}, []);
|
|
6968
6888
|
React24.useCallback((range) => {
|
|
6969
|
-
if (!range)
|
|
6970
|
-
return;
|
|
6889
|
+
if (!range) return;
|
|
6971
6890
|
const selection2 = window.getSelection();
|
|
6972
6891
|
if (selection2) {
|
|
6973
6892
|
selection2.removeAllRanges();
|
|
@@ -6975,8 +6894,7 @@ var SimpleEditor = React24__namespace.default.forwardRef(
|
|
|
6975
6894
|
}
|
|
6976
6895
|
}, []);
|
|
6977
6896
|
const executeCommand = React24.useCallback((command, value2) => {
|
|
6978
|
-
if (disabled)
|
|
6979
|
-
return;
|
|
6897
|
+
if (disabled) return;
|
|
6980
6898
|
if (editorRef.current) {
|
|
6981
6899
|
editorRef.current.focus();
|
|
6982
6900
|
}
|
|
@@ -7719,19 +7637,16 @@ var SwipeableCard = React24__namespace.forwardRef(
|
|
|
7719
7637
|
const [currentX, setCurrentX] = React24__namespace.useState(0);
|
|
7720
7638
|
const [isSwiping, setIsSwiping] = React24__namespace.useState(false);
|
|
7721
7639
|
const handleTouchStart = (e) => {
|
|
7722
|
-
if (disabled)
|
|
7723
|
-
return;
|
|
7640
|
+
if (disabled) return;
|
|
7724
7641
|
setStartX(e.touches[0].clientX);
|
|
7725
7642
|
setIsSwiping(true);
|
|
7726
7643
|
};
|
|
7727
7644
|
const handleTouchMove = (e) => {
|
|
7728
|
-
if (disabled || !isSwiping)
|
|
7729
|
-
return;
|
|
7645
|
+
if (disabled || !isSwiping) return;
|
|
7730
7646
|
setCurrentX(e.touches[0].clientX);
|
|
7731
7647
|
};
|
|
7732
7648
|
const handleTouchEnd = () => {
|
|
7733
|
-
if (disabled || !isSwiping)
|
|
7734
|
-
return;
|
|
7649
|
+
if (disabled || !isSwiping) return;
|
|
7735
7650
|
const deltaX = currentX - startX;
|
|
7736
7651
|
if (Math.abs(deltaX) > threshold) {
|
|
7737
7652
|
if (deltaX > 0 && onSwipeRight) {
|
|
@@ -7871,8 +7786,7 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7871
7786
|
const tagButtonRefs = React24__namespace.useRef([]);
|
|
7872
7787
|
const errorId = React24__namespace.useId();
|
|
7873
7788
|
const focusTag = (index) => {
|
|
7874
|
-
if (value.length === 0)
|
|
7875
|
-
return;
|
|
7789
|
+
if (value.length === 0) return;
|
|
7876
7790
|
const clamped = Math.max(0, Math.min(value.length - 1, index));
|
|
7877
7791
|
tagButtonRefs.current[clamped]?.focus();
|
|
7878
7792
|
};
|
|
@@ -7895,10 +7809,8 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7895
7809
|
break;
|
|
7896
7810
|
case "ArrowRight":
|
|
7897
7811
|
e.preventDefault();
|
|
7898
|
-
if (index >= value.length - 1)
|
|
7899
|
-
|
|
7900
|
-
else
|
|
7901
|
-
focusTag(index + 1);
|
|
7812
|
+
if (index >= value.length - 1) innerInputRef.current?.focus();
|
|
7813
|
+
else focusTag(index + 1);
|
|
7902
7814
|
break;
|
|
7903
7815
|
case "Home":
|
|
7904
7816
|
e.preventDefault();
|
|
@@ -7914,10 +7826,8 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7914
7826
|
const remaining = value.length - 1;
|
|
7915
7827
|
removeTag(index);
|
|
7916
7828
|
requestAnimationFrame(() => {
|
|
7917
|
-
if (remaining > 0)
|
|
7918
|
-
|
|
7919
|
-
else
|
|
7920
|
-
innerInputRef.current?.focus();
|
|
7829
|
+
if (remaining > 0) focusTag(Math.min(index, remaining - 1));
|
|
7830
|
+
else innerInputRef.current?.focus();
|
|
7921
7831
|
});
|
|
7922
7832
|
break;
|
|
7923
7833
|
}
|
|
@@ -7925,8 +7835,7 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7925
7835
|
};
|
|
7926
7836
|
const addTag = () => {
|
|
7927
7837
|
const tag = inputValue.trim();
|
|
7928
|
-
if (!tag)
|
|
7929
|
-
return;
|
|
7838
|
+
if (!tag) return;
|
|
7930
7839
|
if (!allowDuplicates && value.includes(tag)) {
|
|
7931
7840
|
setError("This tag already exists");
|
|
7932
7841
|
setTimeout(() => setError(""), 2e3);
|
|
@@ -7942,8 +7851,7 @@ var TagsInput = React24__namespace.forwardRef(
|
|
|
7942
7851
|
setError("");
|
|
7943
7852
|
};
|
|
7944
7853
|
const removeTag = (index) => {
|
|
7945
|
-
if (disabled)
|
|
7946
|
-
return;
|
|
7854
|
+
if (disabled) return;
|
|
7947
7855
|
onChange(value.filter((_, i) => i !== index));
|
|
7948
7856
|
};
|
|
7949
7857
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
@@ -8073,8 +7981,7 @@ var Textarea = React24__namespace.forwardRef(
|
|
|
8073
7981
|
React24__namespace.useImperativeHandle(ref, () => textareaRef.current);
|
|
8074
7982
|
const adjustHeight = React24__namespace.useCallback(() => {
|
|
8075
7983
|
const textarea = textareaRef.current;
|
|
8076
|
-
if (!textarea || !autoResize)
|
|
8077
|
-
return;
|
|
7984
|
+
if (!textarea || !autoResize) return;
|
|
8078
7985
|
textarea.style.height = "auto";
|
|
8079
7986
|
const newHeight = textarea.scrollHeight;
|
|
8080
7987
|
if (maxHeight && newHeight > maxHeight) {
|
|
@@ -8328,8 +8235,7 @@ function toast({ ...props }) {
|
|
|
8328
8235
|
id,
|
|
8329
8236
|
open: true,
|
|
8330
8237
|
onOpenChange: (open) => {
|
|
8331
|
-
if (!open)
|
|
8332
|
-
dismiss();
|
|
8238
|
+
if (!open) dismiss();
|
|
8333
8239
|
}
|
|
8334
8240
|
}
|
|
8335
8241
|
});
|
|
@@ -8455,18 +8361,15 @@ var Rating = React24__namespace.forwardRef(
|
|
|
8455
8361
|
const displayValue = hoverValue !== null ? hoverValue : currentValue;
|
|
8456
8362
|
const commit = React24__namespace.useCallback(
|
|
8457
8363
|
(next) => {
|
|
8458
|
-
if (readOnly)
|
|
8459
|
-
|
|
8460
|
-
if (!isControlled)
|
|
8461
|
-
setInternalValue(next);
|
|
8364
|
+
if (readOnly) return;
|
|
8365
|
+
if (!isControlled) setInternalValue(next);
|
|
8462
8366
|
onValueChange?.(next);
|
|
8463
8367
|
},
|
|
8464
8368
|
[readOnly, isControlled, onValueChange]
|
|
8465
8369
|
);
|
|
8466
8370
|
const handleKeyDown = React24__namespace.useCallback(
|
|
8467
8371
|
(event) => {
|
|
8468
|
-
if (readOnly)
|
|
8469
|
-
return;
|
|
8372
|
+
if (readOnly) return;
|
|
8470
8373
|
let next = null;
|
|
8471
8374
|
switch (event.key) {
|
|
8472
8375
|
case "ArrowRight":
|
|
@@ -8774,27 +8677,27 @@ var ToggleGroupItem = React24__namespace.forwardRef(({ className, children, vari
|
|
|
8774
8677
|
});
|
|
8775
8678
|
ToggleGroupItem.displayName = "ToggleGroupItem";
|
|
8776
8679
|
|
|
8777
|
-
Object.defineProperty(exports,
|
|
8680
|
+
Object.defineProperty(exports, "Palette", {
|
|
8778
8681
|
enumerable: true,
|
|
8779
8682
|
get: function () { return lucideReact.Palette; }
|
|
8780
8683
|
});
|
|
8781
|
-
Object.defineProperty(exports,
|
|
8684
|
+
Object.defineProperty(exports, "Pipette", {
|
|
8782
8685
|
enumerable: true,
|
|
8783
8686
|
get: function () { return lucideReact.Pipette; }
|
|
8784
8687
|
});
|
|
8785
|
-
Object.defineProperty(exports,
|
|
8688
|
+
Object.defineProperty(exports, "format", {
|
|
8786
8689
|
enumerable: true,
|
|
8787
8690
|
get: function () { return dateFns.format; }
|
|
8788
8691
|
});
|
|
8789
|
-
Object.defineProperty(exports,
|
|
8692
|
+
Object.defineProperty(exports, "REGEXP_ONLY_CHARS", {
|
|
8790
8693
|
enumerable: true,
|
|
8791
8694
|
get: function () { return inputOtp.REGEXP_ONLY_CHARS; }
|
|
8792
8695
|
});
|
|
8793
|
-
Object.defineProperty(exports,
|
|
8696
|
+
Object.defineProperty(exports, "REGEXP_ONLY_DIGITS", {
|
|
8794
8697
|
enumerable: true,
|
|
8795
8698
|
get: function () { return inputOtp.REGEXP_ONLY_DIGITS; }
|
|
8796
8699
|
});
|
|
8797
|
-
Object.defineProperty(exports,
|
|
8700
|
+
Object.defineProperty(exports, "REGEXP_ONLY_DIGITS_AND_CHARS", {
|
|
8798
8701
|
enumerable: true,
|
|
8799
8702
|
get: function () { return inputOtp.REGEXP_ONLY_DIGITS_AND_CHARS; }
|
|
8800
8703
|
});
|
|
@@ -9188,5 +9091,5 @@ exports.toggleVariants = toggleVariants;
|
|
|
9188
9091
|
exports.tooltipVariants = tooltipVariants;
|
|
9189
9092
|
exports.useCarousel = useCarousel;
|
|
9190
9093
|
exports.useToast = useToast;
|
|
9191
|
-
//# sourceMappingURL=
|
|
9094
|
+
//# sourceMappingURL=index.js.map
|
|
9192
9095
|
//# sourceMappingURL=index.js.map
|