@almadar/ui 5.76.7 → 5.77.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 (62) hide show
  1. package/dist/avl/index.cjs +264 -443
  2. package/dist/avl/index.css +3 -3
  3. package/dist/avl/index.js +265 -444
  4. package/dist/components/core/atoms/FlipContainer.d.ts +1 -1
  5. package/dist/components/core/molecules/Card.d.ts +1 -1
  6. package/dist/components/core/molecules/DataGrid.d.ts +1 -1
  7. package/dist/components/core/molecules/DataList.d.ts +1 -1
  8. package/dist/components/core/molecules/DocPagination.d.ts +1 -8
  9. package/dist/components/core/molecules/DocSearch.d.ts +1 -8
  10. package/dist/components/core/molecules/FlipCard.d.ts +1 -1
  11. package/dist/components/core/molecules/MapView.d.ts +1 -18
  12. package/dist/components/core/molecules/SortableList.d.ts +1 -1
  13. package/dist/components/core/molecules/TableView.d.ts +1 -1
  14. package/dist/components/core/organisms/DataTable.d.ts +1 -1
  15. package/dist/components/core/organisms/debug/RuntimeDebugger.d.ts +1 -10
  16. package/dist/components/core/organisms/debug/tabs/EntitiesTab.d.ts +1 -2
  17. package/dist/components/core/organisms/debug/tabs/EventDispatcherTab.d.ts +1 -2
  18. package/dist/components/core/organisms/debug/tabs/EventFlowTab.d.ts +1 -6
  19. package/dist/components/core/organisms/debug/tabs/GuardsPanel.d.ts +1 -6
  20. package/dist/components/core/organisms/debug/tabs/ServerBridgeTab.d.ts +1 -12
  21. package/dist/components/core/organisms/debug/tabs/TicksTab.d.ts +1 -2
  22. package/dist/components/core/organisms/debug/tabs/TraitsTab.d.ts +1 -2
  23. package/dist/components/core/organisms/debug/tabs/TransitionTimeline.d.ts +1 -11
  24. package/dist/components/core/organisms/debug/tabs/VerificationTab.d.ts +1 -8
  25. package/dist/components/game/2d/atoms/ActionButton.d.ts +1 -2
  26. package/dist/components/game/2d/atoms/ChoiceButton.d.ts +1 -2
  27. package/dist/components/game/2d/atoms/ComboCounter.d.ts +1 -2
  28. package/dist/components/game/2d/atoms/ControlButton.d.ts +1 -2
  29. package/dist/components/game/2d/atoms/DamageNumber.d.ts +1 -2
  30. package/dist/components/game/2d/atoms/DialogueBubble.d.ts +1 -2
  31. package/dist/components/game/2d/atoms/GameIcon.d.ts +1 -2
  32. package/dist/components/game/2d/atoms/HealthBar.d.ts +1 -2
  33. package/dist/components/game/2d/atoms/ItemSlot.d.ts +1 -2
  34. package/dist/components/game/2d/atoms/MiniMap.d.ts +1 -2
  35. package/dist/components/game/2d/atoms/ResourceCounter.d.ts +1 -2
  36. package/dist/components/game/2d/atoms/ScoreDisplay.d.ts +1 -2
  37. package/dist/components/game/2d/atoms/StatusEffect.d.ts +1 -2
  38. package/dist/components/game/2d/atoms/TimerDisplay.d.ts +1 -2
  39. package/dist/components/game/2d/atoms/TurnIndicator.d.ts +1 -2
  40. package/dist/components/game/2d/atoms/WaypointMarker.d.ts +1 -2
  41. package/dist/components/game/2d/molecules/GameHud.d.ts +1 -2
  42. package/dist/components/game/2d/molecules/GameMenu.d.ts +1 -2
  43. package/dist/components/game/2d/molecules/InventoryGrid.d.ts +1 -2
  44. package/dist/components/game/2d/molecules/ResourceBar.d.ts +1 -2
  45. package/dist/components/game/2d/molecules/StatBadge.d.ts +1 -2
  46. package/dist/components/game/shared/lib/editorUtils.d.ts +8 -8
  47. package/dist/components/index.cjs +133 -134
  48. package/dist/components/index.css +3 -3
  49. package/dist/components/index.js +133 -134
  50. package/dist/hooks/useGitHub.d.ts +7 -7
  51. package/dist/marketing/index.cjs +2 -2
  52. package/dist/marketing/index.js +2 -2
  53. package/dist/providers/EventBusProvider.d.ts +1 -1
  54. package/dist/providers/SelectionProvider.d.ts +1 -1
  55. package/dist/providers/ServerBridge.d.ts +1 -1
  56. package/dist/providers/index.cjs +260 -439
  57. package/dist/providers/index.css +3 -3
  58. package/dist/providers/index.js +261 -440
  59. package/dist/runtime/index.cjs +260 -439
  60. package/dist/runtime/index.css +3 -3
  61. package/dist/runtime/index.js +261 -440
  62. package/package.json +2 -2
