@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
@@ -630,7 +630,7 @@ var init_AvlFieldType = __esm({
630
630
  }
631
631
  });
632
632
 
633
- // node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
633
+ // node_modules/clsx/dist/clsx.mjs
634
634
  function r(e) {
635
635
  var t, f3, n = "";
636
636
  if ("string" == typeof e || "number" == typeof e) n += e;
@@ -645,11 +645,11 @@ function clsx() {
645
645
  return n;
646
646
  }
647
647
  var init_clsx = __esm({
648
- "node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs"() {
648
+ "node_modules/clsx/dist/clsx.mjs"() {
649
649
  }
650
650
  });
651
651
 
652
- // node_modules/.pnpm/tailwind-merge@2.6.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs
652
+ // node_modules/tailwind-merge/dist/bundle-mjs.mjs
653
653
  function twJoin() {
654
654
  let index = 0;
655
655
  let argument;
@@ -693,7 +693,7 @@ function createTailwindMerge(createConfigFirst, ...createConfigRest) {
693
693
  }
694
694
  var CLASS_PART_SEPARATOR, createClassGroupUtils, getGroupRecursive, arbitraryPropertyRegex, getGroupIdForArbitraryProperty, createClassMap, processClassesRecursively, getPart, isThemeGetter, getPrefixedClassGroupEntries, createLruCache, IMPORTANT_MODIFIER, createParseClassName, sortModifiers, createConfigUtils, SPLIT_CLASSES_REGEX, mergeClassList, toValue, fromTheme, arbitraryValueRegex, fractionRegex, stringLengths, tshirtUnitRegex, lengthUnitRegex, colorFunctionRegex, shadowRegex, imageRegex, isLength, isArbitraryLength, isNumber, isArbitraryNumber, isInteger, isPercent, isArbitraryValue, isTshirtSize, sizeLabels, isArbitrarySize, isArbitraryPosition, imageLabels, isArbitraryImage, isArbitraryShadow, isAny, getIsArbitraryValue, isLengthOnly, isNever, isShadow, isImage, getDefaultConfig, twMerge;
695
695
  var init_bundle_mjs = __esm({
696
- "node_modules/.pnpm/tailwind-merge@2.6.1/node_modules/tailwind-merge/dist/bundle-mjs.mjs"() {
696
+ "node_modules/tailwind-merge/dist/bundle-mjs.mjs"() {
697
697
  CLASS_PART_SEPARATOR = "-";
698
698
  createClassGroupUtils = (config) => {
699
699
  const classMap = createClassMap(config);
@@ -15908,318 +15908,14 @@ var init_useCanvasEffects = __esm({
15908
15908
  "use client";
15909
15909
  }
15910
15910
  });
15911
- function pickPath(entry) {
15912
- if (Array.isArray(entry.path)) {
15913
- return entry.path[Math.floor(Math.random() * entry.path.length)];
15914
- }
15915
- return entry.path;
15916
- }
15917
- function useGameAudio({
15918
- manifest,
15919
- baseUrl = "",
15920
- initialMuted = false,
15921
- initialVolume = 1
15922
- }) {
15923
- const [muted, setMutedState] = React114.useState(initialMuted);
15924
- const [masterVolume, setMasterVolumeState] = React114.useState(initialVolume);
15925
- const mutedRef = React114.useRef(muted);
15926
- const volumeRef = React114.useRef(masterVolume);
15927
- const manifestRef = React114.useRef(manifest);
15928
- mutedRef.current = muted;
15929
- volumeRef.current = masterVolume;
15930
- manifestRef.current = manifest;
15931
- const poolsRef = React114.useRef(/* @__PURE__ */ new Map());
15932
- const getOrCreateElement = React114.useCallback((key) => {
15933
- const entry = manifestRef.current[key];
15934
- if (!entry) return null;
15935
- let pool = poolsRef.current.get(key);
15936
- if (!pool) {
15937
- pool = [];
15938
- poolsRef.current.set(key, pool);
15939
- }
15940
- const maxSize = entry.poolSize ?? 1;
15941
- for (const audio of pool) {
15942
- if (audio.paused && (audio.ended || audio.currentTime === 0)) {
15943
- return audio;
15944
- }
15945
- }
15946
- if (pool.length < maxSize) {
15947
- const src = baseUrl + pickPath(entry);
15948
- const audio = new Audio(src);
15949
- audio.loop = entry.loop ?? false;
15950
- pool.push(audio);
15951
- return audio;
15952
- }
15953
- if (!entry.loop) {
15954
- let oldest = pool[0];
15955
- for (const audio of pool) {
15956
- if (audio.currentTime > oldest.currentTime) {
15957
- oldest = audio;
15958
- }
15959
- }
15960
- oldest.pause();
15961
- oldest.currentTime = 0;
15962
- return oldest;
15963
- }
15964
- return null;
15965
- }, [baseUrl]);
15966
- const play = React114.useCallback((key) => {
15967
- if (mutedRef.current) return;
15968
- const entry = manifestRef.current[key];
15969
- if (!entry) return;
15970
- const audio = getOrCreateElement(key);
15971
- if (!audio) return;
15972
- audio.volume = Math.min(1, (entry.volume ?? 1) * volumeRef.current);
15973
- if (!entry.loop) {
15974
- audio.currentTime = 0;
15975
- }
15976
- const promise = audio.play();
15977
- if (promise) {
15978
- promise.catch(() => {
15979
- });
15980
- }
15981
- }, [getOrCreateElement]);
15982
- const stop = React114.useCallback((key) => {
15983
- const pool = poolsRef.current.get(key);
15984
- if (!pool) return;
15985
- for (const audio of pool) {
15986
- audio.pause();
15987
- audio.currentTime = 0;
15988
- }
15989
- }, []);
15990
- const currentMusicKeyRef = React114.useRef(null);
15991
- const currentMusicElRef = React114.useRef(null);
15992
- const musicFadeRef = React114.useRef(null);
15993
- const pendingMusicKeyRef = React114.useRef(null);
15994
- const clearMusicFade = React114.useCallback(() => {
15995
- if (musicFadeRef.current) {
15996
- clearInterval(musicFadeRef.current);
15997
- musicFadeRef.current = null;
15998
- }
15999
- }, []);
16000
- const playMusic = React114.useCallback((key) => {
16001
- if (key === currentMusicKeyRef.current) return;
16002
- pendingMusicKeyRef.current = key;
16003
- const entry = manifestRef.current[key];
16004
- if (!entry) return;
16005
- const fadeDurationMs = entry.crossfadeDurationMs ?? 1500;
16006
- const stepMs = 50;
16007
- const totalSteps = Math.max(1, fadeDurationMs / stepMs);
16008
- const targetVolume = Math.min(1, (entry.volume ?? 1) * volumeRef.current);
16009
- clearMusicFade();
16010
- const src = baseUrl + (Array.isArray(entry.path) ? entry.path[0] : entry.path);
16011
- const incoming = new Audio(src);
16012
- incoming.loop = true;
16013
- incoming.volume = 0;
16014
- const outgoing = currentMusicElRef.current;
16015
- const outgoingStartVol = outgoing?.volume ?? 0;
16016
- currentMusicKeyRef.current = key;
16017
- currentMusicElRef.current = incoming;
16018
- if (!mutedRef.current) {
16019
- incoming.play().catch(() => {
16020
- currentMusicKeyRef.current = null;
16021
- currentMusicElRef.current = outgoing;
16022
- });
16023
- }
16024
- let step = 0;
16025
- musicFadeRef.current = setInterval(() => {
16026
- step++;
16027
- const progress = Math.min(step / totalSteps, 1);
16028
- incoming.volume = Math.min(1, targetVolume * progress);
16029
- if (outgoing) {
16030
- outgoing.volume = Math.max(0, outgoingStartVol * (1 - progress));
16031
- }
16032
- if (progress >= 1) {
16033
- clearMusicFade();
16034
- if (outgoing) {
16035
- outgoing.pause();
16036
- outgoing.src = "";
16037
- }
16038
- }
16039
- }, stepMs);
16040
- }, [baseUrl, clearMusicFade]);
16041
- const stopMusic = React114.useCallback((fadeDurationMs = 1e3) => {
16042
- const outgoing = currentMusicElRef.current;
16043
- if (!outgoing) return;
16044
- currentMusicKeyRef.current = null;
16045
- currentMusicElRef.current = null;
16046
- pendingMusicKeyRef.current = null;
16047
- clearMusicFade();
16048
- const startVolume = outgoing.volume;
16049
- const stepMs = 50;
16050
- const totalSteps = Math.max(1, fadeDurationMs / stepMs);
16051
- let step = 0;
16052
- musicFadeRef.current = setInterval(() => {
16053
- step++;
16054
- const progress = step / totalSteps;
16055
- outgoing.volume = Math.max(0, startVolume * (1 - progress));
16056
- if (progress >= 1) {
16057
- clearMusicFade();
16058
- outgoing.pause();
16059
- outgoing.src = "";
16060
- }
16061
- }, stepMs);
16062
- }, [clearMusicFade]);
16063
- const stopAll = React114.useCallback(() => {
16064
- for (const pool of poolsRef.current.values()) {
16065
- for (const audio of pool) {
16066
- audio.pause();
16067
- audio.currentTime = 0;
16068
- }
16069
- }
16070
- stopMusic(0);
16071
- }, [stopMusic]);
16072
- const setMuted = React114.useCallback((value) => {
16073
- setMutedState(value);
16074
- if (value) {
16075
- for (const [key, pool] of poolsRef.current.entries()) {
16076
- if (manifestRef.current[key]?.loop) {
16077
- for (const audio of pool) {
16078
- if (!audio.paused) audio.pause();
16079
- }
16080
- }
16081
- }
16082
- currentMusicElRef.current?.pause();
16083
- } else {
16084
- for (const [key, pool] of poolsRef.current.entries()) {
16085
- const entry = manifestRef.current[key];
16086
- if (entry?.loop && entry?.autostart) {
16087
- for (const audio of pool) {
16088
- if (audio.paused) audio.play().catch(() => {
16089
- });
16090
- }
16091
- }
16092
- }
16093
- const musicEl = currentMusicElRef.current;
16094
- if (musicEl) {
16095
- musicEl.play().catch(() => {
16096
- });
16097
- }
16098
- }
16099
- }, []);
16100
- const setMasterVolume = React114.useCallback((volume) => {
16101
- const clamped = Math.max(0, Math.min(1, volume));
16102
- setMasterVolumeState(clamped);
16103
- for (const [key, pool] of poolsRef.current.entries()) {
16104
- const entryVol = manifestRef.current[key]?.volume ?? 1;
16105
- for (const audio of pool) {
16106
- audio.volume = Math.min(1, entryVol * clamped);
16107
- }
16108
- }
16109
- if (!musicFadeRef.current && currentMusicElRef.current) {
16110
- const key = currentMusicKeyRef.current;
16111
- const entryVol = key ? manifestRef.current[key]?.volume ?? 1 : 1;
16112
- currentMusicElRef.current.volume = Math.min(1, entryVol * clamped);
16113
- }
16114
- }, []);
16115
- const unlockedRef = React114.useRef(false);
16116
- React114.useEffect(() => {
16117
- const autoKeys = Object.keys(manifest).filter((k) => manifest[k].autostart);
16118
- const hasPendingMusic = () => pendingMusicKeyRef.current !== null;
16119
- const hasAutoStart = autoKeys.length > 0;
16120
- if (!hasAutoStart && !hasPendingMusic()) return;
16121
- const unlock = () => {
16122
- if (unlockedRef.current) return;
16123
- unlockedRef.current = true;
16124
- if (!mutedRef.current) {
16125
- for (const key of autoKeys) {
16126
- play(key);
16127
- }
16128
- const pending = pendingMusicKeyRef.current;
16129
- if (pending && pending !== currentMusicKeyRef.current) {
16130
- playMusic(pending);
16131
- }
16132
- }
16133
- };
16134
- document.addEventListener("click", unlock, { once: true });
16135
- document.addEventListener("keydown", unlock, { once: true });
16136
- document.addEventListener("touchstart", unlock, { once: true });
16137
- return () => {
16138
- document.removeEventListener("click", unlock);
16139
- document.removeEventListener("keydown", unlock);
16140
- document.removeEventListener("touchstart", unlock);
16141
- };
16142
- }, [manifest, play, playMusic]);
16143
- React114.useEffect(() => {
16144
- return () => {
16145
- clearMusicFade();
16146
- for (const pool of poolsRef.current.values()) {
16147
- for (const audio of pool) {
16148
- audio.pause();
16149
- audio.src = "";
16150
- }
16151
- }
16152
- poolsRef.current.clear();
16153
- if (currentMusicElRef.current) {
16154
- currentMusicElRef.current.pause();
16155
- currentMusicElRef.current.src = "";
16156
- currentMusicElRef.current = null;
16157
- }
16158
- };
16159
- }, [clearMusicFade]);
16160
- return {
16161
- play,
16162
- stop,
16163
- stopAll,
16164
- playMusic,
16165
- stopMusic,
16166
- muted,
16167
- setMuted,
16168
- masterVolume,
16169
- setMasterVolume
16170
- };
16171
- }
16172
15911
  var init_useGameAudio = __esm({
16173
15912
  "components/game/shared/hooks/useGameAudio.ts"() {
16174
15913
  "use client";
16175
- useGameAudio.displayName = "useGameAudio";
16176
15914
  }
16177
15915
  });
16178
15916
  function useGameAudioContextOptional() {
16179
15917
  return React114.useContext(GameAudioContext);
16180
15918
  }
16181
- function GameAudioProvider({
16182
- manifest,
16183
- baseUrl = "",
16184
- children,
16185
- initialMuted = false
16186
- }) {
16187
- const eventBus = useEventBus();
16188
- const { play, stop, stopAll, playMusic, stopMusic, muted, setMuted, masterVolume, setMasterVolume } = useGameAudio({ manifest, baseUrl, initialMuted });
16189
- React114.useEffect(() => {
16190
- const unsubPlay = eventBus.on("UI:PLAY_SOUND", (event) => {
16191
- const key = event.payload?.key;
16192
- if (key) play(key);
16193
- });
16194
- const unsubStop = eventBus.on("UI:STOP_SOUND", (event) => {
16195
- const key = event.payload?.key;
16196
- if (key) {
16197
- stop(key);
16198
- } else {
16199
- stopAll();
16200
- }
16201
- });
16202
- const unsubChangeMusic = eventBus.on("UI:CHANGE_MUSIC", (event) => {
16203
- const key = event.payload?.key;
16204
- if (key) {
16205
- playMusic(key);
16206
- } else {
16207
- stopMusic();
16208
- }
16209
- });
16210
- const unsubStopMusic = eventBus.on("UI:STOP_MUSIC", () => {
16211
- stopMusic();
16212
- });
16213
- return () => {
16214
- unsubPlay();
16215
- unsubStop();
16216
- unsubChangeMusic();
16217
- unsubStopMusic();
16218
- };
16219
- }, [eventBus, play, stop, stopAll, playMusic, stopMusic]);
16220
- const value = { muted, setMuted, masterVolume, setMasterVolume, play, playMusic, stopMusic };
16221
- return /* @__PURE__ */ jsxRuntime.jsx(GameAudioContext.Provider, { value, children });
16222
- }
16223
15919
  var GameAudioContext;
16224
15920
  var init_GameAudioProvider = __esm({
16225
15921
  "components/game/shared/providers/GameAudioProvider.tsx"() {
@@ -16228,7 +15924,6 @@ var init_GameAudioProvider = __esm({
16228
15924
  init_useGameAudio();
16229
15925
  GameAudioContext = React114.createContext(null);
16230
15926
  GameAudioContext.displayName = "GameAudioContext";
16231
- GameAudioProvider.displayName = "GameAudioProvider";
16232
15927
  }
16233
15928
  });
16234
15929
  function GameAudioToggle({
@@ -25576,9 +25271,9 @@ var init_AuthLayout = __esm({
25576
25271
  }
25577
25272
  });
25578
25273
 
25579
- // node_modules/.pnpm/katex@0.16.47/node_modules/katex/dist/katex.min.css
25274
+ // node_modules/katex/dist/katex.min.css
25580
25275
  var init_katex_min = __esm({
25581
- "node_modules/.pnpm/katex@0.16.47/node_modules/katex/dist/katex.min.css"() {
25276
+ "node_modules/katex/dist/katex.min.css"() {
25582
25277
  }
25583
25278
  });
25584
25279
  var Tabs;
@@ -29971,129 +29666,6 @@ var init_Breadcrumb = __esm({
29971
29666
  Breadcrumb.displayName = "Breadcrumb";
29972
29667
  }
29973
29668
  });
29974
- function useSafeEventBus2() {
29975
- try {
29976
- return useEventBus();
29977
- } catch {
29978
- return { emit: () => {
29979
- }, on: () => () => {
29980
- }, once: () => {
29981
- } };
29982
- }
29983
- }
29984
- var log5, lookStyles4, ButtonGroup;
29985
- var init_ButtonGroup = __esm({
29986
- "components/core/molecules/ButtonGroup.tsx"() {
29987
- "use client";
29988
- init_cn();
29989
- init_atoms();
29990
- init_useEventBus();
29991
- log5 = logger.createLogger("almadar:ui:button-group");
29992
- lookStyles4 = {
29993
- "right-aligned-buttons": "",
29994
- "floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
29995
- "inline-row": "gap-2 inline-flex",
29996
- "dropdown-menu": "[&>button:not(:first-child)]:hidden",
29997
- "command-palette-trigger": "[&>button:not(:first-child)]:hidden"
29998
- };
29999
- ButtonGroup = ({
30000
- children,
30001
- primary,
30002
- secondary,
30003
- variant = "default",
30004
- orientation = "horizontal",
30005
- className,
30006
- // Filter-group pattern props (entity and filters are used for schema-driven filtering)
30007
- entity: _entity,
30008
- filters,
30009
- look = "right-aligned-buttons"
30010
- }) => {
30011
- const eventBus = useSafeEventBus2();
30012
- const variantClasses2 = {
30013
- default: "gap-0",
30014
- 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",
30015
- 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"
30016
- };
30017
- const orientationClasses = {
30018
- horizontal: "flex-row",
30019
- 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"
30020
- };
30021
- const handleActionClick = (action) => {
30022
- if (action.event) {
30023
- eventBus.emit("UI:DISPATCH", { event: action.event });
30024
- }
30025
- if (action.navigatesTo) {
30026
- eventBus.emit("UI:NAVIGATE", { url: action.navigatesTo });
30027
- }
30028
- };
30029
- const renderFormActions = () => {
30030
- const buttons = [];
30031
- if (secondary) {
30032
- secondary.forEach((action, index) => {
30033
- buttons.push(
30034
- /* @__PURE__ */ jsxRuntime.jsx(
30035
- Button,
30036
- {
30037
- type: action.actionType === "submit" ? "submit" : "button",
30038
- variant: action.variant || "ghost",
30039
- onClick: () => handleActionClick(action),
30040
- children: action.label
30041
- },
30042
- `secondary-${index}`
30043
- )
30044
- );
30045
- });
30046
- }
30047
- if (primary) {
30048
- const isSubmit = primary.actionType === "submit";
30049
- buttons.push(
30050
- /* @__PURE__ */ jsxRuntime.jsx(
30051
- Button,
30052
- {
30053
- type: isSubmit ? "submit" : "button",
30054
- variant: primary.variant || "primary",
30055
- onClick: () => handleActionClick(primary),
30056
- "data-testid": isSubmit ? "form-submit" : void 0,
30057
- children: primary.label
30058
- },
30059
- "primary"
30060
- )
30061
- );
30062
- }
30063
- return buttons;
30064
- };
30065
- const renderFilters = () => {
30066
- if (!filters || filters.length === 0) return null;
30067
- return filters.map((filter, index) => /* @__PURE__ */ jsxRuntime.jsx(
30068
- Button,
30069
- {
30070
- variant: "ghost",
30071
- onClick: () => {
30072
- log5.debug("Filter clicked", { field: filter.field });
30073
- },
30074
- children: filter.label
30075
- },
30076
- `filter-${filter.field}-${index}`
30077
- ));
30078
- };
30079
- return /* @__PURE__ */ jsxRuntime.jsx(
30080
- "div",
30081
- {
30082
- className: cn(
30083
- "inline-flex gap-2",
30084
- variantClasses2[variant],
30085
- orientationClasses[orientation],
30086
- lookStyles4[look],
30087
- className
30088
- ),
30089
- role: "group",
30090
- children: children || renderFilters() || renderFormActions()
30091
- }
30092
- );
30093
- };
30094
- ButtonGroup.displayName = "ButtonGroup";
30095
- }
30096
- });
30097
29669
  function useSwipeGesture(callbacks, options = {}) {
30098
29670
  const { threshold = 50, velocityThreshold = 0.3, preventDefault = false } = options;
30099
29671
  const startX = React114.useRef(0);
@@ -30903,7 +30475,7 @@ var init_CardGrid = __esm({
30903
30475
  CardGrid.displayName = "CardGrid";
30904
30476
  }
30905
30477
  });
30906
- function useSafeEventBus3() {
30478
+ function useSafeEventBus2() {
30907
30479
  try {
30908
30480
  return useEventBus();
30909
30481
  } catch {
@@ -30939,7 +30511,7 @@ var init_Carousel = __esm({
30939
30511
  const [activeIndex, setActiveIndex] = React114.useState(0);
30940
30512
  const scrollRef = React114.useRef(null);
30941
30513
  const autoPlayRef = React114.useRef(null);
30942
- const eventBus = useSafeEventBus3();
30514
+ const eventBus = useSafeEventBus2();
30943
30515
  const { t } = hooks.useTranslate();
30944
30516
  const safeItems = items ?? [];
30945
30517
  const totalSlides = safeItems.length;
@@ -34275,7 +33847,7 @@ function DataGrid({
34275
33847
  /* @__PURE__ */ jsxRuntime.jsx(
34276
33848
  Box,
34277
33849
  {
34278
- className: cn("grid", gapStyles5[gap], scrollX ? "grid-flow-col overflow-x-auto" : colsClass, lookStyles5[look], className),
33850
+ className: cn("grid", gapStyles5[gap], scrollX ? "grid-flow-col overflow-x-auto" : colsClass, lookStyles4[look], className),
34279
33851
  style: scrollX ? { gridAutoFlow: "column", gridAutoColumns: `minmax(${minCardWidth}px, 1fr)` } : gridTemplateColumns ? { gridTemplateColumns } : void 0,
34280
33852
  children: data.map((item, index) => {
34281
33853
  const itemData = item;
@@ -34470,7 +34042,7 @@ function DataGrid({
34470
34042
  ] })
34471
34043
  );
34472
34044
  }
34473
- var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles5;
34045
+ var dataGridLog, BADGE_VARIANTS, gapStyles5, lookStyles4;
34474
34046
  var init_DataGrid = __esm({
34475
34047
  "components/core/molecules/DataGrid.tsx"() {
34476
34048
  "use client";
@@ -34505,7 +34077,7 @@ var init_DataGrid = __esm({
34505
34077
  lg: "gap-6",
34506
34078
  xl: "gap-8"
34507
34079
  };
34508
- lookStyles5 = {
34080
+ lookStyles4 = {
34509
34081
  dense: "gap-2 [&>*]:p-card-sm",
34510
34082
  spacious: "gap-8 [&>*]:p-card-lg",
34511
34083
  striped: "[&>*:nth-child(even)]:bg-muted/30",
@@ -34932,6 +34504,133 @@ var init_DataList = __esm({
34932
34504
  DataList.displayName = "DataList";
34933
34505
  }
34934
34506
  });
34507
+ var FormSection, FormLayout, FormActions;
34508
+ var init_FormSection = __esm({
34509
+ "components/core/molecules/FormSection.tsx"() {
34510
+ "use client";
34511
+ init_cn();
34512
+ init_atoms();
34513
+ init_Box();
34514
+ init_Typography();
34515
+ init_Button();
34516
+ init_Stack();
34517
+ init_Icon();
34518
+ init_useEventBus();
34519
+ FormSection = ({
34520
+ title,
34521
+ description,
34522
+ children,
34523
+ collapsible = false,
34524
+ defaultCollapsed = false,
34525
+ card = false,
34526
+ columns = 1,
34527
+ className
34528
+ }) => {
34529
+ const [collapsed, setCollapsed] = React114__namespace.default.useState(defaultCollapsed);
34530
+ const { t } = hooks.useTranslate();
34531
+ const eventBus = useEventBus();
34532
+ const gridClass = {
34533
+ 1: "grid-cols-1",
34534
+ 2: "grid-cols-1 md:grid-cols-2",
34535
+ 3: "grid-cols-1 md:grid-cols-2 lg:grid-cols-3"
34536
+ }[columns];
34537
+ React114__namespace.default.useCallback(() => {
34538
+ if (collapsible) {
34539
+ setCollapsed((prev) => !prev);
34540
+ eventBus.emit("UI:TOGGLE_COLLAPSE", { collapsed: !collapsed });
34541
+ }
34542
+ }, [collapsible, collapsed, eventBus]);
34543
+ const content = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
34544
+ (title || description) && /* @__PURE__ */ jsxRuntime.jsxs(VStack, { gap: "xs", className: "mb-4", children: [
34545
+ title && /* @__PURE__ */ jsxRuntime.jsxs(
34546
+ HStack,
34547
+ {
34548
+ justify: "between",
34549
+ align: "center",
34550
+ className: cn(collapsible && "cursor-pointer"),
34551
+ action: collapsible ? "TOGGLE_COLLAPSE" : void 0,
34552
+ children: [
34553
+ /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h3", weight: "semibold", children: title }),
34554
+ collapsible && /* @__PURE__ */ jsxRuntime.jsx(
34555
+ Button,
34556
+ {
34557
+ variant: "ghost",
34558
+ size: "sm",
34559
+ action: "TOGGLE_COLLAPSE",
34560
+ children: /* @__PURE__ */ jsxRuntime.jsx(
34561
+ Icon,
34562
+ {
34563
+ icon: LucideIcons2.ChevronDown,
34564
+ size: "sm",
34565
+ className: cn(
34566
+ "text-muted-foreground transition-transform",
34567
+ collapsed && "rotate-180"
34568
+ )
34569
+ }
34570
+ )
34571
+ }
34572
+ )
34573
+ ]
34574
+ }
34575
+ ),
34576
+ description && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "secondary", children: description })
34577
+ ] }),
34578
+ (!collapsible || !collapsed) && /* @__PURE__ */ jsxRuntime.jsx(Box, { className: cn("grid gap-4", gridClass), children })
34579
+ ] });
34580
+ if (card) {
34581
+ return /* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("p-6", className), children: content });
34582
+ }
34583
+ return /* @__PURE__ */ jsxRuntime.jsx(Box, { className, children: content });
34584
+ };
34585
+ FormSection.displayName = "FormSection";
34586
+ FormLayout = ({
34587
+ children,
34588
+ dividers = true,
34589
+ className
34590
+ }) => {
34591
+ return /* @__PURE__ */ jsxRuntime.jsx(
34592
+ VStack,
34593
+ {
34594
+ gap: "lg",
34595
+ className: cn(
34596
+ dividers && "[&>*+*]:pt-8 [&>*+*]:border-t [&>*+*]:border-border",
34597
+ className
34598
+ ),
34599
+ children
34600
+ }
34601
+ );
34602
+ };
34603
+ FormLayout.displayName = "FormLayout";
34604
+ FormActions = ({
34605
+ children,
34606
+ sticky = false,
34607
+ align = "right",
34608
+ className
34609
+ }) => {
34610
+ const alignClass2 = {
34611
+ left: "justify-start",
34612
+ right: "justify-end",
34613
+ between: "justify-between",
34614
+ center: "justify-center"
34615
+ }[align];
34616
+ return /* @__PURE__ */ jsxRuntime.jsx(
34617
+ HStack,
34618
+ {
34619
+ gap: "sm",
34620
+ align: "center",
34621
+ className: cn(
34622
+ "pt-6 border-t border-border",
34623
+ alignClass2,
34624
+ sticky && "sticky bottom-0 bg-card py-4 -mx-6 px-6 shadow-[0_-4px_6px_-1px_rgb(0,0,0,0.05)]",
34625
+ className
34626
+ ),
34627
+ children
34628
+ }
34629
+ );
34630
+ };
34631
+ FormActions.displayName = "FormActions";
34632
+ }
34633
+ });
34935
34634
  function fileIcon(name) {
34936
34635
  const ext = name.split(".").pop()?.toLowerCase() ?? "";
34937
34636
  switch (ext) {
@@ -35093,6 +34792,129 @@ var init_FormField = __esm({
35093
34792
  FormField.displayName = "FormField";
35094
34793
  }
35095
34794
  });
34795
+ function useSafeEventBus3() {
34796
+ try {
34797
+ return useEventBus();
34798
+ } catch {
34799
+ return { emit: () => {
34800
+ }, on: () => () => {
34801
+ }, once: () => {
34802
+ } };
34803
+ }
34804
+ }
34805
+ var log5, lookStyles5, ButtonGroup;
34806
+ var init_ButtonGroup = __esm({
34807
+ "components/core/molecules/ButtonGroup.tsx"() {
34808
+ "use client";
34809
+ init_cn();
34810
+ init_atoms();
34811
+ init_useEventBus();
34812
+ log5 = logger.createLogger("almadar:ui:button-group");
34813
+ lookStyles5 = {
34814
+ "right-aligned-buttons": "",
34815
+ "floating-bar": "fixed bottom-section left-1/2 -translate-x-1/2 shadow-elevation-toast bg-card p-card-sm rounded-container",
34816
+ "inline-row": "gap-2 inline-flex",
34817
+ "dropdown-menu": "[&>button:not(:first-child)]:hidden",
34818
+ "command-palette-trigger": "[&>button:not(:first-child)]:hidden"
34819
+ };
34820
+ ButtonGroup = ({
34821
+ children,
34822
+ primary,
34823
+ secondary,
34824
+ variant = "default",
34825
+ orientation = "horizontal",
34826
+ className,
34827
+ // Filter-group pattern props (entity and filters are used for schema-driven filtering)
34828
+ entity: _entity,
34829
+ filters,
34830
+ look = "right-aligned-buttons"
34831
+ }) => {
34832
+ const eventBus = useSafeEventBus3();
34833
+ const variantClasses2 = {
34834
+ default: "gap-0",
34835
+ 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",
34836
+ 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"
34837
+ };
34838
+ const orientationClasses = {
34839
+ horizontal: "flex-row",
34840
+ 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"
34841
+ };
34842
+ const handleActionClick = (action) => {
34843
+ if (action.event) {
34844
+ eventBus.emit("UI:DISPATCH", { event: action.event });
34845
+ }
34846
+ if (action.navigatesTo) {
34847
+ eventBus.emit("UI:NAVIGATE", { url: action.navigatesTo });
34848
+ }
34849
+ };
34850
+ const renderFormActions = () => {
34851
+ const buttons = [];
34852
+ if (secondary) {
34853
+ secondary.forEach((action, index) => {
34854
+ buttons.push(
34855
+ /* @__PURE__ */ jsxRuntime.jsx(
34856
+ Button,
34857
+ {
34858
+ type: action.actionType === "submit" ? "submit" : "button",
34859
+ variant: action.variant || "ghost",
34860
+ onClick: () => handleActionClick(action),
34861
+ children: action.label
34862
+ },
34863
+ `secondary-${index}`
34864
+ )
34865
+ );
34866
+ });
34867
+ }
34868
+ if (primary) {
34869
+ const isSubmit = primary.actionType === "submit";
34870
+ buttons.push(
34871
+ /* @__PURE__ */ jsxRuntime.jsx(
34872
+ Button,
34873
+ {
34874
+ type: isSubmit ? "submit" : "button",
34875
+ variant: primary.variant || "primary",
34876
+ onClick: () => handleActionClick(primary),
34877
+ "data-testid": isSubmit ? "form-submit" : void 0,
34878
+ children: primary.label
34879
+ },
34880
+ "primary"
34881
+ )
34882
+ );
34883
+ }
34884
+ return buttons;
34885
+ };
34886
+ const renderFilters = () => {
34887
+ if (!filters || filters.length === 0) return null;
34888
+ return filters.map((filter, index) => /* @__PURE__ */ jsxRuntime.jsx(
34889
+ Button,
34890
+ {
34891
+ variant: "ghost",
34892
+ onClick: () => {
34893
+ log5.debug("Filter clicked", { field: filter.field });
34894
+ },
34895
+ children: filter.label
34896
+ },
34897
+ `filter-${filter.field}-${index}`
34898
+ ));
34899
+ };
34900
+ return /* @__PURE__ */ jsxRuntime.jsx(
34901
+ "div",
34902
+ {
34903
+ className: cn(
34904
+ "inline-flex gap-2",
34905
+ variantClasses2[variant],
34906
+ orientationClasses[orientation],
34907
+ lookStyles5[look],
34908
+ className
34909
+ ),
34910
+ role: "group",
34911
+ children: children || renderFilters() || renderFormActions()
34912
+ }
34913
+ );
34914
+ };
34915
+ ButtonGroup.displayName = "ButtonGroup";
34916
+ }
34917
+ });
35096
34918
  function getOrCreateStore(query) {
35097
34919
  if (!queryStores.has(query)) {
35098
34920
  queryStores.set(query, {
@@ -53263,7 +53085,6 @@ var init_component_registry_generated = __esm({
53263
53085
  init_BranchingLogicBuilder();
53264
53086
  init_Breadcrumb();
53265
53087
  init_BuilderBoard();
53266
- init_ButtonGroup();
53267
53088
  init_CTABanner();
53268
53089
  init_CalendarGrid();
53269
53090
  init_Canvas2D();
@@ -53340,9 +53161,9 @@ var init_component_registry_generated = __esm({
53340
53161
  init_FlipContainer();
53341
53162
  init_FloatingActionButton();
53342
53163
  init_Form();
53164
+ init_FormSection();
53343
53165
  init_FormField();
53344
53166
  init_FormSectionHeader();
53345
- init_GameAudioProvider();
53346
53167
  init_GameAudioToggle();
53347
53168
  init_GameCard();
53348
53169
  init_GameHud();
@@ -53591,7 +53412,6 @@ var init_component_registry_generated = __esm({
53591
53412
  "Breadcrumb": Breadcrumb,
53592
53413
  "BuilderBoard": BuilderBoard,
53593
53414
  "Button": ButtonPattern,
53594
- "ButtonGroup": ButtonGroup,
53595
53415
  "ButtonPattern": ButtonPattern,
53596
53416
  "CTABanner": CTABanner,
53597
53417
  "CalendarGrid": CalendarGrid,
@@ -53671,9 +53491,10 @@ var init_component_registry_generated = __esm({
53671
53491
  "FlipContainer": FlipContainer,
53672
53492
  "FloatingActionButton": FloatingActionButton,
53673
53493
  "Form": Form,
53494
+ "FormActions": FormActions,
53674
53495
  "FormField": FormField,
53496
+ "FormLayout": FormLayout,
53675
53497
  "FormSectionHeader": FormSectionHeader,
53676
- "GameAudioProvider": GameAudioProvider,
53677
53498
  "GameAudioToggle": GameAudioToggle,
53678
53499
  "GameBoard3D": GameBoard3D,
53679
53500
  "GameCanvas3D": GameCanvas3D,