@almadar/ui 1.0.20 → 1.0.21
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.
- package/dist/components/index.d.ts +95 -9
- package/dist/components/index.js +312 -99
- package/package.json +8 -4
|
@@ -28,6 +28,12 @@ interface ButtonProps extends React__default.ButtonHTMLAttributes<HTMLButtonElem
|
|
|
28
28
|
icon?: LucideIcon;
|
|
29
29
|
/** Right icon as Lucide icon component (convenience prop) */
|
|
30
30
|
iconRight?: LucideIcon;
|
|
31
|
+
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
32
|
+
action?: string;
|
|
33
|
+
/** Payload to include with the action event */
|
|
34
|
+
actionPayload?: Record<string, unknown>;
|
|
35
|
+
/** Button label text (alternative to children for schema-driven rendering) */
|
|
36
|
+
label?: string;
|
|
31
37
|
}
|
|
32
38
|
declare const Button: React__default.ForwardRefExoticComponent<ButtonProps & React__default.RefAttributes<HTMLButtonElement>>;
|
|
33
39
|
|
|
@@ -166,6 +172,10 @@ interface AvatarProps {
|
|
|
166
172
|
* Click handler
|
|
167
173
|
*/
|
|
168
174
|
onClick?: () => void;
|
|
175
|
+
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
176
|
+
action?: string;
|
|
177
|
+
/** Payload to include with the action event */
|
|
178
|
+
actionPayload?: Record<string, unknown>;
|
|
169
179
|
}
|
|
170
180
|
declare const Avatar: React__default.FC<AvatarProps>;
|
|
171
181
|
|
|
@@ -214,6 +224,12 @@ interface BoxProps extends React__default.HTMLAttributes<HTMLDivElement> {
|
|
|
214
224
|
position?: "relative" | "absolute" | "fixed" | "sticky";
|
|
215
225
|
/** HTML element to render as */
|
|
216
226
|
as?: React__default.ElementType;
|
|
227
|
+
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
228
|
+
action?: string;
|
|
229
|
+
/** Payload to include with the action event */
|
|
230
|
+
actionPayload?: Record<string, unknown>;
|
|
231
|
+
/** Declarative hover event — emits UI:{hoverEvent} with { hovered: true/false } on mouseEnter/mouseLeave */
|
|
232
|
+
hoverEvent?: string;
|
|
217
233
|
}
|
|
218
234
|
/**
|
|
219
235
|
* Box - Versatile container component with design tokens
|
|
@@ -486,6 +502,10 @@ interface StackProps {
|
|
|
486
502
|
role?: string;
|
|
487
503
|
/** Tab index for focus management */
|
|
488
504
|
tabIndex?: number;
|
|
505
|
+
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
506
|
+
action?: string;
|
|
507
|
+
/** Payload to include with the action event */
|
|
508
|
+
actionPayload?: Record<string, unknown>;
|
|
489
509
|
}
|
|
490
510
|
/**
|
|
491
511
|
* Stack - Flexible layout component for arranging children
|
|
@@ -548,6 +568,10 @@ interface TextHighlightProps {
|
|
|
548
568
|
* Highlighted text content
|
|
549
569
|
*/
|
|
550
570
|
children: React__default.ReactNode;
|
|
571
|
+
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
572
|
+
action?: string;
|
|
573
|
+
/** Declarative hover event — emits UI:{hoverEvent} with { hovered: true/false } */
|
|
574
|
+
hoverEvent?: string;
|
|
551
575
|
}
|
|
552
576
|
/**
|
|
553
577
|
* TextHighlight component for rendering highlighted text annotations
|
|
@@ -678,6 +702,8 @@ interface OverlayProps {
|
|
|
678
702
|
onClick?: (e: React__default.MouseEvent) => void;
|
|
679
703
|
className?: string;
|
|
680
704
|
blur?: boolean;
|
|
705
|
+
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
706
|
+
action?: string;
|
|
681
707
|
}
|
|
682
708
|
declare const Overlay: React__default.FC<OverlayProps>;
|
|
683
709
|
|
|
@@ -853,6 +879,10 @@ interface ControlButtonProps {
|
|
|
853
879
|
onPress?: () => void;
|
|
854
880
|
/** Called when button is released */
|
|
855
881
|
onRelease?: () => void;
|
|
882
|
+
/** Declarative event name emitted on press via useEventBus */
|
|
883
|
+
pressEvent?: string;
|
|
884
|
+
/** Declarative event name emitted on release via useEventBus */
|
|
885
|
+
releaseEvent?: string;
|
|
856
886
|
/** Whether the button is currently pressed */
|
|
857
887
|
pressed?: boolean;
|
|
858
888
|
/** Whether the button is disabled */
|
|
@@ -860,7 +890,7 @@ interface ControlButtonProps {
|
|
|
860
890
|
/** Additional CSS classes */
|
|
861
891
|
className?: string;
|
|
862
892
|
}
|
|
863
|
-
declare function ControlButton({ label, icon, size, shape, variant, onPress, onRelease, pressed, disabled, className, }: ControlButtonProps): react_jsx_runtime.JSX.Element;
|
|
893
|
+
declare function ControlButton({ label, icon, size, shape, variant, onPress, onRelease, pressEvent, releaseEvent, pressed, disabled, className, }: ControlButtonProps): react_jsx_runtime.JSX.Element;
|
|
864
894
|
declare namespace ControlButton {
|
|
865
895
|
var displayName: string;
|
|
866
896
|
}
|
|
@@ -901,6 +931,8 @@ interface SpriteProps {
|
|
|
901
931
|
className?: string;
|
|
902
932
|
/** Optional onClick handler */
|
|
903
933
|
onClick?: () => void;
|
|
934
|
+
/** Declarative event name emitted on click via useEventBus */
|
|
935
|
+
action?: string;
|
|
904
936
|
}
|
|
905
937
|
/**
|
|
906
938
|
* Sprite component for rendering spritesheet frames
|
|
@@ -919,7 +951,7 @@ interface SpriteProps {
|
|
|
919
951
|
* />
|
|
920
952
|
* ```
|
|
921
953
|
*/
|
|
922
|
-
declare function Sprite({ spritesheet, frameWidth, frameHeight, frame, x, y, scale, flipX, flipY, rotation, opacity, zIndex, columns, className, onClick, }: SpriteProps): JSX.Element;
|
|
954
|
+
declare function Sprite({ spritesheet, frameWidth, frameHeight, frame, x, y, scale, flipX, flipY, rotation, opacity, zIndex, columns, className, onClick, action, }: SpriteProps): JSX.Element;
|
|
923
955
|
/**
|
|
924
956
|
* Canvas-based sprite renderer for better performance in game loops
|
|
925
957
|
*/
|
|
@@ -961,6 +993,8 @@ interface EmptyStateProps {
|
|
|
961
993
|
destructive?: boolean;
|
|
962
994
|
/** Variant for color styling */
|
|
963
995
|
variant?: "default" | "success" | "error" | "warning" | "info";
|
|
996
|
+
/** Declarative action event — emits UI:{actionEvent} via eventBus when action button is clicked */
|
|
997
|
+
actionEvent?: string;
|
|
964
998
|
}
|
|
965
999
|
declare const EmptyState: React__default.FC<EmptyStateProps>;
|
|
966
1000
|
|
|
@@ -979,6 +1013,8 @@ interface ErrorStateProps {
|
|
|
979
1013
|
description?: string;
|
|
980
1014
|
onRetry?: () => void;
|
|
981
1015
|
className?: string;
|
|
1016
|
+
/** Declarative retry event — emits UI:{retryEvent} via eventBus when retry button is clicked */
|
|
1017
|
+
retryEvent?: string;
|
|
982
1018
|
}
|
|
983
1019
|
declare const ErrorState: React__default.FC<ErrorStateProps>;
|
|
984
1020
|
|
|
@@ -1045,6 +1081,8 @@ interface AccordionProps {
|
|
|
1045
1081
|
* Additional CSS classes
|
|
1046
1082
|
*/
|
|
1047
1083
|
className?: string;
|
|
1084
|
+
/** Declarative toggle event — emits UI:{toggleEvent} with { itemId, isOpen } */
|
|
1085
|
+
toggleEvent?: string;
|
|
1048
1086
|
}
|
|
1049
1087
|
declare const Accordion: React__default.FC<AccordionProps>;
|
|
1050
1088
|
|
|
@@ -1068,6 +1106,8 @@ interface AlertProps {
|
|
|
1068
1106
|
onClose?: () => void;
|
|
1069
1107
|
actions?: React__default.ReactNode;
|
|
1070
1108
|
className?: string;
|
|
1109
|
+
/** Declarative dismiss event — emits UI:{dismissEvent} via eventBus when alert is dismissed */
|
|
1110
|
+
dismissEvent?: string;
|
|
1071
1111
|
}
|
|
1072
1112
|
declare const Alert: React__default.FC<AlertProps>;
|
|
1073
1113
|
|
|
@@ -1103,6 +1143,8 @@ interface BreadcrumbItem {
|
|
|
1103
1143
|
* Is current page
|
|
1104
1144
|
*/
|
|
1105
1145
|
isCurrent?: boolean;
|
|
1146
|
+
/** Event name to emit when clicked (for trait state machine integration) */
|
|
1147
|
+
event?: string;
|
|
1106
1148
|
}
|
|
1107
1149
|
interface BreadcrumbProps {
|
|
1108
1150
|
/**
|
|
@@ -1249,7 +1291,9 @@ declare const FilterGroup: React__default.FC<FilterGroupProps>;
|
|
|
1249
1291
|
|
|
1250
1292
|
interface CardAction {
|
|
1251
1293
|
label: string;
|
|
1252
|
-
onClick
|
|
1294
|
+
onClick?: () => void;
|
|
1295
|
+
/** Event name to emit when clicked (for trait state machine integration) */
|
|
1296
|
+
event?: string;
|
|
1253
1297
|
variant?: "default" | "primary" | "danger";
|
|
1254
1298
|
icon?: string;
|
|
1255
1299
|
disabled?: boolean;
|
|
@@ -1269,11 +1313,13 @@ interface CardProps {
|
|
|
1269
1313
|
onClick?: () => void;
|
|
1270
1314
|
/** Additional CSS classes */
|
|
1271
1315
|
className?: string;
|
|
1316
|
+
/** Declarative event name — emits UI:{action} via eventBus on card click */
|
|
1317
|
+
action?: string;
|
|
1272
1318
|
}
|
|
1273
1319
|
/**
|
|
1274
1320
|
* Card component for displaying content in a contained box
|
|
1275
1321
|
*/
|
|
1276
|
-
declare function Card({ title, subtitle, image, actions, children, onClick, className, }: CardProps): react_jsx_runtime.JSX.Element;
|
|
1322
|
+
declare function Card({ title, subtitle, image, actions, children, onClick, className, action, }: CardProps): react_jsx_runtime.JSX.Element;
|
|
1277
1323
|
|
|
1278
1324
|
/**
|
|
1279
1325
|
* Container Component
|
|
@@ -1371,7 +1417,9 @@ interface FloatingAction {
|
|
|
1371
1417
|
/**
|
|
1372
1418
|
* Action click handler
|
|
1373
1419
|
*/
|
|
1374
|
-
onClick
|
|
1420
|
+
onClick?: () => void;
|
|
1421
|
+
/** Event name to emit when clicked (for trait state machine integration) */
|
|
1422
|
+
event?: string;
|
|
1375
1423
|
/**
|
|
1376
1424
|
* Action variant
|
|
1377
1425
|
*/
|
|
@@ -1554,6 +1602,8 @@ interface ModalProps {
|
|
|
1554
1602
|
closeOnOverlayClick?: boolean;
|
|
1555
1603
|
closeOnEscape?: boolean;
|
|
1556
1604
|
className?: string;
|
|
1605
|
+
/** Declarative close event — emits UI:{closeEvent} via eventBus when modal should close */
|
|
1606
|
+
closeEvent?: string;
|
|
1557
1607
|
}
|
|
1558
1608
|
declare const Modal: React__default.FC<ModalProps>;
|
|
1559
1609
|
|
|
@@ -1617,6 +1667,10 @@ interface PaginationProps {
|
|
|
1617
1667
|
* Additional CSS classes
|
|
1618
1668
|
*/
|
|
1619
1669
|
className?: string;
|
|
1670
|
+
/** Declarative page change event — emits UI:{pageChangeEvent} with { page } */
|
|
1671
|
+
pageChangeEvent?: string;
|
|
1672
|
+
/** Declarative page size change event — emits UI:{pageSizeChangeEvent} with { pageSize } */
|
|
1673
|
+
pageSizeChangeEvent?: string;
|
|
1620
1674
|
}
|
|
1621
1675
|
declare const Pagination: React__default.FC<PaginationProps>;
|
|
1622
1676
|
|
|
@@ -1813,6 +1867,8 @@ interface SidePanelProps {
|
|
|
1813
1867
|
* Additional CSS classes
|
|
1814
1868
|
*/
|
|
1815
1869
|
className?: string;
|
|
1870
|
+
/** Declarative close event — emits UI:{closeEvent} via eventBus when panel should close */
|
|
1871
|
+
closeEvent?: string;
|
|
1816
1872
|
}
|
|
1817
1873
|
declare const SidePanel: React__default.FC<SidePanelProps>;
|
|
1818
1874
|
|
|
@@ -1917,6 +1973,10 @@ interface ToastProps {
|
|
|
1917
1973
|
badge?: string | number;
|
|
1918
1974
|
/** Additional CSS classes */
|
|
1919
1975
|
className?: string;
|
|
1976
|
+
/** Declarative dismiss event — emits UI:{dismissEvent} via eventBus when toast is dismissed */
|
|
1977
|
+
dismissEvent?: string;
|
|
1978
|
+
/** Declarative action event — emits UI:{actionEvent} via eventBus when action button is clicked */
|
|
1979
|
+
actionEvent?: string;
|
|
1920
1980
|
}
|
|
1921
1981
|
declare const Toast: React__default.FC<ToastProps>;
|
|
1922
1982
|
|
|
@@ -1988,6 +2048,8 @@ interface DrawerProps {
|
|
|
1988
2048
|
closeOnEscape?: boolean;
|
|
1989
2049
|
/** Additional class name */
|
|
1990
2050
|
className?: string;
|
|
2051
|
+
/** Declarative close event — emits UI:{closeEvent} via eventBus when drawer should close */
|
|
2052
|
+
closeEvent?: string;
|
|
1991
2053
|
}
|
|
1992
2054
|
declare const Drawer: React__default.FC<DrawerProps>;
|
|
1993
2055
|
|
|
@@ -2025,6 +2087,8 @@ interface WizardProgressProps {
|
|
|
2025
2087
|
compact?: boolean;
|
|
2026
2088
|
/** Additional CSS classes */
|
|
2027
2089
|
className?: string;
|
|
2090
|
+
/** Declarative step click event — emits UI:{stepClickEvent} with { stepIndex } */
|
|
2091
|
+
stepClickEvent?: string;
|
|
2028
2092
|
}
|
|
2029
2093
|
/**
|
|
2030
2094
|
* WizardProgress - Step progress indicator
|
|
@@ -3944,6 +4008,14 @@ interface IsometricCanvasProps {
|
|
|
3944
4008
|
onTileHover?: (x: number, y: number) => void;
|
|
3945
4009
|
/** Tile leave handler */
|
|
3946
4010
|
onTileLeave?: () => void;
|
|
4011
|
+
/** Declarative event: emits UI:{tileClickEvent} with { x, y } on tile click */
|
|
4012
|
+
tileClickEvent?: string;
|
|
4013
|
+
/** Declarative event: emits UI:{unitClickEvent} with { unitId } on unit click */
|
|
4014
|
+
unitClickEvent?: string;
|
|
4015
|
+
/** Declarative event: emits UI:{tileHoverEvent} with { x, y } on tile hover */
|
|
4016
|
+
tileHoverEvent?: string;
|
|
4017
|
+
/** Declarative event: emits UI:{tileLeaveEvent} with {} on tile leave */
|
|
4018
|
+
tileLeaveEvent?: string;
|
|
3947
4019
|
/** Render scale (0.4 = 40% zoom) */
|
|
3948
4020
|
scale?: number;
|
|
3949
4021
|
/** Show debug grid lines and coordinates */
|
|
@@ -3983,7 +4055,7 @@ interface IsometricCanvasProps {
|
|
|
3983
4055
|
effects?: Record<string, string>;
|
|
3984
4056
|
};
|
|
3985
4057
|
}
|
|
3986
|
-
declare function IsometricCanvas({ className, isLoading, error, entity, tiles: tilesProp, units, features, selectedUnitId, validMoves, attackTargets, hoveredTile, onTileClick, onUnitClick, onTileHover, onTileLeave, scale, debug, backgroundImage, showMinimap, enableCamera, unitScale, getTerrainSprite, getFeatureSprite, getUnitSprite, resolveUnitFrame, effectSpriteUrls, onDrawEffects, hasActiveEffects, assetBaseUrl, assetManifest, }: IsometricCanvasProps): JSX.Element;
|
|
4058
|
+
declare function IsometricCanvas({ className, isLoading, error, entity, tiles: tilesProp, units, features, selectedUnitId, validMoves, attackTargets, hoveredTile, onTileClick, onUnitClick, onTileHover, onTileLeave, tileClickEvent, unitClickEvent, tileHoverEvent, tileLeaveEvent, scale, debug, backgroundImage, showMinimap, enableCamera, unitScale, getTerrainSprite, getFeatureSprite, getUnitSprite, resolveUnitFrame, effectSpriteUrls, onDrawEffects, hasActiveEffects, assetBaseUrl, assetManifest, }: IsometricCanvasProps): JSX.Element;
|
|
3987
4059
|
declare namespace IsometricCanvas {
|
|
3988
4060
|
var displayName: string;
|
|
3989
4061
|
}
|
|
@@ -4061,6 +4133,8 @@ interface CanvasEffectProps {
|
|
|
4061
4133
|
intensity?: number;
|
|
4062
4134
|
/** Callback when the effect animation completes */
|
|
4063
4135
|
onComplete?: () => void;
|
|
4136
|
+
/** Declarative event: emits UI:{completeEvent} when the effect animation completes */
|
|
4137
|
+
completeEvent?: string;
|
|
4064
4138
|
/** Additional CSS classes */
|
|
4065
4139
|
className?: string;
|
|
4066
4140
|
/** Loading state indicator */
|
|
@@ -4524,11 +4598,17 @@ interface InventoryPanelProps {
|
|
|
4524
4598
|
/** Currently selected slot index */
|
|
4525
4599
|
selectedSlot?: number;
|
|
4526
4600
|
/** Called when a slot is selected */
|
|
4527
|
-
onSelectSlot
|
|
4601
|
+
onSelectSlot?: (index: number) => void;
|
|
4528
4602
|
/** Called when an item is used (double-click or Enter) */
|
|
4529
4603
|
onUseItem?: (item: InventoryItem) => void;
|
|
4530
4604
|
/** Called when an item is dropped */
|
|
4531
4605
|
onDropItem?: (item: InventoryItem) => void;
|
|
4606
|
+
/** Declarative event: emits UI:{selectSlotEvent} with { index } when a slot is selected */
|
|
4607
|
+
selectSlotEvent?: string;
|
|
4608
|
+
/** Declarative event: emits UI:{useItemEvent} with { item } when an item is used */
|
|
4609
|
+
useItemEvent?: string;
|
|
4610
|
+
/** Declarative event: emits UI:{dropItemEvent} with { item } when an item is dropped */
|
|
4611
|
+
dropItemEvent?: string;
|
|
4532
4612
|
/** Show item tooltips on hover */
|
|
4533
4613
|
showTooltips?: boolean;
|
|
4534
4614
|
/** Optional className */
|
|
@@ -4552,7 +4632,7 @@ interface InventoryPanelProps {
|
|
|
4552
4632
|
* />
|
|
4553
4633
|
* ```
|
|
4554
4634
|
*/
|
|
4555
|
-
declare function InventoryPanel({ items, slots, columns, selectedSlot, onSelectSlot, onUseItem, onDropItem, showTooltips, className, slotSize, }: InventoryPanelProps): JSX.Element;
|
|
4635
|
+
declare function InventoryPanel({ items, slots, columns, selectedSlot, onSelectSlot, onUseItem, onDropItem, selectSlotEvent, useItemEvent, dropItemEvent, showTooltips, className, slotSize, }: InventoryPanelProps): JSX.Element;
|
|
4556
4636
|
|
|
4557
4637
|
/**
|
|
4558
4638
|
* DialogueBox Component
|
|
@@ -4586,6 +4666,12 @@ interface DialogueBoxProps {
|
|
|
4586
4666
|
onChoice?: (choice: DialogueChoice) => void;
|
|
4587
4667
|
/** Called when dialogue is advanced (no choices) */
|
|
4588
4668
|
onAdvance?: () => void;
|
|
4669
|
+
/** Declarative event: emits UI:{completeEvent} when text animation completes */
|
|
4670
|
+
completeEvent?: string;
|
|
4671
|
+
/** Declarative event: emits UI:{choiceEvent} with { choice } when a choice is selected */
|
|
4672
|
+
choiceEvent?: string;
|
|
4673
|
+
/** Declarative event: emits UI:{advanceEvent} when dialogue is advanced */
|
|
4674
|
+
advanceEvent?: string;
|
|
4589
4675
|
/** Optional className */
|
|
4590
4676
|
className?: string;
|
|
4591
4677
|
}
|
|
@@ -4610,7 +4696,7 @@ interface DialogueBoxProps {
|
|
|
4610
4696
|
* />
|
|
4611
4697
|
* ```
|
|
4612
4698
|
*/
|
|
4613
|
-
declare function DialogueBox({ dialogue, typewriterSpeed, position, onComplete, onChoice, onAdvance, className, }: DialogueBoxProps): JSX.Element;
|
|
4699
|
+
declare function DialogueBox({ dialogue, typewriterSpeed, position, onComplete, onChoice, onAdvance, completeEvent, choiceEvent, advanceEvent, className, }: DialogueBoxProps): JSX.Element;
|
|
4614
4700
|
|
|
4615
4701
|
/**
|
|
4616
4702
|
* UISlotRenderer Component
|