@@ -12153,318 +12153,14 @@ var init_useCanvasEffects = __esm({
12153
12153
  "use client";
12154
12154
  }
12155
12155
  });
12156
- function pickPath(entry) {
12157
- if (Array.isArray(entry.path)) {
12158
- return entry.path[Math.floor(Math.random() * entry.path.length)];
12159
- }
12160
- return entry.path;
12161
- }
12162
- function useGameAudio({
12163
- manifest,
12164
- baseUrl = "",
12165
- initialMuted = false,
12166
- initialVolume = 1
12167
- }) {
12168
- const [muted, setMutedState] = React107.useState(initialMuted);
12169
- const [masterVolume, setMasterVolumeState] = React107.useState(initialVolume);
12170
- const mutedRef = React107.useRef(muted);
12171
- const volumeRef = React107.useRef(masterVolume);
12172
- const manifestRef = React107.useRef(manifest);
12173
- mutedRef.current = muted;
12174
- volumeRef.current = masterVolume;
12175
- manifestRef.current = manifest;
12176
- const poolsRef = React107.useRef(/* @__PURE__ */ new Map());
12177
- const getOrCreateElement = React107.useCallback((key) => {
12178
- const entry = manifestRef.current[key];
12179
- if (!entry) return null;
12180
- let pool = poolsRef.current.get(key);
12181
- if (!pool) {
12182
- pool = [];
12183
- poolsRef.current.set(key, pool);
12184
- }
12185
- const maxSize = entry.poolSize ?? 1;
12186
- for (const audio of pool) {
12187
- if (audio.paused && (audio.ended || audio.currentTime === 0)) {
12188
- return audio;
12189
- }
12190
- }
12191
- if (pool.length < maxSize) {
12192
- const src = baseUrl + pickPath(entry);
12193
- const audio = new Audio(src);
12194
- audio.loop = entry.loop ?? false;
12195
- pool.push(audio);
12196
- return audio;
12197
- }
12198
- if (!entry.loop) {
12199
- let oldest = pool[0];
12200
- for (const audio of pool) {
12201
- if (audio.currentTime > oldest.currentTime) {
12202
- oldest = audio;
12203
- }
12204
- }
12205
- oldest.pause();
12206
- oldest.currentTime = 0;
12207
- return oldest;
12208
- }
12209
- return null;
12210
- }, [baseUrl]);
12211
- const play = React107.useCallback((key) => {
12212
- if (mutedRef.current) return;
12213
- const entry = manifestRef.current[key];
12214
- if (!entry) return;
12215
- const audio = getOrCreateElement(key);
12216
- if (!audio) return;
12217
- audio.volume = Math.min(1, (entry.volume ?? 1) * volumeRef.current);
12218
- if (!entry.loop) {
12219
- audio.currentTime = 0;
12220
- }
12221
- const promise = audio.play();
12222
- if (promise) {
12223
- promise.catch(() => {
12224
- });
12225
- }
12226
- }, [getOrCreateElement]);
12227
- const stop = React107.useCallback((key) => {
12228
- const pool = poolsRef.current.get(key);
12229
- if (!pool) return;
12230
- for (const audio of pool) {
12231
- audio.pause();
12232
- audio.currentTime = 0;
12233
- }
12234
- }, []);
12235
- const currentMusicKeyRef = React107.useRef(null);
12236
- const currentMusicElRef = React107.useRef(null);
12237
- const musicFadeRef = React107.useRef(null);
12238
- const pendingMusicKeyRef = React107.useRef(null);
12239
- const clearMusicFade = React107.useCallback(() => {
12240
- if (musicFadeRef.current) {
12241
- clearInterval(musicFadeRef.current);
12242
- musicFadeRef.current = null;
12243
- }
12244
- }, []);
12245
- const playMusic = React107.useCallback((key) => {
12246
- if (key === currentMusicKeyRef.current) return;
12247
- pendingMusicKeyRef.current = key;
12248
- const entry = manifestRef.current[key];
12249
- if (!entry) return;
12250
- const fadeDurationMs = entry.crossfadeDurationMs ?? 1500;
12251
- const stepMs = 50;
12252
- const totalSteps = Math.max(1, fadeDurationMs / stepMs);
12253
- const targetVolume = Math.min(1, (entry.volume ?? 1) * volumeRef.current);
12254
- clearMusicFade();
12255
- const src = baseUrl + (Array.isArray(entry.path) ? entry.path[0] : entry.path);
12256
- const incoming = new Audio(src);
12257
- incoming.loop = true;
12258
- incoming.volume = 0;
12259
- const outgoing = currentMusicElRef.current;
12260
- const outgoingStartVol = outgoing?.volume ?? 0;
12261
- currentMusicKeyRef.current = key;
12262
- currentMusicElRef.current = incoming;
12263
- if (!mutedRef.current) {
12264
- incoming.play().catch(() => {
12265
- currentMusicKeyRef.current = null;
12266
- currentMusicElRef.current = outgoing;
12267
- });
12268
- }
12269
- let step = 0;
12270
- musicFadeRef.current = setInterval(() => {
12271
- step++;
12272
- const progress = Math.min(step / totalSteps, 1);
12273
- incoming.volume = Math.min(1, targetVolume * progress);
12274
- if (outgoing) {
12275
- outgoing.volume = Math.max(0, outgoingStartVol * (1 - progress));
12276
- }
12277
- if (progress >= 1) {
12278
- clearMusicFade();
12279
- if (outgoing) {
12280
- outgoing.pause();
12281
- outgoing.src = "";
12282
- }
12283
- }
12284
- }, stepMs);
12285
- }, [baseUrl, clearMusicFade]);
12286
- const stopMusic = React107.useCallback((fadeDurationMs = 1e3) => {
12287
- const outgoing = currentMusicElRef.current;
12288
- if (!outgoing) return;
12289
- currentMusicKeyRef.current = null;
12290
- currentMusicElRef.current = null;
12291
- pendingMusicKeyRef.current = null;
12292
- clearMusicFade();
12293
- const startVolume = outgoing.volume;
12294
- const stepMs = 50;
12295
- const totalSteps = Math.max(1, fadeDurationMs / stepMs);
12296
- let step = 0;
12297
- musicFadeRef.current = setInterval(() => {
12298
- step++;
12299
- const progress = step / totalSteps;
12300
- outgoing.volume = Math.max(0, startVolume * (1 - progress));
12301
- if (progress >= 1) {
12302
- clearMusicFade();
12303
- outgoing.pause();
12304
- outgoing.src = "";
12305
- }
12306
- }, stepMs);
12307
- }, [clearMusicFade]);
12308
- const stopAll = React107.useCallback(() => {
12309
- for (const pool of poolsRef.current.values()) {
12310
- for (const audio of pool) {
12311
- audio.pause();
12312
- audio.currentTime = 0;
12313
- }
12314
- }
12315
- stopMusic(0);
12316
- }, [stopMusic]);
12317
- const setMuted = React107.useCallback((value) => {
12318
- setMutedState(value);
12319
- if (value) {
12320
- for (const [key, pool] of poolsRef.current.entries()) {
12321
- if (manifestRef.current[key]?.loop) {
12322
- for (const audio of pool) {
12323
- if (!audio.paused) audio.pause();
12324
- }
12325
- }
12326
- }
12327
- currentMusicElRef.current?.pause();
12328
- } else {
12329
- for (const [key, pool] of poolsRef.current.entries()) {
12330
- const entry = manifestRef.current[key];
12331
- if (entry?.loop && entry?.autostart) {
12332
- for (const audio of pool) {
12333
- if (audio.paused) audio.play().catch(() => {
12334
- });
12335
- }
12336
- }
12337
- }
12338
- const musicEl = currentMusicElRef.current;
12339
- if (musicEl) {
12340
- musicEl.play().catch(() => {
12341
- });
12342
- }
12343
- }
12344
- }, []);
12345
- const setMasterVolume = React107.useCallback((volume) => {
12346
- const clamped = Math.max(0, Math.min(1, volume));
12347
- setMasterVolumeState(clamped);
12348
- for (const [key, pool] of poolsRef.current.entries()) {
12349
- const entryVol = manifestRef.current[key]?.volume ?? 1;
12350
- for (const audio of pool) {
12351
- audio.volume = Math.min(1, entryVol * clamped);
12352
- }
12353
- }
12354
- if (!musicFadeRef.current && currentMusicElRef.current) {
12355
- const key = currentMusicKeyRef.current;
12356
- const entryVol = key ? manifestRef.current[key]?.volume ?? 1 : 1;
12357
- currentMusicElRef.current.volume = Math.min(1, entryVol * clamped);
12358
- }
12359
- }, []);
12360
- const unlockedRef = React107.useRef(false);
12361
- React107.useEffect(() => {
12362
- const autoKeys = Object.keys(manifest).filter((k) => manifest[k].autostart);
12363
- const hasPendingMusic = () => pendingMusicKeyRef.current !== null;
12364
- const hasAutoStart = autoKeys.length > 0;
12365
- if (!hasAutoStart && !hasPendingMusic()) return;
12366
- const unlock = () => {
12367
- if (unlockedRef.current) return;
12368
- unlockedRef.current = true;
12369
- if (!mutedRef.current) {
12370
- for (const key of autoKeys) {
12371
- play(key);
12372
- }
12373
- const pending = pendingMusicKeyRef.current;
12374
- if (pending && pending !== currentMusicKeyRef.current) {
12375
- playMusic(pending);
12376
- }
12377
- }
12378
- };
12379
- document.addEventListener("click", unlock, { once: true });
12380
- document.addEventListener("keydown", unlock, { once: true });
12381
- document.addEventListener("touchstart", unlock, { once: true });
12382
- return () => {
12383
- document.removeEventListener("click", unlock);
12384
- document.removeEventListener("keydown", unlock);
12385
- document.removeEventListener("touchstart", unlock);
12386
- };
12387
- }, [manifest, play, playMusic]);
12388
- React107.useEffect(() => {
12389
- return () => {
12390
- clearMusicFade();
12391
- for (const pool of poolsRef.current.values()) {
12392
- for (const audio of pool) {
12393
- audio.pause();
12394
- audio.src = "";
12395
- }
12396
- }
12397
- poolsRef.current.clear();
12398
- if (currentMusicElRef.current) {
12399
- currentMusicElRef.current.pause();
12400
- currentMusicElRef.current.src = "";
12401
- currentMusicElRef.current = null;
12402
- }
12403
- };
12404
- }, [clearMusicFade]);
12405
- return {
12406
- play,
12407
- stop,
12408
- stopAll,
12409
- playMusic,
12410
- stopMusic,
12411
- muted,
12412
- setMuted,
12413
- masterVolume,
12414
- setMasterVolume
12415
- };
12416
- }
12417
12156
  var init_useGameAudio = __esm({
12418
12157
  "components/game/shared/hooks/useGameAudio.ts"() {
12419
12158
  "use client";
12420
- useGameAudio.displayName = "useGameAudio";
12421
12159
  }
12422
12160
  });
