@almadar/ui 4.20.0 → 4.22.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 (51) hide show
  1. package/dist/avl/index.cjs +5 -1
  2. package/dist/avl/index.js +5 -1
  3. package/dist/components/index.cjs +5 -1
  4. package/dist/components/index.js +5 -1
  5. package/dist/components/molecules/Accordion.d.ts +5 -1
  6. package/dist/components/molecules/CalendarGrid.d.ts +8 -5
  7. package/dist/components/molecules/Card.d.ts +3 -3
  8. package/dist/components/molecules/Carousel.d.ts +4 -1
  9. package/dist/components/molecules/EmptyState.d.ts +2 -1
  10. package/dist/components/molecules/ErrorState.d.ts +2 -1
  11. package/dist/components/molecules/MapView.d.ts +7 -3
  12. package/dist/components/molecules/Modal.d.ts +2 -1
  13. package/dist/components/molecules/Pagination.d.ts +7 -2
  14. package/dist/components/molecules/SidePanel.d.ts +2 -1
  15. package/dist/components/molecules/Tabs.d.ts +7 -2
  16. package/dist/components/molecules/Toast.d.ts +3 -2
  17. package/dist/components/molecules/WizardProgress.d.ts +4 -1
  18. package/dist/components/molecules/game/ActionButtons.d.ts +5 -1
  19. package/dist/components/molecules/game/CraftingRecipe.d.ts +4 -1
  20. package/dist/components/molecules/game/DPad.d.ts +5 -1
  21. package/dist/components/molecules/game/DialogueBox.d.ts +7 -5
  22. package/dist/components/molecules/game/InventoryGrid.d.ts +4 -1
  23. package/dist/components/molecules/game/InventoryPanel.d.ts +12 -6
  24. package/dist/components/molecules/game/IsometricCanvas.d.ts +13 -4
  25. package/dist/components/molecules/game/PlatformerCanvas.d.ts +9 -4
  26. package/dist/components/organisms/GraphCanvas.d.ts +4 -2
  27. package/dist/components/organisms/MediaGallery.d.ts +4 -1
  28. package/dist/components/organisms/PageHeader.d.ts +2 -1
  29. package/dist/components/organisms/Sidebar.d.ts +6 -3
  30. package/dist/components/organisms/SignaturePad.d.ts +5 -2
  31. package/dist/components/organisms/game/BattleBoard.d.ts +20 -8
  32. package/dist/components/organisms/game/CanvasEffect.d.ts +2 -1
  33. package/dist/components/organisms/game/CastleBoard.d.ts +14 -3
  34. package/dist/components/organisms/game/GameCanvas3D.d.ts +52 -8
  35. package/dist/components/organisms/game/TraitSlot.d.ts +7 -2
  36. package/dist/components/organisms/game/WorldMapBoard.d.ts +22 -5
  37. package/dist/components/organisms/game/hooks/useBattleState.d.ts +19 -7
  38. package/dist/components/organisms/game/puzzles/builder/BuilderBoard.d.ts +5 -1
  39. package/dist/components/organisms/game/puzzles/classifier/ClassifierBoard.d.ts +5 -1
  40. package/dist/components/organisms/game/puzzles/debugger/DebuggerBoard.d.ts +5 -1
  41. package/dist/components/organisms/game/puzzles/event-handler/EventHandlerBoard.d.ts +5 -2
  42. package/dist/components/organisms/game/puzzles/negotiator/NegotiatorBoard.d.ts +5 -1
  43. package/dist/components/organisms/game/puzzles/sequencer/SequencerBoard.d.ts +8 -2
  44. package/dist/components/organisms/game/puzzles/simulator/SimulatorBoard.d.ts +5 -1
  45. package/dist/components/organisms/game/puzzles/state-architect/StateArchitectBoard.d.ts +6 -2
  46. package/dist/components/organisms/game/three/hooks/useGameCanvas3DEvents.d.ts +52 -8
  47. package/dist/providers/index.cjs +5 -1
  48. package/dist/providers/index.js +5 -1
  49. package/dist/runtime/index.cjs +5 -1
  50. package/dist/runtime/index.js +5 -1
  51. package/package.json +2 -2
