@almadar/ui 2.24.8 → 2.24.9
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/components/atoms/AnimatedGraphic.d.ts +29 -0
- package/dist/components/atoms/AnimatedReveal.d.ts +24 -0
- package/dist/components/atoms/index.d.ts +2 -0
- package/dist/components/index.cjs +1292 -1008
- package/dist/components/index.js +428 -146
- package/dist/docs/index.cjs +2 -1
- package/dist/docs/index.js +2 -1
- package/dist/marketing/index.cjs +295 -11
- package/dist/marketing/index.d.cts +54 -1
- package/dist/marketing/index.d.ts +4 -0
- package/dist/marketing/index.js +295 -13
- package/dist/providers/index.cjs +410 -125
- package/dist/providers/index.js +322 -37
- package/dist/runtime/index.cjs +1178 -893
- package/dist/runtime/index.js +418 -133
- package/package.json +1 -1
package/dist/providers/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import
|
|
1
|
+
import * as React112 from 'react';
|
|
2
|
+
import React112__default, { createContext, useCallback, useState, useRef, useEffect, useLayoutEffect, lazy, useContext, useMemo } from 'react';
|
|
3
3
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
4
4
|
import { EventBusContext } from '@almadar/ui/providers';
|
|
5
5
|
import 'react-dom';
|
|
@@ -674,7 +674,7 @@ var positionStyles = {
|
|
|
674
674
|
fixed: "fixed",
|
|
675
675
|
sticky: "sticky"
|
|
676
676
|
};
|
|
677
|
-
var Box =
|
|
677
|
+
var Box = React112__default.forwardRef(
|
|
678
678
|
({
|
|
679
679
|
padding,
|
|
680
680
|
paddingX,
|
|
@@ -891,7 +891,8 @@ var variantStyles2 = {
|
|
|
891
891
|
].join(" "),
|
|
892
892
|
ghost: [
|
|
893
893
|
"bg-transparent text-muted-foreground",
|
|
894
|
-
"
|
|
894
|
+
"border border-transparent",
|
|
895
|
+
"hover:text-primary-foreground hover:bg-primary hover:border-primary",
|
|
895
896
|
"active:scale-[var(--active-scale)]"
|
|
896
897
|
].join(" "),
|
|
897
898
|
danger: [
|
|
@@ -944,7 +945,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
944
945
|
const IconComp = value;
|
|
945
946
|
return /* @__PURE__ */ jsx(IconComp, { className: sizeClass });
|
|
946
947
|
}
|
|
947
|
-
if (
|
|
948
|
+
if (React112__default.isValidElement(value)) {
|
|
948
949
|
return value;
|
|
949
950
|
}
|
|
950
951
|
if (typeof value === "object" && value !== null && "render" in value) {
|
|
@@ -953,7 +954,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
953
954
|
}
|
|
954
955
|
return value;
|
|
955
956
|
}
|
|
956
|
-
var Button =
|
|
957
|
+
var Button = React112__default.forwardRef(
|
|
957
958
|
({
|
|
958
959
|
className,
|
|
959
960
|
variant = "primary",
|
|
@@ -1049,7 +1050,7 @@ var sizeStyles3 = {
|
|
|
1049
1050
|
md: "px-2.5 py-1 text-sm",
|
|
1050
1051
|
lg: "px-3 py-1.5 text-base"
|
|
1051
1052
|
};
|
|
1052
|
-
var Badge =
|
|
1053
|
+
var Badge = React112__default.forwardRef(
|
|
1053
1054
|
({ className, variant = "default", size = "sm", amount, label, icon, children, ...props }, ref) => {
|
|
1054
1055
|
const iconSizes2 = { sm: "w-3 h-3", md: "w-3.5 h-3.5", lg: "w-4 h-4" };
|
|
1055
1056
|
const resolvedIcon = typeof icon === "string" ? (() => {
|
|
@@ -1076,7 +1077,7 @@ var Badge = React110__default.forwardRef(
|
|
|
1076
1077
|
}
|
|
1077
1078
|
);
|
|
1078
1079
|
Badge.displayName = "Badge";
|
|
1079
|
-
var Input =
|
|
1080
|
+
var Input = React112__default.forwardRef(
|
|
1080
1081
|
({
|
|
1081
1082
|
className,
|
|
1082
1083
|
inputType,
|
|
@@ -1188,7 +1189,7 @@ var Input = React110__default.forwardRef(
|
|
|
1188
1189
|
}
|
|
1189
1190
|
);
|
|
1190
1191
|
Input.displayName = "Input";
|
|
1191
|
-
var Label =
|
|
1192
|
+
var Label = React112__default.forwardRef(
|
|
1192
1193
|
({ className, required, children, ...props }, ref) => {
|
|
1193
1194
|
return /* @__PURE__ */ jsxs(
|
|
1194
1195
|
"label",
|
|
@@ -1208,7 +1209,7 @@ var Label = React110__default.forwardRef(
|
|
|
1208
1209
|
}
|
|
1209
1210
|
);
|
|
1210
1211
|
Label.displayName = "Label";
|
|
1211
|
-
var Textarea =
|
|
1212
|
+
var Textarea = React112__default.forwardRef(
|
|
1212
1213
|
({ className, error, ...props }, ref) => {
|
|
1213
1214
|
return /* @__PURE__ */ jsx(
|
|
1214
1215
|
"textarea",
|
|
@@ -1231,7 +1232,7 @@ var Textarea = React110__default.forwardRef(
|
|
|
1231
1232
|
}
|
|
1232
1233
|
);
|
|
1233
1234
|
Textarea.displayName = "Textarea";
|
|
1234
|
-
var Select =
|
|
1235
|
+
var Select = React112__default.forwardRef(
|
|
1235
1236
|
({ className, options, placeholder, error, ...props }, ref) => {
|
|
1236
1237
|
return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
|
|
1237
1238
|
/* @__PURE__ */ jsxs(
|
|
@@ -1267,7 +1268,7 @@ var Select = React110__default.forwardRef(
|
|
|
1267
1268
|
}
|
|
1268
1269
|
);
|
|
1269
1270
|
Select.displayName = "Select";
|
|
1270
|
-
var Checkbox =
|
|
1271
|
+
var Checkbox = React112__default.forwardRef(
|
|
1271
1272
|
({ className, label, id, ...props }, ref) => {
|
|
1272
1273
|
const inputId = id || `checkbox-${Math.random().toString(36).substr(2, 9)}`;
|
|
1273
1274
|
return /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
|
|
@@ -1343,7 +1344,7 @@ var shadowStyles2 = {
|
|
|
1343
1344
|
md: "shadow",
|
|
1344
1345
|
lg: "shadow-lg"
|
|
1345
1346
|
};
|
|
1346
|
-
var Card =
|
|
1347
|
+
var Card = React112__default.forwardRef(
|
|
1347
1348
|
({
|
|
1348
1349
|
className,
|
|
1349
1350
|
variant = "bordered",
|
|
@@ -1379,9 +1380,9 @@ var Card = React110__default.forwardRef(
|
|
|
1379
1380
|
}
|
|
1380
1381
|
);
|
|
1381
1382
|
Card.displayName = "Card";
|
|
1382
|
-
var CardHeader =
|
|
1383
|
+
var CardHeader = React112__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
1383
1384
|
CardHeader.displayName = "CardHeader";
|
|
1384
|
-
var CardTitle =
|
|
1385
|
+
var CardTitle = React112__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1385
1386
|
"h3",
|
|
1386
1387
|
{
|
|
1387
1388
|
ref,
|
|
@@ -1394,11 +1395,11 @@ var CardTitle = React110__default.forwardRef(({ className, ...props }, ref) => /
|
|
|
1394
1395
|
}
|
|
1395
1396
|
));
|
|
1396
1397
|
CardTitle.displayName = "CardTitle";
|
|
1397
|
-
var CardContent =
|
|
1398
|
+
var CardContent = React112__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("", className), ...props }));
|
|
1398
1399
|
CardContent.displayName = "CardContent";
|
|
1399
1400
|
var CardBody = CardContent;
|
|
1400
1401
|
CardBody.displayName = "CardBody";
|
|
1401
|
-
var CardFooter =
|
|
1402
|
+
var CardFooter = React112__default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
|
|
1402
1403
|
"div",
|
|
1403
1404
|
{
|
|
1404
1405
|
ref,
|
|
@@ -1413,7 +1414,7 @@ var sizeStyles4 = {
|
|
|
1413
1414
|
md: "h-6 w-6",
|
|
1414
1415
|
lg: "h-8 w-8"
|
|
1415
1416
|
};
|
|
1416
|
-
var Spinner =
|
|
1417
|
+
var Spinner = React112__default.forwardRef(
|
|
1417
1418
|
({ className, size = "md", ...props }, ref) => {
|
|
1418
1419
|
return /* @__PURE__ */ jsx(
|
|
1419
1420
|
"div",
|
|
@@ -1427,7 +1428,7 @@ var Spinner = React110__default.forwardRef(
|
|
|
1427
1428
|
}
|
|
1428
1429
|
);
|
|
1429
1430
|
Spinner.displayName = "Spinner";
|
|
1430
|
-
var Radio =
|
|
1431
|
+
var Radio = React112__default.forwardRef(
|
|
1431
1432
|
({
|
|
1432
1433
|
label,
|
|
1433
1434
|
helperText,
|
|
@@ -1531,7 +1532,7 @@ var Radio = React110__default.forwardRef(
|
|
|
1531
1532
|
}
|
|
1532
1533
|
);
|
|
1533
1534
|
Radio.displayName = "Radio";
|
|
1534
|
-
var Switch =
|
|
1535
|
+
var Switch = React112.forwardRef(
|
|
1535
1536
|
({
|
|
1536
1537
|
checked,
|
|
1537
1538
|
defaultChecked = false,
|
|
@@ -1542,10 +1543,10 @@ var Switch = React110.forwardRef(
|
|
|
1542
1543
|
name,
|
|
1543
1544
|
className
|
|
1544
1545
|
}, ref) => {
|
|
1545
|
-
const [isChecked, setIsChecked] =
|
|
1546
|
+
const [isChecked, setIsChecked] = React112.useState(
|
|
1546
1547
|
checked !== void 0 ? checked : defaultChecked
|
|
1547
1548
|
);
|
|
1548
|
-
|
|
1549
|
+
React112.useEffect(() => {
|
|
1549
1550
|
if (checked !== void 0) {
|
|
1550
1551
|
setIsChecked(checked);
|
|
1551
1552
|
}
|
|
@@ -1703,7 +1704,7 @@ var sizeStyles5 = {
|
|
|
1703
1704
|
md: "w-2.5 h-2.5",
|
|
1704
1705
|
lg: "w-3 h-3"
|
|
1705
1706
|
};
|
|
1706
|
-
var StatusDot =
|
|
1707
|
+
var StatusDot = React112__default.forwardRef(
|
|
1707
1708
|
({ className, status = "offline", pulse = false, size = "md", label, ...props }, ref) => {
|
|
1708
1709
|
return /* @__PURE__ */ jsx(
|
|
1709
1710
|
"span",
|
|
@@ -1750,7 +1751,7 @@ var iconMap2 = {
|
|
|
1750
1751
|
down: TrendingDown,
|
|
1751
1752
|
flat: ArrowRight
|
|
1752
1753
|
};
|
|
1753
|
-
var TrendIndicator =
|
|
1754
|
+
var TrendIndicator = React112__default.forwardRef(
|
|
1754
1755
|
({
|
|
1755
1756
|
className,
|
|
1756
1757
|
value,
|
|
@@ -1809,7 +1810,7 @@ var thumbSizes = {
|
|
|
1809
1810
|
md: "w-4 h-4",
|
|
1810
1811
|
lg: "w-5 h-5"
|
|
1811
1812
|
};
|
|
1812
|
-
var RangeSlider =
|
|
1813
|
+
var RangeSlider = React112__default.forwardRef(
|
|
1813
1814
|
({
|
|
1814
1815
|
className,
|
|
1815
1816
|
min = 0,
|
|
@@ -2012,7 +2013,7 @@ var paddingClasses = {
|
|
|
2012
2013
|
md: "py-16",
|
|
2013
2014
|
lg: "py-24"
|
|
2014
2015
|
};
|
|
2015
|
-
var ContentSection =
|
|
2016
|
+
var ContentSection = React112__default.forwardRef(
|
|
2016
2017
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
2017
2018
|
return /* @__PURE__ */ jsx(
|
|
2018
2019
|
Box,
|
|
@@ -2031,6 +2032,289 @@ var ContentSection = React110__default.forwardRef(
|
|
|
2031
2032
|
}
|
|
2032
2033
|
);
|
|
2033
2034
|
ContentSection.displayName = "ContentSection";
|
|
2035
|
+
var initialStyles = {
|
|
2036
|
+
"fade-up": { opacity: 0, transform: "translateY(24px)" },
|
|
2037
|
+
"fade-down": { opacity: 0, transform: "translateY(-24px)" },
|
|
2038
|
+
"fade-in": { opacity: 0 },
|
|
2039
|
+
"fade-left": { opacity: 0, transform: "translateX(24px)" },
|
|
2040
|
+
"fade-right": { opacity: 0, transform: "translateX(-24px)" },
|
|
2041
|
+
"scale": { opacity: 0, transform: "scale(0.92)" },
|
|
2042
|
+
"scale-up": { opacity: 0, transform: "scale(0.92) translateY(16px)" },
|
|
2043
|
+
"none": {}
|
|
2044
|
+
};
|
|
2045
|
+
var animatedStyles = {
|
|
2046
|
+
"fade-up": { opacity: 1, transform: "translateY(0)" },
|
|
2047
|
+
"fade-down": { opacity: 1, transform: "translateY(0)" },
|
|
2048
|
+
"fade-in": { opacity: 1 },
|
|
2049
|
+
"fade-left": { opacity: 1, transform: "translateX(0)" },
|
|
2050
|
+
"fade-right": { opacity: 1, transform: "translateX(0)" },
|
|
2051
|
+
"scale": { opacity: 1, transform: "scale(1)" },
|
|
2052
|
+
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
2053
|
+
"none": {}
|
|
2054
|
+
};
|
|
2055
|
+
var AnimatedReveal = React112__default.forwardRef(
|
|
2056
|
+
({
|
|
2057
|
+
trigger = "scroll",
|
|
2058
|
+
animation = "fade-up",
|
|
2059
|
+
duration = 600,
|
|
2060
|
+
delay = 0,
|
|
2061
|
+
threshold = 0.15,
|
|
2062
|
+
once = true,
|
|
2063
|
+
animate: manualAnimate,
|
|
2064
|
+
easing = "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
2065
|
+
children,
|
|
2066
|
+
className,
|
|
2067
|
+
style,
|
|
2068
|
+
...props
|
|
2069
|
+
}, forwardedRef) => {
|
|
2070
|
+
const [isAnimated, setIsAnimated] = useState(false);
|
|
2071
|
+
const internalRef = useRef(null);
|
|
2072
|
+
const hasAnimated = useRef(false);
|
|
2073
|
+
const setRef = useCallback(
|
|
2074
|
+
(node) => {
|
|
2075
|
+
internalRef.current = node;
|
|
2076
|
+
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
2077
|
+
else if (forwardedRef) forwardedRef.current = node;
|
|
2078
|
+
},
|
|
2079
|
+
[forwardedRef]
|
|
2080
|
+
);
|
|
2081
|
+
useEffect(() => {
|
|
2082
|
+
if (trigger !== "scroll") return;
|
|
2083
|
+
const el = internalRef.current;
|
|
2084
|
+
if (!el) return;
|
|
2085
|
+
const observer = new IntersectionObserver(
|
|
2086
|
+
([entry]) => {
|
|
2087
|
+
if (entry.isIntersecting) {
|
|
2088
|
+
if (once && hasAnimated.current) return;
|
|
2089
|
+
hasAnimated.current = true;
|
|
2090
|
+
setIsAnimated(true);
|
|
2091
|
+
} else if (!once) {
|
|
2092
|
+
setIsAnimated(false);
|
|
2093
|
+
}
|
|
2094
|
+
},
|
|
2095
|
+
{ threshold }
|
|
2096
|
+
);
|
|
2097
|
+
observer.observe(el);
|
|
2098
|
+
return () => observer.disconnect();
|
|
2099
|
+
}, [trigger, threshold, once]);
|
|
2100
|
+
const handleMouseEnter = trigger === "hover" ? () => setIsAnimated(true) : void 0;
|
|
2101
|
+
const handleMouseLeave = trigger === "hover" ? () => {
|
|
2102
|
+
if (!once || !hasAnimated.current) {
|
|
2103
|
+
hasAnimated.current = true;
|
|
2104
|
+
setIsAnimated(false);
|
|
2105
|
+
}
|
|
2106
|
+
} : void 0;
|
|
2107
|
+
useEffect(() => {
|
|
2108
|
+
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
2109
|
+
setIsAnimated(manualAnimate);
|
|
2110
|
+
}
|
|
2111
|
+
}, [trigger, manualAnimate]);
|
|
2112
|
+
const active = isAnimated;
|
|
2113
|
+
const currentStyle = active ? animatedStyles[animation] : initialStyles[animation];
|
|
2114
|
+
return /* @__PURE__ */ jsx(
|
|
2115
|
+
"div",
|
|
2116
|
+
{
|
|
2117
|
+
ref: setRef,
|
|
2118
|
+
className: cn("will-change-[opacity,transform]", className),
|
|
2119
|
+
style: {
|
|
2120
|
+
...currentStyle,
|
|
2121
|
+
transitionProperty: "opacity, transform",
|
|
2122
|
+
transitionDuration: `${duration}ms`,
|
|
2123
|
+
transitionDelay: `${delay}ms`,
|
|
2124
|
+
transitionTimingFunction: easing,
|
|
2125
|
+
...style
|
|
2126
|
+
},
|
|
2127
|
+
onMouseEnter: handleMouseEnter,
|
|
2128
|
+
onMouseLeave: handleMouseLeave,
|
|
2129
|
+
...props,
|
|
2130
|
+
children: typeof children === "function" ? children(active) : children
|
|
2131
|
+
}
|
|
2132
|
+
);
|
|
2133
|
+
}
|
|
2134
|
+
);
|
|
2135
|
+
AnimatedReveal.displayName = "AnimatedReveal";
|
|
2136
|
+
function useFetchedSvg(src) {
|
|
2137
|
+
const [svg, setSvg] = useState(null);
|
|
2138
|
+
const cache = useRef({});
|
|
2139
|
+
useEffect(() => {
|
|
2140
|
+
if (!src) {
|
|
2141
|
+
setSvg(null);
|
|
2142
|
+
return;
|
|
2143
|
+
}
|
|
2144
|
+
if (cache.current[src]) {
|
|
2145
|
+
setSvg(cache.current[src]);
|
|
2146
|
+
return;
|
|
2147
|
+
}
|
|
2148
|
+
let cancelled = false;
|
|
2149
|
+
fetch(src).then((res) => {
|
|
2150
|
+
if (!res.ok) throw new Error(`Failed to fetch SVG: ${res.status}`);
|
|
2151
|
+
return res.text();
|
|
2152
|
+
}).then((text) => {
|
|
2153
|
+
if (cancelled) return;
|
|
2154
|
+
cache.current[src] = text;
|
|
2155
|
+
setSvg(text);
|
|
2156
|
+
}).catch(() => {
|
|
2157
|
+
if (!cancelled) setSvg(null);
|
|
2158
|
+
});
|
|
2159
|
+
return () => {
|
|
2160
|
+
cancelled = true;
|
|
2161
|
+
};
|
|
2162
|
+
}, [src]);
|
|
2163
|
+
return svg;
|
|
2164
|
+
}
|
|
2165
|
+
function applyDrawAnimation(container, animate, duration, delay, easing) {
|
|
2166
|
+
const paths = container.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
2167
|
+
paths.forEach((el) => {
|
|
2168
|
+
if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
|
|
2169
|
+
const len = el.getTotalLength();
|
|
2170
|
+
el.style.strokeDasharray = `${len}`;
|
|
2171
|
+
el.style.strokeDashoffset = animate ? "0" : `${len}`;
|
|
2172
|
+
el.style.transition = `stroke-dashoffset ${duration}ms ${easing} ${delay}ms`;
|
|
2173
|
+
}
|
|
2174
|
+
});
|
|
2175
|
+
}
|
|
2176
|
+
function applyFillAnimation(container, animate, duration, delay, easing, fillColor) {
|
|
2177
|
+
const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
2178
|
+
paths.forEach((el) => {
|
|
2179
|
+
if ("getTotalLength" in el && typeof el.getTotalLength === "function") {
|
|
2180
|
+
const geom = el;
|
|
2181
|
+
const len = geom.getTotalLength();
|
|
2182
|
+
geom.style.strokeDasharray = `${len}`;
|
|
2183
|
+
geom.style.strokeDashoffset = animate ? "0" : `${len}`;
|
|
2184
|
+
geom.style.transition = `stroke-dashoffset ${duration * 0.6}ms ${easing} ${delay}ms, fill-opacity ${duration * 0.4}ms ${easing} ${delay + duration * 0.6}ms`;
|
|
2185
|
+
}
|
|
2186
|
+
if (fillColor) el.style.fill = fillColor;
|
|
2187
|
+
el.style.fillOpacity = animate ? "1" : "0";
|
|
2188
|
+
});
|
|
2189
|
+
}
|
|
2190
|
+
function applyPulseAnimation(container, animate, duration) {
|
|
2191
|
+
const svg = container.querySelector("svg");
|
|
2192
|
+
if (!svg) return;
|
|
2193
|
+
if (animate) {
|
|
2194
|
+
svg.style.animation = `ag-pulse ${duration}ms ease-in-out infinite`;
|
|
2195
|
+
} else {
|
|
2196
|
+
svg.style.animation = "none";
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
2200
|
+
const paths = container.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
2201
|
+
paths.forEach((el) => {
|
|
2202
|
+
el.style.transition = `all ${duration}ms ${easing} ${delay}ms`;
|
|
2203
|
+
el.style.transform = animate ? "scale(1)" : "scale(0)";
|
|
2204
|
+
el.style.transformOrigin = "center";
|
|
2205
|
+
el.style.opacity = animate ? "1" : "0";
|
|
2206
|
+
});
|
|
2207
|
+
}
|
|
2208
|
+
var AnimatedGraphic = React112__default.forwardRef(
|
|
2209
|
+
({
|
|
2210
|
+
src,
|
|
2211
|
+
svgContent,
|
|
2212
|
+
animation = "draw",
|
|
2213
|
+
animate = false,
|
|
2214
|
+
duration = 1200,
|
|
2215
|
+
delay = 0,
|
|
2216
|
+
easing = "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
2217
|
+
width,
|
|
2218
|
+
height,
|
|
2219
|
+
strokeColor,
|
|
2220
|
+
fillColor,
|
|
2221
|
+
alt,
|
|
2222
|
+
className,
|
|
2223
|
+
style,
|
|
2224
|
+
children,
|
|
2225
|
+
...props
|
|
2226
|
+
}, ref) => {
|
|
2227
|
+
const containerRef = useRef(null);
|
|
2228
|
+
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
2229
|
+
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
2230
|
+
const prevAnimateRef = useRef(animate);
|
|
2231
|
+
const setRef = React112__default.useCallback(
|
|
2232
|
+
(node) => {
|
|
2233
|
+
containerRef.current = node;
|
|
2234
|
+
if (typeof ref === "function") ref(node);
|
|
2235
|
+
else if (ref) ref.current = node;
|
|
2236
|
+
},
|
|
2237
|
+
[ref]
|
|
2238
|
+
);
|
|
2239
|
+
useEffect(() => {
|
|
2240
|
+
const el = containerRef.current;
|
|
2241
|
+
if (!el || !strokeColor) return;
|
|
2242
|
+
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
2243
|
+
paths.forEach((p2) => {
|
|
2244
|
+
p2.style.stroke = strokeColor;
|
|
2245
|
+
});
|
|
2246
|
+
}, [resolvedSvg, strokeColor]);
|
|
2247
|
+
useEffect(() => {
|
|
2248
|
+
const el = containerRef.current;
|
|
2249
|
+
if (!el || !resolvedSvg) return;
|
|
2250
|
+
if (animation === "draw" || animation === "fill") {
|
|
2251
|
+
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
2252
|
+
paths.forEach((p2) => {
|
|
2253
|
+
if ("getTotalLength" in p2 && typeof p2.getTotalLength === "function") {
|
|
2254
|
+
const len = p2.getTotalLength();
|
|
2255
|
+
p2.style.strokeDasharray = `${len}`;
|
|
2256
|
+
p2.style.strokeDashoffset = `${len}`;
|
|
2257
|
+
}
|
|
2258
|
+
if (animation === "fill") {
|
|
2259
|
+
p2.style.fillOpacity = "0";
|
|
2260
|
+
}
|
|
2261
|
+
});
|
|
2262
|
+
}
|
|
2263
|
+
if (animation === "morph") {
|
|
2264
|
+
const paths = el.querySelectorAll("path, circle, ellipse, rect, polygon");
|
|
2265
|
+
paths.forEach((p2) => {
|
|
2266
|
+
p2.style.transform = "scale(0)";
|
|
2267
|
+
p2.style.transformOrigin = "center";
|
|
2268
|
+
p2.style.opacity = "0";
|
|
2269
|
+
});
|
|
2270
|
+
}
|
|
2271
|
+
}, [resolvedSvg, animation]);
|
|
2272
|
+
useEffect(() => {
|
|
2273
|
+
const el = containerRef.current;
|
|
2274
|
+
if (!el) return;
|
|
2275
|
+
const id = requestAnimationFrame(() => {
|
|
2276
|
+
switch (animation) {
|
|
2277
|
+
case "draw":
|
|
2278
|
+
applyDrawAnimation(el, animate, duration, delay, easing);
|
|
2279
|
+
break;
|
|
2280
|
+
case "fill":
|
|
2281
|
+
applyFillAnimation(el, animate, duration, delay, easing, fillColor);
|
|
2282
|
+
break;
|
|
2283
|
+
case "pulse":
|
|
2284
|
+
applyPulseAnimation(el, animate, duration);
|
|
2285
|
+
break;
|
|
2286
|
+
case "morph":
|
|
2287
|
+
applyMorphAnimation(el, animate, duration, delay, easing);
|
|
2288
|
+
break;
|
|
2289
|
+
}
|
|
2290
|
+
});
|
|
2291
|
+
prevAnimateRef.current = animate;
|
|
2292
|
+
return () => cancelAnimationFrame(id);
|
|
2293
|
+
}, [animate, animation, duration, delay, easing, fillColor, resolvedSvg]);
|
|
2294
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2295
|
+
/* @__PURE__ */ jsx("style", { children: `@keyframes ag-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.04); opacity: 0.85; } }` }),
|
|
2296
|
+
/* @__PURE__ */ jsx(
|
|
2297
|
+
"div",
|
|
2298
|
+
{
|
|
2299
|
+
ref: setRef,
|
|
2300
|
+
className: cn("inline-flex items-center justify-center", className),
|
|
2301
|
+
style: { width, height, ...style },
|
|
2302
|
+
role: alt ? "img" : void 0,
|
|
2303
|
+
"aria-label": alt,
|
|
2304
|
+
...props,
|
|
2305
|
+
children: resolvedSvg ? /* @__PURE__ */ jsx(
|
|
2306
|
+
"div",
|
|
2307
|
+
{
|
|
2308
|
+
className: "w-full h-full [&>svg]:w-full [&>svg]:h-full",
|
|
2309
|
+
dangerouslySetInnerHTML: { __html: resolvedSvg }
|
|
2310
|
+
}
|
|
2311
|
+
) : children
|
|
2312
|
+
}
|
|
2313
|
+
)
|
|
2314
|
+
] });
|
|
2315
|
+
}
|
|
2316
|
+
);
|
|
2317
|
+
AnimatedGraphic.displayName = "AnimatedGraphic";
|
|
2034
2318
|
|
|
2035
2319
|
// locales/en.json
|
|
2036
2320
|
var en_default = {
|
|
@@ -2186,7 +2470,7 @@ var ErrorState = ({
|
|
|
2186
2470
|
);
|
|
2187
2471
|
};
|
|
2188
2472
|
ErrorState.displayName = "ErrorState";
|
|
2189
|
-
var ErrorBoundary = class extends
|
|
2473
|
+
var ErrorBoundary = class extends React112__default.Component {
|
|
2190
2474
|
constructor(props) {
|
|
2191
2475
|
super(props);
|
|
2192
2476
|
__publicField(this, "reset", () => {
|
|
@@ -2779,7 +3063,7 @@ function bindTraitStateGetter(getter) {
|
|
|
2779
3063
|
}
|
|
2780
3064
|
}
|
|
2781
3065
|
exposeOnWindow();
|
|
2782
|
-
var MarkdownContent =
|
|
3066
|
+
var MarkdownContent = React112__default.memo(
|
|
2783
3067
|
({ content, direction, className }) => {
|
|
2784
3068
|
const { t: _t } = useTranslate();
|
|
2785
3069
|
const safeContent = typeof content === "string" ? content : String(content ?? "");
|
|
@@ -2881,7 +3165,7 @@ var MarkdownContent = React110__default.memo(
|
|
|
2881
3165
|
(prev, next) => prev.content === next.content && prev.className === next.className && prev.direction === next.direction
|
|
2882
3166
|
);
|
|
2883
3167
|
MarkdownContent.displayName = "MarkdownContent";
|
|
2884
|
-
var CodeBlock =
|
|
3168
|
+
var CodeBlock = React112__default.memo(
|
|
2885
3169
|
({
|
|
2886
3170
|
code: rawCode,
|
|
2887
3171
|
language = "text",
|
|
@@ -2998,12 +3282,12 @@ GameAudioContext.displayName = "GameAudioContext";
|
|
|
2998
3282
|
|
|
2999
3283
|
// components/organisms/component-registry.generated.ts
|
|
3000
3284
|
function lazyThree(name, loader) {
|
|
3001
|
-
const Lazy =
|
|
3285
|
+
const Lazy = React112__default.lazy(() => loader().then((m) => ({ default: m[name] })));
|
|
3002
3286
|
function ThreeWrapper(props) {
|
|
3003
|
-
return
|
|
3004
|
-
|
|
3287
|
+
return React112__default.createElement(
|
|
3288
|
+
React112__default.Suspense,
|
|
3005
3289
|
{ fallback: null },
|
|
3006
|
-
|
|
3290
|
+
React112__default.createElement(Lazy, props)
|
|
3007
3291
|
);
|
|
3008
3292
|
}
|
|
3009
3293
|
ThreeWrapper.displayName = `Lazy(${name})`;
|
|
@@ -3030,7 +3314,7 @@ function SuspenseConfigProvider({
|
|
|
3030
3314
|
config,
|
|
3031
3315
|
children
|
|
3032
3316
|
}) {
|
|
3033
|
-
return
|
|
3317
|
+
return React112__default.createElement(
|
|
3034
3318
|
SuspenseConfigContext.Provider,
|
|
3035
3319
|
{ value: config },
|
|
3036
3320
|
children
|
|
@@ -3103,7 +3387,7 @@ function VerificationProvider({
|
|
|
3103
3387
|
})) : [];
|
|
3104
3388
|
recordTransition({
|
|
3105
3389
|
traitName: parsed.traitName,
|
|
3106
|
-
from: pending?.from ??
|
|
3390
|
+
from: pending?.from ?? payload["currentState"] ?? newState,
|
|
3107
3391
|
to: newState,
|
|
3108
3392
|
event: parsed.event,
|
|
3109
3393
|
effects,
|
|
@@ -3114,10 +3398,11 @@ function VerificationProvider({
|
|
|
3114
3398
|
const pending = pendingRef.current.get(key);
|
|
3115
3399
|
pendingRef.current.delete(key);
|
|
3116
3400
|
const errorMsg = payload["error"] ?? "Unknown error";
|
|
3401
|
+
const fromState = pending?.from ?? payload["currentState"] ?? "unknown";
|
|
3117
3402
|
recordTransition({
|
|
3118
3403
|
traitName: parsed.traitName,
|
|
3119
|
-
from:
|
|
3120
|
-
to:
|
|
3404
|
+
from: fromState,
|
|
3405
|
+
to: fromState,
|
|
3121
3406
|
// state didn't change on error
|
|
3122
3407
|
event: parsed.event,
|
|
3123
3408
|
effects: [{
|