12423
12161
  function useGameAudioContextOptional() {
12424
12162
  return React107.useContext(GameAudioContext);
12425
12163
  }
12426
- function GameAudioProvider({
12427
- manifest,
12428
- baseUrl = "",
12429
- children,
12430
- initialMuted = false
12431
- }) {
12432
- const eventBus = useEventBus();
12433
- const { play, stop, stopAll, playMusic, stopMusic, muted, setMuted, masterVolume, setMasterVolume } = useGameAudio({ manifest, baseUrl, initialMuted });
12434
- React107.useEffect(() => {
12435
- const unsubPlay = eventBus.on("UI:PLAY_SOUND", (event) => {
12436
- const key = event.payload?.key;
12437
- if (key) play(key);
12438
- });
12439
- const unsubStop = eventBus.on("UI:STOP_SOUND", (event) => {
12440
- const key = event.payload?.key;
12441
- if (key) {
12442
- stop(key);
12443
- } else {
12444
- stopAll();
12445
- }
12446
- });
12447
- const unsubChangeMusic = eventBus.on("UI:CHANGE_MUSIC", (event) => {
12448
- const key = event.payload?.key;
12449
- if (key) {
12450
- playMusic(key);
12451
- } else {
12452
- stopMusic();
12453
- }
12454
- });
12455
- const unsubStopMusic = eventBus.on("UI:STOP_MUSIC", () => {
12456
- stopMusic();
12457
- });
12458
- return () => {
12459
- unsubPlay();
12460
- unsubStop();
12461
- unsubChangeMusic();
12462
- unsubStopMusic();
12463
- };
12464
- }, [eventBus, play, stop, stopAll, playMusic, stopMusic]);
12465
- const value = { muted, setMuted, masterVolume, setMasterVolume, play, playMusic, stopMusic };
12466
- return /* @__PURE__ */ jsxRuntime.jsx(GameAudioContext.Provider, { value, children });
12467
- }
12468
12164
  var GameAudioContext;
