@almadar/ui 5.16.4 → 5.17.1

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 (106) hide show
  1. package/dist/avl/index.cjs +191 -153
  2. package/dist/avl/index.js +191 -153
  3. package/dist/components/atoms/Avatar.d.ts +4 -2
  4. package/dist/components/atoms/ConditionalWrapper.d.ts +2 -2
  5. package/dist/components/atoms/Icon.d.ts +6 -2
  6. package/dist/components/atoms/Input.d.ts +3 -2
  7. package/dist/components/atoms/LawReferenceTooltip.d.ts +2 -2
  8. package/dist/components/atoms/game/MiniMap.d.ts +15 -17
  9. package/dist/components/atoms/index.d.ts +1 -0
  10. package/dist/components/atoms/types.d.ts +40 -0
  11. package/dist/components/index.cjs +191 -153
  12. package/dist/components/index.js +191 -153
  13. package/dist/components/molecules/CTABanner.d.ts +3 -8
  14. package/dist/components/molecules/CalendarGrid.d.ts +2 -2
  15. package/dist/components/molecules/CommunityLinks.d.ts +15 -12
  16. package/dist/components/molecules/DataGrid.d.ts +2 -1
  17. package/dist/components/molecules/DataList.d.ts +12 -11
  18. package/dist/components/molecules/GraphView.d.ts +2 -2
  19. package/dist/components/molecules/HeroSection.d.ts +4 -12
  20. package/dist/components/molecules/MapView.d.ts +2 -2
  21. package/dist/components/molecules/MarketingFooter.d.ts +6 -5
  22. package/dist/components/molecules/Meter.d.ts +2 -1
  23. package/dist/components/molecules/OptionConstraintGroup.d.ts +5 -3
  24. package/dist/components/molecules/PricingCard.d.ts +2 -4
  25. package/dist/components/molecules/QrScanner.d.ts +2 -2
  26. package/dist/components/molecules/RepeatableFormSection.d.ts +2 -2
  27. package/dist/components/molecules/ShowcaseCard.d.ts +2 -4
  28. package/dist/components/molecules/SplitSection.d.ts +2 -4
  29. package/dist/components/molecules/StatDisplay.d.ts +2 -1
  30. package/dist/components/molecules/StatsGrid.d.ts +5 -4
  31. package/dist/components/molecules/TableView.d.ts +2 -1
  32. package/dist/components/molecules/ViolationAlert.d.ts +2 -2
  33. package/dist/components/molecules/game/CraftingRecipe.d.ts +11 -7
  34. package/dist/components/molecules/game/DialogueBox.d.ts +2 -2
  35. package/dist/components/molecules/game/HealthPanel.d.ts +6 -5
  36. package/dist/components/molecules/game/IsometricCanvas.d.ts +9 -13
  37. package/dist/components/organisms/Chart.d.ts +2 -1
  38. package/dist/components/organisms/CodeViewer.d.ts +8 -6
  39. package/dist/components/organisms/ComponentPatterns.d.ts +2 -1
  40. package/dist/components/organisms/ConfirmDialog.d.ts +2 -1
  41. package/dist/components/organisms/CustomPattern.d.ts +2 -1
  42. package/dist/components/organisms/DataTable.d.ts +6 -5
  43. package/dist/components/organisms/DetailPanel.d.ts +5 -4
  44. package/dist/components/organisms/DocumentViewer.d.ts +9 -7
  45. package/dist/components/organisms/DrawerSlot.d.ts +2 -1
  46. package/dist/components/organisms/Form.d.ts +5 -4
  47. package/dist/components/organisms/GraphCanvas.d.ts +2 -1
  48. package/dist/components/organisms/Header.d.ts +17 -14
  49. package/dist/components/organisms/JazariStateMachine.d.ts +2 -1
  50. package/dist/components/organisms/LayoutPatterns.d.ts +4 -3
  51. package/dist/components/organisms/List.d.ts +2 -2
  52. package/dist/components/organisms/Meter.d.ts +2 -1
  53. package/dist/components/organisms/ModalSlot.d.ts +2 -1
  54. package/dist/components/organisms/Navigation.d.ts +2 -1
  55. package/dist/components/organisms/OrbitalVisualization.d.ts +2 -1
  56. package/dist/components/organisms/PageHeader.d.ts +7 -5
  57. package/dist/components/organisms/Section.d.ts +2 -1
  58. package/dist/components/organisms/Sidebar.d.ts +2 -1
  59. package/dist/components/organisms/SignaturePad.d.ts +2 -1
  60. package/dist/components/organisms/Split.d.ts +2 -1
  61. package/dist/components/organisms/StateMachineView.d.ts +8 -4
  62. package/dist/components/organisms/Timeline.d.ts +2 -1
  63. package/dist/components/organisms/ToastSlot.d.ts +2 -1
  64. package/dist/components/organisms/UISlotRenderer.d.ts +4 -3
  65. package/dist/components/organisms/WizardContainer.d.ts +2 -1
  66. package/dist/components/organisms/book/types.d.ts +2 -2
  67. package/dist/components/organisms/game/BattleBoard.d.ts +4 -4
  68. package/dist/components/organisms/game/CanvasEffect.d.ts +2 -1
  69. package/dist/components/organisms/game/CastleBoard.d.ts +6 -5
  70. package/dist/components/organisms/game/GameAudioProvider.d.ts +2 -1
  71. package/dist/components/organisms/game/GameAudioToggle.d.ts +2 -1
  72. package/dist/components/organisms/game/TraitSlot.d.ts +4 -3
  73. package/dist/components/organisms/game/TraitStateViewer.d.ts +6 -5
  74. package/dist/components/organisms/game/UncontrolledBattleBoard.d.ts +9 -4
  75. package/dist/components/organisms/game/WorldMapBoard.d.ts +11 -9
  76. package/dist/components/organisms/game/physics-sim/SimulationControls.d.ts +8 -7
  77. package/dist/components/organisms/game/puzzles/builder/BuilderBoard.d.ts +3 -3
  78. package/dist/components/organisms/game/puzzles/classifier/ClassifierBoard.d.ts +3 -3
  79. package/dist/components/organisms/game/puzzles/debugger/DebuggerBoard.d.ts +3 -3
  80. package/dist/components/organisms/game/puzzles/event-handler/EventHandlerBoard.d.ts +7 -4
  81. package/dist/components/organisms/game/puzzles/event-handler/ObjectRulePanel.d.ts +2 -2
  82. package/dist/components/organisms/game/puzzles/event-handler/RuleEditor.d.ts +7 -9
  83. package/dist/components/organisms/game/puzzles/negotiator/NegotiatorBoard.d.ts +3 -3
  84. package/dist/components/organisms/game/puzzles/sequencer/SequencerBoard.d.ts +5 -4
  85. package/dist/components/organisms/game/puzzles/simulator/SimulatorBoard.d.ts +3 -3
  86. package/dist/components/organisms/game/puzzles/state-architect/StateArchitectBoard.d.ts +5 -4
  87. package/dist/components/organisms/game/puzzles/state-architect/StateNode.d.ts +2 -4
  88. package/dist/components/organisms/game/puzzles/state-architect/TransitionArrow.d.ts +3 -8
  89. package/dist/components/organisms/game/types/isometric.d.ts +4 -4
  90. package/dist/components/organisms/index.d.ts +1 -1
  91. package/dist/components/organisms/types.d.ts +3 -1
  92. package/dist/components/templates/DashboardLayout.d.ts +6 -5
  93. package/dist/components/templates/GameTemplate.d.ts +7 -6
  94. package/dist/components/templates/GenericAppTemplate.d.ts +1 -7
  95. package/dist/components/templates/types.d.ts +14 -6
  96. package/dist/docs/index.cjs +60 -22
  97. package/dist/docs/index.d.cts +9 -4
  98. package/dist/docs/index.js +58 -20
  99. package/dist/marketing/index.cjs +61 -23
  100. package/dist/marketing/index.d.cts +54 -55
  101. package/dist/marketing/index.js +58 -20
  102. package/dist/providers/index.cjs +191 -153
  103. package/dist/providers/index.js +191 -153
  104. package/dist/runtime/index.cjs +191 -153
  105. package/dist/runtime/index.js +191 -153
  106. package/package.json +1 -1
