@backbay/glia 0.2.0-alpha.7 → 0.2.0-alpha.8
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/audio/index.js +1145 -5
- package/dist/audio/index.js.map +1 -1
- package/dist/components/index.js +3187 -10
- package/dist/components/index.js.map +1 -1
- package/dist/core.js +19714 -12
- package/dist/core.js.map +1 -1
- package/dist/emotion/index.js +1 -1
- package/dist/emotion/index.js.map +1 -1
- package/dist/hooks/index.js +941 -6
- package/dist/hooks/index.js.map +1 -1
- package/dist/index.js +31841 -183
- package/dist/index.js.map +1 -1
- package/dist/primitives/index.js +21111 -57
- package/dist/primitives/index.js.map +1 -1
- package/dist/protocol/index.js +360 -2
- package/dist/protocol/index.js.map +1 -1
- package/dist/speakeasy/index.js +2786 -38
- package/dist/speakeasy/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/index.js +1150 -3
- package/dist/theme/index.js.map +1 -1
- package/dist/vision/index.js +370 -2
- package/dist/vision/index.js.map +1 -1
- package/dist/workspace/index.js +16824 -2
- package/dist/workspace/index.js.map +1 -1
- package/package.json +15 -9
- package/dist/AuroraBackground-AP6ZHVFA.js +0 -6
- package/dist/AuroraBackground-AP6ZHVFA.js.map +0 -1
- package/dist/BentoGrid-CDARICNM.js +0 -6
- package/dist/BentoGrid-CDARICNM.js.map +0 -1
- package/dist/CommandPalette-JCWJKRBY.js +0 -6
- package/dist/CommandPalette-JCWJKRBY.js.map +0 -1
- package/dist/Glass-H4X4ZI4P.js +0 -7
- package/dist/Glass-H4X4ZI4P.js.map +0 -1
- package/dist/GlitchText-KLQ57PPY.js +0 -6
- package/dist/GlitchText-KLQ57PPY.js.map +0 -1
- package/dist/GlowButton-VGBPMZO7.js +0 -6
- package/dist/GlowButton-VGBPMZO7.js.map +0 -1
- package/dist/Graph3D-GO7N2EZQ.js +0 -540
- package/dist/Graph3D-GO7N2EZQ.js.map +0 -1
- package/dist/HUDProgressRing-N6C5NAEV.js +0 -6
- package/dist/HUDProgressRing-N6C5NAEV.js.map +0 -1
- package/dist/KPIStat-PBQK27ZB.js +0 -6
- package/dist/KPIStat-PBQK27ZB.js.map +0 -1
- package/dist/NeonToast-W5F7MU3U.js +0 -6
- package/dist/NeonToast-W5F7MU3U.js.map +0 -1
- package/dist/ParticleField-WK6CNHWU.js +0 -51
- package/dist/ParticleField-WK6CNHWU.js.map +0 -1
- package/dist/TextGenerateEffect-EUCEIIUJ.js +0 -6
- package/dist/TextGenerateEffect-EUCEIIUJ.js.map +0 -1
- package/dist/ThreeDCard-VH5I3SSY.js +0 -6
- package/dist/ThreeDCard-VH5I3SSY.js.map +0 -1
- package/dist/TypingAnimation-GIWOHPIX.js +0 -6
- package/dist/TypingAnimation-GIWOHPIX.js.map +0 -1
- package/dist/alert-dialog-QOSYBIIE.js +0 -19
- package/dist/alert-dialog-QOSYBIIE.js.map +0 -1
- package/dist/avatar-N5R37PCU.js +0 -10
- package/dist/avatar-N5R37PCU.js.map +0 -1
- package/dist/badge-GTVIIGPY.js +0 -8
- package/dist/badge-GTVIIGPY.js.map +0 -1
- package/dist/button-D7IMSV2D.js +0 -8
- package/dist/button-D7IMSV2D.js.map +0 -1
- package/dist/chunk-3CMPQOMY.js +0 -69
- package/dist/chunk-3CMPQOMY.js.map +0 -1
- package/dist/chunk-3OQT6IYR.js +0 -41
- package/dist/chunk-3OQT6IYR.js.map +0 -1
- package/dist/chunk-43B2WVLS.js +0 -85
- package/dist/chunk-43B2WVLS.js.map +0 -1
- package/dist/chunk-4SRFO5W3.js +0 -121
- package/dist/chunk-4SRFO5W3.js.map +0 -1
- package/dist/chunk-5IZELOOU.js +0 -362
- package/dist/chunk-5IZELOOU.js.map +0 -1
- package/dist/chunk-6DM4ACSS.js +0 -154
- package/dist/chunk-6DM4ACSS.js.map +0 -1
- package/dist/chunk-6IGT34PC.js +0 -50
- package/dist/chunk-6IGT34PC.js.map +0 -1
- package/dist/chunk-6RKBCJHN.js +0 -194
- package/dist/chunk-6RKBCJHN.js.map +0 -1
- package/dist/chunk-6RX2WGCO.js +0 -108
- package/dist/chunk-6RX2WGCO.js.map +0 -1
- package/dist/chunk-7K4WZM3U.js +0 -189
- package/dist/chunk-7K4WZM3U.js.map +0 -1
- package/dist/chunk-7MDBHJPT.js +0 -407
- package/dist/chunk-7MDBHJPT.js.map +0 -1
- package/dist/chunk-7UQD6ROV.js +0 -9
- package/dist/chunk-7UQD6ROV.js.map +0 -1
- package/dist/chunk-AFNIVLZP.js +0 -1069
- package/dist/chunk-AFNIVLZP.js.map +0 -1
- package/dist/chunk-ANWYRO6A.js +0 -407
- package/dist/chunk-ANWYRO6A.js.map +0 -1
- package/dist/chunk-DIXPOHDO.js +0 -71
- package/dist/chunk-DIXPOHDO.js.map +0 -1
- package/dist/chunk-DWYMKYPI.js +0 -3
- package/dist/chunk-DWYMKYPI.js.map +0 -1
- package/dist/chunk-E3NVDCZG.js +0 -280
- package/dist/chunk-E3NVDCZG.js.map +0 -1
- package/dist/chunk-EBM7YBKL.js +0 -399
- package/dist/chunk-EBM7YBKL.js.map +0 -1
- package/dist/chunk-EPAM7IWW.js +0 -294
- package/dist/chunk-EPAM7IWW.js.map +0 -1
- package/dist/chunk-EXQ7GYRS.js +0 -134
- package/dist/chunk-EXQ7GYRS.js.map +0 -1
- package/dist/chunk-F4QTUZ3C.js +0 -136
- package/dist/chunk-F4QTUZ3C.js.map +0 -1
- package/dist/chunk-FEW533R2.js +0 -105
- package/dist/chunk-FEW533R2.js.map +0 -1
- package/dist/chunk-FFZLJKC7.js +0 -270
- package/dist/chunk-FFZLJKC7.js.map +0 -1
- package/dist/chunk-GEAMOBF7.js +0 -8486
- package/dist/chunk-GEAMOBF7.js.map +0 -1
- package/dist/chunk-GRTRSCTD.js +0 -74
- package/dist/chunk-GRTRSCTD.js.map +0 -1
- package/dist/chunk-IKGYOGLK.js +0 -16
- package/dist/chunk-IKGYOGLK.js.map +0 -1
- package/dist/chunk-IQ7WYWVJ.js +0 -73
- package/dist/chunk-IQ7WYWVJ.js.map +0 -1
- package/dist/chunk-IXIVWQLF.js +0 -543
- package/dist/chunk-IXIVWQLF.js.map +0 -1
- package/dist/chunk-JCJU57RC.js +0 -115
- package/dist/chunk-JCJU57RC.js.map +0 -1
- package/dist/chunk-KORSTBU4.js +0 -117
- package/dist/chunk-KORSTBU4.js.map +0 -1
- package/dist/chunk-KSEZ6UM2.js +0 -235
- package/dist/chunk-KSEZ6UM2.js.map +0 -1
- package/dist/chunk-MHPF7R3O.js +0 -1376
- package/dist/chunk-MHPF7R3O.js.map +0 -1
- package/dist/chunk-MPC5IH7E.js +0 -81
- package/dist/chunk-MPC5IH7E.js.map +0 -1
- package/dist/chunk-MQIU2NYA.js +0 -114
- package/dist/chunk-MQIU2NYA.js.map +0 -1
- package/dist/chunk-NYMBJOGR.js +0 -2192
- package/dist/chunk-NYMBJOGR.js.map +0 -1
- package/dist/chunk-OBZD2M3C.js +0 -169
- package/dist/chunk-OBZD2M3C.js.map +0 -1
- package/dist/chunk-ODM2AG6G.js +0 -176
- package/dist/chunk-ODM2AG6G.js.map +0 -1
- package/dist/chunk-ONDKF5LP.js +0 -53
- package/dist/chunk-ONDKF5LP.js.map +0 -1
- package/dist/chunk-P25YCWQB.js +0 -41
- package/dist/chunk-P25YCWQB.js.map +0 -1
- package/dist/chunk-PFYVNM6H.js +0 -14
- package/dist/chunk-PFYVNM6H.js.map +0 -1
- package/dist/chunk-PWNNSGFL.js +0 -20
- package/dist/chunk-PWNNSGFL.js.map +0 -1
- package/dist/chunk-Q2PGZVOT.js +0 -36
- package/dist/chunk-Q2PGZVOT.js.map +0 -1
- package/dist/chunk-Q2XDMV7U.js +0 -76
- package/dist/chunk-Q2XDMV7U.js.map +0 -1
- package/dist/chunk-QG7FH2FI.js +0 -45
- package/dist/chunk-QG7FH2FI.js.map +0 -1
- package/dist/chunk-R7HUOK2D.js +0 -1914
- package/dist/chunk-R7HUOK2D.js.map +0 -1
- package/dist/chunk-REUYY7G5.js +0 -773
- package/dist/chunk-REUYY7G5.js.map +0 -1
- package/dist/chunk-RHC2Z2HT.js +0 -199
- package/dist/chunk-RHC2Z2HT.js.map +0 -1
- package/dist/chunk-RMCVLIFE.js +0 -23
- package/dist/chunk-RMCVLIFE.js.map +0 -1
- package/dist/chunk-ROZLTXGR.js +0 -234
- package/dist/chunk-ROZLTXGR.js.map +0 -1
- package/dist/chunk-RSS2C2O3.js +0 -17
- package/dist/chunk-RSS2C2O3.js.map +0 -1
- package/dist/chunk-SAGCG5SH.js +0 -355
- package/dist/chunk-SAGCG5SH.js.map +0 -1
- package/dist/chunk-TM6AOUSD.js +0 -40
- package/dist/chunk-TM6AOUSD.js.map +0 -1
- package/dist/chunk-TPK4BYCO.js +0 -970
- package/dist/chunk-TPK4BYCO.js.map +0 -1
- package/dist/chunk-UNQIL4K2.js +0 -34
- package/dist/chunk-UNQIL4K2.js.map +0 -1
- package/dist/chunk-UUG6L75Y.js +0 -47
- package/dist/chunk-UUG6L75Y.js.map +0 -1
- package/dist/chunk-V2SYMV4W.js +0 -114
- package/dist/chunk-V2SYMV4W.js.map +0 -1
- package/dist/chunk-V7EN5CTH.js +0 -130
- package/dist/chunk-V7EN5CTH.js.map +0 -1
- package/dist/chunk-VITKG2HL.js +0 -1125
- package/dist/chunk-VITKG2HL.js.map +0 -1
- package/dist/chunk-VYEWU5LO.js +0 -2631
- package/dist/chunk-VYEWU5LO.js.map +0 -1
- package/dist/chunk-W67QAGSH.js +0 -178
- package/dist/chunk-W67QAGSH.js.map +0 -1
- package/dist/chunk-WWBIN6KV.js +0 -1353
- package/dist/chunk-WWBIN6KV.js.map +0 -1
- package/dist/chunk-X77Z4PFB.js +0 -224
- package/dist/chunk-X77Z4PFB.js.map +0 -1
- package/dist/chunk-X7VG7OTT.js +0 -8
- package/dist/chunk-X7VG7OTT.js.map +0 -1
- package/dist/chunk-XE4K2SGI.js +0 -74
- package/dist/chunk-XE4K2SGI.js.map +0 -1
- package/dist/chunk-YIUG7IJK.js +0 -628
- package/dist/chunk-YIUG7IJK.js.map +0 -1
- package/dist/chunk-YNVN3V4Y.js +0 -13
- package/dist/chunk-YNVN3V4Y.js.map +0 -1
- package/dist/chunk-Z2S54IZX.js +0 -198
- package/dist/chunk-Z2S54IZX.js.map +0 -1
- package/dist/chunk-ZR6AH25Z.js +0 -17
- package/dist/chunk-ZR6AH25Z.js.map +0 -1
- package/dist/dialog-SPM3DTTI.js +0 -17
- package/dist/dialog-SPM3DTTI.js.map +0 -1
- package/dist/dropdown-menu-HMTWKWGK.js +0 -21
- package/dist/dropdown-menu-HMTWKWGK.js.map +0 -1
- package/dist/input-BH4P4S26.js +0 -6
- package/dist/input-BH4P4S26.js.map +0 -1
- package/dist/label-5Z4Q6VER.js +0 -8
- package/dist/label-5Z4Q6VER.js.map +0 -1
- package/dist/popover-IFOUXYLI.js +0 -18
- package/dist/popover-IFOUXYLI.js.map +0 -1
- package/dist/scroll-area-DJXNW6QX.js +0 -14
- package/dist/scroll-area-DJXNW6QX.js.map +0 -1
- package/dist/select-FZ277C3G.js +0 -22
- package/dist/select-FZ277C3G.js.map +0 -1
- package/dist/separator-BTMLN4NB.js +0 -8
- package/dist/separator-BTMLN4NB.js.map +0 -1
- package/dist/skeleton-DXIWBH4W.js +0 -6
- package/dist/skeleton-DXIWBH4W.js.map +0 -1
- package/dist/switch-4MCXIZBY.js +0 -13
- package/dist/switch-4MCXIZBY.js.map +0 -1
- package/dist/tabs-O7AW3APK.js +0 -17
- package/dist/tabs-O7AW3APK.js.map +0 -1
- package/dist/textarea-IB5WAFDO.js +0 -6
- package/dist/textarea-IB5WAFDO.js.map +0 -1
- package/dist/toggle-XVPPG6P4.js +0 -10
- package/dist/toggle-XVPPG6P4.js.map +0 -1
- package/dist/tooltip-JICZTD4F.js +0 -18
- package/dist/tooltip-JICZTD4F.js.map +0 -1
package/dist/chunk-7K4WZM3U.js
DELETED
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
import { prefersReducedMotion, animateFloat, animateNumber, cn } from './chunk-6RX2WGCO.js';
|
|
2
|
-
import { motion, AnimatePresence } from 'framer-motion';
|
|
3
|
-
import { useState, useId, useMemo, useEffect } from 'react';
|
|
4
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
function HUDProgressRing({
|
|
7
|
-
value,
|
|
8
|
-
displayValue,
|
|
9
|
-
size = 120,
|
|
10
|
-
strokeWidth = 8,
|
|
11
|
-
theme = "rainbow",
|
|
12
|
-
showValue = true,
|
|
13
|
-
suffix = "%",
|
|
14
|
-
animationDuration = 1500,
|
|
15
|
-
disableAnimations = false,
|
|
16
|
-
label,
|
|
17
|
-
className,
|
|
18
|
-
...props
|
|
19
|
-
}) {
|
|
20
|
-
const [animatedValue, setAnimatedValue] = useState(0);
|
|
21
|
-
const [animatedDisplayValue, setAnimatedDisplayValue] = useState(0);
|
|
22
|
-
const reducedMotion = prefersReducedMotion();
|
|
23
|
-
const shouldAnimate = !disableAnimations && !reducedMotion;
|
|
24
|
-
const gradientId = useId();
|
|
25
|
-
const clampedValue = useMemo(() => Math.max(0, Math.min(1, value)), [value]);
|
|
26
|
-
const radius = (size - strokeWidth) / 2;
|
|
27
|
-
const circumference = 2 * Math.PI * radius;
|
|
28
|
-
const strokeDasharray = circumference;
|
|
29
|
-
const strokeDashoffset = circumference - animatedValue * circumference;
|
|
30
|
-
const finalDisplayValue = displayValue ?? animatedValue * 100;
|
|
31
|
-
useEffect(() => {
|
|
32
|
-
const target = clampedValue;
|
|
33
|
-
if (shouldAnimate) {
|
|
34
|
-
animateFloat(animatedValue, target, animationDuration, setAnimatedValue);
|
|
35
|
-
animateNumber(
|
|
36
|
-
Math.round(animatedDisplayValue),
|
|
37
|
-
Math.round(displayValue ?? target * 100),
|
|
38
|
-
animationDuration,
|
|
39
|
-
setAnimatedDisplayValue
|
|
40
|
-
);
|
|
41
|
-
} else {
|
|
42
|
-
setAnimatedValue(target);
|
|
43
|
-
setAnimatedDisplayValue(displayValue ?? target * 100);
|
|
44
|
-
}
|
|
45
|
-
}, [clampedValue, displayValue, shouldAnimate, animationDuration]);
|
|
46
|
-
const getThemeColors = () => {
|
|
47
|
-
switch (theme) {
|
|
48
|
-
case "cyan":
|
|
49
|
-
return {
|
|
50
|
-
stroke: "hsl(var(--cyan-neon))",
|
|
51
|
-
glow: "var(--cyan-neon)",
|
|
52
|
-
shadow: "shadow-neon-cyan"
|
|
53
|
-
};
|
|
54
|
-
case "magenta":
|
|
55
|
-
return {
|
|
56
|
-
stroke: "hsl(var(--magenta-neon))",
|
|
57
|
-
glow: "var(--magenta-neon)",
|
|
58
|
-
shadow: "shadow-neon-magenta"
|
|
59
|
-
};
|
|
60
|
-
case "emerald":
|
|
61
|
-
return {
|
|
62
|
-
stroke: "hsl(var(--emerald-neon))",
|
|
63
|
-
glow: "var(--emerald-neon)",
|
|
64
|
-
shadow: "shadow-neon-emerald"
|
|
65
|
-
};
|
|
66
|
-
case "rainbow":
|
|
67
|
-
default:
|
|
68
|
-
return {
|
|
69
|
-
stroke: "url(#rainbow-gradient)",
|
|
70
|
-
glow: "var(--cyan-neon)",
|
|
71
|
-
shadow: "shadow-glow"
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
const themeColors = getThemeColors();
|
|
76
|
-
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col items-center justify-center gap-2", className), ...props, children: [
|
|
77
|
-
/* @__PURE__ */ jsxs("div", { className: "relative", style: { width: size, height: size }, children: [
|
|
78
|
-
/* @__PURE__ */ jsxs(
|
|
79
|
-
"svg",
|
|
80
|
-
{
|
|
81
|
-
width: size,
|
|
82
|
-
height: size,
|
|
83
|
-
className: cn(
|
|
84
|
-
"transform -rotate-90 transition-all duration-300",
|
|
85
|
-
shouldAnimate && "animate-soft-glow",
|
|
86
|
-
themeColors.shadow
|
|
87
|
-
),
|
|
88
|
-
role: "img",
|
|
89
|
-
"aria-label": label ? `${label}: ${Math.round(finalDisplayValue)}${suffix}` : `${Math.round(finalDisplayValue)}${suffix}`,
|
|
90
|
-
children: [
|
|
91
|
-
/* @__PURE__ */ jsxs("defs", { children: [
|
|
92
|
-
/* @__PURE__ */ jsxs(
|
|
93
|
-
"linearGradient",
|
|
94
|
-
{
|
|
95
|
-
id: `rainbow-gradient-${gradientId}`,
|
|
96
|
-
x1: "0%",
|
|
97
|
-
y1: "0%",
|
|
98
|
-
x2: "100%",
|
|
99
|
-
y2: "100%",
|
|
100
|
-
children: [
|
|
101
|
-
/* @__PURE__ */ jsx("stop", { offset: "0%", stopColor: "hsl(var(--cyan-neon))" }),
|
|
102
|
-
/* @__PURE__ */ jsx("stop", { offset: "50%", stopColor: "hsl(var(--magenta-neon))" }),
|
|
103
|
-
/* @__PURE__ */ jsx("stop", { offset: "100%", stopColor: "hsl(var(--emerald-neon))" })
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
),
|
|
107
|
-
/* @__PURE__ */ jsxs("filter", { id: "glow", children: [
|
|
108
|
-
/* @__PURE__ */ jsx("feGaussianBlur", { stdDeviation: "3", result: "coloredBlur" }),
|
|
109
|
-
/* @__PURE__ */ jsxs("feMerge", { children: [
|
|
110
|
-
/* @__PURE__ */ jsx("feMergeNode", { in: "coloredBlur" }),
|
|
111
|
-
/* @__PURE__ */ jsx("feMergeNode", { in: "SourceGraphic" })
|
|
112
|
-
] })
|
|
113
|
-
] })
|
|
114
|
-
] }),
|
|
115
|
-
/* @__PURE__ */ jsx(
|
|
116
|
-
"circle",
|
|
117
|
-
{
|
|
118
|
-
cx: size / 2,
|
|
119
|
-
cy: size / 2,
|
|
120
|
-
r: radius,
|
|
121
|
-
fill: "none",
|
|
122
|
-
stroke: "hsl(var(--border))",
|
|
123
|
-
strokeWidth,
|
|
124
|
-
className: "opacity-20"
|
|
125
|
-
}
|
|
126
|
-
),
|
|
127
|
-
/* @__PURE__ */ jsx(
|
|
128
|
-
motion.circle,
|
|
129
|
-
{
|
|
130
|
-
cx: size / 2,
|
|
131
|
-
cy: size / 2,
|
|
132
|
-
r: radius,
|
|
133
|
-
fill: "none",
|
|
134
|
-
stroke: theme === "rainbow" ? `url(#rainbow-gradient-${gradientId})` : themeColors.stroke,
|
|
135
|
-
strokeWidth,
|
|
136
|
-
strokeLinecap: "round",
|
|
137
|
-
strokeDasharray,
|
|
138
|
-
strokeDashoffset,
|
|
139
|
-
filter: "url(#glow)",
|
|
140
|
-
initial: shouldAnimate ? { strokeDashoffset: circumference } : {},
|
|
141
|
-
animate: { strokeDashoffset },
|
|
142
|
-
transition: {
|
|
143
|
-
duration: shouldAnimate ? animationDuration / 1e3 : 0,
|
|
144
|
-
ease: "easeOut"
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
)
|
|
148
|
-
]
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
showValue && /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex flex-col items-center justify-center", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsxs(
|
|
152
|
-
motion.span,
|
|
153
|
-
{
|
|
154
|
-
className: "text-2xl font-bold font-display tabular-nums",
|
|
155
|
-
style: {
|
|
156
|
-
color: theme === "rainbow" ? "hsl(var(--cyan-neon))" : themeColors.stroke
|
|
157
|
-
},
|
|
158
|
-
initial: shouldAnimate ? { y: 10, opacity: 0 } : {},
|
|
159
|
-
animate: { y: 0, opacity: 1 },
|
|
160
|
-
exit: { y: -10, opacity: 0 },
|
|
161
|
-
transition: { duration: shouldAnimate ? 0.2 : 0 },
|
|
162
|
-
children: [
|
|
163
|
-
Math.round(finalDisplayValue),
|
|
164
|
-
suffix
|
|
165
|
-
]
|
|
166
|
-
},
|
|
167
|
-
Math.floor(finalDisplayValue)
|
|
168
|
-
) }) })
|
|
169
|
-
] }),
|
|
170
|
-
label && /* @__PURE__ */ jsx(
|
|
171
|
-
motion.span,
|
|
172
|
-
{
|
|
173
|
-
className: "text-sm text-muted-foreground font-medium",
|
|
174
|
-
initial: shouldAnimate ? { opacity: 0, y: 5 } : {},
|
|
175
|
-
animate: { opacity: 1, y: 0 },
|
|
176
|
-
transition: {
|
|
177
|
-
delay: shouldAnimate ? 0.3 : 0,
|
|
178
|
-
duration: shouldAnimate ? 0.3 : 0
|
|
179
|
-
},
|
|
180
|
-
"aria-hidden": true,
|
|
181
|
-
children: label
|
|
182
|
-
}
|
|
183
|
-
)
|
|
184
|
-
] });
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
export { HUDProgressRing };
|
|
188
|
-
//# sourceMappingURL=chunk-7K4WZM3U.js.map
|
|
189
|
-
//# sourceMappingURL=chunk-7K4WZM3U.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/primitives/atoms/HUDProgressRing/HUDProgressRing.tsx"],"names":[],"mappings":";;;;;AA+BO,SAAS,eAAA,CAAgB;AAAA,EAC9B,KAAA;AAAA,EACA,YAAA;AAAA,EACA,IAAA,GAAO,GAAA;AAAA,EACP,WAAA,GAAc,CAAA;AAAA,EACd,KAAA,GAAQ,SAAA;AAAA,EACR,SAAA,GAAY,IAAA;AAAA,EACZ,MAAA,GAAS,GAAA;AAAA,EACT,iBAAA,GAAoB,IAAA;AAAA,EACpB,iBAAA,GAAoB,KAAA;AAAA,EACpB,KAAA;AAAA,EACA,SAAA;AAAA,EACA,GAAG;AACL,CAAA,EAAyB;AACvB,EAAA,MAAM,CAAC,aAAA,EAAe,gBAAgB,CAAA,GAAI,SAAS,CAAC,CAAA;AACpD,EAAA,MAAM,CAAC,oBAAA,EAAsB,uBAAuB,CAAA,GAAI,SAAS,CAAC,CAAA;AAClE,EAAA,MAAM,gBAAgB,oBAAA,EAAqB;AAC3C,EAAA,MAAM,aAAA,GAAgB,CAAC,iBAAA,IAAqB,CAAC,aAAA;AAC7C,EAAA,MAAM,aAAa,KAAA,EAAM;AACzB,EAAA,MAAM,YAAA,GAAe,OAAA,CAAQ,MAAM,IAAA,CAAK,IAAI,CAAA,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,GAAgB,MAAM,CAAA,EAAE;AAAA,UAE/C,QAAA,EAAA;AAAA,YAAA,IAAA,CAAK,MAAM,iBAAiB,CAAA;AAAA,YAC5B;AAAA;AAAA,SAAA;AAAA,QAXI,IAAA,CAAK,MAAM,iBAAiB;AAAA,SAarC,CAAA,EACF;AAAA,KAAA,EAEJ,CAAA;AAAA,IAGC,KAAA,oBACC,GAAA;AAAA,MAAC,MAAA,CAAO,IAAA;AAAA,MAAP;AAAA,QACC,SAAA,EAAU,2CAAA;AAAA,QACV,OAAA,EAAS,gBAAgB,EAAE,OAAA,EAAS,GAAG,CAAA,EAAG,CAAA,KAAM,EAAC;AAAA,QACjD,OAAA,EAAS,EAAE,OAAA,EAAS,CAAA,EAAG,GAAG,CAAA,EAAE;AAAA,QAC5B,UAAA,EAAY;AAAA,UACV,KAAA,EAAO,gBAAgB,GAAA,GAAM,CAAA;AAAA,UAC7B,QAAA,EAAU,gBAAgB,GAAA,GAAM;AAAA,SAClC;AAAA,QACA,aAAA,EAAW,IAAA;AAAA,QAEV,QAAA,EAAA;AAAA;AAAA;AACH,GAAA,EAEJ,CAAA;AAEJ","file":"chunk-7K4WZM3U.js","sourcesContent":["\"use client\";\n\nimport { animateFloat, animateNumber, cn, prefersReducedMotion } from \"../../../lib/utils\";\nimport { AnimatePresence, motion } from \"framer-motion\";\nimport React, { useEffect, useId, useMemo, useState } from \"react\";\n\nexport interface HUDProgressRingProps extends React.HTMLAttributes<HTMLDivElement> {\n /** Progress value (0-1) */\n value: number;\n /** Display value (defaults to value * 100) */\n displayValue?: number;\n /** Ring size in pixels */\n size?: number;\n /** Ring thickness */\n strokeWidth?: number;\n /** Color theme */\n theme?: \"cyan\" | \"magenta\" | \"emerald\" | \"rainbow\";\n /** Show animated number in center */\n showValue?: boolean;\n /** Value suffix (e.g., '%', 'XP') */\n suffix?: string;\n /** Animation duration in ms */\n animationDuration?: number;\n /** Disable animations */\n disableAnimations?: boolean;\n /** Label text below the ring */\n label?: string;\n /** Optional class name */\n className?: string;\n}\n\nexport function HUDProgressRing({\n value,\n displayValue,\n size = 120,\n strokeWidth = 8,\n theme = \"rainbow\",\n showValue = true,\n suffix = \"%\",\n animationDuration = 1500,\n disableAnimations = false,\n label,\n className,\n ...props\n}: HUDProgressRingProps) {\n const [animatedValue, setAnimatedValue] = useState(0);\n const [animatedDisplayValue, setAnimatedDisplayValue] = useState(0);\n const reducedMotion = prefersReducedMotion();\n const shouldAnimate = !disableAnimations && !reducedMotion;\n const gradientId = useId();\n const clampedValue = useMemo(() => Math.max(0, Math.min(1, value)), [value]);\n\n const radius = (size - strokeWidth) / 2;\n const circumference = 2 * Math.PI * radius;\n const strokeDasharray = circumference;\n const strokeDashoffset = circumference - animatedValue * circumference;\n\n const finalDisplayValue = displayValue ?? animatedValue * 100;\n\n useEffect(() => {\n const target = clampedValue;\n if (shouldAnimate) {\n animateFloat(animatedValue, target, animationDuration, setAnimatedValue);\n animateNumber(\n Math.round(animatedDisplayValue),\n Math.round(displayValue ?? target * 100),\n animationDuration,\n setAnimatedDisplayValue\n );\n } else {\n setAnimatedValue(target);\n setAnimatedDisplayValue(displayValue ?? target * 100);\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [clampedValue, displayValue, shouldAnimate, animationDuration]);\n\n const getThemeColors = () => {\n switch (theme) {\n case \"cyan\":\n return {\n stroke: \"hsl(var(--cyan-neon))\",\n glow: \"var(--cyan-neon)\",\n shadow: \"shadow-neon-cyan\",\n };\n case \"magenta\":\n return {\n stroke: \"hsl(var(--magenta-neon))\",\n glow: \"var(--magenta-neon)\",\n shadow: \"shadow-neon-magenta\",\n };\n case \"emerald\":\n return {\n stroke: \"hsl(var(--emerald-neon))\",\n glow: \"var(--emerald-neon)\",\n shadow: \"shadow-neon-emerald\",\n };\n case \"rainbow\":\n default:\n return {\n stroke: \"url(#rainbow-gradient)\",\n glow: \"var(--cyan-neon)\",\n shadow: \"shadow-glow\",\n };\n }\n };\n\n const themeColors = getThemeColors();\n\n return (\n <div className={cn(\"flex flex-col items-center justify-center gap-2\", className)} {...props}>\n <div className=\"relative\" style={{ width: size, height: size }}>\n <svg\n width={size}\n height={size}\n className={cn(\n \"transform -rotate-90 transition-all duration-300\",\n shouldAnimate && \"animate-soft-glow\",\n themeColors.shadow\n )}\n role=\"img\"\n aria-label={\n label\n ? `${label}: ${Math.round(finalDisplayValue)}${suffix}`\n : `${Math.round(finalDisplayValue)}${suffix}`\n }\n >\n <defs>\n <linearGradient\n id={`rainbow-gradient-${gradientId}`}\n x1=\"0%\"\n y1=\"0%\"\n x2=\"100%\"\n y2=\"100%\"\n >\n <stop offset=\"0%\" stopColor=\"hsl(var(--cyan-neon))\" />\n <stop offset=\"50%\" stopColor=\"hsl(var(--magenta-neon))\" />\n <stop offset=\"100%\" stopColor=\"hsl(var(--emerald-neon))\" />\n </linearGradient>\n <filter id=\"glow\">\n <feGaussianBlur stdDeviation=\"3\" result=\"coloredBlur\" />\n <feMerge>\n <feMergeNode in=\"coloredBlur\" />\n <feMergeNode in=\"SourceGraphic\" />\n </feMerge>\n </filter>\n </defs>\n\n {/* Background ring */}\n <circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n stroke=\"hsl(var(--border))\"\n strokeWidth={strokeWidth}\n className=\"opacity-20\"\n />\n\n {/* Progress ring */}\n <motion.circle\n cx={size / 2}\n cy={size / 2}\n r={radius}\n fill=\"none\"\n stroke={\n theme === \"rainbow\" ? `url(#rainbow-gradient-${gradientId})` : themeColors.stroke\n }\n strokeWidth={strokeWidth}\n strokeLinecap=\"round\"\n strokeDasharray={strokeDasharray}\n strokeDashoffset={strokeDashoffset}\n filter=\"url(#glow)\"\n initial={shouldAnimate ? { strokeDashoffset: circumference } : {}}\n animate={{ strokeDashoffset }}\n transition={{\n duration: shouldAnimate ? animationDuration / 1000 : 0,\n ease: \"easeOut\",\n }}\n />\n </svg>\n\n {/* Center content */}\n {showValue && (\n <div className=\"absolute inset-0 flex flex-col items-center justify-center\">\n <AnimatePresence mode=\"wait\">\n <motion.span\n key={Math.floor(finalDisplayValue)}\n className=\"text-2xl font-bold font-display tabular-nums\"\n style={{\n color: theme === \"rainbow\" ? \"hsl(var(--cyan-neon))\" : themeColors.stroke,\n }}\n initial={shouldAnimate ? { y: 10, opacity: 0 } : {}}\n animate={{ y: 0, opacity: 1 }}\n exit={{ y: -10, opacity: 0 }}\n transition={{ duration: shouldAnimate ? 0.2 : 0 }}\n >\n {Math.round(finalDisplayValue)}\n {suffix}\n </motion.span>\n </AnimatePresence>\n </div>\n )}\n </div>\n\n {/* Label */}\n {label && (\n <motion.span\n className=\"text-sm text-muted-foreground font-medium\"\n initial={shouldAnimate ? { opacity: 0, y: 5 } : {}}\n animate={{ opacity: 1, y: 0 }}\n transition={{\n delay: shouldAnimate ? 0.3 : 0,\n duration: shouldAnimate ? 0.3 : 0,\n }}\n aria-hidden\n >\n {label}\n </motion.span>\n )}\n </div>\n );\n}\n"]}
|
package/dist/chunk-7MDBHJPT.js
DELETED
|
@@ -1,407 +0,0 @@
|
|
|
1
|
-
import { useCallbackRef } from './chunk-PFYVNM6H.js';
|
|
2
|
-
import { useLayoutEffect2 } from './chunk-7UQD6ROV.js';
|
|
3
|
-
import { createSlot } from './chunk-FEW533R2.js';
|
|
4
|
-
import { cn } from './chunk-6RX2WGCO.js';
|
|
5
|
-
import { __commonJS, __require, __toESM } from './chunk-TM6AOUSD.js';
|
|
6
|
-
import * as React3 from 'react';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
import 'react-dom';
|
|
9
|
-
|
|
10
|
-
// ../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js
|
|
11
|
-
var require_use_sync_external_store_shim_production = __commonJS({
|
|
12
|
-
"../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.js"(exports$1) {
|
|
13
|
-
var React4 = __require("react");
|
|
14
|
-
function is(x, y) {
|
|
15
|
-
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
16
|
-
}
|
|
17
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is;
|
|
18
|
-
var useState2 = React4.useState;
|
|
19
|
-
var useEffect2 = React4.useEffect;
|
|
20
|
-
var useLayoutEffect = React4.useLayoutEffect;
|
|
21
|
-
var useDebugValue = React4.useDebugValue;
|
|
22
|
-
function useSyncExternalStore$2(subscribe2, getSnapshot) {
|
|
23
|
-
var value = getSnapshot(), _useState = useState2({ inst: { value, getSnapshot } }), inst = _useState[0].inst, forceUpdate = _useState[1];
|
|
24
|
-
useLayoutEffect(
|
|
25
|
-
function() {
|
|
26
|
-
inst.value = value;
|
|
27
|
-
inst.getSnapshot = getSnapshot;
|
|
28
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
29
|
-
},
|
|
30
|
-
[subscribe2, value, getSnapshot]
|
|
31
|
-
);
|
|
32
|
-
useEffect2(
|
|
33
|
-
function() {
|
|
34
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
35
|
-
return subscribe2(function() {
|
|
36
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
37
|
-
});
|
|
38
|
-
},
|
|
39
|
-
[subscribe2]
|
|
40
|
-
);
|
|
41
|
-
useDebugValue(value);
|
|
42
|
-
return value;
|
|
43
|
-
}
|
|
44
|
-
function checkIfSnapshotChanged(inst) {
|
|
45
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
46
|
-
inst = inst.value;
|
|
47
|
-
try {
|
|
48
|
-
var nextValue = latestGetSnapshot();
|
|
49
|
-
return !objectIs(inst, nextValue);
|
|
50
|
-
} catch (error) {
|
|
51
|
-
return true;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function useSyncExternalStore$1(subscribe2, getSnapshot) {
|
|
55
|
-
return getSnapshot();
|
|
56
|
-
}
|
|
57
|
-
var shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
58
|
-
exports$1.useSyncExternalStore = void 0 !== React4.useSyncExternalStore ? React4.useSyncExternalStore : shim;
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
// ../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
|
|
63
|
-
var require_use_sync_external_store_shim_development = __commonJS({
|
|
64
|
-
"../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports$1) {
|
|
65
|
-
"production" !== process.env.NODE_ENV && (function() {
|
|
66
|
-
function is(x, y) {
|
|
67
|
-
return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
|
|
68
|
-
}
|
|
69
|
-
function useSyncExternalStore$2(subscribe2, getSnapshot) {
|
|
70
|
-
didWarnOld18Alpha || void 0 === React4.startTransition || (didWarnOld18Alpha = true, console.error(
|
|
71
|
-
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
72
|
-
));
|
|
73
|
-
var value = getSnapshot();
|
|
74
|
-
if (!didWarnUncachedGetSnapshot) {
|
|
75
|
-
var cachedValue = getSnapshot();
|
|
76
|
-
objectIs(value, cachedValue) || (console.error(
|
|
77
|
-
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
78
|
-
), didWarnUncachedGetSnapshot = true);
|
|
79
|
-
}
|
|
80
|
-
cachedValue = useState2({
|
|
81
|
-
inst: { value, getSnapshot }
|
|
82
|
-
});
|
|
83
|
-
var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
|
|
84
|
-
useLayoutEffect(
|
|
85
|
-
function() {
|
|
86
|
-
inst.value = value;
|
|
87
|
-
inst.getSnapshot = getSnapshot;
|
|
88
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
89
|
-
},
|
|
90
|
-
[subscribe2, value, getSnapshot]
|
|
91
|
-
);
|
|
92
|
-
useEffect2(
|
|
93
|
-
function() {
|
|
94
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
95
|
-
return subscribe2(function() {
|
|
96
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst });
|
|
97
|
-
});
|
|
98
|
-
},
|
|
99
|
-
[subscribe2]
|
|
100
|
-
);
|
|
101
|
-
useDebugValue(value);
|
|
102
|
-
return value;
|
|
103
|
-
}
|
|
104
|
-
function checkIfSnapshotChanged(inst) {
|
|
105
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
106
|
-
inst = inst.value;
|
|
107
|
-
try {
|
|
108
|
-
var nextValue = latestGetSnapshot();
|
|
109
|
-
return !objectIs(inst, nextValue);
|
|
110
|
-
} catch (error) {
|
|
111
|
-
return true;
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
function useSyncExternalStore$1(subscribe2, getSnapshot) {
|
|
115
|
-
return getSnapshot();
|
|
116
|
-
}
|
|
117
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
118
|
-
var React4 = __require("react"), objectIs = "function" === typeof Object.is ? Object.is : is, useState2 = React4.useState, useEffect2 = React4.useEffect, useLayoutEffect = React4.useLayoutEffect, useDebugValue = React4.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
|
|
119
|
-
exports$1.useSyncExternalStore = void 0 !== React4.useSyncExternalStore ? React4.useSyncExternalStore : shim;
|
|
120
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
121
|
-
})();
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
// ../../node_modules/use-sync-external-store/shim/index.js
|
|
126
|
-
var require_shim = __commonJS({
|
|
127
|
-
"../../node_modules/use-sync-external-store/shim/index.js"(exports$1, module) {
|
|
128
|
-
if (process.env.NODE_ENV === "production") {
|
|
129
|
-
module.exports = require_use_sync_external_store_shim_production();
|
|
130
|
-
} else {
|
|
131
|
-
module.exports = require_use_sync_external_store_shim_development();
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
function createContextScope(scopeName, createContextScopeDeps = []) {
|
|
136
|
-
let defaultContexts = [];
|
|
137
|
-
function createContext3(rootComponentName, defaultContext) {
|
|
138
|
-
const BaseContext = React3.createContext(defaultContext);
|
|
139
|
-
BaseContext.displayName = rootComponentName + "Context";
|
|
140
|
-
const index = defaultContexts.length;
|
|
141
|
-
defaultContexts = [...defaultContexts, defaultContext];
|
|
142
|
-
const Provider = (props) => {
|
|
143
|
-
const { scope, children, ...context } = props;
|
|
144
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
145
|
-
const value = React3.useMemo(() => context, Object.values(context));
|
|
146
|
-
return /* @__PURE__ */ jsx(Context.Provider, { value, children });
|
|
147
|
-
};
|
|
148
|
-
Provider.displayName = rootComponentName + "Provider";
|
|
149
|
-
function useContext2(consumerName, scope) {
|
|
150
|
-
const Context = scope?.[scopeName]?.[index] || BaseContext;
|
|
151
|
-
const context = React3.useContext(Context);
|
|
152
|
-
if (context) return context;
|
|
153
|
-
if (defaultContext !== void 0) return defaultContext;
|
|
154
|
-
throw new Error(`\`${consumerName}\` must be used within \`${rootComponentName}\``);
|
|
155
|
-
}
|
|
156
|
-
return [Provider, useContext2];
|
|
157
|
-
}
|
|
158
|
-
const createScope = () => {
|
|
159
|
-
const scopeContexts = defaultContexts.map((defaultContext) => {
|
|
160
|
-
return React3.createContext(defaultContext);
|
|
161
|
-
});
|
|
162
|
-
return function useScope(scope) {
|
|
163
|
-
const contexts = scope?.[scopeName] || scopeContexts;
|
|
164
|
-
return React3.useMemo(
|
|
165
|
-
() => ({ [`__scope${scopeName}`]: { ...scope, [scopeName]: contexts } }),
|
|
166
|
-
[scope, contexts]
|
|
167
|
-
);
|
|
168
|
-
};
|
|
169
|
-
};
|
|
170
|
-
createScope.scopeName = scopeName;
|
|
171
|
-
return [createContext3, composeContextScopes(createScope, ...createContextScopeDeps)];
|
|
172
|
-
}
|
|
173
|
-
function composeContextScopes(...scopes) {
|
|
174
|
-
const baseScope = scopes[0];
|
|
175
|
-
if (scopes.length === 1) return baseScope;
|
|
176
|
-
const createScope = () => {
|
|
177
|
-
const scopeHooks = scopes.map((createScope2) => ({
|
|
178
|
-
useScope: createScope2(),
|
|
179
|
-
scopeName: createScope2.scopeName
|
|
180
|
-
}));
|
|
181
|
-
return function useComposedScopes(overrideScopes) {
|
|
182
|
-
const nextScopes = scopeHooks.reduce((nextScopes2, { useScope, scopeName }) => {
|
|
183
|
-
const scopeProps = useScope(overrideScopes);
|
|
184
|
-
const currentScope = scopeProps[`__scope${scopeName}`];
|
|
185
|
-
return { ...nextScopes2, ...currentScope };
|
|
186
|
-
}, {});
|
|
187
|
-
return React3.useMemo(() => ({ [`__scope${baseScope.scopeName}`]: nextScopes }), [nextScopes]);
|
|
188
|
-
};
|
|
189
|
-
};
|
|
190
|
-
createScope.scopeName = baseScope.scopeName;
|
|
191
|
-
return createScope;
|
|
192
|
-
}
|
|
193
|
-
var NODES = [
|
|
194
|
-
"a",
|
|
195
|
-
"button",
|
|
196
|
-
"div",
|
|
197
|
-
"form",
|
|
198
|
-
"h2",
|
|
199
|
-
"h3",
|
|
200
|
-
"img",
|
|
201
|
-
"input",
|
|
202
|
-
"label",
|
|
203
|
-
"li",
|
|
204
|
-
"nav",
|
|
205
|
-
"ol",
|
|
206
|
-
"p",
|
|
207
|
-
"select",
|
|
208
|
-
"span",
|
|
209
|
-
"svg",
|
|
210
|
-
"ul"
|
|
211
|
-
];
|
|
212
|
-
var Primitive = NODES.reduce((primitive, node) => {
|
|
213
|
-
const Slot = createSlot(`Primitive.${node}`);
|
|
214
|
-
const Node = React3.forwardRef((props, forwardedRef) => {
|
|
215
|
-
const { asChild, ...primitiveProps } = props;
|
|
216
|
-
const Comp = asChild ? Slot : node;
|
|
217
|
-
if (typeof window !== "undefined") {
|
|
218
|
-
window[/* @__PURE__ */ Symbol.for("radix-ui")] = true;
|
|
219
|
-
}
|
|
220
|
-
return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
|
|
221
|
-
});
|
|
222
|
-
Node.displayName = `Primitive.${node}`;
|
|
223
|
-
return { ...primitive, [node]: Node };
|
|
224
|
-
}, {});
|
|
225
|
-
|
|
226
|
-
// ../../node_modules/@radix-ui/react-use-is-hydrated/dist/index.mjs
|
|
227
|
-
var import_shim = __toESM(require_shim(), 1);
|
|
228
|
-
function useIsHydrated() {
|
|
229
|
-
return (0, import_shim.useSyncExternalStore)(
|
|
230
|
-
subscribe,
|
|
231
|
-
() => true,
|
|
232
|
-
() => false
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
function subscribe() {
|
|
236
|
-
return () => {
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
var AVATAR_NAME = "Avatar";
|
|
240
|
-
var [createAvatarContext] = createContextScope(AVATAR_NAME);
|
|
241
|
-
var [AvatarProvider, useAvatarContext] = createAvatarContext(AVATAR_NAME);
|
|
242
|
-
var Avatar = React3.forwardRef(
|
|
243
|
-
(props, forwardedRef) => {
|
|
244
|
-
const { __scopeAvatar, ...avatarProps } = props;
|
|
245
|
-
const [imageLoadingStatus, setImageLoadingStatus] = React3.useState("idle");
|
|
246
|
-
return /* @__PURE__ */ jsx(
|
|
247
|
-
AvatarProvider,
|
|
248
|
-
{
|
|
249
|
-
scope: __scopeAvatar,
|
|
250
|
-
imageLoadingStatus,
|
|
251
|
-
onImageLoadingStatusChange: setImageLoadingStatus,
|
|
252
|
-
children: /* @__PURE__ */ jsx(Primitive.span, { ...avatarProps, ref: forwardedRef })
|
|
253
|
-
}
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
);
|
|
257
|
-
Avatar.displayName = AVATAR_NAME;
|
|
258
|
-
var IMAGE_NAME = "AvatarImage";
|
|
259
|
-
var AvatarImage = React3.forwardRef(
|
|
260
|
-
(props, forwardedRef) => {
|
|
261
|
-
const { __scopeAvatar, src, onLoadingStatusChange = () => {
|
|
262
|
-
}, ...imageProps } = props;
|
|
263
|
-
const context = useAvatarContext(IMAGE_NAME, __scopeAvatar);
|
|
264
|
-
const imageLoadingStatus = useImageLoadingStatus(src, imageProps);
|
|
265
|
-
const handleLoadingStatusChange = useCallbackRef((status) => {
|
|
266
|
-
onLoadingStatusChange(status);
|
|
267
|
-
context.onImageLoadingStatusChange(status);
|
|
268
|
-
});
|
|
269
|
-
useLayoutEffect2(() => {
|
|
270
|
-
if (imageLoadingStatus !== "idle") {
|
|
271
|
-
handleLoadingStatusChange(imageLoadingStatus);
|
|
272
|
-
}
|
|
273
|
-
}, [imageLoadingStatus, handleLoadingStatusChange]);
|
|
274
|
-
return imageLoadingStatus === "loaded" ? /* @__PURE__ */ jsx(Primitive.img, { ...imageProps, ref: forwardedRef, src }) : null;
|
|
275
|
-
}
|
|
276
|
-
);
|
|
277
|
-
AvatarImage.displayName = IMAGE_NAME;
|
|
278
|
-
var FALLBACK_NAME = "AvatarFallback";
|
|
279
|
-
var AvatarFallback = React3.forwardRef(
|
|
280
|
-
(props, forwardedRef) => {
|
|
281
|
-
const { __scopeAvatar, delayMs, ...fallbackProps } = props;
|
|
282
|
-
const context = useAvatarContext(FALLBACK_NAME, __scopeAvatar);
|
|
283
|
-
const [canRender, setCanRender] = React3.useState(delayMs === void 0);
|
|
284
|
-
React3.useEffect(() => {
|
|
285
|
-
if (delayMs !== void 0) {
|
|
286
|
-
const timerId = window.setTimeout(() => setCanRender(true), delayMs);
|
|
287
|
-
return () => window.clearTimeout(timerId);
|
|
288
|
-
}
|
|
289
|
-
}, [delayMs]);
|
|
290
|
-
return canRender && context.imageLoadingStatus !== "loaded" ? /* @__PURE__ */ jsx(Primitive.span, { ...fallbackProps, ref: forwardedRef }) : null;
|
|
291
|
-
}
|
|
292
|
-
);
|
|
293
|
-
AvatarFallback.displayName = FALLBACK_NAME;
|
|
294
|
-
function resolveLoadingStatus(image, src) {
|
|
295
|
-
if (!image) {
|
|
296
|
-
return "idle";
|
|
297
|
-
}
|
|
298
|
-
if (!src) {
|
|
299
|
-
return "error";
|
|
300
|
-
}
|
|
301
|
-
if (image.src !== src) {
|
|
302
|
-
image.src = src;
|
|
303
|
-
}
|
|
304
|
-
return image.complete && image.naturalWidth > 0 ? "loaded" : "loading";
|
|
305
|
-
}
|
|
306
|
-
function useImageLoadingStatus(src, { referrerPolicy, crossOrigin }) {
|
|
307
|
-
const isHydrated = useIsHydrated();
|
|
308
|
-
const imageRef = React3.useRef(null);
|
|
309
|
-
const image = (() => {
|
|
310
|
-
if (!isHydrated) return null;
|
|
311
|
-
if (!imageRef.current) {
|
|
312
|
-
imageRef.current = new window.Image();
|
|
313
|
-
}
|
|
314
|
-
return imageRef.current;
|
|
315
|
-
})();
|
|
316
|
-
const [loadingStatus, setLoadingStatus] = React3.useState(
|
|
317
|
-
() => resolveLoadingStatus(image, src)
|
|
318
|
-
);
|
|
319
|
-
useLayoutEffect2(() => {
|
|
320
|
-
setLoadingStatus(resolveLoadingStatus(image, src));
|
|
321
|
-
}, [image, src]);
|
|
322
|
-
useLayoutEffect2(() => {
|
|
323
|
-
const updateStatus = (status) => () => {
|
|
324
|
-
setLoadingStatus(status);
|
|
325
|
-
};
|
|
326
|
-
if (!image) return;
|
|
327
|
-
const handleLoad = updateStatus("loaded");
|
|
328
|
-
const handleError = updateStatus("error");
|
|
329
|
-
image.addEventListener("load", handleLoad);
|
|
330
|
-
image.addEventListener("error", handleError);
|
|
331
|
-
if (referrerPolicy) {
|
|
332
|
-
image.referrerPolicy = referrerPolicy;
|
|
333
|
-
}
|
|
334
|
-
if (typeof crossOrigin === "string") {
|
|
335
|
-
image.crossOrigin = crossOrigin;
|
|
336
|
-
}
|
|
337
|
-
return () => {
|
|
338
|
-
image.removeEventListener("load", handleLoad);
|
|
339
|
-
image.removeEventListener("error", handleError);
|
|
340
|
-
};
|
|
341
|
-
}, [image, crossOrigin, referrerPolicy]);
|
|
342
|
-
return loadingStatus;
|
|
343
|
-
}
|
|
344
|
-
var Root = Avatar;
|
|
345
|
-
var Image = AvatarImage;
|
|
346
|
-
var Fallback = AvatarFallback;
|
|
347
|
-
function Avatar2({ className, ...props }) {
|
|
348
|
-
return /* @__PURE__ */ jsx(
|
|
349
|
-
Root,
|
|
350
|
-
{
|
|
351
|
-
"data-slot": "avatar",
|
|
352
|
-
className: cn("relative flex size-8 shrink-0 overflow-hidden rounded-full", className),
|
|
353
|
-
...props
|
|
354
|
-
}
|
|
355
|
-
);
|
|
356
|
-
}
|
|
357
|
-
function AvatarImage2({ className, ...props }) {
|
|
358
|
-
return /* @__PURE__ */ jsx(
|
|
359
|
-
Image,
|
|
360
|
-
{
|
|
361
|
-
"data-slot": "avatar-image",
|
|
362
|
-
className: cn("aspect-square size-full", className),
|
|
363
|
-
...props
|
|
364
|
-
}
|
|
365
|
-
);
|
|
366
|
-
}
|
|
367
|
-
function AvatarFallback2({
|
|
368
|
-
className,
|
|
369
|
-
...props
|
|
370
|
-
}) {
|
|
371
|
-
return /* @__PURE__ */ jsx(
|
|
372
|
-
Fallback,
|
|
373
|
-
{
|
|
374
|
-
"data-slot": "avatar-fallback",
|
|
375
|
-
className: cn("bg-muted flex size-full items-center justify-center rounded-full", className),
|
|
376
|
-
...props
|
|
377
|
-
}
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
/*! Bundled license information:
|
|
381
|
-
|
|
382
|
-
use-sync-external-store/cjs/use-sync-external-store-shim.production.js:
|
|
383
|
-
(**
|
|
384
|
-
* @license React
|
|
385
|
-
* use-sync-external-store-shim.production.js
|
|
386
|
-
*
|
|
387
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
388
|
-
*
|
|
389
|
-
* This source code is licensed under the MIT license found in the
|
|
390
|
-
* LICENSE file in the root directory of this source tree.
|
|
391
|
-
*)
|
|
392
|
-
|
|
393
|
-
use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
|
|
394
|
-
(**
|
|
395
|
-
* @license React
|
|
396
|
-
* use-sync-external-store-shim.development.js
|
|
397
|
-
*
|
|
398
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
399
|
-
*
|
|
400
|
-
* This source code is licensed under the MIT license found in the
|
|
401
|
-
* LICENSE file in the root directory of this source tree.
|
|
402
|
-
*)
|
|
403
|
-
*/
|
|
404
|
-
|
|
405
|
-
export { Avatar2 as Avatar, AvatarFallback2 as AvatarFallback, AvatarImage2 as AvatarImage, Fallback, Image, Root };
|
|
406
|
-
//# sourceMappingURL=chunk-7MDBHJPT.js.map
|
|
407
|
-
//# sourceMappingURL=chunk-7MDBHJPT.js.map
|