12469
12165
  var init_GameAudioProvider = __esm({
12470
12166
  "components/game/shared/providers/GameAudioProvider.tsx"() {
@@ -12473,7 +12169,6 @@ var init_GameAudioProvider = __esm({
12473
12169
  init_useGameAudio();
12474
12170
  GameAudioContext = React107.createContext(null);
12475
12171
  GameAudioContext.displayName = "GameAudioContext";
12476
- GameAudioProvider.displayName = "GameAudioProvider";
12477
12172
  }
12478
12173
  });
12479
12174
  function GameAudioToggle({
@@ -23031,9 +22726,9 @@ var init_BehaviorView = __esm({
23031
22726
  }
23032
22727
  });
23033
22728
 
23034
- // node_modules/.pnpm/katex@0.16.47/node_modules/katex/dist/katex.min.css
22729
+ // node_modules/katex/dist/katex.min.css
23035
22730
  var init_katex_min = __esm({
23036
- "node_modules/.pnpm/katex@0.16.47/node_modules/katex/dist/katex.min.css"() {
22731
+ "node_modules/katex/dist/katex.min.css"() {
23037
22732
  }
23038
22733
  });
23039
22734
  var Tabs;
@@ -27426,129 +27121,6 @@ var init_Breadcrumb = __esm({
27426
27121
  Breadcrumb.displayName = "Breadcrumb";
27427
27122
  }
27428
27123
  });
27429
- function useSafeEventBus2() {
27430
- try {
27431
- return useEventBus();
27432
- } catch {
27433
- return { emit: () => {
27434
- }, on: () => () => {
27435
- }, once: () => {
27436
- } };
27437
- }
27438
- }
27439
- var log8, lookStyles4, ButtonGroup;
27440
- var init_ButtonGroup = __esm({
27441
- "components/core/molecules/ButtonGroup.tsx"() {
27442
- "use client";
27443
- init_cn();
27444
- init_atoms();
27445
- init_useEventBus();
27446
- log8 = logger.createLogger("almadar:ui:button-group");
27447
- lookStyles4 = {
27448
- "right-aligned-buttons": "",
27449
- "floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
27450
- "inline-row": "gap-2 inline-flex",
27451
- "dropdown-menu": "[&>button:not(:first-child)]:hidden",
27452
- "command-palette-trigger": "[&>button:not(:first-child)]:hidden"
27453
- };
27454
- ButtonGroup = ({
27455
- children,
27456
- primary,
27457
- secondary,
27458
- variant = "default",
27459
- orientation = "horizontal",
27460
- className,
27461
- // Filter-group pattern props (entity and filters are used for schema-driven filtering)
27462
- entity: _entity,
27463
- filters,
27464
- look = "right-aligned-buttons"
27465
- }) => {
27466
- const eventBus = useSafeEventBus2();
27467
- const variantClasses2 = {
27468
- default: "gap-0",
27469
- segmented: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0",
27470
- toggle: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0"
27471
- };
27472
- const orientationClasses = {
27473
- horizontal: "flex-row",
27474
- vertical: "flex-col [&>button:first-child]:rounded-t-lg [&>button:last-child]:rounded-b-lg [&>button:not(:first-child)]:border-t-0 [&>button:not(:first-child)]:border-l"
27475
- };
27476
- const handleActionClick = (action) => {
27477
- if (action.event) {
27478
- eventBus.emit("UI:DISPATCH", { event: action.event });
27479
- }
27480
- if (action.navigatesTo) {
27481
- eventBus.emit("UI:NAVIGATE", { url: action.navigatesTo });
27482
- }
27483
- };
27484
- const renderFormActions = () => {
27485
- const buttons = [];
27486
- if (secondary) {
27487
- secondary.forEach((action, index) => {
27488
- buttons.push(
27489
- /* @__PURE__ */ jsxRuntime.jsx(
27490
- Button,
27491
- {
27492
- type: action.actionType === "submit" ? "submit" : "button",
27493
- variant: action.variant || "ghost",
27494
- onClick: () => handleActionClick(action),
27495
- children: action.label
27496
- },
27497
- `secondary-${index}`
27498
- )
27499
- );
27500
- });
27501
- }
27502
- if (primary) {
27503
- const isSubmit = primary.actionType === "submit";
27504
- buttons.push(
27505
- /* @__PURE__ */ jsxRuntime.jsx(
27506
- Button,
27507
- {
27508
- type: isSubmit ? "submit" : "button",
27509
- variant: primary.variant || "primary",
27510
- onClick: () => handleActionClick(primary),
27511
- "data-testid": isSubmit ? "form-submit" : void 0,
27512
- children: primary.label
27513
- },
27514
- "primary"
27515
- )
27516
- );
27517
- }
27518
- return buttons;
27519
- };
27520
- const renderFilters = () => {
27521
- if (!filters || filters.length === 0) return null;
27522
- return filters.map((filter, index) => /* @__PURE__ */ jsxRuntime.jsx(
27523
- Button,
27524
- {
27525
- variant: "ghost",
27526
- onClick: () => {
27527
- log8.debug("Filter clicked", { field: filter.field });
27528
- },
27529
- children: filter.label
27530
- },
27531
- `filter-${filter.field}-${index}`
27532
- ));
27533
- };
27534
- return /* @__PURE__ */ jsxRuntime.jsx(
27535
- "div",
27536
- {
27537
- className: cn(
27538
- "inline-flex gap-2",
27539
- variantClasses2[variant],
27540
- orientationClasses[orientation],
27541
- lookStyles4[look],
27542
- className
27543
- ),
27544
- role: "group",
27545
- children: children || renderFilters() || renderFormActions()
27546
- }
27547
- );
27548
- };
27549
- ButtonGroup.displayName = "ButtonGroup";
27550
- }
27551
- });
27552
27124
  function useSwipeGesture(callbacks, options = {}) {
27553
27125
  const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
27554
27126
  const startX = React107.useRef(0);
@@ -28358,7 +27930,7 @@ var init_CardGrid = __esm({
28358
27930
  CardGrid.displayName = "CardGrid";
28359
27931
  }
28360
27932
  });
28361
- function useSafeEventBus3() {
27933
+ function useSafeEventBus2() {
28362
27934
  try {
28363
27935
  return useEventBus();
28364
27936
  } catch {
@@ -28394,7 +27966,7 @@ var init_Carousel = __esm({
28394
27966
  const [activeIndex, setActiveIndex] = React107.useState(0);
28395
27967
  const scrollRef = React107.useRef(null);
28396
27968
  const autoPlayRef = React107.useRef(null);
28397
- const eventBus = useSafeEventBus3();
27969
+ const eventBus = useSafeEventBus2();
28398
27970
  const { t } = hooks.useTranslate();
28399
27971
  const safeItems = items ?? [];
28400
27972
  const totalSlides = safeItems.length;
@@ -31730,7 +31302,7 @@ function DataGrid({
31730
31302
  /* @__PURE__ */ jsxRuntime.jsx(
31731
31303
  Box,
31732
31304
  {
31733
- className: cn("grid", gapStyles5[gap], scrollX ? "grid-flow-col overflow-x-auto" : colsClass, lookStyles5[look], className),
31305
+ className: cn("grid", gapStyles5[gap], scrollX ? "grid-flow-col overflow-x-auto" : colsClass, lookStyles4[look], className),
31734
31306
  style: scrollX ? { gridAutoFlow: "column", gridAutoColumns: `minmax(${minCardWidth}px, 1fr)` } : gridTemplateColumns ? { gridTemplateColumns } : void 0,
31735
31307
  children: data.map((item, index) => {
31736
31308
  const itemData = item;
@@ -31925,7 +31497,7 @@ function DataGrid({
31925
31497
  ] })
31926
31498
  );
31927
31499
  }
31928
- var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles5;
31500
+ var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles4;
31929
31501
  var init_DataGrid = __esm({
31930
31502
  "components/core/molecules/DataGrid.tsx"() {
31931
31503
  "use client";
@@ -31960,7 +31532,7 @@ var init_DataGrid = __esm({
31960
31532
  lg: "gap-6",
31961
31533
  xl: "gap-8"
31962
31534
  };
31963
- lookStyles5 = {
31535
+ lookStyles4 = {
31964
31536
  dense: "gap-2 [&>*]:p-card-sm",
31965
31537
  spacious: "gap-8 [&>*]:p-card-lg",
31966
31538
  striped: "[&>*:nth-child(even)]:bg-muted/30",
@@ -32387,6 +31959,133 @@ var init_DataList = __esm({
32387
31959
  DataList.displayName = "DataList";
32388
31960
  }
32389
31961
  });
31962
+ var FormSection, FormLayout, FormActions;
31963
+ var init_FormSection = __esm({
31964
+ "components/core/molecules/FormSection.tsx"() {
31965
+ "use client";
31966
+ init_cn();
31967
+ init_atoms();
31968
+ init_Box();
31969
+ init_Typography();
31970
+ init_Button();
31971
+ init_Stack();
31972
+ init_Icon();
31973
+ init_useEventBus();
31974
+ FormSection = ({
31975
+ title,
31976
+ description,
31977
+ children,
31978
+ collapsible = false,
31979
+ defaultCollapsed = false,
31980
+ card = false,
31981
+ columns = 1,
31982
+ className
31983
+ }) => {
31984
+ const [collapsed, setCollapsed] = React107__namespace.default.useState(defaultCollapsed);
31985
+ const { t } = hooks.useTranslate();
31986
+ const eventBus = useEventBus();
31987
+ const gridClass = {
31988
+ 1: "grid-cols-1",
31989
+ 2: "grid-cols-1 md:grid-cols-2",
31990
+ 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
31991
+ }[columns];
31992
+ React107__namespace.default.useCallback(() => {
31993
+ if (collapsible) {
31994
+ setCollapsed((prev) => !prev);
31995
+ eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
31996
+ }
31997
+ }, [collapsible, collapsed, eventBus]);
31998
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
31999
+ (title || description) && /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: "mb-4", children: [
32000
+ title && /* @__PURE__ */ jsxRuntime.jsxs(
32001
+ HStack,
32002
+ {
32003
+ justify: "between",
32004
+ align: "center",
32005
+ className: cn(collapsible && "cursor-pointer"),
32006
+ action: collapsible ? "TOGGLE_COLLAPSE" : void 0,
32007
+ children: [
32008
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h3", weight: "semibold", children: title }),
32009
+ collapsible && /* @__PURE__ */ jsxRuntime.jsx(
32010
+ Button,
32011
+ {
32012
+ variant: "ghost",
32013
+ size: "sm",
32014
+ action: "TOGGLE_COLLAPSE",
32015
+ children: /* @__PURE__ */ jsxRuntime.jsx(
32016
+ Icon,
32017
+ {
32018
+ icon: LucideIcons2.ChevronDown,
32019
+ size: "sm",
32020
+ className: cn(
32021
+ "text-muted-foreground transition-transform",
32022
+ collapsed && "rotate-180"
32023
+ )
32024
+ }
32025
+ )
32026
+ }
32027
+ )
32028
+ ]
32029
+ }
32030
+ ),
32031
+ description && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "secondary", children: description })
32032
+ ] }),
32033
+ (!collapsible || !collapsed) && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("grid gap-4", gridClass), children })
32034
+ ] });
32035
+ if (card) {
32036
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("p-6", className), children: content });
32037
+ }
32038
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { className, children: content });
32039
+ };
32040
+ FormSection.displayName = "FormSection";
32041
+ FormLayout = ({
32042
+ children,
32043
+ dividers = true,
32044
+ className
32045
+ }) => {
32046
+ return /* @__PURE__ */ jsxRuntime.jsx(
32047
+ VStack,
32048
+ {
32049
+ gap: "lg",
32050
+ className: cn(
32051
+ dividers && "[&>*+*]:pt-8 [&>*+*]:border-t [&>*+*]:border-border",
32052
+ className
32053
+ ),
32054
+ children
32055
+ }
32056
+ );
32057
+ };
32058
+ FormLayout.displayName = "FormLayout";
32059
+ FormActions = ({
32060
+ children,
32061
+ sticky = false,
32062
+ align = "right",
32063
+ className
32064
+ }) => {
32065
+ const alignClass2 = {
32066
+ left: "justify-start",
32067
+ right: "justify-end",
32068
+ between: "justify-between",
32069
+ center: "justify-center"
32070
+ }[align];
32071
+ return /* @__PURE__ */ jsxRuntime.jsx(
32072
+ HStack,
32073
+ {
32074
+ gap: "sm",
32075
+ align: "center",
32076
+ className: cn(
32077
+ "pt-6 border-t border-border",
32078
+ alignClass2,
32079
+ sticky && "sticky bottom-0 bg-card py-4 -mx-6 px-6 shadow-[0_-4px_6px_-1px_rgb(0,0,0,0.05)]",
32080
+ className
32081
+ ),
32082
+ children
32083
+ }
32084
+ );
32085
+ };
32086
+ FormActions.displayName = "FormActions";
32087
+ }
32088
+ });
32390
32089
  function fileIcon(name) {
32391
32090
  const ext = name.split(".").pop()?.toLowerCase() ?? "";
32392
32091
  switch (ext) {
@@ -32548,6 +32247,129 @@ var init_FormField = __esm({
32548
32247
  FormField.displayName = "FormField";
32549
32248
  }
32550
32249
  });
32250
+ function useSafeEventBus3() {
32251
+ try {
32252
+ return useEventBus();
32253
+ } catch {
32254
+ return { emit: () => {
32255
+ }, on: () => () => {
32256
+ }, once: () => {
32257
+ } };
32258
+ }
32259
+ }
32260
+ var log8, lookStyles5, ButtonGroup;
32261
+ var init_ButtonGroup = __esm({
32262
+ "components/core/molecules/ButtonGroup.tsx"() {
32263
+ "use client";
32264
+ init_cn();
32265
+ init_atoms();
32266
+ init_useEventBus();
32267
+ log8 = logger.createLogger("almadar:ui:button-group");
32268
+ lookStyles5 = {
32269
+ "right-aligned-buttons": "",
32270
+ "floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
32271
+ "inline-row": "gap-2 inline-flex",
32272
+ "dropdown-menu": "[&>button:not(:first-child)]:hidden",
32273
+ "command-palette-trigger": "[&>button:not(:first-child)]:hidden"
32274
+ };
32275
+ ButtonGroup = ({
32276
+ children,
32277
+ primary,
32278
+ secondary,
32279
+ variant = "default",
32280
+ orientation = "horizontal",
32281
+ className,
32282
+ // Filter-group pattern props (entity and filters are used for schema-driven filtering)
32283
+ entity: _entity,
32284
+ filters,
32285
+ look = "right-aligned-buttons"
32286
+ }) => {
32287
+ const eventBus = useSafeEventBus3();
32288
+ const variantClasses2 = {
32289
+ default: "gap-0",
32290
+ segmented: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0",
32291
+ toggle: "gap-0 [&>button]:rounded-none [&>button:first-child]:rounded-l-lg [&>button:last-child]:rounded-r-lg [&>button:not(:first-child)]:border-l-0"
32292
+ };
32293
+ const orientationClasses = {
32294
+ horizontal: "flex-row",
32295
+ vertical: "flex-col [&>button:first-child]:rounded-t-lg [&>button:last-child]:rounded-b-lg [&>button:not(:first-child)]:border-t-0 [&>button:not(:first-child)]:border-l"
32296
+ };
32297
+ const handleActionClick = (action) => {
32298
+ if (action.event) {
32299
+ eventBus.emit("UI:DISPATCH", { event: action.event });
32300
+ }
32301
+ if (action.navigatesTo) {
32302
+ eventBus.emit("UI:NAVIGATE", { url: action.navigatesTo });
32303
+ }
32304
+ };
32305
+ const renderFormActions = () => {
32306
+ const buttons = [];
32307
+ if (secondary) {
32308
+ secondary.forEach((action, index) => {
32309
+ buttons.push(
32310
+ /* @__PURE__ */ jsxRuntime.jsx(
32311
+ Button,
32312
+ {
32313
+ type: action.actionType === "submit" ? "submit" : "button",
32314
+ variant: action.variant || "ghost",
32315
+ onClick: () => handleActionClick(action),
32316
+ children: action.label
32317
+ },
32318
+ `secondary-${index}`
32319
+ )
32320
+ );
32321
+ });
32322
+ }
32323
+ if (primary) {
32324
+ const isSubmit = primary.actionType === "submit";
32325
+ buttons.push(
32326
+ /* @__PURE__ */ jsxRuntime.jsx(
32327
+ Button,
32328
+ {
32329
+ type: isSubmit ? "submit" : "button",
32330
+ variant: primary.variant || "primary",
32331
+ onClick: () => handleActionClick(primary),
32332
+ "data-testid": isSubmit ? "form-submit" : void 0,
32333
+ children: primary.label
32334
+ },
32335
+ "primary"
32336
+ )
32337
+ );
32338
+ }
32339
+ return buttons;
32340
+ };
32341
+ const renderFilters = () => {
32342
+ if (!filters || filters.length === 0) return null;
32343
+ return filters.map((filter, index) => /* @__PURE__ */ jsxRuntime.jsx(
32344
+ Button,
32345
+ {
32346
+ variant: "ghost",
32347
+ onClick: () => {
32348
+ log8.debug("Filter clicked", { field: filter.field });
32349
+ },
32350
+ children: filter.label
32351
+ },
32352
+ `filter-${filter.field}-${index}`
32353
+ ));
32354
+ };
32355
+ return /* @__PURE__ */ jsxRuntime.jsx(
32356
+ "div",
32357
+ {
32358
+ className: cn(
32359
+ "inline-flex gap-2",
32360
+ variantClasses2[variant],
32361
+ orientationClasses[orientation],
32362
+ lookStyles5[look],
32363
+ className
32364
+ ),
32365
+ role: "group",
32366
+ children: children || renderFilters() || renderFormActions()
32367
+ }
32368
+ );
32369
+ };
32370
+ ButtonGroup.displayName = "ButtonGroup";
32371
+ }
32372
+ });
32551
32373
  function getOrCreateStore(query) {
32552
32374
  if (!queryStores.has(query)) {
32553
32375
  queryStores.set(query, {
@@ -51108,7 +50930,6 @@ var init_component_registry_generated = __esm({
51108
50930
  init_BranchingLogicBuilder();
51109
50931
  init_Breadcrumb();
51110
50932
  init_BuilderBoard();
51111
- init_ButtonGroup();
51112
50933
  init_CTABanner();
51113
50934
  init_CalendarGrid();
51114
50935
  init_Canvas2D();
@@ -51185,9 +51006,9 @@ var init_component_registry_generated = __esm({
51185
51006
  init_FlipContainer();
51186
51007
  init_FloatingActionButton();
51187
51008
  init_Form();
51009
+ init_FormSection();
51188
51010
  init_FormField();
51189
51011
  init_FormSectionHeader();
51190
- init_GameAudioProvider();
51191
51012
  init_GameAudioToggle();
51192
51013
  init_GameCard();
51193
51014
  init_GameHud();
@@ -51436,7 +51257,6 @@ var init_component_registry_generated = __esm({
51436
51257
  "Breadcrumb": Breadcrumb,
51437
51258
  "BuilderBoard": BuilderBoard,
51438
51259
  "Button": ButtonPattern,
51439
- "ButtonGroup": ButtonGroup,
51440
51260
  "ButtonPattern": ButtonPattern,
51441
51261
  "CTABanner": CTABanner,
51442
51262
  "CalendarGrid": CalendarGrid,
@@ -51516,9 +51336,10 @@ var init_component_registry_generated = __esm({
51516
51336
  "FlipContainer": FlipContainer,
51517
51337
  "FloatingActionButton": FloatingActionButton,
51518
51338
  "Form": Form,
51339
+ "FormActions": FormActions,
51519
51340
  "FormField": FormField,
51341
+ "FormLayout": FormLayout,
51520
51342
  "FormSectionHeader": FormSectionHeader,
51521
- "GameAudioProvider": GameAudioProvider,
51522
51343
  "GameAudioToggle": GameAudioToggle,
51523
51344
  "GameBoard3D": GameBoard3D,
51524
51345
  "GameCanvas3D": GameCanvas3D,