@almadar/ui 5.121.3 → 5.121.4
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 +330 -67
- package/dist/avl/index.js +332 -69
- package/dist/components/index.cjs +159 -45
- package/dist/components/index.d.cts +25 -5
- package/dist/components/index.d.ts +25 -5
- package/dist/components/index.js +159 -47
- package/dist/hooks/index.cjs +31 -10
- package/dist/hooks/index.d.cts +17 -1
- package/dist/hooks/index.d.ts +17 -1
- package/dist/hooks/index.js +31 -12
- package/dist/lib/drawable/three/index.cjs +19 -10
- package/dist/lib/drawable/three/index.js +20 -11
- package/dist/lib/index.cjs +41 -13
- package/dist/lib/index.js +41 -13
- package/dist/marketing/index.cjs +29 -14
- package/dist/marketing/index.js +29 -14
- package/dist/providers/index.cjs +204 -63
- package/dist/providers/index.d.cts +33 -4
- package/dist/providers/index.d.ts +33 -4
- package/dist/providers/index.js +204 -64
- package/dist/runtime/index.cjs +330 -67
- package/dist/runtime/index.d.cts +0 -14
- package/dist/runtime/index.d.ts +0 -14
- package/dist/runtime/index.js +333 -70
- package/package.json +2 -2
- package/tailwind-preset.cjs +56 -0
- package/themes/_base.css +19 -0
package/dist/marketing/index.js
CHANGED
|
@@ -2487,9 +2487,11 @@ function cn(...inputs) {
|
|
|
2487
2487
|
createLogger("almadar:eventbus");
|
|
2488
2488
|
createLogger("almadar:eventbus:subscribe");
|
|
2489
2489
|
var EventBusContext = createContext(null);
|
|
2490
|
+
var EMPTY_CHAIN = Object.freeze([]);
|
|
2490
2491
|
var TraitScopeContext = createContext(null);
|
|
2491
|
-
function
|
|
2492
|
-
|
|
2492
|
+
function useTraitScopeChain() {
|
|
2493
|
+
const chain = useContext(TraitScopeContext);
|
|
2494
|
+
return chain ?? EMPTY_CHAIN;
|
|
2493
2495
|
}
|
|
2494
2496
|
var log = createLogger("almadar:eventbus");
|
|
2495
2497
|
var subLog2 = createLogger("almadar:eventbus:subscribe");
|
|
@@ -2567,9 +2569,9 @@ var fallbackEventBus = {
|
|
|
2567
2569
|
function useEventBus() {
|
|
2568
2570
|
const context = useContext(EventBusContext);
|
|
2569
2571
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2570
|
-
const
|
|
2572
|
+
const chain = useTraitScopeChain();
|
|
2571
2573
|
return useMemo(() => {
|
|
2572
|
-
if (
|
|
2574
|
+
if (chain.length === 0) {
|
|
2573
2575
|
return {
|
|
2574
2576
|
...baseBus,
|
|
2575
2577
|
emit: (type, payload, source) => {
|
|
@@ -2585,22 +2587,31 @@ function useEventBus() {
|
|
|
2585
2587
|
emit: (type, payload, source) => {
|
|
2586
2588
|
if (typeof type === "string" && type.startsWith("UI:")) {
|
|
2587
2589
|
const tail = type.slice(3);
|
|
2588
|
-
const
|
|
2589
|
-
|
|
2590
|
-
|
|
2590
|
+
const isQualified = tail.includes(".");
|
|
2591
|
+
const event = isQualified ? tail.split(".").slice(2).join(".") : tail;
|
|
2592
|
+
if (!event) {
|
|
2593
|
+
baseBus.emit(type, payload, source);
|
|
2594
|
+
return;
|
|
2595
|
+
}
|
|
2596
|
+
const keys = /* @__PURE__ */ new Set();
|
|
2597
|
+
if (isQualified) keys.add(type);
|
|
2598
|
+
for (const sc of chain) {
|
|
2599
|
+
keys.add(`UI:${sc.orbital}.${sc.trait}.${event}`);
|
|
2600
|
+
}
|
|
2601
|
+
if (keys.size > 1) {
|
|
2602
|
+
scopeLog.info("emit:fan-out", {
|
|
2591
2603
|
from: type,
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
scopeTrait: scope.trait
|
|
2604
|
+
keys: Array.from(keys),
|
|
2605
|
+
chainDepth: chain.length
|
|
2595
2606
|
});
|
|
2596
2607
|
}
|
|
2597
|
-
baseBus.emit(
|
|
2608
|
+
for (const key of keys) baseBus.emit(key, payload, source);
|
|
2598
2609
|
return;
|
|
2599
2610
|
}
|
|
2600
2611
|
baseBus.emit(type, payload, source);
|
|
2601
2612
|
}
|
|
2602
2613
|
};
|
|
2603
|
-
}, [baseBus,
|
|
2614
|
+
}, [baseBus, chain]);
|
|
2604
2615
|
}
|
|
2605
2616
|
function useTapReveal(options = {}) {
|
|
2606
2617
|
const { onReveal, onDismiss, refs, enabled = true } = options;
|
|
@@ -3197,13 +3208,13 @@ var Icon = ({
|
|
|
3197
3208
|
style
|
|
3198
3209
|
}) => {
|
|
3199
3210
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
3200
|
-
const effectiveName = typeof icon === "string" ? icon : name;
|
|
3211
|
+
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
3212
|
+
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
3201
3213
|
const family = useIconFamily();
|
|
3202
3214
|
const RenderedComponent = React12__default.useMemo(() => {
|
|
3203
3215
|
if (directIcon) return null;
|
|
3204
3216
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
3205
3217
|
}, [directIcon, effectiveName, family]);
|
|
3206
|
-
const effectiveStrokeWidth = strokeWidth ?? void 0;
|
|
3207
3218
|
const inlineStyle = {
|
|
3208
3219
|
...effectiveStrokeWidth === void 0 ? { strokeWidth: "var(--icon-stroke-width, 2)" } : {},
|
|
3209
3220
|
...style
|
|
@@ -5078,6 +5089,10 @@ var AnimatedCounter = ({
|
|
|
5078
5089
|
setDisplayValue(String(value));
|
|
5079
5090
|
return;
|
|
5080
5091
|
}
|
|
5092
|
+
if (window.matchMedia?.("(prefers-reduced-motion: reduce)").matches) {
|
|
5093
|
+
setDisplayValue(String(value));
|
|
5094
|
+
return;
|
|
5095
|
+
}
|
|
5081
5096
|
const startTime = performance.now();
|
|
5082
5097
|
const tick = (now) => {
|
|
5083
5098
|
const elapsed = now - startTime;
|