@almadar/ui 5.95.0 → 5.96.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/avl/index.cjs +1665 -1416
- package/dist/avl/index.js +660 -411
- package/dist/components/core/atoms/AtlasImage.d.ts +58 -0
- package/dist/components/core/atoms/index.d.ts +1 -0
- package/dist/components/game/2d/molecules/Canvas2D.d.ts +4 -0
- package/dist/components/game/2d/templates/GameShell.d.ts +19 -23
- package/dist/components/game/3d/index.cjs +543 -212
- package/dist/components/game/3d/index.js +371 -36
- package/dist/components/game/3d/molecules/GameCanvas3D.d.ts +34 -3
- package/dist/components/game/3d/molecules/ModelLoader.d.ts +7 -1
- package/dist/components/game/3d/molecules/index.d.ts +0 -1
- package/dist/components/index.cjs +1645 -1392
- package/dist/components/index.js +637 -387
- package/dist/marketing/index.cjs +208 -73
- package/dist/marketing/index.js +166 -28
- package/dist/providers/index.cjs +1533 -1284
- package/dist/providers/index.js +636 -387
- package/dist/runtime/index.cjs +1526 -1277
- package/dist/runtime/index.js +640 -391
- package/package.json +1 -1
- package/dist/components/game/3d/molecules/Canvas3D.d.ts +0 -45
- /package/dist/{components/game/shared → lib}/atlasSlice.d.ts +0 -0
package/dist/marketing/index.cjs
CHANGED
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React12 = require('react');
|
|
4
4
|
var logger = require('@almadar/logger');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var LucideIcons2 = require('lucide-react');
|
|
7
7
|
|
|
8
|
-
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
-
|
|
10
8
|
function _interopNamespace(e) {
|
|
11
9
|
if (e && e.__esModule) return e;
|
|
12
10
|
var n = Object.create(null);
|
|
@@ -25,7 +23,7 @@ function _interopNamespace(e) {
|
|
|
25
23
|
return Object.freeze(n);
|
|
26
24
|
}
|
|
27
25
|
|
|
28
|
-
var
|
|
26
|
+
var React12__namespace = /*#__PURE__*/_interopNamespace(React12);
|
|
29
27
|
var LucideIcons2__namespace = /*#__PURE__*/_interopNamespace(LucideIcons2);
|
|
30
28
|
|
|
31
29
|
// node_modules/clsx/dist/clsx.mjs
|
|
@@ -2509,10 +2507,10 @@ function cn(...inputs) {
|
|
|
2509
2507
|
}
|
|
2510
2508
|
logger.createLogger("almadar:eventbus");
|
|
2511
2509
|
logger.createLogger("almadar:eventbus:subscribe");
|
|
2512
|
-
var EventBusContext =
|
|
2513
|
-
var TraitScopeContext =
|
|
2510
|
+
var EventBusContext = React12.createContext(null);
|
|
2511
|
+
var TraitScopeContext = React12.createContext(null);
|
|
2514
2512
|
function useTraitScope() {
|
|
2515
|
-
return
|
|
2513
|
+
return React12.useContext(TraitScopeContext);
|
|
2516
2514
|
}
|
|
2517
2515
|
var log = logger.createLogger("almadar:eventbus");
|
|
2518
2516
|
var subLog2 = logger.createLogger("almadar:eventbus:subscribe");
|
|
@@ -2588,10 +2586,10 @@ var fallbackEventBus = {
|
|
|
2588
2586
|
}
|
|
2589
2587
|
};
|
|
2590
2588
|
function useEventBus() {
|
|
2591
|
-
const context =
|
|
2589
|
+
const context = React12.useContext(EventBusContext);
|
|
2592
2590
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2593
2591
|
const scope = useTraitScope();
|
|
2594
|
-
return
|
|
2592
|
+
return React12.useMemo(() => {
|
|
2595
2593
|
if (!scope) {
|
|
2596
2594
|
return {
|
|
2597
2595
|
...baseBus,
|
|
@@ -2627,24 +2625,24 @@ function useEventBus() {
|
|
|
2627
2625
|
}
|
|
2628
2626
|
function useTapReveal(options = {}) {
|
|
2629
2627
|
const { onReveal, onDismiss, refs, enabled = true } = options;
|
|
2630
|
-
const [revealed, setRevealed] =
|
|
2631
|
-
const onRevealRef =
|
|
2632
|
-
const onDismissRef =
|
|
2628
|
+
const [revealed, setRevealed] = React12.useState(false);
|
|
2629
|
+
const onRevealRef = React12.useRef(onReveal);
|
|
2630
|
+
const onDismissRef = React12.useRef(onDismiss);
|
|
2633
2631
|
onRevealRef.current = onReveal;
|
|
2634
2632
|
onDismissRef.current = onDismiss;
|
|
2635
|
-
const reveal =
|
|
2633
|
+
const reveal = React12.useCallback(() => {
|
|
2636
2634
|
setRevealed((wasRevealed) => {
|
|
2637
2635
|
if (!wasRevealed) onRevealRef.current?.();
|
|
2638
2636
|
return true;
|
|
2639
2637
|
});
|
|
2640
2638
|
}, []);
|
|
2641
|
-
const dismiss =
|
|
2639
|
+
const dismiss = React12.useCallback(() => {
|
|
2642
2640
|
setRevealed((wasRevealed) => {
|
|
2643
2641
|
if (wasRevealed) onDismissRef.current?.();
|
|
2644
2642
|
return false;
|
|
2645
2643
|
});
|
|
2646
2644
|
}, []);
|
|
2647
|
-
const onPointerDown =
|
|
2645
|
+
const onPointerDown = React12.useCallback(
|
|
2648
2646
|
(e) => {
|
|
2649
2647
|
if (!enabled || e.pointerType === "mouse") return;
|
|
2650
2648
|
if (revealed) dismiss();
|
|
@@ -2652,7 +2650,7 @@ function useTapReveal(options = {}) {
|
|
|
2652
2650
|
},
|
|
2653
2651
|
[enabled, revealed, reveal, dismiss]
|
|
2654
2652
|
);
|
|
2655
|
-
|
|
2653
|
+
React12.useEffect(() => {
|
|
2656
2654
|
if (!revealed || typeof document === "undefined") return;
|
|
2657
2655
|
const onDocDown = (ev) => {
|
|
2658
2656
|
const target = ev.target;
|
|
@@ -2772,7 +2770,7 @@ var positionStyles = {
|
|
|
2772
2770
|
fixed: "fixed",
|
|
2773
2771
|
sticky: "sticky"
|
|
2774
2772
|
};
|
|
2775
|
-
var Box =
|
|
2773
|
+
var Box = React12__namespace.default.forwardRef(
|
|
2776
2774
|
({
|
|
2777
2775
|
padding,
|
|
2778
2776
|
paddingX,
|
|
@@ -2804,20 +2802,20 @@ var Box = React11__default.default.forwardRef(
|
|
|
2804
2802
|
...rest
|
|
2805
2803
|
}, ref) => {
|
|
2806
2804
|
const eventBus = useEventBus();
|
|
2807
|
-
const handleClick =
|
|
2805
|
+
const handleClick = React12.useCallback((e) => {
|
|
2808
2806
|
if (action) {
|
|
2809
2807
|
e.stopPropagation();
|
|
2810
2808
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
2811
2809
|
}
|
|
2812
2810
|
onClick?.(e);
|
|
2813
2811
|
}, [action, actionPayload, eventBus, onClick]);
|
|
2814
|
-
const handleMouseEnter =
|
|
2812
|
+
const handleMouseEnter = React12.useCallback((e) => {
|
|
2815
2813
|
if (hoverEvent) {
|
|
2816
2814
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2817
2815
|
}
|
|
2818
2816
|
onMouseEnter?.(e);
|
|
2819
2817
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
2820
|
-
const handleMouseLeave =
|
|
2818
|
+
const handleMouseLeave = React12.useCallback((e) => {
|
|
2821
2819
|
if (hoverEvent) {
|
|
2822
2820
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2823
2821
|
}
|
|
@@ -2825,19 +2823,19 @@ var Box = React11__default.default.forwardRef(
|
|
|
2825
2823
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
2826
2824
|
const { triggerProps } = useTapReveal({
|
|
2827
2825
|
enabled: tapReveal && !!hoverEvent,
|
|
2828
|
-
onReveal:
|
|
2826
|
+
onReveal: React12.useCallback(() => {
|
|
2829
2827
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2830
2828
|
}, [hoverEvent, eventBus]),
|
|
2831
|
-
onDismiss:
|
|
2829
|
+
onDismiss: React12.useCallback(() => {
|
|
2832
2830
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2833
2831
|
}, [hoverEvent, eventBus])
|
|
2834
2832
|
});
|
|
2835
|
-
const handlePointerDown =
|
|
2833
|
+
const handlePointerDown = React12.useCallback((e) => {
|
|
2836
2834
|
if (hoverEvent && tapReveal) triggerProps.onPointerDown(e);
|
|
2837
2835
|
onPointerDown?.(e);
|
|
2838
2836
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
2839
2837
|
const isClickable = action || onClick;
|
|
2840
|
-
return
|
|
2838
|
+
return React12__namespace.default.createElement(
|
|
2841
2839
|
Component,
|
|
2842
2840
|
{
|
|
2843
2841
|
ref,
|
|
@@ -2925,7 +2923,7 @@ var Stack = ({
|
|
|
2925
2923
|
};
|
|
2926
2924
|
const isHorizontal = direction === "horizontal";
|
|
2927
2925
|
const directionClass = responsive && isHorizontal ? reverse ? "flex-col-reverse md:flex-row-reverse" : "flex-col md:flex-row" : isHorizontal ? reverse ? "flex-row-reverse" : "flex-row" : reverse ? "flex-col-reverse" : "flex-col";
|
|
2928
|
-
return
|
|
2926
|
+
return React12__namespace.default.createElement(
|
|
2929
2927
|
Component,
|
|
2930
2928
|
{
|
|
2931
2929
|
className: cn(
|
|
@@ -3035,7 +3033,7 @@ var Typography = ({
|
|
|
3035
3033
|
}) => {
|
|
3036
3034
|
const variant = variantProp ?? (level ? `h${level}` : "body1");
|
|
3037
3035
|
const Component = as || defaultElements[variant];
|
|
3038
|
-
return
|
|
3036
|
+
return React12__namespace.default.createElement(
|
|
3039
3037
|
Component,
|
|
3040
3038
|
{
|
|
3041
3039
|
id,
|
|
@@ -3105,7 +3103,7 @@ function getIconFamilyServerSnapshot() {
|
|
|
3105
3103
|
return DEFAULT_FAMILY;
|
|
3106
3104
|
}
|
|
3107
3105
|
function useIconFamily() {
|
|
3108
|
-
return
|
|
3106
|
+
return React12.useSyncExternalStore(
|
|
3109
3107
|
subscribeIconFamily,
|
|
3110
3108
|
getIconFamilySnapshot,
|
|
3111
3109
|
getIconFamilyServerSnapshot
|
|
@@ -3127,7 +3125,7 @@ function loadLib(key, importer) {
|
|
|
3127
3125
|
return p;
|
|
3128
3126
|
}
|
|
3129
3127
|
function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
3130
|
-
const Lazy =
|
|
3128
|
+
const Lazy = React12__namespace.default.lazy(async () => {
|
|
3131
3129
|
const lib = await loadLib(libKey, importer);
|
|
3132
3130
|
const Comp = pick(lib);
|
|
3133
3131
|
if (!Comp) {
|
|
@@ -3137,7 +3135,7 @@ function lazyFamilyIcon(libKey, importer, pick, fallbackName, family) {
|
|
|
3137
3135
|
return { default: Comp };
|
|
3138
3136
|
});
|
|
3139
3137
|
const Wrapped = (props) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
3140
|
-
|
|
3138
|
+
React12__namespace.default.Suspense,
|
|
3141
3139
|
{
|
|
3142
3140
|
fallback: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3143
3141
|
"span",
|
|
@@ -3843,7 +3841,7 @@ var Icon = ({
|
|
|
3843
3841
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
3844
3842
|
const effectiveName = typeof icon === "string" ? icon : name;
|
|
3845
3843
|
const family = useIconFamily();
|
|
3846
|
-
const RenderedComponent =
|
|
3844
|
+
const RenderedComponent = React12__namespace.default.useMemo(() => {
|
|
3847
3845
|
if (directIcon) return null;
|
|
3848
3846
|
return effectiveName ? resolveIconForFamily(effectiveName, family) : null;
|
|
3849
3847
|
}, [directIcon, effectiveName, family]);
|
|
@@ -3891,6 +3889,143 @@ var Icon = ({
|
|
|
3891
3889
|
);
|
|
3892
3890
|
};
|
|
3893
3891
|
Icon.displayName = "Icon";
|
|
3892
|
+
|
|
3893
|
+
// lib/atlasSlice.ts
|
|
3894
|
+
var atlasCache = /* @__PURE__ */ new Map();
|
|
3895
|
+
function isTilesheet(a) {
|
|
3896
|
+
return typeof a.tileWidth === "number";
|
|
3897
|
+
}
|
|
3898
|
+
function getAtlas(url, onReady) {
|
|
3899
|
+
if (atlasCache.has(url)) return atlasCache.get(url) ?? void 0;
|
|
3900
|
+
atlasCache.set(url, void 0);
|
|
3901
|
+
fetch(url).then((r2) => r2.json()).then((json) => {
|
|
3902
|
+
atlasCache.set(url, json);
|
|
3903
|
+
onReady();
|
|
3904
|
+
}).catch(() => {
|
|
3905
|
+
atlasCache.set(url, null);
|
|
3906
|
+
});
|
|
3907
|
+
return void 0;
|
|
3908
|
+
}
|
|
3909
|
+
function subRectFor(atlas, sprite) {
|
|
3910
|
+
if (isTilesheet(atlas)) {
|
|
3911
|
+
let col;
|
|
3912
|
+
let row;
|
|
3913
|
+
if (sprite.includes(",")) {
|
|
3914
|
+
const [c, r2] = sprite.split(",").map((n) => Number(n.trim()));
|
|
3915
|
+
col = c;
|
|
3916
|
+
row = r2;
|
|
3917
|
+
} else {
|
|
3918
|
+
const i = Number(sprite);
|
|
3919
|
+
if (!Number.isFinite(i)) return null;
|
|
3920
|
+
col = i % atlas.columns;
|
|
3921
|
+
row = Math.floor(i / atlas.columns);
|
|
3922
|
+
}
|
|
3923
|
+
if (!Number.isFinite(col) || !Number.isFinite(row) || col < 0 || row < 0 || col >= atlas.columns || row >= atlas.rows) return null;
|
|
3924
|
+
const margin = atlas.margin ?? 0;
|
|
3925
|
+
const spacing = atlas.spacing ?? 0;
|
|
3926
|
+
return {
|
|
3927
|
+
sx: margin + col * (atlas.tileWidth + spacing),
|
|
3928
|
+
sy: margin + row * (atlas.tileHeight + spacing),
|
|
3929
|
+
sw: atlas.tileWidth,
|
|
3930
|
+
sh: atlas.tileHeight
|
|
3931
|
+
};
|
|
3932
|
+
}
|
|
3933
|
+
const st = atlas.subTextures[sprite];
|
|
3934
|
+
if (!st) return null;
|
|
3935
|
+
return { sx: st.x, sy: st.y, sw: st.width, sh: st.height };
|
|
3936
|
+
}
|
|
3937
|
+
function isAtlasAsset(asset) {
|
|
3938
|
+
return !!asset && typeof asset.atlas === "string" && typeof asset.sprite === "string";
|
|
3939
|
+
}
|
|
3940
|
+
var imageCache = /* @__PURE__ */ new Map();
|
|
3941
|
+
var imageWaiters = /* @__PURE__ */ new Map();
|
|
3942
|
+
function getSheetImage(url, onReady) {
|
|
3943
|
+
const cached = imageCache.get(url);
|
|
3944
|
+
if (cached) return cached;
|
|
3945
|
+
(imageWaiters.get(url) ?? imageWaiters.set(url, /* @__PURE__ */ new Set()).get(url)).add(onReady);
|
|
3946
|
+
if (!imageCache.has(url)) {
|
|
3947
|
+
imageCache.set(url, null);
|
|
3948
|
+
const img = new Image();
|
|
3949
|
+
img.crossOrigin = "anonymous";
|
|
3950
|
+
img.onload = () => {
|
|
3951
|
+
imageCache.set(url, img);
|
|
3952
|
+
imageWaiters.get(url)?.forEach((fn) => fn());
|
|
3953
|
+
imageWaiters.delete(url);
|
|
3954
|
+
};
|
|
3955
|
+
img.src = url;
|
|
3956
|
+
}
|
|
3957
|
+
return null;
|
|
3958
|
+
}
|
|
3959
|
+
function AtlasImage({
|
|
3960
|
+
asset,
|
|
3961
|
+
size,
|
|
3962
|
+
width,
|
|
3963
|
+
height,
|
|
3964
|
+
fill = false,
|
|
3965
|
+
fit = "contain",
|
|
3966
|
+
alt,
|
|
3967
|
+
className,
|
|
3968
|
+
style,
|
|
3969
|
+
"aria-hidden": ariaHidden
|
|
3970
|
+
}) {
|
|
3971
|
+
const [, bump] = React12__namespace.useReducer((x) => x + 1, 0);
|
|
3972
|
+
const canvasRef = React12__namespace.useRef(null);
|
|
3973
|
+
const sliced = isAtlasAsset(asset);
|
|
3974
|
+
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
3975
|
+
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
3976
|
+
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
3977
|
+
React12__namespace.useEffect(() => {
|
|
3978
|
+
const canvas = canvasRef.current;
|
|
3979
|
+
if (!canvas || !img || !rect) return;
|
|
3980
|
+
canvas.width = rect.sw;
|
|
3981
|
+
canvas.height = rect.sh;
|
|
3982
|
+
const ctx = canvas.getContext("2d");
|
|
3983
|
+
if (!ctx) return;
|
|
3984
|
+
ctx.imageSmoothingEnabled = false;
|
|
3985
|
+
ctx.clearRect(0, 0, rect.sw, rect.sh);
|
|
3986
|
+
ctx.drawImage(img, rect.sx, rect.sy, rect.sw, rect.sh, 0, 0, rect.sw, rect.sh);
|
|
3987
|
+
}, [img, rect?.sx, rect?.sy, rect?.sw, rect?.sh]);
|
|
3988
|
+
const w = fill ? "100%" : width ?? size;
|
|
3989
|
+
const h = fill ? "100%" : height ?? size;
|
|
3990
|
+
const boxStyle = {
|
|
3991
|
+
...fill ? { position: "absolute", inset: 0 } : {},
|
|
3992
|
+
width: w,
|
|
3993
|
+
height: h,
|
|
3994
|
+
objectFit: fit,
|
|
3995
|
+
imageRendering: "pixelated",
|
|
3996
|
+
...style
|
|
3997
|
+
};
|
|
3998
|
+
if (!asset?.url) return null;
|
|
3999
|
+
if (sliced) {
|
|
4000
|
+
if (!rect || !img) {
|
|
4001
|
+
return /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, className: cn("inline-block flex-shrink-0", className), style: { ...boxStyle, objectFit: void 0 } });
|
|
4002
|
+
}
|
|
4003
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4004
|
+
"canvas",
|
|
4005
|
+
{
|
|
4006
|
+
ref: canvasRef,
|
|
4007
|
+
role: ariaHidden ? void 0 : "img",
|
|
4008
|
+
"aria-hidden": ariaHidden,
|
|
4009
|
+
"aria-label": ariaHidden ? void 0 : alt ?? asset.name ?? asset.category ?? "",
|
|
4010
|
+
className: cn("flex-shrink-0", className),
|
|
4011
|
+
style: boxStyle
|
|
4012
|
+
}
|
|
4013
|
+
);
|
|
4014
|
+
}
|
|
4015
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4016
|
+
"img",
|
|
4017
|
+
{
|
|
4018
|
+
src: asset.url,
|
|
4019
|
+
alt: alt ?? asset.name ?? asset.category ?? "",
|
|
4020
|
+
"aria-hidden": ariaHidden,
|
|
4021
|
+
...typeof w === "number" ? { width: w } : {},
|
|
4022
|
+
...typeof h === "number" ? { height: h } : {},
|
|
4023
|
+
className: cn("flex-shrink-0", className),
|
|
4024
|
+
style: boxStyle
|
|
4025
|
+
}
|
|
4026
|
+
);
|
|
4027
|
+
}
|
|
4028
|
+
AtlasImage.displayName = "AtlasImage";
|
|
3894
4029
|
var variantStyles2 = {
|
|
3895
4030
|
primary: [
|
|
3896
4031
|
"bg-primary text-primary-foreground",
|
|
@@ -3963,7 +4098,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3963
4098
|
const IconComp = value;
|
|
3964
4099
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
3965
4100
|
}
|
|
3966
|
-
if (
|
|
4101
|
+
if (React12__namespace.default.isValidElement(value)) {
|
|
3967
4102
|
return value;
|
|
3968
4103
|
}
|
|
3969
4104
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -3972,7 +4107,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
3972
4107
|
}
|
|
3973
4108
|
return value;
|
|
3974
4109
|
}
|
|
3975
|
-
var Button =
|
|
4110
|
+
var Button = React12__namespace.default.forwardRef(
|
|
3976
4111
|
({
|
|
3977
4112
|
className,
|
|
3978
4113
|
variant = "primary",
|
|
@@ -3996,7 +4131,7 @@ var Button = React11__default.default.forwardRef(
|
|
|
3996
4131
|
const leftIconValue = leftIcon || iconProp;
|
|
3997
4132
|
const rightIconValue = rightIcon || iconRightProp;
|
|
3998
4133
|
const px = size === "sm" ? 16 : size === "lg" ? 20 : 16;
|
|
3999
|
-
const resolvedLeftIcon = iconAsset?.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4134
|
+
const resolvedLeftIcon = iconAsset?.url ? /* @__PURE__ */ jsxRuntime.jsx(AtlasImage, { asset: iconAsset, size: px, alt: iconAsset.name ?? iconAsset.category ?? "", className: "flex-shrink-0" }) : resolveIconProp(leftIconValue, iconSizeStyles[size]);
|
|
4000
4135
|
const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
|
|
4001
4136
|
const handleClick = (e) => {
|
|
4002
4137
|
if (action) {
|
|
@@ -4071,7 +4206,7 @@ var sizeStyles2 = {
|
|
|
4071
4206
|
md: "px-2.5 py-1 text-sm",
|
|
4072
4207
|
lg: "px-3 py-1.5 text-base"
|
|
4073
4208
|
};
|
|
4074
|
-
var Badge =
|
|
4209
|
+
var Badge = React12__namespace.default.forwardRef(
|
|
4075
4210
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
4076
4211
|
const iconSizes = {
|
|
4077
4212
|
sm: "h-icon-default w-icon-default",
|
|
@@ -4079,7 +4214,7 @@ var Badge = React11__default.default.forwardRef(
|
|
|
4079
4214
|
lg: "h-icon-default w-icon-default"
|
|
4080
4215
|
};
|
|
4081
4216
|
const iconPx = size === "lg" ? 20 : 16;
|
|
4082
|
-
const resolvedIcon = iconAsset?.url ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
4217
|
+
const resolvedIcon = iconAsset?.url ? /* @__PURE__ */ jsxRuntime.jsx(AtlasImage, { asset: iconAsset, size: iconPx, alt: iconAsset.name ?? iconAsset.category ?? "", className: "flex-shrink-0" }) : typeof icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, className: iconSizes[size] }) : icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon, className: iconSizes[size] }) : null;
|
|
4083
4218
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
4084
4219
|
"span",
|
|
4085
4220
|
{
|
|
@@ -4125,7 +4260,7 @@ var sizeStyles3 = {
|
|
|
4125
4260
|
md: "h-6 w-6",
|
|
4126
4261
|
lg: "h-8 w-8"
|
|
4127
4262
|
};
|
|
4128
|
-
var Spinner =
|
|
4263
|
+
var Spinner = React12__namespace.default.forwardRef(
|
|
4129
4264
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
4130
4265
|
if (overlay) {
|
|
4131
4266
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -4207,7 +4342,7 @@ var lookStyles = {
|
|
|
4207
4342
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
4208
4343
|
"tile-image-first": "p-0 overflow-hidden"
|
|
4209
4344
|
};
|
|
4210
|
-
var Card =
|
|
4345
|
+
var Card = React12__namespace.default.forwardRef(
|
|
4211
4346
|
({
|
|
4212
4347
|
className,
|
|
4213
4348
|
variant = "bordered",
|
|
@@ -4255,9 +4390,9 @@ var Card = React11__default.default.forwardRef(
|
|
|
4255
4390
|
}
|
|
4256
4391
|
);
|
|
4257
4392
|
Card.displayName = "Card";
|
|
4258
|
-
var CardHeader =
|
|
4393
|
+
var CardHeader = React12__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
4259
4394
|
CardHeader.displayName = "CardHeader";
|
|
4260
|
-
var CardTitle =
|
|
4395
|
+
var CardTitle = React12__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4261
4396
|
"h3",
|
|
4262
4397
|
{
|
|
4263
4398
|
ref,
|
|
@@ -4270,11 +4405,11 @@ var CardTitle = React11__default.default.forwardRef(({ className, ...props }, re
|
|
|
4270
4405
|
}
|
|
4271
4406
|
));
|
|
4272
4407
|
CardTitle.displayName = "CardTitle";
|
|
4273
|
-
var CardContent =
|
|
4408
|
+
var CardContent = React12__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
4274
4409
|
CardContent.displayName = "CardContent";
|
|
4275
4410
|
var CardBody = CardContent;
|
|
4276
4411
|
CardBody.displayName = "CardBody";
|
|
4277
|
-
var CardFooter =
|
|
4412
|
+
var CardFooter = React12__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4278
4413
|
"div",
|
|
4279
4414
|
{
|
|
4280
4415
|
ref,
|
|
@@ -4366,7 +4501,7 @@ var Center = ({
|
|
|
4366
4501
|
as: Component = "div"
|
|
4367
4502
|
}) => {
|
|
4368
4503
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
4369
|
-
return
|
|
4504
|
+
return React12__namespace.default.createElement(Component, {
|
|
4370
4505
|
className: cn(
|
|
4371
4506
|
inline ? "inline-flex" : "flex",
|
|
4372
4507
|
horizontal && "justify-center",
|
|
@@ -4427,7 +4562,7 @@ var paddingClasses = {
|
|
|
4427
4562
|
md: "py-16",
|
|
4428
4563
|
lg: "py-24"
|
|
4429
4564
|
};
|
|
4430
|
-
var ContentSection =
|
|
4565
|
+
var ContentSection = React12__namespace.default.forwardRef(
|
|
4431
4566
|
({ children, background = "default", padding = "lg", id, className }, ref) => {
|
|
4432
4567
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4433
4568
|
Box,
|
|
@@ -4451,8 +4586,8 @@ var InstallBox = ({
|
|
|
4451
4586
|
label,
|
|
4452
4587
|
className
|
|
4453
4588
|
}) => {
|
|
4454
|
-
const [copied, setCopied] =
|
|
4455
|
-
const handleCopy =
|
|
4589
|
+
const [copied, setCopied] = React12.useState(false);
|
|
4590
|
+
const handleCopy = React12.useCallback(() => {
|
|
4456
4591
|
void navigator.clipboard.writeText(command);
|
|
4457
4592
|
setCopied(true);
|
|
4458
4593
|
const timer = setTimeout(() => setCopied(false), 2e3);
|
|
@@ -5029,7 +5164,7 @@ var StepFlow = ({
|
|
|
5029
5164
|
className
|
|
5030
5165
|
}) => {
|
|
5031
5166
|
if (orientation === "vertical") {
|
|
5032
|
-
return /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5167
|
+
return /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "none", className: cn("w-full", className), children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsx(React12__namespace.default.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", align: "start", className: "w-full", children: [
|
|
5033
5168
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "none", align: "center", children: [
|
|
5034
5169
|
/* @__PURE__ */ jsxRuntime.jsx(StepCircle, { step, index }),
|
|
5035
5170
|
showConnectors && index < steps.length - 1 && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "w-px h-8 bg-border" })
|
|
@@ -5040,7 +5175,7 @@ var StepFlow = ({
|
|
|
5040
5175
|
] })
|
|
5041
5176
|
] }) }, index)) });
|
|
5042
5177
|
}
|
|
5043
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5178
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("w-full flex flex-col md:flex-row items-start gap-0", className), children: steps.map((step, index) => /* @__PURE__ */ jsxRuntime.jsxs(React12__namespace.default.Fragment, { children: [
|
|
5044
5179
|
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", align: "center", className: "flex-1 w-full md:w-auto", children: [
|
|
5045
5180
|
/* @__PURE__ */ jsxRuntime.jsx(StepCircle, { step, index }),
|
|
5046
5181
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h4", className: "text-center", children: step.title }),
|
|
@@ -5248,8 +5383,8 @@ var Avatar = ({
|
|
|
5248
5383
|
actionPayload
|
|
5249
5384
|
}) => {
|
|
5250
5385
|
const eventBus = useEventBus();
|
|
5251
|
-
const [imgFailed, setImgFailed] =
|
|
5252
|
-
|
|
5386
|
+
const [imgFailed, setImgFailed] = React12__namespace.default.useState(false);
|
|
5387
|
+
React12__namespace.default.useEffect(() => {
|
|
5253
5388
|
setImgFailed(false);
|
|
5254
5389
|
}, [src]);
|
|
5255
5390
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -5566,10 +5701,10 @@ var AnimatedCounter = ({
|
|
|
5566
5701
|
duration = 1500,
|
|
5567
5702
|
className
|
|
5568
5703
|
}) => {
|
|
5569
|
-
const ref =
|
|
5570
|
-
const [displayValue, setDisplayValue] =
|
|
5571
|
-
const [hasAnimated, setHasAnimated] =
|
|
5572
|
-
const animate =
|
|
5704
|
+
const ref = React12.useRef(null);
|
|
5705
|
+
const [displayValue, setDisplayValue] = React12.useState("0");
|
|
5706
|
+
const [hasAnimated, setHasAnimated] = React12.useState(false);
|
|
5707
|
+
const animate = React12.useCallback(() => {
|
|
5573
5708
|
const { num, prefix, suffix, decimals } = parseValue(value);
|
|
5574
5709
|
if (num === 0) {
|
|
5575
5710
|
setDisplayValue(String(value));
|
|
@@ -5590,7 +5725,7 @@ var AnimatedCounter = ({
|
|
|
5590
5725
|
};
|
|
5591
5726
|
requestAnimationFrame(tick);
|
|
5592
5727
|
}, [value, duration]);
|
|
5593
|
-
|
|
5728
|
+
React12.useEffect(() => {
|
|
5594
5729
|
if (hasAnimated) return;
|
|
5595
5730
|
const el = ref.current;
|
|
5596
5731
|
if (!el) return;
|
|
@@ -5640,7 +5775,7 @@ var animatedStyles = {
|
|
|
5640
5775
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
5641
5776
|
"none": {}
|
|
5642
5777
|
};
|
|
5643
|
-
var AnimatedReveal =
|
|
5778
|
+
var AnimatedReveal = React12__namespace.default.forwardRef(
|
|
5644
5779
|
({
|
|
5645
5780
|
trigger = "scroll",
|
|
5646
5781
|
animation = "fade-up",
|
|
@@ -5655,10 +5790,10 @@ var AnimatedReveal = React11__default.default.forwardRef(
|
|
|
5655
5790
|
style,
|
|
5656
5791
|
...props
|
|
5657
5792
|
}, forwardedRef) => {
|
|
5658
|
-
const [isAnimated, setIsAnimated] =
|
|
5659
|
-
const internalRef =
|
|
5660
|
-
const hasAnimated =
|
|
5661
|
-
const setRef =
|
|
5793
|
+
const [isAnimated, setIsAnimated] = React12.useState(false);
|
|
5794
|
+
const internalRef = React12.useRef(null);
|
|
5795
|
+
const hasAnimated = React12.useRef(false);
|
|
5796
|
+
const setRef = React12.useCallback(
|
|
5662
5797
|
(node) => {
|
|
5663
5798
|
internalRef.current = node;
|
|
5664
5799
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -5666,7 +5801,7 @@ var AnimatedReveal = React11__default.default.forwardRef(
|
|
|
5666
5801
|
},
|
|
5667
5802
|
[forwardedRef]
|
|
5668
5803
|
);
|
|
5669
|
-
|
|
5804
|
+
React12.useEffect(() => {
|
|
5670
5805
|
if (trigger !== "scroll") return;
|
|
5671
5806
|
const el = internalRef.current;
|
|
5672
5807
|
if (!el) return;
|
|
@@ -5692,7 +5827,7 @@ var AnimatedReveal = React11__default.default.forwardRef(
|
|
|
5692
5827
|
setIsAnimated(false);
|
|
5693
5828
|
}
|
|
5694
5829
|
} : void 0;
|
|
5695
|
-
|
|
5830
|
+
React12.useEffect(() => {
|
|
5696
5831
|
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
5697
5832
|
setIsAnimated(manualAnimate);
|
|
5698
5833
|
}
|
|
@@ -5722,9 +5857,9 @@ var AnimatedReveal = React11__default.default.forwardRef(
|
|
|
5722
5857
|
);
|
|
5723
5858
|
AnimatedReveal.displayName = "AnimatedReveal";
|
|
5724
5859
|
function useFetchedSvg(src) {
|
|
5725
|
-
const [svg, setSvg] =
|
|
5726
|
-
const cache =
|
|
5727
|
-
|
|
5860
|
+
const [svg, setSvg] = React12.useState(null);
|
|
5861
|
+
const cache = React12.useRef({});
|
|
5862
|
+
React12.useEffect(() => {
|
|
5728
5863
|
if (!src) {
|
|
5729
5864
|
setSvg(null);
|
|
5730
5865
|
return;
|
|
@@ -5793,7 +5928,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
5793
5928
|
el.style.opacity = animate ? "1" : "0";
|
|
5794
5929
|
});
|
|
5795
5930
|
}
|
|
5796
|
-
var AnimatedGraphic =
|
|
5931
|
+
var AnimatedGraphic = React12__namespace.default.forwardRef(
|
|
5797
5932
|
({
|
|
5798
5933
|
src,
|
|
5799
5934
|
svgContent,
|
|
@@ -5812,11 +5947,11 @@ var AnimatedGraphic = React11__default.default.forwardRef(
|
|
|
5812
5947
|
children,
|
|
5813
5948
|
...props
|
|
5814
5949
|
}, ref) => {
|
|
5815
|
-
const containerRef =
|
|
5950
|
+
const containerRef = React12.useRef(null);
|
|
5816
5951
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
5817
5952
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
5818
|
-
const prevAnimateRef =
|
|
5819
|
-
const setRef =
|
|
5953
|
+
const prevAnimateRef = React12.useRef(animate);
|
|
5954
|
+
const setRef = React12__namespace.default.useCallback(
|
|
5820
5955
|
(node) => {
|
|
5821
5956
|
containerRef.current = node;
|
|
5822
5957
|
if (typeof ref === "function") ref(node);
|
|
@@ -5824,7 +5959,7 @@ var AnimatedGraphic = React11__default.default.forwardRef(
|
|
|
5824
5959
|
},
|
|
5825
5960
|
[ref]
|
|
5826
5961
|
);
|
|
5827
|
-
|
|
5962
|
+
React12.useEffect(() => {
|
|
5828
5963
|
const el = containerRef.current;
|
|
5829
5964
|
if (!el || !strokeColor) return;
|
|
5830
5965
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
@@ -5832,7 +5967,7 @@ var AnimatedGraphic = React11__default.default.forwardRef(
|
|
|
5832
5967
|
p.style.stroke = strokeColor;
|
|
5833
5968
|
});
|
|
5834
5969
|
}, [resolvedSvg, strokeColor]);
|
|
5835
|
-
|
|
5970
|
+
React12.useEffect(() => {
|
|
5836
5971
|
const el = containerRef.current;
|
|
5837
5972
|
if (!el || !resolvedSvg) return;
|
|
5838
5973
|
if (animation === "draw" || animation === "fill") {
|
|
@@ -5857,7 +5992,7 @@ var AnimatedGraphic = React11__default.default.forwardRef(
|
|
|
5857
5992
|
});
|
|
5858
5993
|
}
|
|
5859
5994
|
}, [resolvedSvg, animation]);
|
|
5860
|
-
|
|
5995
|
+
React12.useEffect(() => {
|
|
5861
5996
|
const el = containerRef.current;
|
|
5862
5997
|
if (!el) return;
|
|
5863
5998
|
const id = requestAnimationFrame(() => {
|
|
@@ -6657,7 +6792,7 @@ var GeometricPattern = ({
|
|
|
6657
6792
|
children,
|
|
6658
6793
|
className
|
|
6659
6794
|
}) => {
|
|
6660
|
-
const reactId =
|
|
6795
|
+
const reactId = React12.useId();
|
|
6661
6796
|
const patternId = `gp${reactId.replace(/:/g, "")}`;
|
|
6662
6797
|
const size = 60 * scale;
|
|
6663
6798
|
const stripHeight = 40 * scale;
|
|
@@ -6892,7 +7027,7 @@ var EdgeDecoration = ({
|
|
|
6892
7027
|
width = 15,
|
|
6893
7028
|
className
|
|
6894
7029
|
}) => {
|
|
6895
|
-
const id =
|
|
7030
|
+
const id = React12.useId();
|
|
6896
7031
|
const Variant = VARIANT_MAP2[variant];
|
|
6897
7032
|
const resolvedColor = color in colorTokenVars2 ? colorTokenVars2[color] : color;
|
|
6898
7033
|
const sides = side === "both" ? ["left", "right"] : [side];
|