@almadar/ui 3.4.0 → 3.5.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.
- package/dist/avl/index.cjs +73 -58
- package/dist/avl/index.js +73 -58
- package/dist/components/atoms/Avatar.d.ts +2 -2
- package/dist/components/atoms/Box.d.ts +3 -3
- package/dist/components/atoms/Button.d.ts +2 -2
- package/dist/components/atoms/InfiniteScrollSentinel.d.ts +3 -2
- package/dist/components/atoms/RangeSlider.d.ts +2 -2
- package/dist/components/atoms/Stack.d.ts +2 -2
- package/dist/components/atoms/TextHighlight.d.ts +1 -1
- package/dist/components/atoms/game/ControlButton.d.ts +3 -2
- package/dist/components/index.cjs +73 -55
- package/dist/components/index.js +73 -55
- package/dist/components/molecules/Alert.d.ts +2 -1
- package/dist/components/molecules/CalendarGrid.d.ts +2 -1
- package/dist/components/molecules/Card.d.ts +2 -2
- package/dist/components/molecules/DataGrid.d.ts +2 -2
- package/dist/components/molecules/DataList.d.ts +5 -5
- package/dist/components/molecules/Drawer.d.ts +2 -1
- package/dist/components/molecules/NumberStepper.d.ts +2 -2
- package/dist/components/molecules/PullToRefresh.d.ts +3 -2
- package/dist/components/molecules/SortableList.d.ts +5 -4
- package/dist/components/molecules/StarRating.d.ts +2 -2
- package/dist/components/molecules/SwipeableRow.d.ts +3 -3
- package/dist/components/molecules/UploadDropZone.d.ts +2 -2
- package/dist/components/molecules/game/DialogueBox.d.ts +3 -2
- package/dist/components/molecules/game/GameMenu.d.ts +3 -3
- package/dist/components/molecules/game/GameOverScreen.d.ts +3 -2
- package/dist/components/molecules/game/InventoryPanel.d.ts +3 -2
- package/dist/components/organisms/ComponentPatterns.d.ts +52 -22
- package/dist/components/organisms/CustomPattern.d.ts +3 -3
- package/dist/components/organisms/GraphCanvas.d.ts +3 -2
- package/dist/components/organisms/game/three/index.cjs +0 -3
- package/dist/components/organisms/game/three/index.js +0 -3
- package/dist/docs/index.cjs +0 -3
- package/dist/docs/index.d.cts +5 -5
- package/dist/docs/index.js +0 -3
- package/dist/hooks/event-bus-types.d.ts +10 -10
- package/dist/hooks/index.cjs +0 -3
- package/dist/hooks/index.js +0 -3
- package/dist/hooks/useDraggable.d.ts +2 -1
- package/dist/hooks/useEventBus.d.ts +2 -1
- package/dist/lib/verificationRegistry.d.ts +2 -2
- package/dist/marketing/index.cjs +0 -3
- package/dist/marketing/index.d.cts +5 -5
- package/dist/marketing/index.js +0 -3
- package/dist/providers/index.cjs +73 -58
- package/dist/providers/index.js +73 -58
- package/dist/runtime/createClientEffectHandlers.d.ts +2 -1
- package/dist/runtime/index.cjs +73 -55
- package/dist/runtime/index.js +73 -55
- package/package.json +6 -3
package/dist/avl/index.cjs
CHANGED
|
@@ -2956,9 +2956,6 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
2956
2956
|
const emit = React126.useCallback((type, payload, source) => {
|
|
2957
2957
|
const event = {
|
|
2958
2958
|
type,
|
|
2959
|
-
// Narrow at the bus boundary: public emit takes Record for ergonomics
|
|
2960
|
-
// (generic UI components pass consumer-defined rows) while the envelope
|
|
2961
|
-
// stores the payload as EventPayload for listeners.
|
|
2962
2959
|
payload,
|
|
2963
2960
|
timestamp: Date.now(),
|
|
2964
2961
|
source
|
|
@@ -3131,9 +3128,6 @@ var init_useEventBus = __esm({
|
|
|
3131
3128
|
emit: (type, payload, source) => {
|
|
3132
3129
|
const event = {
|
|
3133
3130
|
type,
|
|
3134
|
-
// Narrow at the bus boundary: public emit accepts an opaque object so
|
|
3135
|
-
// generic UI emit sites don't require casts; the envelope stores the
|
|
3136
|
-
// payload as EventPayload which listeners consume directly.
|
|
3137
3131
|
payload,
|
|
3138
3132
|
timestamp: Date.now(),
|
|
3139
3133
|
source
|
|
@@ -11047,38 +11041,16 @@ var init_MapView = __esm({
|
|
|
11047
11041
|
}
|
|
11048
11042
|
});
|
|
11049
11043
|
function ButtonPattern({
|
|
11050
|
-
|
|
11051
|
-
variant = "primary",
|
|
11052
|
-
size = "md",
|
|
11053
|
-
disabled = false,
|
|
11044
|
+
action,
|
|
11054
11045
|
onClick,
|
|
11055
11046
|
event,
|
|
11056
11047
|
icon,
|
|
11057
|
-
iconPosition
|
|
11058
|
-
|
|
11048
|
+
iconPosition,
|
|
11049
|
+
...rest
|
|
11059
11050
|
}) {
|
|
11060
|
-
const
|
|
11061
|
-
const
|
|
11062
|
-
|
|
11063
|
-
if (eventName && !disabled) {
|
|
11064
|
-
emit(`UI:${eventName}`, {});
|
|
11065
|
-
}
|
|
11066
|
-
};
|
|
11067
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
11068
|
-
Button,
|
|
11069
|
-
{
|
|
11070
|
-
variant,
|
|
11071
|
-
size,
|
|
11072
|
-
disabled,
|
|
11073
|
-
onClick: handleClick,
|
|
11074
|
-
className,
|
|
11075
|
-
children: [
|
|
11076
|
-
icon && iconPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "sm" }),
|
|
11077
|
-
label,
|
|
11078
|
-
icon && iconPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: icon, size: "sm" })
|
|
11079
|
-
]
|
|
11080
|
-
}
|
|
11081
|
-
);
|
|
11051
|
+
const resolvedAction = action ?? onClick ?? event;
|
|
11052
|
+
const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
|
|
11053
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
|
|
11082
11054
|
}
|
|
11083
11055
|
function TextPattern({
|
|
11084
11056
|
content,
|
|
@@ -19039,7 +19011,11 @@ var init_CardGrid = __esm({
|
|
|
19039
19011
|
return;
|
|
19040
19012
|
}
|
|
19041
19013
|
if (action.event) {
|
|
19042
|
-
|
|
19014
|
+
const payload = {
|
|
19015
|
+
id: itemData.id,
|
|
19016
|
+
row: itemData
|
|
19017
|
+
};
|
|
19018
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
19043
19019
|
}
|
|
19044
19020
|
if (action.onClick) {
|
|
19045
19021
|
action.onClick(itemData);
|
|
@@ -21723,7 +21699,8 @@ var init_DataGrid = __esm({
|
|
|
21723
21699
|
if (next.has(id)) next.delete(id);
|
|
21724
21700
|
else next.add(id);
|
|
21725
21701
|
if (selectionEvent) {
|
|
21726
|
-
|
|
21702
|
+
const payload = { selectedIds: Array.from(next) };
|
|
21703
|
+
eventBus.emit(`UI:${selectionEvent}`, payload);
|
|
21727
21704
|
}
|
|
21728
21705
|
return next;
|
|
21729
21706
|
});
|
|
@@ -21734,7 +21711,8 @@ var init_DataGrid = __esm({
|
|
|
21734
21711
|
const allSelected2 = allIds2.length > 0 && allIds2.every((id) => prev.has(id));
|
|
21735
21712
|
const next = allSelected2 ? /* @__PURE__ */ new Set() : new Set(allIds2);
|
|
21736
21713
|
if (selectionEvent) {
|
|
21737
|
-
|
|
21714
|
+
const payload = { selectedIds: Array.from(next) };
|
|
21715
|
+
eventBus.emit(`UI:${selectionEvent}`, payload);
|
|
21738
21716
|
}
|
|
21739
21717
|
return next;
|
|
21740
21718
|
});
|
|
@@ -21746,7 +21724,11 @@ var init_DataGrid = __esm({
|
|
|
21746
21724
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
21747
21725
|
const handleActionClick = (action, itemData) => (e) => {
|
|
21748
21726
|
e.stopPropagation();
|
|
21749
|
-
|
|
21727
|
+
const payload = {
|
|
21728
|
+
id: itemData.id,
|
|
21729
|
+
row: itemData
|
|
21730
|
+
};
|
|
21731
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
21750
21732
|
};
|
|
21751
21733
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
21752
21734
|
const colsClass = cols ? {
|
|
@@ -22074,7 +22056,11 @@ var init_DataList = __esm({
|
|
|
22074
22056
|
);
|
|
22075
22057
|
const handleActionClick = (action, itemData) => (e) => {
|
|
22076
22058
|
e.stopPropagation();
|
|
22077
|
-
|
|
22059
|
+
const payload = {
|
|
22060
|
+
id: itemData.id,
|
|
22061
|
+
row: itemData
|
|
22062
|
+
};
|
|
22063
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
22078
22064
|
};
|
|
22079
22065
|
if (isLoading) {
|
|
22080
22066
|
return /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
@@ -30458,7 +30444,8 @@ var init_DetailPanel = __esm({
|
|
|
30458
30444
|
return;
|
|
30459
30445
|
}
|
|
30460
30446
|
if (action.event) {
|
|
30461
|
-
|
|
30447
|
+
const payload = data2 ? { id: data2.id, row: data2 } : {};
|
|
30448
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
30462
30449
|
}
|
|
30463
30450
|
if (action.onClick) {
|
|
30464
30451
|
action.onClick();
|
|
@@ -31900,9 +31887,10 @@ var init_Form = __esm({
|
|
|
31900
31887
|
};
|
|
31901
31888
|
const handleSubmit = (e) => {
|
|
31902
31889
|
e.preventDefault();
|
|
31903
|
-
|
|
31890
|
+
const payload = { data: formData };
|
|
31891
|
+
eventBus.emit(`UI:${submitEvent}`, payload);
|
|
31904
31892
|
if (onSubmit) {
|
|
31905
|
-
eventBus.emit(`UI:${onSubmit}`,
|
|
31893
|
+
eventBus.emit(`UI:${onSubmit}`, payload);
|
|
31906
31894
|
}
|
|
31907
31895
|
};
|
|
31908
31896
|
const handleCancel = () => {
|
|
@@ -33270,6 +33258,31 @@ function normalizeFields2(fields) {
|
|
|
33270
33258
|
if (!fields) return [];
|
|
33271
33259
|
return fields.map((f3) => typeof f3 === "string" ? f3 : f3.key ?? f3.name ?? "");
|
|
33272
33260
|
}
|
|
33261
|
+
function entityFieldsFromListItem(item) {
|
|
33262
|
+
const {
|
|
33263
|
+
icon: _icon,
|
|
33264
|
+
metadata: _metadata,
|
|
33265
|
+
onClick: _onClick,
|
|
33266
|
+
avatar: _avatar,
|
|
33267
|
+
_fields,
|
|
33268
|
+
...rest
|
|
33269
|
+
} = item;
|
|
33270
|
+
const result = {};
|
|
33271
|
+
for (const [key, value] of Object.entries(rest)) {
|
|
33272
|
+
if (typeof value === "function" || value !== null && typeof value === "object" && "$$typeof" in value) {
|
|
33273
|
+
continue;
|
|
33274
|
+
}
|
|
33275
|
+
result[key] = value;
|
|
33276
|
+
}
|
|
33277
|
+
if (_fields && typeof _fields === "object") {
|
|
33278
|
+
for (const [k, v] of Object.entries(_fields)) {
|
|
33279
|
+
if (typeof v !== "function") {
|
|
33280
|
+
result[k] = v;
|
|
33281
|
+
}
|
|
33282
|
+
}
|
|
33283
|
+
}
|
|
33284
|
+
return result;
|
|
33285
|
+
}
|
|
33273
33286
|
function getStatusStyle(fieldName, value) {
|
|
33274
33287
|
const val = String(value).toLowerCase();
|
|
33275
33288
|
if (val.includes("complete") || val.includes("done"))
|
|
@@ -33473,18 +33486,17 @@ var init_List = __esm({
|
|
|
33473
33486
|
label: action.label,
|
|
33474
33487
|
event: action.event,
|
|
33475
33488
|
onClick: () => {
|
|
33489
|
+
const row = entityFieldsFromListItem(item);
|
|
33476
33490
|
if (action.navigatesTo) {
|
|
33477
33491
|
const url = action.navigatesTo.replace(
|
|
33478
33492
|
/\{\{(\w+)\}\}/g,
|
|
33479
|
-
(_, key) => String(
|
|
33493
|
+
(_, key) => String(row[key] ?? item.id ?? "")
|
|
33480
33494
|
);
|
|
33481
|
-
eventBus.emit("UI:NAVIGATE", { url, row
|
|
33495
|
+
eventBus.emit("UI:NAVIGATE", { url, row });
|
|
33482
33496
|
return;
|
|
33483
33497
|
}
|
|
33484
33498
|
if (action.event) {
|
|
33485
|
-
eventBus.emit(`UI:${action.event}`, {
|
|
33486
|
-
row: item
|
|
33487
|
-
});
|
|
33499
|
+
eventBus.emit(`UI:${action.event}`, { row });
|
|
33488
33500
|
}
|
|
33489
33501
|
}
|
|
33490
33502
|
}));
|
|
@@ -33564,7 +33576,7 @@ var init_List = __esm({
|
|
|
33564
33576
|
);
|
|
33565
33577
|
const hasExplicitClick = !!(viewAction?.event || item.onClick);
|
|
33566
33578
|
const rowAction = viewAction?.event ?? "VIEW";
|
|
33567
|
-
const rowActionPayload = { row: item };
|
|
33579
|
+
const rowActionPayload = { row: entityFieldsFromListItem(item) };
|
|
33568
33580
|
const primaryField = effectiveFieldNames?.[0];
|
|
33569
33581
|
const statusField = effectiveFieldNames?.find(
|
|
33570
33582
|
(f3) => f3.toLowerCase().includes("status")
|
|
@@ -39418,16 +39430,19 @@ var init_Timeline = __esm({
|
|
|
39418
39430
|
] }),
|
|
39419
39431
|
item.description && /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "small", color: "secondary", children: item.description }),
|
|
39420
39432
|
item.tags && item.tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", wrap: true, children: item.tags.map((tag, tagIdx) => /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", children: tag }, tagIdx)) }),
|
|
39421
|
-
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className: "mt-1", children: itemActions.map((action, actionIdx) =>
|
|
39422
|
-
|
|
39423
|
-
|
|
39424
|
-
|
|
39425
|
-
|
|
39426
|
-
|
|
39427
|
-
|
|
39428
|
-
|
|
39429
|
-
|
|
39430
|
-
|
|
39433
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(HStack, { gap: "xs", className: "mt-1", children: itemActions.map((action, actionIdx) => {
|
|
39434
|
+
const { icon: _icon, ...rowSafe } = item;
|
|
39435
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
39436
|
+
Box,
|
|
39437
|
+
{
|
|
39438
|
+
action: action.event,
|
|
39439
|
+
actionPayload: { row: rowSafe },
|
|
39440
|
+
className: "cursor-pointer hover:opacity-80 transition-opacity",
|
|
39441
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "default", children: action.label })
|
|
39442
|
+
},
|
|
39443
|
+
actionIdx
|
|
39444
|
+
);
|
|
39445
|
+
}) })
|
|
39431
39446
|
] })
|
|
39432
39447
|
] }, item.id);
|
|
39433
39448
|
}) })
|
package/dist/avl/index.js
CHANGED
|
@@ -2910,9 +2910,6 @@ function EventBusProvider({ children, debug: debug2 = false }) {
|
|
|
2910
2910
|
const emit = useCallback((type, payload, source) => {
|
|
2911
2911
|
const event = {
|
|
2912
2912
|
type,
|
|
2913
|
-
// Narrow at the bus boundary: public emit takes Record for ergonomics
|
|
2914
|
-
// (generic UI components pass consumer-defined rows) while the envelope
|
|
2915
|
-
// stores the payload as EventPayload for listeners.
|
|
2916
2913
|
payload,
|
|
2917
2914
|
timestamp: Date.now(),
|
|
2918
2915
|
source
|
|
@@ -3085,9 +3082,6 @@ var init_useEventBus = __esm({
|
|
|
3085
3082
|
emit: (type, payload, source) => {
|
|
3086
3083
|
const event = {
|
|
3087
3084
|
type,
|
|
3088
|
-
// Narrow at the bus boundary: public emit accepts an opaque object so
|
|
3089
|
-
// generic UI emit sites don't require casts; the envelope stores the
|
|
3090
|
-
// payload as EventPayload which listeners consume directly.
|
|
3091
3085
|
payload,
|
|
3092
3086
|
timestamp: Date.now(),
|
|
3093
3087
|
source
|
|
@@ -11001,38 +10995,16 @@ var init_MapView = __esm({
|
|
|
11001
10995
|
}
|
|
11002
10996
|
});
|
|
11003
10997
|
function ButtonPattern({
|
|
11004
|
-
|
|
11005
|
-
variant = "primary",
|
|
11006
|
-
size = "md",
|
|
11007
|
-
disabled = false,
|
|
10998
|
+
action,
|
|
11008
10999
|
onClick,
|
|
11009
11000
|
event,
|
|
11010
11001
|
icon,
|
|
11011
|
-
iconPosition
|
|
11012
|
-
|
|
11002
|
+
iconPosition,
|
|
11003
|
+
...rest
|
|
11013
11004
|
}) {
|
|
11014
|
-
const
|
|
11015
|
-
const
|
|
11016
|
-
|
|
11017
|
-
if (eventName && !disabled) {
|
|
11018
|
-
emit(`UI:${eventName}`, {});
|
|
11019
|
-
}
|
|
11020
|
-
};
|
|
11021
|
-
return /* @__PURE__ */ jsxs(
|
|
11022
|
-
Button,
|
|
11023
|
-
{
|
|
11024
|
-
variant,
|
|
11025
|
-
size,
|
|
11026
|
-
disabled,
|
|
11027
|
-
onClick: handleClick,
|
|
11028
|
-
className,
|
|
11029
|
-
children: [
|
|
11030
|
-
icon && iconPosition === "left" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }),
|
|
11031
|
-
label,
|
|
11032
|
-
icon && iconPosition === "right" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" })
|
|
11033
|
-
]
|
|
11034
|
-
}
|
|
11035
|
-
);
|
|
11005
|
+
const resolvedAction = action ?? onClick ?? event;
|
|
11006
|
+
const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
|
|
11007
|
+
return /* @__PURE__ */ jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
|
|
11036
11008
|
}
|
|
11037
11009
|
function TextPattern({
|
|
11038
11010
|
content,
|
|
@@ -18993,7 +18965,11 @@ var init_CardGrid = __esm({
|
|
|
18993
18965
|
return;
|
|
18994
18966
|
}
|
|
18995
18967
|
if (action.event) {
|
|
18996
|
-
|
|
18968
|
+
const payload = {
|
|
18969
|
+
id: itemData.id,
|
|
18970
|
+
row: itemData
|
|
18971
|
+
};
|
|
18972
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
18997
18973
|
}
|
|
18998
18974
|
if (action.onClick) {
|
|
18999
18975
|
action.onClick(itemData);
|
|
@@ -21677,7 +21653,8 @@ var init_DataGrid = __esm({
|
|
|
21677
21653
|
if (next.has(id)) next.delete(id);
|
|
21678
21654
|
else next.add(id);
|
|
21679
21655
|
if (selectionEvent) {
|
|
21680
|
-
|
|
21656
|
+
const payload = { selectedIds: Array.from(next) };
|
|
21657
|
+
eventBus.emit(`UI:${selectionEvent}`, payload);
|
|
21681
21658
|
}
|
|
21682
21659
|
return next;
|
|
21683
21660
|
});
|
|
@@ -21688,7 +21665,8 @@ var init_DataGrid = __esm({
|
|
|
21688
21665
|
const allSelected2 = allIds2.length > 0 && allIds2.every((id) => prev.has(id));
|
|
21689
21666
|
const next = allSelected2 ? /* @__PURE__ */ new Set() : new Set(allIds2);
|
|
21690
21667
|
if (selectionEvent) {
|
|
21691
|
-
|
|
21668
|
+
const payload = { selectedIds: Array.from(next) };
|
|
21669
|
+
eventBus.emit(`UI:${selectionEvent}`, payload);
|
|
21692
21670
|
}
|
|
21693
21671
|
return next;
|
|
21694
21672
|
});
|
|
@@ -21700,7 +21678,11 @@ var init_DataGrid = __esm({
|
|
|
21700
21678
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
21701
21679
|
const handleActionClick = (action, itemData) => (e) => {
|
|
21702
21680
|
e.stopPropagation();
|
|
21703
|
-
|
|
21681
|
+
const payload = {
|
|
21682
|
+
id: itemData.id,
|
|
21683
|
+
row: itemData
|
|
21684
|
+
};
|
|
21685
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
21704
21686
|
};
|
|
21705
21687
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
21706
21688
|
const colsClass = cols ? {
|
|
@@ -22028,7 +22010,11 @@ var init_DataList = __esm({
|
|
|
22028
22010
|
);
|
|
22029
22011
|
const handleActionClick = (action, itemData) => (e) => {
|
|
22030
22012
|
e.stopPropagation();
|
|
22031
|
-
|
|
22013
|
+
const payload = {
|
|
22014
|
+
id: itemData.id,
|
|
22015
|
+
row: itemData
|
|
22016
|
+
};
|
|
22017
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
22032
22018
|
};
|
|
22033
22019
|
if (isLoading) {
|
|
22034
22020
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
@@ -30412,7 +30398,8 @@ var init_DetailPanel = __esm({
|
|
|
30412
30398
|
return;
|
|
30413
30399
|
}
|
|
30414
30400
|
if (action.event) {
|
|
30415
|
-
|
|
30401
|
+
const payload = data2 ? { id: data2.id, row: data2 } : {};
|
|
30402
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
30416
30403
|
}
|
|
30417
30404
|
if (action.onClick) {
|
|
30418
30405
|
action.onClick();
|
|
@@ -31854,9 +31841,10 @@ var init_Form = __esm({
|
|
|
31854
31841
|
};
|
|
31855
31842
|
const handleSubmit = (e) => {
|
|
31856
31843
|
e.preventDefault();
|
|
31857
|
-
|
|
31844
|
+
const payload = { data: formData };
|
|
31845
|
+
eventBus.emit(`UI:${submitEvent}`, payload);
|
|
31858
31846
|
if (onSubmit) {
|
|
31859
|
-
eventBus.emit(`UI:${onSubmit}`,
|
|
31847
|
+
eventBus.emit(`UI:${onSubmit}`, payload);
|
|
31860
31848
|
}
|
|
31861
31849
|
};
|
|
31862
31850
|
const handleCancel = () => {
|
|
@@ -33224,6 +33212,31 @@ function normalizeFields2(fields) {
|
|
|
33224
33212
|
if (!fields) return [];
|
|
33225
33213
|
return fields.map((f3) => typeof f3 === "string" ? f3 : f3.key ?? f3.name ?? "");
|
|
33226
33214
|
}
|
|
33215
|
+
function entityFieldsFromListItem(item) {
|
|
33216
|
+
const {
|
|
33217
|
+
icon: _icon,
|
|
33218
|
+
metadata: _metadata,
|
|
33219
|
+
onClick: _onClick,
|
|
33220
|
+
avatar: _avatar,
|
|
33221
|
+
_fields,
|
|
33222
|
+
...rest
|
|
33223
|
+
} = item;
|
|
33224
|
+
const result = {};
|
|
33225
|
+
for (const [key, value] of Object.entries(rest)) {
|
|
33226
|
+
if (typeof value === "function" || value !== null && typeof value === "object" && "$$typeof" in value) {
|
|
33227
|
+
continue;
|
|
33228
|
+
}
|
|
33229
|
+
result[key] = value;
|
|
33230
|
+
}
|
|
33231
|
+
if (_fields && typeof _fields === "object") {
|
|
33232
|
+
for (const [k, v] of Object.entries(_fields)) {
|
|
33233
|
+
if (typeof v !== "function") {
|
|
33234
|
+
result[k] = v;
|
|
33235
|
+
}
|
|
33236
|
+
}
|
|
33237
|
+
}
|
|
33238
|
+
return result;
|
|
33239
|
+
}
|
|
33227
33240
|
function getStatusStyle(fieldName, value) {
|
|
33228
33241
|
const val = String(value).toLowerCase();
|
|
33229
33242
|
if (val.includes("complete") || val.includes("done"))
|
|
@@ -33427,18 +33440,17 @@ var init_List = __esm({
|
|
|
33427
33440
|
label: action.label,
|
|
33428
33441
|
event: action.event,
|
|
33429
33442
|
onClick: () => {
|
|
33443
|
+
const row = entityFieldsFromListItem(item);
|
|
33430
33444
|
if (action.navigatesTo) {
|
|
33431
33445
|
const url = action.navigatesTo.replace(
|
|
33432
33446
|
/\{\{(\w+)\}\}/g,
|
|
33433
|
-
(_, key) => String(
|
|
33447
|
+
(_, key) => String(row[key] ?? item.id ?? "")
|
|
33434
33448
|
);
|
|
33435
|
-
eventBus.emit("UI:NAVIGATE", { url, row
|
|
33449
|
+
eventBus.emit("UI:NAVIGATE", { url, row });
|
|
33436
33450
|
return;
|
|
33437
33451
|
}
|
|
33438
33452
|
if (action.event) {
|
|
33439
|
-
eventBus.emit(`UI:${action.event}`, {
|
|
33440
|
-
row: item
|
|
33441
|
-
});
|
|
33453
|
+
eventBus.emit(`UI:${action.event}`, { row });
|
|
33442
33454
|
}
|
|
33443
33455
|
}
|
|
33444
33456
|
}));
|
|
@@ -33518,7 +33530,7 @@ var init_List = __esm({
|
|
|
33518
33530
|
);
|
|
33519
33531
|
const hasExplicitClick = !!(viewAction?.event || item.onClick);
|
|
33520
33532
|
const rowAction = viewAction?.event ?? "VIEW";
|
|
33521
|
-
const rowActionPayload = { row: item };
|
|
33533
|
+
const rowActionPayload = { row: entityFieldsFromListItem(item) };
|
|
33522
33534
|
const primaryField = effectiveFieldNames?.[0];
|
|
33523
33535
|
const statusField = effectiveFieldNames?.find(
|
|
33524
33536
|
(f3) => f3.toLowerCase().includes("status")
|
|
@@ -39372,16 +39384,19 @@ var init_Timeline = __esm({
|
|
|
39372
39384
|
] }),
|
|
39373
39385
|
item.description && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "secondary", children: item.description }),
|
|
39374
39386
|
item.tags && item.tags.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", wrap: true, children: item.tags.map((tag, tagIdx) => /* @__PURE__ */ jsx(Badge, { variant: "default", children: tag }, tagIdx)) }),
|
|
39375
|
-
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "mt-1", children: itemActions.map((action, actionIdx) =>
|
|
39376
|
-
|
|
39377
|
-
|
|
39378
|
-
|
|
39379
|
-
|
|
39380
|
-
|
|
39381
|
-
|
|
39382
|
-
|
|
39383
|
-
|
|
39384
|
-
|
|
39387
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "mt-1", children: itemActions.map((action, actionIdx) => {
|
|
39388
|
+
const { icon: _icon, ...rowSafe } = item;
|
|
39389
|
+
return /* @__PURE__ */ jsx(
|
|
39390
|
+
Box,
|
|
39391
|
+
{
|
|
39392
|
+
action: action.event,
|
|
39393
|
+
actionPayload: { row: rowSafe },
|
|
39394
|
+
className: "cursor-pointer hover:opacity-80 transition-opacity",
|
|
39395
|
+
children: /* @__PURE__ */ jsx(Badge, { variant: "default", children: action.label })
|
|
39396
|
+
},
|
|
39397
|
+
actionIdx
|
|
39398
|
+
);
|
|
39399
|
+
}) })
|
|
39385
39400
|
] })
|
|
39386
39401
|
] }, item.id);
|
|
39387
39402
|
}) })
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* A versatile avatar component supporting images, initials, icons, and status indicators.
|
|
5
5
|
*/
|
|
6
6
|
import React from "react";
|
|
7
|
-
import type { EventKey } from "@almadar/core";
|
|
7
|
+
import type { EventKey, EventPayload } from "@almadar/core";
|
|
8
8
|
import type { LucideIcon } from "lucide-react";
|
|
9
9
|
export type AvatarSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
10
10
|
export type AvatarStatus = "online" | "offline" | "away" | "busy";
|
|
@@ -54,6 +54,6 @@ export interface AvatarProps {
|
|
|
54
54
|
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
55
55
|
action?: EventKey;
|
|
56
56
|
/** Payload to include with the action event */
|
|
57
|
-
actionPayload?:
|
|
57
|
+
actionPayload?: EventPayload;
|
|
58
58
|
}
|
|
59
59
|
export declare const Avatar: React.FC<AvatarProps>;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Think of it as a styled div with consistent design tokens.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
-
import type { EventKey } from "@almadar/core";
|
|
8
|
+
import type { EventKey, EventPayload } from "@almadar/core";
|
|
9
9
|
export type BoxPadding = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
10
10
|
export type BoxMargin = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "auto";
|
|
11
11
|
export type BoxBg = "transparent" | "primary" | "secondary" | "muted" | "accent" | "surface" | "overlay";
|
|
@@ -47,9 +47,9 @@ export interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
47
47
|
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
48
48
|
action?: EventKey;
|
|
49
49
|
/** Payload to include with the action event */
|
|
50
|
-
actionPayload?:
|
|
50
|
+
actionPayload?: EventPayload;
|
|
51
51
|
/** Declarative hover event — emits UI:{hoverEvent} with { hovered: true/false } on mouseEnter/mouseLeave */
|
|
52
|
-
hoverEvent?:
|
|
52
|
+
hoverEvent?: EventKey;
|
|
53
53
|
/** Maximum width (CSS value, e.g., "550px", "80rem") */
|
|
54
54
|
maxWidth?: string;
|
|
55
55
|
/** Children elements */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { EventKey } from "@almadar/core";
|
|
2
|
+
import type { EventKey, EventPayload } from "@almadar/core";
|
|
3
3
|
import { type LucideIcon } from "lucide-react";
|
|
4
4
|
export type ButtonVariant = "primary" | "secondary" | "ghost" | "danger" | "success" | "warning" | "default";
|
|
5
5
|
export type ButtonSize = "sm" | "md" | "lg";
|
|
@@ -18,7 +18,7 @@ export interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
18
18
|
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
19
19
|
action?: EventKey;
|
|
20
20
|
/** Payload to include with the action event */
|
|
21
|
-
actionPayload?:
|
|
21
|
+
actionPayload?: EventPayload;
|
|
22
22
|
/** Button label text (alternative to children for schema-driven rendering) */
|
|
23
23
|
label?: string;
|
|
24
24
|
}
|
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
* then fires a load-more event through the event bus.
|
|
7
7
|
*/
|
|
8
8
|
import React from "react";
|
|
9
|
+
import type { EventKey, EventPayload } from "@almadar/core";
|
|
9
10
|
export interface InfiniteScrollSentinelProps {
|
|
10
11
|
/** Event name to emit when load-more is triggered (emitted as UI:{loadMoreEvent}) */
|
|
11
|
-
loadMoreEvent:
|
|
12
|
+
loadMoreEvent: EventKey;
|
|
12
13
|
/** Optional payload to include with the load-more event */
|
|
13
|
-
loadMorePayload?:
|
|
14
|
+
loadMorePayload?: EventPayload;
|
|
14
15
|
/** Whether a load operation is currently in progress */
|
|
15
16
|
isLoading?: boolean;
|
|
16
17
|
/** Whether there are more items to load */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import type { EventKey } from "@almadar/core";
|
|
2
|
+
import type { EventKey, EventPayload } from "@almadar/core";
|
|
3
3
|
export type RangeSliderSize = "sm" | "md" | "lg";
|
|
4
4
|
export interface RangeSliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, "onChange"> {
|
|
5
5
|
/** Minimum value */
|
|
@@ -23,7 +23,7 @@ export interface RangeSliderProps extends Omit<React.HTMLAttributes<HTMLDivEleme
|
|
|
23
23
|
/** Declarative event name for value changes */
|
|
24
24
|
action?: EventKey;
|
|
25
25
|
/** Payload to include with the action event */
|
|
26
|
-
actionPayload?:
|
|
26
|
+
actionPayload?: EventPayload;
|
|
27
27
|
/** Direct onChange callback */
|
|
28
28
|
onChange?: (value: number) => void;
|
|
29
29
|
/** Format function for tooltip display */
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Includes convenience exports VStack and HStack for common use cases.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
-
import type { EventKey } from "@almadar/core";
|
|
8
|
+
import type { EventKey, EventPayload } from "@almadar/core";
|
|
9
9
|
export type StackDirection = "horizontal" | "vertical";
|
|
10
10
|
export type StackGap = "none" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
|
|
11
11
|
export type StackAlign = "start" | "center" | "end" | "stretch" | "baseline";
|
|
@@ -44,7 +44,7 @@ export interface StackProps {
|
|
|
44
44
|
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
45
45
|
action?: EventKey;
|
|
46
46
|
/** Payload to include with the action event */
|
|
47
|
-
actionPayload?:
|
|
47
|
+
actionPayload?: EventPayload;
|
|
48
48
|
/** When true, horizontal stacks flip to vertical below the md breakpoint (768px) */
|
|
49
49
|
responsive?: boolean;
|
|
50
50
|
}
|
|
@@ -46,7 +46,7 @@ export interface TextHighlightProps {
|
|
|
46
46
|
/** Declarative event name — emits UI:{action} via eventBus on click */
|
|
47
47
|
action?: EventKey;
|
|
48
48
|
/** Declarative hover event — emits UI:{hoverEvent} with { hovered: true/false } */
|
|
49
|
-
hoverEvent?:
|
|
49
|
+
hoverEvent?: EventKey;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* TextHighlight component for rendering highlighted text annotations
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import type { EventKey } from "@almadar/core";
|
|
2
3
|
export interface ControlButtonProps {
|
|
3
4
|
/** Button label text */
|
|
4
5
|
label?: string;
|
|
@@ -15,9 +16,9 @@ export interface ControlButtonProps {
|
|
|
15
16
|
/** Called when button is released */
|
|
16
17
|
onRelease?: () => void;
|
|
17
18
|
/** Declarative event name emitted on press via useEventBus */
|
|
18
|
-
pressEvent?:
|
|
19
|
+
pressEvent?: EventKey;
|
|
19
20
|
/** Declarative event name emitted on release via useEventBus */
|
|
20
|
-
releaseEvent?:
|
|
21
|
+
releaseEvent?: EventKey;
|
|
21
22
|
/** Whether the button is currently pressed */
|
|
22
23
|
pressed?: boolean;
|
|
23
24
|
/** Whether the button is disabled */
|