@almadar/ui 6.51.2 → 6.52.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.
Files changed (121) hide show
  1. package/dist/{Canvas3DHost-CLC_jXh_.d.ts → Canvas3DHost-CWO0tswb.d.ts} +1 -1
  2. package/dist/{FileTree-RKQqRhIM.d.ts → FileTree-DUi7e7Z8.d.ts} +5 -5
  3. package/dist/{GameAudioProvider-BgWLggIy.d.ts → GameAudioProvider-_hPzjqp-.d.ts} +1 -1
  4. package/dist/{NavStackContext-B-XLULCO.d.ts → NavStackContext-04NLdXsY.d.ts} +8 -0
  5. package/dist/Typography-7FRZOS2H.js +5 -0
  6. package/dist/{UISlotContext-DNM8iXna.d.ts → UISlotContext-CS487Uoc.d.ts} +1 -1
  7. package/dist/{UISlotRenderer-7UYHFW4S.js → UISlotRenderer-CR7SCAMR.js} +8 -8
  8. package/dist/avl/index.cjs +3401 -1590
  9. package/dist/avl/index.d.ts +4 -4
  10. package/dist/avl/index.js +26 -23
  11. package/dist/{chunk-6CFYRP4S.js → chunk-2QB2PXOO.js} +1 -3
  12. package/dist/{chunk-R4V7IZQP.js → chunk-5GCI6C7J.js} +2 -2
  13. package/dist/{chunk-BUEIZY54.js → chunk-BHZG4PDZ.js} +420 -422
  14. package/dist/{chunk-MWPX2O4M.js → chunk-CLSLVFSP.js} +3 -16
  15. package/dist/{chunk-GIPZSCND.js → chunk-EERAGPBW.js} +3078 -1832
  16. package/dist/{chunk-OLZ3EEML.js → chunk-G4GMXYMY.js} +109 -15
  17. package/dist/{chunk-HQDKHLFG.js → chunk-IN3BVW2Z.js} +15 -1
  18. package/dist/{chunk-FGHRVJCI.js → chunk-MSBMVG3B.js} +12 -2
  19. package/dist/{chunk-YKHNK5JH.js → chunk-NCNP2RKZ.js} +11 -4
  20. package/dist/{chunk-T7IH5ABO.js → chunk-QWDKMVLX.js} +69 -17
  21. package/dist/{chunk-NTO555KF.js → chunk-TWHYH25Q.js} +136 -15
  22. package/dist/{chunk-GHXWGQTX.js → chunk-V5AGW2JN.js} +1 -1
  23. package/dist/{chunk-L55SAFKL.js → chunk-WB2A6V3I.js} +31 -1
  24. package/dist/{chunk-JXUYEO7U.js → chunk-XUSSAWKL.js} +7 -1
  25. package/dist/{cn-CO-0rolG.d.ts → cn-ClXGlIOY.d.ts} +2 -2
  26. package/dist/components/index.cjs +4933 -3165
  27. package/dist/components/index.d.ts +499 -416
  28. package/dist/components/index.js +11 -11
  29. package/dist/context/index.cjs +12 -4
  30. package/dist/context/index.d.ts +3 -3
  31. package/dist/context/index.js +2 -2
  32. package/dist/hooks/index.cjs +73 -6
  33. package/dist/hooks/index.d.ts +32 -7
  34. package/dist/hooks/index.js +6 -6
  35. package/dist/lib/drawable/three/index.cjs +33 -2
  36. package/dist/lib/drawable/three/index.d.ts +5 -5
  37. package/dist/lib/drawable/three/index.js +7 -7
  38. package/dist/lib/index.cjs +69 -2
  39. package/dist/lib/index.d.ts +29 -6
  40. package/dist/lib/index.js +5 -5
  41. package/dist/locales/index.cjs +93 -3
  42. package/dist/locales/index.js +63 -3
  43. package/dist/{paintDispatch-CMgOyVjS.d.ts → paintDispatch-DHo3WhaU.d.ts} +4 -4
  44. package/dist/providers/index.cjs +3392 -1607
  45. package/dist/providers/index.d.ts +6 -6
  46. package/dist/providers/index.js +55 -16
  47. package/dist/runtime/index.cjs +3417 -1611
  48. package/dist/runtime/index.d.ts +2 -2
  49. package/dist/runtime/index.js +10 -10
  50. package/dist/ssr/index.cjs +306 -141
  51. package/dist/ssr/index.d.cts +32 -44
  52. package/dist/ssr/index.d.ts +32 -44
  53. package/dist/ssr/index.js +249 -84
  54. package/dist/{themeTokens-CN9WCXQc.d.ts → themeTokens-Ccu7EmGY.d.ts} +4 -2
  55. package/dist/{useUISlots-CwUWM1ra.d.ts → useUISlots-1dk2TR4j.d.ts} +1 -9
  56. package/dist/{verificationRegistry-DBHfOR9y.d.ts → verificationRegistry-BYD3cVhS.d.ts} +1 -1
  57. package/locales/ar.json +31 -1
  58. package/locales/en.json +31 -1
  59. package/locales/sl.json +31 -1
  60. package/package.json +12 -9
  61. package/tailwind-preset.cjs +24 -1
  62. package/themes/_base.css +86 -0
  63. package/themes/_contract.md +1 -0
  64. package/themes/almadar-website.css +2 -0
  65. package/themes/almadar.css +2 -0
  66. package/themes/aqua.css +5 -3
  67. package/themes/arabesque.css +9 -7
  68. package/themes/art-deco.css +5 -3
  69. package/themes/art-nouveau.css +4 -0
  70. package/themes/atelier.css +10 -8
  71. package/themes/bauhaus.css +2 -0
  72. package/themes/bloomberg-dense.css +13 -11
  73. package/themes/blueprint.css +2 -0
  74. package/themes/clay.css +2 -0
  75. package/themes/comic.css +12 -10
  76. package/themes/constructivist.css +2 -0
  77. package/themes/corporate.css +4 -2
  78. package/themes/cyberpunk.css +2 -0
  79. package/themes/frutiger-aero.css +2 -0
  80. package/themes/game-adventure.css +1 -0
  81. package/themes/game-rpg.css +1 -0
  82. package/themes/game-sci-fi.css +1 -0
  83. package/themes/game-ui-pack.css +1 -0
  84. package/themes/gazette.css +10 -8
  85. package/themes/glass.css +17 -15
  86. package/themes/gothic.css +2 -0
  87. package/themes/ink-wash.css +2 -0
  88. package/themes/kawaii.css +2 -0
  89. package/themes/kiosk.css +17 -15
  90. package/themes/linear-clean.css +12 -10
  91. package/themes/luxury.css +2 -0
  92. package/themes/mac-classic.css +2 -0
  93. package/themes/material.css +2 -0
  94. package/themes/memphis.css +2 -0
  95. package/themes/mid-century.css +2 -0
  96. package/themes/minimalist.css +2 -0
  97. package/themes/mudcloth.css +2 -0
  98. package/themes/neon.css +2 -0
  99. package/themes/neumorphic.css +2 -0
  100. package/themes/newsprint.css +2 -0
  101. package/themes/notion-editorial.css +12 -10
  102. package/themes/pixel.css +2 -0
  103. package/themes/prism.css +20 -18
  104. package/themes/retro.css +2 -0
  105. package/themes/risograph.css +2 -0
  106. package/themes/scandi.css +2 -0
  107. package/themes/sketch.css +2 -0
  108. package/themes/solarpunk.css +2 -0
  109. package/themes/steampunk.css +2 -0
  110. package/themes/swiss.css +2 -0
  111. package/themes/terminal.css +8 -6
  112. package/themes/trait-wars.css +2 -0
  113. package/themes/ukiyo-e.css +2 -0
  114. package/themes/vaporwave.css +2 -0
  115. package/themes/victorian.css +2 -0
  116. package/themes/wabi-sabi.css +2 -0
  117. package/themes/win95.css +2 -0
  118. package/themes/wireframe.css +2 -0
  119. package/themes/zine.css +2 -0
  120. package/dist/Typography-2Z3JKWHN.js +0 -5
  121. package/dist/{avl-3d-context-MAt_NuU9.d.ts → avl-3d-context-DLteNEwu.d.ts} +3 -3
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var React15 = require('react');
3
+ var React16 = 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 React15__namespace = /*#__PURE__*/_interopNamespace(React15);
28
+ var React16__namespace = /*#__PURE__*/_interopNamespace(React16);
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 = React15.createContext(null));
2581
+ var EventBusContext = globalThis.__almadarUiEventBusContext ?? (globalThis.__almadarUiEventBusContext = React16.createContext(null));
2582
2582
  var EMPTY_CHAIN = Object.freeze([]);