@@ -20318,6 +20318,7 @@ var init_Tabs = __esm({
20318
20318
  defaultActiveTab,
20319
20319
  activeTab: controlledActiveTab,
20320
20320
  onTabChange,
20321
+ tabChangeEvent,
20321
20322
  variant = "default",
20322
20323
  orientation = "horizontal",
20323
20324
  className
@@ -20340,6 +20341,9 @@ var init_Tabs = __esm({
20340
20341
  setInternalActiveTab(tabId);
20341
20342
  }
20342
20343
  onTabChange?.(tabId);
20344
+ if (tabChangeEvent) {
20345
+ eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
20346
+ }
20343
20347
  if (tabEvent) {
20344
20348
  eventBus.emit(`UI:${tabEvent}`, { tabId });
20345
20349
  }
@@ -20420,7 +20424,7 @@ var init_Tabs = __esm({
20420
20424
  isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
20421
20425
  ),
20422
20426
  children: [
20423
- item.icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: item.icon, size: "sm" }),
20427
+ item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: item.icon, size: "sm" })),
20424
20428
  /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
20425
20429
  item.badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", size: "sm", children: item.badge })
20426
20430
  ]
package/dist/avl/index.js CHANGED
@@ -20272,6 +20272,7 @@ var init_Tabs = __esm({
20272
20272
  defaultActiveTab,
20273
20273
  activeTab: controlledActiveTab,
20274
20274
  onTabChange,
20275
+ tabChangeEvent,
20275
20276
  variant = "default",
20276
20277
  orientation = "horizontal",
20277
20278
  className
@@ -20294,6 +20295,9 @@ var init_Tabs = __esm({
20294
20295
  setInternalActiveTab(tabId);
20295
20296
  }
20296
20297
  onTabChange?.(tabId);
20298
+ if (tabChangeEvent) {
20299
+ eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
20300
+ }
20297
20301
  if (tabEvent) {
20298
20302
  eventBus.emit(`UI:${tabEvent}`, { tabId });
20299
20303
  }
@@ -20374,7 +20378,7 @@ var init_Tabs = __esm({
20374
20378
  isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
20375
20379
  ),
20376
20380
  children: [
20377
- item.icon && /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" }),
20381
+ item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
20378
20382
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
20379
20383
  item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
20380
20384
  ]
@@ -15561,6 +15561,7 @@ var init_Tabs = __esm({
15561
15561
  defaultActiveTab,
15562
15562
  activeTab: controlledActiveTab,
15563
15563
  onTabChange,
15564
+ tabChangeEvent,
15564
15565
  variant = "default",
15565
15566
  orientation = "horizontal",
15566
15567
  className
@@ -15583,6 +15584,9 @@ var init_Tabs = __esm({
15583
15584
  setInternalActiveTab(tabId);
15584
15585
  }
15585
15586
  onTabChange?.(tabId);
15587
+ if (tabChangeEvent) {
15588
+ eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
15589
+ }
15586
15590
  if (tabEvent) {
15587
15591
  eventBus.emit(`UI:${tabEvent}`, { tabId });
15588
15592
  }
@@ -15663,7 +15667,7 @@ var init_Tabs = __esm({
15663
15667
  isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
15664
15668
  ),
15665
15669
  children: [
15666
- item.icon && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { icon: item.icon, size: "sm" }),
15670
+ item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { icon: item.icon, size: "sm" })),
15667
15671
  /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
15668
15672
  item.badge !== void 0 && /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: "default", size: "sm", children: item.badge })
15669
15673
  ]
@@ -15516,6 +15516,7 @@ var init_Tabs = __esm({
15516
15516
  defaultActiveTab,
15517
15517
  activeTab: controlledActiveTab,
15518
15518
  onTabChange,
15519
+ tabChangeEvent,
15519
15520
  variant = "default",
15520
15521
  orientation = "horizontal",
15521
15522
  className
@@ -15538,6 +15539,9 @@ var init_Tabs = __esm({
15538
15539
  setInternalActiveTab(tabId);
15539
15540
  }
15540
15541
  onTabChange?.(tabId);
15542
+ if (tabChangeEvent) {
15543
+ eventBus.emit(`UI:${tabChangeEvent}`, { tabId });
15544
+ }
15541
15545
  if (tabEvent) {
15542
15546
  eventBus.emit(`UI:${tabEvent}`, { tabId });
15543
15547
  }
@@ -15618,7 +15622,7 @@ var init_Tabs = __esm({
15618
15622
  isActive ? variant === "pills" ? "text-primary-foreground font-bold" : "text-foreground font-bold" : "text-muted-foreground hover:text-foreground"
15619
15623
  ),
15620
15624
  children: [
15621
- item.icon && /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" }),
15625
+ item.icon && (typeof item.icon === "string" ? /* @__PURE__ */ jsx(Icon, { name: item.icon, size: "sm" }) : /* @__PURE__ */ jsx(Icon, { icon: item.icon, size: "sm" })),
15622
15626
  /* @__PURE__ */ jsx(Typography, { variant: "small", weight: isActive ? "semibold" : "normal", className: "!text-inherit", children: item.label }),
15623
15627
  item.badge !== void 0 && /* @__PURE__ */ jsx(Badge, { variant: "default", size: "sm", children: item.badge })
15624
15628
  ]
@@ -5,6 +5,7 @@
5
5
  * Uses Button, Icon, Typography, and Divider atoms.
6
6
  */
7
7
  import React from "react";
8
+ import type { EventEmit } from "@almadar/core";
8
9
  export interface AccordionItem {
9
10
  /**
10
11
  * Item ID (auto-generated from header/title if not provided)
@@ -62,6 +63,9 @@ export interface AccordionProps {
62
63
  */
63
64
  className?: string;
64
65
  /** Declarative toggle event — emits UI:{toggleEvent} with { itemId, isOpen } */
65
- toggleEvent?: string;
66
+ toggleEvent?: EventEmit<{
67
+ itemId: string;
68
+ isOpen: boolean;
69
+ }>;
66
70
  }
67
71
  export declare const Accordion: React.FC<AccordionProps>;
@@ -6,7 +6,7 @@
6
6
  * Composes DayCell and TimeSlotCell atoms into a 7-day grid.
7
7
  */
8
8
  import React from "react";
9
- import type { EventPayload } from "@almadar/core";
9
+ import type { EventEmit, EventPayload } from "@almadar/core";
10
10
  export interface CalendarEvent {
11
11
  id: string;
12
12
  title: string;
@@ -29,14 +29,17 @@ export interface CalendarGridProps {
29
29
  onEventClick?: (event: CalendarEvent) => void;
30
30
  /** Additional CSS classes */
31
31
  className?: string;
32
- /** Event emitted on long-press of a time slot: UI:{longPressEvent} with { date, time } */
33
- longPressEvent?: string;
32
+ /** Event emitted on long-press of a time slot: UI:{longPressEvent} with { date, time, ...longPressPayload } */
33
+ longPressEvent?: EventEmit<{
34
+ date: string;
35
+ time?: string;
36
+ }>;
34
37
  /** Additional payload for long-press events */
35
38
  longPressPayload?: EventPayload;
36
39
  /** Event emitted on swipe left (next week): UI:{swipeLeftEvent} */
37
- swipeLeftEvent?: string;
40
+ swipeLeftEvent?: EventEmit<Record<string, never>>;
38
41
  /** Event emitted on swipe right (prev week): UI:{swipeRightEvent} */
39
- swipeRightEvent?: string;
42
+ swipeRightEvent?: EventEmit<Record<string, never>>;
40
43
  }
41
44
  export declare function CalendarGrid({ weekStart, timeSlots, events, onSlotClick, onDayClick, onEventClick, className, longPressEvent, longPressPayload, swipeLeftEvent, swipeRightEvent, }: CalendarGridProps): React.JSX.Element;
42
45
  export declare namespace CalendarGrid {
@@ -7,7 +7,7 @@
7
7
  * @generated by Orbital Compiler
8
8
  */
9
9
  import React from "react";
10
- import type { EventKey, EventPayload } from "@almadar/core";
10
+ import type { EventEmit, EventKey, EventPayload } from "@almadar/core";
11
11
  export interface CardAction {
12
12
  label: string;
13
13
  onClick?: () => void;
@@ -42,8 +42,8 @@ export interface CardProps {
42
42
  level?: number;
43
43
  /** Maximum level */
44
44
  maxLevel?: number;
45
- /** Event emitted on long press: UI:{longPressEvent} */
46
- longPressEvent?: string;
45
+ /** Event emitted on long press: UI:{longPressEvent} (payload: longPressPayload spread — variable) */
46
+ longPressEvent?: EventEmit<EventPayload>;
47
47
  /** Additional payload for long-press events */
48
48
  longPressPayload?: EventPayload;
49
49
  }
@@ -6,6 +6,7 @@
6
6
  * Pure UI molecule with no entity binding.
7
7
  */
8
8
  import React from 'react';
9
+ import type { EventEmit } from '@almadar/core';
9
10
  export interface CarouselProps<T = Record<string, unknown>> {
10
11
  /** Array of items to display as slides */
11
12
  items: T[];
@@ -24,7 +25,9 @@ export interface CarouselProps<T = Record<string, unknown>> {
24
25
  /** Enable infinite loop */
25
26
  loop?: boolean;
26
27
  /** Declarative event name for slide change */
27
- slideChangeEvent?: string;
28
+ slideChangeEvent?: EventEmit<{
29
+ index: number;
30
+ }>;
28
31
  /** Payload to include with the slide change event */
29
32
  slideChangePayload?: Record<string, unknown>;
30
33
  /** Additional CSS classes */
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import type { EventEmit } from "@almadar/core";
2
3
  import { LucideIcon } from "lucide-react";
3
4
  export interface EmptyStateProps {
4
5
  /**
@@ -20,6 +21,6 @@ export interface EmptyStateProps {
20
21
  /** Variant for color styling */
21
22
  variant?: "default" | "success" | "error" | "warning" | "info";
22
23
  /** Declarative action event — emits UI:{actionEvent} via eventBus when action button is clicked */
23
- actionEvent?: string;
24
+ actionEvent?: EventEmit<Record<string, never>>;
24
25
  }
25
26
  export declare const EmptyState: React.FC<EmptyStateProps>;
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import type { EventEmit } from "@almadar/core";
2
3
  export interface ErrorStateProps {
3
4
  title?: string;
4
5
  /** Error message to display */
@@ -8,6 +9,6 @@ export interface ErrorStateProps {
8
9
  onRetry?: () => void;
9
10
  className?: string;
10
11
  /** Declarative retry event — emits UI:{retryEvent} via eventBus when retry button is clicked */
11
- retryEvent?: string;
12
+ retryEvent?: EventEmit<Record<string, never>>;
12
13
  }
13
14
  export declare const ErrorState: React.FC<ErrorStateProps>;
@@ -1,3 +1,4 @@
1
+ import type { EventEmit } from '@almadar/core';
1
2
  export interface MapMarkerData {
2
3
  /** Unique marker identifier */
3
4
  id: string | number;
@@ -26,9 +27,12 @@ export interface MapViewProps {
26
27
  /** Callback when the map is clicked (programmatic use) */
27
28
  onMapClick?: (lat: number, lng: number) => void;
28
29
  /** Event name dispatched via event bus when the map is clicked. Payload: { latitude, longitude } */
29
- mapClickEvent?: string;
30
- /** Event name dispatched via event bus when a marker is clicked. Payload: marker data */
31
- markerClickEvent?: string;
30
+ mapClickEvent?: EventEmit<{
31
+ latitude: number;
32
+ longitude: number;
33
+ }>;
34
+ /** Event name dispatched via event bus when a marker is clicked. Payload: full MapMarkerData spread. */
35
+ markerClickEvent?: EventEmit<MapMarkerData>;
32
36
  /** Whether to show a pin at the clicked location */
33
37
  showClickedPin?: boolean;
34
38
  /** Additional CSS classes */
@@ -5,6 +5,7 @@
5
5
  * Uses theme-aware CSS variables for styling.
6
6
  */
7
7
  import React from "react";
8
+ import type { EventEmit } from "@almadar/core";
8
9
  export type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
9
10
  export interface ModalProps {
10
11
  /** Whether the modal is open (defaults to true when rendered by slot wrapper) */
@@ -21,7 +22,7 @@ export interface ModalProps {
21
22
  closeOnEscape?: boolean;
22
23
  className?: string;
23
24
  /** Declarative close event — emits UI:{closeEvent} via eventBus when modal should close */
24
- closeEvent?: string;
25
+ closeEvent?: EventEmit<Record<string, never>>;
25
26
  /** Enable swipe-down-to-close on mobile bottom sheet (default: true) */
26
27
  swipeDownToClose?: boolean;
27
28
  }
@@ -5,6 +5,7 @@
5
5
  * Uses Button, Icon, Typography, and Input atoms.
6
6
  */
7
7
  import React from "react";
8
+ import type { EventEmit } from "@almadar/core";
8
9
  export interface PaginationProps {
9
10
  /**
10
11
  * Current page (1-indexed)
@@ -59,8 +60,12 @@ export interface PaginationProps {
59
60
  */
60
61
  className?: string;
61
62
  /** Declarative page change event — emits UI:{pageChangeEvent} with { page } */
62
- pageChangeEvent?: string;
63
+ pageChangeEvent?: EventEmit<{
64
+ page: number;
65
+ }>;
63
66
  /** Declarative page size change event — emits UI:{pageSizeChangeEvent} with { pageSize } */
64
- pageSizeChangeEvent?: string;
67
+ pageSizeChangeEvent?: EventEmit<{
68
+ pageSize: number;
69
+ }>;
65
70
  }
66
71
  export declare const Pagination: React.FC<PaginationProps>;
@@ -5,6 +5,7 @@
5
5
  * Uses Button, Typography atoms.
6
6
  */
7
7
  import React from "react";
8
+ import type { EventEmit } from "@almadar/core";
8
9
  export interface SidePanelProps {
9
10
  /**
10
11
  * Panel title
@@ -42,6 +43,6 @@ export interface SidePanelProps {
42
43
  */
43
44
  className?: string;
44
45
  /** Declarative close event — emits UI:{closeEvent} via eventBus when panel should close */
45
- closeEvent?: string;
46
+ closeEvent?: EventEmit<Record<string, never>>;
46
47
  }
47
48
  export declare const SidePanel: React.FC<SidePanelProps>;
@@ -6,6 +6,7 @@
6
6
  */
7
7
  import React from 'react';
8
8
  import type { LucideIcon } from 'lucide-react';
9
+ import type { EventEmit } from '@almadar/core';
9
10
  export interface TabItem {
10
11
  /** Tab ID */
11
12
  id: string;
@@ -13,8 +14,8 @@ export interface TabItem {
13
14
  label: string;
14
15
  /** Tab content - optional for event-driven tabs */
15
16
  content?: React.ReactNode;
16
- /** Tab icon */
17
- icon?: LucideIcon;
17
+ /** Tab icon — pass either a Lucide component or its registry name (e.g. "file-text") */
18
+ icon?: LucideIcon | string;
18
19
  /** Tab badge */
19
20
  badge?: string | number;
20
21
  /** Disable tab */
@@ -35,6 +36,10 @@ export interface TabsProps {
35
36
  activeTab?: string;
36
37
  /** Callback when tab changes */
37
38
  onTabChange?: (tabId: string) => void;
39
+ /** Declarative tab change event — emits UI:{tabChangeEvent} with { tabId } */
40
+ tabChangeEvent?: EventEmit<{
41
+ tabId: string;
42
+ }>;
38
43
  /** Tab variant */
39
44
  variant?: 'default' | 'pills' | 'underline';
40
45
  /** Tab orientation */
@@ -5,6 +5,7 @@
5
5
  * Uses theme-aware CSS variables for styling.
6
6
  */
7
7
  import React from "react";
8
+ import type { EventEmit } from "@almadar/core";
8
9
  export type ToastVariant = "success" | "error" | "info" | "warning";
9
10
  export interface ToastProps {
10
11
  /** Toast variant */
@@ -28,8 +29,8 @@ export interface ToastProps {
28
29
  /** Additional CSS classes */
29
30
  className?: string;
30
31
  /** Declarative dismiss event — emits UI:{dismissEvent} via eventBus when toast is dismissed */
31
- dismissEvent?: string;
32
+ dismissEvent?: EventEmit<Record<string, never>>;
32
33
  /** Declarative action event — emits UI:{actionEvent} via eventBus when action button is clicked */
33
- actionEvent?: string;
34
+ actionEvent?: EventEmit<Record<string, never>>;
34
35
  }
35
36
  export declare const Toast: React.FC<ToastProps>;
@@ -7,6 +7,7 @@
7
7
  * Uses wireframe theme styling (high contrast, sharp edges).
8
8
  */
9
9
  import React from "react";
10
+ import type { EventEmit } from "@almadar/core";
10
11
  /**
11
12
  * Step info needed by WizardProgress.
12
13
  * Compatible with WizardContainer's WizardStep (subset of fields).
@@ -33,7 +34,9 @@ export interface WizardProgressProps {
33
34
  /** Additional CSS classes */
34
35
  className?: string;
35
36
  /** Declarative step click event — emits UI:{stepClickEvent} with { stepIndex } */
36
- stepClickEvent?: string;
37
+ stepClickEvent?: EventEmit<{
38
+ stepIndex: number;
39
+ }>;
37
40
  }
38
41
  /**
39
42
  * WizardProgress - Step progress indicator
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { EventEmit } from '@almadar/core';
2
3
  export interface ActionButtonConfig {
3
4
  /** Unique identifier */
4
5
  id: string;
@@ -18,7 +19,10 @@ export interface ActionButtonsProps {
18
19
  /** Called when a button is pressed/released */
19
20
  onAction?: (id: string, pressed: boolean) => void;
20
21
  /** Declarative event name emitted on action via useEventBus */
21
- actionEvent?: string;
22
+ actionEvent?: EventEmit<{
23
+ id: string;
24
+ pressed: boolean;
25
+ }>;
22
26
  /** Layout variant */
23
27
  layout?: 'horizontal' | 'vertical' | 'diamond';
24
28
  /** Size variant */
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { EventEmit } from '@almadar/core';
2
3
  export interface CraftingIngredient {
3
4
  /** Icon component or emoji */
4
5
  icon?: React.ReactNode;
@@ -23,7 +24,9 @@ export interface CraftingRecipeProps {
23
24
  /** Callback when the craft button is clicked */
24
25
  onCraft?: () => void;
25
26
  /** Event bus event name for crafting */
26
- craftEvent?: string;
27
+ craftEvent?: EventEmit<{
28
+ output: string;
29
+ }>;
27
30
  /** Additional CSS classes */
28
31
  className?: string;
29
32
  }
@@ -1,3 +1,4 @@
1
+ import type { EventEmit } from '@almadar/core';
1
2
  export type DPadDirection = 'up' | 'down' | 'left' | 'right';
2
3
  /** Event Contract:
3
4
  * Emits: UI:DIRECTION
@@ -6,7 +7,10 @@ export interface DPadProps {
6
7
  /** Called when a direction is pressed/released */
7
8
  onDirection?: (direction: DPadDirection, pressed: boolean) => void;
8
9
  /** Declarative event name emitted on direction press/release via useEventBus */
9
- directionEvent?: string;
10
+ directionEvent?: EventEmit<{
11
+ direction: DPadDirection;
12
+ pressed: boolean;
13
+ }>;
10
14
  /** Size variant */
11
15
  size?: 'sm' | 'md' | 'lg';
12
16
  /** Whether to include diagonal buttons */
@@ -12,7 +12,7 @@
12
12
  * concern analogous to Form's `formData`.
13
13
  */
14
14
  import React from 'react';
15
- import type { EventPayload } from '@almadar/core';
15
+ import type { EventEmit, EventPayload } from '@almadar/core';
16
16
  export type DialogueChoice = EventPayload & {
17
17
  text: string;
18
18
  action?: string;
@@ -46,11 +46,13 @@ export interface DialogueBoxProps {
46
46
  /** Called when dialogue is advanced (no choices) */
47
47
  onAdvance?: () => void;
48
48
  /** Declarative event: emits UI:{completeEvent} when text animation completes */
49
- completeEvent?: string;
50
- /** Declarative event: emits UI:{choiceEvent} with { choice } when a choice is selected */
51
- choiceEvent?: string;
49
+ completeEvent?: EventEmit<Record<string, never>>;
50
+ /** Declarative event: emits UI:{choiceEvent} with { choice: DialogueChoice } when a choice is selected */
51
+ choiceEvent?: EventEmit<{
52
+ choice: DialogueChoice;
53
+ }>;
52
54
  /** Declarative event: emits UI:{advanceEvent} when dialogue is advanced */
53
- advanceEvent?: string;
55
+ advanceEvent?: EventEmit<Record<string, never>>;
54
56
  /** Optional className */
55
57
  className?: string;
56
58
  }
@@ -1,4 +1,5 @@
1
1
  import * as React from 'react';
2
+ import type { EventEmit } from '@almadar/core';
2
3
  export interface InventoryGridItem {
3
4
  id: string;
4
5
  icon?: React.ReactNode;
@@ -18,7 +19,9 @@ export interface InventoryGridProps {
18
19
  /** Callback when an item is selected */
19
20
  onSelect?: (id: string) => void;
20
21
  /** Event bus event name for selection */
21
- selectEvent?: string;
22
+ selectEvent?: EventEmit<{
23
+ id: string;
24
+ }>;
22
25
  /** Size variant for all item slots */
23
26
  size?: 'sm' | 'md' | 'lg';
24
27
  /** Additional CSS classes */
@@ -11,7 +11,7 @@
11
11
  * Local state is hover/tooltip only — rendering-only concerns.
12
12
  */
13
13
  import React from 'react';
14
- import type { EventPayload } from "@almadar/core";
14
+ import type { EventEmit, EventPayload } from "@almadar/core";
15
15
  export type InventoryItem = EventPayload & {
16
16
  id: string;
17
17
  type: string;
@@ -36,11 +36,17 @@ export interface InventoryPanelProps {
36
36
  /** Called when an item is dropped */
37
37
  onDropItem?: (item: InventoryItem) => void;
38
38
  /** Declarative event: emits UI:{selectSlotEvent} with { index } when a slot is selected */
39
- selectSlotEvent?: string;
40
- /** Declarative event: emits UI:{useItemEvent} with { item } when an item is used */
41
- useItemEvent?: string;
42
- /** Declarative event: emits UI:{dropItemEvent} with { item } when an item is dropped */
43
- dropItemEvent?: string;
39
+ selectSlotEvent?: EventEmit<{
40
+ index: number;
41
+ }>;
42
+ /** Declarative event: emits UI:{useItemEvent} with { item: InventoryItem } when an item is used */
43
+ useItemEvent?: EventEmit<{
44
+ item: InventoryItem;
45
+ }>;
46
+ /** Declarative event: emits UI:{dropItemEvent} with { item: InventoryItem } when an item is dropped */
47
+ dropItemEvent?: EventEmit<{
48
+ item: InventoryItem;
49
+ }>;
44
50
  /** Show item tooltips on hover */
45
51
  showTooltips?: boolean;
46
52
  /** Optional className */
@@ -24,6 +24,7 @@
24
24
  * @packageDocumentation
25
25
  */
26
26
  import * as React from 'react';
27
+ import type { EventEmit } from '@almadar/core';
27
28
  import type { IsometricTile, IsometricUnit, IsometricFeature } from '../../organisms/game/types/isometric';
28
29
  import type { ResolvedFrame } from '../../organisms/game/types/spriteAnimation';
29
30
  /** Event Contract:
@@ -67,13 +68,21 @@ export interface IsometricCanvasProps {
67
68
  onTileHover?: (x: number, y: number) => void;
68
69
  onTileLeave?: () => void;
69
70
  /** Declarative event: emits UI:{tileClickEvent} with { x, y } on tile click */
70
- tileClickEvent?: string;
71
+ tileClickEvent?: EventEmit<{
72
+ x: number;
73
+ y: number;
74
+ }>;
71
75
  /** Declarative event: emits UI:{unitClickEvent} with { unitId } on unit click */
72
- unitClickEvent?: string;
76
+ unitClickEvent?: EventEmit<{
77
+ unitId: string;
78
+ }>;
73
79
  /** Declarative event: emits UI:{tileHoverEvent} with { x, y } on tile hover */
74
- tileHoverEvent?: string;
80
+ tileHoverEvent?: EventEmit<{
81
+ x: number;
82
+ y: number;
83
+ }>;
75
84
  /** Declarative event: emits UI:{tileLeaveEvent} with {} on tile leave */
76
- tileLeaveEvent?: string;
85
+ tileLeaveEvent?: EventEmit<Record<string, never>>;
77
86
  /** Render scale (0.4 = 40% zoom) */
78
87
  scale?: number;
79
88
  /** Show debug grid lines and coordinates */
@@ -1,3 +1,4 @@
1
+ import type { EventEmit } from '@almadar/core';
1
2
  export interface PlatformerPlatform {
2
3
  x: number;
3
4
  y: number;
@@ -39,10 +40,14 @@ export interface PlatformerCanvasProps {
39
40
  /** Base URL prefix for asset URLs */
40
41
  assetBaseUrl?: string;
41
42
  /** Event names for keyboard controls */
42
- leftEvent?: string;
43
- rightEvent?: string;
44
- jumpEvent?: string;
45
- stopEvent?: string;
43
+ leftEvent?: EventEmit<{
44
+ direction: number;
45
+ }>;
46
+ rightEvent?: EventEmit<{
47
+ direction: number;
48
+ }>;
49
+ jumpEvent?: EventEmit<Record<string, never>>;
50
+ stopEvent?: EventEmit<Record<string, never>>;
46
51
  /** Additional CSS classes */
47
52
  className?: string;
48
53
  }
@@ -11,7 +11,7 @@
11
11
  * - className for external styling
12
12
  */
13
13
  import React from "react";
14
- import type { EventPayload } from "@almadar/core";
14
+ import type { EventEmit, EventPayload } from "@almadar/core";
15
15
  export type GraphNode = EventPayload & {
16
16
  id: string;
17
17
  label?: string;
@@ -55,7 +55,9 @@ export interface GraphCanvasProps {
55
55
  /** On node click */
56
56
  onNodeClick?: (node: GraphNode) => void;
57
57
  /** Node click event */
58
- nodeClickEvent?: string;
58
+ nodeClickEvent?: EventEmit<{
59
+ id: string;
60
+ }>;
59
61
  /** Layout algorithm */
60
62
  layout?: "force" | "circular" | "grid";
61
63
  /** Entity name for schema-driven auto-fetch */
@@ -11,6 +11,7 @@
11
11
  * - className for external styling
12
12
  */
13
13
  import React from "react";
14
+ import type { EventEmit } from "@almadar/core";
14
15
  import type { EntityDisplayProps } from "./types";
15
16
  import type { EntityRow } from "@almadar/core";
16
17
  export type MediaItem = EntityRow & {
@@ -47,7 +48,9 @@ export interface MediaGalleryProps extends EntityDisplayProps<MediaItem> {
47
48
  /** Selected item IDs */
48
49
  selectedItems?: readonly string[];
49
50
  /** Event name emitted when selection changes (emitted as UI:{selectionEvent}) */
50
- selectionEvent?: string;
51
+ selectionEvent?: EventEmit<{
52
+ selection: string[];
53
+ }>;
51
54
  /** Show upload button */
52
55
  showUpload?: boolean;
53
56
  /** Actions */
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import type { EventEmit } from "@almadar/core";
2
3
  import { LucideIcon } from "lucide-react";
3
4
  export interface PageBreadcrumb {
4
5
  label: string;
@@ -28,7 +29,7 @@ export interface PageHeaderProps {
28
29
  /** Show back button */
29
30
  showBack?: boolean;
30
31
  /** Event to emit when back is clicked (default: BACK) */
31
- backEvent?: string;
32
+ backEvent?: EventEmit<Record<string, never>>;
32
33
  /** Breadcrumbs */
33
34
  breadcrumbs?: readonly PageBreadcrumb[];
34
35
  /** Status badge */