@almadar/ui 4.21.0 → 4.22.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 +17 -13
- package/dist/avl/index.js +17 -13
- package/dist/components/index.cjs +17 -13
- package/dist/components/index.js +17 -13
- package/dist/components/molecules/Accordion.d.ts +5 -1
- package/dist/components/molecules/CalendarGrid.d.ts +8 -5
- package/dist/components/molecules/Card.d.ts +3 -3
- package/dist/components/molecules/Carousel.d.ts +4 -1
- package/dist/components/molecules/DataGrid.d.ts +9 -3
- package/dist/components/molecules/DataList.d.ts +9 -3
- package/dist/components/molecules/EmptyState.d.ts +2 -1
- package/dist/components/molecules/ErrorState.d.ts +2 -1
- package/dist/components/molecules/MapView.d.ts +7 -3
- package/dist/components/molecules/Modal.d.ts +2 -1
- package/dist/components/molecules/Pagination.d.ts +7 -2
- package/dist/components/molecules/SidePanel.d.ts +2 -1
- package/dist/components/molecules/Tabs.d.ts +4 -1
- package/dist/components/molecules/Toast.d.ts +3 -2
- package/dist/components/molecules/WizardProgress.d.ts +4 -1
- package/dist/components/molecules/game/ActionButtons.d.ts +5 -1
- package/dist/components/molecules/game/CraftingRecipe.d.ts +4 -1
- package/dist/components/molecules/game/DPad.d.ts +5 -1
- package/dist/components/molecules/game/DialogueBox.d.ts +7 -5
- package/dist/components/molecules/game/InventoryGrid.d.ts +4 -1
- package/dist/components/molecules/game/InventoryPanel.d.ts +12 -6
- package/dist/components/molecules/game/IsometricCanvas.d.ts +13 -4
- package/dist/components/molecules/game/PlatformerCanvas.d.ts +9 -4
- package/dist/components/organisms/GraphCanvas.d.ts +4 -2
- package/dist/components/organisms/MediaGallery.d.ts +4 -1
- package/dist/components/organisms/PageHeader.d.ts +2 -1
- package/dist/components/organisms/Sidebar.d.ts +6 -3
- package/dist/components/organisms/SignaturePad.d.ts +5 -2
- package/dist/components/organisms/game/BattleBoard.d.ts +20 -8
- package/dist/components/organisms/game/CanvasEffect.d.ts +2 -1
- package/dist/components/organisms/game/CastleBoard.d.ts +14 -3
- package/dist/components/organisms/game/GameCanvas3D.d.ts +52 -8
- package/dist/components/organisms/game/TraitSlot.d.ts +7 -2
- package/dist/components/organisms/game/WorldMapBoard.d.ts +22 -5
- package/dist/components/organisms/game/hooks/useBattleState.d.ts +19 -7
- package/dist/components/organisms/game/puzzles/builder/BuilderBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/classifier/ClassifierBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/debugger/DebuggerBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/event-handler/EventHandlerBoard.d.ts +5 -2
- package/dist/components/organisms/game/puzzles/negotiator/NegotiatorBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/sequencer/SequencerBoard.d.ts +8 -2
- package/dist/components/organisms/game/puzzles/simulator/SimulatorBoard.d.ts +5 -1
- package/dist/components/organisms/game/puzzles/state-architect/StateArchitectBoard.d.ts +6 -2
- package/dist/components/organisms/game/three/hooks/useGameCanvas3DEvents.d.ts +52 -8
- package/dist/providers/index.cjs +17 -13
- package/dist/providers/index.js +17 -13
- package/dist/runtime/index.cjs +17 -13
- package/dist/runtime/index.js +17 -13
- package/package.json +2 -2
package/dist/avl/index.cjs
CHANGED
|
@@ -21941,6 +21941,7 @@ function formatValue(value, format) {
|
|
|
21941
21941
|
function DataGrid({
|
|
21942
21942
|
entity,
|
|
21943
21943
|
fields,
|
|
21944
|
+
columns,
|
|
21944
21945
|
itemActions,
|
|
21945
21946
|
cols,
|
|
21946
21947
|
gap = "md",
|
|
@@ -21962,6 +21963,7 @@ function DataGrid({
|
|
|
21962
21963
|
const { t } = useTranslate();
|
|
21963
21964
|
const [selectedIds, setSelectedIds] = React127.useState(/* @__PURE__ */ new Set());
|
|
21964
21965
|
const [visibleCount, setVisibleCount] = React127.useState(pageSize || Infinity);
|
|
21966
|
+
const fieldDefs = fields ?? columns ?? [];
|
|
21965
21967
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
21966
21968
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
21967
21969
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -21989,9 +21991,9 @@ function DataGrid({
|
|
|
21989
21991
|
return next;
|
|
21990
21992
|
});
|
|
21991
21993
|
}, [data, selectionEvent, eventBus]);
|
|
21992
|
-
const titleField =
|
|
21993
|
-
const badgeFields =
|
|
21994
|
-
const bodyFields =
|
|
21994
|
+
const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
|
|
21995
|
+
const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
21996
|
+
const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
|
|
21995
21997
|
const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
|
|
21996
21998
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
21997
21999
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -22004,7 +22006,7 @@ function DataGrid({
|
|
|
22004
22006
|
};
|
|
22005
22007
|
const hasRenderProp = typeof children === "function";
|
|
22006
22008
|
React127.useEffect(() => {
|
|
22007
|
-
if (data.length > 0 && !hasRenderProp &&
|
|
22009
|
+
if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
|
|
22008
22010
|
const renderItemRaw = schemaRenderItem;
|
|
22009
22011
|
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
22010
22012
|
dataGridLog.warn("renderItem-unresolved", {
|
|
@@ -22012,7 +22014,7 @@ function DataGrid({
|
|
|
22012
22014
|
renderItemIsFnLambda: isFnLambda
|
|
22013
22015
|
});
|
|
22014
22016
|
}
|
|
22015
|
-
}, [data, hasRenderProp, schemaRenderItem,
|
|
22017
|
+
}, [data, hasRenderProp, schemaRenderItem, fieldDefs]);
|
|
22016
22018
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
22017
22019
|
const colsClass = cols ? {
|
|
22018
22020
|
1: "grid-cols-1",
|
|
@@ -22317,6 +22319,7 @@ function groupData(items, field) {
|
|
|
22317
22319
|
function DataList({
|
|
22318
22320
|
entity,
|
|
22319
22321
|
fields,
|
|
22322
|
+
columns,
|
|
22320
22323
|
itemActions,
|
|
22321
22324
|
gap = "none",
|
|
22322
22325
|
variant = "default",
|
|
@@ -22346,6 +22349,7 @@ function DataList({
|
|
|
22346
22349
|
const eventBus = useEventBus();
|
|
22347
22350
|
const { t } = useTranslate();
|
|
22348
22351
|
const [visibleCount, setVisibleCount] = React127__namespace.default.useState(pageSize || Infinity);
|
|
22352
|
+
const fieldDefs = fields ?? columns ?? [];
|
|
22349
22353
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
22350
22354
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
22351
22355
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -22360,7 +22364,7 @@ function DataList({
|
|
|
22360
22364
|
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
22361
22365
|
dataListLog.warn("renderItem-unresolved", {
|
|
22362
22366
|
rowCount: data.length,
|
|
22363
|
-
fieldsCount:
|
|
22367
|
+
fieldsCount: fieldDefs.length,
|
|
22364
22368
|
renderItemTypeOf,
|
|
22365
22369
|
renderItemIsArray: Array.isArray(renderItemRaw),
|
|
22366
22370
|
renderItemIsFnLambda: isFnLambda,
|
|
@@ -22369,11 +22373,11 @@ function DataList({
|
|
|
22369
22373
|
sampleRowKeys: sampleKeys
|
|
22370
22374
|
});
|
|
22371
22375
|
}
|
|
22372
|
-
}, [data, hasRenderProp, schemaRenderItem, children,
|
|
22373
|
-
const titleField =
|
|
22374
|
-
const badgeFields =
|
|
22375
|
-
const progressFields =
|
|
22376
|
-
const bodyFields =
|
|
22376
|
+
}, [data, hasRenderProp, schemaRenderItem, children, fieldDefs]);
|
|
22377
|
+
const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
|
|
22378
|
+
const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
22379
|
+
const progressFields = fieldDefs.filter((f3) => f3.variant === "progress");
|
|
22380
|
+
const bodyFields = fieldDefs.filter(
|
|
22377
22381
|
(f3) => f3 !== titleField && !badgeFields.includes(f3) && !progressFields.includes(f3)
|
|
22378
22382
|
);
|
|
22379
22383
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -22405,7 +22409,7 @@ function DataList({
|
|
|
22405
22409
|
if (isMessage) {
|
|
22406
22410
|
const items2 = data.map((item) => item);
|
|
22407
22411
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
22408
|
-
const contentField = titleField?.name ??
|
|
22412
|
+
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
22409
22413
|
return /* @__PURE__ */ jsxRuntime.jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxRuntime.jsxs(React127__namespace.default.Fragment, { children: [
|
|
22410
22414
|
group.label && /* @__PURE__ */ jsxRuntime.jsx(Divider, { label: group.label, className: "my-2" }),
|
|
22411
22415
|
group.items.map((itemData, index) => {
|
|
@@ -22413,7 +22417,7 @@ function DataList({
|
|
|
22413
22417
|
const sender = senderField ? String(getNestedValue(itemData, senderField) ?? "") : "";
|
|
22414
22418
|
const isSent = Boolean(currentUser && sender === currentUser);
|
|
22415
22419
|
const content = getNestedValue(itemData, contentField);
|
|
22416
|
-
const timestampField =
|
|
22420
|
+
const timestampField = fieldDefs.find((f3) => f3.format === "date");
|
|
22417
22421
|
const timestamp = timestampField ? getNestedValue(itemData, timestampField.name) : null;
|
|
22418
22422
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
22419
22423
|
Box,
|
package/dist/avl/index.js
CHANGED
|
@@ -21895,6 +21895,7 @@ function formatValue(value, format) {
|
|
|
21895
21895
|
function DataGrid({
|
|
21896
21896
|
entity,
|
|
21897
21897
|
fields,
|
|
21898
|
+
columns,
|
|
21898
21899
|
itemActions,
|
|
21899
21900
|
cols,
|
|
21900
21901
|
gap = "md",
|
|
@@ -21916,6 +21917,7 @@ function DataGrid({
|
|
|
21916
21917
|
const { t } = useTranslate();
|
|
21917
21918
|
const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
|
|
21918
21919
|
const [visibleCount, setVisibleCount] = useState(pageSize || Infinity);
|
|
21920
|
+
const fieldDefs = fields ?? columns ?? [];
|
|
21919
21921
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
21920
21922
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
21921
21923
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -21943,9 +21945,9 @@ function DataGrid({
|
|
|
21943
21945
|
return next;
|
|
21944
21946
|
});
|
|
21945
21947
|
}, [data, selectionEvent, eventBus]);
|
|
21946
|
-
const titleField =
|
|
21947
|
-
const badgeFields =
|
|
21948
|
-
const bodyFields =
|
|
21948
|
+
const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
|
|
21949
|
+
const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
21950
|
+
const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
|
|
21949
21951
|
const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
|
|
21950
21952
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
21951
21953
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -21958,7 +21960,7 @@ function DataGrid({
|
|
|
21958
21960
|
};
|
|
21959
21961
|
const hasRenderProp = typeof children === "function";
|
|
21960
21962
|
useEffect(() => {
|
|
21961
|
-
if (data.length > 0 && !hasRenderProp &&
|
|
21963
|
+
if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
|
|
21962
21964
|
const renderItemRaw = schemaRenderItem;
|
|
21963
21965
|
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
21964
21966
|
dataGridLog.warn("renderItem-unresolved", {
|
|
@@ -21966,7 +21968,7 @@ function DataGrid({
|
|
|
21966
21968
|
renderItemIsFnLambda: isFnLambda
|
|
21967
21969
|
});
|
|
21968
21970
|
}
|
|
21969
|
-
}, [data, hasRenderProp, schemaRenderItem,
|
|
21971
|
+
}, [data, hasRenderProp, schemaRenderItem, fieldDefs]);
|
|
21970
21972
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
21971
21973
|
const colsClass = cols ? {
|
|
21972
21974
|
1: "grid-cols-1",
|
|
@@ -22271,6 +22273,7 @@ function groupData(items, field) {
|
|
|
22271
22273
|
function DataList({
|
|
22272
22274
|
entity,
|
|
22273
22275
|
fields,
|
|
22276
|
+
columns,
|
|
22274
22277
|
itemActions,
|
|
22275
22278
|
gap = "none",
|
|
22276
22279
|
variant = "default",
|
|
@@ -22300,6 +22303,7 @@ function DataList({
|
|
|
22300
22303
|
const eventBus = useEventBus();
|
|
22301
22304
|
const { t } = useTranslate();
|
|
22302
22305
|
const [visibleCount, setVisibleCount] = React127__default.useState(pageSize || Infinity);
|
|
22306
|
+
const fieldDefs = fields ?? columns ?? [];
|
|
22303
22307
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
22304
22308
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
22305
22309
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -22314,7 +22318,7 @@ function DataList({
|
|
|
22314
22318
|
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
22315
22319
|
dataListLog.warn("renderItem-unresolved", {
|
|
22316
22320
|
rowCount: data.length,
|
|
22317
|
-
fieldsCount:
|
|
22321
|
+
fieldsCount: fieldDefs.length,
|
|
22318
22322
|
renderItemTypeOf,
|
|
22319
22323
|
renderItemIsArray: Array.isArray(renderItemRaw),
|
|
22320
22324
|
renderItemIsFnLambda: isFnLambda,
|
|
@@ -22323,11 +22327,11 @@ function DataList({
|
|
|
22323
22327
|
sampleRowKeys: sampleKeys
|
|
22324
22328
|
});
|
|
22325
22329
|
}
|
|
22326
|
-
}, [data, hasRenderProp, schemaRenderItem, children,
|
|
22327
|
-
const titleField =
|
|
22328
|
-
const badgeFields =
|
|
22329
|
-
const progressFields =
|
|
22330
|
-
const bodyFields =
|
|
22330
|
+
}, [data, hasRenderProp, schemaRenderItem, children, fieldDefs]);
|
|
22331
|
+
const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
|
|
22332
|
+
const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
22333
|
+
const progressFields = fieldDefs.filter((f3) => f3.variant === "progress");
|
|
22334
|
+
const bodyFields = fieldDefs.filter(
|
|
22331
22335
|
(f3) => f3 !== titleField && !badgeFields.includes(f3) && !progressFields.includes(f3)
|
|
22332
22336
|
);
|
|
22333
22337
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -22359,7 +22363,7 @@ function DataList({
|
|
|
22359
22363
|
if (isMessage) {
|
|
22360
22364
|
const items2 = data.map((item) => item);
|
|
22361
22365
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
22362
|
-
const contentField = titleField?.name ??
|
|
22366
|
+
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
22363
22367
|
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React127__default.Fragment, { children: [
|
|
22364
22368
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
22365
22369
|
group.items.map((itemData, index) => {
|
|
@@ -22367,7 +22371,7 @@ function DataList({
|
|
|
22367
22371
|
const sender = senderField ? String(getNestedValue(itemData, senderField) ?? "") : "";
|
|
22368
22372
|
const isSent = Boolean(currentUser && sender === currentUser);
|
|
22369
22373
|
const content = getNestedValue(itemData, contentField);
|
|
22370
|
-
const timestampField =
|
|
22374
|
+
const timestampField = fieldDefs.find((f3) => f3.format === "date");
|
|
22371
22375
|
const timestamp = timestampField ? getNestedValue(itemData, timestampField.name) : null;
|
|
22372
22376
|
return /* @__PURE__ */ jsx(
|
|
22373
22377
|
Box,
|
|
@@ -17369,6 +17369,7 @@ function formatValue(value, format) {
|
|
|
17369
17369
|
function DataGrid({
|
|
17370
17370
|
entity,
|
|
17371
17371
|
fields,
|
|
17372
|
+
columns,
|
|
17372
17373
|
itemActions,
|
|
17373
17374
|
cols,
|
|
17374
17375
|
gap = "md",
|
|
@@ -17390,6 +17391,7 @@ function DataGrid({
|
|
|
17390
17391
|
const { t } = useTranslate();
|
|
17391
17392
|
const [selectedIds, setSelectedIds] = React110.useState(/* @__PURE__ */ new Set());
|
|
17392
17393
|
const [visibleCount, setVisibleCount] = React110.useState(pageSize || Infinity);
|
|
17394
|
+
const fieldDefs = fields ?? columns ?? [];
|
|
17393
17395
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
17394
17396
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
17395
17397
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -17417,9 +17419,9 @@ function DataGrid({
|
|
|
17417
17419
|
return next;
|
|
17418
17420
|
});
|
|
17419
17421
|
}, [data, selectionEvent, eventBus]);
|
|
17420
|
-
const titleField =
|
|
17421
|
-
const badgeFields =
|
|
17422
|
-
const bodyFields =
|
|
17422
|
+
const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
|
|
17423
|
+
const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
17424
|
+
const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
|
|
17423
17425
|
const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
|
|
17424
17426
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
17425
17427
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -17432,7 +17434,7 @@ function DataGrid({
|
|
|
17432
17434
|
};
|
|
17433
17435
|
const hasRenderProp = typeof children === "function";
|
|
17434
17436
|
React110.useEffect(() => {
|
|
17435
|
-
if (data.length > 0 && !hasRenderProp &&
|
|
17437
|
+
if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
|
|
17436
17438
|
const renderItemRaw = schemaRenderItem;
|
|
17437
17439
|
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
17438
17440
|
dataGridLog.warn("renderItem-unresolved", {
|
|
@@ -17440,7 +17442,7 @@ function DataGrid({
|
|
|
17440
17442
|
renderItemIsFnLambda: isFnLambda
|
|
17441
17443
|
});
|
|
17442
17444
|
}
|
|
17443
|
-
}, [data, hasRenderProp, schemaRenderItem,
|
|
17445
|
+
}, [data, hasRenderProp, schemaRenderItem, fieldDefs]);
|
|
17444
17446
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
17445
17447
|
const colsClass = cols ? {
|
|
17446
17448
|
1: "grid-cols-1",
|
|
@@ -17745,6 +17747,7 @@ function groupData(items, field) {
|
|
|
17745
17747
|
function DataList({
|
|
17746
17748
|
entity,
|
|
17747
17749
|
fields,
|
|
17750
|
+
columns,
|
|
17748
17751
|
itemActions,
|
|
17749
17752
|
gap = "none",
|
|
17750
17753
|
variant = "default",
|
|
@@ -17774,6 +17777,7 @@ function DataList({
|
|
|
17774
17777
|
const eventBus = useEventBus();
|
|
17775
17778
|
const { t } = useTranslate();
|
|
17776
17779
|
const [visibleCount, setVisibleCount] = React110__namespace.default.useState(pageSize || Infinity);
|
|
17780
|
+
const fieldDefs = fields ?? columns ?? [];
|
|
17777
17781
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
17778
17782
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
17779
17783
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -17788,7 +17792,7 @@ function DataList({
|
|
|
17788
17792
|
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
17789
17793
|
dataListLog.warn("renderItem-unresolved", {
|
|
17790
17794
|
rowCount: data.length,
|
|
17791
|
-
fieldsCount:
|
|
17795
|
+
fieldsCount: fieldDefs.length,
|
|
17792
17796
|
renderItemTypeOf,
|
|
17793
17797
|
renderItemIsArray: Array.isArray(renderItemRaw),
|
|
17794
17798
|
renderItemIsFnLambda: isFnLambda,
|
|
@@ -17797,11 +17801,11 @@ function DataList({
|
|
|
17797
17801
|
sampleRowKeys: sampleKeys
|
|
17798
17802
|
});
|
|
17799
17803
|
}
|
|
17800
|
-
}, [data, hasRenderProp, schemaRenderItem, children,
|
|
17801
|
-
const titleField =
|
|
17802
|
-
const badgeFields =
|
|
17803
|
-
const progressFields =
|
|
17804
|
-
const bodyFields =
|
|
17804
|
+
}, [data, hasRenderProp, schemaRenderItem, children, fieldDefs]);
|
|
17805
|
+
const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
|
|
17806
|
+
const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
17807
|
+
const progressFields = fieldDefs.filter((f3) => f3.variant === "progress");
|
|
17808
|
+
const bodyFields = fieldDefs.filter(
|
|
17805
17809
|
(f3) => f3 !== titleField && !badgeFields.includes(f3) && !progressFields.includes(f3)
|
|
17806
17810
|
);
|
|
17807
17811
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -17833,7 +17837,7 @@ function DataList({
|
|
|
17833
17837
|
if (isMessage) {
|
|
17834
17838
|
const items2 = data.map((item) => item);
|
|
17835
17839
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
17836
|
-
const contentField = titleField?.name ??
|
|
17840
|
+
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
17837
17841
|
return /* @__PURE__ */ jsxRuntime.jsx(exports.VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxRuntime.jsxs(React110__namespace.default.Fragment, { children: [
|
|
17838
17842
|
group.label && /* @__PURE__ */ jsxRuntime.jsx(exports.Divider, { label: group.label, className: "my-2" }),
|
|
17839
17843
|
group.items.map((itemData, index) => {
|
|
@@ -17841,7 +17845,7 @@ function DataList({
|
|
|
17841
17845
|
const sender = senderField ? String(getNestedValue(itemData, senderField) ?? "") : "";
|
|
17842
17846
|
const isSent = Boolean(currentUser && sender === currentUser);
|
|
17843
17847
|
const content = getNestedValue(itemData, contentField);
|
|
17844
|
-
const timestampField =
|
|
17848
|
+
const timestampField = fieldDefs.find((f3) => f3.format === "date");
|
|
17845
17849
|
const timestamp = timestampField ? getNestedValue(itemData, timestampField.name) : null;
|
|
17846
17850
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
17847
17851
|
exports.Box,
|
package/dist/components/index.js
CHANGED
|
@@ -17324,6 +17324,7 @@ function formatValue(value, format) {
|
|
|
17324
17324
|
function DataGrid({
|
|
17325
17325
|
entity,
|
|
17326
17326
|
fields,
|
|
17327
|
+
columns,
|
|
17327
17328
|
itemActions,
|
|
17328
17329
|
cols,
|
|
17329
17330
|
gap = "md",
|
|
@@ -17345,6 +17346,7 @@ function DataGrid({
|
|
|
17345
17346
|
const { t } = useTranslate();
|
|
17346
17347
|
const [selectedIds, setSelectedIds] = useState(/* @__PURE__ */ new Set());
|
|
17347
17348
|
const [visibleCount, setVisibleCount] = useState(pageSize || Infinity);
|
|
17349
|
+
const fieldDefs = fields ?? columns ?? [];
|
|
17348
17350
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
17349
17351
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
17350
17352
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -17372,9 +17374,9 @@ function DataGrid({
|
|
|
17372
17374
|
return next;
|
|
17373
17375
|
});
|
|
17374
17376
|
}, [data, selectionEvent, eventBus]);
|
|
17375
|
-
const titleField =
|
|
17376
|
-
const badgeFields =
|
|
17377
|
-
const bodyFields =
|
|
17377
|
+
const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
|
|
17378
|
+
const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
17379
|
+
const bodyFields = fieldDefs.filter((f3) => f3 !== titleField && !badgeFields.includes(f3));
|
|
17378
17380
|
const primaryActions = itemActions?.filter((a) => a.variant !== "danger") ?? [];
|
|
17379
17381
|
const dangerActions = itemActions?.filter((a) => a.variant === "danger") ?? [];
|
|
17380
17382
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -17387,7 +17389,7 @@ function DataGrid({
|
|
|
17387
17389
|
};
|
|
17388
17390
|
const hasRenderProp = typeof children === "function";
|
|
17389
17391
|
useEffect(() => {
|
|
17390
|
-
if (data.length > 0 && !hasRenderProp &&
|
|
17392
|
+
if (data.length > 0 && !hasRenderProp && fieldDefs.length === 0) {
|
|
17391
17393
|
const renderItemRaw = schemaRenderItem;
|
|
17392
17394
|
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
17393
17395
|
dataGridLog.warn("renderItem-unresolved", {
|
|
@@ -17395,7 +17397,7 @@ function DataGrid({
|
|
|
17395
17397
|
renderItemIsFnLambda: isFnLambda
|
|
17396
17398
|
});
|
|
17397
17399
|
}
|
|
17398
|
-
}, [data, hasRenderProp, schemaRenderItem,
|
|
17400
|
+
}, [data, hasRenderProp, schemaRenderItem, fieldDefs]);
|
|
17399
17401
|
const gridTemplateColumns = cols ? void 0 : `repeat(auto-fit, minmax(min(${minCardWidth}px, 100%), 1fr))`;
|
|
17400
17402
|
const colsClass = cols ? {
|
|
17401
17403
|
1: "grid-cols-1",
|
|
@@ -17700,6 +17702,7 @@ function groupData(items, field) {
|
|
|
17700
17702
|
function DataList({
|
|
17701
17703
|
entity,
|
|
17702
17704
|
fields,
|
|
17705
|
+
columns,
|
|
17703
17706
|
itemActions,
|
|
17704
17707
|
gap = "none",
|
|
17705
17708
|
variant = "default",
|
|
@@ -17729,6 +17732,7 @@ function DataList({
|
|
|
17729
17732
|
const eventBus = useEventBus();
|
|
17730
17733
|
const { t } = useTranslate();
|
|
17731
17734
|
const [visibleCount, setVisibleCount] = React110__default.useState(pageSize || Infinity);
|
|
17735
|
+
const fieldDefs = fields ?? columns ?? [];
|
|
17732
17736
|
const allData = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
17733
17737
|
const data = pageSize > 0 ? allData.slice(0, visibleCount) : allData;
|
|
17734
17738
|
const hasMoreLocal = pageSize > 0 && visibleCount < allData.length;
|
|
@@ -17743,7 +17747,7 @@ function DataList({
|
|
|
17743
17747
|
const isFnLambda = Array.isArray(renderItemRaw) && renderItemRaw.length >= 3 && (renderItemRaw[0] === "fn" || renderItemRaw[0] === "lambda");
|
|
17744
17748
|
dataListLog.warn("renderItem-unresolved", {
|
|
17745
17749
|
rowCount: data.length,
|
|
17746
|
-
fieldsCount:
|
|
17750
|
+
fieldsCount: fieldDefs.length,
|
|
17747
17751
|
renderItemTypeOf,
|
|
17748
17752
|
renderItemIsArray: Array.isArray(renderItemRaw),
|
|
17749
17753
|
renderItemIsFnLambda: isFnLambda,
|
|
@@ -17752,11 +17756,11 @@ function DataList({
|
|
|
17752
17756
|
sampleRowKeys: sampleKeys
|
|
17753
17757
|
});
|
|
17754
17758
|
}
|
|
17755
|
-
}, [data, hasRenderProp, schemaRenderItem, children,
|
|
17756
|
-
const titleField =
|
|
17757
|
-
const badgeFields =
|
|
17758
|
-
const progressFields =
|
|
17759
|
-
const bodyFields =
|
|
17759
|
+
}, [data, hasRenderProp, schemaRenderItem, children, fieldDefs]);
|
|
17760
|
+
const titleField = fieldDefs.find((f3) => f3.variant === "h3" || f3.variant === "h4") ?? fieldDefs[0];
|
|
17761
|
+
const badgeFields = fieldDefs.filter((f3) => f3.variant === "badge" && f3 !== titleField);
|
|
17762
|
+
const progressFields = fieldDefs.filter((f3) => f3.variant === "progress");
|
|
17763
|
+
const bodyFields = fieldDefs.filter(
|
|
17760
17764
|
(f3) => f3 !== titleField && !badgeFields.includes(f3) && !progressFields.includes(f3)
|
|
17761
17765
|
);
|
|
17762
17766
|
const handleActionClick = (action, itemData) => (e) => {
|
|
@@ -17788,7 +17792,7 @@ function DataList({
|
|
|
17788
17792
|
if (isMessage) {
|
|
17789
17793
|
const items2 = data.map((item) => item);
|
|
17790
17794
|
const groups2 = groupBy ? groupData(items2, groupBy) : [{ label: "", items: items2 }];
|
|
17791
|
-
const contentField = titleField?.name ??
|
|
17795
|
+
const contentField = titleField?.name ?? fieldDefs[0]?.name ?? "";
|
|
17792
17796
|
return /* @__PURE__ */ jsx(VStack, { gap: "sm", className: cn("py-2", className), children: groups2.map((group, gi) => /* @__PURE__ */ jsxs(React110__default.Fragment, { children: [
|
|
17793
17797
|
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: "my-2" }),
|
|
17794
17798
|
group.items.map((itemData, index) => {
|
|
@@ -17796,7 +17800,7 @@ function DataList({
|
|
|
17796
17800
|
const sender = senderField ? String(getNestedValue(itemData, senderField) ?? "") : "";
|
|
17797
17801
|
const isSent = Boolean(currentUser && sender === currentUser);
|
|
17798
17802
|
const content = getNestedValue(itemData, contentField);
|
|
17799
|
-
const timestampField =
|
|
17803
|
+
const timestampField = fieldDefs.find((f3) => f3.format === "date");
|
|
17800
17804
|
const timestamp = timestampField ? getNestedValue(itemData, timestampField.name) : null;
|
|
17801
17805
|
return /* @__PURE__ */ jsx(
|
|
17802
17806
|
Box,
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Uses Button, Icon, Typography, and Divider atoms.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import type { EventEmit } from "@almadar/core";
|
|
8
9
|
export interface AccordionItem {
|
|
9
10
|
/**
|
|
10
11
|
* Item ID (auto-generated from header/title if not provided)
|
|
@@ -62,6 +63,9 @@ export interface AccordionProps {
|
|
|
62
63
|
*/
|
|
63
64
|
className?: string;
|
|
64
65
|
/** Declarative toggle event — emits UI:{toggleEvent} with { itemId, isOpen } */
|
|
65
|
-
toggleEvent?:
|
|
66
|
+
toggleEvent?: EventEmit<{
|
|
67
|
+
itemId: string;
|
|
68
|
+
isOpen: boolean;
|
|
69
|
+
}>;
|
|
66
70
|
}
|
|
67
71
|
export declare const Accordion: React.FC<AccordionProps>;
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* Composes DayCell and TimeSlotCell atoms into a 7-day grid.
|
|
7
7
|
*/
|
|
8
8
|
import React from "react";
|
|
9
|
-
import type { EventPayload } from "@almadar/core";
|
|
9
|
+
import type { EventEmit, EventPayload } from "@almadar/core";
|
|
10
10
|
export interface CalendarEvent {
|
|
11
11
|
id: string;
|
|
12
12
|
title: string;
|
|
@@ -29,14 +29,17 @@ export interface CalendarGridProps {
|
|
|
29
29
|
onEventClick?: (event: CalendarEvent) => void;
|
|
30
30
|
/** Additional CSS classes */
|
|
31
31
|
className?: string;
|
|
32
|
-
/** Event emitted on long-press of a time slot: UI:{longPressEvent} with { date, time } */
|
|
33
|
-
longPressEvent?:
|
|
32
|
+
/** Event emitted on long-press of a time slot: UI:{longPressEvent} with { date, time, ...longPressPayload } */
|
|
33
|
+
longPressEvent?: EventEmit<{
|
|
34
|
+
date: string;
|
|
35
|
+
time?: string;
|
|
36
|
+
}>;
|
|
34
37
|
/** Additional payload for long-press events */
|
|
35
38
|
longPressPayload?: EventPayload;
|
|
36
39
|
/** Event emitted on swipe left (next week): UI:{swipeLeftEvent} */
|
|
37
|
-
swipeLeftEvent?: string
|
|
40
|
+
swipeLeftEvent?: EventEmit<Record<string, never>>;
|
|
38
41
|
/** Event emitted on swipe right (prev week): UI:{swipeRightEvent} */
|
|
39
|
-
swipeRightEvent?: string
|
|
42
|
+
swipeRightEvent?: EventEmit<Record<string, never>>;
|
|
40
43
|
}
|
|
41
44
|
export declare function CalendarGrid({ weekStart, timeSlots, events, onSlotClick, onDayClick, onEventClick, className, longPressEvent, longPressPayload, swipeLeftEvent, swipeRightEvent, }: CalendarGridProps): React.JSX.Element;
|
|
42
45
|
export declare namespace CalendarGrid {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @generated by Orbital Compiler
|
|
8
8
|
*/
|
|
9
9
|
import React from "react";
|
|
10
|
-
import type { EventKey, EventPayload } from "@almadar/core";
|
|
10
|
+
import type { EventEmit, EventKey, EventPayload } from "@almadar/core";
|
|
11
11
|
export interface CardAction {
|
|
12
12
|
label: string;
|
|
13
13
|
onClick?: () => void;
|
|
@@ -42,8 +42,8 @@ export interface CardProps {
|
|
|
42
42
|
level?: number;
|
|
43
43
|
/** Maximum level */
|
|
44
44
|
maxLevel?: number;
|
|
45
|
-
/** Event emitted on long press: UI:{longPressEvent} */
|
|
46
|
-
longPressEvent?:
|
|
45
|
+
/** Event emitted on long press: UI:{longPressEvent} (payload: longPressPayload spread — variable) */
|
|
46
|
+
longPressEvent?: EventEmit<EventPayload>;
|
|
47
47
|
/** Additional payload for long-press events */
|
|
48
48
|
longPressPayload?: EventPayload;
|
|
49
49
|
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Pure UI molecule with no entity binding.
|
|
7
7
|
*/
|
|
8
8
|
import React from 'react';
|
|
9
|
+
import type { EventEmit } from '@almadar/core';
|
|
9
10
|
export interface CarouselProps<T = Record<string, unknown>> {
|
|
10
11
|
/** Array of items to display as slides */
|
|
11
12
|
items: T[];
|
|
@@ -24,7 +25,9 @@ export interface CarouselProps<T = Record<string, unknown>> {
|
|
|
24
25
|
/** Enable infinite loop */
|
|
25
26
|
loop?: boolean;
|
|
26
27
|
/** Declarative event name for slide change */
|
|
27
|
-
slideChangeEvent?:
|
|
28
|
+
slideChangeEvent?: EventEmit<{
|
|
29
|
+
index: number;
|
|
30
|
+
}>;
|
|
28
31
|
/** Payload to include with the slide change event */
|
|
29
32
|
slideChangePayload?: Record<string, unknown>;
|
|
30
33
|
/** Additional CSS classes */
|
|
@@ -55,8 +55,14 @@ export interface DataGridProps<T extends EntityRow = EntityRow> {
|
|
|
55
55
|
* receive cards typed to that exact shape.
|
|
56
56
|
*/
|
|
57
57
|
entity: T | readonly T[];
|
|
58
|
-
/**
|
|
59
|
-
|
|
58
|
+
/**
|
|
59
|
+
* Field definitions for rendering each card. The pattern contract in
|
|
60
|
+
* `@almadar/patterns` documents `columns` as the wire-format alias the
|
|
61
|
+
* compiler emits — both names resolve to the same shape here. Pass either.
|
|
62
|
+
*/
|
|
63
|
+
fields?: readonly DataGridField[];
|
|
64
|
+
/** Alias for `fields` — the compiler emits `columns` for field defs. */
|
|
65
|
+
columns?: readonly DataGridField[];
|
|
60
66
|
/** Per-item action buttons */
|
|
61
67
|
itemActions?: readonly DataGridItemAction[];
|
|
62
68
|
/** Number of columns (uses auto-fit if omitted) */
|
|
@@ -96,7 +102,7 @@ export interface DataGridProps<T extends EntityRow = EntityRow> {
|
|
|
96
102
|
/** Max items to show before "Show More" button. Defaults to 0 (disabled). */
|
|
97
103
|
pageSize?: number;
|
|
98
104
|
}
|
|
99
|
-
export declare function DataGrid<T extends EntityRow = EntityRow>({ entity, fields, itemActions, cols, gap, minCardWidth, className, isLoading, error, imageField, selectable, selectionEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, }: DataGridProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
export declare function DataGrid<T extends EntityRow = EntityRow>({ entity, fields, columns, itemActions, cols, gap, minCardWidth, className, isLoading, error, imageField, selectable, selectionEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, }: DataGridProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
100
106
|
export declare namespace DataGrid {
|
|
101
107
|
var displayName: string;
|
|
102
108
|
}
|
|
@@ -45,8 +45,14 @@ export interface DataListProps<T extends EntityRow = EntityRow> {
|
|
|
45
45
|
* receive items of that exact shape.
|
|
46
46
|
*/
|
|
47
47
|
entity: T | readonly T[];
|
|
48
|
-
/**
|
|
49
|
-
|
|
48
|
+
/**
|
|
49
|
+
* Field definitions for rendering each row. The pattern contract in
|
|
50
|
+
* `@almadar/patterns` documents `columns` as the wire-format alias the
|
|
51
|
+
* compiler emits — both names resolve to the same shape here. Pass either.
|
|
52
|
+
*/
|
|
53
|
+
fields?: readonly DataListField[];
|
|
54
|
+
/** Alias for `fields` — the compiler emits `columns` for field defs. */
|
|
55
|
+
columns?: readonly DataListField[];
|
|
50
56
|
/** Per-item action buttons */
|
|
51
57
|
itemActions?: readonly DataListItemAction[];
|
|
52
58
|
/** Gap between rows */
|
|
@@ -110,7 +116,7 @@ export interface DataListProps<T extends EntityRow = EntityRow> {
|
|
|
110
116
|
/** Max items to show before "Show More" button. Defaults to 5. Set to 0 to disable. */
|
|
111
117
|
pageSize?: number;
|
|
112
118
|
}
|
|
113
|
-
export declare function DataList<T extends EntityRow = EntityRow>({ entity, fields, itemActions, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, }: DataListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
119
|
+
export declare function DataList<T extends EntityRow = EntityRow>({ entity, fields, columns, itemActions, gap, variant, groupBy, senderField, currentUser, className, isLoading, error, reorderable: _reorderable, reorderEvent: _reorderEvent, swipeLeftEvent: _swipeLeftEvent, swipeLeftActions: _swipeLeftActions, swipeRightEvent: _swipeRightEvent, swipeRightActions: _swipeRightActions, longPressEvent: _longPressEvent, infiniteScroll, loadMoreEvent, hasMore, children, pageSize, renderItem: schemaRenderItem, }: DataListProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
114
120
|
export declare namespace DataList {
|
|
115
121
|
var displayName: string;
|
|
116
122
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { EventEmit } from "@almadar/core";
|
|
2
3
|
import { LucideIcon } from "lucide-react";
|
|
3
4
|
export interface EmptyStateProps {
|
|
4
5
|
/**
|
|
@@ -20,6 +21,6 @@ export interface EmptyStateProps {
|
|
|
20
21
|
/** Variant for color styling */
|
|
21
22
|
variant?: "default" | "success" | "error" | "warning" | "info";
|
|
22
23
|
/** Declarative action event — emits UI:{actionEvent} via eventBus when action button is clicked */
|
|
23
|
-
actionEvent?: string
|
|
24
|
+
actionEvent?: EventEmit<Record<string, never>>;
|
|
24
25
|
}
|
|
25
26
|
export declare const EmptyState: React.FC<EmptyStateProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import type { EventEmit } from "@almadar/core";
|
|
2
3
|
export interface ErrorStateProps {
|
|
3
4
|
title?: string;
|
|
4
5
|
/** Error message to display */
|
|
@@ -8,6 +9,6 @@ export interface ErrorStateProps {
|
|
|
8
9
|
onRetry?: () => void;
|
|
9
10
|
className?: string;
|
|
10
11
|
/** Declarative retry event — emits UI:{retryEvent} via eventBus when retry button is clicked */
|
|
11
|
-
retryEvent?: string
|
|
12
|
+
retryEvent?: EventEmit<Record<string, never>>;
|
|
12
13
|
}
|
|
13
14
|
export declare const ErrorState: React.FC<ErrorStateProps>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { EventEmit } from '@almadar/core';
|
|
1
2
|
export interface MapMarkerData {
|
|
2
3
|
/** Unique marker identifier */
|
|
3
4
|
id: string | number;
|
|
@@ -26,9 +27,12 @@ export interface MapViewProps {
|
|
|
26
27
|
/** Callback when the map is clicked (programmatic use) */
|
|
27
28
|
onMapClick?: (lat: number, lng: number) => void;
|
|
28
29
|
/** Event name dispatched via event bus when the map is clicked. Payload: { latitude, longitude } */
|
|
29
|
-
mapClickEvent?:
|
|
30
|
-
|
|
31
|
-
|
|
30
|
+
mapClickEvent?: EventEmit<{
|
|
31
|
+
latitude: number;
|
|
32
|
+
longitude: number;
|
|
33
|
+
}>;
|
|
34
|
+
/** Event name dispatched via event bus when a marker is clicked. Payload: full MapMarkerData spread. */
|
|
35
|
+
markerClickEvent?: EventEmit<MapMarkerData>;
|
|
32
36
|
/** Whether to show a pin at the clicked location */
|
|
33
37
|
showClickedPin?: boolean;
|
|
34
38
|
/** Additional CSS classes */
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* Uses theme-aware CSS variables for styling.
|
|
6
6
|
*/
|
|
7
7
|
import React from "react";
|
|
8
|
+
import type { EventEmit } from "@almadar/core";
|
|
8
9
|
export type ModalSize = "sm" | "md" | "lg" | "xl" | "full";
|
|
9
10
|
export interface ModalProps {
|
|
10
11
|
/** Whether the modal is open (defaults to true when rendered by slot wrapper) */
|
|
@@ -21,7 +22,7 @@ export interface ModalProps {
|
|
|
21
22
|
closeOnEscape?: boolean;
|
|
22
23
|
className?: string;
|
|
23
24
|
/** Declarative close event — emits UI:{closeEvent} via eventBus when modal should close */
|
|
24
|
-
closeEvent?: string
|
|
25
|
+
closeEvent?: EventEmit<Record<string, never>>;
|
|
25
26
|
/** Enable swipe-down-to-close on mobile bottom sheet (default: true) */
|
|
26
27
|
swipeDownToClose?: boolean;
|
|
27
28
|
}
|