2583
- var TraitScopeContext = React15.createContext(null);
2583
+ var TraitScopeContext = React16.createContext(null);
2584
2584
  function useTraitScopeChain() {
2585
- const chain = React15.useContext(TraitScopeContext);
2585
+ const chain = React16.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 = React15.useContext(EventBusContext);
2662
+ const context = React16.useContext(EventBusContext);
2663
2663
  const baseBus = context ?? getGlobalEventBus() ?? fallbackEventBus;
2664
2664
  const chain = useTraitScopeChain();
2665
- return React15.useMemo(() => {
2665
+ return React16.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] = React15.useState(false);
2712
- const onRevealRef = React15.useRef(onReveal);
2713
- const onDismissRef = React15.useRef(onDismiss);
2711
+ const [revealed, setRevealed] = React16.useState(false);
2712
+ const onRevealRef = React16.useRef(onReveal);
2713
+ const onDismissRef = React16.useRef(onDismiss);
2714
2714
  onRevealRef.current = onReveal;
2715
2715
  onDismissRef.current = onDismiss;
2716
- const reveal = React15.useCallback(() => {
2716
+ const reveal = React16.useCallback(() => {
2717
2717
  setRevealed((wasRevealed) => {
2718
2718
  if (!wasRevealed) onRevealRef.current?.();
2719
2719
  return true;
2720
2720
  });
2721
2721
  }, []);
2722
- const dismiss = React15.useCallback(() => {
2722
+ const dismiss = React16.useCallback(() => {
2723
2723
  setRevealed((wasRevealed) => {
2724
2724
  if (wasRevealed) onDismissRef.current?.();
2725
2725
  return false;
2726
2726
  });
2727
2727
  }, []);
2728
- const onPointerDown = React15.useCallback(
2728
+ const onPointerDown = React16.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
- React15.useEffect(() => {
2736
+ React16.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
- React15.createContext(void 0);
2754
- var ThemeScopeContext = React15.createContext({});
2753
+ React16.createContext(void 0);
2754
+ var ThemeScopeContext = React16.createContext({});
2755
2755
  function useThemeScope() {
2756
- return React15.useContext(ThemeScopeContext);
2756
+ return React16.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 = React15__namespace.default.forwardRef(
2886
+ var Box = React16__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 = React15.useCallback((e) => {
2921
+ const handleClick = React16.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 = React15.useCallback((e) => {
2928
+ const handleMouseEnter = React16.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 = React15.useCallback((e) => {
2934
+ const handleMouseLeave = React16.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: React15.useCallback(() => {
2942
+ onReveal: React16.useCallback(() => {
2943
2943
  if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: true });
2944
2944
  }, [hoverEvent, eventBus]),
2945
- onDismiss: React15.useCallback(() => {
2945
+ onDismiss: React16.useCallback(() => {
2946
2946
  if (hoverEvent) eventBus.emit(`UI:${hoverEvent}`, { hovered: false });
2947
2947
  }, [hoverEvent, eventBus])
2948
2948
  });
2949
- const handlePointerDown = React15.useCallback((e) => {
2949
+ const handlePointerDown = React16.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 React15__namespace.default.createElement(
2955
+ return React16__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 === "role" || key === "id") {
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 React15__namespace.default.createElement(
3060
+ return React16__namespace.default.createElement(
3060
3061
  Component,
3061
3062
  {
3062
3063
  ...domPassthrough(rest),
@@ -4235,7 +4236,37 @@ var en_default = {
4235
4236
  "flowCanvas.presetSize": "{{label}} ({{width}}px)",
4236
4237
  "avl.breadcrumb.transitionNumber": "Transition #{{n}}",
4237
4238
  "orbInspector.pattern": "Pattern",
4238
- "orbInspector.slotLabel": "slot: {{slot}}"
4239
+ "orbInspector.slotLabel": "slot: {{slot}}",
4240
+ "detailPanel.section.activity": "Activity",
4241
+ "detailPanel.section.lineItems": "Line items",
4242
+ "detailPanel.tab.overview": "Overview",
4243
+ "detailPanel.thread.empty": "No messages yet",
4244
+ "detailPanel.openImage": "Open image",
4245
+ "detailPanel.showImage": "Show image {{index}}",
4246
+ "aria.clearSelection": "Clear selection",
4247
+ "aria.searchOptions": "Search options",
4248
+ "aria.zoomIn": "Zoom in",
4249
+ "aria.zoomOut": "Zoom out",
4250
+ "aria.previousPage": "Previous page",
4251
+ "aria.nextPage": "Next page",
4252
+ "aria.downloadDocument": "Download document",
4253
+ "aria.printDocument": "Print document",
4254
+ "aria.wrapLines": "Wrap lines",
4255
+ "aria.copyCode": "Copy code",
4256
+ "aria.clearInput": "Clear input",
4257
+ "aria.skipToContent": "Skip to content",
4258
+ "aria.mainNavigation": "Main navigation",
4259
+ "aria.carouselSlides": "Slides",
4260
+ "aria.minimap": "Minimap",
4261
+ "aria.canvasScene": "Game scene",
4262
+ "aria.learningCanvas": "Interactive diagram",
4263
+ "aria.scene3d": "3D scene",
4264
+ "aria.graphCanvas": "Graph",
4265
+ "aria.positionedCanvas": "Floor plan",
4266
+ "aria.walkTraitDone": "completed",
4267
+ "aria.walkTraitPending": "pending",
4268
+ "aria.walkGraph": "State graph for {{trait}}: {{from}} to {{to}}",
4269
+ "aria.loading": "Loading"
4239
4270
  };
4240
4271
 
4241
4272
  // lib/format.ts
@@ -4299,7 +4330,7 @@ function formatValue(value, format, fmt = {}) {
4299
4330
  var INLINE_TEXT_ATTR = "data-inline-text";
4300
4331
  var { $meta: _meta2, ...coreMessages2 } = en_default;
4301
4332
  var coreLocale2 = coreMessages2;
4302
- var I18nContext = React15.createContext({
4333
+ var I18nContext = React16.createContext({
4303
4334
  locale: "en",
4304
4335
  direction: "ltr",
4305
4336
  t: (key, params) => {
@@ -4313,13 +4344,12 @@ var I18nContext = React15.createContext({
4313
4344
  }
4314
4345
  });
4315
4346
  I18nContext.displayName = "I18nContext";
4316
- I18nContext.Provider;
4317
4347
  function useTranslate() {
4318
- return React15.useContext(I18nContext);
4348
+ return React16.useContext(I18nContext);
4319
4349
  }
4320
4350
  function useFormatContext() {
4321
- const { t, locale, currency } = React15.useContext(I18nContext);
4322
- return React15.useMemo(
4351
+ const { t, locale, currency } = React16.useContext(I18nContext);
4352
+ return React16.useMemo(
4323
4353
  () => ({ locale, currency: currency ?? DEFAULT_CURRENCY, booleanLabels: { yes: t("common.yes"), no: t("common.no") } }),
4324
4354
  [t, locale, currency]
4325
4355
  );
@@ -4425,7 +4455,7 @@ var Typography = ({
4425
4455
  if (format !== void 0 && format !== "none" && (typeof body === "string" || typeof body === "number" || body instanceof Date)) {
4426
4456
  body = formatValue(body, format, fmt);
4427
4457
  }
4428
- return React15__namespace.default.createElement(
4458
+ return React16__namespace.default.createElement(
4429
4459
  Component,
4430
4460
  {
4431
4461
  ...domPassthrough(rest),
@@ -4457,6 +4487,50 @@ var Typography = ({
4457
4487
  );
4458
4488
  };
4459
4489
  Typography.displayName = "Typography";
4490
+ var counts = /* @__PURE__ */ new Map();
4491
+ var keyListeners = /* @__PURE__ */ new Map();
4492
+ var seq = 0;
4493
+ function newPendingKey() {
4494
+ seq += 1;
4495
+ return `pending-${seq}`;
4496
+ }
4497
+ function isPending(key) {
4498
+ return (counts.get(key) ?? 0) > 0;
4499
+ }
4500
+ function subscribePending(key, cb) {
4501
+ let set = keyListeners.get(key);
4502
+ if (!set) {
4503
+ set = /* @__PURE__ */ new Set();
4504
+ keyListeners.set(key, set);
4505
+ }
4506
+ set.add(cb);
4507
+ return () => {
4508
+ set?.delete(cb);
4509
+ if (set && set.size === 0) keyListeners.delete(key);
4510
+ };
4511
+ }
4512
+ var PendingScopeContext = React16.createContext(null);
4513
+ function usePendingAction() {
4514
+ const scope = React16.useContext(PendingScopeContext);
4515
+ const [key, setKey] = React16.useState(null);
4516
+ const pending = React16.useSyncExternalStore(
4517
+ React16.useCallback((cb) => key ? subscribePending(key, cb) : () => {
4518
+ }, [key]),
4519
+ () => key ? isPending(key) : false,
4520
+ () => false
4521
+ );
4522
+ React16.useEffect(() => {
4523
+ if (key && !pending) setKey(null);
4524
+ }, [key, pending]);
4525
+ const activate = React16.useCallback((emit) => {
4526
+ const k = newPendingKey();
4527
+ emit(k);
4528
+ if (!isPending(k)) return;
4529
+ scope?.track(k);
4530
+ setKey(k);
4531
+ }, [scope]);
4532
+ return { pending, activate };
4533
+ }
4460
4534
  var DEFAULT_FAMILY = "lucide";
4461
4535
  var VALID_FAMILIES = [DEFAULT_FAMILY];
4462
4536
  function themeIconFamily() {
@@ -4539,16 +4613,16 @@ function getThemeVersionSnapshot() {
4539
4613
  return themeVersion;
4540
4614
  }
4541
4615
  function useThemeIconStrokeApplies(ref) {
4542
- const documentApplies = React15.useSyncExternalStore(subscribeIconFamily, getStrokeAppliesSnapshot, () => true);
4543
- const version = React15.useSyncExternalStore(subscribeIconFamily, getThemeVersionSnapshot, () => 0);
4544
- const [scopedApplies, setScopedApplies] = React15.useState(null);
4545
- React15.useLayoutEffect(() => {
4616
+ const documentApplies = React16.useSyncExternalStore(subscribeIconFamily, getStrokeAppliesSnapshot, () => true);
4617
+ const version = React16.useSyncExternalStore(subscribeIconFamily, getThemeVersionSnapshot, () => 0);
4618
+ const [scopedApplies, setScopedApplies] = React16.useState(null);
4619
+ React16.useLayoutEffect(() => {
4546
4620
  if (ref.current) setScopedApplies(familyStrokeApplies(scopedIconFamily(ref.current)));
4547
4621
  }, [ref, version]);
4548
4622
  return scopedApplies ?? documentApplies;
4549
4623
  }
4550
4624
  function useIconFamily() {
4551
- return React15.useSyncExternalStore(
4625
+ return React16.useSyncExternalStore(
4552
4626
  subscribeIconFamily,
4553
4627
  getIconFamilySnapshot,
4554
4628
  getIconFamilyServerSnapshot
@@ -4587,7 +4661,7 @@ function resolveLucide(name) {
4587
4661
  }
4588
4662
  function makeLucideAdapter(name) {
4589
4663
  const LucideComp = resolveLucide(name);
4590
- const Adapter = React15__namespace.default.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4664
+ const Adapter = React16__namespace.default.forwardRef((props, ref) => /* @__PURE__ */ jsxRuntime.jsx(
4591
4665
  LucideComp,
4592
4666
  {
4593
4667
  ref,
@@ -4668,15 +4742,16 @@ var Icon = ({
4668
4742
  animation = "none",
4669
4743
  className,
4670
4744
  strokeWidth,
4671
- style
4745
+ style,
4746
+ ...rest
4672
4747
  }) => {
4673
4748
  const directIcon = typeof icon === "string" ? void 0 : icon;
4674
4749
  const effectiveName = typeof icon === "string" && icon !== "" ? icon : name;
4675
4750
  const effectiveStrokeWidth = strokeWidth != null && strokeWidth > 0 ? strokeWidth : void 0;
4676
4751
  const family = useIconFamily();
4677
- const svgRef = React15__namespace.default.useRef(null);
4752
+ const svgRef = React16__namespace.default.useRef(null);
4678
4753
  const themeStroke = useThemeIconStrokeApplies(svgRef);
4679
- const RenderedComponent = React15__namespace.default.useMemo(() => {
4754
+ const RenderedComponent = React16__namespace.default.useMemo(() => {
4680
4755
  if (directIcon) return null;
4681
4756
  return effectiveName ? resolveIconForFamily(effectiveName) : null;
4682
4757
  }, [directIcon, effectiveName, family]);
@@ -4699,7 +4774,8 @@ var Icon = ({
4699
4774
  ref: svgRef,
4700
4775
  className: composedClassName,
4701
4776
  strokeWidth: effectiveStrokeWidth,
4702
- style: inlineStyle
4777
+ style: inlineStyle,
4778
+ ...domPassthrough(rest)
4703
4779
  }
4704
4780
  );
4705
4781
  }
@@ -4710,7 +4786,8 @@ var Icon = ({
4710
4786
  ref: svgRef,
4711
4787
  className: composedClassName,
4712
4788
  strokeWidth: effectiveStrokeWidth,
4713
- style: inlineStyle
4789
+ style: inlineStyle,
4790
+ ...domPassthrough(rest)
4714
4791
  }
4715
4792
  );
4716
4793
  }
@@ -4721,7 +4798,8 @@ var Icon = ({
4721
4798
  ref: svgRef,
4722
4799
  className: composedClassName,
4723
4800
  strokeWidth: effectiveStrokeWidth,
4724
- style: inlineStyle
4801
+ style: inlineStyle,
4802
+ ...domPassthrough(rest)
4725
4803
  }
4726
4804
  );
4727
4805
  };
@@ -4812,15 +4890,16 @@ function AtlasImage({
4812
4890
  alt,
4813
4891
  className,
4814
4892
  style,
4815
- "aria-hidden": ariaHidden
4893
+ "aria-hidden": ariaHidden,
4894
+ ...rest
4816
4895
  }) {
4817
- const [, bump] = React15__namespace.useReducer((x) => x + 1, 0);
4818
- const canvasRef = React15__namespace.useRef(null);
4896
+ const [, bump] = React16__namespace.useReducer((x) => x + 1, 0);
4897
+ const canvasRef = React16__namespace.useRef(null);
4819
4898
  const sliced = isAtlasAsset(asset);
4820
4899
  const atlas = sliced ? getAtlas(asset.atlas, bump) : void 0;
4821
4900
  const img = sliced && asset?.url ? getSheetImage(asset.url, bump) : null;
4822
4901
  const rect = sliced && atlas ? subRectFor(atlas, asset.sprite) : null;
4823
- React15__namespace.useEffect(() => {
4902
+ React16__namespace.useEffect(() => {
4824
4903
  const canvas = canvasRef.current;
4825
4904
  if (!canvas || !img || !rect) return;
4826
4905
  canvas.width = rect.sw;
@@ -4853,6 +4932,7 @@ function AtlasImage({
4853
4932
  role: ariaHidden ? void 0 : "img",
4854
4933
  "aria-hidden": ariaHidden,
4855
4934
  "aria-label": ariaHidden ? void 0 : alt ?? asset.name ?? asset.category ?? "",
4935
+ ...domPassthrough(rest),
4856
4936
  className: cn("flex-shrink-0", className),
4857
4937
  style: boxStyle
4858
4938
  }
@@ -4864,6 +4944,7 @@ function AtlasImage({
4864
4944
  src: asset.url,
4865
4945
  alt: alt ?? asset.name ?? asset.category ?? "",
4866
4946
  "aria-hidden": ariaHidden,
4947
+ ...domPassthrough(rest),
4867
4948
  ...typeof w === "number" ? { width: w } : {},
4868
4949
  ...typeof h === "number" ? { height: h } : {},
4869
4950
  className: cn("flex-shrink-0", className),
@@ -4873,21 +4954,22 @@ function AtlasImage({
4873
4954
  }
4874
4955
  AtlasImage.displayName = "AtlasImage";
4875
4956
  logger.createLogger("almadar:ui:navigation");
4876
- React15.createContext(null);
4957
+ React16.createContext(null);
4877
4958
  var INERT_API = {
4878
4959
  entries: [],
4879
4960
  canGoBack: false,
4880
4961
  beginNavigate: () => void 0,
4881
4962
  back: () => void 0,
4882
4963
  goTo: () => void 0,
4883
- setCurrentLabel: () => void 0
4964
+ setCurrentLabel: () => void 0,
4965
+ registerNavItems: () => void 0
4884
4966
  };
4885
- var NavStackContext = React15.createContext(INERT_API);
4967
+ var NavStackContext = React16.createContext(INERT_API);
4886
4968
  function isInertNavStack(api) {
4887
4969
  return api === INERT_API;
4888
4970
  }
4889
4971
  function useNavStack() {
4890
- return React15.useContext(NavStackContext);
4972
+ return React16.useContext(NavStackContext);
4891
4973
  }
4892
4974
 
4893
4975
  // lib/followHref.ts
@@ -4896,7 +4978,9 @@ function isAbsoluteHref(href) {
4896
4978
  }
4897
4979
  function followHref(href, navStack) {
4898
4980
  if (href.startsWith("#")) {
4899
- document.getElementById(decodeURIComponent(href.slice(1)))?.scrollIntoView({ behavior: "smooth" });
4981
+ const target = document.getElementById(decodeURIComponent(href.slice(1)));
4982
+ target?.scrollIntoView({ behavior: "smooth" });
4983
+ target?.focus({ preventScroll: true });
4900
4984
  } else if (isAbsoluteHref(href) || isInertNavStack(navStack)) {
4901
4985
  window.location.assign(href);
4902
4986
  } else {
@@ -4980,7 +5064,7 @@ function resolveIconProp(value, sizeClass) {
4980
5064
  const IconComp = value;
4981
5065
  return /* @__PURE__ */ jsxRuntime.jsx(IconComp, { className: sizeClass });
4982
5066
  }
4983
- if (React15__namespace.default.isValidElement(value)) {
5067
+ if (React16__namespace.default.isValidElement(value)) {
4984
5068
  return value;
4985
5069
  }
4986
5070
  if (typeof value === "object" && value !== null && isIconLike(value)) {
@@ -4989,7 +5073,7 @@ function resolveIconProp(value, sizeClass) {
4989
5073
  }
4990
5074
  return value;
4991
5075
  }
4992
- var Button = React15__namespace.default.forwardRef(
5076
+ var Button = React16__namespace.default.forwardRef(
4993
5077
  ({
4994
5078
  className,
4995
5079
  variant = "primary",
@@ -5007,22 +5091,42 @@ var Button = React15__namespace.default.forwardRef(
5007
5091
  href,
5008
5092
  children,
5009
5093
  onClick,
5094
+ onFocus,
5095
+ onBlur,
5010
5096
  "data-testid": dataTestId,
5011
5097
  ...props
5012
5098
  }, ref) => {
5013
5099
  const eventBus = useEventBus();
5014
5100
  const navStack = useNavStack();
5101
+ const { pending, activate } = usePendingAction();
5102
+ const busy = isLoading || pending;
5103
+ const [focused, setFocused] = React16__namespace.default.useState(false);
5104
+ const inert = Boolean(disabled) || busy;
5105
+ const emitAction = () => {
5106
+ if (!action) return;
5107
+ activate((pendingKey) => eventBus.emit(`UI:${action}`, actionPayload ?? {}, { pendingKey }));
5108
+ };
5015
5109
  const leftIconValue = leftIcon || iconProp;
5016
5110
  const rightIconValue = rightIcon || iconRightProp;
5017
5111
  const px = size === "sm" ? 16 : size === "lg" ? 20 : 16;
5018
5112
  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
5113
  const resolvedRightIcon = resolveIconProp(rightIconValue, iconSizeStyles[size]);
5020
5114
  const handleClick = (e) => {
5021
- if (action) {
5022
- eventBus.emit(`UI:${action}`, actionPayload ?? {});
5115
+ if (inert) {
5116
+ e.preventDefault();
5117
+ return;
5023
5118
  }
5119
+ emitAction();
5024
5120
  onClick?.(e);
5025
5121
  };
5122
+ const handleFocus = (e) => {
5123
+ setFocused(true);
5124
+ onFocus?.(e);
5125
+ };
5126
+ const handleBlur = (e) => {
5127
+ setFocused(false);
5128
+ onBlur?.(e);
5129
+ };
5026
5130
  const classes = cn(
5027
5131
  "relative inline-flex items-center justify-center gap-2",
5028
5132
  "font-medium",
@@ -5034,23 +5138,26 @@ var Button = React15__namespace.default.forwardRef(
5034
5138
  "disabled:opacity-50 disabled:cursor-not-allowed",
5035
5139
  variantStyles2[variant],
5036
5140
  variant === "link" ? "h-auto px-0 text-sm" : sizeStyles[size],
5141
+ busy && "cursor-progress",
5142
+ disabled && focused && "opacity-50 cursor-not-allowed",
5037
5143
  className
5038
5144
  );
5039
5145
  const testId = dataTestId ?? (action ? `action-${action}` : void 0);
5040
5146
  const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5041
- isLoading ? /* @__PURE__ */ jsxRuntime.jsx(LucideIcons2.Loader2, { className: "h-icon-default w-icon-default animate-spin" }) : resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
5042
- (Array.isArray(children) ? children.length > 0 : Boolean(children)) ? children : label ? /* @__PURE__ */ jsxRuntime.jsx("span", { ...{ [INLINE_TEXT_ATTR]: "label" }, children: label }) : label,
5043
- resolvedRightIcon && !isLoading && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
5147
+ 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" }) }),
5148
+ /* @__PURE__ */ jsxRuntime.jsxs("span", { className: cn("inline-flex items-center justify-center gap-2", busy && "almadar-busy-content"), children: [
5149
+ resolvedLeftIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: resolvedLeftIcon }),
5150
+ (Array.isArray(children) ? children.length > 0 : Boolean(children)) ? children : label ? /* @__PURE__ */ jsxRuntime.jsx("span", { ...{ [INLINE_TEXT_ATTR]: "label" }, children: label }) : label,
5151
+ resolvedRightIcon && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0", children: resolvedRightIcon })
5152
+ ] })
5044
5153
  ] });
5045
5154
  if (href !== void 0 && href !== "") {
5046
5155
  const handleLinkClick = (e) => {
5047
- if (disabled || isLoading) {
5156
+ if (disabled || busy) {
5048
5157
  e.preventDefault();
5049
5158
  return;
5050
5159
  }
5051
- if (action) {
5052
- eventBus.emit(`UI:${action}`, actionPayload ?? {});
5053
- }
5160
+ emitAction();
5054
5161
  if (e.metaKey || e.ctrlKey || e.shiftKey || e.altKey || e.button !== 0) return;
5055
5162
  if (!href.startsWith("#") && isInertNavStack(navStack)) return;
5056
5163
  e.preventDefault();
@@ -5065,7 +5172,8 @@ var Button = React15__namespace.default.forwardRef(
5065
5172
  title: props.title,
5066
5173
  style: props.style,
5067
5174
  "aria-label": props["aria-label"],
5068
- "aria-disabled": disabled || isLoading || void 0,
5175
+ "aria-disabled": disabled || busy || void 0,
5176
+ "aria-busy": busy || void 0,
5069
5177
  className: classes,
5070
5178
  onClick: handleLinkClick,
5071
5179
  "data-testid": testId,
@@ -5078,9 +5186,13 @@ var Button = React15__namespace.default.forwardRef(
5078
5186
  {
5079
5187
  ref,
5080
5188
  type: "button",
5081
- disabled: disabled || isLoading,
5189
+ disabled: Boolean(disabled) && !focused,
5190
+ "aria-disabled": inert || void 0,
5191
+ "aria-busy": busy || void 0,
5082
5192
  className: classes,
5083
5193
  onClick: handleClick,
5194
+ onFocus: handleFocus,
5195
+ onBlur: handleBlur,
5084
5196
  ...props,
5085
5197
  "data-testid": testId,
5086
5198
  children: content
@@ -5126,8 +5238,8 @@ var sizeStyles2 = {
5126
5238
  md: "px-2.5 py-1 text-sm",
5127
5239
  lg: "px-3 py-1.5 text-base"
5128
5240
  };
5129
- var Badge = React15__namespace.default.forwardRef(
5130
- ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, ...props }, ref) => {
5241
+ var Badge = React16__namespace.default.forwardRef(
5242
+ ({ className, variant = "default", size = "sm", amount, label, icon, iconAsset, children, onRemove, removeLabel, onClick, ...props }, ref) => {
5131
5243
  const { t } = useTranslate();
5132
5244
  const iconSizes = {
5133
5245
  sm: "h-icon-default w-icon-default",
@@ -5138,6 +5250,12 @@ var Badge = React15__namespace.default.forwardRef(
5138
5250
  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
5251
  const hasText = Boolean(children) || amount != null || label !== void 0 && label !== null && label !== "";
5140
5252
  if (!hasText && !resolvedIcon && !onRemove) return null;
5253
+ const text = typeof children === "string" || typeof children === "number" ? String(children) : amount != null ? `${label ? `${label} ` : ""}${amount}` : label !== void 0 && label !== null ? String(label) : "";
5254
+ const removeName = removeLabel ?? `${t("common.remove")}${text ? `: ${text}` : ""}`;
5255
+ const body = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
5256
+ resolvedIcon,
5257
+ children || (amount != null ? `${label ? `${label} ` : ""}${amount}` : label ? /* @__PURE__ */ jsxRuntime.jsx("span", { ...{ [INLINE_TEXT_ATTR]: "label" }, children: label }) : label)
5258
+ ] });
5141
5259
  return /* @__PURE__ */ jsxRuntime.jsxs(
5142
5260
  "span",
5143
5261
  {
@@ -5151,13 +5269,20 @@ var Badge = React15__namespace.default.forwardRef(
5151
5269
  ),
5152
5270
  ...props,
5153
5271
  children: [
5154
- resolvedIcon,
5155
- children || (amount != null ? `${label ? `${label} ` : ""}${amount}` : label ? /* @__PURE__ */ jsxRuntime.jsx("span", { ...{ [INLINE_TEXT_ATTR]: "label" }, children: label }) : label),
5272
+ onClick ? /* @__PURE__ */ jsxRuntime.jsx(
5273
+ "button",
5274
+ {
5275
+ type: "button",
5276
+ onClick,
5277
+ className: "inline-flex items-center gap-1 rounded-pill focus:outline-none focus-visible:ring-1 focus-visible:ring-ring",
5278
+ children: body
5279
+ }
5280
+ ) : body,
5156
5281
  onRemove ? /* @__PURE__ */ jsxRuntime.jsx(
5157
5282
  "button",
5158
5283
  {
5159
5284
  type: "button",
5160
- "aria-label": removeLabel ?? t("common.remove"),
5285
+ "aria-label": removeName,
5161
5286
  onClick: (e) => {
5162
5287
  e.stopPropagation();
5163
5288
  onRemove();
@@ -5183,13 +5308,16 @@ var sizeStyles3 = {
5183
5308
  md: "h-6 w-6",
5184
5309
  lg: "h-8 w-8"
5185
5310
  };
5186
- var Spinner = React15__namespace.default.forwardRef(
5311
+ var Spinner = React16__namespace.default.forwardRef(
5187
5312
  ({ className, size = "md", overlay, ...props }, ref) => {
5313
+ const { t } = useTranslate();
5188
5314
  if (overlay) {
5189
5315
  return /* @__PURE__ */ jsxRuntime.jsx(
5190
5316
  "div",
5191
5317
  {
5192
5318
  ref,
5319
+ role: "status",
5320
+ "aria-label": t("aria.loading"),
5193
5321
  ...{ [core.LOADING_STATE_MARKER]: "" },
5194
5322
  className: cn(
5195
5323
  "absolute inset-0 z-10 flex items-center justify-center",
@@ -5205,6 +5333,8 @@ var Spinner = React15__namespace.default.forwardRef(
5205
5333
  "div",
5206
5334
  {
5207
5335
  ref,
5336
+ role: "status",
5337
+ "aria-label": t("aria.loading"),
5208
5338
  ...{ [core.LOADING_STATE_MARKER]: "" },
5209
5339
  className: cn("text-foreground", className),
5210
5340
  ...props,
@@ -5267,7 +5397,7 @@ var lookStyles = {
5267
5397
  chip: "shadow-none rounded-pill border-[length:var(--border-width)] border-border",
5268
5398
  "tile-image-first": "p-0 overflow-hidden"
5269
5399
  };
5270
- var Card = React15__namespace.default.forwardRef(
5400
+ var Card = React16__namespace.default.forwardRef(
5271
5401
  ({
5272
5402
  className,
5273
5403
  variant = "bordered",
@@ -5317,9 +5447,9 @@ var Card = React15__namespace.default.forwardRef(
5317
5447
  }
5318
5448
  );
5319
5449
  Card.displayName = "Card";
5320
- var CardHeader = React15__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
5450
+ var CardHeader = React16__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("mb-4", className), ...props }));
5321
5451
  CardHeader.displayName = "CardHeader";
5322
- var CardTitle = React15__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5452
+ var CardTitle = React16__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5323
5453
  "h3",
5324
5454
  {
5325
5455
  ref,
@@ -5332,11 +5462,11 @@ var CardTitle = React15__namespace.default.forwardRef(({ className, ...props },
5332
5462
  }
5333
5463
  ));
5334
5464
  CardTitle.displayName = "CardTitle";
5335
- var CardContent = React15__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
5465
+ var CardContent = React16__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx("div", { ref, className: cn("", className), ...props }));
5336
5466
  CardContent.displayName = "CardContent";
5337
5467
  var CardBody = CardContent;
5338
5468
  CardBody.displayName = "CardBody";
5339
- var CardFooter = React15__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5469
+ var CardFooter = React16__namespace.default.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxRuntime.jsx(
5340
5470
  "div",
5341
5471
  {
5342
5472
  ref,
@@ -5354,7 +5484,8 @@ var Divider = ({
5354
5484
  orientation = "horizontal",
5355
5485
  label,
5356
5486
  variant = "solid",
5357
- className
5487
+ className,
5488
+ ...rest
5358
5489
  }) => {
5359
5490
  if (orientation === "vertical") {
5360
5491
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5365,6 +5496,7 @@ var Divider = ({
5365
5496
  variantStyles5[variant],
5366
5497
  className
5367
5498
  ),
5499
+ ...domPassthrough(rest),
5368
5500
  role: "separator",
5369
5501
  "aria-orientation": "vertical"
5370
5502
  }
@@ -5375,8 +5507,9 @@ var Divider = ({
5375
5507
  "div",
5376
5508
  {
5377
5509
  className: cn("flex items-center gap-3 my-4", className),
5510
+ ...domPassthrough(rest),
5378
5511
  role: "separator",
5379
- "aria-label": label,
5512
+ "aria-label": rest["aria-label"] ?? label,
5380
5513
  children: [
5381
5514
  /* @__PURE__ */ jsxRuntime.jsx(
5382
5515
  "div",
@@ -5409,6 +5542,7 @@ var Divider = ({
5409
5542
  variantStyles5[variant],
5410
5543
  className
5411
5544
  ),
5545
+ ...domPassthrough(rest),
5412
5546
  role: "separator",
5413
5547
  "aria-orientation": "horizontal"
5414
5548
  }
@@ -5425,10 +5559,12 @@ var Center = ({
5425
5559
  className,
5426
5560
  style,
5427
5561
  children,
5428
- as: Component = "div"
5562
+ as: Component = "div",
5563
+ ...rest
5429
5564
  }) => {
5430
5565
  const mergedStyle = minHeight ? { minHeight, ...style } : style;
5431
- return React15__namespace.default.createElement(Component, {
5566
+ return React16__namespace.default.createElement(Component, {
5567
+ ...domPassthrough(rest),
5432
5568
  className: cn(
5433
5569
  inline ? "inline-flex" : "flex",
5434
5570
  horizontal && "justify-center",
@@ -5460,16 +5596,18 @@ var verticalSizes = {
5460
5596
  var Spacer = ({
5461
5597
  size = "auto",
5462
5598
  axis = "horizontal",
5463
- className
5599
+ className,
5600
+ ...rest
5464
5601
  }) => {
5465
5602
  if (size === "auto") {
5466
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1", className), "aria-hidden": "true" });
5603
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("flex-1", className), ...domPassthrough(rest), "aria-hidden": "true" });
5467
5604
  }
5468
5605
  const sizeClass = axis === "horizontal" ? horizontalSizes[size] : verticalSizes[size];
5469
5606
  return /* @__PURE__ */ jsxRuntime.jsx(
5470
5607
  "div",
5471
5608
  {
5472
5609
  className: cn("flex-shrink-0", sizeClass, className),
5610
+ ...domPassthrough(rest),
5473
5611
  "aria-hidden": "true"
5474
5612
  }
5475
5613
  );
@@ -5527,12 +5665,13 @@ var Avatar = ({
5527
5665
  className,
5528
5666
  onClick,
5529
5667
  action,
5530
- actionPayload
5668
+ actionPayload,
5669
+ ...rest
5531
5670
  }) => {
5532
5671
  const eventBus = useEventBus();
5533
5672
  const { t } = useTranslate();
5534
- const [imgFailed, setImgFailed] = React15__namespace.default.useState(false);
5535
- React15__namespace.default.useEffect(() => {
5673
+ const [imgFailed, setImgFailed] = React16__namespace.default.useState(false);
5674
+ React16__namespace.default.useEffect(() => {
5536
5675
  setImgFailed(false);
5537
5676
  }, [src]);
5538
5677
  const initials = providedInitials ?? (name ? generateInitials(name) : void 0);
@@ -5548,7 +5687,7 @@ var Avatar = ({
5548
5687
  onClick?.();
5549
5688
  };
5550
5689
  const press = pressableProps(isClickable ? handleClick : void 0);
5551
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative inline-block", children: [
5690
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative inline-block", ...domPassthrough(rest), children: [
5552
5691
  /* @__PURE__ */ jsxRuntime.jsx(
5553
5692
  "div",
5554
5693
  {
@@ -5657,7 +5796,8 @@ var Image2 = ({
5657
5796
  rounded = "md",
5658
5797
  bordered = false,
5659
5798
  loading = "lazy",
5660
- className
5799
+ className,
5800
+ ...rest
5661
5801
  }) => {
5662
5802
  if (!src) return null;
5663
5803
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -5665,7 +5805,8 @@ var Image2 = ({
5665
5805
  {
5666
5806
  src,
5667
5807
  alt,
5668
- role: alt === "" ? "presentation" : void 0,
5808
+ ...domPassthrough(rest),
5809
+ role: alt === "" ? "presentation" : rest.role,
5669
5810
  loading,
5670
5811
  decoding: "async",
5671
5812
  className: cn(
@@ -5695,7 +5836,7 @@ var alignToStack = {
5695
5836
  left: "start",
5696
5837
  right: "end"
5697
5838
  };
5698
- var SectionHeader = ({ title, subtitle, align = "center", level = 2, className }) => {
5839
+ var SectionHeader = ({ title, subtitle, align = "center", level = 2, className, ...rest }) => {
5699
5840
  const variant = levelToVariant[level];
5700
5841
  return /* @__PURE__ */ jsxRuntime.jsxs(
5701
5842
  VStack,
@@ -5703,6 +5844,7 @@ var SectionHeader = ({ title, subtitle, align = "center", level = 2, className }
5703
5844
  gap: "sm",
5704
5845
  align: alignToStack[align],
5705
5846
  className: cn(alignClasses[align], className),
5847
+ ...domPassthrough(rest),
5706
5848
  children: [
5707
5849
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant, weight: "bold", children: title }),
5708
5850
  subtitle ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "muted", children: subtitle }) : null
@@ -5729,7 +5871,8 @@ var FeatureCard = ({
5729
5871
  linkLabel,
5730
5872
  variant = "bordered",
5731
5873
  size = "md",
5732
- className
5874
+ className,
5875
+ ...rest
5733
5876
  }) => {
5734
5877
  const { t } = useTranslate();
5735
5878
  const renderIcon = () => {
@@ -5752,6 +5895,7 @@ var FeatureCard = ({
5752
5895
  return /* @__PURE__ */ jsxRuntime.jsx(
5753
5896
  Card,
5754
5897
  {
5898
+ ...domPassthrough(rest),
5755
5899
  variant,
5756
5900
  padding: size,
5757
5901
  className: cn(
@@ -5786,6 +5930,14 @@ var gapStyles2 = {
5786
5930
  lg: "gap-6",
5787
5931
  xl: "gap-8"
5788
5932
  };
5933
+ var gapLengths = {
5934
+ none: "0px",
5935
+ xs: "0.25rem",
5936
+ sm: "0.5rem",
5937
+ md: "1rem",
5938
+ lg: "1.5rem",
5939
+ xl: "2rem"
5940
+ };
5789
5941
  var colStyles = {
5790
5942
  1: "grid-cols-1",
5791
5943
  2: "grid-cols-1 sm:grid-cols-2 @max-sm:!grid-cols-1",
@@ -5800,22 +5952,22 @@ var SimpleGrid = ({
5800
5952
  cols,
5801
5953
  gap = "md",
5802
5954
  className,
5803
- children
5955
+ children,
5956
+ ...rest
5804
5957
  }) => {
5958
+ const passthrough = domPassthrough(rest);
5805
5959
  if (cols) {
5806
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("grid", colStyles[cols], gapStyles2[gap], className), children });
5960
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("grid", colStyles[cols], gapStyles2[gap], className), ...passthrough, children });
5807
5961
  }
5808
5962
  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))`;
5963
+ 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
5964
  return /* @__PURE__ */ jsxRuntime.jsx(
5811
5965
  Box,
5812
5966
  {
5967
+ ...domPassthrough(rest),
5813
5968
  className: cn("grid", gapStyles2[gap], className),
5814
- style: {
5815
- gridTemplateColumns: templateColumns,
5816
- // Limit max columns if specified
5817
- ...maxCols && { maxWidth: `calc(${maxCols} * (${minWidth} + var(--gap, 1rem)))` }
5818
- },
5969
+ style: { gridTemplateColumns: templateColumns },
5970
+ ...passthrough,
5819
5971
  children
5820
5972
  }
5821
5973
  );
@@ -5825,11 +5977,13 @@ var FeatureGrid = ({
5825
5977
  items,
5826
5978
  columns = 3,
5827
5979
  gap = "md",
5828
- className
5980
+ className,
5981
+ ...rest
5829
5982
  }) => {
5830
5983
  return /* @__PURE__ */ jsxRuntime.jsx(
5831
5984
  SimpleGrid,
5832
5985
  {
5986
+ ...domPassthrough(rest),
5833
5987
  cols: columns,
5834
5988
  gap,
5835
5989
  className: cn(className),
@@ -5869,12 +6023,14 @@ var Container = ({
5869
6023
  center = true,
5870
6024
  className,
5871
6025
  children,
5872
- as: Component = "div"
6026
+ as: Component = "div",
6027
+ ...rest
5873
6028
  }) => {
5874
6029
  const resolvedSize = maxWidth ?? size ?? "lg";
5875
- return React15__namespace.default.createElement(
6030
+ return React16__namespace.default.createElement(
5876
6031
  Component,
5877
6032
  {
6033
+ ...domPassthrough(rest),
5878
6034
  className: cn(
5879
6035
  "w-full",
5880
6036
  sizeStyles4[resolvedSize],
@@ -5902,7 +6058,8 @@ var Sparkline = ({
5902
6058
  height = 32,
5903
6059
  strokeWidth = 2,
5904
6060
  fill = false,
5905
- className
6061
+ className,
6062
+ ...rest
5906
6063
  }) => {
5907
6064
  if (data.length < 2) return null;
5908
6065
  const pad = 2;
@@ -5923,7 +6080,8 @@ var Sparkline = ({
5923
6080
  height,
5924
6081
  viewBox: `0 0 ${width} ${height}`,
5925
6082
  className: cn("flex-shrink-0", className),
5926
- "aria-hidden": "true",
6083
+ ...domPassthrough(rest),
6084
+ "aria-hidden": rest["aria-hidden"] ?? true,
5927
6085
  children: [
5928
6086
  areaPath && /* @__PURE__ */ jsxRuntime.jsx("path", { d: areaPath, fill: resolvedColor, opacity: 0.15 }),
5929
6087
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -5984,11 +6142,12 @@ var StatDisplay = ({
5984
6142
  look = "elevated",
5985
6143
  className,
5986
6144
  isLoading = false,
5987
- error = null
6145
+ error = null,
6146
+ ...rest
5988
6147
  }) => {
5989
6148
  const eventBus = useEventBus();
5990
6149
  const fmt = useFormatContext();
5991
- const handleClick = React15.useCallback(() => {
6150
+ const handleClick = React16.useCallback(() => {
5992
6151
  if (clickEvent) eventBus.emit(`UI:${clickEvent}`, { metricLabel: label });
5993
6152
  }, [clickEvent, eventBus, label]);
5994
6153
  const ResolvedIcon = typeof iconProp === "string" ? resolveIcon(iconProp) : typeof iconProp === "function" ? iconProp : null;
@@ -6006,10 +6165,10 @@ var StatDisplay = ({
6006
6165
  const trendSuffix = trendFormat === "percent" ? "%" : "";
6007
6166
  const trendLabel = showTrend ? `${trendUp ? "\u2191" : "\u2193"} ${trendMagnitude}${trendSuffix}` : "";
6008
6167
  if (error) {
6009
- return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn(padSizes[size], className), children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "error", children: error.message }) });
6168
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { ...domPassthrough(rest), className: cn(padSizes[size], className), children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "error", children: error.message }) });
6010
6169
  }
6011
6170
  if (isLoading) {
6012
- return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn(padSizes[size], className), children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", className: "animate-pulse", children: [
6171
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { ...domPassthrough(rest), className: cn(padSizes[size], className), children: /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "sm", className: "animate-pulse", children: [
6013
6172
  /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-3 bg-muted rounded w-16" }),
6014
6173
  /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-6 bg-muted rounded w-12" })
6015
6174
  ] }) });
@@ -6018,6 +6177,7 @@ var StatDisplay = ({
6018
6177
  return /* @__PURE__ */ jsxRuntime.jsxs(
6019
6178
  HStack,
6020
6179
  {
6180
+ ...domPassthrough(rest),
6021
6181
  gap: "sm",
6022
6182
  className: cn("items-center", clickEvent && "cursor-pointer hover:opacity-80", className),
6023
6183
  ...pressableProps(clickEvent ? handleClick : void 0),
@@ -6034,6 +6194,7 @@ var StatDisplay = ({
6034
6194
  return /* @__PURE__ */ jsxRuntime.jsx(
6035
6195
  Card,
6036
6196
  {
6197
+ ...domPassthrough(rest),
6037
6198
  className: cn(padSizes[size], lookStyles2[look], clickEvent && "cursor-pointer hover:shadow-elevation-dialog transition-shadow", className),
6038
6199
  ...pressableProps(clickEvent ? handleClick : void 0),
6039
6200
  children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { align: "start", justify: "between", children: [
@@ -6077,12 +6238,14 @@ var colorTokenVars = {
6077
6238
  };
6078
6239
  var GradientDivider = ({
6079
6240
  color,
6080
- className
6241
+ className,
6242
+ ...rest
6081
6243
  }) => {
6082
6244
  const centerColor = color ? color in colorTokenVars ? colorTokenVars[color] : color : "var(--color-primary)";
6083
6245
  return /* @__PURE__ */ jsxRuntime.jsx(
6084
6246
  Box,
6085
6247
  {
6248
+ ...domPassthrough(rest),
6086
6249
  className: cn("w-full h-px", className),
6087
6250
  style: {
6088
6251
  background: `linear-gradient(to right, transparent, ${centerColor}, transparent)`
@@ -6133,17 +6296,18 @@ var AnimatedCounter = ({
6133
6296
  prefix,
6134
6297
  suffix,
6135
6298
  format,
6136
- className
6299
+ className,
6300
+ ...rest
6137
6301
  }) => {
6138
6302
  const fmt = useFormatContext();
6139
- const ref = React15.useRef(null);
6303
+ const ref = React16.useRef(null);
6140
6304
  const parsed = parseValue(value);
6141
6305
  const target = parsed.num ?? 0;
6142
- const [visible, setVisible] = React15.useState(() => typeof IntersectionObserver === "undefined");
6143
- const [display, setDisplay] = React15.useState(() => typeof IntersectionObserver === "undefined" ? target : 0);
6144
- const shownRef = React15.useRef(display);
6145
- const frameRef = React15.useRef(null);
6146
- React15.useEffect(() => {
6306
+ const [visible, setVisible] = React16.useState(() => typeof IntersectionObserver === "undefined");
6307
+ const [display, setDisplay] = React16.useState(() => typeof IntersectionObserver === "undefined" ? target : 0);
6308
+ const shownRef = React16.useRef(display);
6309
+ const frameRef = React16.useRef(null);
6310
+ React16.useEffect(() => {
6147
6311
  if (visible) return;
6148
6312
  const el = ref.current;
6149
6313
  if (!el || typeof IntersectionObserver === "undefined") {
@@ -6162,7 +6326,7 @@ var AnimatedCounter = ({
6162
6326
  observer2.observe(el);
6163
6327
  return () => observer2.disconnect();
6164
6328
  }, [visible]);
6165
- React15.useEffect(() => {
6329
+ React16.useEffect(() => {
6166
6330
  if (!visible) return;
6167
6331
  const from = shownRef.current;
6168
6332
  if (from === target || prefersReducedMotion() || typeof requestAnimationFrame === "undefined") {
@@ -6185,7 +6349,7 @@ var AnimatedCounter = ({
6185
6349
  };
6186
6350
  }, [visible, target, duration]);
6187
6351
  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: [
6352
+ return /* @__PURE__ */ jsxRuntime.jsxs(Box, { ...domPassthrough(rest), ref, className: cn("flex flex-col items-center gap-1", className), children: [
6189
6353
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h2", className: "text-primary tabular-nums", children: text }),
6190
6354
  label ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", color: "muted", className: "text-center", children: label }) : null
6191
6355
  ] });
@@ -6211,7 +6375,7 @@ var animatedStyles = {
6211
6375
  "scale-up": { opacity: 1, transform: "scale(1) translateY(0)" },
6212
6376
  "none": {}
6213
6377
  };
6214
- var AnimatedReveal = React15__namespace.default.forwardRef(
6378
+ var AnimatedReveal = React16__namespace.default.forwardRef(
6215
6379
  ({
6216
6380
  trigger = "scroll",
6217
6381
  animation = "fade-up",
@@ -6226,10 +6390,10 @@ var AnimatedReveal = React15__namespace.default.forwardRef(
6226
6390
  style,
6227
6391
  ...props
6228
6392
  }, forwardedRef) => {
6229
- const [isAnimated, setIsAnimated] = React15.useState(false);
6230
- const internalRef = React15.useRef(null);
6231
- const hasAnimated = React15.useRef(false);
6232
- const setRef = React15.useCallback(
6393
+ const [isAnimated, setIsAnimated] = React16.useState(false);
6394
+ const internalRef = React16.useRef(null);
6395
+ const hasAnimated = React16.useRef(false);
6396
+ const setRef = React16.useCallback(
6233
6397
  (node) => {
6234
6398
  internalRef.current = node;
6235
6399
  if (typeof forwardedRef === "function") forwardedRef(node);
@@ -6237,7 +6401,7 @@ var AnimatedReveal = React15__namespace.default.forwardRef(
6237
6401
  },
6238
6402
  [forwardedRef]
6239
6403
  );
6240
- React15.useEffect(() => {
6404
+ React16.useEffect(() => {
6241
6405
  if (trigger !== "scroll") return;
6242
6406
  const el = internalRef.current;
6243
6407
  if (!el) return;
@@ -6263,7 +6427,7 @@ var AnimatedReveal = React15__namespace.default.forwardRef(
6263
6427
  setIsAnimated(false);
6264
6428
  }
6265
6429
  } : void 0;
6266
- React15.useEffect(() => {
6430
+ React16.useEffect(() => {
6267
6431
  if (trigger === "manual" && manualAnimate !== void 0) {
6268
6432
  setIsAnimated(manualAnimate);
6269
6433
  }
@@ -6293,9 +6457,9 @@ var AnimatedReveal = React15__namespace.default.forwardRef(
6293
6457
  );
6294
6458
  AnimatedReveal.displayName = "AnimatedReveal";
6295
6459
  function useFetchedSvg(src) {
6296
- const [svg, setSvg] = React15.useState(null);
6297
- const cache = React15.useRef({});
6298
- React15.useEffect(() => {
6460
+ const [svg, setSvg] = React16.useState(null);
6461
+ const cache = React16.useRef({});
6462
+ React16.useEffect(() => {
6299
6463
  if (!src) {
6300
6464
  setSvg(null);
6301
6465
  return;
@@ -6364,7 +6528,7 @@ function applyMorphAnimation(container, animate, duration, delay, easing) {
6364
6528
  el.style.opacity = animate ? "1" : "0";
6365
6529
  });
6366
6530
  }
6367
- var AnimatedGraphic = React15__namespace.default.forwardRef(
6531
+ var AnimatedGraphic = React16__namespace.default.forwardRef(
6368
6532
  ({
6369
6533
  src,
6370
6534
  svgContent,
@@ -6383,11 +6547,11 @@ var AnimatedGraphic = React15__namespace.default.forwardRef(
6383
6547
  children,
6384
6548
  ...props
6385
6549
  }, ref) => {
6386
- const containerRef = React15.useRef(null);
6550
+ const containerRef = React16.useRef(null);
6387
6551
  const fetchedSvg = useFetchedSvg(svgContent ? void 0 : src);
6388
6552
  const resolvedSvg = svgContent ?? fetchedSvg;
6389
- const prevAnimateRef = React15.useRef(animate);
6390
- const setRef = React15__namespace.default.useCallback(
6553
+ const prevAnimateRef = React16.useRef(animate);
6554
+ const setRef = React16__namespace.default.useCallback(
6391
6555
  (node) => {
6392
6556
  containerRef.current = node;
6393
6557
  if (typeof ref === "function") ref(node);
@@ -6395,7 +6559,7 @@ var AnimatedGraphic = React15__namespace.default.forwardRef(
6395
6559
  },
6396
6560
  [ref]
6397
6561
  );
6398
- React15.useEffect(() => {
6562
+ React16.useEffect(() => {
6399
6563
  const el = containerRef.current;
6400
6564
  if (!el || !strokeColor) return;
6401
6565
  const paths = el.querySelectorAll("path, line, polyline, polygon, circle, ellipse, rect");
@@ -6403,7 +6567,7 @@ var AnimatedGraphic = React15__namespace.default.forwardRef(
6403
6567
  p.style.stroke = strokeColor;
6404
6568
  });
6405
6569
  }, [resolvedSvg, strokeColor]);
6406
- React15.useEffect(() => {
6570
+ React16.useEffect(() => {
6407
6571
  const el = containerRef.current;
6408
6572
  if (!el || !resolvedSvg) return;
6409
6573
  if (animation === "draw" || animation === "fill") {
@@ -6428,7 +6592,7 @@ var AnimatedGraphic = React15__namespace.default.forwardRef(
6428
6592
  });
6429
6593
  }
6430
6594
  }, [resolvedSvg, animation]);
6431
- React15.useEffect(() => {
6595
+ React16.useEffect(() => {
6432
6596
  const el = containerRef.current;
6433
6597
  if (!el) return;
6434
6598
  const id = requestAnimationFrame(() => {
@@ -6938,10 +7102,11 @@ var PatternTile = ({
6938
7102
  size = 60,
6939
7103
  color = "var(--color-primary)",
6940
7104
  strokeWidth = 0.5,
6941
- className
7105
+ className,
7106
+ ...rest
6942
7107
  }) => {
6943
7108
  const Variant = VARIANT_MAP[variant];
6944
- return /* @__PURE__ */ jsxRuntime.jsx("g", { className, children: /* @__PURE__ */ jsxRuntime.jsx(Variant, { size, color, strokeWidth }) });
7109
+ return /* @__PURE__ */ jsxRuntime.jsx("g", { className, ...domPassthrough(rest), children: /* @__PURE__ */ jsxRuntime.jsx(Variant, { size, color, strokeWidth }) });
6945
7110
  };
6946
7111
  PatternTile.displayName = "PatternTile";
6947
7112
  function getTileDimensions(variant, size) {
@@ -7228,7 +7393,7 @@ var GeometricPattern = ({
7228
7393
  children,
7229
7394
  className
7230
7395
  }) => {
7231
- const reactId = React15.useId();
7396
+ const reactId = React16.useId();
7232
7397
  const patternId = `gp${reactId.replace(/:/g, "")}`;
7233
7398
  const size = 60 * scale2;
7234
7399
  const stripHeight = 40 * scale2;
@@ -7463,7 +7628,7 @@ var EdgeDecoration = ({
7463
7628
  width = 15,
7464
7629
  className
7465
7630
  }) => {
7466
- const id = React15.useId();
7631
+ const id = React16.useId();
7467
7632
  const Variant = VARIANT_MAP2[variant];
7468
7633
  const resolvedColor = color in colorTokenVars2 ? colorTokenVars2[color] : color;
7469
7634
  const sides = side === "both" ? ["left", "right"] : [side];