@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
|
@@ -227,9 +227,6 @@ var init_useEventBus = __esm({
|
|
|
227
227
|
emit: (type, payload, source) => {
|
|
228
228
|
const event = {
|
|
229
229
|
type,
|
|
230
|
-
// Narrow at the bus boundary: public emit accepts an opaque object so
|
|
231
|
-
// generic UI emit sites don't require casts; the envelope stores the
|
|
232
|
-
// payload as EventPayload which listeners consume directly.
|
|
233
230
|
payload,
|
|
234
231
|
timestamp: Date.now(),
|
|
235
232
|
source
|
|
@@ -6401,38 +6398,16 @@ var init_MapView = __esm({
|
|
|
6401
6398
|
}
|
|
6402
6399
|
});
|
|
6403
6400
|
function ButtonPattern({
|
|
6404
|
-
|
|
6405
|
-
variant = "primary",
|
|
6406
|
-
size = "md",
|
|
6407
|
-
disabled = false,
|
|
6401
|
+
action,
|
|
6408
6402
|
onClick,
|
|
6409
6403
|
event,
|
|
6410
6404
|
icon,
|
|
6411
|
-
iconPosition
|
|
6412
|
-
|
|
6405
|
+
iconPosition,
|
|
6406
|
+
...rest
|
|
6413
6407
|
}) {
|
|
6414
|
-
const
|
|
6415
|
-
const
|
|
6416
|
-
|
|
6417
|
-
if (eventName && !disabled) {
|
|
6418
|
-
emit(`UI:${eventName}`, {});
|
|
6419
|
-
}
|
|
6420
|
-
};
|
|
6421
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6422
|
-
exports.Button,
|
|
6423
|
-
{
|
|
6424
|
-
variant,
|
|
6425
|
-
size,
|
|
6426
|
-
disabled,
|
|
6427
|
-
onClick: handleClick,
|
|
6428
|
-
className,
|
|
6429
|
-
children: [
|
|
6430
|
-
icon && iconPosition === "left" && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: icon, size: "sm" }),
|
|
6431
|
-
label,
|
|
6432
|
-
icon && iconPosition === "right" && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: icon, size: "sm" })
|
|
6433
|
-
]
|
|
6434
|
-
}
|
|
6435
|
-
);
|
|
6408
|
+
const resolvedAction = action ?? onClick ?? event;
|
|
6409
|
+
const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
|
|
6410
|
+
return /* @__PURE__ */ jsxRuntime.jsx(exports.Button, { ...rest, action: resolvedAction, ...iconProps });
|
|
6436
6411
|
}
|
|
6437
6412
|
function TextPattern({
|
|
6438
6413
|
content,
|
|
@@ -14451,7 +14426,11 @@ var init_CardGrid = __esm({
|
|
|
14451
14426
|
return;
|
|
14452
14427
|
}
|
|
14453
14428
|
if (action.event) {
|
|
14454
|
-
|
|
14429
|
+
const payload = {
|
|
14430
|
+
id: itemData.id,
|
|
14431
|
+
row: itemData
|
|
14432
|
+
};
|
|
14433
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
14455
14434
|
}
|
|
14456
14435
|
if (action.onClick) {
|
|
14457
14436
|
action.onClick(itemData);
|
|
@@ -17366,7 +17345,8 @@ var init_DataGrid = __esm({
|
|
|
17366
17345
|
if (next.has(id)) next.delete(id);
|
|
17367
17346
|
else next.add(id);
|
|
17368
17347
|
if (selectionEvent) {
|
|
17369
|
-
|
|
17348
|
+
const payload = { selectedIds: Array.from(next) };
|
|
17349
|
+
eventBus.emit(`UI:${selectionEvent}`, payload);
|
|
17370
17350
|
}
|
|
17371
17351
|
return next;
|
|
17372
17352
|
});
|
|
@@ -17377,7 +17357,8 @@ var init_DataGrid = __esm({
|
|
|
17377
17357
|
const allSelected2 = allIds2.length > 0 && allIds2.every((id) => prev.has(id));
|
|
17378
17358
|
const next = allSelected2 ? /* @__PURE__ */ new Set() : new Set(allIds2);
|
|
17379
17359
|
if (selectionEvent) {
|
|
17380
|
-
|
|
17360
|
+
const payload = { selectedIds: Array.from(next) };
|
|
17361
|
+
eventBus.emit(`UI:${selectionEvent}`, payload);
|
|
17381
17362
|
}
|
|
17382
17363
|
return next;
|
|
17383
17364
|
});
|
|
@@ -17389,7 +17370,11 @@ var init_DataGrid = __esm({
|
|
|
17389
17370
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
17390
17371
|
const handleActionClick = (action, itemData) => (e) => {
|
|
17391
17372
|
e.stopPropagation();
|
|
17392
|
-
|
|
17373
|
+
const payload = {
|
|
17374
|
+
id: itemData.id,
|
|
17375
|
+
row: itemData
|
|
17376
|
+
};
|
|
17377
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
17393
17378
|
};
|
|
17394
17379
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
17395
17380
|
const colsClass = cols ? {
|
|
@@ -17717,7 +17702,11 @@ var init_DataList = __esm({
|
|
|
17717
17702
|
);
|
|
17718
17703
|
const handleActionClick = (action, itemData) => (e) => {
|
|
17719
17704
|
e.stopPropagation();
|
|
17720
|
-
|
|
17705
|
+
const payload = {
|
|
17706
|
+
id: itemData.id,
|
|
17707
|
+
row: itemData
|
|
17708
|
+
};
|
|
17709
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
17721
17710
|
};
|
|
17722
17711
|
if (isLoading) {
|
|
17723
17712
|
return /* @__PURE__ */ jsxRuntime.jsx(exports.Box, { className: "text-center py-8", children: /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
@@ -26371,7 +26360,8 @@ var init_DetailPanel = __esm({
|
|
|
26371
26360
|
return;
|
|
26372
26361
|
}
|
|
26373
26362
|
if (action.event) {
|
|
26374
|
-
|
|
26363
|
+
const payload = data2 ? { id: data2.id, row: data2 } : {};
|
|
26364
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
26375
26365
|
}
|
|
26376
26366
|
if (action.onClick) {
|
|
26377
26367
|
action.onClick();
|
|
@@ -27908,9 +27898,10 @@ var init_Form = __esm({
|
|
|
27908
27898
|
};
|
|
27909
27899
|
const handleSubmit = (e) => {
|
|
27910
27900
|
e.preventDefault();
|
|
27911
|
-
|
|
27901
|
+
const payload = { data: formData };
|
|
27902
|
+
eventBus.emit(`UI:${submitEvent}`, payload);
|
|
27912
27903
|
if (onSubmit) {
|
|
27913
|
-
eventBus.emit(`UI:${onSubmit}`,
|
|
27904
|
+
eventBus.emit(`UI:${onSubmit}`, payload);
|
|
27914
27905
|
}
|
|
27915
27906
|
};
|
|
27916
27907
|
const handleCancel = () => {
|
|
@@ -29278,6 +29269,31 @@ function normalizeFields2(fields) {
|
|
|
29278
29269
|
if (!fields) return [];
|
|
29279
29270
|
return fields.map((f3) => typeof f3 === "string" ? f3 : f3.key ?? f3.name ?? "");
|
|
29280
29271
|
}
|
|
29272
|
+
function entityFieldsFromListItem(item) {
|
|
29273
|
+
const {
|
|
29274
|
+
icon: _icon,
|
|
29275
|
+
metadata: _metadata,
|
|
29276
|
+
onClick: _onClick,
|
|
29277
|
+
avatar: _avatar,
|
|
29278
|
+
_fields,
|
|
29279
|
+
...rest
|
|
29280
|
+
} = item;
|
|
29281
|
+
const result = {};
|
|
29282
|
+
for (const [key, value] of Object.entries(rest)) {
|
|
29283
|
+
if (typeof value === "function" || value !== null && typeof value === "object" && "$$typeof" in value) {
|
|
29284
|
+
continue;
|
|
29285
|
+
}
|
|
29286
|
+
result[key] = value;
|
|
29287
|
+
}
|
|
29288
|
+
if (_fields && typeof _fields === "object") {
|
|
29289
|
+
for (const [k, v] of Object.entries(_fields)) {
|
|
29290
|
+
if (typeof v !== "function") {
|
|
29291
|
+
result[k] = v;
|
|
29292
|
+
}
|
|
29293
|
+
}
|
|
29294
|
+
}
|
|
29295
|
+
return result;
|
|
29296
|
+
}
|
|
29281
29297
|
function getStatusStyle(fieldName, value) {
|
|
29282
29298
|
const val = String(value).toLowerCase();
|
|
29283
29299
|
if (val.includes("complete") || val.includes("done"))
|
|
@@ -29481,18 +29497,17 @@ var init_List = __esm({
|
|
|
29481
29497
|
label: action.label,
|
|
29482
29498
|
event: action.event,
|
|
29483
29499
|
onClick: () => {
|
|
29500
|
+
const row = entityFieldsFromListItem(item);
|
|
29484
29501
|
if (action.navigatesTo) {
|
|
29485
29502
|
const url = action.navigatesTo.replace(
|
|
29486
29503
|
/\{\{(\w+)\}\}/g,
|
|
29487
|
-
(_, key) => String(
|
|
29504
|
+
(_, key) => String(row[key] ?? item.id ?? "")
|
|
29488
29505
|
);
|
|
29489
|
-
eventBus.emit("UI:NAVIGATE", { url, row
|
|
29506
|
+
eventBus.emit("UI:NAVIGATE", { url, row });
|
|
29490
29507
|
return;
|
|
29491
29508
|
}
|
|
29492
29509
|
if (action.event) {
|
|
29493
|
-
eventBus.emit(`UI:${action.event}`, {
|
|
29494
|
-
row: item
|
|
29495
|
-
});
|
|
29510
|
+
eventBus.emit(`UI:${action.event}`, { row });
|
|
29496
29511
|
}
|
|
29497
29512
|
}
|
|
29498
29513
|
}));
|
|
@@ -29572,7 +29587,7 @@ var init_List = __esm({
|
|
|
29572
29587
|
);
|
|
29573
29588
|
const hasExplicitClick = !!(viewAction?.event || item.onClick);
|
|
29574
29589
|
const rowAction = viewAction?.event ?? "VIEW";
|
|
29575
|
-
const rowActionPayload = { row: item };
|
|
29590
|
+
const rowActionPayload = { row: entityFieldsFromListItem(item) };
|
|
29576
29591
|
const primaryField = effectiveFieldNames?.[0];
|
|
29577
29592
|
const statusField = effectiveFieldNames?.find(
|
|
29578
29593
|
(f3) => f3.toLowerCase().includes("status")
|
|
@@ -35727,16 +35742,19 @@ var init_Timeline = __esm({
|
|
|
35727
35742
|
] }),
|
|
35728
35743
|
item.description && /* @__PURE__ */ jsxRuntime.jsx(exports.Typography, { variant: "small", color: "secondary", children: item.description }),
|
|
35729
35744
|
item.tags && item.tags.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { gap: "xs", wrap: true, children: item.tags.map((tag, tagIdx) => /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: "default", children: tag }, tagIdx)) }),
|
|
35730
|
-
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { gap: "xs", className: "mt-1", children: itemActions.map((action, actionIdx) =>
|
|
35731
|
-
|
|
35732
|
-
|
|
35733
|
-
|
|
35734
|
-
|
|
35735
|
-
|
|
35736
|
-
|
|
35737
|
-
|
|
35738
|
-
|
|
35739
|
-
|
|
35745
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(exports.HStack, { gap: "xs", className: "mt-1", children: itemActions.map((action, actionIdx) => {
|
|
35746
|
+
const { icon: _icon, ...rowSafe } = item;
|
|
35747
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
35748
|
+
exports.Box,
|
|
35749
|
+
{
|
|
35750
|
+
action: action.event,
|
|
35751
|
+
actionPayload: { row: rowSafe },
|
|
35752
|
+
className: "cursor-pointer hover:opacity-80 transition-opacity",
|
|
35753
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: "default", children: action.label })
|
|
35754
|
+
},
|
|
35755
|
+
actionIdx
|
|
35756
|
+
);
|
|
35757
|
+
}) })
|
|
35740
35758
|
] })
|
|
35741
35759
|
] }, item.id);
|
|
35742
35760
|
}) })
|
package/dist/components/index.js
CHANGED
|
@@ -182,9 +182,6 @@ var init_useEventBus = __esm({
|
|
|
182
182
|
emit: (type, payload, source) => {
|
|
183
183
|
const event = {
|
|
184
184
|
type,
|
|
185
|
-
// Narrow at the bus boundary: public emit accepts an opaque object so
|
|
186
|
-
// generic UI emit sites don't require casts; the envelope stores the
|
|
187
|
-
// payload as EventPayload which listeners consume directly.
|
|
188
185
|
payload,
|
|
189
186
|
timestamp: Date.now(),
|
|
190
187
|
source
|
|
@@ -6356,38 +6353,16 @@ var init_MapView = __esm({
|
|
|
6356
6353
|
}
|
|
6357
6354
|
});
|
|
6358
6355
|
function ButtonPattern({
|
|
6359
|
-
|
|
6360
|
-
variant = "primary",
|
|
6361
|
-
size = "md",
|
|
6362
|
-
disabled = false,
|
|
6356
|
+
action,
|
|
6363
6357
|
onClick,
|
|
6364
6358
|
event,
|
|
6365
6359
|
icon,
|
|
6366
|
-
iconPosition
|
|
6367
|
-
|
|
6360
|
+
iconPosition,
|
|
6361
|
+
...rest
|
|
6368
6362
|
}) {
|
|
6369
|
-
const
|
|
6370
|
-
const
|
|
6371
|
-
|
|
6372
|
-
if (eventName && !disabled) {
|
|
6373
|
-
emit(`UI:${eventName}`, {});
|
|
6374
|
-
}
|
|
6375
|
-
};
|
|
6376
|
-
return /* @__PURE__ */ jsxs(
|
|
6377
|
-
Button,
|
|
6378
|
-
{
|
|
6379
|
-
variant,
|
|
6380
|
-
size,
|
|
6381
|
-
disabled,
|
|
6382
|
-
onClick: handleClick,
|
|
6383
|
-
className,
|
|
6384
|
-
children: [
|
|
6385
|
-
icon && iconPosition === "left" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" }),
|
|
6386
|
-
label,
|
|
6387
|
-
icon && iconPosition === "right" && /* @__PURE__ */ jsx(Icon, { name: icon, size: "sm" })
|
|
6388
|
-
]
|
|
6389
|
-
}
|
|
6390
|
-
);
|
|
6363
|
+
const resolvedAction = action ?? onClick ?? event;
|
|
6364
|
+
const iconProps = iconPosition === "right" ? { iconRight: icon } : { icon };
|
|
6365
|
+
return /* @__PURE__ */ jsx(Button, { ...rest, action: resolvedAction, ...iconProps });
|
|
6391
6366
|
}
|
|
6392
6367
|
function TextPattern({
|
|
6393
6368
|
content,
|
|
@@ -14406,7 +14381,11 @@ var init_CardGrid = __esm({
|
|
|
14406
14381
|
return;
|
|
14407
14382
|
}
|
|
14408
14383
|
if (action.event) {
|
|
14409
|
-
|
|
14384
|
+
const payload = {
|
|
14385
|
+
id: itemData.id,
|
|
14386
|
+
row: itemData
|
|
14387
|
+
};
|
|
14388
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
14410
14389
|
}
|
|
14411
14390
|
if (action.onClick) {
|
|
14412
14391
|
action.onClick(itemData);
|
|
@@ -17321,7 +17300,8 @@ var init_DataGrid = __esm({
|
|
|
17321
17300
|
if (next.has(id)) next.delete(id);
|
|
17322
17301
|
else next.add(id);
|
|
17323
17302
|
if (selectionEvent) {
|
|
17324
|
-
|
|
17303
|
+
const payload = { selectedIds: Array.from(next) };
|
|
17304
|
+
eventBus.emit(`UI:${selectionEvent}`, payload);
|
|
17325
17305
|
}
|
|
17326
17306
|
return next;
|
|
17327
17307
|
});
|
|
@@ -17332,7 +17312,8 @@ var init_DataGrid = __esm({
|
|
|
17332
17312
|
const allSelected2 = allIds2.length > 0 && allIds2.every((id) => prev.has(id));
|
|
17333
17313
|
const next = allSelected2 ? /* @__PURE__ */ new Set() : new Set(allIds2);
|
|
17334
17314
|
if (selectionEvent) {
|
|
17335
|
-
|
|
17315
|
+
const payload = { selectedIds: Array.from(next) };
|
|
17316
|
+
eventBus.emit(`UI:${selectionEvent}`, payload);
|
|
17336
17317
|
}
|
|
17337
17318
|
return next;
|
|
17338
17319
|
});
|
|
@@ -17344,7 +17325,11 @@ var init_DataGrid = __esm({
|
|
|
17344
17325
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
17345
17326
|
const handleActionClick = (action, itemData) => (e) => {
|
|
17346
17327
|
e.stopPropagation();
|
|
17347
|
-
|
|
17328
|
+
const payload = {
|
|
17329
|
+
id: itemData.id,
|
|
17330
|
+
row: itemData
|
|
17331
|
+
};
|
|
17332
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
17348
17333
|
};
|
|
17349
17334
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
17350
17335
|
const colsClass = cols ? {
|
|
@@ -17672,7 +17657,11 @@ var init_DataList = __esm({
|
|
|
17672
17657
|
);
|
|
17673
17658
|
const handleActionClick = (action, itemData) => (e) => {
|
|
17674
17659
|
e.stopPropagation();
|
|
17675
|
-
|
|
17660
|
+
const payload = {
|
|
17661
|
+
id: itemData.id,
|
|
17662
|
+
row: itemData
|
|
17663
|
+
};
|
|
17664
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
17676
17665
|
};
|
|
17677
17666
|
if (isLoading) {
|
|
17678
17667
|
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading..." }) });
|
|
@@ -26326,7 +26315,8 @@ var init_DetailPanel = __esm({
|
|
|
26326
26315
|
return;
|
|
26327
26316
|
}
|
|
26328
26317
|
if (action.event) {
|
|
26329
|
-
|
|
26318
|
+
const payload = data2 ? { id: data2.id, row: data2 } : {};
|
|
26319
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
26330
26320
|
}
|
|
26331
26321
|
if (action.onClick) {
|
|
26332
26322
|
action.onClick();
|
|
@@ -27863,9 +27853,10 @@ var init_Form = __esm({
|
|
|
27863
27853
|
};
|
|
27864
27854
|
const handleSubmit = (e) => {
|
|
27865
27855
|
e.preventDefault();
|
|
27866
|
-
|
|
27856
|
+
const payload = { data: formData };
|
|
27857
|
+
eventBus.emit(`UI:${submitEvent}`, payload);
|
|
27867
27858
|
if (onSubmit) {
|
|
27868
|
-
eventBus.emit(`UI:${onSubmit}`,
|
|
27859
|
+
eventBus.emit(`UI:${onSubmit}`, payload);
|
|
27869
27860
|
}
|
|
27870
27861
|
};
|
|
27871
27862
|
const handleCancel = () => {
|
|
@@ -29233,6 +29224,31 @@ function normalizeFields2(fields) {
|
|
|
29233
29224
|
if (!fields) return [];
|
|
29234
29225
|
return fields.map((f3) => typeof f3 === "string" ? f3 : f3.key ?? f3.name ?? "");
|
|
29235
29226
|
}
|
|
29227
|
+
function entityFieldsFromListItem(item) {
|
|
29228
|
+
const {
|
|
29229
|
+
icon: _icon,
|
|
29230
|
+
metadata: _metadata,
|
|
29231
|
+
onClick: _onClick,
|
|
29232
|
+
avatar: _avatar,
|
|
29233
|
+
_fields,
|
|
29234
|
+
...rest
|
|
29235
|
+
} = item;
|
|
29236
|
+
const result = {};
|
|
29237
|
+
for (const [key, value] of Object.entries(rest)) {
|
|
29238
|
+
if (typeof value === "function" || value !== null && typeof value === "object" && "$$typeof" in value) {
|
|
29239
|
+
continue;
|
|
29240
|
+
}
|
|
29241
|
+
result[key] = value;
|
|
29242
|
+
}
|
|
29243
|
+
if (_fields && typeof _fields === "object") {
|
|
29244
|
+
for (const [k, v] of Object.entries(_fields)) {
|
|
29245
|
+
if (typeof v !== "function") {
|
|
29246
|
+
result[k] = v;
|
|
29247
|
+
}
|
|
29248
|
+
}
|
|
29249
|
+
}
|
|
29250
|
+
return result;
|
|
29251
|
+
}
|
|
29236
29252
|
function getStatusStyle(fieldName, value) {
|
|
29237
29253
|
const val = String(value).toLowerCase();
|
|
29238
29254
|
if (val.includes("complete") || val.includes("done"))
|
|
@@ -29436,18 +29452,17 @@ var init_List = __esm({
|
|
|
29436
29452
|
label: action.label,
|
|
29437
29453
|
event: action.event,
|
|
29438
29454
|
onClick: () => {
|
|
29455
|
+
const row = entityFieldsFromListItem(item);
|
|
29439
29456
|
if (action.navigatesTo) {
|
|
29440
29457
|
const url = action.navigatesTo.replace(
|
|
29441
29458
|
/\{\{(\w+)\}\}/g,
|
|
29442
|
-
(_, key) => String(
|
|
29459
|
+
(_, key) => String(row[key] ?? item.id ?? "")
|
|
29443
29460
|
);
|
|
29444
|
-
eventBus.emit("UI:NAVIGATE", { url, row
|
|
29461
|
+
eventBus.emit("UI:NAVIGATE", { url, row });
|
|
29445
29462
|
return;
|
|
29446
29463
|
}
|
|
29447
29464
|
if (action.event) {
|
|
29448
|
-
eventBus.emit(`UI:${action.event}`, {
|
|
29449
|
-
row: item
|
|
29450
|
-
});
|
|
29465
|
+
eventBus.emit(`UI:${action.event}`, { row });
|
|
29451
29466
|
}
|
|
29452
29467
|
}
|
|
29453
29468
|
}));
|
|
@@ -29527,7 +29542,7 @@ var init_List = __esm({
|
|
|
29527
29542
|
);
|
|
29528
29543
|
const hasExplicitClick = !!(viewAction?.event || item.onClick);
|
|
29529
29544
|
const rowAction = viewAction?.event ?? "VIEW";
|
|
29530
|
-
const rowActionPayload = { row: item };
|
|
29545
|
+
const rowActionPayload = { row: entityFieldsFromListItem(item) };
|
|
29531
29546
|
const primaryField = effectiveFieldNames?.[0];
|
|
29532
29547
|
const statusField = effectiveFieldNames?.find(
|
|
29533
29548
|
(f3) => f3.toLowerCase().includes("status")
|
|
@@ -35682,16 +35697,19 @@ var init_Timeline = __esm({
|
|
|
35682
35697
|
] }),
|
|
35683
35698
|
item.description && /* @__PURE__ */ jsx(Typography, { variant: "small", color: "secondary", children: item.description }),
|
|
35684
35699
|
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)) }),
|
|
35685
|
-
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "mt-1", children: itemActions.map((action, actionIdx) =>
|
|
35686
|
-
|
|
35687
|
-
|
|
35688
|
-
|
|
35689
|
-
|
|
35690
|
-
|
|
35691
|
-
|
|
35692
|
-
|
|
35693
|
-
|
|
35694
|
-
|
|
35700
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "mt-1", children: itemActions.map((action, actionIdx) => {
|
|
35701
|
+
const { icon: _icon, ...rowSafe } = item;
|
|
35702
|
+
return /* @__PURE__ */ jsx(
|
|
35703
|
+
Box,
|
|
35704
|
+
{
|
|
35705
|
+
action: action.event,
|
|
35706
|
+
actionPayload: { row: rowSafe },
|
|
35707
|
+
className: "cursor-pointer hover:opacity-80 transition-opacity",
|
|
35708
|
+
children: /* @__PURE__ */ jsx(Badge, { variant: "default", children: action.label })
|
|
35709
|
+
},
|
|
35710
|
+
actionIdx
|
|
35711
|
+
);
|
|
35712
|
+
}) })
|
|
35695
35713
|
] })
|
|
35696
35714
|
] }, item.id);
|
|
35697
35715
|
}) })
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Uses theme-aware CSS variables for styling.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import type { EventKey } from "@almadar/core";
|
|
8
9
|
export type AlertVariant = "info" | "success" | "warning" | "error";
|
|
9
10
|
export interface AlertProps {
|
|
10
11
|
/** Alert content (children or message) */
|
|
@@ -19,6 +20,6 @@ export interface AlertProps {
|
|
|
19
20
|
actions?: React.ReactNode;
|
|
20
21
|
className?: string;
|
|
21
22
|
/** Declarative dismiss event — emits UI:{dismissEvent} via eventBus when alert is dismissed */
|
|
22
|
-
dismissEvent?:
|
|
23
|
+
dismissEvent?: EventKey;
|
|
23
24
|
}
|
|
24
25
|
export declare const Alert: React.FC<AlertProps>;
|
|
@@ -6,6 +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
10
|
export interface CalendarEvent {
|
|
10
11
|
id: string;
|
|
11
12
|
title: string;
|
|
@@ -31,7 +32,7 @@ export interface CalendarGridProps {
|
|
|
31
32
|
/** Event emitted on long-press of a time slot: UI:{longPressEvent} with { date, time } */
|
|
32
33
|
longPressEvent?: string;
|
|
33
34
|
/** Additional payload for long-press events */
|
|
34
|
-
longPressPayload?:
|
|
35
|
+
longPressPayload?: EventPayload;
|
|
35
36
|
/** Event emitted on swipe left (next week): UI:{swipeLeftEvent} */
|
|
36
37
|
swipeLeftEvent?: string;
|
|
37
38
|
/** Event emitted on swipe right (prev week): UI:{swipeRightEvent} */
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @generated by Orbital Compiler
|
|
8
8
|
*/
|
|
9
9
|
import React from "react";
|
|
10
|
-
import type { EventKey } from "@almadar/core";
|
|
10
|
+
import type { EventKey, EventPayload } from "@almadar/core";
|
|
11
11
|
export interface CardAction {
|
|
12
12
|
label: string;
|
|
13
13
|
onClick?: () => void;
|
|
@@ -45,7 +45,7 @@ export interface CardProps {
|
|
|
45
45
|
/** Event emitted on long press: UI:{longPressEvent} */
|
|
46
46
|
longPressEvent?: string;
|
|
47
47
|
/** Additional payload for long-press events */
|
|
48
|
-
longPressPayload?:
|
|
48
|
+
longPressPayload?: EventPayload;
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Card component for displaying content in a contained box
|
|
@@ -61,11 +61,11 @@ export interface DataGridProps {
|
|
|
61
61
|
/** Enable multi-select with checkboxes */
|
|
62
62
|
selectable?: boolean;
|
|
63
63
|
/** Selection change event name (emits UI:{selectionEvent} with { selectedIds: string[] }) */
|
|
64
|
-
selectionEvent?:
|
|
64
|
+
selectionEvent?: EventKey;
|
|
65
65
|
/** Enable infinite scroll loading */
|
|
66
66
|
infiniteScroll?: boolean;
|
|
67
67
|
/** Event emitted when more items needed: UI:{loadMoreEvent} */
|
|
68
|
-
loadMoreEvent?:
|
|
68
|
+
loadMoreEvent?: EventKey;
|
|
69
69
|
/** Whether more items are available for infinite scroll */
|
|
70
70
|
hasMore?: boolean;
|
|
71
71
|
/** Render prop for custom per-item content. When provided, `fields` and `itemActions` are ignored. */
|
|
@@ -63,9 +63,9 @@ export interface DataListProps {
|
|
|
63
63
|
/** Enable drag-to-reorder with grip handles */
|
|
64
64
|
reorderable?: boolean;
|
|
65
65
|
/** Event emitted on reorder: UI:{reorderEvent} with { fromIndex, toIndex } */
|
|
66
|
-
reorderEvent?:
|
|
66
|
+
reorderEvent?: EventKey;
|
|
67
67
|
/** Event emitted on left swipe: UI:{swipeLeftEvent} with { row } */
|
|
68
|
-
swipeLeftEvent?:
|
|
68
|
+
swipeLeftEvent?: EventKey;
|
|
69
69
|
/** Actions revealed on left swipe */
|
|
70
70
|
swipeLeftActions?: readonly {
|
|
71
71
|
label: string;
|
|
@@ -73,7 +73,7 @@ export interface DataListProps {
|
|
|
73
73
|
variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
|
|
74
74
|
}[];
|
|
75
75
|
/** Event emitted on right swipe: UI:{swipeRightEvent} with { row } */
|
|
76
|
-
swipeRightEvent?:
|
|
76
|
+
swipeRightEvent?: EventKey;
|
|
77
77
|
/** Actions revealed on right swipe */
|
|
78
78
|
swipeRightActions?: readonly {
|
|
79
79
|
label: string;
|
|
@@ -81,11 +81,11 @@ export interface DataListProps {
|
|
|
81
81
|
variant?: 'primary' | 'secondary' | 'danger' | 'ghost';
|
|
82
82
|
}[];
|
|
83
83
|
/** Event emitted on long press: UI:{longPressEvent} with { row } */
|
|
84
|
-
longPressEvent?:
|
|
84
|
+
longPressEvent?: EventKey;
|
|
85
85
|
/** Enable infinite scroll loading */
|
|
86
86
|
infiniteScroll?: boolean;
|
|
87
87
|
/** Event emitted when more items needed: UI:{loadMoreEvent} */
|
|
88
|
-
loadMoreEvent?:
|
|
88
|
+
loadMoreEvent?: EventKey;
|
|
89
89
|
/** Whether more items are available for infinite scroll */
|
|
90
90
|
hasMore?: boolean;
|
|
91
91
|
/** Render prop for custom per-item content. When provided, `fields` and `itemActions` are ignored. */
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* @packageDocumentation
|
|
16
16
|
*/
|
|
17
17
|
import React from "react";
|
|
18
|
+
import type { EventKey } from "@almadar/core";
|
|
18
19
|
export type DrawerPosition = "left" | "right";
|
|
19
20
|
export type DrawerSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
20
21
|
export interface DrawerProps {
|
|
@@ -41,6 +42,6 @@ export interface DrawerProps {
|
|
|
41
42
|
/** Additional class name */
|
|
42
43
|
className?: string;
|
|
43
44
|
/** Declarative close event — emits UI:{closeEvent} via eventBus when drawer should close */
|
|
44
|
-
closeEvent?:
|
|
45
|
+
closeEvent?: EventKey;
|
|
45
46
|
}
|
|
46
47
|
export declare const Drawer: React.FC<DrawerProps>;
|
|
@@ -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 NumberStepperSize = "sm" | "md" | "lg";
|
|
4
4
|
export interface NumberStepperProps {
|
|
5
5
|
/** Current value */
|
|
@@ -19,7 +19,7 @@ export interface NumberStepperProps {
|
|
|
19
19
|
/** Declarative event name for value changes */
|
|
20
20
|
action?: EventKey;
|
|
21
21
|
/** Payload to include with the action event */
|
|
22
|
-
actionPayload?:
|
|
22
|
+
actionPayload?: EventPayload;
|
|
23
23
|
/** Additional CSS classes */
|
|
24
24
|
className?: string;
|
|
25
25
|
/** Accessible label */
|
|
@@ -6,11 +6,12 @@
|
|
|
6
6
|
* a refresh event via the event bus when the threshold is met.
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import type { EventKey, EventPayload } from "@almadar/core";
|
|
9
10
|
export interface PullToRefreshProps {
|
|
10
11
|
/** Event name to emit on refresh (emitted as UI:{refreshEvent}) */
|
|
11
|
-
refreshEvent:
|
|
12
|
+
refreshEvent: EventKey;
|
|
12
13
|
/** Payload to include with the refresh event */
|
|
13
|
-
refreshPayload?:
|
|
14
|
+
refreshPayload?: EventPayload;
|
|
14
15
|
/** Pull distance threshold to trigger refresh in px (default: 60) */
|
|
15
16
|
threshold?: number;
|
|
16
17
|
/** Content to wrap */
|
|
@@ -6,12 +6,13 @@
|
|
|
6
6
|
* Shows a drop indicator line at the target position during drag.
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
-
|
|
9
|
+
import type { EventKey, EventPayload, EventPayloadValue } from "@almadar/core";
|
|
10
|
+
export interface SortableListProps<T extends EventPayloadValue = EventPayload> {
|
|
10
11
|
items: T[];
|
|
11
12
|
renderItem: (item: T, index: number) => React.ReactNode;
|
|
12
|
-
reorderEvent:
|
|
13
|
-
reorderPayload?:
|
|
13
|
+
reorderEvent: EventKey;
|
|
14
|
+
reorderPayload?: EventPayload;
|
|
14
15
|
dragHandlePosition?: 'left' | 'right';
|
|
15
16
|
className?: string;
|
|
16
17
|
}
|
|
17
|
-
export declare const SortableList: <T =
|
|
18
|
+
export declare const SortableList: <T extends EventPayloadValue = EventPayload>(props: SortableListProps<T>) => React.ReactElement;
|
|
@@ -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 StarRatingSize = "sm" | "md" | "lg";
|
|
4
4
|
export type StarRatingPrecision = "full" | "half";
|
|
5
5
|
export interface StarRatingProps {
|
|
@@ -16,7 +16,7 @@ export interface StarRatingProps {
|
|
|
16
16
|
/** Declarative event name for rating changes */
|
|
17
17
|
action?: EventKey;
|
|
18
18
|
/** Payload to include with the action event */
|
|
19
|
-
actionPayload?:
|
|
19
|
+
actionPayload?: EventPayload;
|
|
20
20
|
/** Direct onChange callback */
|
|
21
21
|
onChange?: (value: number) => void;
|
|
22
22
|
/** Additional CSS classes */
|