@@ -5,6 +5,7 @@
5
5
  * Uses the site's theme naturally - no forced color inversions.
6
6
  */
7
7
  import React from 'react';
8
+ import type { LinkAction } from '../atoms/types';
8
9
  export type CTABannerBackground = 'default' | 'alt' | 'dark' | 'gradient' | 'primary';
9
10
  export interface CTABannerProps {
10
11
  /** Banner headline */
@@ -12,15 +13,9 @@ export interface CTABannerProps {
12
13
  /** Supporting text below the title */
13
14
  subtitle?: string;
14
15
  /** Primary action button config */
15
- primaryAction?: {
16
- label: string;
17
- href: string;
18
- };
16
+ primaryAction?: LinkAction;
19
17
  /** Secondary action button config */
20
- secondaryAction?: {
21
- label: string;
22
- href: string;
23
- };
18
+ secondaryAction?: LinkAction;
24
19
  /** Background style */
25
20
  background?: CTABannerBackground;
26
21
  /** Content alignment */
@@ -7,13 +7,13 @@
7
7
  */
8
8
  import React from "react";
9
9
  import type { EventEmit, EventPayload, EntityCollection } from "@almadar/core";
10
- export interface CalendarEvent {
10
+ export type CalendarEvent = {
11
11
  id: string;
12
12
  title: string;
13
13
  startTime: string | Date;
14
14
  endTime?: string | Date;
15
15
  color?: string;
16
- }
16
+ };
17
17
  /**
18
18
  * Number of day columns rendered at once. Matches the responsiveness-
19
19
  * audit tiers exactly: 1 day on mobile (≤640), 3 on tablet (641–1024),
@@ -5,19 +5,22 @@
5
5
  * Composes VStack, HStack, Typography, Button, and Icon atoms.
6
6
  */
7
7
  import React from 'react';
8
+ export interface GithubLink {
9
+ url: string;
10
+ stars?: number;
11
+ }
12
+ export interface DiscordLink {
13
+ url: string;
14
+ members?: number;
15
+ }
16
+ export interface TwitterLink {
17
+ url: string;
18
+ followers?: number;
19
+ }
8
20
  export interface CommunityLinksProps {
9
- github?: {
10
- url: string;
11
- stars?: number;
12
- };
13
- discord?: {
14
- url: string;
15
- members?: number;
16
- };
17
- twitter?: {
18
- url: string;
19
- followers?: number;
20
- };
21
+ github?: GithubLink;
22
+ discord?: DiscordLink;
23
+ twitter?: TwitterLink;
21
24
  heading?: string;
22
25
  subtitle?: string;
23
26
  className?: string;
@@ -13,6 +13,7 @@
13
13
  import React from 'react';
14
14
  import type { EntityRow, EventKey, EntityCollection } from '@almadar/core';
15
15
  import { type DataDndProps } from './useDataDnd';
16
+ import type { UiError } from '../atoms/types';
16
17
  export interface DataGridField {
17
18
  /** Entity field name (dot-notation supported) */
18
19
  name: string;
@@ -87,7 +88,7 @@ export interface DataGridProps<T extends EntityRow = EntityRow> extends DataDndP
87
88
  /** Loading state */
88
89
  isLoading?: boolean;
89
90
  /** Error state */
90
- error?: Error | null;
91
+ error?: UiError | null;
91
92
  /** Entity field name containing an image URL for card thumbnails */
92
93
  imageField?: string;
93
94
  /** Enable multi-select with checkboxes */
@@ -13,6 +13,7 @@
13
13
  import React from 'react';
14
14
  import type { EntityRow, EntityCollection, EventKey } from "@almadar/core";
15
15
  import { type DataDndProps } from './useDataDnd';
16
+ import type { UiError } from '../atoms/types';
16
17
  export interface DataListField {
17
18
  /** Entity field name (dot-notation supported) */
18
19
  name: string;
@@ -36,6 +37,14 @@ export interface DataListItemAction {
36
37
  /** Button variant */
37
38
  variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
38
39
  }
40
+ export interface DataListSwipeAction {
41
+ /** Button label */
42
+ label: string;
43
+ /** Lucide icon name */
44
+ icon?: string;
45
+ /** Button variant */
46
+ variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
47
+ }
39
48
  export interface DataListProps<T extends EntityRow = EntityRow> extends DataDndProps {
40
49
  /**
41
50
  * Schema entity data — single record or collection, typed against
@@ -76,7 +85,7 @@ export interface DataListProps<T extends EntityRow = EntityRow> extends DataDndP
76
85
  /** Loading state */
77
86
  isLoading?: boolean;
78
87
  /** Error state */
79
- error?: Error | null;
88
+ error?: UiError | null;
80
89
  /** Enable drag-to-reorder with grip handles */
81
90
  reorderable?: boolean;
82
91
  /** Event emitted on reorder: UI:{reorderEvent} with { fromIndex, toIndex } */
@@ -84,19 +93,11 @@ export interface DataListProps<T extends EntityRow = EntityRow> extends DataDndP
84
93
  /** Event emitted on left swipe: UI:{swipeLeftEvent} with { row } */
85
94
  swipeLeftEvent?: EventKey;
86
95
  /** Actions revealed on left swipe */
87
- swipeLeftActions?: readonly {
88
- label: string;
89
- icon?: string;
90
- variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
91
- }[];
96
+ swipeLeftActions?: readonly DataListSwipeAction[];
92
97
  /** Event emitted on right swipe: UI:{swipeRightEvent} with { row } */
93
98
  swipeRightEvent?: EventKey;
94
99
  /** Actions revealed on right swipe */
95
- swipeRightActions?: readonly {
96
- label: string;
97
- icon?: string;
98
- variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
99
- }[];
100
+ swipeRightActions?: readonly DataListSwipeAction[];
100
101
  /** Event emitted on long press: UI:{longPressEvent} with { row } */
101
102
  longPressEvent?: EventKey;
102
103
  /** Enable infinite scroll loading */
@@ -8,13 +8,13 @@
8
8
  * to lay out nodes, then renders via SVG circles and lines.
9
9
  */
10
10
  import React from 'react';
11
- export interface GraphViewNode {
11
+ export type GraphViewNode = {
12
12
  id: string;
13
13
  label?: string;
14
14
  color?: string;
15
15
  size?: number;
16
16
  group?: string;
17
- }
17
+ };
18
18
  export interface GraphViewEdge {
19
19
  source: string;
20
20
  target: string;
@@ -6,25 +6,17 @@
6
6
  * Optionally includes an InstallBox molecule for CLI commands.
7
7
  */
8
8
  import React from 'react';
9
+ import type { LinkAction, ImageSource } from '../atoms/types';
9
10
  export interface HeroSectionProps {
10
11
  tag?: string;
11
12
  tagVariant?: 'primary' | 'secondary' | 'accent';
12
13
  title: string;
13
14
  titleAccent?: string;
14
15
  subtitle: string;
15
- primaryAction?: {
16
- label: string;
17
- href: string;
18
- };
19
- secondaryAction?: {
20
- label: string;
21
- href: string;
22
- };
16
+ primaryAction?: LinkAction;
17
+ secondaryAction?: LinkAction;
23
18
  installCommand?: string;
24
- image?: {
25
- src: string;
26
- alt: string;
27
- };
19
+ image?: ImageSource;
28
20
  imagePosition?: 'below' | 'right' | 'background';
29
21
  background?: 'dark' | 'gradient' | 'subtle';
30
22
  align?: 'center' | 'left';
@@ -1,5 +1,5 @@
1
1
  import type { EventEmit } from '@almadar/core';
2
- export interface MapMarkerData {
2
+ export type MapMarkerData = {
3
3
  /** Unique marker identifier */
4
4
  id: string | number;
5
5
  /** Latitude */
@@ -10,7 +10,7 @@ export interface MapMarkerData {
10
10
  label?: string;
11
11
  /** Optional category for styling */
12
12
  category?: string;
13
- }
13
+ };
14
14
  export interface MapRouteWaypoint {
15
15
  lat: number;
16
16
  lng: number;
@@ -14,14 +14,15 @@ export interface FooterLinkColumn {
14
14
  title: string;
15
15
  items: FooterLinkItem[];
16
16
  }
17
+ export interface FooterLogo {
18
+ src: string;
19
+ alt: string;
20
+ href?: string;
21
+ }
17
22
  export interface MarketingFooterProps {
18
23
  columns: FooterLinkColumn[];
19
24
  copyright?: string;
20
- logo?: {
21
- src: string;
22
- alt: string;
23
- href?: string;
24
- };
25
+ logo?: FooterLogo;
25
26
  className?: string;
26
27
  }
27
28
  export declare const MarketingFooter: React.FC<MarketingFooterProps>;
@@ -6,6 +6,7 @@
6
6
  * Pure molecule: no entity prop, no data fetching.
7
7
  */
8
8
  import React from "react";
9
+ import type { UiError } from '../atoms/types';
9
10
  export type MeterVariant = "linear" | "radial" | "segmented";
10
11
  export interface MeterThreshold {
11
12
  value: number;
@@ -44,7 +45,7 @@ export interface MeterProps {
44
45
  /** Loading state */
45
46
  isLoading?: boolean;
46
47
  /** Error state */
47
- error?: Error | null;
48
+ error?: UiError | null;
48
49
  /** Additional CSS classes */
49
50
  className?: string;
50
51
  }
@@ -10,13 +10,13 @@
10
10
  */
11
11
  import React from 'react';
12
12
  import type { EventEmit } from '@almadar/core';
13
- export interface OptionConstraintOption {
13
+ export type OptionConstraintOption = {
14
14
  id: string;
15
15
  label: string;
16
16
  priceDelta?: number;
17
17
  disabled?: boolean;
18
18
  outOfStock?: boolean;
19
- }
19
+ };
20
20
  export type OptionConstraint = {
21
21
  type: 'single';
22
22
  required?: boolean;
@@ -30,7 +30,9 @@ export interface OptionConstraintGroupProps {
30
30
  title: string;
31
31
  description?: string;
32
32
  options: OptionConstraintOption[];
33
- constraint: OptionConstraint;
33
+ /** Selection constraint. Optional — defaults to single-select (the generic
34
+ * factory can't author a discriminated-union value; an author overrides it). */
35
+ constraint?: OptionConstraint;
34
36
  selected?: string[];
35
37
  onChange?: (selected: string[]) => void;
36
38
  changeEvent?: EventEmit<{
@@ -5,15 +5,13 @@
5
5
  * Composes atoms: Card, VStack, HStack, Badge, Typography, Icon, Divider, Spacer, Button.
6
6
  */
7
7
  import React from 'react';
8
+ import type { LinkAction } from '../atoms/types';
8
9
  export interface PricingCardProps {
9
10
  name: string;
10
11
  price: string;
11
12
  description?: string;
12
13
  features: string[];
13
- action: {
14
- label: string;
15
- href: string;
16
- };
14
+ action: LinkAction;
17
15
  highlighted?: boolean;
18
16
  badge?: string;
19
17
  className?: string;
@@ -5,11 +5,11 @@ import type { EventEmit, EventPayload } from "@almadar/core";
5
5
  * `EventPayloadValue` map) so the result is directly assignable to a
6
6
  * render-ui dispatched event payload without re-shaping.
7
7
  */
8
- export interface QrScanResult extends EventPayload {
8
+ export type QrScanResult = EventPayload & {
9
9
  text: string;
10
10
  format: string;
11
11
  timestamp: number;
12
- }
12
+ };
13
13
  export interface QrScannerProps {
14
14
  onScan?: (result: QrScanResult) => void;
15
15
  scanEvent?: EventEmit<QrScanResult>;
@@ -11,14 +11,14 @@
11
11
  * - Emits: UI:SECTION_REMOVED { sectionType, index, itemId }
12
12
  */
13
13
  import React from "react";
14
- export interface RepeatableItem {
14
+ export type RepeatableItem = {
15
15
  id: string;
16
16
  /** State in which this item was added (for audit trails) */
17
17
  addedInState?: string;
18
18
  /** Timestamp when item was added */
19
19
  addedAt?: string;
20
20
  [key: string]: unknown;
21
- }
21
+ };
22
22
  export interface RepeatableFormSectionProps {
23
23
  /** Section type identifier */
24
24
  sectionType: string;
@@ -5,13 +5,11 @@
5
5
  * Composes Card, Box, VStack, Badge, and Typography atoms.
6
6
  */
7
7
  import React from 'react';
8
+ import type { ImageSource } from '../atoms/types';
8
9
  export interface ShowcaseCardProps {
9
10
  title: string;
10
11
  description?: string;
11
- image: {
12
- src: string;
13
- alt: string;
14
- };
12
+ image: ImageSource;
15
13
  href?: string;
16
14
  badge?: string;
17
15
  accentColor?: string;
@@ -5,14 +5,12 @@
5
5
  * Composes Box, HStack, VStack, Typography, and Icon atoms.
6
6
  */
7
7
  import React from 'react';
8
+ import type { ImageSource } from '../atoms/types';
8
9
  export interface SplitSectionProps {
9
10
  title: string;
10
11
  description: string | React.ReactNode;
11
12
  bullets?: string[];
12
- image?: {
13
- src: string;
14
- alt: string;
15
- };
13
+ image?: ImageSource;
16
14
  imagePosition?: 'left' | 'right';
17
15
  background?: 'default' | 'alt';
18
16
  children?: React.ReactNode;
@@ -6,6 +6,7 @@
6
6
  * No entity prop, no data fetching, no hooks beyond icon resolution.
7
7
  */
8
8
  import React from 'react';
9
+ import type { UiError } from '../atoms/types';
9
10
  export type StatDisplayLook = 'elevated' | 'flat' | 'progress-backed' | 'gauge' | 'sparkline';
10
11
  export interface StatDisplayProps {
11
12
  /** Display label (e.g., "Total", "Remaining") */
@@ -51,6 +52,6 @@ export interface StatDisplayProps {
51
52
  /** Loading state */
52
53
  isLoading?: boolean;
53
54
  /** Error state */
54
- error?: Error | null;
55
+ error?: UiError | null;
55
56
  }
56
57
  export declare const StatDisplay: React.FC<StatDisplayProps>;
@@ -6,11 +6,12 @@
6
6
  * Uses StatDisplay internally when available for consistent styling.
7
7
  */
8
8
  import React from 'react';
9
+ export interface StatItem {
10
+ value: string;
11
+ label: string;
12
+ }
9
13
  export interface StatsGridProps {
10
- stats: {
11
- value: string;
12
- label: string;
13
- }[];
14
+ stats: StatItem[];
14
15
  columns?: 2 | 3 | 4 | 6;
15
16
  className?: string;
16
17
  }
@@ -14,6 +14,7 @@
14
14
  import React from 'react';
15
15
  import type { EntityRow, EventKey, EntityCollection } from '@almadar/core';
16
16
  import { type DataDndProps } from './useDataDnd';
17
+ import type { UiError } from '../atoms/types';
17
18
  export interface TableViewColumn {
18
19
  /** Stable column key (React key + default value lookup). */
19
20
  key: string;
@@ -80,7 +81,7 @@ export interface TableViewProps<T extends EntityRow = EntityRow> extends DataDnd
80
81
  /** Loading state. */
81
82
  isLoading?: boolean;
82
83
  /** Error state. */
83
- error?: Error | null;
84
+ error?: UiError | null;
84
85
  /** Group rows under section headers by a field value. */
85
86
  groupBy?: string;
86
87
  /** Max rows before a "Show More" button. Defaults to 0 (show all). */
@@ -10,7 +10,7 @@
10
10
  * - penalty: Penalty proceedings (error, severe)
11
11
  */
12
12
  import React from "react";
13
- export interface ViolationRecord {
13
+ export type ViolationRecord = {
14
14
  /** Unique violation identifier */
15
15
  id: string;
16
16
  /** Law reference (e.g., "ZVPOT-1") */
@@ -29,7 +29,7 @@ export interface ViolationRecord {
29
29
  fieldId?: string;
30
30
  /** Tab/form where violation occurred */
31
31
  tabId?: string;
32
- }
32
+ };
33
33
  export interface ViolationAlertProps {
34
34
  /** Violation data */
35
35
  violation: ViolationRecord;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import type { EventEmit } from '@almadar/core';
3
- export interface CraftingIngredient {
3
+ export type CraftingIngredient = {
4
4
  /** Icon component or emoji */
5
5
  icon?: React.ReactNode;
6
6
  /** Ingredient label */
@@ -9,16 +9,20 @@ export interface CraftingIngredient {
9
9
  required: number;
10
10
  /** Number currently available */
11
11
  available: number;
12
- }
12
+ };
13
+ export type CraftingOutput = {
14
+ /** Icon component or emoji */
15
+ icon?: React.ReactNode;
16
+ /** Output item label */
17
+ label: string;
18
+ /** Rarity tier */
19
+ rarity?: string;
20
+ };
13
21
  export interface CraftingRecipeProps {
14
22
  /** Input ingredients for the recipe */
15
23
  inputs: CraftingIngredient[];
16
24
  /** Output item produced by the recipe */
17
- output: {
18
- icon?: React.ReactNode;
19
- label: string;
20
- rarity?: string;
21
- };
25
+ output: CraftingOutput;
22
26
  /** Whether the player has enough ingredients to craft */
23
27
  canCraft?: boolean;
24
28
  /** Callback when the craft button is clicked */
@@ -19,14 +19,14 @@ export type DialogueChoice = EventPayload & {
19
19
  next?: string;
20
20
  disabled?: boolean;
21
21
  };
22
- export interface DialogueNode {
22
+ export type DialogueNode = {
23
23
  id?: string;
24
24
  speaker: string;
25
25
  text: string;
26
26
  portrait?: string;
27
27
  choices?: DialogueChoice[];
28
28
  autoAdvance?: number;
29
- }
29
+ };
30
30
  /** Event Contract:
31
31
  * Emits: UI:COMPLETE
32
32
  * Emits: UI:CHOICE
@@ -1,4 +1,9 @@
1
1
  import * as React from 'react';
2
+ export interface HealthEffect {
3
+ icon: React.ReactNode;
4
+ label?: string;
5
+ variant?: 'buff' | 'debuff' | 'neutral';
6
+ }
2
7
  export interface HealthPanelProps {
3
8
  /** Current health value */
4
9
  current: number;
@@ -9,11 +14,7 @@ export interface HealthPanelProps {
9
14
  /** Label shown above the bar */
10
15
  label?: string;
11
16
  /** Active status effects displayed as small badges */
12
- effects?: {
13
- icon: React.ReactNode;
14
- label?: string;
15
- variant?: 'buff' | 'debuff' | 'neutral';
16
- }[];
17
+ effects?: HealthEffect[];
17
18
  /** Whether to display numeric HP values */
18
19
  showNumbers?: boolean;
19
20
  /** Size variant */
@@ -27,19 +27,24 @@ import * as React from 'react';
27
27
  import type { EventEmit } from '@almadar/core';
28
28
  import type { IsometricTile, IsometricUnit, IsometricFeature } from '../../organisms/game/types/isometric';
29
29
  import type { ResolvedFrame } from '../../organisms/game/types/spriteAnimation';
30
+ import type { UiError } from '../../atoms/types';
30
31
  /** Event Contract:
31
32
  * Emits: UI:TILE_CLICK
32
33
  * Emits: UI:UNIT_CLICK
33
34
  * Emits: UI:TILE_HOVER
34
35
  * Emits: UI:TILE_LEAVE
35
36
  */
37
+ export interface TileCoord {
38
+ x: number;
39
+ y: number;
40
+ }
36
41
  export interface IsometricCanvasProps {
37
42
  /** Additional CSS classes */
38
43
  className?: string;
39
44
  /** Loading state indicator */
40
45
  isLoading?: boolean;
41
46
  /** Error state */
42
- error?: Error | null;
47
+ error?: UiError | null;
43
48
  /** Array of tiles to render */
44
49
  tiles?: IsometricTile[];
45
50
  /** Array of units on the board */
@@ -49,20 +54,11 @@ export interface IsometricCanvasProps {
49
54
  /** Currently selected unit ID */
50
55
  selectedUnitId?: string | null;
51
56
  /** Valid move positions (shown as pulsing green highlights) */
52
- validMoves?: Array<{
53
- x: number;
54
- y: number;
55
- }>;
57
+ validMoves?: TileCoord[];
56
58
  /** Attack target positions (shown as pulsing red highlights) */
57
- attackTargets?: Array<{
58
- x: number;
59
- y: number;
60
- }>;
59
+ attackTargets?: TileCoord[];
61
60
  /** Hovered tile position */
62
- hoveredTile?: {
63
- x: number;
64
- y: number;
65
- } | null;
61
+ hoveredTile?: TileCoord | null;
66
62
  onTileClick?: (x: number, y: number) => void;
67
63
  onUnitClick?: (unitId: string) => void;
68
64
  onTileHover?: (x: number, y: number) => void;
@@ -15,6 +15,7 @@
15
15
  * alignment is deliberately deferred).
16
16
  */
17
17
  import React from "react";
18
+ import type { UiError } from '../atoms/types';
18
19
  export type ChartType = "bar" | "line" | "pie" | "area" | "donut" | "scatter" | "histogram";
19
20
  /**
20
21
  * Layer 2 visual treatment for the chart pattern — drives the chart
@@ -100,7 +101,7 @@ export interface ChartProps {
100
101
  /** Loading state */
101
102
  isLoading?: boolean;
102
103
  /** Error state */
103
- error?: Error | null;
104
+ error?: UiError | null;
104
105
  /** Additional CSS classes */
105
106
  className?: string;
106
107
  }
@@ -12,6 +12,7 @@
12
12
  * - className for external styling
13
13
  */
14
14
  import React from "react";
15
+ import type { UiError } from '../atoms/types';
15
16
  export type CodeViewerMode = "code" | "diff";
16
17
  export interface DiffLine {
17
18
  type: "add" | "remove" | "context";
@@ -24,6 +25,11 @@ export interface CodeViewerAction {
24
25
  navigatesTo?: string;
25
26
  variant?: "primary" | "secondary" | "ghost";
26
27
  }
28
+ export interface CodeViewerFile {
29
+ label: string;
30
+ code: string;
31
+ language?: string;
32
+ }
27
33
  export interface CodeViewerProps {
28
34
  /** Viewer title */
29
35
  title?: string;
@@ -48,11 +54,7 @@ export interface CodeViewerProps {
48
54
  /** Max height before scrolling */
49
55
  maxHeight?: number | string;
50
56
  /** Multiple files (tabbed view) */
51
- files?: readonly {
52
- label: string;
53
- code: string;
54
- language?: string;
55
- }[];
57
+ files?: readonly CodeViewerFile[];
56
58
  /** Actions */
57
59
  actions?: readonly CodeViewerAction[];
58
60
  /** Entity name for schema-driven auto-fetch */
@@ -60,7 +62,7 @@ export interface CodeViewerProps {
60
62
  /** Loading state */
61
63
  isLoading?: boolean;
62
64
  /** Error state */
63
- error?: Error | null;
65
+ error?: UiError | null;
64
66
  /** Additional CSS classes */
65
67
  className?: string;
66
68
  }
@@ -10,6 +10,7 @@
10
10
  */
11
11
  import React from 'react';
12
12
  import type { EventKey, EventPayload } from '@almadar/core';
13
+ import type { UiError } from '../atoms/types';
13
14
  import { type ButtonProps } from '../atoms/Button';
14
15
  import { type BadgeVariant } from '../atoms/Badge';
15
16
  import { type AlertVariant } from '../molecules/Alert';
@@ -20,7 +21,7 @@ import { type MapViewProps } from '../molecules/MapView';
20
21
  interface ClosedCircuitProps {
21
22
  className?: string;
22
23
  isLoading?: boolean;
23
- error?: Error | null;
24
+ error?: UiError | null;
24
25
  entity?: string;
25
26
  }
26
27
  /**
@@ -8,6 +8,7 @@
8
8
  */
9
9
  import React from "react";
10
10
  import { type ModalSize } from "../molecules/Modal";
11
+ import type { UiError } from '../atoms/types';
11
12
  export type ConfirmDialogVariant = "danger" | "warning" | "info" | "default";
12
13
  export interface ConfirmDialogProps {
13
14
  /** Whether the dialog is open (defaults to true when rendered by slot wrapper) */
@@ -37,7 +38,7 @@ export interface ConfirmDialogProps {
37
38
  /** Loading state for confirm button */
38
39
  isLoading?: boolean;
39
40
  /** Error state */
40
- error?: Error | null;
41
+ error?: UiError | null;
41
42
  /** Entity name for schema-driven auto-fetch */
42
43
  entity?: string;
43
44
  /** Additional CSS classes */