@almadar/ui 6.51.2 → 6.53.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/{EntityBindingContext-BbxrwSb9.d.ts → AwaitingSkeletonContext-Bh399p1x.d.ts} +17 -2
- package/dist/{Canvas3DHost-CLC_jXh_.d.ts → Canvas3DHost-B-y2TNij.d.ts} +1 -1
- package/dist/{FileTree-RKQqRhIM.d.ts → FileTree-DUi7e7Z8.d.ts} +5 -5
- package/dist/{GameAudioProvider-BgWLggIy.d.ts → GameAudioProvider-DyBvYP2c.d.ts} +1 -1
- package/dist/{NavStackContext-B-XLULCO.d.ts → NavStackContext-04NLdXsY.d.ts} +8 -0
- package/dist/Typography-JGSDH4JP.js +5 -0
- package/dist/{UISlotContext-DNM8iXna.d.ts → UISlotContext-CS487Uoc.d.ts} +1 -1
- package/dist/{UISlotRenderer-7UYHFW4S.js → UISlotRenderer-JT34I3O7.js} +9 -9
- package/dist/avl/index.cjs +39958 -38525
- package/dist/avl/index.d.ts +8 -5
- package/dist/avl/index.js +37 -26
- package/dist/{chunk-JXUYEO7U.js → chunk-2LFBQ4IS.js} +7 -1
- package/dist/{chunk-GIPZSCND.js → chunk-3EF5SDIJ.js} +31157 -31206
- package/dist/{chunk-GHXWGQTX.js → chunk-4OZDHCZV.js} +1 -1
- package/dist/{chunk-HQDKHLFG.js → chunk-64WACXM7.js} +15 -1
- package/dist/{chunk-FGHRVJCI.js → chunk-6O37FCX4.js} +13 -2
- package/dist/{chunk-BUEIZY54.js → chunk-7LM6I3NA.js} +8 -7
- package/dist/chunk-CBIJP5PL.js +284 -0
- package/dist/{chunk-MWPX2O4M.js → chunk-GMDMOYXD.js} +3 -16
- package/dist/{chunk-YKHNK5JH.js → chunk-GODZKHAL.js} +11 -4
- package/dist/{chunk-T7IH5ABO.js → chunk-IKULQIDX.js} +199 -88
- package/dist/{chunk-NTO555KF.js → chunk-JRW33U35.js} +183 -62
- package/dist/{chunk-OLZ3EEML.js → chunk-KQXXO42S.js} +106 -90
- package/dist/chunk-OKWD7LPO.js +80 -0
- package/dist/{chunk-YHY5K2Y7.js → chunk-PEST66PN.js} +6 -0
- package/dist/{chunk-L55SAFKL.js → chunk-UGHAADU5.js} +77 -1
- package/dist/{chunk-6CFYRP4S.js → chunk-VHTJRS2N.js} +4 -8
- package/dist/{chunk-R4V7IZQP.js → chunk-WPNM2KC6.js} +2 -2
- package/dist/{cn-CO-0rolG.d.ts → cn-ClXGlIOY.d.ts} +2 -2
- package/dist/components/index.cjs +46084 -44766
- package/dist/components/index.d.ts +645 -699
- package/dist/components/index.js +621 -13
- package/dist/context/index.cjs +20 -7
- package/dist/context/index.d.ts +3 -3
- package/dist/context/index.js +3 -3
- package/dist/hooks/index.cjs +126 -9
- package/dist/hooks/index.d.ts +32 -7
- package/dist/hooks/index.js +7 -7
- package/dist/lib/drawable/three/index.cjs +79 -2
- package/dist/lib/drawable/three/index.d.ts +3 -3
- package/dist/lib/drawable/three/index.js +7 -7
- package/dist/lib/index.cjs +116 -2
- package/dist/lib/index.d.ts +29 -6
- package/dist/lib/index.js +6 -5
- package/dist/locales/index.cjs +231 -3
- package/dist/locales/index.js +155 -3
- package/dist/{paintDispatch-CMgOyVjS.d.ts → paintDispatch-_6EhJCiL.d.ts} +6 -6
- package/dist/providers/index.cjs +36404 -35028
- package/dist/providers/index.d.ts +34 -9
- package/dist/providers/index.js +82 -19
- package/dist/renderer/index.cjs +6 -0
- package/dist/renderer/index.d.ts +1 -1
- package/dist/renderer/index.js +1 -1
- package/dist/runtime/index.cjs +37861 -36437
- package/dist/runtime/index.d.ts +6 -4
- package/dist/runtime/index.js +11 -11
- package/dist/ssr/index.cjs +584 -181
- package/dist/ssr/index.d.cts +36 -44
- package/dist/ssr/index.d.ts +36 -44
- package/dist/ssr/index.js +527 -124
- package/dist/{themeTokens-CN9WCXQc.d.ts → themeTokens-Ccu7EmGY.d.ts} +4 -2
- package/dist/{useUISlots-CwUWM1ra.d.ts → useUISlots-1dk2TR4j.d.ts} +1 -9
- package/dist/{verificationRegistry-DBHfOR9y.d.ts → verificationRegistry-CD7Xb40L.d.ts} +1 -1
- package/locales/ar.json +77 -1
- package/locales/en.json +77 -1
- package/locales/sl.json +77 -1
- package/package.json +13 -10
- package/tailwind-preset.cjs +37 -1
- package/themes/_base.css +114 -8
- package/themes/_contract.md +6 -0
- package/themes/almadar-website.css +2 -0
- package/themes/almadar.css +2 -0
- package/themes/aqua.css +5 -3
- package/themes/arabesque.css +9 -7
- package/themes/art-deco.css +5 -3
- package/themes/art-nouveau.css +4 -0
- package/themes/atelier.css +10 -8
- package/themes/bauhaus.css +2 -0
- package/themes/bloomberg-dense.css +13 -11
- package/themes/blueprint.css +2 -0
- package/themes/clay.css +2 -0
- package/themes/comic.css +12 -10
- package/themes/constructivist.css +2 -0
- package/themes/corporate.css +4 -2
- package/themes/cyberpunk.css +2 -0
- package/themes/frutiger-aero.css +2 -0
- package/themes/game-adventure.css +1 -0
- package/themes/game-rpg.css +1 -0
- package/themes/game-sci-fi.css +1 -0
- package/themes/game-ui-pack.css +1 -0
- package/themes/gazette.css +10 -8
- package/themes/glass.css +17 -15
- package/themes/gothic.css +2 -0
- package/themes/ink-wash.css +2 -0
- package/themes/kawaii.css +2 -0
- package/themes/kiosk.css +17 -15
- package/themes/linear-clean.css +12 -10
- package/themes/luxury.css +2 -0
- package/themes/mac-classic.css +2 -0
- package/themes/material.css +2 -0
- package/themes/memphis.css +2 -0
- package/themes/mid-century.css +2 -0
- package/themes/minimalist.css +2 -0
- package/themes/mudcloth.css +2 -0
- package/themes/neon.css +2 -0
- package/themes/neumorphic.css +2 -0
- package/themes/newsprint.css +2 -0
- package/themes/notion-editorial.css +12 -10
- package/themes/pixel.css +2 -0
- package/themes/prism.css +20 -18
- package/themes/retro.css +2 -0
- package/themes/risograph.css +2 -0
- package/themes/scandi.css +2 -0
- package/themes/sketch.css +2 -0
- package/themes/solarpunk.css +2 -0
- package/themes/steampunk.css +2 -0
- package/themes/swiss.css +2 -0
- package/themes/terminal.css +8 -6
- package/themes/trait-wars.css +2 -0
- package/themes/ukiyo-e.css +2 -0
- package/themes/vaporwave.css +2 -0
- package/themes/victorian.css +2 -0
- package/themes/wabi-sabi.css +2 -0
- package/themes/win95.css +2 -0
- package/themes/wireframe.css +2 -0
- package/themes/zine.css +2 -0
- package/dist/Typography-2Z3JKWHN.js +0 -5
package/dist/ssr/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var React17 = require('react');
|
|
4
4
|
var logger = require('@almadar/logger');
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var LucideIcons2 = require('lucide-react');
|
|
@@ -25,7 +25,7 @@ function _interopNamespace(e) {
|
|
|
25
25
|
return Object.freeze(n);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var React17__namespace = /*#__PURE__*/_interopNamespace(React17);
|
|
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
|
|
@@ -2578,11 +2578,11 @@ function cn(...inputs) {
|
|
|
2578
2578
|
}
|
|
2579
2579
|
logger.createLogger("almadar:eventbus");
|
|
2580
2580
|
logger.createLogger("almadar:eventbus:subscribe");
|
|
2581
|
-
var EventBusContext = globalThis.__almadarUiEventBusContext ?? (globalThis.__almadarUiEventBusContext =
|
|
2581
|
+
var EventBusContext = globalThis.__almadarUiEventBusContext ?? (globalThis.__almadarUiEventBusContext = React17.createContext(null));
|
|
2582
2582
|
var EMPTY_CHAIN = Object.freeze([]);
|
|
2583
|
-
var TraitScopeContext =
|
|
2583
|
+
var TraitScopeContext = React17.createContext(null);
|
|
2584
2584
|
function useTraitScopeChain() {
|
|
2585
|
-
const chain =
|
|
2585
|
+
const chain = React17.useContext(TraitScopeContext);
|
|
2586
2586
|
return chain ?? EMPTY_CHAIN;
|
|
2587
2587
|
}
|
|
2588
2588
|
var log = logger.createLogger("almadar:eventbus");
|
|
@@ -2659,10 +2659,10 @@ var fallbackEventBus = {
|
|
|
2659
2659
|
}
|
|
2660
2660
|
};
|
|
2661
2661
|
function useEventBus() {
|
|
2662
|
-
const context =
|
|
2662
|
+
const context = React17.useContext(EventBusContext);
|
|
2663
2663
|
const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
|
|
2664
2664
|
const chain = useTraitScopeChain();
|
|
2665
|
-
return
|
|
2665
|
+
return React17.useMemo(() => {
|
|
2666
2666
|
if (chain.length === 0) {
|
|
2667
2667
|
return {
|
|
2668
2668
|
...baseBus,
|
|
@@ -2708,24 +2708,24 @@ function useEventBus() {
|
|
|
2708
2708
|
}
|
|
2709
2709
|
function useTapReveal(options = {}) {
|
|
2710
2710
|
const { onReveal, onDismiss, refs, enabled = true } = options;
|
|
2711
|
-
const [revealed, setRevealed] =
|
|
2712
|
-
const onRevealRef =
|
|
2713
|
-
const onDismissRef =
|
|
2711
|
+
const [revealed, setRevealed] = React17.useState(false);
|
|
2712
|
+
const onRevealRef = React17.useRef(onReveal);
|
|
2713
|
+
const onDismissRef = React17.useRef(onDismiss);
|
|
2714
2714
|
onRevealRef.current = onReveal;
|
|
2715
2715
|
onDismissRef.current = onDismiss;
|
|
2716
|
-
const reveal =
|
|
2716
|
+
const reveal = React17.useCallback(() => {
|
|
2717
2717
|
setRevealed((wasRevealed) => {
|
|
2718
2718
|
if (!wasRevealed) onRevealRef.current?.();
|
|
2719
2719
|
return true;
|
|
2720
2720
|
});
|
|
2721
2721
|
}, []);
|
|
2722
|
-
const dismiss =
|
|
2722
|
+
const dismiss = React17.useCallback(() => {
|
|
2723
2723
|
setRevealed((wasRevealed) => {
|
|
2724
2724
|
if (wasRevealed) onDismissRef.current?.();
|
|
2725
2725
|
return false;
|
|
2726
2726
|
});
|
|
2727
2727
|
}, []);
|
|
2728
|
-
const onPointerDown =
|
|
2728
|
+
const onPointerDown = React17.useCallback(
|
|
2729
2729
|
(e) => {
|
|
2730
2730
|
if (!enabled || e.pointerType === "mouse") return;
|
|
2731
2731
|
if (revealed) dismiss();
|
|
@@ -2733,7 +2733,7 @@ function useTapReveal(options = {}) {
|
|
|
2733
2733
|
},
|
|
2734
2734
|
[enabled, revealed, reveal, dismiss]
|
|
2735
2735
|
);
|
|
2736
|
-
|
|
2736
|
+
React17.useEffect(() => {
|
|
2737
2737
|
if (!revealed || typeof document === "undefined") return;
|
|
2738
2738
|
const onDocDown = (ev) => {
|
|
2739
2739
|
const target = ev.target;
|
|
@@ -2750,10 +2750,10 @@ function useTapReveal(options = {}) {
|
|
|
2750
2750
|
return { revealed, triggerProps: { onPointerDown }, reveal, dismiss };
|
|
2751
2751
|
}
|
|
2752
2752
|
logger.createLogger("almadar:ui:theme");
|
|
2753
|
-
|
|
2754
|
-
var ThemeScopeContext =
|
|
2753
|
+
React17.createContext(void 0);
|
|
2754
|
+
var ThemeScopeContext = React17.createContext({});
|
|
2755
2755
|
function useThemeScope() {
|
|
2756
|
-
return
|
|
2756
|
+
return React17.useContext(ThemeScopeContext);
|
|
2757
2757
|
}
|
|
2758
2758
|
|
|
2759
2759
|
// lib/pressable.ts
|
|
@@ -2883,7 +2883,7 @@ var positionStyles = {
|
|
|
2883
2883
|
fixed: "fixed",
|
|
2884
2884
|
sticky: "sticky"
|
|
2885
2885
|
};
|
|
2886
|
-
var Box =
|
|
2886
|
+
var Box = React17__namespace.default.forwardRef(
|
|
2887
2887
|
({
|
|
2888
2888
|
padding,
|
|
2889
2889
|
paddingX,
|
|
@@ -2918,20 +2918,20 @@ var Box = React15__namespace.default.forwardRef(
|
|
|
2918
2918
|
const { override: themeOverride } = useThemeScope();
|
|
2919
2919
|
const declaredTheme = rest["data-theme"];
|
|
2920
2920
|
const dataTheme = declaredTheme !== void 0 && themeOverride ? themeOverride : declaredTheme;
|
|
2921
|
-
const handleClick =
|
|
2921
|
+
const handleClick = React17.useCallback((e) => {
|
|
2922
2922
|
if (action) {
|
|
2923
2923
|
e.stopPropagation();
|
|
2924
2924
|
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
2925
2925
|
}
|
|
2926
2926
|
onClick?.(e);
|
|
2927
2927
|
}, [action, actionPayload, eventBus, onClick]);
|
|
2928
|
-
const handleMouseEnter =
|
|
2928
|
+
const handleMouseEnter = React17.useCallback((e) => {
|
|
2929
2929
|
if (hoverEvent) {
|
|
2930
2930
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2931
2931
|
}
|
|
2932
2932
|
onMouseEnter?.(e);
|
|
2933
2933
|
}, [hoverEvent, eventBus, onMouseEnter]);
|
|
2934
|
-
const handleMouseLeave =
|
|
2934
|
+
const handleMouseLeave = React17.useCallback((e) => {
|
|
2935
2935
|
if (hoverEvent) {
|
|
2936
2936
|
eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2937
2937
|
}
|
|
@@ -2939,20 +2939,20 @@ var Box = React15__namespace.default.forwardRef(
|
|
|
2939
2939
|
}, [hoverEvent, eventBus, onMouseLeave]);
|
|
2940
2940
|
const { triggerProps } = useTapReveal({
|
|
2941
2941
|
enabled: tapReveal && !!hoverEvent,
|
|
2942
|
-
onReveal:
|
|
2942
|
+
onReveal: React17.useCallback(() => {
|
|
2943
2943
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
|
|
2944
2944
|
}, [hoverEvent, eventBus]),
|
|
2945
|
-
onDismiss:
|
|
2945
|
+
onDismiss: React17.useCallback(() => {
|
|
2946
2946
|
if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
|
|
2947
2947
|
}, [hoverEvent, eventBus])
|
|
2948
2948
|
});
|
|
2949
|
-
const handlePointerDown =
|
|
2949
|
+
const handlePointerDown = React17.useCallback((e) => {
|
|
2950
2950
|
if (hoverEvent && tapReveal) triggerProps.onPointerDown(e);
|
|
2951
2951
|
onPointerDown?.(e);
|
|
2952
2952
|
}, [hoverEvent, tapReveal, triggerProps, onPointerDown]);
|
|
2953
2953
|
const isClickable = action || onClick;
|
|
2954
2954
|
const actionControl = action && rest.role === void 0 && rest.tabIndex === void 0 ? pressableProps(handleClick) : {};
|
|
2955
|
-
return
|
|
2955
|
+
return React17__namespace.default.createElement(
|
|
2956
2956
|
Component,
|
|
2957
2957
|
{
|
|
2958
2958
|
ref,
|
|
@@ -2991,10 +2991,11 @@ var Box = React15__namespace.default.forwardRef(
|
|
|
2991
2991
|
Box.displayName = "Box";
|
|
2992
2992
|
|
|
2993
2993
|
// lib/domPassthrough.ts
|
|
2994
|
+
var GLOBAL_ATTRIBUTES = /* @__PURE__ */ new Set(["role", "id", "lang", "dir", "tabIndex"]);
|
|
2994
2995
|
function domPassthrough(props) {
|
|
2995
2996
|
const out = {};
|
|
2996
2997
|
for (const [key, value] of Object.entries(props)) {
|
|
2997
|
-
if (key.startsWith("aria-") || key.startsWith("data-") || key
|
|
2998
|
+
if (key.startsWith("aria-") || key.startsWith("data-") || GLOBAL_ATTRIBUTES.has(key)) {
|
|
2998
2999
|
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === void 0) {
|
|
2999
3000
|
out[key] = value;
|
|
3000
3001
|
}
|
|
@@ -3056,7 +3057,7 @@ var Stack = ({
|
|
|
3056
3057
|
};
|
|
3057
3058
|
const isHorizontal = direction === "horizontal";
|
|
3058
3059
|
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";
|
|
3059
|
-
return
|
|
3060
|
+
return React17__namespace.default.createElement(
|
|
3060
3061
|
Component,
|
|
3061
3062
|
{
|
|
3062
3063
|
...domPassthrough(rest),
|
|
@@ -3199,6 +3200,7 @@ var en_default = {
|
|
|
3199
3200
|
"aria.removeFilter": "Remove filter",
|
|
3200
3201
|
"aria.closeDrawer": "Close drawer",
|
|
3201
3202
|
"aria.closePanel": "Close panel",
|
|
3203
|
+
"aria.dockPanel": "Side panel",
|
|
3202
3204
|
"aria.previousImage": "Previous image",
|
|
3203
3205
|
"aria.nextImage": "Next image",
|
|
3204
3206
|
"aria.dismiss": "Dismiss",
|
|
@@ -3220,6 +3222,7 @@ var en_default = {
|
|
|
3220
3222
|
"aria.openMenu": "Open menu",
|
|
3221
3223
|
"aria.closeMenu": "Close menu",
|
|
3222
3224
|
"aria.openSidebar": "Open sidebar",
|
|
3225
|
+
"aria.openRow": "Open item {{position}}",
|
|
3223
3226
|
"sidebar.expand": "Expand sidebar",
|
|
3224
3227
|
"sidebar.collapse": "Collapse sidebar",
|
|
3225
3228
|
"sidebar.close": "Close sidebar",
|
|
@@ -4235,7 +4238,81 @@ var en_default = {
|
|
|
4235
4238
|
"flowCanvas.presetSize": "{{label}} ({{width}}px)",
|
|
4236
4239
|
"avl.breadcrumb.transitionNumber": "Transition #{{n}}",
|
|
4237
4240
|
"orbInspector.pattern": "Pattern",
|
|
4238
|
-
"orbInspector.slotLabel": "slot: {{slot}}"
|
|
4241
|
+
"orbInspector.slotLabel": "slot: {{slot}}",
|
|
4242
|
+
"detailPanel.section.activity": "Activity",
|
|
4243
|
+
"detailPanel.section.lineItems": "Line items",
|
|
4244
|
+
"detailPanel.tab.overview": "Overview",
|
|
4245
|
+
"detailPanel.thread.empty": "No messages yet",
|
|
4246
|
+
"detailPanel.openImage": "Open image",
|
|
4247
|
+
"detailPanel.showImage": "Show image {{index}}",
|
|
4248
|
+
"aria.clearSelection": "Clear selection",
|
|
4249
|
+
"aria.searchOptions": "Search options",
|
|
4250
|
+
"aria.zoomIn": "Zoom in",
|
|
4251
|
+
"aria.zoomOut": "Zoom out",
|
|
4252
|
+
"aria.previousPage": "Previous page",
|
|
4253
|
+
"aria.nextPage": "Next page",
|
|
4254
|
+
"aria.downloadDocument": "Download document",
|
|
4255
|
+
"aria.printDocument": "Print document",
|
|
4256
|
+
"aria.wrapLines": "Wrap lines",
|
|
4257
|
+
"aria.copyCode": "Copy code",
|
|
4258
|
+
"aria.clearInput": "Clear input",
|
|
4259
|
+
"aria.skipToContent": "Skip to content",
|
|
4260
|
+
"aria.mainNavigation": "Main navigation",
|
|
4261
|
+
"aria.carouselSlides": "Slides",
|
|
4262
|
+
"aria.minimap": "Minimap",
|
|
4263
|
+
"aria.canvasScene": "Game scene",
|
|
4264
|
+
"aria.learningCanvas": "Interactive diagram",
|
|
4265
|
+
"aria.scene3d": "3D scene",
|
|
4266
|
+
"aria.graphCanvas": "Graph",
|
|
4267
|
+
"aria.positionedCanvas": "Floor plan",
|
|
4268
|
+
"aria.walkTraitDone": "completed",
|
|
4269
|
+
"aria.walkTraitPending": "pending",
|
|
4270
|
+
"aria.walkGraph": "State graph for {{trait}}: {{from}} to {{to}}",
|
|
4271
|
+
"aria.loading": "Loading",
|
|
4272
|
+
"agentActivity.toolCall": "Called {{tool}}",
|
|
4273
|
+
"agentActivity.toolResult": "{{tool}} returned",
|
|
4274
|
+
"agentActivity.toolRows": "{{count}} rows",
|
|
4275
|
+
"agentActivity.thinking": "Thinking\u2026",
|
|
4276
|
+
"agentActivity.analyzed": "Analyzed your request \u2014 {{organism}}",
|
|
4277
|
+
"agentActivity.renamed": "Rename {{from}} \u2192 {{to}}",
|
|
4278
|
+
"agentActivity.deleted": "Remove {{orbitalName}}",
|
|
4279
|
+
"agentActivity.roster": "Planning {{count}} orbitals",
|
|
4280
|
+
"agentActivity.orbitalStarted": "Working on {{orbitalName}}\u2026",
|
|
4281
|
+
"agentActivity.orbitalStartedSettled": "Started {{orbitalName}}",
|
|
4282
|
+
"agentActivity.orbitalDone": "{{orbitalName}} ready",
|
|
4283
|
+
"agentActivity.orbitalCounts": "{{traitCount}} traits, {{transitionCount}} transitions",
|
|
4284
|
+
"agentActivity.change.orbital-added": "Added {{orbitalName}}",
|
|
4285
|
+
"agentActivity.change.orbital-removed": "Removed {{orbitalName}}",
|
|
4286
|
+
"agentActivity.change.entity-fields-changed": "Changed the data fields of {{orbitalName}}",
|
|
4287
|
+
"agentActivity.change.trait-added": "Added a behavior to {{orbitalName}}",
|
|
4288
|
+
"agentActivity.change.trait-removed": "Removed a behavior from {{orbitalName}}",
|
|
4289
|
+
"agentActivity.change.state-machine-changed": "Changed the flow of {{orbitalName}}",
|
|
4290
|
+
"agentActivity.change.guard-changed": "Changed a rule in {{orbitalName}}",
|
|
4291
|
+
"agentActivity.change.effect-changed": "Changed what {{orbitalName}} does",
|
|
4292
|
+
"agentActivity.change.render-ui-changed": "Changed the design of {{orbitalName}}",
|
|
4293
|
+
"agentActivity.change.event-wiring-changed": "Changed the connections of {{orbitalName}}",
|
|
4294
|
+
"agentActivity.change.page-changed": "Changed the pages of {{orbitalName}}",
|
|
4295
|
+
"agentActivity.change.behavior-composed": "Composed a behavior into {{orbitalName}}",
|
|
4296
|
+
"agentActivity.done": "Done \u2014 {{count}} orbitals ready",
|
|
4297
|
+
"agentActivity.cancelled": "Cancelled",
|
|
4298
|
+
"agentActivity.jump": "Show",
|
|
4299
|
+
"agentActivity.emptyTitle": "No activity yet",
|
|
4300
|
+
"agentActivity.emptyDescription": "Send a message and the agent's work shows up here.",
|
|
4301
|
+
"agentActivity.fileOperation": "{{operation}}",
|
|
4302
|
+
"agentActivity.schemaDiff": "Edited {{filePath}}",
|
|
4303
|
+
"agentActivity.coordinatorDecision": "Chose {{organism}}",
|
|
4304
|
+
"agentActivity.change.trait-config-changed": "Changed the settings of {{orbitalName}}",
|
|
4305
|
+
"agentActivity.change.theme-changed": "Changed the theme of {{orbitalName}}",
|
|
4306
|
+
"agentActivity.llmResponse": "Raw LLM response",
|
|
4307
|
+
"agentActivity.llmDuration": "{{seconds}}s",
|
|
4308
|
+
"agentActivity.llmTokens": "{{prompt}} in / {{completion}} out tokens",
|
|
4309
|
+
"agentActivity.llmResponseLabel": "Response",
|
|
4310
|
+
"agentActivity.llmSystemPrompt": "System prompt",
|
|
4311
|
+
"agentActivity.llmUserPrompt": "User prompt",
|
|
4312
|
+
"agentActivity.llmToolCalls": "Tool calls",
|
|
4313
|
+
"agentActivity.showRawLlm": "Raw LLM",
|
|
4314
|
+
"agentActivity.earlierConversations": "Earlier conversations ({{count}})",
|
|
4315
|
+
"agentActivity.earlierActivity": "Earlier activity"
|
|
4239
4316
|
};
|
|
4240
4317
|
|
|
4241
4318
|
// lib/format.ts
|
|
@@ -4299,7 +4376,7 @@ function formatValue(value, format, fmt = {}) {
|
|
|
4299
4376
|
var INLINE_TEXT_ATTR = "data-inline-text";
|
|
4300
4377
|
var { $meta: _meta2, ...coreMessages2 } = en_default;
|
|
4301
4378
|
var coreLocale2 = coreMessages2;
|
|
4302
|
-
var I18nContext =
|
|
4379
|
+
var I18nContext = React17.createContext({
|
|
4303
4380
|
locale: "en",
|
|
4304
4381
|
direction: "ltr",
|
|
4305
4382
|
t: (key, params) => {
|
|
@@ -4313,13 +4390,12 @@ var I18nContext = React15.createContext({
|
|
|
4313
4390
|
}
|
|
4314
4391
|
});
|
|
4315
4392
|
I18nContext.displayName = "I18nContext";
|
|
4316
|
-
I18nContext.Provider;
|
|
4317
4393
|
function useTranslate() {
|
|
4318
|
-
return
|
|
4394
|
+
return React17.useContext(I18nContext);
|
|
4319
4395
|
}
|
|
4320
4396
|
function useFormatContext() {
|
|
4321
|
-
const { t, locale, currency } =
|
|
4322
|
-
return
|
|
4397
|
+
const { t, locale, currency } = React17.useContext(I18nContext);
|
|
4398
|
+
return React17.useMemo(
|
|
4323
4399
|
() => ({ locale, currency: currency ?? DEFAULT_CURRENCY, booleanLabels: { yes: t("common.yes"), no: t("common.no") } }),
|
|
4324
4400
|
[t, locale, currency]
|
|
4325
4401
|
);
|
|
@@ -4425,7 +4501,7 @@ var Typography = ({
|
|
|
4425
4501
|
if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
|
|
4426
4502
|
body = formatValue(body, format, fmt);
|
|
4427
4503
|
}
|
|
4428
|
-
return
|
|
4504
|
+
return React17__namespace.default.createElement(
|
|
4429
4505
|
Component,
|
|
4430
4506
|
{
|
|
4431
4507
|
...domPassthrough(rest),
|
|
@@ -4457,6 +4533,50 @@ var Typography = ({
|
|
|
4457
4533
|
);
|
|
4458
4534
|
};
|
|
4459
4535
|
Typography.displayName = "Typography";
|
|
4536
|
+
var counts = /* @__PURE__ */ new Map();
|
|
4537
|
+
var keyListeners = /* @__PURE__ */ new Map();
|
|
4538
|
+
var seq = 0;
|
|
4539
|
+
function newPendingKey() {
|
|
4540
|
+
seq += 1;
|
|
4541
|
+
return `pending-${seq}`;
|
|
4542
|
+
}
|
|
4543
|
+
function isPending(key) {
|
|
4544
|
+
return (counts.get(key) ?? 0) > 0;
|
|
4545
|
+
}
|
|
4546
|
+
function subscribePending(key, cb) {
|
|
4547
|
+
let set = keyListeners.get(key);
|
|
4548
|
+
if (!set) {
|
|
4549
|
+
set = /* @__PURE__ */ new Set();
|
|
4550
|
+
keyListeners.set(key, set);
|
|
4551
|
+
}
|
|
4552
|
+
set.add(cb);
|
|
4553
|
+
return () => {
|
|
4554
|
+
set?.delete(cb);
|
|
4555
|
+
if (set && set.size === 0) keyListeners.delete(key);
|
|
4556
|
+
};
|
|
4557
|
+
}
|
|
4558
|
+
var PendingScopeContext = React17.createContext(null);
|
|
4559
|
+
function usePendingAction() {
|
|
4560
|
+
const scope = React17.useContext(PendingScopeContext);
|
|
4561
|
+
const [key, setKey] = React17.useState(null);
|
|
4562
|
+
const pending = React17.useSyncExternalStore(
|
|
4563
|
+
React17.useCallback((cb) => key ? subscribePending(key, cb) : () => {
|
|
4564
|
+
}, [key]),
|
|
4565
|
+
() => key ? isPending(key) : false,
|
|
4566
|
+
() => false
|
|
4567
|
+
);
|
|
4568
|
+
React17.useEffect(() => {
|
|
4569
|
+
if (key && !pending) setKey(null);
|
|
4570
|
+
}, [key, pending]);
|
|
4571
|
+
const activate = React17.useCallback((emit) => {
|
|
4572
|
+
const k = newPendingKey();
|
|
4573
|
+
emit(k);
|
|
4574
|
+
if (!isPending(k)) return;
|
|
4575
|
+
scope?.track(k);
|
|
4576
|
+
setKey(k);
|
|
4577
|
+
}, [scope]);
|
|
4578
|
+
return { pending, activate };
|
|
4579
|
+
}
|
|
4460
4580
|
var DEFAULT_FAMILY = "lucide";
|
|
4461
4581
|
var VALID_FAMILIES = [DEFAULT_FAMILY];
|
|
4462
4582
|
function themeIconFamily() {
|
|
@@ -4539,16 +4659,16 @@ function getThemeVersionSnapshot() {
|
|
|
4539
4659
|
return themeVersion;
|
|
4540
4660
|
}
|
|
4541
4661
|
function useThemeIconStrokeApplies(ref) {
|
|
4542
|
-
const documentApplies =
|
|
4543
|
-
const version =
|
|
4544
|
-
const [scopedApplies, setScopedApplies] =
|
|
4545
|
-
|
|
4662
|
+
const documentApplies = React17.useSyncExternalStore(subscribeIconFamily, getStrokeAppliesSnapshot, () => true);
|
|
4663
|
+
const version = React17.useSyncExternalStore(subscribeIconFamily, getThemeVersionSnapshot, () => 0);
|
|
4664
|
+
const [scopedApplies, setScopedApplies] = React17.useState(null);
|
|
4665
|
+
React17.useLayoutEffect(() => {
|
|
4546
4666
|
if (ref.current) setScopedApplies(familyStrokeApplies(scopedIconFamily(ref.current)));
|
|
4547
4667
|
}, [ref, version]);
|
|
4548
4668
|
return scopedApplies ?? documentApplies;
|
|
4549
4669
|
}
|
|
4550
4670
|
function useIconFamily() {
|
|
4551
|
-
return
|
|
4671
|
+
return React17.useSyncExternalStore(
|
|
4552
4672
|
subscribeIconFamily,
|
|
4553
4673
|
getIconFamilySnapshot,
|
|
4554
4674
|
getIconFamilyServerSnapshot
|
|
@@ -4587,7 +4707,7 @@ function resolveLucide(name) {
|
|
|
4587
4707
|
}
|
|
4588
4708
|
function makeLucideAdapter(name) {
|
|
4589
4709
|
const LucideComp = resolveLucide(name);
|
|
4590
|
-
const Adapter =
|
|
4710
|
+
const Adapter = React17__namespace.default.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
4591
4711
|
LucideComp,
|
|
4592
4712
|
{
|
|
4593
4713
|
ref,
|
|
@@ -4668,15 +4788,16 @@ var Icon = ({
|
|
|
4668
4788
|
animation = "none",
|
|
4669
4789
|
className,
|
|
4670
4790
|
strokeWidth,
|
|
4671
|
-
style
|
|
4791
|
+
style,
|
|
4792
|
+
...rest
|
|
4672
4793
|
}) => {
|
|
4673
4794
|
const directIcon = typeof icon === "string" ? void 0 : icon;
|
|
4674
4795
|
const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
|
|
4675
4796
|
const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
|
|
4676
4797
|
const family = useIconFamily();
|
|
4677
|
-
const svgRef =
|
|
4798
|
+
const svgRef = React17__namespace.default.useRef(null);
|
|
4678
4799
|
const themeStroke = useThemeIconStrokeApplies(svgRef);
|
|
4679
|
-
const RenderedComponent =
|
|
4800
|
+
const RenderedComponent = React17__namespace.default.useMemo(() => {
|
|
4680
4801
|
if (directIcon) return null;
|
|
4681
4802
|
return effectiveName ? resolveIconForFamily(effectiveName) : null;
|
|
4682
4803
|
}, [directIcon, effectiveName, family]);
|
|
@@ -4699,7 +4820,8 @@ var Icon = ({
|
|
|
4699
4820
|
ref: svgRef,
|
|
4700
4821
|
className: composedClassName,
|
|
4701
4822
|
strokeWidth: effectiveStrokeWidth,
|
|
4702
|
-
style: inlineStyle
|
|
4823
|
+
style: inlineStyle,
|
|
4824
|
+
...domPassthrough(rest)
|
|
4703
4825
|
}
|
|
4704
4826
|
);
|
|
4705
4827
|
}
|
|
@@ -4710,7 +4832,8 @@ var Icon = ({
|
|
|
4710
4832
|
ref: svgRef,
|
|
4711
4833
|
className: composedClassName,
|
|
4712
4834
|
strokeWidth: effectiveStrokeWidth,
|
|
4713
|
-
style: inlineStyle
|
|
4835
|
+
style: inlineStyle,
|
|
4836
|
+
...domPassthrough(rest)
|
|
4714
4837
|
}
|
|
4715
4838
|
);
|
|
4716
4839
|
}
|
|
@@ -4721,7 +4844,8 @@ var Icon = ({
|
|
|
4721
4844
|
ref: svgRef,
|
|
4722
4845
|
className: composedClassName,
|
|
4723
4846
|
strokeWidth: effectiveStrokeWidth,
|
|
4724
|
-
style: inlineStyle
|
|
4847
|
+
style: inlineStyle,
|
|
4848
|
+
...domPassthrough(rest)
|
|
4725
4849
|
}
|
|
4726
4850
|
);
|
|
4727
4851
|
};
|
|
@@ -4812,15 +4936,16 @@ function AtlasImage({
|
|
|
4812
4936
|
alt,
|
|
4813
4937
|
className,
|
|
4814
4938
|
style,
|
|
4815
|
-
"aria-hidden": ariaHidden
|
|
4939
|
+
"aria-hidden": ariaHidden,
|
|
4940
|
+
...rest
|
|
4816
4941
|
}) {
|
|
4817
|
-
const [, bump] =
|
|
4818
|
-
const canvasRef =
|
|
4942
|
+
const [, bump] = React17__namespace.useReducer((x) => x + 1, 0);
|
|
4943
|
+
const canvasRef = React17__namespace.useRef(null);
|
|
4819
4944
|
const sliced = isAtlasAsset(asset);
|
|
4820
4945
|
const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
|
|
4821
4946
|
const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
|
|
4822
4947
|
const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
|
|
4823
|
-
|
|
4948
|
+
React17__namespace.useEffect(() => {
|
|
4824
4949
|
const canvas = canvasRef.current;
|
|
4825
4950
|
if (!canvas || !img || !rect) return;
|
|
4826
4951
|
canvas.width = rect.sw;
|
|
@@ -4853,6 +4978,7 @@ function AtlasImage({
|
|
|
4853
4978
|
role: ariaHidden ? void 0 : "img",
|
|
4854
4979
|
"aria-hidden": ariaHidden,
|
|
4855
4980
|
"aria-label": ariaHidden ? void 0 : alt ?? asset.name ?? asset.category ?? "",
|
|
4981
|
+
...domPassthrough(rest),
|
|
4856
4982
|
className: cn("flex-shrink-0", className),
|
|
4857
4983
|
style: boxStyle
|
|
4858
4984
|
}
|
|
@@ -4864,6 +4990,7 @@ function AtlasImage({
|
|
|
4864
4990
|
src: asset.url,
|
|
4865
4991
|
alt: alt ?? asset.name ?? asset.category ?? "",
|
|
4866
4992
|
"aria-hidden": ariaHidden,
|
|
4993
|
+
...domPassthrough(rest),
|
|
4867
4994
|
...typeof w === "number" ? { width: w } : {},
|
|
4868
4995
|
...typeof h === "number" ? { height: h } : {},
|
|
4869
4996
|
className: cn("flex-shrink-0", className),
|
|
@@ -4873,21 +5000,22 @@ function AtlasImage({
|
|
|
4873
5000
|
}
|
|
4874
5001
|
AtlasImage.displayName = "AtlasImage";
|
|
4875
5002
|
logger.createLogger("almadar:ui:navigation");
|
|
4876
|
-
|
|
5003
|
+
React17.createContext(null);
|
|
4877
5004
|
var INERT_API = {
|
|
4878
5005
|
entries: [],
|
|
4879
5006
|
canGoBack: false,
|
|
4880
5007
|
beginNavigate: () => void 0,
|
|
4881
5008
|
back: () => void 0,
|
|
4882
5009
|
goTo: () => void 0,
|
|
4883
|
-
setCurrentLabel: () => void 0
|
|
5010
|
+
setCurrentLabel: () => void 0,
|
|
5011
|
+
registerNavItems: () => void 0
|
|
4884
5012
|
};
|
|
4885
|
-
var NavStackContext =
|
|
5013
|
+
var NavStackContext = React17.createContext(INERT_API);
|
|
4886
5014
|
function isInertNavStack(api) {
|
|
4887
5015
|
return api === INERT_API;
|
|
4888
5016
|
}
|
|
4889
5017
|
function useNavStack() {
|
|
4890
|
-
return
|
|
5018
|
+
return React17.useContext(NavStackContext);
|
|
4891
5019
|
}
|
|
4892
5020
|
|
|
4893
5021
|
// lib/followHref.ts
|
|
@@ -4896,7 +5024,9 @@ function isAbsoluteHref(href) {
|
|
|
4896
5024
|
}
|
|
4897
5025
|
function followHref(href, navStack) {
|
|
4898
5026
|
if (href.startsWith("#")) {
|
|
4899
|
-
document.getElementById(decodeURIComponent(href.slice(1)))
|
|
5027
|
+
const target = document.getElementById(decodeURIComponent(href.slice(1)));
|
|
5028
|
+
target?.scrollIntoView({ behavior: "smooth" });
|
|
5029
|
+
target?.focus({ preventScroll: true });
|
|
4900
5030
|
} else if (isAbsoluteHref(href) || isInertNavStack(navStack)) {
|
|
4901
5031
|
window.location.assign(href);
|
|
4902
5032
|
} else {
|
|
@@ -4980,7 +5110,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
4980
5110
|
const IconComp = value;
|
|
4981
5111
|
return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
|
|
4982
5112
|
}
|
|
4983
|
-
if (
|
|
5113
|
+
if (React17__namespace.default.isValidElement(value)) {
|
|
4984
5114
|
return value;
|
|
4985
5115
|
}
|
|
4986
5116
|
if (typeof value === "object" && value !== null && isIconLike(value)) {
|
|
@@ -4989,7 +5119,7 @@ function resolveIconProp(value, sizeClass) {
|
|
|
4989
5119
|
}
|
|
4990
5120
|
return value;
|
|
4991
5121
|
}
|
|
4992
|
-
var Button =
|
|
5122
|
+
var Button = React17__namespace.default.forwardRef(
|
|
4993
5123
|
({
|
|
4994
5124
|
className,
|
|
4995
5125
|
variant = "primary",
|
|
@@ -5007,22 +5137,42 @@ var Button = React15__namespace.default.forwardRef(
|
|
|
5007
5137
|
href,
|
|
5008
5138
|
children,
|
|
5009
5139
|
onClick,
|
|
5140
|
+
onFocus,
|
|
5141
|
+
onBlur,
|
|
5010
5142
|
"data-testid": dataTestId,
|
|
5011
5143
|
...props
|
|
5012
5144
|
}, ref) => {
|
|
5013
5145
|
const eventBus = useEventBus();
|
|
5014
5146
|
const navStack = useNavStack();
|
|
5147
|
+
const { pending, activate } = usePendingAction();
|
|
5148
|
+
const busy = isLoading || pending;
|
|
5149
|
+
const [focused, setFocused] = React17__namespace.default.useState(false);
|
|
5150
|
+
const inert = Boolean(disabled) || busy;
|
|
5151
|
+
const emitAction = () => {
|
|
5152
|
+
if (!action) return;
|
|
5153
|
+
activate((pendingKey) => eventBus.emit(`UI:${action}`, actionPayload ?? {}, { pendingKey }));
|
|
5154
|
+
};
|
|
5015
5155
|
const leftIconValue = leftIcon || iconProp;
|
|
5016
5156
|
const rightIconValue = rightIcon || iconRightProp;
|
|
5017
5157
|
const px = size === "sm" ? 16 : size === "lg" ? 20 : 16;
|
|
5018
5158
|
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]);
|
|
5019
5159
|
const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
|
|
5020
5160
|
const handleClick = (e) => {
|
|
5021
|
-
if (
|
|
5022
|
-
|
|
5161
|
+
if (inert) {
|
|
5162
|
+
e.preventDefault();
|
|
5163
|
+
return;
|
|
5023
5164
|
}
|
|
5165
|
+
emitAction();
|
|
5024
5166
|
onClick?.(e);
|
|
5025
5167
|
};
|
|
5168
|
+
const handleFocus = (e) => {
|
|
5169
|
+
setFocused(true);
|
|
5170
|
+
onFocus?.(e);
|
|
5171
|
+
};
|
|
5172
|
+
const handleBlur = (e) => {
|
|
5173
|
+
setFocused(false);
|
|
5174
|
+
onBlur?.(e);
|
|
5175
|
+
};
|
|
5026
5176
|
const classes = cn(
|
|
5027
5177
|
"relative inline-flex items-center justify-center gap-2",
|
|
5028
5178
|
"font-medium",
|
|
@@ -5034,23 +5184,26 @@ var Button = React15__namespace.default.forwardRef(
|
|
|
5034
5184
|
"disabled:opacity-50 disabled:cursor-not-allowed",
|
|
5035
5185
|
variantStyles2[variant],
|
|
5036
5186
|
variant === "link" ? "h-auto px-0 text-sm" : sizeStyles[size],
|
|
5187
|
+
busy && "cursor-progress",
|
|
5188
|
+
disabled && focused && "opacity-50 cursor-not-allowed",
|
|
5037
5189
|
className
|
|
5038
5190
|
);
|
|
5039
5191
|
const testId = dataTestId ?? (action ? `action-${action}` : void 0);
|
|
5040
5192
|
const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5041
|
-
|
|
5042
|
-
|
|
5043
|
-
|
|
5193
|
+
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" }) }),
|
|
5194
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("inline-flex items-center justify-center gap-2", busy && "almadar-busy-content"), children: [
|
|
5195
|
+
resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
|
|
5196
|
+
(Array.isArray(children) ? children.length > 0 : Boolean(children)) ? children : label ? /* @__PURE__ */ jsxRuntime.jsx("span", { ...{ [INLINE_TEXT_ATTR]: "label" }, children: label }) : label,
|
|
5197
|
+
resolvedRightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
|
|
5198
|
+
] })
|
|
5044
5199
|
] });
|
|
5045
5200
|
if (href !== void 0 && href !== "") {
|
|
5046
5201
|
const handleLinkClick = (e) => {
|
|
5047
|
-
if (disabled ||
|
|
5202
|
+
if (disabled || busy) {
|
|
5048
5203
|
e.preventDefault();
|
|
5049
5204
|
return;
|
|
5050
5205
|
}
|
|
5051
|
-
|
|
5052
|
-
eventBus.emit(`UI:${action}`, actionPayload ?? {});
|
|
5053
|
-
}
|
|
5206
|
+
emitAction();
|
|
5054
5207
|
if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return;
|
|
5055
5208
|
if (!href.startsWith("#") && isInertNavStack(navStack)) return;
|
|
5056
5209
|
e.preventDefault();
|
|
@@ -5065,7 +5218,8 @@ var Button = React15__namespace.default.forwardRef(
|
|
|
5065
5218
|
title: props.title,
|
|
5066
5219
|
style: props.style,
|
|
5067
5220
|
"aria-label": props["aria-label"],
|
|
5068
|
-
"aria-disabled": disabled ||
|
|
5221
|
+
"aria-disabled": disabled || busy || void 0,
|
|
5222
|
+
"aria-busy": busy || void 0,
|
|
5069
5223
|
className: classes,
|
|
5070
5224
|
onClick: handleLinkClick,
|
|
5071
5225
|
"data-testid": testId,
|
|
@@ -5078,9 +5232,13 @@ var Button = React15__namespace.default.forwardRef(
|
|
|
5078
5232
|
{
|
|
5079
5233
|
ref,
|
|
5080
5234
|
type: "button",
|
|
5081
|
-
disabled: disabled
|
|
5235
|
+
disabled: Boolean(disabled) && !focused,
|
|
5236
|
+
"aria-disabled": inert || void 0,
|
|
5237
|
+
"aria-busy": busy || void 0,
|
|
5082
5238
|
className: classes,
|
|
5083
5239
|
onClick: handleClick,
|
|
5240
|
+
onFocus: handleFocus,
|
|
5241
|
+
onBlur: handleBlur,
|
|
5084
5242
|
...props,
|
|
5085
5243
|
"data-testid": testId,
|
|
5086
5244
|
children: content
|
|
@@ -5126,8 +5284,8 @@ var sizeStyles2 = {
|
|
|
5126
5284
|
md: "px-2.5 py-1 text-sm",
|
|
5127
5285
|
lg: "px-3 py-1.5 text-base"
|
|
5128
5286
|
};
|
|
5129
|
-
var Badge =
|
|
5130
|
-
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
|
|
5287
|
+
var Badge = React17__namespace.default.forwardRef(
|
|
5288
|
+
({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, onClick, ...props }, ref) => {
|
|
5131
5289
|
const { t } = useTranslate();
|
|
5132
5290
|
const iconSizes = {
|
|
5133
5291
|
sm: "h-icon-default w-icon-default",
|
|
@@ -5138,6 +5296,12 @@ var Badge = React15__namespace.default.forwardRef(
|
|
|
5138
5296
|
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;
|
|
5139
5297
|
const hasText = Boolean(children) || amount != null || label !== void 0 && label !== null && label !== "";
|
|
5140
5298
|
if (!hasText && !resolvedIcon && !onRemove) return null;
|
|
5299
|
+
const text = typeof children === "string" || typeof children === "number" ? String(children) : amount != null ? `${label ? `${label} ` : ""}${amount}` : label !== void 0 && label !== null ? String(label) : "";
|
|
5300
|
+
const removeName = removeLabel ?? `${t("common.remove")}${text ? `: ${text}` : ""}`;
|
|
5301
|
+
const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
5302
|
+
resolvedIcon,
|
|
5303
|
+
children || (amount != null ? `${label ? `${label} ` : ""}${amount}` : label ? /* @__PURE__ */ jsxRuntime.jsx("span", { ...{ [INLINE_TEXT_ATTR]: "label" }, children: label }) : label)
|
|
5304
|
+
] });
|
|
5141
5305
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5142
5306
|
"span",
|
|
5143
5307
|
{
|
|
@@ -5151,13 +5315,20 @@ var Badge = React15__namespace.default.forwardRef(
|
|
|
5151
5315
|
),
|
|
5152
5316
|
...props,
|
|
5153
5317
|
children: [
|
|
5154
|
-
|
|
5155
|
-
|
|
5318
|
+
onClick ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5319
|
+
"button",
|
|
5320
|
+
{
|
|
5321
|
+
type: "button",
|
|
5322
|
+
onClick,
|
|
5323
|
+
className: "inline-flex items-center gap-1 rounded-pill focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",
|
|
5324
|
+
children: body
|
|
5325
|
+
}
|
|
5326
|
+
) : body,
|
|
5156
5327
|
onRemove ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
5157
5328
|
"button",
|
|
5158
5329
|
{
|
|
5159
5330
|
type: "button",
|
|
5160
|
-
"aria-label":
|
|
5331
|
+
"aria-label": removeName,
|
|
5161
5332
|
onClick: (e) => {
|
|
5162
5333
|
e.stopPropagation();
|
|
5163
5334
|
onRemove();
|
|
@@ -5177,19 +5348,34 @@ var Badge = React15__namespace.default.forwardRef(
|
|
|
5177
5348
|
}
|
|
5178
5349
|
);
|
|
5179
5350
|
Badge.displayName = "Badge";
|
|
5351
|
+
var SurfaceContext = React17__namespace.default.createContext(false);
|
|
5352
|
+
function SurfaceBoundary({ children }) {
|
|
5353
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SurfaceContext.Provider, { value: true, children });
|
|
5354
|
+
}
|
|
5355
|
+
function useContentSurface(surface = "auto") {
|
|
5356
|
+
const onSurface = React17__namespace.default.useContext(SurfaceContext);
|
|
5357
|
+
const paints = surface === "auto" && !onSurface;
|
|
5358
|
+
return {
|
|
5359
|
+
className: paints ? "surface-content" : void 0,
|
|
5360
|
+
provide: (node) => paints ? /* @__PURE__ */ jsxRuntime.jsx(SurfaceBoundary, { children: node }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: node })
|
|
5361
|
+
};
|
|
5362
|
+
}
|
|
5180
5363
|
var sizeStyles3 = {
|
|
5181
5364
|
xs: "h-3 w-3",
|
|
5182
5365
|
sm: "h-icon-default w-icon-default",
|
|
5183
5366
|
md: "h-6 w-6",
|
|
5184
5367
|
lg: "h-8 w-8"
|
|
5185
5368
|
};
|
|
5186
|
-
var Spinner =
|
|
5369
|
+
var Spinner = React17__namespace.default.forwardRef(
|
|
5187
5370
|
({ className, size = "md", overlay, ...props }, ref) => {
|
|
5371
|
+
const { t } = useTranslate();
|
|
5188
5372
|
if (overlay) {
|
|
5189
5373
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5190
5374
|
"div",
|
|
5191
5375
|
{
|
|
5192
5376
|
ref,
|
|
5377
|
+
role: "status",
|
|
5378
|
+
"aria-label": t("aria.loading"),
|
|
5193
5379
|
...{ [core.LOADING_STATE_MARKER]: "" },
|
|
5194
5380
|
className: cn(
|
|
5195
5381
|
"absolute inset-0 z-10 flex items-center justify-center",
|
|
@@ -5205,6 +5391,8 @@ var Spinner = React15__namespace.default.forwardRef(
|
|
|
5205
5391
|
"div",
|
|
5206
5392
|
{
|
|
5207
5393
|
ref,
|
|
5394
|
+
role: "status",
|
|
5395
|
+
"aria-label": t("aria.loading"),
|
|
5208
5396
|
...{ [core.LOADING_STATE_MARKER]: "" },
|
|
5209
5397
|
className: cn("text-foreground", className),
|
|
5210
5398
|
...props,
|
|
@@ -5216,16 +5404,12 @@ var Spinner = React15__namespace.default.forwardRef(
|
|
|
5216
5404
|
Spinner.displayName = "Spinner";
|
|
5217
5405
|
var variantStyles4 = {
|
|
5218
5406
|
default: [
|
|
5219
|
-
"
|
|
5220
|
-
"border-[length:var(--border-width)] border-border",
|
|
5221
|
-
"shadow-elevation-card",
|
|
5407
|
+
"surface-content",
|
|
5222
5408
|
"transition-all duration-normal",
|
|
5223
5409
|
"hover:shadow-elevation-dialog hover:translate-y-[var(--hover-translate-y)]"
|
|
5224
5410
|
].join(" "),
|
|
5225
5411
|
bordered: [
|
|
5226
|
-
"
|
|
5227
|
-
"border-[length:var(--border-width)] border-border",
|
|
5228
|
-
"shadow-elevation-card",
|
|
5412
|
+
"surface-content",
|
|
5229
5413
|
"transition-all duration-normal",
|
|
5230
5414
|
"hover:shadow-elevation-dialog hover:translate-y-[var(--hover-translate-y)]"
|
|
5231
5415
|
].join(" "),
|
|
@@ -5267,7 +5451,7 @@ var lookStyles = {
|
|
|
5267
5451
|
chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
|
|
5268
5452
|
"tile-image-first": "p-0 overflow-hidden"
|
|
5269
5453
|
};
|
|
5270
|
-
var Card =
|
|
5454
|
+
var Card = React17__namespace.default.forwardRef(
|
|
5271
5455
|
({
|
|
5272
5456
|
className,
|
|
5273
5457
|
variant = "bordered",
|
|
@@ -5310,16 +5494,16 @@ var Card = React15__namespace.default.forwardRef(
|
|
|
5310
5494
|
title && /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "text-lg text-card-foreground heading-voice", children: title }),
|
|
5311
5495
|
subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-muted-foreground mt-1", children: subtitle })
|
|
5312
5496
|
] }),
|
|
5313
|
-
children
|
|
5497
|
+
/* @__PURE__ */ jsxRuntime.jsx(SurfaceBoundary, { children })
|
|
5314
5498
|
]
|
|
5315
5499
|
}
|
|
5316
5500
|
);
|
|
5317
5501
|
}
|
|
5318
5502
|
);
|
|
5319
5503
|
Card.displayName = "Card";
|
|
5320
|
-
var CardHeader =
|
|
5504
|
+
var CardHeader = React17__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
|
|
5321
5505
|
CardHeader.displayName = "CardHeader";
|
|
5322
|
-
var CardTitle =
|
|
5506
|
+
var CardTitle = React17__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5323
5507
|
"h3",
|
|
5324
5508
|
{
|
|
5325
5509
|
ref,
|
|
@@ -5332,11 +5516,11 @@ var CardTitle = React15__namespace.default.forwardRef(({ className, ...props },
|
|
|
5332
5516
|
}
|
|
5333
5517
|
));
|
|
5334
5518
|
CardTitle.displayName = "CardTitle";
|
|
5335
|
-
var CardContent =
|
|
5519
|
+
var CardContent = React17__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
|
|
5336
5520
|
CardContent.displayName = "CardContent";
|
|
5337
5521
|
var CardBody = CardContent;
|
|
5338
5522
|
CardBody.displayName = "CardBody";
|
|
5339
|
-
var CardFooter =
|
|
5523
|
+
var CardFooter = React17__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
5340
5524
|
"div",
|
|
5341
5525
|
{
|
|
5342
5526
|
ref,
|
|
@@ -5354,7 +5538,8 @@ var Divider = ({
|
|
|
5354
5538
|
orientation = "horizontal",
|
|
5355
5539
|
label,
|
|
5356
5540
|
variant = "solid",
|
|
5357
|
-
className
|
|
5541
|
+
className,
|
|
5542
|
+
...rest
|
|
5358
5543
|
}) => {
|
|
5359
5544
|
if (orientation === "vertical") {
|
|
5360
5545
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5365,6 +5550,7 @@ var Divider = ({
|
|
|
5365
5550
|
variantStyles5[variant],
|
|
5366
5551
|
className
|
|
5367
5552
|
),
|
|
5553
|
+
...domPassthrough(rest),
|
|
5368
5554
|
role: "separator",
|
|
5369
5555
|
"aria-orientation": "vertical"
|
|
5370
5556
|
}
|
|
@@ -5375,8 +5561,9 @@ var Divider = ({
|
|
|
5375
5561
|
"div",
|
|
5376
5562
|
{
|
|
5377
5563
|
className: cn("flex items-center gap-3 my-4", className),
|
|
5564
|
+
...domPassthrough(rest),
|
|
5378
5565
|
role: "separator",
|
|
5379
|
-
"aria-label": label,
|
|
5566
|
+
"aria-label": rest["aria-label"] ?? label,
|
|
5380
5567
|
children: [
|
|
5381
5568
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5382
5569
|
"div",
|
|
@@ -5409,6 +5596,7 @@ var Divider = ({
|
|
|
5409
5596
|
variantStyles5[variant],
|
|
5410
5597
|
className
|
|
5411
5598
|
),
|
|
5599
|
+
...domPassthrough(rest),
|
|
5412
5600
|
role: "separator",
|
|
5413
5601
|
"aria-orientation": "horizontal"
|
|
5414
5602
|
}
|
|
@@ -5425,10 +5613,12 @@ var Center = ({
|
|
|
5425
5613
|
className,
|
|
5426
5614
|
style,
|
|
5427
5615
|
children,
|
|
5428
|
-
as: Component = "div"
|
|
5616
|
+
as: Component = "div",
|
|
5617
|
+
...rest
|
|
5429
5618
|
}) => {
|
|
5430
5619
|
const mergedStyle = minHeight ? { minHeight, ...style } : style;
|
|
5431
|
-
return
|
|
5620
|
+
return React17__namespace.default.createElement(Component, {
|
|
5621
|
+
...domPassthrough(rest),
|
|
5432
5622
|
className: cn(
|
|
5433
5623
|
inline ? "inline-flex" : "flex",
|
|
5434
5624
|
horizontal && "justify-center",
|
|
@@ -5460,16 +5650,18 @@ var verticalSizes = {
|
|
|
5460
5650
|
var Spacer = ({
|
|
5461
5651
|
size = "auto",
|
|
5462
5652
|
axis = "horizontal",
|
|
5463
|
-
className
|
|
5653
|
+
className,
|
|
5654
|
+
...rest
|
|
5464
5655
|
}) => {
|
|
5465
5656
|
if (size === "auto") {
|
|
5466
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1", className), "aria-hidden": "true" });
|
|
5657
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1", className), ...domPassthrough(rest), "aria-hidden": "true" });
|
|
5467
5658
|
}
|
|
5468
5659
|
const sizeClass = axis === "horizontal" ? horizontalSizes[size] : verticalSizes[size];
|
|
5469
5660
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5470
5661
|
"div",
|
|
5471
5662
|
{
|
|
5472
5663
|
className: cn("flex-shrink-0", sizeClass, className),
|
|
5664
|
+
...domPassthrough(rest),
|
|
5473
5665
|
"aria-hidden": "true"
|
|
5474
5666
|
}
|
|
5475
5667
|
);
|
|
@@ -5527,12 +5719,13 @@ var Avatar = ({
|
|
|
5527
5719
|
className,
|
|
5528
5720
|
onClick,
|
|
5529
5721
|
action,
|
|
5530
|
-
actionPayload
|
|
5722
|
+
actionPayload,
|
|
5723
|
+
...rest
|
|
5531
5724
|
}) => {
|
|
5532
5725
|
const eventBus = useEventBus();
|
|
5533
5726
|
const { t } = useTranslate();
|
|
5534
|
-
const [imgFailed, setImgFailed] =
|
|
5535
|
-
|
|
5727
|
+
const [imgFailed, setImgFailed] = React17__namespace.default.useState(false);
|
|
5728
|
+
React17__namespace.default.useEffect(() => {
|
|
5536
5729
|
setImgFailed(false);
|
|
5537
5730
|
}, [src]);
|
|
5538
5731
|
const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
|
|
@@ -5548,7 +5741,7 @@ var Avatar = ({
|
|
|
5548
5741
|
onClick?.();
|
|
5549
5742
|
};
|
|
5550
5743
|
const press = pressableProps(isClickable ? handleClick : void 0);
|
|
5551
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative inline-block", children: [
|
|
5744
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative inline-block", ...domPassthrough(rest), children: [
|
|
5552
5745
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5553
5746
|
"div",
|
|
5554
5747
|
{
|
|
@@ -5657,7 +5850,8 @@ var Image2 = ({
|
|
|
5657
5850
|
rounded = "md",
|
|
5658
5851
|
bordered = false,
|
|
5659
5852
|
loading = "lazy",
|
|
5660
|
-
className
|
|
5853
|
+
className,
|
|
5854
|
+
...rest
|
|
5661
5855
|
}) => {
|
|
5662
5856
|
if (!src) return null;
|
|
5663
5857
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5665,7 +5859,8 @@ var Image2 = ({
|
|
|
5665
5859
|
{
|
|
5666
5860
|
src,
|
|
5667
5861
|
alt,
|
|
5668
|
-
|
|
5862
|
+
...domPassthrough(rest),
|
|
5863
|
+
role: alt === "" ? "presentation" : rest.role,
|
|
5669
5864
|
loading,
|
|
5670
5865
|
decoding: "async",
|
|
5671
5866
|
className: cn(
|
|
@@ -5695,7 +5890,7 @@ var alignToStack = {
|
|
|
5695
5890
|
left: "start",
|
|
5696
5891
|
right: "end"
|
|
5697
5892
|
};
|
|
5698
|
-
var SectionHeader = ({ title, subtitle, align = "center", level = 2, className }) => {
|
|
5893
|
+
var SectionHeader = ({ title, subtitle, align = "center", level = 2, className, ...rest }) => {
|
|
5699
5894
|
const variant = levelToVariant[level];
|
|
5700
5895
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5701
5896
|
VStack,
|
|
@@ -5703,6 +5898,7 @@ var SectionHeader = ({ title, subtitle, align = "center", level = 2, className }
|
|
|
5703
5898
|
gap: "sm",
|
|
5704
5899
|
align: alignToStack[align],
|
|
5705
5900
|
className: cn(alignClasses[align], className),
|
|
5901
|
+
...domPassthrough(rest),
|
|
5706
5902
|
children: [
|
|
5707
5903
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant, weight: "bold", children: title }),
|
|
5708
5904
|
subtitle ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "muted", children: subtitle }) : null
|
|
@@ -5729,7 +5925,8 @@ var FeatureCard = ({
|
|
|
5729
5925
|
linkLabel,
|
|
5730
5926
|
variant = "bordered",
|
|
5731
5927
|
size = "md",
|
|
5732
|
-
className
|
|
5928
|
+
className,
|
|
5929
|
+
...rest
|
|
5733
5930
|
}) => {
|
|
5734
5931
|
const { t } = useTranslate();
|
|
5735
5932
|
const renderIcon = () => {
|
|
@@ -5752,6 +5949,7 @@ var FeatureCard = ({
|
|
|
5752
5949
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5753
5950
|
Card,
|
|
5754
5951
|
{
|
|
5952
|
+
...domPassthrough(rest),
|
|
5755
5953
|
variant,
|
|
5756
5954
|
padding: size,
|
|
5757
5955
|
className: cn(
|
|
@@ -5786,6 +5984,14 @@ var gapStyles2 = {
|
|
|
5786
5984
|
lg: "gap-6",
|
|
5787
5985
|
xl: "gap-8"
|
|
5788
5986
|
};
|
|
5987
|
+
var gapLengths = {
|
|
5988
|
+
none: "0px",
|
|
5989
|
+
xs: "0.25rem",
|
|
5990
|
+
sm: "0.5rem",
|
|
5991
|
+
md: "1rem",
|
|
5992
|
+
lg: "1.5rem",
|
|
5993
|
+
xl: "2rem"
|
|
5994
|
+
};
|
|
5789
5995
|
var colStyles = {
|
|
5790
5996
|
1: "grid-cols-1",
|
|
5791
5997
|
2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
|
|
@@ -5800,22 +6006,22 @@ var SimpleGrid = ({
|
|
|
5800
6006
|
cols,
|
|
5801
6007
|
gap = "md",
|
|
5802
6008
|
className,
|
|
5803
|
-
children
|
|
6009
|
+
children,
|
|
6010
|
+
...rest
|
|
5804
6011
|
}) => {
|
|
6012
|
+
const passthrough = domPassthrough(rest);
|
|
5805
6013
|
if (cols) {
|
|
5806
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("grid", colStyles[cols], gapStyles2[gap], className), children });
|
|
6014
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("grid", colStyles[cols], gapStyles2[gap], className), ...passthrough, children });
|
|
5807
6015
|
}
|
|
5808
6016
|
const minWidth = typeof minChildWidth === "number" ? `${minChildWidth}px` : minChildWidth;
|
|
5809
|
-
const templateColumns = maxCols ? `repeat(auto-fit, minmax(min(${minWidth}, 100%), 1fr))` : `repeat(auto-fit, minmax(${minWidth}, 1fr))`;
|
|
6017
|
+
const templateColumns = maxCols ? `repeat(auto-fit, minmax(max(min(${minWidth}, 100%), calc((100% - ${maxCols - 1} * ${gapLengths[gap]}) / ${maxCols})), 1fr))` : `repeat(auto-fit, minmax(${minWidth}, 1fr))`;
|
|
5810
6018
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5811
6019
|
Box,
|
|
5812
6020
|
{
|
|
6021
|
+
...domPassthrough(rest),
|
|
5813
6022
|
className: cn("grid", gapStyles2[gap], className),
|
|
5814
|
-
style: {
|
|
5815
|
-
|
|
5816
|
-
// Limit max columns if specified
|
|
5817
|
-
...maxCols && { maxWidth: `calc(${maxCols} * (${minWidth} + var(--gap, 1rem)))` }
|
|
5818
|
-
},
|
|
6023
|
+
style: { gridTemplateColumns: templateColumns },
|
|
6024
|
+
...passthrough,
|
|
5819
6025
|
children
|
|
5820
6026
|
}
|
|
5821
6027
|
);
|
|
@@ -5825,11 +6031,13 @@ var FeatureGrid = ({
|
|
|
5825
6031
|
items,
|
|
5826
6032
|
columns = 3,
|
|
5827
6033
|
gap = "md",
|
|
5828
|
-
className
|
|
6034
|
+
className,
|
|
6035
|
+
...rest
|
|
5829
6036
|
}) => {
|
|
5830
6037
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
5831
6038
|
SimpleGrid,
|
|
5832
6039
|
{
|
|
6040
|
+
...domPassthrough(rest),
|
|
5833
6041
|
cols: columns,
|
|
5834
6042
|
gap,
|
|
5835
6043
|
className: cn(className),
|
|
@@ -5869,12 +6077,14 @@ var Container = ({
|
|
|
5869
6077
|
center = true,
|
|
5870
6078
|
className,
|
|
5871
6079
|
children,
|
|
5872
|
-
as: Component = "div"
|
|
6080
|
+
as: Component = "div",
|
|
6081
|
+
...rest
|
|
5873
6082
|
}) => {
|
|
5874
6083
|
const resolvedSize = maxWidth ?? size ?? "lg";
|
|
5875
|
-
return
|
|
6084
|
+
return React17__namespace.default.createElement(
|
|
5876
6085
|
Component,
|
|
5877
6086
|
{
|
|
6087
|
+
...domPassthrough(rest),
|
|
5878
6088
|
className: cn(
|
|
5879
6089
|
"w-full",
|
|
5880
6090
|
sizeStyles4[resolvedSize],
|
|
@@ -5887,6 +6097,186 @@ var Container = ({
|
|
|
5887
6097
|
);
|
|
5888
6098
|
};
|
|
5889
6099
|
Container.displayName = "Container";
|
|
6100
|
+
var pulseClass = "almadar-shimmer animate-shimmer rounded-container";
|
|
6101
|
+
function SkeletonLine({ className }) {
|
|
6102
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn(pulseClass, "h-4", className) });
|
|
6103
|
+
}
|
|
6104
|
+
function SkeletonBlock({ className }) {
|
|
6105
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn(pulseClass, className) });
|
|
6106
|
+
}
|
|
6107
|
+
function HeaderSkeleton({ className }) {
|
|
6108
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { className: cn("items-center justify-between px-6 py-5", className), children: [
|
|
6109
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", className: "flex-1", children: [
|
|
6110
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-7 w-48" }),
|
|
6111
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "w-64" })
|
|
6112
|
+
] }),
|
|
6113
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", children: [
|
|
6114
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-9 w-24 rounded-interactive" }),
|
|
6115
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-9 w-32 rounded-interactive" })
|
|
6116
|
+
] })
|
|
6117
|
+
] });
|
|
6118
|
+
}
|
|
6119
|
+
function TableSkeleton({ rows = 5, columns = 4, className }) {
|
|
6120
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "none", className: cn("border border-border rounded-container overflow-hidden", className), children: [
|
|
6121
|
+
/* @__PURE__ */ jsxRuntime.jsx(HStack, { className: "px-4 py-3 bg-muted/30 border-b border-border", children: Array.from({ length: columns }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-4 flex-1 mx-2" }, i)) }),
|
|
6122
|
+
Array.from({ length: rows }).map((_, rowIdx) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6123
|
+
HStack,
|
|
6124
|
+
{
|
|
6125
|
+
className: cn(
|
|
6126
|
+
"px-4 py-3",
|
|
6127
|
+
rowIdx < rows - 1 && "border-b border-border"
|
|
6128
|
+
),
|
|
6129
|
+
children: Array.from({ length: columns }).map((_2, colIdx) => /* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "flex-1 mx-2" }, colIdx))
|
|
6130
|
+
},
|
|
6131
|
+
rowIdx
|
|
6132
|
+
))
|
|
6133
|
+
] });
|
|
6134
|
+
}
|
|
6135
|
+
function FormSkeleton({ fields = 4, className }) {
|
|
6136
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "lg", className: cn("p-6", className), children: [
|
|
6137
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-6 w-40" }),
|
|
6138
|
+
Array.from({ length: fields }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", children: [
|
|
6139
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-4 w-24" }),
|
|
6140
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-10 w-full rounded-interactive" })
|
|
6141
|
+
] }, i)),
|
|
6142
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", className: "justify-end pt-2", children: [
|
|
6143
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-10 w-20 rounded-interactive" }),
|
|
6144
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-10 w-24 rounded-interactive" })
|
|
6145
|
+
] })
|
|
6146
|
+
] });
|
|
6147
|
+
}
|
|
6148
|
+
function CardSkeleton({ className }) {
|
|
6149
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6150
|
+
VStack,
|
|
6151
|
+
{
|
|
6152
|
+
gap: "md",
|
|
6153
|
+
className: cn(
|
|
6154
|
+
"p-5 border border-border rounded-container",
|
|
6155
|
+
className
|
|
6156
|
+
),
|
|
6157
|
+
children: [
|
|
6158
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { className: "items-center", gap: "md", children: [
|
|
6159
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-10 w-10 rounded-full" }),
|
|
6160
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: "flex-1", children: [
|
|
6161
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-5 w-32" }),
|
|
6162
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "w-48" })
|
|
6163
|
+
] })
|
|
6164
|
+
] }),
|
|
6165
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "w-full" }),
|
|
6166
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "w-3/4" }),
|
|
6167
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "pt-2", children: [
|
|
6168
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-6 w-16 rounded-full" }),
|
|
6169
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-6 w-20 rounded-full" })
|
|
6170
|
+
] })
|
|
6171
|
+
]
|
|
6172
|
+
}
|
|
6173
|
+
);
|
|
6174
|
+
}
|
|
6175
|
+
function TextSkeleton({ rows = 3, className }) {
|
|
6176
|
+
return /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "sm", className, children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
6177
|
+
SkeletonLine,
|
|
6178
|
+
{
|
|
6179
|
+
className: i === rows - 1 ? "w-2/3" : "w-full"
|
|
6180
|
+
},
|
|
6181
|
+
i
|
|
6182
|
+
)) });
|
|
6183
|
+
}
|
|
6184
|
+
function ListSkeleton({ rows = 5, className }) {
|
|
6185
|
+
return /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "none", className: cn("border border-border rounded-container overflow-hidden", className), children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", className: cn("items-center px-4 py-3", i < rows - 1 && "border-b border-border"), children: [
|
|
6186
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-10 w-10 rounded-full shrink-0" }),
|
|
6187
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: "flex-1 min-w-0", children: [
|
|
6188
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-4 w-1/3" }),
|
|
6189
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "w-2/3 h-3" })
|
|
6190
|
+
] }),
|
|
6191
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-6 w-16 rounded-full" })
|
|
6192
|
+
] }, i)) });
|
|
6193
|
+
}
|
|
6194
|
+
function GridSkeleton({ rows = 6, className }) {
|
|
6195
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SimpleGrid, { minChildWidth: "260px", gap: "md", className, children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsx(CardSkeleton, {}, i)) });
|
|
6196
|
+
}
|
|
6197
|
+
function StatsSkeleton({ columns = 4, className }) {
|
|
6198
|
+
return /* @__PURE__ */ jsxRuntime.jsx(SimpleGrid, { minChildWidth: "180px", 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: [
|
|
6199
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "w-1/2 h-3" }),
|
|
6200
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-7 w-2/3" })
|
|
6201
|
+
] }, i)) });
|
|
6202
|
+
}
|
|
6203
|
+
function DetailSkeleton({ rows = 6, className }) {
|
|
6204
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "lg", className: cn("p-6 border border-border rounded-container", className), children: [
|
|
6205
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { className: "items-start justify-between", gap: "md", children: [
|
|
6206
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", className: "items-center", children: [
|
|
6207
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-8 w-56" }),
|
|
6208
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-6 w-20 rounded-full" })
|
|
6209
|
+
] }),
|
|
6210
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", children: [
|
|
6211
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-9 w-24 rounded-interactive" }),
|
|
6212
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-9 w-9 rounded-interactive" })
|
|
6213
|
+
] })
|
|
6214
|
+
] }),
|
|
6215
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "md", children: [
|
|
6216
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-20 flex-1" }),
|
|
6217
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-20 flex-1" }),
|
|
6218
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-20 flex-1" })
|
|
6219
|
+
] }),
|
|
6220
|
+
/* @__PURE__ */ jsxRuntime.jsx(SimpleGrid, { minChildWidth: "200px", maxCols: 3, gap: "md", children: Array.from({ length: rows }).map((_, i) => /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", children: [
|
|
6221
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonLine, { className: "w-1/3 h-3" }),
|
|
6222
|
+
/* @__PURE__ */ jsxRuntime.jsx(SkeletonBlock, { className: "h-5 w-2/3" })
|
|
6223
|
+
] }, i)) }),
|
|
6224
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextSkeleton, { rows: 3 })
|
|
6225
|
+
] });
|
|
6226
|
+
}
|
|
6227
|
+
function Skeleton({
|
|
6228
|
+
variant = "text",
|
|
6229
|
+
spec,
|
|
6230
|
+
rows,
|
|
6231
|
+
columns,
|
|
6232
|
+
fields,
|
|
6233
|
+
className,
|
|
6234
|
+
...rest
|
|
6235
|
+
}) {
|
|
6236
|
+
const { t } = useTranslate();
|
|
6237
|
+
const shape = spec !== void 0 ? shapeOfSpec(spec) : { variant, rows, columns, fields };
|
|
6238
|
+
if (shape === null) return null;
|
|
6239
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6240
|
+
Box,
|
|
6241
|
+
{
|
|
6242
|
+
...domPassthrough(rest),
|
|
6243
|
+
role: "status",
|
|
6244
|
+
"aria-busy": "true",
|
|
6245
|
+
"aria-label": rest["aria-label"] ?? t("common.loading"),
|
|
6246
|
+
"data-skeleton": shape.variant,
|
|
6247
|
+
...{ [core.LOADING_STATE_MARKER]: "" },
|
|
6248
|
+
className: "w-full",
|
|
6249
|
+
children: renderVariant(shape.variant, shape.rows, shape.columns, shape.fields, className)
|
|
6250
|
+
}
|
|
6251
|
+
);
|
|
6252
|
+
}
|
|
6253
|
+
function shapeOfSpec(spec) {
|
|
6254
|
+
if (spec === "none") return null;
|
|
6255
|
+
return typeof spec === "string" ? { variant: spec } : spec;
|
|
6256
|
+
}
|
|
6257
|
+
function renderVariant(variant, rows, columns, fields, className) {
|
|
6258
|
+
switch (variant) {
|
|
6259
|
+
case "header":
|
|
6260
|
+
return /* @__PURE__ */ jsxRuntime.jsx(HeaderSkeleton, { className });
|
|
6261
|
+
case "table":
|
|
6262
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TableSkeleton, { rows, columns, className });
|
|
6263
|
+
case "list":
|
|
6264
|
+
return /* @__PURE__ */ jsxRuntime.jsx(ListSkeleton, { rows, className });
|
|
6265
|
+
case "grid":
|
|
6266
|
+
return /* @__PURE__ */ jsxRuntime.jsx(GridSkeleton, { rows, className });
|
|
6267
|
+
case "detail":
|
|
6268
|
+
return /* @__PURE__ */ jsxRuntime.jsx(DetailSkeleton, { rows, className });
|
|
6269
|
+
case "stats":
|
|
6270
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StatsSkeleton, { columns, className });
|
|
6271
|
+
case "form":
|
|
6272
|
+
return /* @__PURE__ */ jsxRuntime.jsx(FormSkeleton, { fields, className });
|
|
6273
|
+
case "card":
|
|
6274
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CardSkeleton, { className });
|
|
6275
|
+
case "text":
|
|
6276
|
+
return /* @__PURE__ */ jsxRuntime.jsx(TextSkeleton, { rows, className });
|
|
6277
|
+
}
|
|
6278
|
+
}
|
|
6279
|
+
Skeleton.displayName = "Skeleton";
|
|
5890
6280
|
var COLOR_VAR = {
|
|
5891
6281
|
primary: "var(--color-primary)",
|
|
5892
6282
|
success: "var(--color-success)",
|
|
@@ -5902,7 +6292,8 @@ var Sparkline = ({
|
|
|
5902
6292
|
height = 32,
|
|
5903
6293
|
strokeWidth = 2,
|
|
5904
6294
|
fill = false,
|
|
5905
|
-
className
|
|
6295
|
+
className,
|
|
6296
|
+
...rest
|
|
5906
6297
|
}) => {
|
|
5907
6298
|
if (data.length < 2) return null;
|
|
5908
6299
|
const pad = 2;
|
|
@@ -5923,7 +6314,8 @@ var Sparkline = ({
|
|
|
5923
6314
|
height,
|
|
5924
6315
|
viewBox: `0 0 ${width} ${height}`,
|
|
5925
6316
|
className: cn("flex-shrink-0", className),
|
|
5926
|
-
|
|
6317
|
+
...domPassthrough(rest),
|
|
6318
|
+
"aria-hidden": rest["aria-hidden"] ?? true,
|
|
5927
6319
|
children: [
|
|
5928
6320
|
areaPath && /* @__PURE__ */ jsxRuntime.jsx("path", { d: areaPath, fill: resolvedColor, opacity: 0.15 }),
|
|
5929
6321
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -5944,7 +6336,7 @@ var Sparkline = ({
|
|
|
5944
6336
|
Sparkline.displayName = "Sparkline";
|
|
5945
6337
|
var lookStyles2 = {
|
|
5946
6338
|
elevated: "",
|
|
5947
|
-
flat: "shadow-none
|
|
6339
|
+
flat: "shadow-none",
|
|
5948
6340
|
"progress-backed": "",
|
|
5949
6341
|
gauge: "",
|
|
5950
6342
|
sparkline: ""
|
|
@@ -5984,11 +6376,15 @@ var StatDisplay = ({
|
|
|
5984
6376
|
look = "elevated",
|
|
5985
6377
|
className,
|
|
5986
6378
|
isLoading = false,
|
|
5987
|
-
|
|
6379
|
+
skeleton = { variant: "stats", columns: 1 },
|
|
6380
|
+
error = null,
|
|
6381
|
+
surface = "auto",
|
|
6382
|
+
...rest
|
|
5988
6383
|
}) => {
|
|
6384
|
+
const contentSurface = useContentSurface(surface);
|
|
5989
6385
|
const eventBus = useEventBus();
|
|
5990
6386
|
const fmt = useFormatContext();
|
|
5991
|
-
const handleClick =
|
|
6387
|
+
const handleClick = React17.useCallback(() => {
|
|
5992
6388
|
if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { metricLabel: label });
|
|
5993
6389
|
}, [clickEvent, eventBus, label]);
|
|
5994
6390
|
const ResolvedIcon = typeof iconProp === "string" ? resolveIcon(iconProp) : typeof iconProp === "function" ? iconProp : null;
|
|
@@ -6006,18 +6402,18 @@ var StatDisplay = ({
|
|
|
6006
6402
|
const trendSuffix = trendFormat === "percent" ? "%" : "";
|
|
6007
6403
|
const trendLabel = showTrend ? `${trendUp ? "\u2191" : "\u2193"} ${trendMagnitude}${trendSuffix}` : "";
|
|
6008
6404
|
if (error) {
|
|
6009
|
-
return
|
|
6405
|
+
return contentSurface.provide(
|
|
6406
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { ...domPassthrough(rest), className: cn(contentSurface.className, "rounded-container", padSizes[size], className), children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "error", children: error.message }) })
|
|
6407
|
+
);
|
|
6010
6408
|
}
|
|
6011
6409
|
if (isLoading) {
|
|
6012
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6013
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-3 bg-muted rounded w-16" }),
|
|
6014
|
-
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-6 bg-muted rounded w-12" })
|
|
6015
|
-
] }) });
|
|
6410
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { spec: skeleton, className });
|
|
6016
6411
|
}
|
|
6017
6412
|
if (compact) {
|
|
6018
6413
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6019
6414
|
HStack,
|
|
6020
6415
|
{
|
|
6416
|
+
...domPassthrough(rest),
|
|
6021
6417
|
gap: "sm",
|
|
6022
6418
|
className: cn("items-center", clickEvent && "cursor-pointer hover:opacity-80", className),
|
|
6023
6419
|
...pressableProps(clickEvent ? handleClick : void 0),
|
|
@@ -6031,39 +6427,42 @@ var StatDisplay = ({
|
|
|
6031
6427
|
}
|
|
6032
6428
|
);
|
|
6033
6429
|
}
|
|
6034
|
-
return
|
|
6035
|
-
|
|
6036
|
-
|
|
6037
|
-
|
|
6038
|
-
|
|
6039
|
-
|
|
6040
|
-
|
|
6041
|
-
|
|
6042
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6043
|
-
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "
|
|
6044
|
-
|
|
6045
|
-
Typography,
|
|
6430
|
+
return contentSurface.provide(
|
|
6431
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6432
|
+
Box,
|
|
6433
|
+
{
|
|
6434
|
+
...domPassthrough(rest),
|
|
6435
|
+
className: cn(contentSurface.className, "rounded-container", padSizes[size], lookStyles2[look], clickEvent && "cursor-pointer hover:shadow-elevation-dialog transition-shadow", className),
|
|
6436
|
+
...pressableProps(clickEvent ? handleClick : void 0),
|
|
6437
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "start", justify: "between", children: [
|
|
6438
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "none", className: "space-y-1 flex-1", children: [
|
|
6439
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "overline", color: "secondary", children: label }),
|
|
6440
|
+
/* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "sm", align: "end", children: [
|
|
6441
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h4", className: cn("", valueSizes[size], variantColor[variant]), children: displayValue }),
|
|
6442
|
+
showTrend && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6443
|
+
Typography,
|
|
6444
|
+
{
|
|
6445
|
+
variant: "caption",
|
|
6446
|
+
className: cn("font-semibold pb-1", trendIsGood ? "text-success" : "text-error"),
|
|
6447
|
+
children: trendLabel
|
|
6448
|
+
}
|
|
6449
|
+
)
|
|
6450
|
+
] }),
|
|
6451
|
+
showTarget && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "mt-2 h-1.5 w-full bg-muted rounded-full overflow-hidden", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
6452
|
+
Box,
|
|
6046
6453
|
{
|
|
6047
|
-
|
|
6048
|
-
|
|
6049
|
-
children: trendLabel
|
|
6454
|
+
className: cn("h-full rounded-full transition-all", `bg-${variant === "default" ? "primary" : variant}`),
|
|
6455
|
+
style: { width: `${targetPct}%` }
|
|
6050
6456
|
}
|
|
6051
|
-
)
|
|
6457
|
+
) })
|
|
6052
6458
|
] }),
|
|
6053
|
-
|
|
6054
|
-
Box,
|
|
6055
|
-
{
|
|
6056
|
-
|
|
6057
|
-
style: { width: `${targetPct}%` }
|
|
6058
|
-
}
|
|
6059
|
-
) })
|
|
6060
|
-
] }),
|
|
6061
|
-
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", align: "end", children: [
|
|
6062
|
-
ResolvedIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("p-3 rounded-container", iconBg), children: /* @__PURE__ */ jsxRuntime.jsx(ResolvedIcon, { className: cn(iconSizes[size], iconColor) }) }),
|
|
6063
|
-
sparklineData && sparklineData.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(Sparkline, { data: sparklineData, color: "auto" })
|
|
6459
|
+
/* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", align: "end", children: [
|
|
6460
|
+
ResolvedIcon && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("p-3 rounded-container", iconBg), children: /* @__PURE__ */ jsxRuntime.jsx(ResolvedIcon, { className: cn(iconSizes[size], iconColor) }) }),
|
|
6461
|
+
sparklineData && sparklineData.length > 1 && /* @__PURE__ */ jsxRuntime.jsx(Sparkline, { data: sparklineData, color: "auto" })
|
|
6462
|
+
] })
|
|
6064
6463
|
] })
|
|
6065
|
-
|
|
6066
|
-
|
|
6464
|
+
}
|
|
6465
|
+
)
|
|
6067
6466
|
);
|
|
6068
6467
|
};
|
|
6069
6468
|
StatDisplay.displayName = "StatDisplay";
|
|
@@ -6077,12 +6476,14 @@ var colorTokenVars = {
|
|
|
6077
6476
|
};
|
|
6078
6477
|
var GradientDivider = ({
|
|
6079
6478
|
color,
|
|
6080
|
-
className
|
|
6479
|
+
className,
|
|
6480
|
+
...rest
|
|
6081
6481
|
}) => {
|
|
6082
6482
|
const centerColor = color ? color in colorTokenVars ? colorTokenVars[color] : color : "var(--color-primary)";
|
|
6083
6483
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
6084
6484
|
Box,
|
|
6085
6485
|
{
|
|
6486
|
+
...domPassthrough(rest),
|
|
6086
6487
|
className: cn("w-full h-px", className),
|
|
6087
6488
|
style: {
|
|
6088
6489
|
background: `linear-gradient(to right, transparent, ${centerColor}, transparent)`
|
|
@@ -6133,17 +6534,18 @@ var AnimatedCounter = ({
|
|
|
6133
6534
|
prefix,
|
|
6134
6535
|
suffix,
|
|
6135
6536
|
format,
|
|
6136
|
-
className
|
|
6537
|
+
className,
|
|
6538
|
+
...rest
|
|
6137
6539
|
}) => {
|
|
6138
6540
|
const fmt = useFormatContext();
|
|
6139
|
-
const ref =
|
|
6541
|
+
const ref = React17.useRef(null);
|
|
6140
6542
|
const parsed = parseValue(value);
|
|
6141
6543
|
const target = parsed.num ?? 0;
|
|
6142
|
-
const [visible, setVisible] =
|
|
6143
|
-
const [display, setDisplay] =
|
|
6144
|
-
const shownRef =
|
|
6145
|
-
const frameRef =
|
|
6146
|
-
|
|
6544
|
+
const [visible, setVisible] = React17.useState(() => typeof IntersectionObserver === "undefined");
|
|
6545
|
+
const [display, setDisplay] = React17.useState(() => typeof IntersectionObserver === "undefined" ? target : 0);
|
|
6546
|
+
const shownRef = React17.useRef(display);
|
|
6547
|
+
const frameRef = React17.useRef(null);
|
|
6548
|
+
React17.useEffect(() => {
|
|
6147
6549
|
if (visible) return;
|
|
6148
6550
|
const el = ref.current;
|
|
6149
6551
|
if (!el || typeof IntersectionObserver === "undefined") {
|
|
@@ -6162,7 +6564,7 @@ var AnimatedCounter = ({
|
|
|
6162
6564
|
observer2.observe(el);
|
|
6163
6565
|
return () => observer2.disconnect();
|
|
6164
6566
|
}, [visible]);
|
|
6165
|
-
|
|
6567
|
+
React17.useEffect(() => {
|
|
6166
6568
|
if (!visible) return;
|
|
6167
6569
|
const from = shownRef.current;
|
|
6168
6570
|
if (from === target || prefersReducedMotion() || typeof requestAnimationFrame === "undefined") {
|
|
@@ -6185,7 +6587,7 @@ var AnimatedCounter = ({
|
|
|
6185
6587
|
};
|
|
6186
6588
|
}, [visible, target, duration]);
|
|
6187
6589
|
const text = parsed.num === null ? parsed.suffix : `${prefix ?? ""}${parsed.prefix}${formatNumber(display, format, parsed.decimals, fmt)}${parsed.suffix}${suffix ?? ""}`;
|
|
6188
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { ref, className: cn("flex flex-col items-center gap-1", className), children: [
|
|
6590
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { ...domPassthrough(rest), ref, className: cn("flex flex-col items-center gap-1", className), children: [
|
|
6189
6591
|
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h2", className: "text-primary tabular-nums", children: text }),
|
|
6190
6592
|
label ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", color: "muted", className: "text-center", children: label }) : null
|
|
6191
6593
|
] });
|
|
@@ -6211,7 +6613,7 @@ var animatedStyles = {
|
|
|
6211
6613
|
"scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
|
|
6212
6614
|
"none": {}
|
|
6213
6615
|
};
|
|
6214
|
-
var AnimatedReveal =
|
|
6616
|
+
var AnimatedReveal = React17__namespace.default.forwardRef(
|
|
6215
6617
|
({
|
|
6216
6618
|
trigger = "scroll",
|
|
6217
6619
|
animation = "fade-up",
|
|
@@ -6226,10 +6628,10 @@ var AnimatedReveal = React15__namespace.default.forwardRef(
|
|
|
6226
6628
|
style,
|
|
6227
6629
|
...props
|
|
6228
6630
|
}, forwardedRef) => {
|
|
6229
|
-
const [isAnimated, setIsAnimated] =
|
|
6230
|
-
const internalRef =
|
|
6231
|
-
const hasAnimated =
|
|
6232
|
-
const setRef =
|
|
6631
|
+
const [isAnimated, setIsAnimated] = React17.useState(false);
|
|
6632
|
+
const internalRef = React17.useRef(null);
|
|
6633
|
+
const hasAnimated = React17.useRef(false);
|
|
6634
|
+
const setRef = React17.useCallback(
|
|
6233
6635
|
(node) => {
|
|
6234
6636
|
internalRef.current = node;
|
|
6235
6637
|
if (typeof forwardedRef === "function") forwardedRef(node);
|
|
@@ -6237,7 +6639,7 @@ var AnimatedReveal = React15__namespace.default.forwardRef(
|
|
|
6237
6639
|
},
|
|
6238
6640
|
[forwardedRef]
|
|
6239
6641
|
);
|
|
6240
|
-
|
|
6642
|
+
React17.useEffect(() => {
|
|
6241
6643
|
if (trigger !== "scroll") return;
|
|
6242
6644
|
const el = internalRef.current;
|
|
6243
6645
|
if (!el) return;
|
|
@@ -6263,7 +6665,7 @@ var AnimatedReveal = React15__namespace.default.forwardRef(
|
|
|
6263
6665
|
setIsAnimated(false);
|
|
6264
6666
|
}
|
|
6265
6667
|
} : void 0;
|
|
6266
|
-
|
|
6668
|
+
React17.useEffect(() => {
|
|
6267
6669
|
if (trigger === "manual" && manualAnimate !== void 0) {
|
|
6268
6670
|
setIsAnimated(manualAnimate);
|
|
6269
6671
|
}
|
|
@@ -6293,9 +6695,9 @@ var AnimatedReveal = React15__namespace.default.forwardRef(
|
|
|
6293
6695
|
);
|
|
6294
6696
|
AnimatedReveal.displayName = "AnimatedReveal";
|
|
6295
6697
|
function useFetchedSvg(src) {
|
|
6296
|
-
const [svg, setSvg] =
|
|
6297
|
-
const cache =
|
|
6298
|
-
|
|
6698
|
+
const [svg, setSvg] = React17.useState(null);
|
|
6699
|
+
const cache = React17.useRef({});
|
|
6700
|
+
React17.useEffect(() => {
|
|
6299
6701
|
if (!src) {
|
|
6300
6702
|
setSvg(null);
|
|
6301
6703
|
return;
|
|
@@ -6364,7 +6766,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
|
|
|
6364
6766
|
el.style.opacity = animate ? "1" : "0";
|
|
6365
6767
|
});
|
|
6366
6768
|
}
|
|
6367
|
-
var AnimatedGraphic =
|
|
6769
|
+
var AnimatedGraphic = React17__namespace.default.forwardRef(
|
|
6368
6770
|
({
|
|
6369
6771
|
src,
|
|
6370
6772
|
svgContent,
|
|
@@ -6383,11 +6785,11 @@ var AnimatedGraphic = React15__namespace.default.forwardRef(
|
|
|
6383
6785
|
children,
|
|
6384
6786
|
...props
|
|
6385
6787
|
}, ref) => {
|
|
6386
|
-
const containerRef =
|
|
6788
|
+
const containerRef = React17.useRef(null);
|
|
6387
6789
|
const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
|
|
6388
6790
|
const resolvedSvg = svgContent ?? fetchedSvg;
|
|
6389
|
-
const prevAnimateRef =
|
|
6390
|
-
const setRef =
|
|
6791
|
+
const prevAnimateRef = React17.useRef(animate);
|
|
6792
|
+
const setRef = React17__namespace.default.useCallback(
|
|
6391
6793
|
(node) => {
|
|
6392
6794
|
containerRef.current = node;
|
|
6393
6795
|
if (typeof ref === "function") ref(node);
|
|
@@ -6395,7 +6797,7 @@ var AnimatedGraphic = React15__namespace.default.forwardRef(
|
|
|
6395
6797
|
},
|
|
6396
6798
|
[ref]
|
|
6397
6799
|
);
|
|
6398
|
-
|
|
6800
|
+
React17.useEffect(() => {
|
|
6399
6801
|
const el = containerRef.current;
|
|
6400
6802
|
if (!el || !strokeColor) return;
|
|
6401
6803
|
const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
|
|
@@ -6403,7 +6805,7 @@ var AnimatedGraphic = React15__namespace.default.forwardRef(
|
|
|
6403
6805
|
p.style.stroke = strokeColor;
|
|
6404
6806
|
});
|
|
6405
6807
|
}, [resolvedSvg, strokeColor]);
|
|
6406
|
-
|
|
6808
|
+
React17.useEffect(() => {
|
|
6407
6809
|
const el = containerRef.current;
|
|
6408
6810
|
if (!el || !resolvedSvg) return;
|
|
6409
6811
|
if (animation === "draw" || animation === "fill") {
|
|
@@ -6428,7 +6830,7 @@ var AnimatedGraphic = React15__namespace.default.forwardRef(
|
|
|
6428
6830
|
});
|
|
6429
6831
|
}
|
|
6430
6832
|
}, [resolvedSvg, animation]);
|
|
6431
|
-
|
|
6833
|
+
React17.useEffect(() => {
|
|
6432
6834
|
const el = containerRef.current;
|
|
6433
6835
|
if (!el) return;
|
|
6434
6836
|
const id = requestAnimationFrame(() => {
|
|
@@ -6938,10 +7340,11 @@ var PatternTile = ({
|
|
|
6938
7340
|
size = 60,
|
|
6939
7341
|
color = "var(--color-primary)",
|
|
6940
7342
|
strokeWidth = 0.5,
|
|
6941
|
-
className
|
|
7343
|
+
className,
|
|
7344
|
+
...rest
|
|
6942
7345
|
}) => {
|
|
6943
7346
|
const Variant = VARIANT_MAP[variant];
|
|
6944
|
-
return /* @__PURE__ */ jsxRuntime.jsx("g", { className, children: /* @__PURE__ */ jsxRuntime.jsx(Variant, { size, color, strokeWidth }) });
|
|
7347
|
+
return /* @__PURE__ */ jsxRuntime.jsx("g", { className, ...domPassthrough(rest), children: /* @__PURE__ */ jsxRuntime.jsx(Variant, { size, color, strokeWidth }) });
|
|
6945
7348
|
};
|
|
6946
7349
|
PatternTile.displayName = "PatternTile";
|
|
6947
7350
|
function getTileDimensions(variant, size) {
|
|
@@ -7228,7 +7631,7 @@ var GeometricPattern = ({
|
|
|
7228
7631
|
children,
|
|
7229
7632
|
className
|
|
7230
7633
|
}) => {
|
|
7231
|
-
const reactId =
|
|
7634
|
+
const reactId = React17.useId();
|
|
7232
7635
|
const patternId = `gp${reactId.replace(/:/g, "")}`;
|
|
7233
7636
|
const size = 60 * scale2;
|
|
7234
7637
|
const stripHeight = 40 * scale2;
|
|
@@ -7463,7 +7866,7 @@ var EdgeDecoration = ({
|
|
|
7463
7866
|
width = 15,
|
|
7464
7867
|
className
|
|
7465
7868
|
}) => {
|
|
7466
|
-
const id =
|
|
7869
|
+
const id = React17.useId();
|
|
7467
7870
|
const Variant = VARIANT_MAP2[variant];
|
|
7468
7871
|
const resolvedColor = color in colorTokenVars2 ? colorTokenVars2[color] : color;
|
|
7469
7872
|
const sides = side === "both" ? ["left", "right"] : [side];
|