@moontra/moonui 2.3.10 → 2.4.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.d.mts +50 -16
- package/dist/index.d.ts +50 -16
- package/dist/index.global.js +538 -37
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +858 -220
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +857 -219
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/components/ui/input.tsx +92 -19
- package/src/components/ui/pagination.tsx +1 -1
- package/src/components/ui/textarea.tsx +194 -20
package/dist/index.js
CHANGED
|
@@ -966,7 +966,26 @@ var springAnimations = {
|
|
|
966
966
|
type: "spring",
|
|
967
967
|
stiffness: 260,
|
|
968
968
|
damping: 20
|
|
969
|
-
}
|
|
969
|
+
},
|
|
970
|
+
// Bouncy spring for playful interactions
|
|
971
|
+
bouncy: {
|
|
972
|
+
type: "spring",
|
|
973
|
+
stiffness: 300,
|
|
974
|
+
damping: 15
|
|
975
|
+
},
|
|
976
|
+
// Stiff spring for quick responses
|
|
977
|
+
stiff: {
|
|
978
|
+
type: "spring",
|
|
979
|
+
stiffness: 400,
|
|
980
|
+
damping: 25
|
|
981
|
+
},
|
|
982
|
+
// Gentle spring for subtle movements
|
|
983
|
+
gentle: {
|
|
984
|
+
type: "spring",
|
|
985
|
+
stiffness: 150,
|
|
986
|
+
damping: 15
|
|
987
|
+
}
|
|
988
|
+
};
|
|
970
989
|
var hoverAnimations = {
|
|
971
990
|
lift: {
|
|
972
991
|
y: -2,
|
|
@@ -979,12 +998,22 @@ var hoverAnimations = {
|
|
|
979
998
|
glow: {
|
|
980
999
|
boxShadow: "0 0 20px rgba(var(--primary), 0.3)",
|
|
981
1000
|
transition: springAnimations.smooth
|
|
982
|
-
}
|
|
1001
|
+
},
|
|
1002
|
+
rotate: {
|
|
1003
|
+
rotate: 2,
|
|
1004
|
+
transition: springAnimations.bouncy
|
|
1005
|
+
}
|
|
1006
|
+
};
|
|
983
1007
|
var tapAnimations = {
|
|
984
1008
|
scale: {
|
|
985
1009
|
scale: 0.95,
|
|
986
1010
|
transition: { duration: 0.1 }
|
|
987
|
-
}
|
|
1011
|
+
},
|
|
1012
|
+
depress: {
|
|
1013
|
+
y: 1,
|
|
1014
|
+
transition: { duration: 0.1 }
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
988
1017
|
var skeletonAnimation = {
|
|
989
1018
|
initial: { opacity: 0.5 },
|
|
990
1019
|
animate: {
|
|
@@ -1109,7 +1138,8 @@ var getCardType = (number) => {
|
|
|
1109
1138
|
jcb: /^35/
|
|
1110
1139
|
};
|
|
1111
1140
|
for (const [type, pattern] of Object.entries(patterns)) {
|
|
1112
|
-
if (pattern.test(number))
|
|
1141
|
+
if (pattern.test(number))
|
|
1142
|
+
return type;
|
|
1113
1143
|
}
|
|
1114
1144
|
return "unknown";
|
|
1115
1145
|
};
|
|
@@ -1119,8 +1149,10 @@ var formatCardNumber = (value, cardType) => {
|
|
|
1119
1149
|
let formatted = "";
|
|
1120
1150
|
let position = 0;
|
|
1121
1151
|
for (const group of groups) {
|
|
1122
|
-
if (position >= cleaned.length)
|
|
1123
|
-
|
|
1152
|
+
if (position >= cleaned.length)
|
|
1153
|
+
break;
|
|
1154
|
+
if (formatted)
|
|
1155
|
+
formatted += " ";
|
|
1124
1156
|
formatted += cleaned.slice(position, position + group);
|
|
1125
1157
|
position += group;
|
|
1126
1158
|
}
|
|
@@ -1446,8 +1478,10 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
1446
1478
|
function useContext22(consumerName, scope) {
|
|
1447
1479
|
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
1448
1480
|
const context = t__namespace.useContext(Context);
|
|
1449
|
-
if (context)
|
|
1450
|
-
|
|
1481
|
+
if (context)
|
|
1482
|
+
return context;
|
|
1483
|
+
if (defaultContext !== void 0)
|
|
1484
|
+
return defaultContext;
|
|
1451
1485
|
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
1452
1486
|
}
|
|
1453
1487
|
return [Provider3, useContext22];
|
|
@@ -1469,7 +1503,8 @@ function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
|
1469
1503
|
}
|
|
1470
1504
|
function composeContextScopes(...scopes) {
|
|
1471
1505
|
const baseScope = scopes[0];
|
|
1472
|
-
if (scopes.length === 1)
|
|
1506
|
+
if (scopes.length === 1)
|
|
1507
|
+
return baseScope;
|
|
1473
1508
|
const createScope = () => {
|
|
1474
1509
|
const scopeHooks = scopes.map((createScope2) => ({
|
|
1475
1510
|
useScope: createScope2(),
|
|
@@ -1746,12 +1781,13 @@ var count = 0;
|
|
|
1746
1781
|
function useId2(deterministicId) {
|
|
1747
1782
|
const [id, setId] = t__namespace.useState(useReactId());
|
|
1748
1783
|
useLayoutEffect2(() => {
|
|
1749
|
-
|
|
1784
|
+
if (!deterministicId)
|
|
1785
|
+
setId((reactId) => reactId ?? String(count++));
|
|
1750
1786
|
}, [deterministicId]);
|
|
1751
1787
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
1752
1788
|
}
|
|
1753
1789
|
var COLLAPSIBLE_NAME = "Collapsible";
|
|
1754
|
-
var [createCollapsibleContext] = createContextScope(COLLAPSIBLE_NAME);
|
|
1790
|
+
var [createCollapsibleContext, createCollapsibleScope] = createContextScope(COLLAPSIBLE_NAME);
|
|
1755
1791
|
var [CollapsibleProvider, useCollapsibleContext] = createCollapsibleContext(COLLAPSIBLE_NAME);
|
|
1756
1792
|
var Collapsible = t__namespace.forwardRef(
|
|
1757
1793
|
(props, forwardedRef) => {
|
|
@@ -1990,10 +2026,10 @@ var inputVariants = classVarianceAuthority.cva(
|
|
|
1990
2026
|
{
|
|
1991
2027
|
variants: {
|
|
1992
2028
|
variant: {
|
|
1993
|
-
standard: "border border-gray-300 dark:border-gray-700 rounded-md px-3 py-2 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:bg-gray-
|
|
1994
|
-
filled: "border border-transparent bg-gray-100 dark:bg-gray-800
|
|
2029
|
+
standard: "border border-gray-300 dark:border-gray-700 rounded-md px-3 py-2 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:bg-gray-800/80 dark:shadow-inner dark:shadow-gray-950/10",
|
|
2030
|
+
filled: "border border-transparent bg-gray-100 dark:bg-gray-800 rounded-md px-3 py-2 hover:bg-gray-200 dark:hover:bg-gray-700 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 dark:shadow-inner dark:shadow-gray-950/10",
|
|
1995
2031
|
ghost: "border-none bg-transparent shadow-none px-1 dark:text-gray-300 dark:placeholder:text-gray-500 hover:bg-gray-100/50 dark:hover:bg-gray-800/30 focus-visible:bg-transparent",
|
|
1996
|
-
underline: "border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 py-2 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:text-gray-300"
|
|
2032
|
+
underline: "border-t-0 border-l-0 border-r-0 border-b border-gray-300 dark:border-gray-600 rounded-none px-0 py-2 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-b-2 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:text-gray-300 dark:bg-transparent"
|
|
1997
2033
|
},
|
|
1998
2034
|
size: {
|
|
1999
2035
|
sm: "h-8 text-xs",
|
|
@@ -2053,12 +2089,59 @@ var Input = t__namespace.forwardRef(
|
|
|
2053
2089
|
rightIcon,
|
|
2054
2090
|
rightButton,
|
|
2055
2091
|
alwaysShowMessage = false,
|
|
2092
|
+
label,
|
|
2093
|
+
floatingLabel = false,
|
|
2094
|
+
floatingLabelClassName,
|
|
2095
|
+
value,
|
|
2096
|
+
defaultValue,
|
|
2097
|
+
onChange,
|
|
2098
|
+
onFocus,
|
|
2099
|
+
onBlur,
|
|
2100
|
+
placeholder,
|
|
2056
2101
|
...props
|
|
2057
2102
|
}, ref) => {
|
|
2103
|
+
const [isFocused, setIsFocused] = t__namespace.useState(false);
|
|
2104
|
+
const [internalValue, setInternalValue] = t__namespace.useState(value || defaultValue || "");
|
|
2105
|
+
const hasValue = internalValue !== "" && internalValue !== null && internalValue !== void 0;
|
|
2106
|
+
const isLabelActive = isFocused || hasValue;
|
|
2107
|
+
const handleFocus = (e) => {
|
|
2108
|
+
setIsFocused(true);
|
|
2109
|
+
onFocus?.(e);
|
|
2110
|
+
};
|
|
2111
|
+
const handleBlur = (e) => {
|
|
2112
|
+
setIsFocused(false);
|
|
2113
|
+
onBlur?.(e);
|
|
2114
|
+
};
|
|
2115
|
+
const handleChange = (e) => {
|
|
2116
|
+
setInternalValue(e.target.value);
|
|
2117
|
+
onChange?.(e);
|
|
2118
|
+
};
|
|
2119
|
+
t__namespace.useEffect(() => {
|
|
2120
|
+
if (value !== void 0) {
|
|
2121
|
+
setInternalValue(value);
|
|
2122
|
+
}
|
|
2123
|
+
}, [value]);
|
|
2058
2124
|
const showMessage = alwaysShowMessage || error || success;
|
|
2059
2125
|
const messageType = error ? "error" : success ? "success" : "normal";
|
|
2060
2126
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-1.5 w-full", children: [
|
|
2061
2127
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("moonui-theme", inputWrapperVariants({ size }), wrapperClassName), children: [
|
|
2128
|
+
floatingLabel && label && /* @__PURE__ */ jsxRuntime.jsx(
|
|
2129
|
+
"label",
|
|
2130
|
+
{
|
|
2131
|
+
htmlFor: props.id,
|
|
2132
|
+
className: cn(
|
|
2133
|
+
"absolute transition-all duration-200 pointer-events-none",
|
|
2134
|
+
leftIcon || loading ? "left-10" : "left-3",
|
|
2135
|
+
"text-gray-500 dark:text-gray-400",
|
|
2136
|
+
isLabelActive ? "top-0 -translate-y-1/2 text-xs bg-background dark:bg-gray-800 px-1" : "top-1/2 -translate-y-1/2 text-sm",
|
|
2137
|
+
isFocused && "text-primary dark:text-primary",
|
|
2138
|
+
!!error && "text-error",
|
|
2139
|
+
disabled && "opacity-50",
|
|
2140
|
+
floatingLabelClassName
|
|
2141
|
+
),
|
|
2142
|
+
children: label
|
|
2143
|
+
}
|
|
2144
|
+
),
|
|
2062
2145
|
leftIcon && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none", children: loading ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin" }) : leftIcon }),
|
|
2063
2146
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
2064
2147
|
"input",
|
|
@@ -2083,6 +2166,12 @@ var Input = t__namespace.forwardRef(
|
|
|
2083
2166
|
"data-success": !!success ? "" : void 0,
|
|
2084
2167
|
"aria-invalid": !!error || !!isError || void 0,
|
|
2085
2168
|
"aria-describedby": error ? `${props.id || ""}-error` : success ? `${props.id || ""}-success` : void 0,
|
|
2169
|
+
value,
|
|
2170
|
+
defaultValue,
|
|
2171
|
+
onChange: handleChange,
|
|
2172
|
+
onFocus: handleFocus,
|
|
2173
|
+
onBlur: handleBlur,
|
|
2174
|
+
placeholder: floatingLabel ? isLabelActive ? placeholder : "" : placeholder,
|
|
2086
2175
|
...props
|
|
2087
2176
|
}
|
|
2088
2177
|
),
|
|
@@ -2495,9 +2584,11 @@ var Slider = t__namespace.forwardRef(({
|
|
|
2495
2584
|
}
|
|
2496
2585
|
};
|
|
2497
2586
|
const handleTrackClick = (event) => {
|
|
2498
|
-
if (disabled)
|
|
2587
|
+
if (disabled)
|
|
2588
|
+
return;
|
|
2499
2589
|
const track = trackRef.current;
|
|
2500
|
-
if (!track)
|
|
2590
|
+
if (!track)
|
|
2591
|
+
return;
|
|
2501
2592
|
const rect = track.getBoundingClientRect();
|
|
2502
2593
|
const percent = (event.clientX - rect.left) / rect.width;
|
|
2503
2594
|
const rawValue = min2 + percent * (max2 - min2);
|
|
@@ -2508,11 +2599,13 @@ var Slider = t__namespace.forwardRef(({
|
|
|
2508
2599
|
handleValueChange(newValues);
|
|
2509
2600
|
};
|
|
2510
2601
|
const handleThumbMouseDown = (index) => (event) => {
|
|
2511
|
-
if (disabled)
|
|
2602
|
+
if (disabled)
|
|
2603
|
+
return;
|
|
2512
2604
|
event.preventDefault();
|
|
2513
2605
|
const handleMouseMove = (moveEvent) => {
|
|
2514
2606
|
const track = trackRef.current;
|
|
2515
|
-
if (!track)
|
|
2607
|
+
if (!track)
|
|
2608
|
+
return;
|
|
2516
2609
|
const rect = track.getBoundingClientRect();
|
|
2517
2610
|
const percent = (moveEvent.clientX - rect.left) / rect.width;
|
|
2518
2611
|
const rawValue = min2 + percent * (max2 - min2);
|
|
@@ -2629,7 +2722,8 @@ function rgbToHex(r, g, b) {
|
|
|
2629
2722
|
}
|
|
2630
2723
|
function hexToHsl(hex) {
|
|
2631
2724
|
const rgb = hexToRgb(hex);
|
|
2632
|
-
if (!rgb)
|
|
2725
|
+
if (!rgb)
|
|
2726
|
+
return null;
|
|
2633
2727
|
const r = rgb.r / 255;
|
|
2634
2728
|
const g = rgb.g / 255;
|
|
2635
2729
|
const b = rgb.b / 255;
|
|
@@ -2668,11 +2762,16 @@ function hslToHex(h, s, l) {
|
|
|
2668
2762
|
r = g = b = l;
|
|
2669
2763
|
} else {
|
|
2670
2764
|
const hue2rgb = (p3, q2, t2) => {
|
|
2671
|
-
if (t2 < 0)
|
|
2672
|
-
|
|
2673
|
-
if (t2
|
|
2674
|
-
|
|
2675
|
-
if (t2 <
|
|
2765
|
+
if (t2 < 0)
|
|
2766
|
+
t2 += 1;
|
|
2767
|
+
if (t2 > 1)
|
|
2768
|
+
t2 -= 1;
|
|
2769
|
+
if (t2 < 1 / 6)
|
|
2770
|
+
return p3 + (q2 - p3) * 6 * t2;
|
|
2771
|
+
if (t2 < 1 / 2)
|
|
2772
|
+
return q2;
|
|
2773
|
+
if (t2 < 2 / 3)
|
|
2774
|
+
return p3 + (q2 - p3) * (2 / 3 - t2) * 6;
|
|
2676
2775
|
return p3;
|
|
2677
2776
|
};
|
|
2678
2777
|
const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
|
|
@@ -2789,8 +2888,10 @@ function ColorPicker({
|
|
|
2789
2888
|
}
|
|
2790
2889
|
};
|
|
2791
2890
|
const formatDisplay = () => {
|
|
2792
|
-
if (format4 === "rgb")
|
|
2793
|
-
|
|
2891
|
+
if (format4 === "rgb")
|
|
2892
|
+
return `rgb(${rgb.r}, ${rgb.g}, ${rgb.b})`;
|
|
2893
|
+
if (format4 === "hsl")
|
|
2894
|
+
return `hsl(${hsl.h}, ${hsl.s}%, ${hsl.l}%)`;
|
|
2794
2895
|
return color;
|
|
2795
2896
|
};
|
|
2796
2897
|
return /* @__PURE__ */ jsxRuntime.jsxs(Popover, { open, onOpenChange: setOpen, children: [
|
|
@@ -3207,10 +3308,13 @@ var B = /[\\\/_+.#"@\[\(\{&]/g;
|
|
|
3207
3308
|
var K = /[\s-]/;
|
|
3208
3309
|
var X2 = /[\s-]/g;
|
|
3209
3310
|
function G(_, C, h, P2, A, f, O) {
|
|
3210
|
-
if (f === C.length)
|
|
3311
|
+
if (f === C.length)
|
|
3312
|
+
return A === _.length ? U : k;
|
|
3211
3313
|
var T2 = `${A},${f}`;
|
|
3212
|
-
if (O[T2] !== void 0)
|
|
3213
|
-
|
|
3314
|
+
if (O[T2] !== void 0)
|
|
3315
|
+
return O[T2];
|
|
3316
|
+
for (var L2 = P2.charAt(f), c = h.indexOf(L2, A), S = 0, E, N2, R, M; c >= 0; )
|
|
3317
|
+
E = G(_, C, h, P2, c + 1, f + 1, O), E > S && (c === A ? E *= U : m.test(_.charAt(c - 1)) ? (E *= H, R = _.slice(A, c - 1).match(B), R && A > 0 && (E *= Math.pow(u, R.length))) : K.test(_.charAt(c - 1)) ? (E *= Y, M = _.slice(A, c - 1).match(X2), M && A > 0 && (E *= Math.pow(u, M.length))) : (E *= J, A > 0 && (E *= Math.pow(u, c - A))), _.charAt(c) !== C.charAt(f) && (E *= $)), (E < p && h.charAt(c - 1) === P2.charAt(f + 1) || P2.charAt(f + 1) === P2.charAt(f) && h.charAt(c - 1) !== P2.charAt(f)) && (N2 = G(_, C, h, P2, c + 1, f + 2, O), N2 * p > E && (E = N2 * p)), E > S && (S = E), c = h.indexOf(L2, c + 1);
|
|
3214
3318
|
return O[T2] = S, S;
|
|
3215
3319
|
}
|
|
3216
3320
|
function D(_) {
|
|
@@ -3219,6 +3323,88 @@ function D(_) {
|
|
|
3219
3323
|
function W(_, C, h) {
|
|
3220
3324
|
return _ = h && h.length > 0 ? `${_ + " " + h.join(" ")}` : _, G(_, C, D(_), D(C), 0, 0, {});
|
|
3221
3325
|
}
|
|
3326
|
+
var NODES2 = [
|
|
3327
|
+
"a",
|
|
3328
|
+
"button",
|
|
3329
|
+
"div",
|
|
3330
|
+
"form",
|
|
3331
|
+
"h2",
|
|
3332
|
+
"h3",
|
|
3333
|
+
"img",
|
|
3334
|
+
"input",
|
|
3335
|
+
"label",
|
|
3336
|
+
"li",
|
|
3337
|
+
"nav",
|
|
3338
|
+
"ol",
|
|
3339
|
+
"p",
|
|
3340
|
+
"select",
|
|
3341
|
+
"span",
|
|
3342
|
+
"svg",
|
|
3343
|
+
"ul"
|
|
3344
|
+
];
|
|
3345
|
+
var Primitive2 = NODES2.reduce((primitive, node) => {
|
|
3346
|
+
const Slot = reactSlot.createSlot(`Primitive.${node}`);
|
|
3347
|
+
const Node = t__namespace.forwardRef((props, forwardedRef) => {
|
|
3348
|
+
const { asChild, ...primitiveProps } = props;
|
|
3349
|
+
const Comp = asChild ? Slot : node;
|
|
3350
|
+
if (typeof window !== "undefined") {
|
|
3351
|
+
window[Symbol.for("radix-ui")] = true;
|
|
3352
|
+
}
|
|
3353
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
3354
|
+
});
|
|
3355
|
+
Node.displayName = `Primitive.${node}`;
|
|
3356
|
+
return { ...primitive, [node]: Node };
|
|
3357
|
+
}, {});
|
|
3358
|
+
var useLayoutEffect22 = globalThis?.document ? t__namespace.useLayoutEffect : () => {
|
|
3359
|
+
};
|
|
3360
|
+
|
|
3361
|
+
// ../../node_modules/@radix-ui/react-id/dist/index.mjs
|
|
3362
|
+
var useReactId2 = t__namespace[" useId ".trim().toString()] || (() => void 0);
|
|
3363
|
+
var count2 = 0;
|
|
3364
|
+
function useId3(deterministicId) {
|
|
3365
|
+
const [id, setId] = t__namespace.useState(useReactId2());
|
|
3366
|
+
useLayoutEffect22(() => {
|
|
3367
|
+
if (!deterministicId)
|
|
3368
|
+
setId((reactId) => reactId ?? String(count2++));
|
|
3369
|
+
}, [deterministicId]);
|
|
3370
|
+
return deterministicId || (id ? `radix-${id}` : "");
|
|
3371
|
+
}
|
|
3372
|
+
function setRef2(ref, value) {
|
|
3373
|
+
if (typeof ref === "function") {
|
|
3374
|
+
return ref(value);
|
|
3375
|
+
} else if (ref !== null && ref !== void 0) {
|
|
3376
|
+
ref.current = value;
|
|
3377
|
+
}
|
|
3378
|
+
}
|
|
3379
|
+
function composeRefs2(...refs) {
|
|
3380
|
+
return (node) => {
|
|
3381
|
+
let hasCleanup = false;
|
|
3382
|
+
const cleanups = refs.map((ref) => {
|
|
3383
|
+
const cleanup = setRef2(ref, node);
|
|
3384
|
+
if (!hasCleanup && typeof cleanup == "function") {
|
|
3385
|
+
hasCleanup = true;
|
|
3386
|
+
}
|
|
3387
|
+
return cleanup;
|
|
3388
|
+
});
|
|
3389
|
+
if (hasCleanup) {
|
|
3390
|
+
return () => {
|
|
3391
|
+
for (let i = 0; i < cleanups.length; i++) {
|
|
3392
|
+
const cleanup = cleanups[i];
|
|
3393
|
+
if (typeof cleanup == "function") {
|
|
3394
|
+
cleanup();
|
|
3395
|
+
} else {
|
|
3396
|
+
setRef2(refs[i], null);
|
|
3397
|
+
}
|
|
3398
|
+
}
|
|
3399
|
+
};
|
|
3400
|
+
}
|
|
3401
|
+
};
|
|
3402
|
+
}
|
|
3403
|
+
function useComposedRefs2(...refs) {
|
|
3404
|
+
return t__namespace.useCallback(composeRefs2(...refs), refs);
|
|
3405
|
+
}
|
|
3406
|
+
|
|
3407
|
+
// ../../node_modules/cmdk/dist/index.mjs
|
|
3222
3408
|
var N = '[cmdk-group=""]';
|
|
3223
3409
|
var Y2 = '[cmdk-group-items=""]';
|
|
3224
3410
|
var be = '[cmdk-group-heading=""]';
|
|
@@ -3236,7 +3422,7 @@ var me = t__namespace.forwardRef((r, o) => {
|
|
|
3236
3422
|
let n = L(() => {
|
|
3237
3423
|
var e, a;
|
|
3238
3424
|
return { search: "", value: (a = (e = r.value) != null ? e : r.defaultValue) != null ? a : "", selectedItemId: void 0, filtered: { count: 0, items: /* @__PURE__ */ new Map(), groups: /* @__PURE__ */ new Set() } };
|
|
3239
|
-
}), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r, $2 =
|
|
3425
|
+
}), u2 = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p2 = pe(r), { label: b, children: m2, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = false, vimBindings: j = true, ...O } = r, $2 = useId3(), q = useId3(), _ = useId3(), I = t__namespace.useRef(null), v = ke();
|
|
3240
3426
|
k2(() => {
|
|
3241
3427
|
if (R !== void 0) {
|
|
3242
3428
|
let e = R.trim();
|
|
@@ -3248,7 +3434,8 @@ var me = t__namespace.forwardRef((r, o) => {
|
|
|
3248
3434
|
let E = t__namespace.useMemo(() => ({ subscribe: (e) => (f.current.add(e), () => f.current.delete(e)), snapshot: () => n.current, setState: (e, a, s) => {
|
|
3249
3435
|
var i, l, g, y;
|
|
3250
3436
|
if (!Object.is(n.current[e], a)) {
|
|
3251
|
-
if (n.current[e] = a, e === "search")
|
|
3437
|
+
if (n.current[e] = a, e === "search")
|
|
3438
|
+
J2(), z(), v(1, W2);
|
|
3252
3439
|
else if (e === "value") {
|
|
3253
3440
|
if (document.activeElement.hasAttribute("cmdk-input") || document.activeElement.hasAttribute("cmdk-root")) {
|
|
3254
3441
|
let h = document.getElementById(_);
|
|
@@ -3289,7 +3476,8 @@ var me = t__namespace.forwardRef((r, o) => {
|
|
|
3289
3476
|
return e ? s(e, n.current.search, a) : 0;
|
|
3290
3477
|
}
|
|
3291
3478
|
function z() {
|
|
3292
|
-
if (!n.current.search || p2.current.shouldFilter === false)
|
|
3479
|
+
if (!n.current.search || p2.current.shouldFilter === false)
|
|
3480
|
+
return;
|
|
3293
3481
|
let e = n.current.filtered.items, a = [];
|
|
3294
3482
|
n.current.filtered.groups.forEach((i) => {
|
|
3295
3483
|
let l = c.current.get(i), g = 0;
|
|
@@ -3328,10 +3516,12 @@ var me = t__namespace.forwardRef((r, o) => {
|
|
|
3328
3516
|
let y = (s = (a = d.current.get(g)) == null ? void 0 : a.value) != null ? s : "", h = (l = (i = d.current.get(g)) == null ? void 0 : i.keywords) != null ? l : [], F = te(y, h);
|
|
3329
3517
|
n.current.filtered.items.set(g, F), F > 0 && e++;
|
|
3330
3518
|
}
|
|
3331
|
-
for (let [g, y] of c.current)
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3519
|
+
for (let [g, y] of c.current)
|
|
3520
|
+
for (let h of y)
|
|
3521
|
+
if (n.current.filtered.items.get(h) > 0) {
|
|
3522
|
+
n.current.filtered.groups.add(g);
|
|
3523
|
+
break;
|
|
3524
|
+
}
|
|
3335
3525
|
n.current.filtered.count = e;
|
|
3336
3526
|
}
|
|
3337
3527
|
function ne() {
|
|
@@ -3358,7 +3548,8 @@ var me = t__namespace.forwardRef((r, o) => {
|
|
|
3358
3548
|
}
|
|
3359
3549
|
function re(e) {
|
|
3360
3550
|
let a = M(), s = a == null ? void 0 : a.closest(N), i;
|
|
3361
|
-
for (; s && !i; )
|
|
3551
|
+
for (; s && !i; )
|
|
3552
|
+
s = e > 0 ? we(s, N) : De(s, N), i = s == null ? void 0 : s.querySelector(ce);
|
|
3362
3553
|
i ? E.setState("value", i.getAttribute(T)) : Q(e);
|
|
3363
3554
|
}
|
|
3364
3555
|
let oe = () => X7(V().length - 1), ie = (e) => {
|
|
@@ -3366,58 +3557,61 @@ var me = t__namespace.forwardRef((r, o) => {
|
|
|
3366
3557
|
}, se = (e) => {
|
|
3367
3558
|
e.preventDefault(), e.metaKey ? X7(0) : e.altKey ? re(-1) : Q(-1);
|
|
3368
3559
|
};
|
|
3369
|
-
return t__namespace.createElement(
|
|
3560
|
+
return t__namespace.createElement(Primitive2.div, { ref: o, tabIndex: -1, ...O, "cmdk-root": "", onKeyDown: (e) => {
|
|
3370
3561
|
var s;
|
|
3371
3562
|
(s = O.onKeyDown) == null || s.call(O, e);
|
|
3372
3563
|
let a = e.nativeEvent.isComposing || e.keyCode === 229;
|
|
3373
|
-
if (!(e.defaultPrevented || a))
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
j
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3564
|
+
if (!(e.defaultPrevented || a))
|
|
3565
|
+
switch (e.key) {
|
|
3566
|
+
case "n":
|
|
3567
|
+
case "j": {
|
|
3568
|
+
j && e.ctrlKey && ie(e);
|
|
3569
|
+
break;
|
|
3570
|
+
}
|
|
3571
|
+
case "ArrowDown": {
|
|
3572
|
+
ie(e);
|
|
3573
|
+
break;
|
|
3574
|
+
}
|
|
3575
|
+
case "p":
|
|
3576
|
+
case "k": {
|
|
3577
|
+
j && e.ctrlKey && se(e);
|
|
3578
|
+
break;
|
|
3579
|
+
}
|
|
3580
|
+
case "ArrowUp": {
|
|
3581
|
+
se(e);
|
|
3582
|
+
break;
|
|
3583
|
+
}
|
|
3584
|
+
case "Home": {
|
|
3585
|
+
e.preventDefault(), X7(0);
|
|
3586
|
+
break;
|
|
3587
|
+
}
|
|
3588
|
+
case "End": {
|
|
3589
|
+
e.preventDefault(), oe();
|
|
3590
|
+
break;
|
|
3591
|
+
}
|
|
3592
|
+
case "Enter": {
|
|
3593
|
+
e.preventDefault();
|
|
3594
|
+
let i = M();
|
|
3595
|
+
if (i) {
|
|
3596
|
+
let l = new Event(Z);
|
|
3597
|
+
i.dispatchEvent(l);
|
|
3598
|
+
}
|
|
3406
3599
|
}
|
|
3407
3600
|
}
|
|
3408
|
-
}
|
|
3409
3601
|
} }, t__namespace.createElement("label", { "cmdk-label": "", htmlFor: U2.inputId, id: U2.labelId, style: Te }, b), B2(r, (e) => t__namespace.createElement(de.Provider, { value: E }, t__namespace.createElement(ue.Provider, { value: U2 }, e))));
|
|
3410
3602
|
});
|
|
3411
3603
|
var he = t__namespace.forwardRef((r, o) => {
|
|
3412
3604
|
var _, I;
|
|
3413
|
-
let n =
|
|
3605
|
+
let n = useId3(), u2 = t__namespace.useRef(null), c = t__namespace.useContext(fe), d = K2(), f = pe(r), p2 = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
|
|
3414
3606
|
k2(() => {
|
|
3415
|
-
if (!p2)
|
|
3607
|
+
if (!p2)
|
|
3608
|
+
return d.item(n, c == null ? void 0 : c.id);
|
|
3416
3609
|
}, [p2]);
|
|
3417
3610
|
let b = ve(n, u2, [r.value, r.children, u2], r.keywords), m2 = ee(), R = P((v) => v.value && v.value === b.current), x = P((v) => p2 || d.filter() === false ? true : v.search ? v.filtered.items.get(n) > 0 : true);
|
|
3418
3611
|
t__namespace.useEffect(() => {
|
|
3419
3612
|
let v = u2.current;
|
|
3420
|
-
if (!(!v || r.disabled))
|
|
3613
|
+
if (!(!v || r.disabled))
|
|
3614
|
+
return v.addEventListener(Z, C), () => v.removeEventListener(Z, C);
|
|
3421
3615
|
}, [x, r.onSelect, r.disabled]);
|
|
3422
3616
|
function C() {
|
|
3423
3617
|
var v, E;
|
|
@@ -3426,25 +3620,26 @@ var he = t__namespace.forwardRef((r, o) => {
|
|
|
3426
3620
|
function S() {
|
|
3427
3621
|
m2.setState("value", b.current, true);
|
|
3428
3622
|
}
|
|
3429
|
-
if (!x)
|
|
3623
|
+
if (!x)
|
|
3624
|
+
return null;
|
|
3430
3625
|
let { disabled: A, value: ge, onSelect: j, forceMount: O, keywords: $2, ...q } = r;
|
|
3431
|
-
return t__namespace.createElement(
|
|
3626
|
+
return t__namespace.createElement(Primitive2.div, { ref: composeRefs2(u2, o), ...q, id: n, "cmdk-item": "", role: "option", "aria-disabled": !!A, "aria-selected": !!R, "data-disabled": !!A, "data-selected": !!R, onPointerMove: A || d.getDisablePointerSelection() ? void 0 : S, onClick: A ? void 0 : C }, r.children);
|
|
3432
3627
|
});
|
|
3433
3628
|
var Ee = t__namespace.forwardRef((r, o) => {
|
|
3434
|
-
let { heading: n, children: u2, forceMount: c, ...d } = r, f =
|
|
3629
|
+
let { heading: n, children: u2, forceMount: c, ...d } = r, f = useId3(), p2 = t__namespace.useRef(null), b = t__namespace.useRef(null), m2 = useId3(), R = K2(), x = P((S) => c || R.filter() === false ? true : S.search ? S.filtered.groups.has(f) : true);
|
|
3435
3630
|
k2(() => R.group(f), []), ve(f, p2, [r.value, r.heading, b]);
|
|
3436
3631
|
let C = t__namespace.useMemo(() => ({ id: f, forceMount: c }), [c]);
|
|
3437
|
-
return t__namespace.createElement(
|
|
3632
|
+
return t__namespace.createElement(Primitive2.div, { ref: composeRefs2(p2, o), ...d, "cmdk-group": "", role: "presentation", hidden: x ? void 0 : true }, n && t__namespace.createElement("div", { ref: b, "cmdk-group-heading": "", "aria-hidden": true, id: m2 }, n), B2(r, (S) => t__namespace.createElement("div", { "cmdk-group-items": "", role: "group", "aria-labelledby": n ? m2 : void 0 }, t__namespace.createElement(fe.Provider, { value: C }, S))));
|
|
3438
3633
|
});
|
|
3439
3634
|
var ye = t__namespace.forwardRef((r, o) => {
|
|
3440
3635
|
let { alwaysRender: n, ...u2 } = r, c = t__namespace.useRef(null), d = P((f) => !f.search);
|
|
3441
|
-
return !n && !d ? null : t__namespace.createElement(
|
|
3636
|
+
return !n && !d ? null : t__namespace.createElement(Primitive2.div, { ref: composeRefs2(c, o), ...u2, "cmdk-separator": "", role: "separator" });
|
|
3442
3637
|
});
|
|
3443
3638
|
var Se = t__namespace.forwardRef((r, o) => {
|
|
3444
3639
|
let { onValueChange: n, ...u2 } = r, c = r.value != null, d = ee(), f = P((m2) => m2.search), p2 = P((m2) => m2.selectedItemId), b = K2();
|
|
3445
3640
|
return t__namespace.useEffect(() => {
|
|
3446
3641
|
r.value != null && d.setState("search", r.value);
|
|
3447
|
-
}, [r.value]), t__namespace.createElement(
|
|
3642
|
+
}, [r.value]), t__namespace.createElement(Primitive2.input, { ref: o, ...u2, "cmdk-input": "", autoComplete: "off", autoCorrect: "off", spellCheck: false, "aria-autocomplete": "list", role: "combobox", "aria-expanded": true, "aria-controls": b.listId, "aria-labelledby": b.labelId, "aria-activedescendant": p2, id: b.inputId, type: "text", value: c ? r.value : f, onChange: (m2) => {
|
|
3448
3643
|
c || d.setState("search", m2.target.value), n == null || n(m2.target.value);
|
|
3449
3644
|
} });
|
|
3450
3645
|
});
|
|
@@ -3462,29 +3657,31 @@ var Ce = t__namespace.forwardRef((r, o) => {
|
|
|
3462
3657
|
cancelAnimationFrame(x), C.unobserve(m2);
|
|
3463
3658
|
};
|
|
3464
3659
|
}
|
|
3465
|
-
}, []), t__namespace.createElement(
|
|
3660
|
+
}, []), t__namespace.createElement(Primitive2.div, { ref: composeRefs2(d, o), ...c, "cmdk-list": "", role: "listbox", tabIndex: -1, "aria-activedescendant": p2, "aria-label": u2, id: b.listId }, B2(r, (m2) => t__namespace.createElement("div", { ref: composeRefs2(f, b.listInnerRef), "cmdk-list-sizer": "" }, m2)));
|
|
3466
3661
|
});
|
|
3467
3662
|
var xe = t__namespace.forwardRef((r, o) => {
|
|
3468
3663
|
let { open: n, onOpenChange: u2, overlayClassName: c, contentClassName: d, container: f, ...p2 } = r;
|
|
3469
3664
|
return t__namespace.createElement(DialogPrimitive__namespace.Root, { open: n, onOpenChange: u2 }, t__namespace.createElement(DialogPrimitive__namespace.Portal, { container: f }, t__namespace.createElement(DialogPrimitive__namespace.Overlay, { "cmdk-overlay": "", className: c }), t__namespace.createElement(DialogPrimitive__namespace.Content, { "aria-label": r.label, "cmdk-dialog": "", className: d }, t__namespace.createElement(me, { ref: o, ...p2 }))));
|
|
3470
3665
|
});
|
|
3471
|
-
var Ie = t__namespace.forwardRef((r, o) => P((u2) => u2.filtered.count === 0) ? t__namespace.createElement(
|
|
3666
|
+
var Ie = t__namespace.forwardRef((r, o) => P((u2) => u2.filtered.count === 0) ? t__namespace.createElement(Primitive2.div, { ref: o, ...r, "cmdk-empty": "", role: "presentation" }) : null);
|
|
3472
3667
|
var Pe = t__namespace.forwardRef((r, o) => {
|
|
3473
3668
|
let { progress: n, children: u2, label: c = "Loading...", ...d } = r;
|
|
3474
|
-
return t__namespace.createElement(
|
|
3669
|
+
return t__namespace.createElement(Primitive2.div, { ref: o, ...d, "cmdk-loading": "", role: "progressbar", "aria-valuenow": n, "aria-valuemin": 0, "aria-valuemax": 100, "aria-label": c }, B2(r, (f) => t__namespace.createElement("div", { "aria-hidden": true }, f)));
|
|
3475
3670
|
});
|
|
3476
3671
|
var _e = Object.assign(me, { List: Ce, Item: he, Input: Se, Group: Ee, Separator: ye, Dialog: xe, Empty: Ie, Loading: Pe });
|
|
3477
3672
|
function we(r, o) {
|
|
3478
3673
|
let n = r.nextElementSibling;
|
|
3479
3674
|
for (; n; ) {
|
|
3480
|
-
if (n.matches(o))
|
|
3675
|
+
if (n.matches(o))
|
|
3676
|
+
return n;
|
|
3481
3677
|
n = n.nextElementSibling;
|
|
3482
3678
|
}
|
|
3483
3679
|
}
|
|
3484
3680
|
function De(r, o) {
|
|
3485
3681
|
let n = r.previousElementSibling;
|
|
3486
3682
|
for (; n; ) {
|
|
3487
|
-
if (n.matches(o))
|
|
3683
|
+
if (n.matches(o))
|
|
3684
|
+
return n;
|
|
3488
3685
|
n = n.previousElementSibling;
|
|
3489
3686
|
}
|
|
3490
3687
|
}
|
|
@@ -3510,8 +3707,10 @@ function ve(r, o, n, u2 = []) {
|
|
|
3510
3707
|
let f = (() => {
|
|
3511
3708
|
var m2;
|
|
3512
3709
|
for (let R of n) {
|
|
3513
|
-
if (typeof R == "string")
|
|
3514
|
-
|
|
3710
|
+
if (typeof R == "string")
|
|
3711
|
+
return R.trim();
|
|
3712
|
+
if (typeof R == "object" && "current" in R)
|
|
3713
|
+
return R.current ? (m2 = R.current.textContent) == null ? void 0 : m2.trim() : c.current;
|
|
3515
3714
|
}
|
|
3516
3715
|
})(), p2 = u2.map((m2) => m2.trim());
|
|
3517
3716
|
d.value(r, f, p2), (b = o.current) == null || b.setAttribute(T, f), c.current = f;
|
|
@@ -3929,7 +4128,8 @@ function memo(getDeps, fn, opts) {
|
|
|
3929
4128
|
let result;
|
|
3930
4129
|
return (depArgs) => {
|
|
3931
4130
|
let depTime;
|
|
3932
|
-
if (opts.key && opts.debug)
|
|
4131
|
+
if (opts.key && opts.debug)
|
|
4132
|
+
depTime = Date.now();
|
|
3933
4133
|
const newDeps = getDeps(depArgs);
|
|
3934
4134
|
const depsChanged = newDeps.length !== deps.length || newDeps.some((dep, index) => deps[index] !== dep);
|
|
3935
4135
|
if (!depsChanged) {
|
|
@@ -3937,7 +4137,8 @@ function memo(getDeps, fn, opts) {
|
|
|
3937
4137
|
}
|
|
3938
4138
|
deps = newDeps;
|
|
3939
4139
|
let resultTime;
|
|
3940
|
-
if (opts.key && opts.debug)
|
|
4140
|
+
if (opts.key && opts.debug)
|
|
4141
|
+
resultTime = Date.now();
|
|
3941
4142
|
result = fn(...newDeps);
|
|
3942
4143
|
opts == null || opts.onChange == null || opts.onChange(result);
|
|
3943
4144
|
if (opts.key && opts.debug) {
|
|
@@ -4308,7 +4509,7 @@ var createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
|
|
|
4308
4509
|
var _row$getValue;
|
|
4309
4510
|
return (_row$getValue = row.getValue(columnId)) != null ? _row$getValue : table.options.renderFallbackValue;
|
|
4310
4511
|
},
|
|
4311
|
-
subRows: [],
|
|
4512
|
+
subRows: subRows != null ? subRows : [],
|
|
4312
4513
|
getLeafRows: () => flattenBy(row.subRows, (d) => d.subRows),
|
|
4313
4514
|
getParentRow: () => row.parentId ? table.getRow(row.parentId, true) : void 0,
|
|
4314
4515
|
getParentRows: () => {
|
|
@@ -4316,7 +4517,8 @@ var createRow = (table, id, original, rowIndex, depth, subRows, parentId) => {
|
|
|
4316
4517
|
let currentRow = row;
|
|
4317
4518
|
while (true) {
|
|
4318
4519
|
const parentRow = currentRow.getParentRow();
|
|
4319
|
-
if (!parentRow)
|
|
4520
|
+
if (!parentRow)
|
|
4521
|
+
break;
|
|
4320
4522
|
parentRows.push(parentRow);
|
|
4321
4523
|
currentRow = parentRow;
|
|
4322
4524
|
}
|
|
@@ -4604,25 +4806,29 @@ var extent = (columnId, _leafRows, childRows) => {
|
|
|
4604
4806
|
const value = row.getValue(columnId);
|
|
4605
4807
|
if (value != null) {
|
|
4606
4808
|
if (min2 === void 0) {
|
|
4607
|
-
if (value >= value)
|
|
4809
|
+
if (value >= value)
|
|
4810
|
+
min2 = max2 = value;
|
|
4608
4811
|
} else {
|
|
4609
|
-
if (min2 > value)
|
|
4610
|
-
|
|
4812
|
+
if (min2 > value)
|
|
4813
|
+
min2 = value;
|
|
4814
|
+
if (max2 < value)
|
|
4815
|
+
max2 = value;
|
|
4611
4816
|
}
|
|
4612
4817
|
}
|
|
4613
4818
|
});
|
|
4614
4819
|
return [min2, max2];
|
|
4615
4820
|
};
|
|
4616
4821
|
var mean = (columnId, leafRows) => {
|
|
4617
|
-
let
|
|
4822
|
+
let count4 = 0;
|
|
4618
4823
|
let sum2 = 0;
|
|
4619
4824
|
leafRows.forEach((row) => {
|
|
4620
4825
|
let value = row.getValue(columnId);
|
|
4621
4826
|
if (value != null && (value = +value) >= value) {
|
|
4622
|
-
++
|
|
4827
|
+
++count4, sum2 += value;
|
|
4623
4828
|
}
|
|
4624
4829
|
});
|
|
4625
|
-
if (
|
|
4830
|
+
if (count4)
|
|
4831
|
+
return sum2 / count4;
|
|
4626
4832
|
return;
|
|
4627
4833
|
};
|
|
4628
4834
|
var median = (columnId, leafRows) => {
|
|
@@ -4646,7 +4852,7 @@ var unique = (columnId, leafRows) => {
|
|
|
4646
4852
|
var uniqueCount = (columnId, leafRows) => {
|
|
4647
4853
|
return new Set(leafRows.map((d) => d.getValue(columnId))).size;
|
|
4648
4854
|
};
|
|
4649
|
-
var
|
|
4855
|
+
var count3 = (_columnId, leafRows) => {
|
|
4650
4856
|
return leafRows.length;
|
|
4651
4857
|
};
|
|
4652
4858
|
var aggregationFns = {
|
|
@@ -4658,7 +4864,7 @@ var aggregationFns = {
|
|
|
4658
4864
|
median,
|
|
4659
4865
|
unique,
|
|
4660
4866
|
uniqueCount,
|
|
4661
|
-
count:
|
|
4867
|
+
count: count3
|
|
4662
4868
|
};
|
|
4663
4869
|
var ColumnGrouping = {
|
|
4664
4870
|
getDefaultColumnDef: () => {
|
|
@@ -4706,7 +4912,8 @@ var ColumnGrouping = {
|
|
|
4706
4912
|
column.getToggleGroupingHandler = () => {
|
|
4707
4913
|
const canGroup = column.getCanGroup();
|
|
4708
4914
|
return () => {
|
|
4709
|
-
if (!canGroup)
|
|
4915
|
+
if (!canGroup)
|
|
4916
|
+
return;
|
|
4710
4917
|
column.toggleGrouping();
|
|
4711
4918
|
};
|
|
4712
4919
|
};
|
|
@@ -5169,7 +5376,8 @@ var ColumnSizing = {
|
|
|
5169
5376
|
};
|
|
5170
5377
|
var passiveSupported = null;
|
|
5171
5378
|
function passiveEventSupported() {
|
|
5172
|
-
if (typeof passiveSupported === "boolean")
|
|
5379
|
+
if (typeof passiveSupported === "boolean")
|
|
5380
|
+
return passiveSupported;
|
|
5173
5381
|
let supported = false;
|
|
5174
5382
|
try {
|
|
5175
5383
|
const options = {
|
|
@@ -5363,7 +5571,8 @@ var RowExpanding = {
|
|
|
5363
5571
|
return;
|
|
5364
5572
|
}
|
|
5365
5573
|
if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetExpanded) != null ? _ref : !table.options.manualExpanding) {
|
|
5366
|
-
if (queued)
|
|
5574
|
+
if (queued)
|
|
5575
|
+
return;
|
|
5367
5576
|
queued = true;
|
|
5368
5577
|
table._queue(() => {
|
|
5369
5578
|
table.resetExpanded();
|
|
@@ -5480,7 +5689,8 @@ var RowExpanding = {
|
|
|
5480
5689
|
row.getToggleExpandedHandler = () => {
|
|
5481
5690
|
const canExpand = row.getCanExpand();
|
|
5482
5691
|
return () => {
|
|
5483
|
-
if (!canExpand)
|
|
5692
|
+
if (!canExpand)
|
|
5693
|
+
return;
|
|
5484
5694
|
row.toggleExpanded();
|
|
5485
5695
|
};
|
|
5486
5696
|
};
|
|
@@ -5519,7 +5729,8 @@ var RowPagination = {
|
|
|
5519
5729
|
return;
|
|
5520
5730
|
}
|
|
5521
5731
|
if ((_ref = (_table$options$autoRe = table.options.autoResetAll) != null ? _table$options$autoRe : table.options.autoResetPageIndex) != null ? _ref : !table.options.manualPagination) {
|
|
5522
|
-
if (queued)
|
|
5732
|
+
if (queued)
|
|
5733
|
+
return;
|
|
5523
5734
|
queued = true;
|
|
5524
5735
|
table._queue(() => {
|
|
5525
5736
|
table.resetPageIndex();
|
|
@@ -5712,7 +5923,8 @@ var RowPinning = {
|
|
|
5712
5923
|
row.getPinnedIndex = () => {
|
|
5713
5924
|
var _ref4, _visiblePinnedRowIds$;
|
|
5714
5925
|
const position = row.getIsPinned();
|
|
5715
|
-
if (!position)
|
|
5926
|
+
if (!position)
|
|
5927
|
+
return -1;
|
|
5716
5928
|
const visiblePinnedRowIds = (_ref4 = position === "top" ? table.getTopRows() : table.getBottomRows()) == null ? void 0 : _ref4.map((_ref5) => {
|
|
5717
5929
|
let {
|
|
5718
5930
|
id
|
|
@@ -5953,7 +6165,8 @@ var RowSelection = {
|
|
|
5953
6165
|
const canSelect = row.getCanSelect();
|
|
5954
6166
|
return (e) => {
|
|
5955
6167
|
var _target;
|
|
5956
|
-
if (!canSelect)
|
|
6168
|
+
if (!canSelect)
|
|
6169
|
+
return;
|
|
5957
6170
|
row.toggleSelected((_target = e.target) == null ? void 0 : _target.checked);
|
|
5958
6171
|
};
|
|
5959
6172
|
};
|
|
@@ -6011,7 +6224,8 @@ function isRowSelected(row, selection) {
|
|
|
6011
6224
|
}
|
|
6012
6225
|
function isSubRowSelected(row, selection, table) {
|
|
6013
6226
|
var _row$subRows3;
|
|
6014
|
-
if (!((_row$subRows3 = row.subRows) != null && _row$subRows3.length))
|
|
6227
|
+
if (!((_row$subRows3 = row.subRows) != null && _row$subRows3.length))
|
|
6228
|
+
return false;
|
|
6015
6229
|
let allChildrenSelected = true;
|
|
6016
6230
|
let someSelected = false;
|
|
6017
6231
|
row.subRows.forEach((subRow) => {
|
|
@@ -6270,7 +6484,8 @@ var RowSorting = {
|
|
|
6270
6484
|
column.getToggleSortingHandler = () => {
|
|
6271
6485
|
const canSort = column.getCanSort();
|
|
6272
6486
|
return (e) => {
|
|
6273
|
-
if (!canSort)
|
|
6487
|
+
if (!canSort)
|
|
6488
|
+
return;
|
|
6274
6489
|
e.persist == null || e.persist();
|
|
6275
6490
|
column.toggleSorting == null || column.toggleSorting(void 0, column.getCanMultiSort() ? table.options.isMultiSortEvent == null ? void 0 : table.options.isMultiSortEvent(e) : false);
|
|
6276
6491
|
};
|
|
@@ -6753,7 +6968,8 @@ function getSortedRowModel() {
|
|
|
6753
6968
|
const columnInfoById = {};
|
|
6754
6969
|
availableSorting.forEach((sortEntry) => {
|
|
6755
6970
|
const column = table.getColumn(sortEntry.id);
|
|
6756
|
-
if (!column)
|
|
6971
|
+
if (!column)
|
|
6972
|
+
return;
|
|
6757
6973
|
columnInfoById[sortEntry.id] = {
|
|
6758
6974
|
sortUndefined: column.columnDef.sortUndefined,
|
|
6759
6975
|
invertSorting: column.columnDef.invertSorting,
|
|
@@ -6778,8 +6994,10 @@ function getSortedRowModel() {
|
|
|
6778
6994
|
const aUndefined = aValue === void 0;
|
|
6779
6995
|
const bUndefined = bValue === void 0;
|
|
6780
6996
|
if (aUndefined || bUndefined) {
|
|
6781
|
-
if (sortUndefined === "first")
|
|
6782
|
-
|
|
6997
|
+
if (sortUndefined === "first")
|
|
6998
|
+
return aUndefined ? -1 : 1;
|
|
6999
|
+
if (sortUndefined === "last")
|
|
7000
|
+
return aUndefined ? 1 : -1;
|
|
6783
7001
|
sortInt = aUndefined && bUndefined ? 0 : aUndefined ? sortUndefined : -sortUndefined;
|
|
6784
7002
|
}
|
|
6785
7003
|
}
|
|
@@ -6969,7 +7187,8 @@ TableRow.displayName = "TableRow";
|
|
|
6969
7187
|
var TableHead = t__namespace.forwardRef(
|
|
6970
7188
|
({ className, sortable, sorted, onSort, align = "left", children, ...props }, ref) => {
|
|
6971
7189
|
const renderSortIcon = () => {
|
|
6972
|
-
if (!sortable)
|
|
7190
|
+
if (!sortable)
|
|
7191
|
+
return null;
|
|
6973
7192
|
if (sorted === "asc") {
|
|
6974
7193
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6975
7194
|
"svg",
|
|
@@ -7250,7 +7469,8 @@ function Calendar({
|
|
|
7250
7469
|
setCurrentMonth(dateFns.addMonths(currentMonth, 1));
|
|
7251
7470
|
};
|
|
7252
7471
|
const handleDateClick = (date) => {
|
|
7253
|
-
if (disabled?.(date))
|
|
7472
|
+
if (disabled?.(date))
|
|
7473
|
+
return;
|
|
7254
7474
|
if (mode === "single") {
|
|
7255
7475
|
onSelect?.(date);
|
|
7256
7476
|
} else if (mode === "range") {
|
|
@@ -7267,7 +7487,8 @@ function Calendar({
|
|
|
7267
7487
|
}
|
|
7268
7488
|
};
|
|
7269
7489
|
const isDateSelected = (date) => {
|
|
7270
|
-
if (!selected)
|
|
7490
|
+
if (!selected)
|
|
7491
|
+
return false;
|
|
7271
7492
|
if (mode === "single") {
|
|
7272
7493
|
return dateFns.isSameDay(date, selected);
|
|
7273
7494
|
} else if (mode === "range") {
|
|
@@ -7280,19 +7501,23 @@ function Calendar({
|
|
|
7280
7501
|
return false;
|
|
7281
7502
|
};
|
|
7282
7503
|
const isRangeStart = (date) => {
|
|
7283
|
-
if (mode !== "range" || !selected)
|
|
7504
|
+
if (mode !== "range" || !selected)
|
|
7505
|
+
return false;
|
|
7284
7506
|
const range = selected;
|
|
7285
7507
|
return range.from ? dateFns.isSameDay(date, range.from) : false;
|
|
7286
7508
|
};
|
|
7287
7509
|
const isRangeEnd = (date) => {
|
|
7288
|
-
if (mode !== "range" || !selected)
|
|
7510
|
+
if (mode !== "range" || !selected)
|
|
7511
|
+
return false;
|
|
7289
7512
|
const range = selected;
|
|
7290
7513
|
return range.to ? dateFns.isSameDay(date, range.to) : false;
|
|
7291
7514
|
};
|
|
7292
7515
|
const isRangeMiddle = (date) => {
|
|
7293
|
-
if (mode !== "range" || !selected)
|
|
7516
|
+
if (mode !== "range" || !selected)
|
|
7517
|
+
return false;
|
|
7294
7518
|
const range = selected;
|
|
7295
|
-
if (!range.from || !range.to)
|
|
7519
|
+
if (!range.from || !range.to)
|
|
7520
|
+
return false;
|
|
7296
7521
|
return date > range.from && date < range.to;
|
|
7297
7522
|
};
|
|
7298
7523
|
const getDaysInMonth = () => {
|
|
@@ -7488,10 +7713,14 @@ function DatePicker({
|
|
|
7488
7713
|
handleSelect(today);
|
|
7489
7714
|
};
|
|
7490
7715
|
const isDateDisabled = (date) => {
|
|
7491
|
-
if (minDate && date < minDate)
|
|
7492
|
-
|
|
7493
|
-
if (
|
|
7494
|
-
|
|
7716
|
+
if (minDate && date < minDate)
|
|
7717
|
+
return true;
|
|
7718
|
+
if (maxDate && date > maxDate)
|
|
7719
|
+
return true;
|
|
7720
|
+
if (disabledDates?.some((d) => d.toDateString() === date.toDateString()))
|
|
7721
|
+
return true;
|
|
7722
|
+
if (disabledDaysOfWeek?.includes(date.getDay()))
|
|
7723
|
+
return true;
|
|
7495
7724
|
return false;
|
|
7496
7725
|
};
|
|
7497
7726
|
const displayValue = internalDate && dateFns.isValid(internalDate) ? dateFns.format(internalDate, formatString) : null;
|
|
@@ -7633,7 +7862,8 @@ function DateRangePicker({
|
|
|
7633
7862
|
}
|
|
7634
7863
|
};
|
|
7635
7864
|
const displayValue = t__namespace.useMemo(() => {
|
|
7636
|
-
if (!internalRange?.from)
|
|
7865
|
+
if (!internalRange?.from)
|
|
7866
|
+
return null;
|
|
7637
7867
|
if (!internalRange?.to) {
|
|
7638
7868
|
return dateFns.format(internalRange.from, formatString);
|
|
7639
7869
|
}
|
|
@@ -7867,7 +8097,8 @@ function DraggableList({
|
|
|
7867
8097
|
}) {
|
|
7868
8098
|
const [draggedIndex, setDraggedIndex] = t__namespace.useState(null);
|
|
7869
8099
|
const handleDragStart = (e, index) => {
|
|
7870
|
-
if (disabled)
|
|
8100
|
+
if (disabled)
|
|
8101
|
+
return;
|
|
7871
8102
|
setDraggedIndex(index);
|
|
7872
8103
|
e.dataTransfer.effectAllowed = "move";
|
|
7873
8104
|
};
|
|
@@ -8161,14 +8392,19 @@ var Progress = t__namespace.forwardRef(({
|
|
|
8161
8392
|
});
|
|
8162
8393
|
Progress.displayName = "Progress";
|
|
8163
8394
|
var getFileIcon = (type) => {
|
|
8164
|
-
if (type.startsWith("image/"))
|
|
8165
|
-
|
|
8166
|
-
if (type.startsWith("
|
|
8167
|
-
|
|
8395
|
+
if (type.startsWith("image/"))
|
|
8396
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Image, { className: "h-4 w-4" });
|
|
8397
|
+
if (type.startsWith("video/"))
|
|
8398
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Video, { className: "h-4 w-4" });
|
|
8399
|
+
if (type.startsWith("audio/"))
|
|
8400
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Music, { className: "h-4 w-4" });
|
|
8401
|
+
if (type.includes("text") || type.includes("document"))
|
|
8402
|
+
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-4 w-4" });
|
|
8168
8403
|
return /* @__PURE__ */ jsxRuntime.jsx(lucideReact.File, { className: "h-4 w-4" });
|
|
8169
8404
|
};
|
|
8170
8405
|
var formatFileSize = (bytes) => {
|
|
8171
|
-
if (bytes === 0)
|
|
8406
|
+
if (bytes === 0)
|
|
8407
|
+
return "0 Bytes";
|
|
8172
8408
|
const k3 = 1024;
|
|
8173
8409
|
const sizes = ["Bytes", "KB", "MB", "GB"];
|
|
8174
8410
|
const i = Math.floor(Math.log(bytes) / Math.log(k3));
|
|
@@ -8328,7 +8564,8 @@ var FileUpload = t__namespace.default.forwardRef(
|
|
|
8328
8564
|
const handleDrop = t.useCallback((e) => {
|
|
8329
8565
|
e.preventDefault();
|
|
8330
8566
|
setIsDragOver(false);
|
|
8331
|
-
if (disabled)
|
|
8567
|
+
if (disabled)
|
|
8568
|
+
return;
|
|
8332
8569
|
const files = e.dataTransfer.files;
|
|
8333
8570
|
if (files.length > 0) {
|
|
8334
8571
|
processFiles(files);
|
|
@@ -8469,7 +8706,8 @@ var GestureDrawer = t__namespace.default.forwardRef(
|
|
|
8469
8706
|
const motionValue = isVertical ? y : x;
|
|
8470
8707
|
const opacity = framerMotion.useTransform(motionValue, [0, threshold], [1, 0.5]);
|
|
8471
8708
|
const handleDragEnd = (event, info) => {
|
|
8472
|
-
if (!enableSwipeToClose)
|
|
8709
|
+
if (!enableSwipeToClose)
|
|
8710
|
+
return;
|
|
8473
8711
|
const offset = isVertical ? info.offset.y : info.offset.x;
|
|
8474
8712
|
const velocity = isVertical ? info.velocity.y : info.velocity.x;
|
|
8475
8713
|
let shouldClose = false;
|
|
@@ -8510,7 +8748,8 @@ var GestureDrawer = t__namespace.default.forwardRef(
|
|
|
8510
8748
|
const getAnimatePosition = () => {
|
|
8511
8749
|
return isVertical ? { y: 0 } : { x: 0 };
|
|
8512
8750
|
};
|
|
8513
|
-
if (!isOpen)
|
|
8751
|
+
if (!isOpen)
|
|
8752
|
+
return null;
|
|
8514
8753
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "fixed inset-0 z-50", children: [
|
|
8515
8754
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
8516
8755
|
framerMotion.motion.div,
|
|
@@ -8730,7 +8969,8 @@ function LockedComponent({
|
|
|
8730
8969
|
const [isPreviewActive, setIsPreviewActive] = t.useState(false);
|
|
8731
8970
|
const [previewTimeout, setPreviewTimeout] = t.useState(null);
|
|
8732
8971
|
const handleMouseEnter = () => {
|
|
8733
|
-
if (!showPreview)
|
|
8972
|
+
if (!showPreview)
|
|
8973
|
+
return;
|
|
8734
8974
|
setIsPreviewActive(true);
|
|
8735
8975
|
if (previewTimeout) {
|
|
8736
8976
|
clearTimeout(previewTimeout);
|
|
@@ -8836,6 +9076,7 @@ function ProComponentWrapper({
|
|
|
8836
9076
|
nodeEnv: process.env.NODE_ENV === "development",
|
|
8837
9077
|
nextPublicEnv: process.env.NEXT_PUBLIC_VERCEL_ENV === "development",
|
|
8838
9078
|
localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local")),
|
|
9079
|
+
port: typeof window !== "undefined" && (window.location.port === "3000" || window.location.port === "3001" || window.location.port === "8080"),
|
|
8839
9080
|
vercelEnv: !process.env.VERCEL,
|
|
8840
9081
|
ciEnv: !process.env.CI,
|
|
8841
9082
|
deploymentEnv: !process.env.DEPLOYMENT_ENV
|
|
@@ -8916,7 +9157,9 @@ function ProComponentWrapper({
|
|
|
8916
9157
|
const isDevelopment = () => {
|
|
8917
9158
|
const checks = {
|
|
8918
9159
|
nodeEnv: process.env.NODE_ENV === "development",
|
|
8919
|
-
localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local"))
|
|
9160
|
+
localhost: typeof window !== "undefined" && (window.location.hostname === "localhost" || window.location.hostname === "127.0.0.1" || window.location.hostname.includes(".local")),
|
|
9161
|
+
port: typeof window !== "undefined" && (window.location.port === "3000" || window.location.port === "3001" || window.location.port === "8080")
|
|
9162
|
+
};
|
|
8920
9163
|
if (process.env.VERCEL || process.env.NETLIFY || process.env.RENDER || process.env.RAILWAY_ENVIRONMENT || process.env.FLY_APP_NAME) {
|
|
8921
9164
|
return false;
|
|
8922
9165
|
}
|
|
@@ -9359,22 +9602,30 @@ var formatPhoneNumber = (value, countryCode) => {
|
|
|
9359
9602
|
const cleaned = value.replace(/\D/g, "");
|
|
9360
9603
|
switch (countryCode) {
|
|
9361
9604
|
case "+1":
|
|
9362
|
-
if (cleaned.length <= 3)
|
|
9363
|
-
|
|
9605
|
+
if (cleaned.length <= 3)
|
|
9606
|
+
return cleaned;
|
|
9607
|
+
if (cleaned.length <= 6)
|
|
9608
|
+
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
|
|
9364
9609
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)}-${cleaned.slice(6, 10)}`;
|
|
9365
9610
|
case "+44":
|
|
9366
|
-
if (cleaned.length <= 4)
|
|
9367
|
-
|
|
9611
|
+
if (cleaned.length <= 4)
|
|
9612
|
+
return cleaned;
|
|
9613
|
+
if (cleaned.length <= 7)
|
|
9614
|
+
return `${cleaned.slice(0, 4)} ${cleaned.slice(4)}`;
|
|
9368
9615
|
return `${cleaned.slice(0, 4)} ${cleaned.slice(4, 7)} ${cleaned.slice(7, 11)}`;
|
|
9369
9616
|
case "+90":
|
|
9370
|
-
if (cleaned.length <= 3)
|
|
9371
|
-
|
|
9372
|
-
if (cleaned.length <=
|
|
9617
|
+
if (cleaned.length <= 3)
|
|
9618
|
+
return cleaned;
|
|
9619
|
+
if (cleaned.length <= 6)
|
|
9620
|
+
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3)}`;
|
|
9621
|
+
if (cleaned.length <= 9)
|
|
9622
|
+
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6)}`;
|
|
9373
9623
|
return `(${cleaned.slice(0, 3)}) ${cleaned.slice(3, 6)} ${cleaned.slice(6, 8)} ${cleaned.slice(8, 10)}`;
|
|
9374
9624
|
default:
|
|
9375
9625
|
let formatted = "";
|
|
9376
9626
|
for (let i = 0; i < cleaned.length; i++) {
|
|
9377
|
-
if (i > 0 && i % 3 === 0)
|
|
9627
|
+
if (i > 0 && i % 3 === 0)
|
|
9628
|
+
formatted += " ";
|
|
9378
9629
|
formatted += cleaned[i];
|
|
9379
9630
|
}
|
|
9380
9631
|
return formatted;
|
|
@@ -9384,13 +9635,10 @@ var getMaxLength = (countryCode) => {
|
|
|
9384
9635
|
switch (countryCode) {
|
|
9385
9636
|
case "+1":
|
|
9386
9637
|
return 10;
|
|
9387
|
-
// US/Canada
|
|
9388
9638
|
case "+44":
|
|
9389
9639
|
return 11;
|
|
9390
|
-
// UK
|
|
9391
9640
|
case "+90":
|
|
9392
9641
|
return 10;
|
|
9393
|
-
// Turkey
|
|
9394
9642
|
default:
|
|
9395
9643
|
return 15;
|
|
9396
9644
|
}
|
|
@@ -9646,6 +9894,188 @@ function RichTextEditor({
|
|
|
9646
9894
|
)
|
|
9647
9895
|
] });
|
|
9648
9896
|
}
|
|
9897
|
+
function useStateMachine2(initialState, machine) {
|
|
9898
|
+
return t__namespace.useReducer((state, event) => {
|
|
9899
|
+
const nextState = machine[state][event];
|
|
9900
|
+
return nextState ?? state;
|
|
9901
|
+
}, initialState);
|
|
9902
|
+
}
|
|
9903
|
+
var Presence2 = (props) => {
|
|
9904
|
+
const { present, children } = props;
|
|
9905
|
+
const presence = usePresence2(present);
|
|
9906
|
+
const child = typeof children === "function" ? children({ present: presence.isPresent }) : t__namespace.Children.only(children);
|
|
9907
|
+
const ref = useComposedRefs2(presence.ref, getElementRef2(child));
|
|
9908
|
+
const forceMount = typeof children === "function";
|
|
9909
|
+
return forceMount || presence.isPresent ? t__namespace.cloneElement(child, { ref }) : null;
|
|
9910
|
+
};
|
|
9911
|
+
Presence2.displayName = "Presence";
|
|
9912
|
+
function usePresence2(present) {
|
|
9913
|
+
const [node, setNode] = t__namespace.useState();
|
|
9914
|
+
const stylesRef = t__namespace.useRef(null);
|
|
9915
|
+
const prevPresentRef = t__namespace.useRef(present);
|
|
9916
|
+
const prevAnimationNameRef = t__namespace.useRef("none");
|
|
9917
|
+
const initialState = present ? "mounted" : "unmounted";
|
|
9918
|
+
const [state, send] = useStateMachine2(initialState, {
|
|
9919
|
+
mounted: {
|
|
9920
|
+
UNMOUNT: "unmounted",
|
|
9921
|
+
ANIMATION_OUT: "unmountSuspended"
|
|
9922
|
+
},
|
|
9923
|
+
unmountSuspended: {
|
|
9924
|
+
MOUNT: "mounted",
|
|
9925
|
+
ANIMATION_END: "unmounted"
|
|
9926
|
+
},
|
|
9927
|
+
unmounted: {
|
|
9928
|
+
MOUNT: "mounted"
|
|
9929
|
+
}
|
|
9930
|
+
});
|
|
9931
|
+
t__namespace.useEffect(() => {
|
|
9932
|
+
const currentAnimationName = getAnimationName2(stylesRef.current);
|
|
9933
|
+
prevAnimationNameRef.current = state === "mounted" ? currentAnimationName : "none";
|
|
9934
|
+
}, [state]);
|
|
9935
|
+
useLayoutEffect22(() => {
|
|
9936
|
+
const styles = stylesRef.current;
|
|
9937
|
+
const wasPresent = prevPresentRef.current;
|
|
9938
|
+
const hasPresentChanged = wasPresent !== present;
|
|
9939
|
+
if (hasPresentChanged) {
|
|
9940
|
+
const prevAnimationName = prevAnimationNameRef.current;
|
|
9941
|
+
const currentAnimationName = getAnimationName2(styles);
|
|
9942
|
+
if (present) {
|
|
9943
|
+
send("MOUNT");
|
|
9944
|
+
} else if (currentAnimationName === "none" || styles?.display === "none") {
|
|
9945
|
+
send("UNMOUNT");
|
|
9946
|
+
} else {
|
|
9947
|
+
const isAnimating = prevAnimationName !== currentAnimationName;
|
|
9948
|
+
if (wasPresent && isAnimating) {
|
|
9949
|
+
send("ANIMATION_OUT");
|
|
9950
|
+
} else {
|
|
9951
|
+
send("UNMOUNT");
|
|
9952
|
+
}
|
|
9953
|
+
}
|
|
9954
|
+
prevPresentRef.current = present;
|
|
9955
|
+
}
|
|
9956
|
+
}, [present, send]);
|
|
9957
|
+
useLayoutEffect22(() => {
|
|
9958
|
+
if (node) {
|
|
9959
|
+
let timeoutId;
|
|
9960
|
+
const ownerWindow = node.ownerDocument.defaultView ?? window;
|
|
9961
|
+
const handleAnimationEnd = (event) => {
|
|
9962
|
+
const currentAnimationName = getAnimationName2(stylesRef.current);
|
|
9963
|
+
const isCurrentAnimation = currentAnimationName.includes(CSS.escape(event.animationName));
|
|
9964
|
+
if (event.target === node && isCurrentAnimation) {
|
|
9965
|
+
send("ANIMATION_END");
|
|
9966
|
+
if (!prevPresentRef.current) {
|
|
9967
|
+
const currentFillMode = node.style.animationFillMode;
|
|
9968
|
+
node.style.animationFillMode = "forwards";
|
|
9969
|
+
timeoutId = ownerWindow.setTimeout(() => {
|
|
9970
|
+
if (node.style.animationFillMode === "forwards") {
|
|
9971
|
+
node.style.animationFillMode = currentFillMode;
|
|
9972
|
+
}
|
|
9973
|
+
});
|
|
9974
|
+
}
|
|
9975
|
+
}
|
|
9976
|
+
};
|
|
9977
|
+
const handleAnimationStart = (event) => {
|
|
9978
|
+
if (event.target === node) {
|
|
9979
|
+
prevAnimationNameRef.current = getAnimationName2(stylesRef.current);
|
|
9980
|
+
}
|
|
9981
|
+
};
|
|
9982
|
+
node.addEventListener("animationstart", handleAnimationStart);
|
|
9983
|
+
node.addEventListener("animationcancel", handleAnimationEnd);
|
|
9984
|
+
node.addEventListener("animationend", handleAnimationEnd);
|
|
9985
|
+
return () => {
|
|
9986
|
+
ownerWindow.clearTimeout(timeoutId);
|
|
9987
|
+
node.removeEventListener("animationstart", handleAnimationStart);
|
|
9988
|
+
node.removeEventListener("animationcancel", handleAnimationEnd);
|
|
9989
|
+
node.removeEventListener("animationend", handleAnimationEnd);
|
|
9990
|
+
};
|
|
9991
|
+
} else {
|
|
9992
|
+
send("ANIMATION_END");
|
|
9993
|
+
}
|
|
9994
|
+
}, [node, send]);
|
|
9995
|
+
return {
|
|
9996
|
+
isPresent: ["mounted", "unmountSuspended"].includes(state),
|
|
9997
|
+
ref: t__namespace.useCallback((node2) => {
|
|
9998
|
+
stylesRef.current = node2 ? getComputedStyle(node2) : null;
|
|
9999
|
+
setNode(node2);
|
|
10000
|
+
}, [])
|
|
10001
|
+
};
|
|
10002
|
+
}
|
|
10003
|
+
function getAnimationName2(styles) {
|
|
10004
|
+
return styles?.animationName || "none";
|
|
10005
|
+
}
|
|
10006
|
+
function getElementRef2(element) {
|
|
10007
|
+
let getter = Object.getOwnPropertyDescriptor(element.props, "ref")?.get;
|
|
10008
|
+
let mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10009
|
+
if (mayWarn) {
|
|
10010
|
+
return element.ref;
|
|
10011
|
+
}
|
|
10012
|
+
getter = Object.getOwnPropertyDescriptor(element, "ref")?.get;
|
|
10013
|
+
mayWarn = getter && "isReactWarning" in getter && getter.isReactWarning;
|
|
10014
|
+
if (mayWarn) {
|
|
10015
|
+
return element.props.ref;
|
|
10016
|
+
}
|
|
10017
|
+
return element.props.ref || element.ref;
|
|
10018
|
+
}
|
|
10019
|
+
function createContextScope2(scopeName, createContextScopeDeps = []) {
|
|
10020
|
+
let defaultContexts = [];
|
|
10021
|
+
function createContext32(rootComponentName, defaultContext) {
|
|
10022
|
+
const BaseContext = t__namespace.createContext(defaultContext);
|
|
10023
|
+
const index = defaultContexts.length;
|
|
10024
|
+
defaultContexts = [...defaultContexts, defaultContext];
|
|
10025
|
+
const Provider3 = (props) => {
|
|
10026
|
+
const { scope, children, ...context } = props;
|
|
10027
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
10028
|
+
const value = t__namespace.useMemo(() => context, Object.values(context));
|
|
10029
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Context.Provider, { value, children });
|
|
10030
|
+
};
|
|
10031
|
+
Provider3.displayName = rootComponentName + "Provider";
|
|
10032
|
+
function useContext22(consumerName, scope) {
|
|
10033
|
+
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
10034
|
+
const context = t__namespace.useContext(Context);
|
|
10035
|
+
if (context)
|
|
10036
|
+
return context;
|
|
10037
|
+
if (defaultContext !== void 0)
|
|
10038
|
+
return defaultContext;
|
|
10039
|
+
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
10040
|
+
}
|
|
10041
|
+
return [Provider3, useContext22];
|
|
10042
|
+
}
|
|
10043
|
+
const createScope = () => {
|
|
10044
|
+
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
10045
|
+
return t__namespace.createContext(defaultContext);
|
|
10046
|
+
});
|
|
10047
|
+
return function useScope(scope) {
|
|
10048
|
+
const contexts = scope?.[scopeName] || scopeContexts;
|
|
10049
|
+
return t__namespace.useMemo(
|
|
10050
|
+
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
10051
|
+
[scope, contexts]
|
|
10052
|
+
);
|
|
10053
|
+
};
|
|
10054
|
+
};
|
|
10055
|
+
createScope.scopeName = scopeName;
|
|
10056
|
+
return [createContext32, composeContextScopes2(createScope, ...createContextScopeDeps)];
|
|
10057
|
+
}
|
|
10058
|
+
function composeContextScopes2(...scopes) {
|
|
10059
|
+
const baseScope = scopes[0];
|
|
10060
|
+
if (scopes.length === 1)
|
|
10061
|
+
return baseScope;
|
|
10062
|
+
const createScope = () => {
|
|
10063
|
+
const scopeHooks = scopes.map((createScope2) => ({
|
|
10064
|
+
useScope: createScope2(),
|
|
10065
|
+
scopeName: createScope2.scopeName
|
|
10066
|
+
}));
|
|
10067
|
+
return function useComposedScopes(overrideScopes) {
|
|
10068
|
+
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
10069
|
+
const scopeProps = useScope(overrideScopes);
|
|
10070
|
+
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
10071
|
+
return { ...nextScopes2, ...currentScope };
|
|
10072
|
+
}, {});
|
|
10073
|
+
return t__namespace.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
10074
|
+
};
|
|
10075
|
+
};
|
|
10076
|
+
createScope.scopeName = baseScope.scopeName;
|
|
10077
|
+
return createScope;
|
|
10078
|
+
}
|
|
9649
10079
|
function useCallbackRef(callback) {
|
|
9650
10080
|
const callbackRef = t__namespace.useRef(callback);
|
|
9651
10081
|
t__namespace.useEffect(() => {
|
|
@@ -9663,14 +10093,22 @@ function useDirection(localDir) {
|
|
|
9663
10093
|
function clamp(value, [min2, max2]) {
|
|
9664
10094
|
return Math.min(max2, Math.max(min2, value));
|
|
9665
10095
|
}
|
|
9666
|
-
function
|
|
10096
|
+
function composeEventHandlers2(originalEventHandler, ourEventHandler, { checkForDefaultPrevented = true } = {}) {
|
|
10097
|
+
return function handleEvent(event) {
|
|
10098
|
+
originalEventHandler?.(event);
|
|
10099
|
+
if (checkForDefaultPrevented === false || !event.defaultPrevented) {
|
|
10100
|
+
return ourEventHandler?.(event);
|
|
10101
|
+
}
|
|
10102
|
+
};
|
|
10103
|
+
}
|
|
10104
|
+
function useStateMachine3(initialState, machine) {
|
|
9667
10105
|
return t__namespace.useReducer((state, event) => {
|
|
9668
10106
|
const nextState = machine[state][event];
|
|
9669
10107
|
return nextState ?? state;
|
|
9670
10108
|
}, initialState);
|
|
9671
10109
|
}
|
|
9672
10110
|
var SCROLL_AREA_NAME = "ScrollArea";
|
|
9673
|
-
var [createScrollAreaContext] =
|
|
10111
|
+
var [createScrollAreaContext, createScrollAreaScope] = createContextScope2(SCROLL_AREA_NAME);
|
|
9674
10112
|
var [ScrollAreaProvider, useScrollAreaContext] = createScrollAreaContext(SCROLL_AREA_NAME);
|
|
9675
10113
|
var ScrollArea = t__namespace.forwardRef(
|
|
9676
10114
|
(props, forwardedRef) => {
|
|
@@ -9690,7 +10128,7 @@ var ScrollArea = t__namespace.forwardRef(
|
|
|
9690
10128
|
const [cornerHeight, setCornerHeight] = t__namespace.useState(0);
|
|
9691
10129
|
const [scrollbarXEnabled, setScrollbarXEnabled] = t__namespace.useState(false);
|
|
9692
10130
|
const [scrollbarYEnabled, setScrollbarYEnabled] = t__namespace.useState(false);
|
|
9693
|
-
const composedRefs =
|
|
10131
|
+
const composedRefs = useComposedRefs2(forwardedRef, (node) => setScrollArea(node));
|
|
9694
10132
|
const direction = useDirection(dir);
|
|
9695
10133
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9696
10134
|
ScrollAreaProvider,
|
|
@@ -9715,7 +10153,7 @@ var ScrollArea = t__namespace.forwardRef(
|
|
|
9715
10153
|
onCornerWidthChange: setCornerWidth,
|
|
9716
10154
|
onCornerHeightChange: setCornerHeight,
|
|
9717
10155
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9718
|
-
|
|
10156
|
+
Primitive2.div,
|
|
9719
10157
|
{
|
|
9720
10158
|
dir: direction,
|
|
9721
10159
|
...scrollAreaProps,
|
|
@@ -9740,7 +10178,7 @@ var ScrollAreaViewport = t__namespace.forwardRef(
|
|
|
9740
10178
|
const { __scopeScrollArea, children, nonce, ...viewportProps } = props;
|
|
9741
10179
|
const context = useScrollAreaContext(VIEWPORT_NAME, __scopeScrollArea);
|
|
9742
10180
|
const ref = t__namespace.useRef(null);
|
|
9743
|
-
const composedRefs =
|
|
10181
|
+
const composedRefs = useComposedRefs2(forwardedRef, ref, context.onViewportChange);
|
|
9744
10182
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
9745
10183
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9746
10184
|
"style",
|
|
@@ -9752,7 +10190,7 @@ var ScrollAreaViewport = t__namespace.forwardRef(
|
|
|
9752
10190
|
}
|
|
9753
10191
|
),
|
|
9754
10192
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
9755
|
-
|
|
10193
|
+
Primitive2.div,
|
|
9756
10194
|
{
|
|
9757
10195
|
"data-radix-scroll-area-viewport": "",
|
|
9758
10196
|
...viewportProps,
|
|
@@ -9821,7 +10259,7 @@ var ScrollAreaScrollbarHover = t__namespace.forwardRef((props, forwardedRef) =>
|
|
|
9821
10259
|
};
|
|
9822
10260
|
}
|
|
9823
10261
|
}, [context.scrollArea, context.scrollHideDelay]);
|
|
9824
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10262
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Presence2, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9825
10263
|
ScrollAreaScrollbarAuto,
|
|
9826
10264
|
{
|
|
9827
10265
|
"data-state": visible ? "visible" : "hidden",
|
|
@@ -9835,7 +10273,7 @@ var ScrollAreaScrollbarScroll = t__namespace.forwardRef((props, forwardedRef) =>
|
|
|
9835
10273
|
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
9836
10274
|
const isHorizontal = props.orientation === "horizontal";
|
|
9837
10275
|
const debounceScrollEnd = useDebounceCallback(() => send("SCROLL_END"), 100);
|
|
9838
|
-
const [state, send] =
|
|
10276
|
+
const [state, send] = useStateMachine3("hidden", {
|
|
9839
10277
|
hidden: {
|
|
9840
10278
|
SCROLL: "scrolling"
|
|
9841
10279
|
},
|
|
@@ -9877,14 +10315,14 @@ var ScrollAreaScrollbarScroll = t__namespace.forwardRef((props, forwardedRef) =>
|
|
|
9877
10315
|
return () => viewport.removeEventListener("scroll", handleScroll);
|
|
9878
10316
|
}
|
|
9879
10317
|
}, [context.viewport, isHorizontal, send, debounceScrollEnd]);
|
|
9880
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10318
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Presence2, { present: forceMount || state !== "hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9881
10319
|
ScrollAreaScrollbarVisible,
|
|
9882
10320
|
{
|
|
9883
10321
|
"data-state": state === "hidden" ? "hidden" : "visible",
|
|
9884
10322
|
...scrollbarProps,
|
|
9885
10323
|
ref: forwardedRef,
|
|
9886
|
-
onPointerEnter:
|
|
9887
|
-
onPointerLeave:
|
|
10324
|
+
onPointerEnter: composeEventHandlers2(props.onPointerEnter, () => send("POINTER_ENTER")),
|
|
10325
|
+
onPointerLeave: composeEventHandlers2(props.onPointerLeave, () => send("POINTER_LEAVE"))
|
|
9888
10326
|
}
|
|
9889
10327
|
) });
|
|
9890
10328
|
});
|
|
@@ -9902,7 +10340,7 @@ var ScrollAreaScrollbarAuto = t__namespace.forwardRef((props, forwardedRef) => {
|
|
|
9902
10340
|
}, 10);
|
|
9903
10341
|
useResizeObserver(context.viewport, handleResize);
|
|
9904
10342
|
useResizeObserver(context.content, handleResize);
|
|
9905
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10343
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Presence2, { present: forceMount || visible, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
9906
10344
|
ScrollAreaScrollbarVisible,
|
|
9907
10345
|
{
|
|
9908
10346
|
"data-state": visible ? "visible" : "hidden",
|
|
@@ -9948,7 +10386,8 @@ var ScrollAreaScrollbarVisible = t__namespace.forwardRef((props, forwardedRef) =
|
|
|
9948
10386
|
}
|
|
9949
10387
|
},
|
|
9950
10388
|
onWheelScroll: (scrollPos) => {
|
|
9951
|
-
if (context.viewport)
|
|
10389
|
+
if (context.viewport)
|
|
10390
|
+
context.viewport.scrollLeft = scrollPos;
|
|
9952
10391
|
},
|
|
9953
10392
|
onDragScroll: (pointerPos) => {
|
|
9954
10393
|
if (context.viewport) {
|
|
@@ -9972,10 +10411,12 @@ var ScrollAreaScrollbarVisible = t__namespace.forwardRef((props, forwardedRef) =
|
|
|
9972
10411
|
}
|
|
9973
10412
|
},
|
|
9974
10413
|
onWheelScroll: (scrollPos) => {
|
|
9975
|
-
if (context.viewport)
|
|
10414
|
+
if (context.viewport)
|
|
10415
|
+
context.viewport.scrollTop = scrollPos;
|
|
9976
10416
|
},
|
|
9977
10417
|
onDragScroll: (pointerPos) => {
|
|
9978
|
-
if (context.viewport)
|
|
10418
|
+
if (context.viewport)
|
|
10419
|
+
context.viewport.scrollTop = getScrollPosition(pointerPos);
|
|
9979
10420
|
}
|
|
9980
10421
|
}
|
|
9981
10422
|
);
|
|
@@ -9987,16 +10428,17 @@ var ScrollAreaScrollbarX = t__namespace.forwardRef((props, forwardedRef) => {
|
|
|
9987
10428
|
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
9988
10429
|
const [computedStyle, setComputedStyle] = t__namespace.useState();
|
|
9989
10430
|
const ref = t__namespace.useRef(null);
|
|
9990
|
-
const
|
|
10431
|
+
const composeRefs3 = useComposedRefs2(forwardedRef, ref, context.onScrollbarXChange);
|
|
9991
10432
|
t__namespace.useEffect(() => {
|
|
9992
|
-
if (ref.current)
|
|
10433
|
+
if (ref.current)
|
|
10434
|
+
setComputedStyle(getComputedStyle(ref.current));
|
|
9993
10435
|
}, [ref]);
|
|
9994
10436
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
9995
10437
|
ScrollAreaScrollbarImpl,
|
|
9996
10438
|
{
|
|
9997
10439
|
"data-orientation": "horizontal",
|
|
9998
10440
|
...scrollbarProps,
|
|
9999
|
-
ref:
|
|
10441
|
+
ref: composeRefs3,
|
|
10000
10442
|
sizes,
|
|
10001
10443
|
style: {
|
|
10002
10444
|
bottom: 0,
|
|
@@ -10037,16 +10479,17 @@ var ScrollAreaScrollbarY = t__namespace.forwardRef((props, forwardedRef) => {
|
|
|
10037
10479
|
const context = useScrollAreaContext(SCROLLBAR_NAME, props.__scopeScrollArea);
|
|
10038
10480
|
const [computedStyle, setComputedStyle] = t__namespace.useState();
|
|
10039
10481
|
const ref = t__namespace.useRef(null);
|
|
10040
|
-
const
|
|
10482
|
+
const composeRefs3 = useComposedRefs2(forwardedRef, ref, context.onScrollbarYChange);
|
|
10041
10483
|
t__namespace.useEffect(() => {
|
|
10042
|
-
if (ref.current)
|
|
10484
|
+
if (ref.current)
|
|
10485
|
+
setComputedStyle(getComputedStyle(ref.current));
|
|
10043
10486
|
}, [ref]);
|
|
10044
10487
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10045
10488
|
ScrollAreaScrollbarImpl,
|
|
10046
10489
|
{
|
|
10047
10490
|
"data-orientation": "vertical",
|
|
10048
10491
|
...scrollbarProps,
|
|
10049
|
-
ref:
|
|
10492
|
+
ref: composeRefs3,
|
|
10050
10493
|
sizes,
|
|
10051
10494
|
style: {
|
|
10052
10495
|
top: 0,
|
|
@@ -10100,7 +10543,7 @@ var ScrollAreaScrollbarImpl = t__namespace.forwardRef((props, forwardedRef) => {
|
|
|
10100
10543
|
} = props;
|
|
10101
10544
|
const context = useScrollAreaContext(SCROLLBAR_NAME, __scopeScrollArea);
|
|
10102
10545
|
const [scrollbar, setScrollbar] = t__namespace.useState(null);
|
|
10103
|
-
const
|
|
10546
|
+
const composeRefs3 = useComposedRefs2(forwardedRef, (node) => setScrollbar(node));
|
|
10104
10547
|
const rectRef = t__namespace.useRef(null);
|
|
10105
10548
|
const prevWebkitUserSelectRef = t__namespace.useRef("");
|
|
10106
10549
|
const viewport = context.viewport;
|
|
@@ -10119,7 +10562,8 @@ var ScrollAreaScrollbarImpl = t__namespace.forwardRef((props, forwardedRef) => {
|
|
|
10119
10562
|
const handleWheel = (event) => {
|
|
10120
10563
|
const element = event.target;
|
|
10121
10564
|
const isScrollbarWheel = scrollbar?.contains(element);
|
|
10122
|
-
if (isScrollbarWheel)
|
|
10565
|
+
if (isScrollbarWheel)
|
|
10566
|
+
handleWheelScroll(event, maxScrollPos);
|
|
10123
10567
|
};
|
|
10124
10568
|
document.addEventListener("wheel", handleWheel, { passive: false });
|
|
10125
10569
|
return () => document.removeEventListener("wheel", handleWheel, { passive: false });
|
|
@@ -10138,12 +10582,12 @@ var ScrollAreaScrollbarImpl = t__namespace.forwardRef((props, forwardedRef) => {
|
|
|
10138
10582
|
onThumbPositionChange: handleThumbPositionChange,
|
|
10139
10583
|
onThumbPointerDown: useCallbackRef(onThumbPointerDown),
|
|
10140
10584
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
10141
|
-
|
|
10585
|
+
Primitive2.div,
|
|
10142
10586
|
{
|
|
10143
10587
|
...scrollbarProps,
|
|
10144
|
-
ref:
|
|
10588
|
+
ref: composeRefs3,
|
|
10145
10589
|
style: { position: "absolute", ...scrollbarProps.style },
|
|
10146
|
-
onPointerDown:
|
|
10590
|
+
onPointerDown: composeEventHandlers2(props.onPointerDown, (event) => {
|
|
10147
10591
|
const mainPointer = 0;
|
|
10148
10592
|
if (event.button === mainPointer) {
|
|
10149
10593
|
const element = event.target;
|
|
@@ -10151,18 +10595,20 @@ var ScrollAreaScrollbarImpl = t__namespace.forwardRef((props, forwardedRef) => {
|
|
|
10151
10595
|
rectRef.current = scrollbar.getBoundingClientRect();
|
|
10152
10596
|
prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;
|
|
10153
10597
|
document.body.style.webkitUserSelect = "none";
|
|
10154
|
-
if (context.viewport)
|
|
10598
|
+
if (context.viewport)
|
|
10599
|
+
context.viewport.style.scrollBehavior = "auto";
|
|
10155
10600
|
handleDragScroll(event);
|
|
10156
10601
|
}
|
|
10157
10602
|
}),
|
|
10158
|
-
onPointerMove:
|
|
10159
|
-
onPointerUp:
|
|
10603
|
+
onPointerMove: composeEventHandlers2(props.onPointerMove, handleDragScroll),
|
|
10604
|
+
onPointerUp: composeEventHandlers2(props.onPointerUp, (event) => {
|
|
10160
10605
|
const element = event.target;
|
|
10161
10606
|
if (element.hasPointerCapture(event.pointerId)) {
|
|
10162
10607
|
element.releasePointerCapture(event.pointerId);
|
|
10163
10608
|
}
|
|
10164
10609
|
document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;
|
|
10165
|
-
if (context.viewport)
|
|
10610
|
+
if (context.viewport)
|
|
10611
|
+
context.viewport.style.scrollBehavior = "";
|
|
10166
10612
|
rectRef.current = null;
|
|
10167
10613
|
})
|
|
10168
10614
|
}
|
|
@@ -10175,7 +10621,7 @@ var ScrollAreaThumb = t__namespace.forwardRef(
|
|
|
10175
10621
|
(props, forwardedRef) => {
|
|
10176
10622
|
const { forceMount, ...thumbProps } = props;
|
|
10177
10623
|
const scrollbarContext = useScrollbarContext(THUMB_NAME, props.__scopeScrollArea);
|
|
10178
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10624
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Presence2, { present: forceMount || scrollbarContext.hasThumb, children: /* @__PURE__ */ jsxRuntime.jsx(ScrollAreaThumbImpl, { ref: forwardedRef, ...thumbProps }) });
|
|
10179
10625
|
}
|
|
10180
10626
|
);
|
|
10181
10627
|
var ScrollAreaThumbImpl = t__namespace.forwardRef(
|
|
@@ -10184,7 +10630,7 @@ var ScrollAreaThumbImpl = t__namespace.forwardRef(
|
|
|
10184
10630
|
const scrollAreaContext = useScrollAreaContext(THUMB_NAME, __scopeScrollArea);
|
|
10185
10631
|
const scrollbarContext = useScrollbarContext(THUMB_NAME, __scopeScrollArea);
|
|
10186
10632
|
const { onThumbPositionChange } = scrollbarContext;
|
|
10187
|
-
const composedRef =
|
|
10633
|
+
const composedRef = useComposedRefs2(
|
|
10188
10634
|
forwardedRef,
|
|
10189
10635
|
(node) => scrollbarContext.onThumbChange(node)
|
|
10190
10636
|
);
|
|
@@ -10212,7 +10658,7 @@ var ScrollAreaThumbImpl = t__namespace.forwardRef(
|
|
|
10212
10658
|
}
|
|
10213
10659
|
}, [scrollAreaContext.viewport, debounceScrollEnd, onThumbPositionChange]);
|
|
10214
10660
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10215
|
-
|
|
10661
|
+
Primitive2.div,
|
|
10216
10662
|
{
|
|
10217
10663
|
"data-state": scrollbarContext.hasThumb ? "visible" : "hidden",
|
|
10218
10664
|
...thumbProps,
|
|
@@ -10222,14 +10668,14 @@ var ScrollAreaThumbImpl = t__namespace.forwardRef(
|
|
|
10222
10668
|
height: "var(--radix-scroll-area-thumb-height)",
|
|
10223
10669
|
...style
|
|
10224
10670
|
},
|
|
10225
|
-
onPointerDownCapture:
|
|
10671
|
+
onPointerDownCapture: composeEventHandlers2(props.onPointerDownCapture, (event) => {
|
|
10226
10672
|
const thumb = event.target;
|
|
10227
10673
|
const thumbRect = thumb.getBoundingClientRect();
|
|
10228
10674
|
const x = event.clientX - thumbRect.left;
|
|
10229
10675
|
const y = event.clientY - thumbRect.top;
|
|
10230
10676
|
scrollbarContext.onThumbPointerDown({ x, y });
|
|
10231
10677
|
}),
|
|
10232
|
-
onPointerUp:
|
|
10678
|
+
onPointerUp: composeEventHandlers2(props.onPointerUp, scrollbarContext.onThumbPointerUp)
|
|
10233
10679
|
}
|
|
10234
10680
|
);
|
|
10235
10681
|
}
|
|
@@ -10262,7 +10708,7 @@ var ScrollAreaCornerImpl = t__namespace.forwardRef((props, forwardedRef) => {
|
|
|
10262
10708
|
setWidth(width2);
|
|
10263
10709
|
});
|
|
10264
10710
|
return hasSize ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
10265
|
-
|
|
10711
|
+
Primitive2.div,
|
|
10266
10712
|
{
|
|
10267
10713
|
...cornerProps,
|
|
10268
10714
|
ref: forwardedRef,
|
|
@@ -10316,7 +10762,8 @@ function getThumbOffsetFromScroll(scrollPos, sizes, dir = "ltr") {
|
|
|
10316
10762
|
}
|
|
10317
10763
|
function linearScale(input, output) {
|
|
10318
10764
|
return (value) => {
|
|
10319
|
-
if (input[0] === input[1] || output[0] === output[1])
|
|
10765
|
+
if (input[0] === input[1] || output[0] === output[1])
|
|
10766
|
+
return output[0];
|
|
10320
10767
|
const ratio = (output[1] - output[0]) / (input[1] - input[0]);
|
|
10321
10768
|
return output[0] + ratio * (value - input[0]);
|
|
10322
10769
|
};
|
|
@@ -10332,7 +10779,8 @@ var addUnlinkedScrollListener = (node, handler = () => {
|
|
|
10332
10779
|
const position = { left: node.scrollLeft, top: node.scrollTop };
|
|
10333
10780
|
const isHorizontalScroll = prevPosition.left !== position.left;
|
|
10334
10781
|
const isVerticalScroll = prevPosition.top !== position.top;
|
|
10335
|
-
if (isHorizontalScroll || isVerticalScroll)
|
|
10782
|
+
if (isHorizontalScroll || isVerticalScroll)
|
|
10783
|
+
handler();
|
|
10336
10784
|
prevPosition = position;
|
|
10337
10785
|
rAF = window.requestAnimationFrame(loop);
|
|
10338
10786
|
})();
|
|
@@ -10349,7 +10797,7 @@ function useDebounceCallback(callback, delay) {
|
|
|
10349
10797
|
}
|
|
10350
10798
|
function useResizeObserver(element, onResize) {
|
|
10351
10799
|
const handleResize = useCallbackRef(onResize);
|
|
10352
|
-
|
|
10800
|
+
useLayoutEffect22(() => {
|
|
10353
10801
|
let rAF = 0;
|
|
10354
10802
|
if (element) {
|
|
10355
10803
|
const resizeObserver = new ResizeObserver(() => {
|
|
@@ -10450,7 +10898,8 @@ var ScrollReveal = t__namespace.forwardRef(
|
|
|
10450
10898
|
once: triggerOnce
|
|
10451
10899
|
});
|
|
10452
10900
|
const customVariants = t__namespace.useMemo(() => {
|
|
10453
|
-
if (variants)
|
|
10901
|
+
if (variants)
|
|
10902
|
+
return variants;
|
|
10454
10903
|
const baseVariants = defaultVariants[direction] || defaultVariants.up;
|
|
10455
10904
|
return {
|
|
10456
10905
|
hidden: {
|
|
@@ -10464,7 +10913,8 @@ var ScrollReveal = t__namespace.forwardRef(
|
|
|
10464
10913
|
};
|
|
10465
10914
|
}, [direction, distance, variants]);
|
|
10466
10915
|
t__namespace.useEffect(() => {
|
|
10467
|
-
if (!animate2)
|
|
10916
|
+
if (!animate2)
|
|
10917
|
+
return;
|
|
10468
10918
|
if (isInView) {
|
|
10469
10919
|
controls.start("visible");
|
|
10470
10920
|
} else if (!triggerOnce) {
|
|
@@ -10545,7 +10995,8 @@ var ScrollRevealItem = t__namespace.forwardRef(
|
|
|
10545
10995
|
id
|
|
10546
10996
|
}, ref) => {
|
|
10547
10997
|
const customVariants = t__namespace.useMemo(() => {
|
|
10548
|
-
if (variants)
|
|
10998
|
+
if (variants)
|
|
10999
|
+
return variants;
|
|
10549
11000
|
const baseVariants = defaultVariants[direction] || defaultVariants.up;
|
|
10550
11001
|
return {
|
|
10551
11002
|
hidden: {
|
|
@@ -10696,17 +11147,81 @@ var Separator3 = t__namespace.forwardRef(
|
|
|
10696
11147
|
)
|
|
10697
11148
|
);
|
|
10698
11149
|
Separator3.displayName = SeparatorPrimitive__namespace.Root.displayName;
|
|
11150
|
+
var useInsertionEffect2 = t__namespace[" useInsertionEffect ".trim().toString()] || useLayoutEffect22;
|
|
11151
|
+
function useControllableState2({
|
|
11152
|
+
prop,
|
|
11153
|
+
defaultProp,
|
|
11154
|
+
onChange = () => {
|
|
11155
|
+
},
|
|
11156
|
+
caller
|
|
11157
|
+
}) {
|
|
11158
|
+
const [uncontrolledProp, setUncontrolledProp, onChangeRef] = useUncontrolledState2({
|
|
11159
|
+
defaultProp,
|
|
11160
|
+
onChange
|
|
11161
|
+
});
|
|
11162
|
+
const isControlled = prop !== void 0;
|
|
11163
|
+
const value = isControlled ? prop : uncontrolledProp;
|
|
11164
|
+
{
|
|
11165
|
+
const isControlledRef = t__namespace.useRef(prop !== void 0);
|
|
11166
|
+
t__namespace.useEffect(() => {
|
|
11167
|
+
const wasControlled = isControlledRef.current;
|
|
11168
|
+
if (wasControlled !== isControlled) {
|
|
11169
|
+
const from = wasControlled ? "controlled" : "uncontrolled";
|
|
11170
|
+
const to = isControlled ? "controlled" : "uncontrolled";
|
|
11171
|
+
console.warn(
|
|
11172
|
+
`${caller} is changing from ${from} to ${to}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
|
|
11173
|
+
);
|
|
11174
|
+
}
|
|
11175
|
+
isControlledRef.current = isControlled;
|
|
11176
|
+
}, [isControlled, caller]);
|
|
11177
|
+
}
|
|
11178
|
+
const setValue = t__namespace.useCallback(
|
|
11179
|
+
(nextValue) => {
|
|
11180
|
+
if (isControlled) {
|
|
11181
|
+
const value2 = isFunction3(nextValue) ? nextValue(prop) : nextValue;
|
|
11182
|
+
if (value2 !== prop) {
|
|
11183
|
+
onChangeRef.current?.(value2);
|
|
11184
|
+
}
|
|
11185
|
+
} else {
|
|
11186
|
+
setUncontrolledProp(nextValue);
|
|
11187
|
+
}
|
|
11188
|
+
},
|
|
11189
|
+
[isControlled, prop, setUncontrolledProp, onChangeRef]
|
|
11190
|
+
);
|
|
11191
|
+
return [value, setValue];
|
|
11192
|
+
}
|
|
11193
|
+
function useUncontrolledState2({
|
|
11194
|
+
defaultProp,
|
|
11195
|
+
onChange
|
|
11196
|
+
}) {
|
|
11197
|
+
const [value, setValue] = t__namespace.useState(defaultProp);
|
|
11198
|
+
const prevValueRef = t__namespace.useRef(value);
|
|
11199
|
+
const onChangeRef = t__namespace.useRef(onChange);
|
|
11200
|
+
useInsertionEffect2(() => {
|
|
11201
|
+
onChangeRef.current = onChange;
|
|
11202
|
+
}, [onChange]);
|
|
11203
|
+
t__namespace.useEffect(() => {
|
|
11204
|
+
if (prevValueRef.current !== value) {
|
|
11205
|
+
onChangeRef.current?.(value);
|
|
11206
|
+
prevValueRef.current = value;
|
|
11207
|
+
}
|
|
11208
|
+
}, [value, prevValueRef]);
|
|
11209
|
+
return [value, setValue, onChangeRef];
|
|
11210
|
+
}
|
|
11211
|
+
function isFunction3(value) {
|
|
11212
|
+
return typeof value === "function";
|
|
11213
|
+
}
|
|
10699
11214
|
var NAME = "Toggle";
|
|
10700
11215
|
var Toggle = t__namespace.forwardRef((props, forwardedRef) => {
|
|
10701
11216
|
const { pressed: pressedProp, defaultPressed, onPressedChange, ...buttonProps } = props;
|
|
10702
|
-
const [pressed, setPressed] =
|
|
11217
|
+
const [pressed, setPressed] = useControllableState2({
|
|
10703
11218
|
prop: pressedProp,
|
|
10704
11219
|
onChange: onPressedChange,
|
|
10705
11220
|
defaultProp: defaultPressed ?? false,
|
|
10706
11221
|
caller: NAME
|
|
10707
11222
|
});
|
|
10708
11223
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
10709
|
-
|
|
11224
|
+
Primitive2.button,
|
|
10710
11225
|
{
|
|
10711
11226
|
type: "button",
|
|
10712
11227
|
"aria-pressed": pressed,
|
|
@@ -10714,7 +11229,7 @@ var Toggle = t__namespace.forwardRef((props, forwardedRef) => {
|
|
|
10714
11229
|
"data-disabled": props.disabled ? "" : void 0,
|
|
10715
11230
|
...buttonProps,
|
|
10716
11231
|
ref: forwardedRef,
|
|
10717
|
-
onClick:
|
|
11232
|
+
onClick: composeEventHandlers2(props.onClick, () => {
|
|
10718
11233
|
if (!props.disabled) {
|
|
10719
11234
|
setPressed(!pressed);
|
|
10720
11235
|
}
|
|
@@ -10904,7 +11419,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
|
|
|
10904
11419
|
const [content, setContent] = t.useState(value);
|
|
10905
11420
|
const [isPreview, setIsPreview] = t.useState(false);
|
|
10906
11421
|
const [sourceContent, setSourceContent] = t.useState(value);
|
|
10907
|
-
|
|
11422
|
+
t.useState(null);
|
|
10908
11423
|
const editorRef = t__namespace.default.useRef(null);
|
|
10909
11424
|
const sourceRef = t__namespace.default.useRef(null);
|
|
10910
11425
|
const [formatState, setFormatState] = t.useState({
|
|
@@ -10933,7 +11448,8 @@ var SimpleEditor = t__namespace.default.forwardRef(
|
|
|
10933
11448
|
return null;
|
|
10934
11449
|
}, []);
|
|
10935
11450
|
t.useCallback((range) => {
|
|
10936
|
-
if (!range)
|
|
11451
|
+
if (!range)
|
|
11452
|
+
return;
|
|
10937
11453
|
const selection2 = window.getSelection();
|
|
10938
11454
|
if (selection2) {
|
|
10939
11455
|
selection2.removeAllRanges();
|
|
@@ -10941,7 +11457,8 @@ var SimpleEditor = t__namespace.default.forwardRef(
|
|
|
10941
11457
|
}
|
|
10942
11458
|
}, []);
|
|
10943
11459
|
const executeCommand = t.useCallback((command, value2) => {
|
|
10944
|
-
if (disabled)
|
|
11460
|
+
if (disabled)
|
|
11461
|
+
return;
|
|
10945
11462
|
if (editorRef.current) {
|
|
10946
11463
|
editorRef.current.focus();
|
|
10947
11464
|
}
|
|
@@ -11400,7 +11917,7 @@ var SimpleEditor = t__namespace.default.forwardRef(
|
|
|
11400
11917
|
);
|
|
11401
11918
|
SimpleEditor.displayName = "SimpleEditor";
|
|
11402
11919
|
var CharacterCount = ({ content }) => {
|
|
11403
|
-
const [
|
|
11920
|
+
const [count4, setCount] = t.useState(0);
|
|
11404
11921
|
t.useEffect(() => {
|
|
11405
11922
|
const getPlainText = (html) => {
|
|
11406
11923
|
const div = document.createElement("div");
|
|
@@ -11410,7 +11927,7 @@ var CharacterCount = ({ content }) => {
|
|
|
11410
11927
|
setCount(getPlainText(content).length);
|
|
11411
11928
|
}, [content]);
|
|
11412
11929
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
11413
|
-
|
|
11930
|
+
count4,
|
|
11414
11931
|
" characters"
|
|
11415
11932
|
] });
|
|
11416
11933
|
};
|
|
@@ -11679,16 +12196,19 @@ var SwipeableCard = t__namespace.forwardRef(
|
|
|
11679
12196
|
const [currentX, setCurrentX] = t__namespace.useState(0);
|
|
11680
12197
|
const [isSwiping, setIsSwiping] = t__namespace.useState(false);
|
|
11681
12198
|
const handleTouchStart = (e) => {
|
|
11682
|
-
if (disabled)
|
|
12199
|
+
if (disabled)
|
|
12200
|
+
return;
|
|
11683
12201
|
setStartX(e.touches[0].clientX);
|
|
11684
12202
|
setIsSwiping(true);
|
|
11685
12203
|
};
|
|
11686
12204
|
const handleTouchMove = (e) => {
|
|
11687
|
-
if (disabled || !isSwiping)
|
|
12205
|
+
if (disabled || !isSwiping)
|
|
12206
|
+
return;
|
|
11688
12207
|
setCurrentX(e.touches[0].clientX);
|
|
11689
12208
|
};
|
|
11690
12209
|
const handleTouchEnd = () => {
|
|
11691
|
-
if (disabled || !isSwiping)
|
|
12210
|
+
if (disabled || !isSwiping)
|
|
12211
|
+
return;
|
|
11692
12212
|
const deltaX = currentX - startX;
|
|
11693
12213
|
if (Math.abs(deltaX) > threshold) {
|
|
11694
12214
|
if (deltaX > 0 && onSwipeRight) {
|
|
@@ -11792,7 +12312,8 @@ var TagsInput = t__namespace.forwardRef(
|
|
|
11792
12312
|
};
|
|
11793
12313
|
const addTag = () => {
|
|
11794
12314
|
const tag = inputValue.trim();
|
|
11795
|
-
if (!tag)
|
|
12315
|
+
if (!tag)
|
|
12316
|
+
return;
|
|
11796
12317
|
if (!allowDuplicates && value.includes(tag)) {
|
|
11797
12318
|
setError("This tag already exists");
|
|
11798
12319
|
setTimeout(() => setError(""), 2e3);
|
|
@@ -11808,7 +12329,8 @@ var TagsInput = t__namespace.forwardRef(
|
|
|
11808
12329
|
setError("");
|
|
11809
12330
|
};
|
|
11810
12331
|
const removeTag = (index) => {
|
|
11811
|
-
if (disabled)
|
|
12332
|
+
if (disabled)
|
|
12333
|
+
return;
|
|
11812
12334
|
onChange(value.filter((_, i) => i !== index));
|
|
11813
12335
|
};
|
|
11814
12336
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
@@ -11871,32 +12393,147 @@ var TagsInput = t__namespace.forwardRef(
|
|
|
11871
12393
|
}
|
|
11872
12394
|
);
|
|
11873
12395
|
TagsInput.displayName = "TagsInput";
|
|
12396
|
+
var textareaVariants = classVarianceAuthority.cva(
|
|
12397
|
+
[
|
|
12398
|
+
"flex w-full rounded-md px-3 py-2 text-sm transition-all duration-200",
|
|
12399
|
+
"text-foreground placeholder:text-muted-foreground dark:placeholder:text-gray-500",
|
|
12400
|
+
"disabled:cursor-not-allowed disabled:opacity-50",
|
|
12401
|
+
"focus-visible:outline-none dark:text-gray-200",
|
|
12402
|
+
"resize-none"
|
|
12403
|
+
// Always disable manual resize, we control it
|
|
12404
|
+
],
|
|
12405
|
+
{
|
|
12406
|
+
variants: {
|
|
12407
|
+
variant: {
|
|
12408
|
+
default: "border border-gray-300 dark:border-gray-700 bg-background dark:bg-gray-800/80 hover:border-gray-400 dark:hover:border-gray-600 focus-visible:ring-2 focus-visible:ring-primary/30 dark:focus-visible:ring-primary/20 focus-visible:border-primary dark:focus-visible:border-primary/80 dark:shadow-inner dark:shadow-gray-950/10",
|
|
12409
|
+
outline: "border-2 border-gray-300 dark:border-gray-700 bg-transparent hover:border-gray-400 dark:hover:border-gray-600 focus-visible:border-primary dark:focus-visible:border-primary/80",
|
|
12410
|
+
ghost: "border-none bg-transparent hover:bg-gray-100/50 dark:hover:bg-gray-800/30 focus-visible:bg-transparent",
|
|
12411
|
+
underline: "border-t-0 border-l-0 border-r-0 border-b-2 border-gray-300 dark:border-gray-600 rounded-none px-0 hover:border-gray-400 dark:hover:border-gray-500 focus-visible:ring-0 focus-visible:border-primary dark:focus-visible:border-primary/80 bg-transparent dark:bg-transparent"
|
|
12412
|
+
},
|
|
12413
|
+
size: {
|
|
12414
|
+
sm: "min-h-[60px] text-xs",
|
|
12415
|
+
md: "min-h-[80px] text-sm",
|
|
12416
|
+
lg: "min-h-[120px] text-base"
|
|
12417
|
+
},
|
|
12418
|
+
isError: {
|
|
12419
|
+
true: "border-error focus-visible:ring-error/30 focus-visible:border-error hover:border-error/80 dark:hover:border-error/80",
|
|
12420
|
+
false: ""
|
|
12421
|
+
},
|
|
12422
|
+
isSuccess: {
|
|
12423
|
+
true: "border-success focus-visible:ring-success/30 focus-visible:border-success hover:border-success/80 dark:hover:border-success/80",
|
|
12424
|
+
false: ""
|
|
12425
|
+
}
|
|
12426
|
+
},
|
|
12427
|
+
defaultVariants: {
|
|
12428
|
+
variant: "default",
|
|
12429
|
+
size: "md",
|
|
12430
|
+
isError: false,
|
|
12431
|
+
isSuccess: false
|
|
12432
|
+
}
|
|
12433
|
+
}
|
|
12434
|
+
);
|
|
11874
12435
|
var Textarea = t__namespace.forwardRef(
|
|
11875
12436
|
({
|
|
11876
12437
|
className,
|
|
11877
|
-
|
|
12438
|
+
wrapperClassName,
|
|
12439
|
+
messageClassName,
|
|
11878
12440
|
variant,
|
|
11879
12441
|
size,
|
|
11880
12442
|
error,
|
|
11881
12443
|
success,
|
|
11882
12444
|
loading,
|
|
11883
|
-
autoResize,
|
|
12445
|
+
autoResize = false,
|
|
11884
12446
|
maxHeight,
|
|
11885
|
-
characterCount,
|
|
12447
|
+
characterCount = false,
|
|
12448
|
+
disabled,
|
|
12449
|
+
maxLength,
|
|
12450
|
+
value,
|
|
12451
|
+
defaultValue,
|
|
12452
|
+
onChange,
|
|
11886
12453
|
...props
|
|
11887
12454
|
}, ref) => {
|
|
11888
|
-
|
|
11889
|
-
|
|
11890
|
-
|
|
11891
|
-
|
|
11892
|
-
|
|
11893
|
-
|
|
11894
|
-
|
|
11895
|
-
|
|
11896
|
-
|
|
11897
|
-
|
|
12455
|
+
const textareaRef = t__namespace.useRef(null);
|
|
12456
|
+
const [internalValue, setInternalValue] = t__namespace.useState(value || defaultValue || "");
|
|
12457
|
+
t__namespace.useImperativeHandle(ref, () => textareaRef.current);
|
|
12458
|
+
const adjustHeight = t__namespace.useCallback(() => {
|
|
12459
|
+
const textarea = textareaRef.current;
|
|
12460
|
+
if (!textarea || !autoResize)
|
|
12461
|
+
return;
|
|
12462
|
+
textarea.style.height = "auto";
|
|
12463
|
+
const newHeight = textarea.scrollHeight;
|
|
12464
|
+
if (maxHeight && newHeight > maxHeight) {
|
|
12465
|
+
textarea.style.height = `${maxHeight}px`;
|
|
12466
|
+
textarea.style.overflowY = "auto";
|
|
12467
|
+
} else {
|
|
12468
|
+
textarea.style.height = `${newHeight}px`;
|
|
12469
|
+
textarea.style.overflowY = "hidden";
|
|
11898
12470
|
}
|
|
11899
|
-
);
|
|
12471
|
+
}, [autoResize, maxHeight]);
|
|
12472
|
+
t__namespace.useEffect(() => {
|
|
12473
|
+
adjustHeight();
|
|
12474
|
+
}, [internalValue, adjustHeight]);
|
|
12475
|
+
t__namespace.useEffect(() => {
|
|
12476
|
+
if (value !== void 0) {
|
|
12477
|
+
setInternalValue(value);
|
|
12478
|
+
}
|
|
12479
|
+
}, [value]);
|
|
12480
|
+
const handleChange = (e) => {
|
|
12481
|
+
setInternalValue(e.target.value);
|
|
12482
|
+
onChange?.(e);
|
|
12483
|
+
};
|
|
12484
|
+
const currentLength = String(internalValue).length;
|
|
12485
|
+
const showCharCount = characterCount && (maxLength !== void 0 || currentLength > 0);
|
|
12486
|
+
const errorMessage = typeof error === "string" ? error : void 0;
|
|
12487
|
+
const successMessage = typeof success === "string" ? success : void 0;
|
|
12488
|
+
const showMessage = errorMessage || successMessage;
|
|
12489
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("moonui-theme", "space-y-1.5 w-full", wrapperClassName), children: [
|
|
12490
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
|
|
12491
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
12492
|
+
"textarea",
|
|
12493
|
+
{
|
|
12494
|
+
ref: textareaRef,
|
|
12495
|
+
className: cn(
|
|
12496
|
+
textareaVariants({
|
|
12497
|
+
variant,
|
|
12498
|
+
size,
|
|
12499
|
+
isError: !!error,
|
|
12500
|
+
isSuccess: !!success
|
|
12501
|
+
}),
|
|
12502
|
+
loading && "pr-10",
|
|
12503
|
+
className
|
|
12504
|
+
),
|
|
12505
|
+
disabled: disabled || loading,
|
|
12506
|
+
value,
|
|
12507
|
+
defaultValue,
|
|
12508
|
+
onChange: handleChange,
|
|
12509
|
+
maxLength,
|
|
12510
|
+
"aria-invalid": !!error || void 0,
|
|
12511
|
+
"aria-describedby": errorMessage ? `${props.id || ""}-error` : successMessage ? `${props.id || ""}-success` : void 0,
|
|
12512
|
+
...props
|
|
12513
|
+
}
|
|
12514
|
+
),
|
|
12515
|
+
loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute top-3 right-3 text-gray-500", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-4 w-4 animate-spin", "aria-hidden": "true" }) })
|
|
12516
|
+
] }),
|
|
12517
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
12518
|
+
showMessage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
12519
|
+
"p",
|
|
12520
|
+
{
|
|
12521
|
+
className: cn(
|
|
12522
|
+
"text-xs transition-all",
|
|
12523
|
+
errorMessage && "text-error",
|
|
12524
|
+
successMessage && "text-success",
|
|
12525
|
+
messageClassName
|
|
12526
|
+
),
|
|
12527
|
+
id: errorMessage ? `${props.id || ""}-error` : successMessage ? `${props.id || ""}-success` : void 0,
|
|
12528
|
+
children: errorMessage || successMessage
|
|
12529
|
+
}
|
|
12530
|
+
),
|
|
12531
|
+
showCharCount && /* @__PURE__ */ jsxRuntime.jsxs("p", { className: "text-xs text-muted-foreground dark:text-gray-500 ml-auto", children: [
|
|
12532
|
+
currentLength,
|
|
12533
|
+
maxLength !== void 0 && ` / ${maxLength}`
|
|
12534
|
+
] })
|
|
12535
|
+
] })
|
|
12536
|
+
] });
|
|
11900
12537
|
}
|
|
11901
12538
|
);
|
|
11902
12539
|
Textarea.displayName = "Textarea";
|
|
@@ -12072,7 +12709,8 @@ function toast({ ...props }) {
|
|
|
12072
12709
|
id,
|
|
12073
12710
|
open: true,
|
|
12074
12711
|
onOpenChange: (open) => {
|
|
12075
|
-
if (!open)
|
|
12712
|
+
if (!open)
|
|
12713
|
+
dismiss();
|
|
12076
12714
|
}
|
|
12077
12715
|
}
|
|
12078
12716
|
});
|
|
@@ -12142,15 +12780,15 @@ function Toaster() {
|
|
|
12142
12780
|
*)
|
|
12143
12781
|
*/
|
|
12144
12782
|
|
|
12145
|
-
Object.defineProperty(exports,
|
|
12783
|
+
Object.defineProperty(exports, 'Palette', {
|
|
12146
12784
|
enumerable: true,
|
|
12147
12785
|
get: function () { return lucideReact.Palette; }
|
|
12148
12786
|
});
|
|
12149
|
-
Object.defineProperty(exports,
|
|
12787
|
+
Object.defineProperty(exports, 'Pipette', {
|
|
12150
12788
|
enumerable: true,
|
|
12151
12789
|
get: function () { return lucideReact.Pipette; }
|
|
12152
12790
|
});
|
|
12153
|
-
Object.defineProperty(exports,
|
|
12791
|
+
Object.defineProperty(exports, 'format', {
|
|
12154
12792
|
enumerable: true,
|
|
12155
12793
|
get: function () { return dateFns.format; }
|
|
12156
12794
|
});
|
|
@@ -12497,5 +13135,5 @@ exports.toast = toast;
|
|
|
12497
13135
|
exports.toggleVariants = toggleVariants;
|
|
12498
13136
|
exports.tooltipVariants = tooltipVariants;
|
|
12499
13137
|
exports.useToast = useToast;
|
|
12500
|
-
//# sourceMappingURL=
|
|
13138
|
+
//# sourceMappingURL=out.js.map
|
|
12501
13139
|
//# sourceMappingURL=index.js.map
|