@almadar/ui 6.59.0 → 6.62.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/BehaviorValueFrame-3ORZHPWQ.css +1252 -0
- package/dist/BehaviorValueFrame-QYFJEMN5.js +18 -0
- package/dist/TraitValueFrame-2WMYJOA5.css +1252 -0
- package/dist/TraitValueFrame-X6IL3UST.js +17 -0
- package/dist/Typography-KBATMU2V.js +5 -0
- package/dist/{UISlotRenderer-YNY7V2UJ.js → UISlotRenderer-NZBV5BUI.js} +12 -10
- package/dist/avl/index.cjs +32263 -28103
- package/dist/avl/index.d.ts +36 -13
- package/dist/avl/index.js +298 -6130
- package/dist/{avl-3d-context-BpBKZIbc.d.ts → avl-3d-context-Dxun3-ri.d.ts} +2 -0
- package/dist/{chunk-YYYHH5BA.js → chunk-7JRWELUC.js} +4 -6
- package/dist/{chunk-723MJUU3.js → chunk-CXQENFO2.js} +1 -1
- package/dist/chunk-D4NAA2JW.js +49 -0
- package/dist/{chunk-I5QOYW2Z.js → chunk-DXPCAQJU.js} +205 -2
- package/dist/{chunk-J755QADM.js → chunk-EDPUQ2ZJ.js} +327 -18
- package/dist/{chunk-4ZGXIW3B.js → chunk-ERDYADVZ.js} +1 -1
- package/dist/{chunk-7CVXM2KS.js → chunk-EZ5FSNOE.js} +2 -2
- package/dist/{chunk-E6MWYQVZ.js → chunk-G6EFTACU.js} +9713 -786
- package/dist/{chunk-MZIDOJMD.js → chunk-GVQOTA7T.js} +2 -1
- package/dist/{chunk-Q47ZN2DW.js → chunk-N23SVGTH.js} +83 -1
- package/dist/{chunk-KJGVLXEN.js → chunk-N4IJS5DD.js} +50 -116
- package/dist/{chunk-LZRW6GXG.js → chunk-QOV3TUAA.js} +2 -3
- package/dist/chunk-WBWXBA5H.js +434 -0
- package/dist/{chunk-V3FGTQUE.js → chunk-ZR45FGW3.js} +7 -1
- package/dist/{cn-DIql5232.d.ts → cn-CDIhHCUC.d.ts} +40 -16
- package/dist/components/index.cjs +14779 -4354
- package/dist/components/index.d.ts +200 -180
- package/dist/components/index.js +16 -17
- package/dist/context/index.cjs +9 -1
- package/dist/context/index.js +3 -1
- package/dist/hooks/index.cjs +78 -9
- package/dist/hooks/index.d.ts +43 -2
- package/dist/hooks/index.js +6 -7
- package/dist/lib/drawable/three/index.cjs +361 -27
- package/dist/lib/drawable/three/index.d.ts +2 -2
- package/dist/lib/drawable/three/index.js +28 -7
- package/dist/lib/index.cjs +117 -5
- package/dist/lib/index.d.ts +2 -2
- package/dist/lib/index.js +99 -6
- package/dist/locales/index.cjs +6 -9
- package/dist/locales/index.js +2 -2
- package/dist/providers/index.cjs +14137 -1311
- package/dist/providers/index.d.ts +36 -4
- package/dist/providers/index.js +37 -17
- package/dist/runtime/index.cjs +28769 -18640
- package/dist/runtime/index.d.ts +70 -3
- package/dist/runtime/index.js +15 -381
- package/dist/ssr/index.cjs +508 -134
- package/dist/ssr/index.d.cts +56 -4
- package/dist/ssr/index.d.ts +56 -4
- package/dist/ssr/index.js +446 -72
- package/dist/{verificationRegistry-B3dj1Zl8.d.ts → verificationRegistry-B5aGl7WF.d.ts} +2 -1
- package/locales/ar.json +2 -3
- package/locales/en.json +2 -3
- package/locales/sl.json +2 -3
- package/package.json +8 -8
- package/tailwind-preset.cjs +78 -8
- package/themes/_base.css +27 -0
- package/themes/_contract.md +6 -0
- package/themes/_fonts.css +4 -4
- package/themes/_foundation.css +11 -0
- package/themes/_presets.css +2 -0
- package/themes/almadar-website.css +10 -0
- package/themes/almadar.css +10 -0
- package/themes/atelier.css +10 -0
- package/themes/bauhaus.css +10 -0
- package/themes/bloomberg-dense.css +10 -0
- package/themes/clay.css +10 -0
- package/themes/corporate.css +10 -0
- package/themes/gazette.css +10 -0
- package/themes/glass.css +10 -0
- package/themes/kflow.css +5 -0
- package/themes/kiosk.css +10 -0
- package/themes/linear-clean.css +10 -0
- package/themes/material.css +10 -0
- package/themes/minimalist.css +10 -0
- package/themes/nata.css +304 -0
- package/themes/neon.css +10 -0
- package/themes/notion-editorial.css +10 -0
- package/themes/orb.css +10 -0
- package/themes/prism.css +10 -0
- package/themes/rawi.css +304 -0
- package/themes/retro.css +10 -0
- package/themes/risograph.css +10 -0
- package/themes/scandi.css +10 -0
- package/themes/solarpunk.css +10 -0
- package/themes/terminal.css +138 -128
- package/dist/Typography-LZTP72Y4.js +0 -5
- package/dist/chunk-D2E44ODB.js +0 -350
- package/dist/chunk-N7JIG57B.js +0 -138
- package/dist/chunk-QJIAJ6EH.js +0 -2256
package/dist/ssr/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React18 = require('react');
|
|
4
4
|
var logger = require('@almadar/logger');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var core = require('@almadar/core');
|
|
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
|
|
|
25
25
|
return Object.freeze(n);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var React18__namespace = /*#__PURE__*/_interopNamespace(React18);
|
|
29
29
|
var LucideIcons2__namespace = /*#__PURE__*/_interopNamespace(LucideIcons2);
|
|
30
30
|
|
|
31
31
|
// node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
|
|
@@ -2576,13 +2576,51 @@ var twMerge = extendTailwindMerge({
|
|
|
2576
2576
|
function cn(...inputs) {
|
|
2577
2577
|
return twMerge(clsx(inputs));
|
|
2578
2578
|
}
|
|
2579
|
+
|
|
2580
|
+
// lib/bandShapes.ts
|
|
2581
|
+
var shape = (d) => `url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100' preserveAspectRatio='none'><path d='${d}'/></svg>")`;
|
|
2582
|
+
var BAND_SHAPES = {
|
|
2583
|
+
wave: shape("M0 60 C240 100 480 100 720 60 C960 20 1200 20 1440 60 V100 H0 Z"),
|
|
2584
|
+
arc: shape("M0 100 Q720 0 1440 100 Z"),
|
|
2585
|
+
tilt: shape("M0 100 L1440 0 V100 Z"),
|
|
2586
|
+
step: shape("M0 100 V75 H360 V50 H720 V25 H1080 V0 H1440 V100 Z"),
|
|
2587
|
+
scallop: shape("M0 100 V40 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 a60 40 0 0 1 120 0 V100 Z")
|
|
2588
|
+
};
|
|
2589
|
+
var BAND_EDGE_HEIGHT = "clamp(24px, 6vw, 96px)";
|
|
2590
|
+
var BAND_ACCENT_FALLBACK = "linear-gradient(180deg, color-mix(in oklab, var(--color-primary) 12%, var(--color-background)), var(--color-background))";
|
|
2591
|
+
var BAND_EDGE_FILL = {
|
|
2592
|
+
background: "var(--surface-page-image, none), var(--color-background)",
|
|
2593
|
+
muted: "var(--color-muted)",
|
|
2594
|
+
surface: "var(--color-card)",
|
|
2595
|
+
gradient: `var(--surface-accent-image, ${BAND_ACCENT_FALLBACK}), var(--color-muted)`,
|
|
2596
|
+
inverse: "var(--color-foreground)"
|
|
2597
|
+
};
|
|
2598
|
+
function bandEdgeMask(edge) {
|
|
2599
|
+
return edge === "curve" ? "var(--surface-edge-mask, none)" : BAND_SHAPES[edge];
|
|
2600
|
+
}
|
|
2601
|
+
function bandEdgeHeight(edge) {
|
|
2602
|
+
return edge === "curve" ? `var(--surface-edge-height, ${BAND_EDGE_HEIGHT})` : BAND_EDGE_HEIGHT;
|
|
2603
|
+
}
|
|
2604
|
+
function bandEdgeLayerStyle(edge, side, flip, color) {
|
|
2605
|
+
const mask = bandEdgeMask(edge);
|
|
2606
|
+
const turn = side === "top" ? flip ? "scaleY(-1)" : "rotate(180deg)" : flip ? "scaleX(-1)" : void 0;
|
|
2607
|
+
const style = { height: bandEdgeHeight(edge), background: BAND_EDGE_FILL[color], maskImage: mask, WebkitMaskImage: mask, transform: turn };
|
|
2608
|
+
if (color === "background") {
|
|
2609
|
+
style.backgroundSize = "var(--surface-page-image-size, auto), auto";
|
|
2610
|
+
style.backgroundAttachment = "fixed";
|
|
2611
|
+
}
|
|
2612
|
+
return style;
|
|
2613
|
+
}
|
|
2614
|
+
function bandPadding(basePad, edge) {
|
|
2615
|
+
return edge === "none" ? void 0 : `calc(${basePad} + ${bandEdgeHeight(edge)})`;
|
|
2616
|
+
}
|
|
2579
2617
|
logger.createLogger("almadar:eventbus");
|
|
2580
2618
|
logger.createLogger("almadar:eventbus:subscribe");
|
|
2581
|
-
var EventBusContext = globalThis.__almadarUiEventBusContext ?? (globalThis.__almadarUiEventBusContext =
|
|
2619
|
+
var EventBusContext = globalThis.__almadarUiEventBusContext ?? (globalThis.__almadarUiEventBusContext = React18.createContext(null));
|
|
2582
2620
|
var EMPTY_CHAIN = Object.freeze([]);
|
|
2583
|
-
var TraitScopeContext =
|
|
2621
|
+
var TraitScopeContext = React18.createContext(null);
|
|
2584
2622
|
function useTraitScopeChain() {
|
|
2585
|
-
const chain =
|
|
2623
|
+
const chain = React18.useContext(TraitScopeContext);
|
|
2586
2624
|
return chain ?? EMPTY_CHAIN;
|
|
2587
2625
|
}
|
|
2588
2626
|
var log = logger.createLogger("almadar:eventbus");
|
|
@@ -2659,10 +2697,10 @@ var fallbackEventBus = {
|
|
|
2659
2697
|
}
|
|
2660
2698
|
};
|
|
2661
2699
|
function useEventBus() {
|
|
2662
|
-
const context =
|
|
2700
|
+
const context = React18.useContext(EventBusContext);
|
|
2663
2701
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2664
2702
|
const chain = useTraitScopeChain();
|
|
2665
|
-
return
|
|
2703
|
+
return React18.useMemo(() => {
|
|
2666
2704
|
if (chain.length === 0) {
|
|
2667
2705
|
return {
|
|
2668
2706
|
...baseBus,
|
|
@@ -2708,24 +2746,24 @@ function useEventBus() {
|
|
|
2708
2746
|
}
|
|
2709
2747
|
function useTapReveal(options = {}) {
|
|
2710
2748
|
const { onReveal, onDismiss, refs, enabled = true } = options;
|
|
2711
|
-
const [revealed, setRevealed] =
|
|
2712
|
-
const onRevealRef =
|
|
2713
|
-
const onDismissRef =
|
|
2749
|
+
const [revealed, setRevealed] = React18.useState(false);
|
|
2750
|
+
const onRevealRef = React18.useRef(onReveal);
|
|
2751
|
+
const onDismissRef = React18.useRef(onDismiss);
|
|
2714
2752
|
onRevealRef.current = onReveal;
|
|
2715
2753
|
onDismissRef.current = onDismiss;
|
|
2716
|
-
const reveal =
|
|
2754
|
+
const reveal = React18.useCallback(() => {
|
|
2717
2755
|
setRevealed((wasRevealed) => {
|
|
2718
2756
|
if (!wasRevealed) onRevealRef.current?.();
|
|
2719
2757
|
return true;
|
|
2720
2758
|
});
|
|
2721
2759
|
}, []);
|
|
2722
|
-
const dismiss =
|
|
2760
|
+
const dismiss = React18.useCallback(() => {
|
|
2723
2761
|
setRevealed((wasRevealed) => {
|
|
2724
2762
|
if (wasRevealed) onDismissRef.current?.();
|
|
2725
2763
|
return false;
|
|
2726
2764
|
});
|
|
2727
2765
|
}, []);
|
|
2728
|
-
const onPointerDown =
|
|
2766
|
+
const onPointerDown = React18.useCallback(
|
|
2729
2767
|
(e) => {
|
|
2730
2768
|
if (!enabled || e.pointerType === "mouse") return;
|
|
2731
2769
|
if (revealed) dismiss();
|
|
@@ -2733,7 +2771,7 @@ function useTapReveal(options = {}) {
|
|
|
2733
2771
|
},
|
|
2734
2772
|
[enabled, revealed, reveal, dismiss]
|
|
2735
2773
|
);
|
|
2736
|
-
|
|
2774
|
+
React18.useEffect(() => {
|
|
2737
2775
|
if (!revealed || typeof document === "undefined") return;
|
|
2738
2776
|
const onDocDown = (ev) => {
|
|
2739
2777
|
const target = ev.target;
|
|
@@ -2750,10 +2788,10 @@ function useTapReveal(options = {}) {
|
|
|
2750
2788
|
return { revealed, triggerProps: { onPointerDown }, reveal, dismiss };
|
|
2751
2789
|
}
|
|
2752
2790
|
logger.createLogger("almadar:ui:theme");
|
|
2753
|
-
|
|
2754
|
-
var ThemeScopeContext =
|
|
2791
|
+
React18.createContext(void 0);
|
|
2792
|
+
var ThemeScopeContext = React18.createContext({});
|
|
2755
2793
|
function useThemeScope() {
|
|
2756
|
-
return
|
|
2794
|
+
return React18.useContext(ThemeScopeContext);
|
|
2757
2795
|
}
|
|
2758
2796
|
|
|
2759
2797
|
// lib/pressable.ts
|
|
@@ -2780,7 +2818,237 @@ function pressableProps(onPress, options = {}) {
|
|
|
2780
2818
|
};
|
|
2781
2819
|
}
|
|
2782
2820
|
|
|
2783
|
-
//
|
|
2821
|
+
// lib/domPassthrough.ts
|
|
2822
|
+
var GLOBAL_ATTRIBUTES = /* @__PURE__ */ new Set(["role", "id", "lang", "dir", "tabIndex"]);
|
|
2823
|
+
function domPassthrough(props) {
|
|
2824
|
+
const out = {};
|
|
2825
|
+
for (const [key, value] of Object.entries(props)) {
|
|
2826
|
+
if (key.startsWith("aria-") || key.startsWith("data-") || GLOBAL_ATTRIBUTES.has(key)) {
|
|
2827
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === void 0) {
|
|
2828
|
+
out[key] = value;
|
|
2829
|
+
}
|
|
2830
|
+
}
|
|
2831
|
+
}
|
|
2832
|
+
return out;
|
|
2833
|
+
}
|
|
2834
|
+
var motionEnabledCache = null;
|
|
2835
|
+
function isMotionEnabled() {
|
|
2836
|
+
if (typeof document === "undefined") return true;
|
|
2837
|
+
if (motionEnabledCache !== null) return motionEnabledCache;
|
|
2838
|
+
const v = getComputedStyle(document.documentElement).getPropertyValue("--motion-enable").trim().toLowerCase();
|
|
2839
|
+
motionEnabledCache = v !== "off";
|
|
2840
|
+
return motionEnabledCache;
|
|
2841
|
+
}
|
|
2842
|
+
|
|
2843
|
+
// lib/motion-tokens.ts
|
|
2844
|
+
function cssTimeMs(value) {
|
|
2845
|
+
const v = value.trim();
|
|
2846
|
+
if (v.endsWith("ms")) return Number.parseFloat(v);
|
|
2847
|
+
if (v.endsWith("s")) return Number.parseFloat(v) * 1e3;
|
|
2848
|
+
return Number.NaN;
|
|
2849
|
+
}
|
|
2850
|
+
function tokenAt(el, name) {
|
|
2851
|
+
for (let at = el; at !== null; at = at.parentElement) {
|
|
2852
|
+
const value = getComputedStyle(at).getPropertyValue(name).trim();
|
|
2853
|
+
if (value !== "") return value;
|
|
2854
|
+
}
|
|
2855
|
+
return "";
|
|
2856
|
+
}
|
|
2857
|
+
function motionTiming(durationToken, easingToken, scope) {
|
|
2858
|
+
const duration = cssTimeMs(tokenAt(scope ?? document.documentElement, durationToken));
|
|
2859
|
+
const easing = tokenAt(scope ?? document.documentElement, easingToken);
|
|
2860
|
+
const reduced = typeof window.matchMedia === "function" && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
|
|
2861
|
+
if (!isMotionEnabled() || reduced || !Number.isFinite(duration) || easing === "") return void 0;
|
|
2862
|
+
return { duration, easing };
|
|
2863
|
+
}
|
|
2864
|
+
function layoutScale(el) {
|
|
2865
|
+
const layoutWidth = el instanceof HTMLElement ? el.offsetWidth : 0;
|
|
2866
|
+
const screenWidth = el.getBoundingClientRect().width;
|
|
2867
|
+
return layoutWidth > 0 && screenWidth > 0 ? screenWidth / layoutWidth : 1;
|
|
2868
|
+
}
|
|
2869
|
+
|
|
2870
|
+
// lib/animate-changes.ts
|
|
2871
|
+
function ownMotion(el) {
|
|
2872
|
+
return el.closest("[data-item-move]") !== null || /\balmadar-enter-/.test(el.getAttribute("class") ?? "");
|
|
2873
|
+
}
|
|
2874
|
+
function boxesOf(el) {
|
|
2875
|
+
return getComputedStyle(el).display === "contents" ? boxedChildren(el) : [el];
|
|
2876
|
+
}
|
|
2877
|
+
function boxedChildren(el) {
|
|
2878
|
+
return [...el.children].flatMap(boxesOf);
|
|
2879
|
+
}
|
|
2880
|
+
var GHOST_STYLE = ["font", "letterSpacing", "lineHeight", "color", "textAlign", "whiteSpace", "textTransform"];
|
|
2881
|
+
function roll(el, oldText, timing) {
|
|
2882
|
+
const box = el.getBoundingClientRect();
|
|
2883
|
+
const scale2 = layoutScale(el);
|
|
2884
|
+
const computed = getComputedStyle(el);
|
|
2885
|
+
const holder = document.createElement("span");
|
|
2886
|
+
holder.setAttribute("aria-hidden", "true");
|
|
2887
|
+
Object.assign(holder.style, {
|
|
2888
|
+
position: "fixed",
|
|
2889
|
+
left: `${box.left}px`,
|
|
2890
|
+
top: `${box.top}px`,
|
|
2891
|
+
width: `${box.width / scale2}px`,
|
|
2892
|
+
height: `${box.height / scale2}px`,
|
|
2893
|
+
transform: scale2 === 1 ? "" : `scale(${scale2})`,
|
|
2894
|
+
transformOrigin: "top left",
|
|
2895
|
+
pointerEvents: "none",
|
|
2896
|
+
zIndex: "2147483647"
|
|
2897
|
+
});
|
|
2898
|
+
const ghost = document.createElement("span");
|
|
2899
|
+
ghost.setAttribute("data-change-ghost", "");
|
|
2900
|
+
ghost.setAttribute("aria-hidden", "true");
|
|
2901
|
+
ghost.textContent = oldText;
|
|
2902
|
+
for (const prop of GHOST_STYLE) ghost.style[prop] = computed[prop];
|
|
2903
|
+
Object.assign(ghost.style, { display: "block", width: "100%", height: "100%", overflow: "visible" });
|
|
2904
|
+
holder.appendChild(ghost);
|
|
2905
|
+
document.body.appendChild(holder);
|
|
2906
|
+
const out = ghost.animate(
|
|
2907
|
+
[{ opacity: 1, transform: "none" }, { opacity: 0, transform: "translateY(-40%)", offset: 0.5 }, { opacity: 0, transform: "translateY(-40%)" }],
|
|
2908
|
+
timing
|
|
2909
|
+
);
|
|
2910
|
+
if (out === void 0) holder.remove();
|
|
2911
|
+
else {
|
|
2912
|
+
out.addEventListener("finish", () => holder.remove());
|
|
2913
|
+
out.addEventListener("cancel", () => holder.remove());
|
|
2914
|
+
}
|
|
2915
|
+
el.animate(
|
|
2916
|
+
[{ opacity: 0, transform: "translateY(40%)" }, { opacity: 0, transform: "translateY(40%)", offset: 0.4 }, { opacity: 1, transform: "none" }],
|
|
2917
|
+
timing
|
|
2918
|
+
);
|
|
2919
|
+
}
|
|
2920
|
+
var textOnly = (el) => el instanceof HTMLElement && el.childNodes.length > 0 && [...el.childNodes].every((n) => n.nodeType === Node.TEXT_NODE);
|
|
2921
|
+
function settle(root, added, changed) {
|
|
2922
|
+
const timing = motionTiming("--duration-normal", "--easing-emphasized", root);
|
|
2923
|
+
if (timing === void 0) return;
|
|
2924
|
+
for (const el of added) {
|
|
2925
|
+
if (ownMotion(el) || el.parentElement !== null && [...added].some((other) => other !== el && other.contains(el))) continue;
|
|
2926
|
+
for (const box of boxesOf(el)) {
|
|
2927
|
+
if (ownMotion(box)) continue;
|
|
2928
|
+
box.animate([{ opacity: 0, transform: "translateY(6px)" }, { opacity: 1, transform: "none" }], timing);
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
for (const [el, oldText] of changed) {
|
|
2932
|
+
if (ownMotion(el) || [...added].some((a) => a.contains(el))) continue;
|
|
2933
|
+
if (oldText !== void 0 && oldText !== el.textContent && textOnly(el)) roll(el, oldText, timing);
|
|
2934
|
+
else el.animate([{ opacity: 0.25 }, { opacity: 1 }], timing);
|
|
2935
|
+
}
|
|
2936
|
+
}
|
|
2937
|
+
function blocks(root) {
|
|
2938
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2939
|
+
for (const wrapper of root.querySelectorAll("[data-pattern]")) {
|
|
2940
|
+
for (const box of boxesOf(wrapper)) if (!ownMotion(box)) seen.add(box);
|
|
2941
|
+
}
|
|
2942
|
+
return [...seen];
|
|
2943
|
+
}
|
|
2944
|
+
function glidePushed(root, places) {
|
|
2945
|
+
const timing = motionTiming("--duration-normal", "--easing-emphasized", root);
|
|
2946
|
+
const origin = root.getBoundingClientRect();
|
|
2947
|
+
const applied = /* @__PURE__ */ new Map();
|
|
2948
|
+
const present = /* @__PURE__ */ new Set();
|
|
2949
|
+
for (const el of blocks(root)) {
|
|
2950
|
+
present.add(el);
|
|
2951
|
+
if ((el.getAnimations?.() ?? []).length > 0) {
|
|
2952
|
+
places.delete(el);
|
|
2953
|
+
continue;
|
|
2954
|
+
}
|
|
2955
|
+
const box = el.getBoundingClientRect();
|
|
2956
|
+
const now = { x: box.left - origin.left, y: box.top - origin.top };
|
|
2957
|
+
const was = places.get(el);
|
|
2958
|
+
places.set(el, now);
|
|
2959
|
+
if (was === void 0 || timing === void 0) continue;
|
|
2960
|
+
let inherited = { x: 0, y: 0 };
|
|
2961
|
+
for (let up = el.parentElement; up !== null && up !== root; up = up.parentElement) {
|
|
2962
|
+
const a = applied.get(up);
|
|
2963
|
+
if (a !== void 0) {
|
|
2964
|
+
inherited = a;
|
|
2965
|
+
break;
|
|
2966
|
+
}
|
|
2967
|
+
}
|
|
2968
|
+
const dx = was.x - now.x - inherited.x;
|
|
2969
|
+
const dy = was.y - now.y - inherited.y;
|
|
2970
|
+
if (Math.abs(dx) < 0.5 && Math.abs(dy) < 0.5) {
|
|
2971
|
+
if (inherited.x !== 0 || inherited.y !== 0) applied.set(el, inherited);
|
|
2972
|
+
continue;
|
|
2973
|
+
}
|
|
2974
|
+
const scale2 = layoutScale(el);
|
|
2975
|
+
el.animate([{ transform: `translate(${dx / scale2}px, ${dy / scale2}px)` }, { transform: "none" }], { ...timing, composite: "add" });
|
|
2976
|
+
applied.set(el, { x: inherited.x + dx, y: inherited.y + dy });
|
|
2977
|
+
}
|
|
2978
|
+
for (const el of places.keys()) if (!present.has(el)) places.delete(el);
|
|
2979
|
+
}
|
|
2980
|
+
function easeHeight(root) {
|
|
2981
|
+
if (typeof ResizeObserver === "undefined") return () => void 0;
|
|
2982
|
+
let rest;
|
|
2983
|
+
let glide;
|
|
2984
|
+
const sizes = new ResizeObserver(() => {
|
|
2985
|
+
const scale2 = layoutScale(root);
|
|
2986
|
+
const shown = root.getBoundingClientRect().height / scale2;
|
|
2987
|
+
const gliding = glide !== void 0 && glide.playState === "running";
|
|
2988
|
+
glide?.cancel();
|
|
2989
|
+
glide = void 0;
|
|
2990
|
+
const height = root.getBoundingClientRect().height / scale2;
|
|
2991
|
+
const from = gliding ? shown : rest;
|
|
2992
|
+
rest = height;
|
|
2993
|
+
const timing = motionTiming("--duration-normal", "--easing-emphasized", root);
|
|
2994
|
+
if (from === void 0 || timing === void 0 || Math.abs(from - height) < 1) return;
|
|
2995
|
+
glide = root.animate(
|
|
2996
|
+
[{ height: `${from}px`, overflow: "clip" }, { height: `${height}px`, overflow: "clip" }],
|
|
2997
|
+
timing
|
|
2998
|
+
) ?? void 0;
|
|
2999
|
+
});
|
|
3000
|
+
let watched = [];
|
|
3001
|
+
const watch = () => {
|
|
3002
|
+
const next = boxedChildren(root);
|
|
3003
|
+
if (next.length === watched.length && next.every((el, i) => el === watched[i])) return;
|
|
3004
|
+
watched = next;
|
|
3005
|
+
sizes.disconnect();
|
|
3006
|
+
for (const el of next) sizes.observe(el);
|
|
3007
|
+
};
|
|
3008
|
+
watch();
|
|
3009
|
+
const children = new MutationObserver(watch);
|
|
3010
|
+
children.observe(root, { childList: true, subtree: true });
|
|
3011
|
+
return () => {
|
|
3012
|
+
children.disconnect();
|
|
3013
|
+
sizes.disconnect();
|
|
3014
|
+
};
|
|
3015
|
+
}
|
|
3016
|
+
function useAnimateChanges(ref, enabled) {
|
|
3017
|
+
React18.useEffect(() => {
|
|
3018
|
+
const root = ref.current;
|
|
3019
|
+
if (!enabled || root === null) return;
|
|
3020
|
+
return easeHeight(root);
|
|
3021
|
+
}, [ref, enabled]);
|
|
3022
|
+
React18.useEffect(() => {
|
|
3023
|
+
const root = ref.current;
|
|
3024
|
+
if (!enabled || root === null || typeof MutationObserver === "undefined") return;
|
|
3025
|
+
const observer2 = new MutationObserver((records) => {
|
|
3026
|
+
const added = /* @__PURE__ */ new Set();
|
|
3027
|
+
const changed = /* @__PURE__ */ new Map();
|
|
3028
|
+
for (const record of records) {
|
|
3029
|
+
if (record.type === "childList") {
|
|
3030
|
+
for (const node of record.addedNodes) {
|
|
3031
|
+
if (node instanceof Element) added.add(node);
|
|
3032
|
+
else if (node.nodeType === Node.TEXT_NODE && node.parentElement !== null && changed.get(node.parentElement) === void 0) {
|
|
3033
|
+
const removed = [...record.removedNodes].filter((n) => n.nodeType === Node.TEXT_NODE);
|
|
3034
|
+
changed.set(node.parentElement, removed.length > 0 ? removed.map((n) => n.textContent ?? "").join("") : void 0);
|
|
3035
|
+
}
|
|
3036
|
+
}
|
|
3037
|
+
} else if (record.type === "characterData") {
|
|
3038
|
+
const el = record.target.parentElement;
|
|
3039
|
+
if (el === null || changed.get(el) !== void 0) continue;
|
|
3040
|
+
changed.set(el, [...el.childNodes].map((n) => n === record.target ? record.oldValue ?? "" : n.textContent ?? "").join(""));
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
glidePushed(root, places);
|
|
3044
|
+
settle(root, added, changed);
|
|
3045
|
+
});
|
|
3046
|
+
const places = /* @__PURE__ */ new Map();
|
|
3047
|
+
glidePushed(root, places);
|
|
3048
|
+
observer2.observe(root, { subtree: true, childList: true, characterData: true, characterDataOldValue: true });
|
|
3049
|
+
return () => observer2.disconnect();
|
|
3050
|
+
}, [ref, enabled]);
|
|
3051
|
+
}
|
|
2784
3052
|
var paddingStyles = {
|
|
2785
3053
|
none: "p-0",
|
|
2786
3054
|
xs: "p-1",
|
|
@@ -2845,7 +3113,18 @@ var bgStyles = {
|
|
|
2845
3113
|
muted: "bg-muted text-foreground",
|
|
2846
3114
|
accent: "bg-accent text-accent-foreground",
|
|
2847
3115
|
surface: "bg-card",
|
|
2848
|
-
overlay: "bg-card/80 backdrop-blur-sm"
|
|
3116
|
+
overlay: "bg-card/80 backdrop-blur-sm",
|
|
3117
|
+
gradient: "band-gradient",
|
|
3118
|
+
inverse: "band-inverse"
|
|
3119
|
+
};
|
|
3120
|
+
var paddingRem = {
|
|
3121
|
+
none: "0rem",
|
|
3122
|
+
xs: "0.25rem",
|
|
3123
|
+
sm: "0.5rem",
|
|
3124
|
+
md: "1rem",
|
|
3125
|
+
lg: "1.5rem",
|
|
3126
|
+
xl: "2rem",
|
|
3127
|
+
"2xl": "3rem"
|
|
2849
3128
|
};
|
|
2850
3129
|
var roundedStyles = {
|
|
2851
3130
|
none: "rounded-none",
|
|
@@ -2883,7 +3162,7 @@ var positionStyles = {
|
|
|
2883
3162
|
fixed: "fixed",
|
|
2884
3163
|
sticky: "sticky"
|
|
2885
3164
|
};
|
|
2886
|
-
var Box =
|
|
3165
|
+
var Box = React18__namespace.default.forwardRef(
|
|
2887
3166
|
({
|
|
2888
3167
|
padding,
|
|
2889
3168
|
paddingX,
|
|
@@ -2908,6 +3187,13 @@ var Box = React17__namespace.default.forwardRef(
|
|
|
2908
3187
|
hoverEvent,
|
|
2909
3188
|
tapReveal = true,
|
|
2910
3189
|
maxWidth,
|
|
3190
|
+
edgeTop = "none",
|
|
3191
|
+
edgeBottom = "none",
|
|
3192
|
+
edgeColor = "background",
|
|
3193
|
+
edgeFlip = false,
|
|
3194
|
+
texture = false,
|
|
3195
|
+
animateChanges = false,
|
|
3196
|
+
backdrop,
|
|
2911
3197
|
onClick,
|
|
2912
3198
|
onMouseEnter,
|
|
2913
3199
|
onMouseLeave,
|
|
@@ -2915,23 +3201,30 @@ var Box = React17__namespace.default.forwardRef(
|
|
|
2915
3201
|
...rest
|
|
2916
3202
|
}, ref) => {
|
|
2917
3203
|
const eventBus = useEventBus();
|
|
3204
|
+
const ownRef = React18.useRef(null);
|
|
3205
|
+
useAnimateChanges(ownRef, animateChanges);
|
|
3206
|
+
const setRef = React18.useCallback((node) => {
|
|
3207
|
+
ownRef.current = node;
|
|
3208
|
+
if (typeof ref === "function") ref(node);
|
|
3209
|
+
else if (ref !== null) ref.current = node;
|
|
3210
|
+
}, [ref]);
|
|
2918
3211
|
const { override: themeOverride } = useThemeScope();
|
|
2919
3212
|
const declaredTheme = rest["data-theme"];
|
|
2920
3213
|
const dataTheme = declaredTheme !== void 0 && themeOverride ? themeOverride : declaredTheme;
|
|
2921
|
-
const handleClick =
|
|
3214
|
+
const handleClick = React18.useCallback((e) => {
|
|
2922
3215
|
if (action) {
|
|
2923
3216
|
e.stopPropagation();
|
|
2924
3217
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
2925
3218
|
}
|
|
2926
3219
|
onClick?.(e);
|
|
2927
3220
|
}, [action, actionPayload, eventBus, onClick]);
|
|
2928
|
-
const handleMouseEnter =
|
|
3221
|
+
const handleMouseEnter = React18.useCallback((e) => {
|
|
2929
3222
|
if (hoverEvent) {
|
|
2930
3223
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2931
3224
|
}
|
|
2932
3225
|
onMouseEnter?.(e);
|
|
2933
3226
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
2934
|
-
const handleMouseLeave =
|
|
3227
|
+
const handleMouseLeave = React18.useCallback((e) => {
|
|
2935
3228
|
if (hoverEvent) {
|
|
2936
3229
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2937
3230
|
}
|
|
@@ -2939,23 +3232,36 @@ var Box = React17__namespace.default.forwardRef(
|
|
|
2939
3232
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
2940
3233
|
const { triggerProps } = useTapReveal({
|
|
2941
3234
|
enabled: tapReveal && !!hoverEvent,
|
|
2942
|
-
onReveal:
|
|
3235
|
+
onReveal: React18.useCallback(() => {
|
|
2943
3236
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2944
3237
|
}, [hoverEvent, eventBus]),
|
|
2945
|
-
onDismiss:
|
|
3238
|
+
onDismiss: React18.useCallback(() => {
|
|
2946
3239
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2947
3240
|
}, [hoverEvent, eventBus])
|
|
2948
3241
|
});
|
|
2949
|
-
const handlePointerDown =
|
|
3242
|
+
const handlePointerDown = React18.useCallback((e) => {
|
|
2950
3243
|
if (hoverEvent && tapReveal) triggerProps.onPointerDown(e);
|
|
2951
3244
|
onPointerDown?.(e);
|
|
2952
3245
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
3246
|
+
const isBand = backdrop != null || texture || edgeTop !== "none" || edgeBottom !== "none";
|
|
3247
|
+
const padKey = paddingY ?? padding;
|
|
3248
|
+
const bandStyle = {};
|
|
3249
|
+
const padTop = padKey ? bandPadding(paddingRem[padKey], edgeTop) : void 0;
|
|
3250
|
+
const padBottom = padKey ? bandPadding(paddingRem[padKey], edgeBottom) : void 0;
|
|
3251
|
+
if (padTop) bandStyle.paddingTop = padTop;
|
|
3252
|
+
if (padBottom) bandStyle.paddingBottom = padBottom;
|
|
3253
|
+
const bandLayers = isBand ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3254
|
+
backdrop != null && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", "data-band-layer": "", "aria-hidden": true, className: "band-backdrop", children: backdrop }),
|
|
3255
|
+
texture && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", "data-band-layer": "", "aria-hidden": true, className: "band-texture" }),
|
|
3256
|
+
edgeTop !== "none" && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", "data-band-layer": "", "aria-hidden": true, className: "band-edge band-edge-top", style: bandEdgeLayerStyle(edgeTop, "top", edgeFlip, edgeColor) }),
|
|
3257
|
+
edgeBottom !== "none" && /* @__PURE__ */ jsxRuntime.jsx(Box, { as: "span", "data-band-layer": "", "aria-hidden": true, className: "band-edge band-edge-bottom", style: bandEdgeLayerStyle(edgeBottom, "bottom", edgeFlip, edgeColor) })
|
|
3258
|
+
] }) : null;
|
|
2953
3259
|
const isClickable = action || onClick;
|
|
2954
3260
|
const actionControl = action && rest.role === void 0 && rest.tabIndex === void 0 ? pressableProps(handleClick) : {};
|
|
2955
|
-
return
|
|
3261
|
+
return React18__namespace.default.createElement(
|
|
2956
3262
|
Component,
|
|
2957
3263
|
{
|
|
2958
|
-
ref,
|
|
3264
|
+
ref: setRef,
|
|
2959
3265
|
className: cn(
|
|
2960
3266
|
padding && paddingStyles[padding],
|
|
2961
3267
|
paddingX && paddingXStyles[paddingX],
|
|
@@ -2973,6 +3279,7 @@ var Box = React17__namespace.default.forwardRef(
|
|
|
2973
3279
|
overflow && overflowStyles[overflow],
|
|
2974
3280
|
position && positionStyles[position],
|
|
2975
3281
|
isClickable && "cursor-pointer",
|
|
3282
|
+
isBand && "band",
|
|
2976
3283
|
className
|
|
2977
3284
|
),
|
|
2978
3285
|
onClick: isClickable ? handleClick : void 0,
|
|
@@ -2980,29 +3287,19 @@ var Box = React17__namespace.default.forwardRef(
|
|
|
2980
3287
|
onMouseEnter: hoverEvent || onMouseEnter ? handleMouseEnter : void 0,
|
|
2981
3288
|
onMouseLeave: hoverEvent || onMouseLeave ? handleMouseLeave : void 0,
|
|
2982
3289
|
onPointerDown: hoverEvent && tapReveal || onPointerDown ? handlePointerDown : void 0,
|
|
2983
|
-
style: maxWidth ? { maxWidth, ...rest.style } : rest.style,
|
|
3290
|
+
style: maxWidth || isBand ? { ...maxWidth ? { maxWidth } : {}, ...bandStyle, ...rest.style } : rest.style,
|
|
2984
3291
|
...rest,
|
|
2985
|
-
"data-theme": dataTheme
|
|
3292
|
+
"data-theme": dataTheme,
|
|
3293
|
+
"data-motion": animateChanges ? "presentation" : void 0
|
|
2986
3294
|
},
|
|
2987
|
-
children
|
|
3295
|
+
isBand ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
3296
|
+
bandLayers,
|
|
3297
|
+
children
|
|
3298
|
+
] }) : children
|
|
2988
3299
|
);
|
|
2989
3300
|
}
|
|
2990
3301
|
);
|
|
2991
3302
|
Box.displayName = "Box";
|
|
2992
|
-
|
|
2993
|
-
// lib/domPassthrough.ts
|
|
2994
|
-
var GLOBAL_ATTRIBUTES = /* @__PURE__ */ new Set(["role", "id", "lang", "dir", "tabIndex"]);
|
|
2995
|
-
function domPassthrough(props) {
|
|
2996
|
-
const out = {};
|
|
2997
|
-
for (const [key, value] of Object.entries(props)) {
|
|
2998
|
-
if (key.startsWith("aria-") || key.startsWith("data-") || GLOBAL_ATTRIBUTES.has(key)) {
|
|
2999
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === void 0) {
|
|
3000
|
-
out[key] = value;
|
|
3001
|
-
}
|
|
3002
|
-
}
|
|
3003
|
-
}
|
|
3004
|
-
return out;
|
|
3005
|
-
}
|
|
3006
3303
|
var gapStyles = {
|
|
3007
3304
|
none: "gap-0",
|
|
3008
3305
|
xs: "gap-1",
|
|
@@ -3057,7 +3354,7 @@ var Stack = ({
|
|
|
3057
3354
|
};
|
|
3058
3355
|
const isHorizontal = direction === "horizontal";
|
|
3059
3356
|
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";
|
|
3060
|
-
return
|
|
3357
|
+
return React18__namespace.default.createElement(
|
|
3061
3358
|
Component,
|
|
3062
3359
|
{
|
|
3063
3360
|
...domPassthrough(rest),
|
|
@@ -3219,7 +3516,6 @@ var en_default = {
|
|
|
3219
3516
|
"aria.upvote": "Upvote",
|
|
3220
3517
|
"aria.downvote": "Downvote",
|
|
3221
3518
|
"aria.qrScanner": "QR scanner",
|
|
3222
|
-
"aria.mockScanDev": "Mock scan (dev)",
|
|
3223
3519
|
"aria.openMenu": "Open menu",
|
|
3224
3520
|
"aria.closeMenu": "Close menu",
|
|
3225
3521
|
"aria.openSidebar": "Open sidebar",
|
|
@@ -3417,7 +3713,6 @@ var en_default = {
|
|
|
3417
3713
|
"qrScanner.pauseScanning": "Pause scanning",
|
|
3418
3714
|
"qrScanner.switchToFrontCamera": "Switch to front camera",
|
|
3419
3715
|
"qrScanner.switchToRearCamera": "Switch to rear camera",
|
|
3420
|
-
"qrScanner.mockScan": "Mock Scan",
|
|
3421
3716
|
"docSearch.placeholder": "Search documentation...",
|
|
3422
3717
|
"stateMachine.loading": "Loading state machine\u2026",
|
|
3423
3718
|
"stateMachine.noStateMachine": "No state machine to visualize",
|
|
@@ -4339,7 +4634,8 @@ var en_default = {
|
|
|
4339
4634
|
"avl.stateInitial": "start",
|
|
4340
4635
|
"avl.stateTerminal": "end",
|
|
4341
4636
|
"avl.guardCaption": "The transition only fires when this check is true.",
|
|
4342
|
-
"avl.effectsCaption": "What runs, in order, when the transition fires."
|
|
4637
|
+
"avl.effectsCaption": "What runs, in order, when the transition fires.",
|
|
4638
|
+
"aria.carousel": "carousel"
|
|
4343
4639
|
};
|
|
4344
4640
|
|
|
4345
4641
|
// lib/format.ts
|
|
@@ -4405,7 +4701,7 @@ var INLINE_TEXT_ATTR = "data-inline-text";
|
|
|
4405
4701
|
// hooks/useTranslate.ts
|
|
4406
4702
|
var { $meta: _meta2, ...coreMessages2 } = en_default;
|
|
4407
4703
|
var coreLocale2 = coreMessages2;
|
|
4408
|
-
var I18nContext =
|
|
4704
|
+
var I18nContext = React18.createContext({
|
|
4409
4705
|
locale: "en",
|
|
4410
4706
|
direction: "ltr",
|
|
4411
4707
|
t: (key, params) => {
|
|
@@ -4420,11 +4716,11 @@ var I18nContext = React17.createContext({
|
|
|
4420
4716
|
});
|
|
4421
4717
|
I18nContext.displayName = "I18nContext";
|
|
4422
4718
|
function useTranslate() {
|
|
4423
|
-
return
|
|
4719
|
+
return React18.useContext(I18nContext);
|
|
4424
4720
|
}
|
|
4425
4721
|
function useFormatContext() {
|
|
4426
|
-
const { t, locale, currency } =
|
|
4427
|
-
return
|
|
4722
|
+
const { t, locale, currency } = React18.useContext(I18nContext);
|
|
4723
|
+
return React18.useMemo(
|
|
4428
4724
|
() => ({ locale, currency: currency ?? DEFAULT_CURRENCY, booleanLabels: { yes: t("common.yes"), no: t("common.no") } }),
|
|
4429
4725
|
[t, locale, currency]
|
|
4430
4726
|
);
|
|
@@ -4530,7 +4826,7 @@ var Typography = ({
|
|
|
4530
4826
|
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
4531
4827
|
body = formatValue(body, format, fmt);
|
|
4532
4828
|
}
|
|
4533
|
-
return
|
|
4829
|
+
return React18__namespace.default.createElement(
|
|
4534
4830
|
Component,
|
|
4535
4831
|
{
|
|
4536
4832
|
...domPassthrough(rest),
|
|
@@ -4584,20 +4880,20 @@ function subscribePending(key, cb) {
|
|
|
4584
4880
|
if (set && set.size === 0) keyListeners.delete(key);
|
|
4585
4881
|
};
|
|
4586
4882
|
}
|
|
4587
|
-
var PendingScopeContext =
|
|
4883
|
+
var PendingScopeContext = React18.createContext(null);
|
|
4588
4884
|
function usePendingAction() {
|
|
4589
|
-
const scope =
|
|
4590
|
-
const [key, setKey] =
|
|
4591
|
-
const pending =
|
|
4592
|
-
|
|
4885
|
+
const scope = React18.useContext(PendingScopeContext);
|
|
4886
|
+
const [key, setKey] = React18.useState(null);
|
|
4887
|
+
const pending = React18.useSyncExternalStore(
|
|
4888
|
+
React18.useCallback((cb) => key ? subscribePending(key, cb) : () => {
|
|
4593
4889
|
}, [key]),
|
|
4594
4890
|
() => key ? isPending(key) : false,
|
|
4595
4891
|
() => false
|
|
4596
4892
|
);
|
|
4597
|
-
|
|
4893
|
+
React18.useEffect(() => {
|
|
4598
4894
|
if (key && !pending) setKey(null);
|
|
4599
4895
|
}, [key, pending]);
|
|
4600
|
-
const activate =
|
|
4896
|
+
const activate = React18.useCallback((emit) => {
|
|
4601
4897
|
const k = newPendingKey();
|
|
4602
4898
|
emit(k);
|
|
4603
4899
|
if (!isPending(k)) return;
|
|
@@ -4692,10 +4988,10 @@ function getThemeVersionSnapshot() {
|
|
|
4692
4988
|
return themeVersion;
|
|
4693
4989
|
}
|
|
4694
4990
|
function useThemeIconStrokeApplies(ref) {
|
|
4695
|
-
const documentApplies =
|
|
4696
|
-
const version =
|
|
4697
|
-
const [scopedApplies, setScopedApplies] =
|
|
4698
|
-
|
|
4991
|
+
const documentApplies = React18.useSyncExternalStore(subscribeIconFamily, getStrokeAppliesSnapshot, () => true);
|
|
4992
|
+
const version = React18.useSyncExternalStore(subscribeIconFamily, getThemeVersionSnapshot, () => 0);
|
|
4993
|
+
const [scopedApplies, setScopedApplies] = React18.useState(null);
|
|
4994
|
+
React18.useLayoutEffect(() => {
|
|
4699
4995
|
if (!ref.current) return;
|
|
4700
4996
|
const scoped = scopedIconFamily(ref.current);
|
|
4701
4997
|
setScopedApplies(scoped === null ? null : familyStrokeApplies(scoped));
|
|
@@ -4703,7 +4999,7 @@ function useThemeIconStrokeApplies(ref) {
|
|
|
4703
4999
|
return scopedApplies ?? documentApplies;
|
|
4704
5000
|
}
|
|
4705
5001
|
function useIconFamily() {
|
|
4706
|
-
return
|
|
5002
|
+
return React18.useSyncExternalStore(
|
|
4707
5003
|
subscribeIconFamily,
|
|
4708
5004
|
getIconFamilySnapshot,
|
|
4709
5005
|
getIconFamilyServerSnapshot
|
|
@@ -4742,7 +5038,7 @@ function resolveLucide(name) {
|
|
|
4742
5038
|
}
|
|
4743
5039
|
function makeLucideAdapter(name) {
|
|
4744
5040
|
const LucideComp = resolveLucide(name);
|
|
4745
|
-
const Adapter =
|
|
5041
|
+
const Adapter = React18__namespace.default.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4746
5042
|
LucideComp,
|
|
4747
5043
|
{
|
|
4748
5044
|
ref,
|
|
@@ -4830,9 +5126,9 @@ var Icon = ({
|
|
|
4830
5126
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
4831
5127
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
4832
5128
|
const family = useIconFamily();
|
|
4833
|
-
const svgRef =
|
|
5129
|
+
const svgRef = React18__namespace.default.useRef(null);
|
|
4834
5130
|
const themeStroke = useThemeIconStrokeApplies(svgRef);
|
|
4835
|
-
const RenderedComponent =
|
|
5131
|
+
const RenderedComponent = React18__namespace.default.useMemo(() => {
|
|
4836
5132
|
if (directIcon) return null;
|
|
4837
5133
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
4838
5134
|
}, [directIcon, effectiveName, family]);
|
|
@@ -4974,13 +5270,13 @@ function AtlasImage({
|
|
|
4974
5270
|
"aria-hidden": ariaHidden,
|
|
4975
5271
|
...rest
|
|
4976
5272
|
}) {
|
|
4977
|
-
const [, bump] =
|
|
4978
|
-
const canvasRef =
|
|
5273
|
+
const [, bump] = React18__namespace.useReducer((x) => x + 1, 0);
|
|
5274
|
+
const canvasRef = React18__namespace.useRef(null);
|
|
4979
5275
|
const sliced = isAtlasAsset(asset);
|
|
4980
5276
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
4981
5277
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
4982
5278
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
4983
|
-
|
|
5279
|
+
React18__namespace.useEffect(() => {
|
|
4984
5280
|
const canvas = canvasRef.current;
|
|
4985
5281
|
if (!canvas || !img || !rect) return;
|
|
4986
5282
|
canvas.width = rect.sw;
|
|
@@ -5035,7 +5331,7 @@ function AtlasImage({
|
|
|
5035
5331
|
}
|
|
5036
5332
|
AtlasImage.displayName = "AtlasImage";
|
|
5037
5333
|
logger.createLogger("almadar:ui:navigation");
|
|
5038
|
-
|
|
5334
|
+
React18.createContext(null);
|
|
5039
5335
|
var INERT_API = {
|
|
5040
5336
|
entries: [],
|
|
5041
5337
|
canGoBack: false,
|
|
@@ -5045,12 +5341,12 @@ var INERT_API = {
|
|
|
5045
5341
|
setCurrentLabel: () => void 0,
|
|
5046
5342
|
registerNavItems: () => void 0
|
|
5047
5343
|
};
|
|
5048
|
-
var NavStackContext =
|
|
5344
|
+
var NavStackContext = React18.createContext(INERT_API);
|
|
5049
5345
|
function isInertNavStack(api) {
|
|
5050
5346
|
return api === INERT_API;
|
|
5051
5347
|
}
|
|
5052
5348
|
function useNavStack() {
|
|
5053
|
-
return
|
|
5349
|
+
return React18.useContext(NavStackContext);
|
|
5054
5350
|
}
|
|
5055
5351
|
|
|
5056
5352
|
// lib/followHref.ts
|
|
@@ -5146,7 +5442,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
5146
5442
|
const IconComp = value;
|
|
5147
5443
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
5148
5444
|
}
|
|
5149
|
-
if (
|
|
5445
|
+
if (React18__namespace.default.isValidElement(value)) {
|
|
5150
5446
|
return value;
|
|
5151
5447
|
}
|
|
5152
5448
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -5155,7 +5451,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
5155
5451
|
}
|
|
5156
5452
|
return value;
|
|
5157
5453
|
}
|
|
5158
|
-
var Button =
|
|
5454
|
+
var Button = React18__namespace.default.forwardRef(
|
|
5159
5455
|
({
|
|
5160
5456
|
className,
|
|
5161
5457
|
variant = "primary",
|
|
@@ -5182,7 +5478,7 @@ var Button = React17__namespace.default.forwardRef(
|
|
|
5182
5478
|
const navStack = useNavStack();
|
|
5183
5479
|
const { pending, activate } = usePendingAction();
|
|
5184
5480
|
const busy = isLoading || pending;
|
|
5185
|
-
const [focused, setFocused] =
|
|
5481
|
+
const [focused, setFocused] = React18__namespace.default.useState(false);
|
|
5186
5482
|
const inert = Boolean(disabled) || busy;
|
|
5187
5483
|
const emitAction = () => {
|
|
5188
5484
|
if (!action) return;
|
|
@@ -5224,7 +5520,7 @@ var Button = React17__namespace.default.forwardRef(
|
|
|
5224
5520
|
disabled && focused && "opacity-50 cursor-not-allowed",
|
|
5225
5521
|
className
|
|
5226
5522
|
);
|
|
5227
|
-
const testId = dataTestId ?? (action ?
|
|
5523
|
+
const testId = dataTestId ?? (action ? core.actionTestId(action) : void 0);
|
|
5228
5524
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5229
5525
|
busy && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "almadar-busy-indicator absolute inset-0 flex items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.Loader2, { className: "h-icon-default w-icon-default animate-spin" }) }),
|
|
5230
5526
|
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("inline-flex flex-1 min-w-0 items-center [justify-content:inherit] gap-2", busy && "almadar-busy-content"), children: [
|
|
@@ -5240,6 +5536,8 @@ var Button = React17__namespace.default.forwardRef(
|
|
|
5240
5536
|
return;
|
|
5241
5537
|
}
|
|
5242
5538
|
emitAction();
|
|
5539
|
+
onClick?.(e);
|
|
5540
|
+
if (e.defaultPrevented) return;
|
|
5243
5541
|
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return;
|
|
5244
5542
|
if (!href.startsWith("#") && isInertNavStack(navStack)) return;
|
|
5245
5543
|
e.preventDefault();
|
|
@@ -5320,7 +5618,7 @@ var sizeStyles2 = {
|
|
|
5320
5618
|
md: "px-2.5 py-1 text-sm",
|
|
5321
5619
|
lg: "px-3 py-1.5 text-base"
|
|
5322
5620
|
};
|
|
5323
|
-
var Badge =
|
|
5621
|
+
var Badge = React18__namespace.default.forwardRef(
|
|
5324
5622
|
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, onClick, ...props }, ref) => {
|
|
5325
5623
|
const { t } = useTranslate();
|
|
5326
5624
|
const iconSizes = {
|
|
@@ -5384,12 +5682,12 @@ var Badge = React17__namespace.default.forwardRef(
|
|
|
5384
5682
|
}
|
|
5385
5683
|
);
|
|
5386
5684
|
Badge.displayName = "Badge";
|
|
5387
|
-
var SurfaceContext =
|
|
5685
|
+
var SurfaceContext = React18__namespace.default.createContext(false);
|
|
5388
5686
|
function SurfaceBoundary({ children }) {
|
|
5389
5687
|
return /* @__PURE__ */ jsxRuntime.jsx(SurfaceContext.Provider, { value: true, children });
|
|
5390
5688
|
}
|
|
5391
5689
|
function useContentSurface(surface = "auto") {
|
|
5392
|
-
const onSurface =
|
|
5690
|
+
const onSurface = React18__namespace.default.useContext(SurfaceContext);
|
|
5393
5691
|
const paints = surface === "auto" && !onSurface;
|
|
5394
5692
|
return {
|
|
5395
5693
|
className: paints ? "surface-content" : void 0,
|
|
@@ -5402,7 +5700,7 @@ var sizeStyles3 = {
|
|
|
5402
5700
|
md: "h-6 w-6",
|
|
5403
5701
|
lg: "h-8 w-8"
|
|
5404
5702
|
};
|
|
5405
|
-
var Spinner =
|
|
5703
|
+
var Spinner = React18__namespace.default.forwardRef(
|
|
5406
5704
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
5407
5705
|
const { t } = useTranslate();
|
|
5408
5706
|
if (overlay) {
|
|
@@ -5487,7 +5785,7 @@ var lookStyles = {
|
|
|
5487
5785
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
5488
5786
|
"tile-image-first": "p-0 overflow-hidden"
|
|
5489
5787
|
};
|
|
5490
|
-
var Card =
|
|
5788
|
+
var Card = React18__namespace.default.forwardRef(
|
|
5491
5789
|
({
|
|
5492
5790
|
className,
|
|
5493
5791
|
variant = "bordered",
|
|
@@ -5537,9 +5835,9 @@ var Card = React17__namespace.default.forwardRef(
|
|
|
5537
5835
|
}
|
|
5538
5836
|
);
|
|
5539
5837
|
Card.displayName = "Card";
|
|
5540
|
-
var CardHeader =
|
|
5838
|
+
var CardHeader = React18__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
5541
5839
|
CardHeader.displayName = "CardHeader";
|
|
5542
|
-
var CardTitle =
|
|
5840
|
+
var CardTitle = React18__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5543
5841
|
"h3",
|
|
5544
5842
|
{
|
|
5545
5843
|
ref,
|
|
@@ -5552,11 +5850,11 @@ var CardTitle = React17__namespace.default.forwardRef(({ className, ...props },
|
|
|
5552
5850
|
}
|
|
5553
5851
|
));
|
|
5554
5852
|
CardTitle.displayName = "CardTitle";
|
|
5555
|
-
var CardContent =
|
|
5853
|
+
var CardContent = React18__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
5556
5854
|
CardContent.displayName = "CardContent";
|
|
5557
5855
|
var CardBody = CardContent;
|
|
5558
5856
|
CardBody.displayName = "CardBody";
|
|
5559
|
-
var CardFooter =
|
|
5857
|
+
var CardFooter = React18__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5560
5858
|
"div",
|
|
5561
5859
|
{
|
|
5562
5860
|
ref,
|
|
@@ -5653,7 +5951,7 @@ var Center = ({
|
|
|
5653
5951
|
...rest
|
|
5654
5952
|
}) => {
|
|
5655
5953
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
5656
|
-
return
|
|
5954
|
+
return React18__namespace.default.createElement(Component, {
|
|
5657
5955
|
...domPassthrough(rest),
|
|
5658
5956
|
className: cn(
|
|
5659
5957
|
inline ? "inline-flex" : "flex",
|
|
@@ -5760,8 +6058,8 @@ var Avatar = ({
|
|
|
5760
6058
|
}) => {
|
|
5761
6059
|
const eventBus = useEventBus();
|
|
5762
6060
|
const { t } = useTranslate();
|
|
5763
|
-
const [imgFailed, setImgFailed] =
|
|
5764
|
-
|
|
6061
|
+
const [imgFailed, setImgFailed] = React18__namespace.default.useState(false);
|
|
6062
|
+
React18__namespace.default.useEffect(() => {
|
|
5765
6063
|
setImgFailed(false);
|
|
5766
6064
|
}, [src]);
|
|
5767
6065
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -5879,6 +6177,13 @@ var roundedClass = {
|
|
|
5879
6177
|
"2xl": "rounded-[calc(var(--radius-xl)*1.5)]",
|
|
5880
6178
|
full: "rounded-full"
|
|
5881
6179
|
};
|
|
6180
|
+
var positionClass = {
|
|
6181
|
+
center: "object-center",
|
|
6182
|
+
top: "object-top",
|
|
6183
|
+
bottom: "object-bottom",
|
|
6184
|
+
left: "object-left",
|
|
6185
|
+
right: "object-right"
|
|
6186
|
+
};
|
|
5882
6187
|
var Image2 = ({
|
|
5883
6188
|
src,
|
|
5884
6189
|
alt,
|
|
@@ -5887,6 +6192,10 @@ var Image2 = ({
|
|
|
5887
6192
|
rounded = "md",
|
|
5888
6193
|
bordered = false,
|
|
5889
6194
|
loading = "lazy",
|
|
6195
|
+
position = "center",
|
|
6196
|
+
srcSet,
|
|
6197
|
+
sizes,
|
|
6198
|
+
priority = false,
|
|
5890
6199
|
className,
|
|
5891
6200
|
...rest
|
|
5892
6201
|
}) => {
|
|
@@ -5895,14 +6204,18 @@ var Image2 = ({
|
|
|
5895
6204
|
"img",
|
|
5896
6205
|
{
|
|
5897
6206
|
src,
|
|
6207
|
+
srcSet,
|
|
6208
|
+
sizes,
|
|
6209
|
+
fetchPriority: priority ? "high" : void 0,
|
|
5898
6210
|
alt,
|
|
5899
6211
|
...domPassthrough(rest),
|
|
5900
6212
|
role: alt === "" ? "presentation" : rest.role,
|
|
5901
|
-
loading,
|
|
6213
|
+
loading: priority ? "eager" : loading,
|
|
5902
6214
|
decoding: "async",
|
|
5903
6215
|
className: cn(
|
|
5904
6216
|
"block w-full h-auto max-w-full",
|
|
5905
6217
|
fitClass[fit],
|
|
6218
|
+
positionClass[position],
|
|
5906
6219
|
aspectClass[aspect],
|
|
5907
6220
|
roundedClass[rounded],
|
|
5908
6221
|
bordered && "border border-border",
|
|
@@ -6118,7 +6431,7 @@ var Container = ({
|
|
|
6118
6431
|
...rest
|
|
6119
6432
|
}) => {
|
|
6120
6433
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
6121
|
-
return
|
|
6434
|
+
return React18__namespace.default.createElement(
|
|
6122
6435
|
Component,
|
|
6123
6436
|
{
|
|
6124
6437
|
...domPassthrough(rest),
|
|
@@ -6229,10 +6542,10 @@ function ListSkeleton({ rows = 5, className }) {
|
|
|
6229
6542
|
] }, i)) });
|
|
6230
6543
|
}
|
|
6231
6544
|
function GridSkeleton({ rows = 6, className }) {
|
|
6232
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SimpleGrid, { minChildWidth: "
|
|
6545
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SimpleGrid, { minChildWidth: "256px", gap: "md", className, children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(CardSkeleton, {}, i)) });
|
|
6233
6546
|
}
|
|
6234
6547
|
function StatsSkeleton({ columns = 4, className }) {
|
|
6235
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SimpleGrid, { minChildWidth: "
|
|
6548
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SimpleGrid, { minChildWidth: "176px", gap: "md", className, children: Array.from({ length: columns }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", className: "p-4 border border-border rounded-container", children: [
|
|
6236
6549
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "w-1/2 h-3" }),
|
|
6237
6550
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-7 w-2/3" })
|
|
6238
6551
|
] }, i)) });
|
|
@@ -6254,7 +6567,7 @@ function DetailSkeleton({ rows = 6, className }) {
|
|
|
6254
6567
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-20 flex-1" }),
|
|
6255
6568
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-20 flex-1" })
|
|
6256
6569
|
] }),
|
|
6257
|
-
/* @__PURE__ */ jsxRuntime.jsx(SimpleGrid, { minChildWidth: "
|
|
6570
|
+
/* @__PURE__ */ jsxRuntime.jsx(SimpleGrid, { minChildWidth: "192px", maxCols: 3, gap: "md", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
6258
6571
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "w-1/3 h-3" }),
|
|
6259
6572
|
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-5 w-2/3" })
|
|
6260
6573
|
] }, i)) }),
|
|
@@ -6271,8 +6584,8 @@ function Skeleton({
|
|
|
6271
6584
|
...rest
|
|
6272
6585
|
}) {
|
|
6273
6586
|
const { t } = useTranslate();
|
|
6274
|
-
const
|
|
6275
|
-
if (
|
|
6587
|
+
const shape2 = spec !== void 0 ? shapeOfSpec(spec) : { variant, rows, columns, fields };
|
|
6588
|
+
if (shape2 === null) return null;
|
|
6276
6589
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6277
6590
|
Box,
|
|
6278
6591
|
{
|
|
@@ -6280,10 +6593,10 @@ function Skeleton({
|
|
|
6280
6593
|
role: "status",
|
|
6281
6594
|
"aria-busy": "true",
|
|
6282
6595
|
"aria-label": rest["aria-label"] ?? t("common.loading"),
|
|
6283
|
-
"data-skeleton":
|
|
6596
|
+
"data-skeleton": shape2.variant,
|
|
6284
6597
|
...{ [core.LOADING_STATE_MARKER]: "" },
|
|
6285
6598
|
className: "w-full",
|
|
6286
|
-
children: renderVariant(
|
|
6599
|
+
children: renderVariant(shape2.variant, shape2.rows, shape2.columns, shape2.fields, className)
|
|
6287
6600
|
}
|
|
6288
6601
|
);
|
|
6289
6602
|
}
|
|
@@ -6421,7 +6734,7 @@ var StatDisplay = ({
|
|
|
6421
6734
|
const contentSurface = useContentSurface(surface);
|
|
6422
6735
|
const eventBus = useEventBus();
|
|
6423
6736
|
const fmt = useFormatContext();
|
|
6424
|
-
const handleClick =
|
|
6737
|
+
const handleClick = React18.useCallback(() => {
|
|
6425
6738
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { metricLabel: label });
|
|
6426
6739
|
}, [clickEvent, eventBus, label]);
|
|
6427
6740
|
const ResolvedIcon = typeof iconProp === "string" ? resolveIcon(iconProp) : typeof iconProp === "function" ? iconProp : null;
|
|
@@ -6575,14 +6888,14 @@ var AnimatedCounter = ({
|
|
|
6575
6888
|
...rest
|
|
6576
6889
|
}) => {
|
|
6577
6890
|
const fmt = useFormatContext();
|
|
6578
|
-
const ref =
|
|
6891
|
+
const ref = React18.useRef(null);
|
|
6579
6892
|
const parsed = parseValue(value);
|
|
6580
6893
|
const target = parsed.num ?? 0;
|
|
6581
|
-
const [visible, setVisible] =
|
|
6582
|
-
const [display, setDisplay] =
|
|
6583
|
-
const shownRef =
|
|
6584
|
-
const frameRef =
|
|
6585
|
-
|
|
6894
|
+
const [visible, setVisible] = React18.useState(() => typeof IntersectionObserver === "undefined");
|
|
6895
|
+
const [display, setDisplay] = React18.useState(() => typeof IntersectionObserver === "undefined" ? target : 0);
|
|
6896
|
+
const shownRef = React18.useRef(display);
|
|
6897
|
+
const frameRef = React18.useRef(null);
|
|
6898
|
+
React18.useEffect(() => {
|
|
6586
6899
|
if (visible) return;
|
|
6587
6900
|
const el = ref.current;
|
|
6588
6901
|
if (!el || typeof IntersectionObserver === "undefined") {
|
|
@@ -6601,7 +6914,7 @@ var AnimatedCounter = ({
|
|
|
6601
6914
|
observer2.observe(el);
|
|
6602
6915
|
return () => observer2.disconnect();
|
|
6603
6916
|
}, [visible]);
|
|
6604
|
-
|
|
6917
|
+
React18.useEffect(() => {
|
|
6605
6918
|
if (!visible) return;
|
|
6606
6919
|
const from = shownRef.current;
|
|
6607
6920
|
if (from === target || prefersReducedMotion() || typeof requestAnimationFrame === "undefined") {
|
|
@@ -6630,6 +6943,35 @@ var AnimatedCounter = ({
|
|
|
6630
6943
|
] });
|
|
6631
6944
|
};
|
|
6632
6945
|
AnimatedCounter.displayName = "AnimatedCounter";
|
|
6946
|
+
function useMediaQuery(query) {
|
|
6947
|
+
const subscribe = React18.useCallback(
|
|
6948
|
+
(onChange) => {
|
|
6949
|
+
if (!hasMatchMedia()) return () => void 0;
|
|
6950
|
+
const mql = window.matchMedia(query);
|
|
6951
|
+
mql.addEventListener("change", onChange);
|
|
6952
|
+
return () => mql.removeEventListener("change", onChange);
|
|
6953
|
+
},
|
|
6954
|
+
[query]
|
|
6955
|
+
);
|
|
6956
|
+
return React18.useSyncExternalStore(
|
|
6957
|
+
subscribe,
|
|
6958
|
+
() => hasMatchMedia() && window.matchMedia(query).matches,
|
|
6959
|
+
() => false
|
|
6960
|
+
);
|
|
6961
|
+
}
|
|
6962
|
+
function hasMatchMedia() {
|
|
6963
|
+
return typeof window !== "undefined" && typeof window.matchMedia === "function";
|
|
6964
|
+
}
|
|
6965
|
+
|
|
6966
|
+
// hooks/usePrefersReducedMotion.ts
|
|
6967
|
+
function usePrefersReducedMotion() {
|
|
6968
|
+
return useMediaQuery("(prefers-reduced-motion: reduce)");
|
|
6969
|
+
}
|
|
6970
|
+
var revealLog = logger.createLogger("almadar:ui:animated-reveal");
|
|
6971
|
+
function revealThresholds(threshold) {
|
|
6972
|
+
const steps = Array.from({ length: 20 }, (_, i) => i * threshold / 20);
|
|
6973
|
+
return [...steps, threshold];
|
|
6974
|
+
}
|
|
6633
6975
|
var initialStyles = {
|
|
6634
6976
|
"fade-up": { opacity: 0, transform: "translateY(24px)" },
|
|
6635
6977
|
"fade-down": { opacity: 0, transform: "translateY(-24px)" },
|
|
@@ -6650,7 +6992,7 @@ var animatedStyles = {
|
|
|
6650
6992
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6651
6993
|
"none": {}
|
|
6652
6994
|
};
|
|
6653
|
-
var AnimatedReveal =
|
|
6995
|
+
var AnimatedReveal = React18__namespace.default.forwardRef(
|
|
6654
6996
|
({
|
|
6655
6997
|
trigger = "scroll",
|
|
6656
6998
|
animation = "fade-up",
|
|
@@ -6658,6 +7000,9 @@ var AnimatedReveal = React17__namespace.default.forwardRef(
|
|
|
6658
7000
|
delay = 0,
|
|
6659
7001
|
threshold = 0.15,
|
|
6660
7002
|
once = true,
|
|
7003
|
+
revealEvent,
|
|
7004
|
+
enterEvent,
|
|
7005
|
+
leaveEvent,
|
|
6661
7006
|
animate: manualAnimate,
|
|
6662
7007
|
easing = "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
6663
7008
|
children,
|
|
@@ -6665,10 +7010,14 @@ var AnimatedReveal = React17__namespace.default.forwardRef(
|
|
|
6665
7010
|
style,
|
|
6666
7011
|
...props
|
|
6667
7012
|
}, forwardedRef) => {
|
|
6668
|
-
const [isAnimated, setIsAnimated] =
|
|
6669
|
-
const
|
|
6670
|
-
const
|
|
6671
|
-
const
|
|
7013
|
+
const [isAnimated, setIsAnimated] = React18.useState(false);
|
|
7014
|
+
const reducedMotion = usePrefersReducedMotion();
|
|
7015
|
+
const eventBus = useEventBus();
|
|
7016
|
+
const revealEmitted = React18.useRef(false);
|
|
7017
|
+
const internalRef = React18.useRef(null);
|
|
7018
|
+
const hasAnimated = React18.useRef(false);
|
|
7019
|
+
const inView = React18.useRef(false);
|
|
7020
|
+
const setRef = React18.useCallback(
|
|
6672
7021
|
(node) => {
|
|
6673
7022
|
internalRef.current = node;
|
|
6674
7023
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -6676,25 +7025,48 @@ var AnimatedReveal = React17__namespace.default.forwardRef(
|
|
|
6676
7025
|
},
|
|
6677
7026
|
[forwardedRef]
|
|
6678
7027
|
);
|
|
6679
|
-
|
|
7028
|
+
React18.useEffect(() => {
|
|
6680
7029
|
if (trigger !== "scroll") return;
|
|
6681
7030
|
const el = internalRef.current;
|
|
6682
7031
|
if (!el) return;
|
|
6683
7032
|
const observer2 = new IntersectionObserver(
|
|
6684
7033
|
([entry]) => {
|
|
6685
|
-
if (entry.isIntersecting) {
|
|
7034
|
+
if (entry.isIntersecting !== inView.current) {
|
|
7035
|
+
const event = entry.isIntersecting ? enterEvent : leaveEvent;
|
|
7036
|
+
inView.current = entry.isIntersecting;
|
|
7037
|
+
if (event) eventBus.emit(`UI:${event}`, {});
|
|
7038
|
+
}
|
|
7039
|
+
const seenEnough = entry.isIntersecting && (entry.intersectionRatio >= threshold || entry.rootBounds !== null && entry.intersectionRect.height >= threshold * entry.rootBounds.height);
|
|
7040
|
+
if (seenEnough) {
|
|
7041
|
+
if (revealEvent && !reducedMotion && !revealEmitted.current) {
|
|
7042
|
+
revealEmitted.current = true;
|
|
7043
|
+
revealLog.debug("reveal event", { event: revealEvent });
|
|
7044
|
+
eventBus.emit(`UI:${revealEvent}`, {});
|
|
7045
|
+
}
|
|
6686
7046
|
if (once && hasAnimated.current) return;
|
|
6687
7047
|
hasAnimated.current = true;
|
|
6688
7048
|
setIsAnimated(true);
|
|
6689
|
-
} else if (!once) {
|
|
7049
|
+
} else if (!entry.isIntersecting && !once) {
|
|
6690
7050
|
setIsAnimated(false);
|
|
6691
7051
|
}
|
|
6692
7052
|
},
|
|
6693
|
-
{ threshold }
|
|
7053
|
+
{ threshold: revealThresholds(threshold) }
|
|
7054
|
+
);
|
|
7055
|
+
observer2.observe(el);
|
|
7056
|
+
return () => observer2.disconnect();
|
|
7057
|
+
}, [trigger, threshold, once, revealEvent, enterEvent, leaveEvent, reducedMotion, eventBus]);
|
|
7058
|
+
React18.useEffect(() => {
|
|
7059
|
+
const el = internalRef.current;
|
|
7060
|
+
if (!el || typeof IntersectionObserver === "undefined") return;
|
|
7061
|
+
const observer2 = new IntersectionObserver(
|
|
7062
|
+
([entry]) => {
|
|
7063
|
+
el.dataset.onScreen = entry.isIntersecting ? "true" : "false";
|
|
7064
|
+
},
|
|
7065
|
+
{ rootMargin: "200px" }
|
|
6694
7066
|
);
|
|
6695
7067
|
observer2.observe(el);
|
|
6696
7068
|
return () => observer2.disconnect();
|
|
6697
|
-
}, [
|
|
7069
|
+
}, []);
|
|
6698
7070
|
const handleMouseEnter = trigger === "hover" ? () => setIsAnimated(true) : void 0;
|
|
6699
7071
|
const handleMouseLeave = trigger === "hover" ? () => {
|
|
6700
7072
|
if (!once || !hasAnimated.current) {
|
|
@@ -6702,22 +7074,24 @@ var AnimatedReveal = React17__namespace.default.forwardRef(
|
|
|
6702
7074
|
setIsAnimated(false);
|
|
6703
7075
|
}
|
|
6704
7076
|
} : void 0;
|
|
6705
|
-
|
|
7077
|
+
React18.useEffect(() => {
|
|
6706
7078
|
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
6707
7079
|
setIsAnimated(manualAnimate);
|
|
6708
7080
|
}
|
|
6709
7081
|
}, [trigger, manualAnimate]);
|
|
6710
|
-
const active = isAnimated;
|
|
7082
|
+
const active = isAnimated || reducedMotion;
|
|
6711
7083
|
const currentStyle = active ? animatedStyles[animation] : initialStyles[animation];
|
|
6712
7084
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6713
7085
|
"div",
|
|
6714
7086
|
{
|
|
6715
7087
|
ref: setRef,
|
|
6716
|
-
className: cn(
|
|
7088
|
+
className: cn(className),
|
|
6717
7089
|
style: {
|
|
6718
7090
|
...currentStyle,
|
|
7091
|
+
// A revealed band is page-sized: keeping the layer hint after the reveal holds a huge GPU layer.
|
|
7092
|
+
willChange: active ? "auto" : "opacity, transform",
|
|
6719
7093
|
transitionProperty: "opacity, transform",
|
|
6720
|
-
transitionDuration: `${duration}ms`,
|
|
7094
|
+
transitionDuration: reducedMotion ? "0ms" : `${duration}ms`,
|
|
6721
7095
|
transitionDelay: `${delay}ms`,
|
|
6722
7096
|
transitionTimingFunction: easing,
|
|
6723
7097
|
...style
|
|
@@ -6732,9 +7106,9 @@ var AnimatedReveal = React17__namespace.default.forwardRef(
|
|
|
6732
7106
|
);
|
|
6733
7107
|
AnimatedReveal.displayName = "AnimatedReveal";
|
|
6734
7108
|
function useFetchedSvg(src) {
|
|
6735
|
-
const [svg, setSvg] =
|
|
6736
|
-
const cache =
|
|
6737
|
-
|
|
7109
|
+
const [svg, setSvg] = React18.useState(null);
|
|
7110
|
+
const cache = React18.useRef({});
|
|
7111
|
+
React18.useEffect(() => {
|
|
6738
7112
|
if (!src) {
|
|
6739
7113
|
setSvg(null);
|
|
6740
7114
|
return;
|
|
@@ -6803,7 +7177,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
6803
7177
|
el.style.opacity = animate ? "1" : "0";
|
|
6804
7178
|
});
|
|
6805
7179
|
}
|
|
6806
|
-
var AnimatedGraphic =
|
|
7180
|
+
var AnimatedGraphic = React18__namespace.default.forwardRef(
|
|
6807
7181
|
({
|
|
6808
7182
|
src,
|
|
6809
7183
|
svgContent,
|
|
@@ -6822,11 +7196,11 @@ var AnimatedGraphic = React17__namespace.default.forwardRef(
|
|
|
6822
7196
|
children,
|
|
6823
7197
|
...props
|
|
6824
7198
|
}, ref) => {
|
|
6825
|
-
const containerRef =
|
|
7199
|
+
const containerRef = React18.useRef(null);
|
|
6826
7200
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6827
7201
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6828
|
-
const prevAnimateRef =
|
|
6829
|
-
const setRef =
|
|
7202
|
+
const prevAnimateRef = React18.useRef(animate);
|
|
7203
|
+
const setRef = React18__namespace.default.useCallback(
|
|
6830
7204
|
(node) => {
|
|
6831
7205
|
containerRef.current = node;
|
|
6832
7206
|
if (typeof ref === "function") ref(node);
|
|
@@ -6834,7 +7208,7 @@ var AnimatedGraphic = React17__namespace.default.forwardRef(
|
|
|
6834
7208
|
},
|
|
6835
7209
|
[ref]
|
|
6836
7210
|
);
|
|
6837
|
-
|
|
7211
|
+
React18.useEffect(() => {
|
|
6838
7212
|
const el = containerRef.current;
|
|
6839
7213
|
if (!el || !strokeColor) return;
|
|
6840
7214
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
@@ -6842,7 +7216,7 @@ var AnimatedGraphic = React17__namespace.default.forwardRef(
|
|
|
6842
7216
|
p.style.stroke = strokeColor;
|
|
6843
7217
|
});
|
|
6844
7218
|
}, [resolvedSvg, strokeColor]);
|
|
6845
|
-
|
|
7219
|
+
React18.useEffect(() => {
|
|
6846
7220
|
const el = containerRef.current;
|
|
6847
7221
|
if (!el || !resolvedSvg) return;
|
|
6848
7222
|
if (animation === "draw" || animation === "fill") {
|
|
@@ -6867,7 +7241,7 @@ var AnimatedGraphic = React17__namespace.default.forwardRef(
|
|
|
6867
7241
|
});
|
|
6868
7242
|
}
|
|
6869
7243
|
}, [resolvedSvg, animation]);
|
|
6870
|
-
|
|
7244
|
+
React18.useEffect(() => {
|
|
6871
7245
|
const el = containerRef.current;
|
|
6872
7246
|
if (!el) return;
|
|
6873
7247
|
const id = requestAnimationFrame(() => {
|
|
@@ -7669,7 +8043,7 @@ var GeometricPattern = ({
|
|
|
7669
8043
|
children,
|
|
7670
8044
|
className
|
|
7671
8045
|
}) => {
|
|
7672
|
-
const reactId =
|
|
8046
|
+
const reactId = React18.useId();
|
|
7673
8047
|
const patternId = `gp${reactId.replace(/:/g, "")}`;
|
|
7674
8048
|
const size = 60 * scale2;
|
|
7675
8049
|
const stripHeight = 40 * scale2;
|
|
@@ -7904,7 +8278,7 @@ var EdgeDecoration = ({
|
|
|
7904
8278
|
width = 15,
|
|
7905
8279
|
className
|
|
7906
8280
|
}) => {
|
|
7907
|
-
const id =
|
|
8281
|
+
const id = React18.useId();
|
|
7908
8282
|
const Variant = VARIANT_MAP2[variant];
|
|
7909
8283
|
const resolvedColor = color in colorTokenVars2 ? colorTokenVars2[color] : color;
|
|
7910
8284
|
const sides = side === "both" ? ["left", "right"] : [side];
|