@almadar/ui 5.8.1 → 5.9.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 +314 -0
- package/dist/avl/index.js +314 -0
- package/dist/components/atoms/AnimatedGraphic.d.ts +2 -0
- package/dist/components/atoms/AnimatedReveal.d.ts +2 -0
- package/dist/components/atoms/Badge.d.ts +2 -0
- package/dist/components/atoms/Box.d.ts +2 -0
- package/dist/components/atoms/Button.d.ts +2 -0
- package/dist/components/atoms/Card.d.ts +2 -0
- package/dist/components/atoms/Checkbox.d.ts +2 -0
- package/dist/components/atoms/FilterPill.d.ts +2 -0
- package/dist/components/atoms/Input.d.ts +2 -0
- package/dist/components/atoms/Label.d.ts +2 -0
- package/dist/components/atoms/Radio.d.ts +2 -0
- package/dist/components/atoms/RangeSlider.d.ts +2 -0
- package/dist/components/atoms/Select.d.ts +2 -0
- package/dist/components/atoms/Spinner.d.ts +2 -0
- package/dist/components/atoms/StatusDot.d.ts +2 -0
- package/dist/components/atoms/Textarea.d.ts +2 -0
- package/dist/components/atoms/TrendIndicator.d.ts +2 -0
- package/dist/components/index.cjs +318 -2
- package/dist/components/index.js +318 -3
- package/dist/components/molecules/TableView.d.ts +107 -0
- package/dist/components/molecules/index.d.ts +1 -0
- package/dist/docs/index.d.cts +8 -0
- package/dist/marketing/index.d.cts +12 -0
- package/dist/providers/index.cjs +314 -0
- package/dist/providers/index.js +314 -0
- package/dist/runtime/index.cjs +314 -0
- package/dist/runtime/index.js +314 -0
- package/package.json +1 -1
package/dist/components/index.js
CHANGED
|
@@ -28234,6 +28234,318 @@ var init_Lightbox = __esm({
|
|
|
28234
28234
|
Lightbox.displayName = "Lightbox";
|
|
28235
28235
|
}
|
|
28236
28236
|
});
|
|
28237
|
+
function columnLabel(col) {
|
|
28238
|
+
return col.header ?? col.label ?? col.key.replace(/([a-z])([A-Z])/g, "$1 $2").replace(/[_-]/g, " ").replace(/\b\w/g, (c) => c.toUpperCase());
|
|
28239
|
+
}
|
|
28240
|
+
function statusVariant4(value) {
|
|
28241
|
+
const v = value.toLowerCase();
|
|
28242
|
+
if (["active", "completed", "done", "approved", "published", "resolved", "open", "online", "ok"].includes(v)) return "success";
|
|
28243
|
+
if (["pending", "in_progress", "in-progress", "review", "draft", "processing", "warn", "warning"].includes(v)) return "warning";
|
|
28244
|
+
if (["inactive", "deleted", "rejected", "failed", "error", "blocked", "closed", "offline"].includes(v)) return "error";
|
|
28245
|
+
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
28246
|
+
return "default";
|
|
28247
|
+
}
|
|
28248
|
+
function formatCell(value, format) {
|
|
28249
|
+
if (value === void 0 || value === null) return "";
|
|
28250
|
+
switch (format) {
|
|
28251
|
+
case "date": {
|
|
28252
|
+
const d = new Date(String(value));
|
|
28253
|
+
return isNaN(d.getTime()) ? String(value) : d.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" });
|
|
28254
|
+
}
|
|
28255
|
+
case "currency":
|
|
28256
|
+
return typeof value === "number" ? `$${value.toFixed(2)}` : String(value);
|
|
28257
|
+
case "number":
|
|
28258
|
+
return typeof value === "number" ? value.toLocaleString() : String(value);
|
|
28259
|
+
case "percent":
|
|
28260
|
+
return typeof value === "number" ? `${Math.round(value)}%` : String(value);
|
|
28261
|
+
case "boolean":
|
|
28262
|
+
return value ? "Yes" : "No";
|
|
28263
|
+
default:
|
|
28264
|
+
return String(value);
|
|
28265
|
+
}
|
|
28266
|
+
}
|
|
28267
|
+
function groupData2(items, field) {
|
|
28268
|
+
const groups = /* @__PURE__ */ new Map();
|
|
28269
|
+
for (const item of items) {
|
|
28270
|
+
const key = String(getNestedValue(item, field) ?? "");
|
|
28271
|
+
const group = groups.get(key);
|
|
28272
|
+
if (group) group.push(item);
|
|
28273
|
+
else groups.set(key, [item]);
|
|
28274
|
+
}
|
|
28275
|
+
return Array.from(groups.entries()).map(([label, groupItems]) => ({ label, items: groupItems }));
|
|
28276
|
+
}
|
|
28277
|
+
function TableView({
|
|
28278
|
+
entity,
|
|
28279
|
+
columns,
|
|
28280
|
+
fields,
|
|
28281
|
+
itemActions,
|
|
28282
|
+
selectable = false,
|
|
28283
|
+
selectEvent,
|
|
28284
|
+
selectedIds,
|
|
28285
|
+
sortEvent,
|
|
28286
|
+
sortColumn,
|
|
28287
|
+
sortDirection,
|
|
28288
|
+
className,
|
|
28289
|
+
emptyMessage,
|
|
28290
|
+
isLoading = false,
|
|
28291
|
+
error = null,
|
|
28292
|
+
groupBy,
|
|
28293
|
+
pageSize = 0,
|
|
28294
|
+
children,
|
|
28295
|
+
renderItem: _schemaRenderItem,
|
|
28296
|
+
look = "dense",
|
|
28297
|
+
// DnD props consumed by useDataDnd.
|
|
28298
|
+
dragGroup,
|
|
28299
|
+
accepts,
|
|
28300
|
+
sortable,
|
|
28301
|
+
dropEvent,
|
|
28302
|
+
reorderEvent,
|
|
28303
|
+
positionEvent,
|
|
28304
|
+
dndItemIdField,
|
|
28305
|
+
dndRoot
|
|
28306
|
+
}) {
|
|
28307
|
+
const eventBus = useEventBus();
|
|
28308
|
+
const { t } = useTranslate();
|
|
28309
|
+
const [visibleCount, setVisibleCount] = React80__default.useState(pageSize > 0 ? pageSize : Infinity);
|
|
28310
|
+
const [localSelected, setLocalSelected] = React80__default.useState(/* @__PURE__ */ new Set());
|
|
28311
|
+
const colDefs = columns ?? fields ?? [];
|
|
28312
|
+
const allDataRaw = Array.isArray(entity) ? entity : entity ? [entity] : [];
|
|
28313
|
+
const dnd = useDataDnd({
|
|
28314
|
+
items: allDataRaw,
|
|
28315
|
+
layout: "list",
|
|
28316
|
+
dragGroup,
|
|
28317
|
+
accepts,
|
|
28318
|
+
sortable,
|
|
28319
|
+
dropEvent,
|
|
28320
|
+
reorderEvent,
|
|
28321
|
+
positionEvent,
|
|
28322
|
+
dndItemIdField,
|
|
28323
|
+
dndRoot
|
|
28324
|
+
});
|
|
28325
|
+
const ordered = dnd.orderedItems;
|
|
28326
|
+
const data = pageSize > 0 ? ordered.slice(0, visibleCount) : ordered;
|
|
28327
|
+
const hasMore = pageSize > 0 && visibleCount < ordered.length;
|
|
28328
|
+
const hasRenderProp = typeof children === "function";
|
|
28329
|
+
const idField = dndItemIdField ?? "id";
|
|
28330
|
+
const selected = selectedIds ? new Set(selectedIds) : localSelected;
|
|
28331
|
+
const emitSelection = (next) => {
|
|
28332
|
+
if (!selectedIds) setLocalSelected(next);
|
|
28333
|
+
if (selectEvent) {
|
|
28334
|
+
const payload = { selectedIds: Array.from(next) };
|
|
28335
|
+
eventBus.emit(`UI:${selectEvent}`, payload);
|
|
28336
|
+
}
|
|
28337
|
+
};
|
|
28338
|
+
const allSelected = selectable && data.length > 0 && data.every((r, i) => selected.has(String(r[idField] ?? i)));
|
|
28339
|
+
const toggleAll = () => {
|
|
28340
|
+
if (allSelected) emitSelection(/* @__PURE__ */ new Set());
|
|
28341
|
+
else emitSelection(new Set(data.map((r, i) => String(r[idField] ?? i))));
|
|
28342
|
+
};
|
|
28343
|
+
const toggleRow = (id) => {
|
|
28344
|
+
const next = new Set(selected);
|
|
28345
|
+
if (next.has(id)) next.delete(id);
|
|
28346
|
+
else next.add(id);
|
|
28347
|
+
emitSelection(next);
|
|
28348
|
+
};
|
|
28349
|
+
const handleSort = (col) => {
|
|
28350
|
+
if (!col.sortable || !sortEvent) return;
|
|
28351
|
+
const dir = sortColumn === (col.field ?? col.key) && sortDirection === "asc" ? "desc" : "asc";
|
|
28352
|
+
eventBus.emit(`UI:${sortEvent}`, { column: col.field ?? col.key, direction: dir });
|
|
28353
|
+
};
|
|
28354
|
+
const handleActionClick = (action, row) => (e) => {
|
|
28355
|
+
e.stopPropagation();
|
|
28356
|
+
const payload = {
|
|
28357
|
+
id: row.id,
|
|
28358
|
+
row
|
|
28359
|
+
};
|
|
28360
|
+
eventBus.emit(`UI:${action.event}`, payload);
|
|
28361
|
+
};
|
|
28362
|
+
if (isLoading) {
|
|
28363
|
+
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: t("loading.items") || "Loading\u2026" }) });
|
|
28364
|
+
}
|
|
28365
|
+
if (error) {
|
|
28366
|
+
return /* @__PURE__ */ jsx(Box, { className: "text-center py-8", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "error", children: error.message }) });
|
|
28367
|
+
}
|
|
28368
|
+
if (data.length === 0) {
|
|
28369
|
+
const emptyNode = /* @__PURE__ */ jsx(Box, { className: "text-center py-12", children: /* @__PURE__ */ jsx(Typography, { variant: "body", color: "secondary", children: emptyMessage || t("empty.noItems") || "No records" }) });
|
|
28370
|
+
return dnd.enabled ? /* @__PURE__ */ jsx(Fragment, { children: dnd.wrapContainer(emptyNode) }) : emptyNode;
|
|
28371
|
+
}
|
|
28372
|
+
const lk = LOOKS[look];
|
|
28373
|
+
const hasActions = Boolean(itemActions && itemActions.length > 0);
|
|
28374
|
+
const gridTemplateColumns = [
|
|
28375
|
+
selectable ? "auto" : null,
|
|
28376
|
+
...colDefs.map((c) => c.width ?? "minmax(0, 1fr)"),
|
|
28377
|
+
hasActions ? "auto" : null
|
|
28378
|
+
].filter(Boolean).join(" ");
|
|
28379
|
+
const header = /* @__PURE__ */ jsxs(
|
|
28380
|
+
Box,
|
|
28381
|
+
{
|
|
28382
|
+
role: "row",
|
|
28383
|
+
style: { gridTemplateColumns },
|
|
28384
|
+
className: cn(
|
|
28385
|
+
"grid items-center gap-3 sticky top-0 z-10",
|
|
28386
|
+
"bg-[var(--color-surface-subtle)] border-b border-[var(--color-border)]",
|
|
28387
|
+
"text-[var(--color-text-muted)] uppercase text-xs font-semibold tracking-wide",
|
|
28388
|
+
lk.headPad
|
|
28389
|
+
),
|
|
28390
|
+
children: [
|
|
28391
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(Checkbox, { checked: allSelected, onChange: toggleAll, "aria-label": "Select all rows" }) }),
|
|
28392
|
+
colDefs.map((col) => {
|
|
28393
|
+
const active = sortColumn === (col.field ?? col.key);
|
|
28394
|
+
return /* @__PURE__ */ jsxs(
|
|
28395
|
+
Box,
|
|
28396
|
+
{
|
|
28397
|
+
role: "columnheader",
|
|
28398
|
+
onClick: () => handleSort(col),
|
|
28399
|
+
className: cn(
|
|
28400
|
+
"flex items-center gap-1 min-w-0",
|
|
28401
|
+
alignClass[col.align ?? "left"],
|
|
28402
|
+
col.sortable && sortEvent && "cursor-pointer select-none hover:text-foreground"
|
|
28403
|
+
),
|
|
28404
|
+
children: [
|
|
28405
|
+
col.icon && /* @__PURE__ */ jsx(Icon, { name: col.icon, size: "xs" }),
|
|
28406
|
+
/* @__PURE__ */ jsx("span", { className: "truncate", children: columnLabel(col) }),
|
|
28407
|
+
col.sortable && sortEvent && /* @__PURE__ */ jsx(
|
|
28408
|
+
Icon,
|
|
28409
|
+
{
|
|
28410
|
+
name: active ? sortDirection === "asc" ? "chevron-up" : "chevron-down" : "chevrons-up-down",
|
|
28411
|
+
size: "xs",
|
|
28412
|
+
className: cn("flex-shrink-0", active ? "text-foreground" : "opacity-40")
|
|
28413
|
+
}
|
|
28414
|
+
)
|
|
28415
|
+
]
|
|
28416
|
+
},
|
|
28417
|
+
col.key
|
|
28418
|
+
);
|
|
28419
|
+
}),
|
|
28420
|
+
hasActions && /* @__PURE__ */ jsx(Box, { "aria-hidden": true })
|
|
28421
|
+
]
|
|
28422
|
+
}
|
|
28423
|
+
);
|
|
28424
|
+
const renderRow = (row, index) => {
|
|
28425
|
+
const id = String(row[idField] ?? index);
|
|
28426
|
+
const rowInner = /* @__PURE__ */ jsxs(
|
|
28427
|
+
Box,
|
|
28428
|
+
{
|
|
28429
|
+
role: "row",
|
|
28430
|
+
"data-entity-row": true,
|
|
28431
|
+
"data-entity-id": id,
|
|
28432
|
+
style: !hasRenderProp ? { gridTemplateColumns } : void 0,
|
|
28433
|
+
className: cn(
|
|
28434
|
+
"group items-center gap-3 transition-colors duration-fast",
|
|
28435
|
+
hasRenderProp ? "flex" : "grid",
|
|
28436
|
+
lk.rowPad,
|
|
28437
|
+
lk.divider && "border-b border-[var(--color-border)]",
|
|
28438
|
+
lk.striped && index % 2 === 1 && "bg-[var(--color-surface-subtle)]",
|
|
28439
|
+
"hover:bg-[var(--color-surface-subtle)]",
|
|
28440
|
+
look === "bordered" && "[&>*]:border-r [&>*]:border-[var(--color-border)] [&>*:last-child]:border-r-0"
|
|
28441
|
+
),
|
|
28442
|
+
children: [
|
|
28443
|
+
selectable && /* @__PURE__ */ jsx(Box, { className: "flex items-center", children: /* @__PURE__ */ jsx(
|
|
28444
|
+
Checkbox,
|
|
28445
|
+
{
|
|
28446
|
+
checked: selected.has(id),
|
|
28447
|
+
onChange: () => toggleRow(id),
|
|
28448
|
+
"aria-label": `Select row ${id}`
|
|
28449
|
+
}
|
|
28450
|
+
) }),
|
|
28451
|
+
hasRenderProp ? /* @__PURE__ */ jsx(Box, { className: "flex-1 min-w-0", children: children(row, index) }) : colDefs.map((col) => {
|
|
28452
|
+
const raw = getNestedValue(row, col.field ?? col.key);
|
|
28453
|
+
const cellBase = cn(
|
|
28454
|
+
"flex items-center min-w-0",
|
|
28455
|
+
alignClass[col.align ?? "left"],
|
|
28456
|
+
weightClass[col.weight ?? "normal"],
|
|
28457
|
+
col.className
|
|
28458
|
+
);
|
|
28459
|
+
if (col.format === "badge" && raw != null && raw !== "") {
|
|
28460
|
+
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx(Badge, { variant: statusVariant4(String(raw)), size: "sm", children: String(raw) }) }, col.key);
|
|
28461
|
+
}
|
|
28462
|
+
return /* @__PURE__ */ jsx(Box, { role: "cell", className: cellBase, children: /* @__PURE__ */ jsx("span", { className: "truncate", children: formatCell(raw, col.format) }) }, col.key);
|
|
28463
|
+
}),
|
|
28464
|
+
itemActions && itemActions.length > 0 && /* @__PURE__ */ jsx(HStack, { gap: "xs", className: "flex-shrink-0 opacity-60 group-hover:opacity-100 transition-opacity", children: itemActions.map((action, i) => /* @__PURE__ */ jsxs(
|
|
28465
|
+
Button,
|
|
28466
|
+
{
|
|
28467
|
+
variant: action.variant ?? "ghost",
|
|
28468
|
+
size: "sm",
|
|
28469
|
+
onClick: handleActionClick(action, row),
|
|
28470
|
+
"data-testid": `action-${action.event}`,
|
|
28471
|
+
"data-row-id": String(row.id),
|
|
28472
|
+
className: cn(action.variant === "danger" && "text-error hover:bg-error/10"),
|
|
28473
|
+
children: [
|
|
28474
|
+
action.icon && /* @__PURE__ */ jsx(Icon, { name: action.icon, size: "xs", className: "mr-1" }),
|
|
28475
|
+
action.label
|
|
28476
|
+
]
|
|
28477
|
+
},
|
|
28478
|
+
i
|
|
28479
|
+
)) })
|
|
28480
|
+
]
|
|
28481
|
+
}
|
|
28482
|
+
);
|
|
28483
|
+
return dnd.isZone ? /* @__PURE__ */ jsx(dnd.SortableItem, { id: row[idField] ?? id, children: rowInner }, id) : /* @__PURE__ */ jsx(React80__default.Fragment, { children: rowInner }, id);
|
|
28484
|
+
};
|
|
28485
|
+
const items = data.map((row) => row);
|
|
28486
|
+
const groups = groupBy ? groupData2(items, groupBy) : [{ label: "", items }];
|
|
28487
|
+
let runningIndex = 0;
|
|
28488
|
+
const body = /* @__PURE__ */ jsx(Box, { role: "rowgroup", children: groups.map((group, gi) => /* @__PURE__ */ jsxs(React80__default.Fragment, { children: [
|
|
28489
|
+
group.label && /* @__PURE__ */ jsx(Divider, { label: group.label, className: gi > 0 ? "mt-3" : "mt-0" }),
|
|
28490
|
+
group.items.map((row) => renderRow(row, runningIndex++))
|
|
28491
|
+
] }, gi)) });
|
|
28492
|
+
return /* @__PURE__ */ jsxs(
|
|
28493
|
+
Box,
|
|
28494
|
+
{
|
|
28495
|
+
role: "table",
|
|
28496
|
+
className: cn("w-full text-sm", className),
|
|
28497
|
+
children: [
|
|
28498
|
+
header,
|
|
28499
|
+
dnd.wrapContainer(body),
|
|
28500
|
+
hasMore && /* @__PURE__ */ jsx(Box, { className: "flex justify-center py-3", children: /* @__PURE__ */ jsxs(Button, { variant: "ghost", size: "sm", onClick: () => setVisibleCount((p2) => p2 + (pageSize || 5)), children: [
|
|
28501
|
+
/* @__PURE__ */ jsx(Icon, { name: "chevron-down", size: "xs", className: "mr-1" }),
|
|
28502
|
+
t("common.showMore"),
|
|
28503
|
+
" (",
|
|
28504
|
+
ordered.length - visibleCount,
|
|
28505
|
+
" remaining)"
|
|
28506
|
+
] }) })
|
|
28507
|
+
]
|
|
28508
|
+
}
|
|
28509
|
+
);
|
|
28510
|
+
}
|
|
28511
|
+
var alignClass, weightClass, LOOKS;
|
|
28512
|
+
var init_TableView = __esm({
|
|
28513
|
+
"components/molecules/TableView.tsx"() {
|
|
28514
|
+
"use client";
|
|
28515
|
+
init_cn();
|
|
28516
|
+
init_getNestedValue();
|
|
28517
|
+
init_useEventBus();
|
|
28518
|
+
init_useTranslate();
|
|
28519
|
+
init_Box();
|
|
28520
|
+
init_Stack();
|
|
28521
|
+
init_Typography();
|
|
28522
|
+
init_Badge();
|
|
28523
|
+
init_Button();
|
|
28524
|
+
init_Icon();
|
|
28525
|
+
init_Checkbox();
|
|
28526
|
+
init_Divider();
|
|
28527
|
+
init_useDataDnd();
|
|
28528
|
+
createLogger("almadar:ui:table-view");
|
|
28529
|
+
alignClass = {
|
|
28530
|
+
left: "justify-start text-left",
|
|
28531
|
+
center: "justify-center text-center",
|
|
28532
|
+
right: "justify-end text-right"
|
|
28533
|
+
};
|
|
28534
|
+
weightClass = {
|
|
28535
|
+
normal: "",
|
|
28536
|
+
medium: "font-medium",
|
|
28537
|
+
semibold: "font-semibold"
|
|
28538
|
+
};
|
|
28539
|
+
LOOKS = {
|
|
28540
|
+
dense: { rowPad: "px-3 py-2", headPad: "px-3 py-2", striped: false, divider: true },
|
|
28541
|
+
spacious: { rowPad: "px-5 py-4", headPad: "px-5 py-3", striped: false, divider: true },
|
|
28542
|
+
striped: { rowPad: "px-3 py-2", headPad: "px-3 py-2", striped: true, divider: false },
|
|
28543
|
+
borderless: { rowPad: "px-3 py-2", headPad: "px-3 py-2", striped: false, divider: false },
|
|
28544
|
+
bordered: { rowPad: "px-3 py-2", headPad: "px-3 py-2", striped: false, divider: true }
|
|
28545
|
+
};
|
|
28546
|
+
TableView.displayName = "TableView";
|
|
28547
|
+
}
|
|
28548
|
+
});
|
|
28237
28549
|
function formatNumber(value, format) {
|
|
28238
28550
|
if (value == null) return "0";
|
|
28239
28551
|
const v = typeof value === "number" ? value : value;
|
|
@@ -33924,6 +34236,7 @@ var init_molecules = __esm({
|
|
|
33924
34236
|
init_Lightbox();
|
|
33925
34237
|
init_DataGrid();
|
|
33926
34238
|
init_DataList();
|
|
34239
|
+
init_TableView();
|
|
33927
34240
|
init_StatDisplay();
|
|
33928
34241
|
init_Meter();
|
|
33929
34242
|
init_SwipeableRow();
|
|
@@ -45925,6 +46238,7 @@ var init_component_registry_generated = __esm({
|
|
|
45925
46238
|
init_Switch();
|
|
45926
46239
|
init_TabbedContainer();
|
|
45927
46240
|
init_Table();
|
|
46241
|
+
init_TableView();
|
|
45928
46242
|
init_Tabs();
|
|
45929
46243
|
init_TagCloud();
|
|
45930
46244
|
init_TagInput();
|
|
@@ -46242,6 +46556,7 @@ var init_component_registry_generated = __esm({
|
|
|
46242
46556
|
"Switch": Switch,
|
|
46243
46557
|
"TabbedContainer": TabbedContainer,
|
|
46244
46558
|
"Table": Table,
|
|
46559
|
+
"TableView": TableView,
|
|
46245
46560
|
"Tabs": Tabs,
|
|
46246
46561
|
"TagCloud": TagCloud,
|
|
46247
46562
|
"TagInput": TagInput,
|
|
@@ -47358,7 +47673,7 @@ var FormActions = ({
|
|
|
47358
47673
|
align = "right",
|
|
47359
47674
|
className
|
|
47360
47675
|
}) => {
|
|
47361
|
-
const
|
|
47676
|
+
const alignClass2 = {
|
|
47362
47677
|
left: "justify-start",
|
|
47363
47678
|
right: "justify-end",
|
|
47364
47679
|
between: "justify-between",
|
|
@@ -47371,7 +47686,7 @@ var FormActions = ({
|
|
|
47371
47686
|
align: "center",
|
|
47372
47687
|
className: cn(
|
|
47373
47688
|
"pt-6 border-t border-border",
|
|
47374
|
-
|
|
47689
|
+
alignClass2,
|
|
47375
47690
|
sticky && "sticky bottom-0 bg-card py-4 -mx-6 px-6 shadow-[0_-4px_6px_-1px_rgb(0,0,0,0.05)]",
|
|
47376
47691
|
className
|
|
47377
47692
|
),
|
|
@@ -50153,4 +50468,4 @@ function useGitHubBranches(owner, repo, enabled = true) {
|
|
|
50153
50468
|
});
|
|
50154
50469
|
}
|
|
50155
50470
|
|
|
50156
|
-
export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, CodeBlock, CodeExample, CodeView, CodeViewer, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocCodeBlock, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FeatureRenderer2 as FeatureRenderer, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, HStack, Header, Heading, HealthBar, HealthPanel, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NotifyListener, NumberStepper, ObjectRulePanel, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, Table, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, clearEntities, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createTranslate, createUnitAnimationState, drawSprite, generateCombatMessage, getAllEntities, getByType, getCurrentFrame, getEntity, getSingleton, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseQueryBinding, pendulum, projectileMotion, removeEntity, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, spawnEntity, springOscillator, tickAnimationState, transitionAnimation, updateEntity, updateSingleton, useAgentChat, useAuthContext, useBattleState, useCamera, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEntities, useEntitiesByType, useEntity as useEntityById, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGameAudioContext, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useInput, useLongPress, useOrbitalHistory, usePhysics, usePhysics2D, usePinchZoom, usePlayer, usePreview, usePullToRefresh, useQuerySingleton, useSingletonEntity, useSpriteAnimations, useSwipeGesture, useTraitListens, useTranslate, useUIEvents, useUISlotManager, useValidation };
|
|
50471
|
+
export { ALL_PRESETS, ALMADAR_DND_MIME, AR_BOOK_FIELDS, AboutPageTemplate, Accordion, ActionButton, ActionButtons, Card2 as ActionCard, ActionPalette, ActionTile, Alert, AnimatedCounter, AnimatedGraphic, AnimatedReveal, ArticleSection, Aside, AuthLayout, Avatar, Badge, BattleBoard, BattleTemplate, BehaviorView, BookChapterView, BookCoverPage, BookNavBar, BookTableOfContents, BookViewer, Box, BranchingLogicBuilder, Breadcrumb, BuilderBoard, Button, ButtonGroup, CTABanner, CalendarGrid, CanvasEffect, Card, CardBody, CardContent, CardFooter, CardGrid, CardHeader, CardTitle, Carousel, CaseStudyCard, CaseStudyOrganism, CastleBoard, CastleTemplate, Center, Chart, ChartLegend, Checkbox, ChoiceButton, ClassifierBoard, CodeBlock, CodeExample, CodeView, CodeViewer, CollapsibleSection, CombatLog, ComboCounter, CommunityLinks, ConditionalWrapper, ConfettiEffect, ConfirmDialog, Container, ContentRenderer, ContentSection, ControlButton, CounterTemplate, CraftingRecipe, DEFAULT_LIKERT_OPTIONS, DEFAULT_MATRIX_COLUMNS, DEFAULT_SLOTS, DIAMOND_TOP_Y, DPad, DamageNumber, DashboardGrid, DashboardLayout, DataGrid, DataList, DataTable, DateRangePicker, DateRangeSelector, DayCell, DebuggerBoard, DetailPanel, Dialog, DialogueBox, DialogueBubble, Divider, DocBreadcrumb, DocCodeBlock, DocPagination, DocSearch, DocSidebar, DocTOC, DocumentViewer, StateMachineView as DomStateMachineVisualizer, Drawer, DrawerSlot, EdgeDecoration, EditorCheckbox, EditorSelect, EditorSlider, EditorTextInput, EditorToolbar, EmptyState, EnemyPlate, EntityDisplayEvents, ErrorBoundary, ErrorState, EventHandlerBoard, EventLog, FEATURE_COLORS, FEATURE_TYPES, FLOOR_HEIGHT, FeatureCard, FeatureDetailPageTemplate, FeatureGrid, FeatureGridOrganism, FeatureRenderer2 as FeatureRenderer, FileTree, FilterGroup, FilterPill, Flex, FlipCard, FlipContainer, FloatingActionButton, Form, FormActions, FormField, FormLayout, FormSection, FormSectionHeader, GameAudioContext, GameAudioProvider, GameAudioToggle, GameCanvas2D, GameHud, GameMenu, GameOverScreen, GameShell, GameTemplate, GenericAppTemplate, GeometricPattern, GradientDivider, GraphCanvas, GraphView, Grid, HStack, Header, Heading, HealthBar, HealthPanel, HeroOrganism, HeroSection, I18nProvider, IDENTITY_BOOK_FIELDS, Icon, InfiniteScrollSentinel, Input, InputGroup, InstallBox, InventoryGrid, InventoryPanel, IsometricCanvas, ItemSlot, JazariStateMachine, Label, LandingPageTemplate, LawReferenceTooltip, Lightbox, LikertScale, LineChart2 as LineChart, List3 as List, LoadingState, MapView, MarkdownContent, MarketingFooter, MarketingStatCard, MasterDetail, MasterDetailLayout, MatrixQuestion, MediaGallery, Menu, Meter, MiniMap, Modal, ModalSlot, ModuleCard, Navigation, NegotiatorBoard, NotifyListener, NumberStepper, ObjectRulePanel, OptionConstraintGroup, StateMachineView as OrbitalStateMachineView, OrbitalVisualization, Overlay, PageHeader, Pagination, PatternTile, PhysicsManager, PlatformerCanvas, Popover, PositionedCanvas, PowerupSlots, PricingCard, PricingGrid, PricingOrganism, PricingPageTemplate, ProgressBar, ProgressDots, PullQuote, PullToRefresh, QrScanner, QuestTracker, QuizBlock, Radio, RangeSlider, RelationSelect, RepeatableFormSection, ReplyTree, ResourceBar, ResourceCounter, RichBlockEditor, RuleEditor, RuntimeDebugger, SHEET_COLUMNS, SPRITE_SHEET_LAYOUT, ScaledDiagram, ScoreBoard, ScoreDisplay, SearchInput, Section, SectionHeader, Select, SequenceBar, SequencerBoard, ServiceCatalog, ShowcaseCard, ShowcaseOrganism, SidePanel, Sidebar, SignaturePad, SimpleGrid, SimulationCanvas, SimulationControls, SimulationGraph, SimulatorBoard, Skeleton, SlotContentRenderer, SocialProof, SortableList, Spacer, Sparkline, Spinner, Split, SplitPane, SplitSection, Sprite, Stack, StarRating, StatBadge, StatCard, StatDisplay, StateArchitectBoard, StateIndicator, StateMachineView, StateNode2 as StateNode, StatsGrid, StatsOrganism, StatusBar, StatusDot, StatusEffect, StepFlow, StepFlowOrganism, SvgBranch, SvgConnection, SvgFlow, SvgGrid, SvgLobe, SvgMesh, SvgMorph, SvgNode, SvgPulse, SvgRing, SvgShield, SvgStack, SwipeableRow, Switch, TERRAIN_COLORS, TILE_HEIGHT, TILE_WIDTH, TabbedContainer, Table, TableView, Tabs, TagCloud, TagInput, TeamCard, TeamOrganism, TerrainPalette, Text, TextHighlight, Textarea, ThemeSelector, ThemeToggle, TimeSlotCell, Timeline, TimerDisplay, Toast, ToastSlot, Tooltip, TraitFrame, TraitSlot, TraitStateViewer, TransitionArrow, TrendIndicator, TurnIndicator, TurnPanel, TypewriterText, Typography, UISlotComponent, UISlotRenderer, UncontrolledBattleBoard, UnitCommandBar, UploadDropZone, VStack, VariablePanel, VersionDiff, ViolationAlert, VoteStack, WaypointMarker, WizardContainer, WizardNavigation, WizardProgress, WorldMapBoard, WorldMapTemplate, XPBar, applyTemporaryEffect, calculateAttackTargets, calculateDamage, calculateValidMoves, clearEntities, cn, combatAnimations, combatClasses, combatEffects, createInitialGameState, createTranslate, createUnitAnimationState, drawSprite, generateCombatMessage, getAllEntities, getByType, getCurrentFrame, getEntity, getSingleton, getTileDimensions, inferDirection, isoToScreen, mapBookData, parseQueryBinding, pendulum, projectileMotion, removeEntity, resolveFieldMap, resolveFrame, resolveSheetDirection, screenToIso, spawnEntity, springOscillator, tickAnimationState, transitionAnimation, updateEntity, updateSingleton, useAgentChat, useAuthContext, useBattleState, useCamera, useCompile, useConnectGitHub, useDeepAgentGeneration, useDisconnectGitHub, useDragReorder, useDraggable, useDropZone, useEmitEvent, useEntities, useEntitiesByType, useEntity as useEntityById, useEventBus, useEventListener, useExtensions, useFileEditor, useFileSystem, useGameAudio, useGameAudioContext, useGitHubBranches, useGitHubRepo, useGitHubRepos, useGitHubStatus, useImageCache, useInfiniteScroll, useInput, useLongPress, useOrbitalHistory, usePhysics, usePhysics2D, usePinchZoom, usePlayer, usePreview, usePullToRefresh, useQuerySingleton, useSingletonEntity, useSpriteAnimations, useSwipeGesture, useTraitListens, useTranslate, useUIEvents, useUISlotManager, useValidation };
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TableView Molecule
|
|
3
|
+
*
|
|
4
|
+
* A simplified, schema-driven column table for iterating over entity data.
|
|
5
|
+
* The table-shaped sibling of DataList (rows) and DataGrid (cards): same
|
|
6
|
+
* `entity` + `columns`/`fields` + `itemActions` contract and the same
|
|
7
|
+
* `useDataDnd` drag-to-reorder machinery, rendered as aligned columns with a
|
|
8
|
+
* header. All complexity is opt-in: selection, drag-reorder, and per-column
|
|
9
|
+
* sorting are each enabled by their own props and emit via the event bus.
|
|
10
|
+
*
|
|
11
|
+
* Uses atoms only internally: Box, VStack, HStack, Typography, Badge, Button,
|
|
12
|
+
* Icon, Checkbox, Divider.
|
|
13
|
+
*/
|
|
14
|
+
import React from 'react';
|
|
15
|
+
import type { EntityRow, EventKey } from '@almadar/core';
|
|
16
|
+
import { type DataDndProps } from './useDataDnd';
|
|
17
|
+
export interface TableViewColumn {
|
|
18
|
+
/** Stable column key (React key + default value lookup). */
|
|
19
|
+
key: string;
|
|
20
|
+
/** Entity field to read (dot-notation ok). Defaults to `key`. */
|
|
21
|
+
field?: string;
|
|
22
|
+
/** Header cell text. Falls back to `label`, then a humanized `key`. */
|
|
23
|
+
header?: string;
|
|
24
|
+
/** Accessibility / fallback label. */
|
|
25
|
+
label?: string;
|
|
26
|
+
/** CSS grid track size for this column (e.g. "7rem", "minmax(10rem, 1.5fr)",
|
|
27
|
+
* "1fr"). Shared across header + body so columns align. Defaults to
|
|
28
|
+
* "minmax(0, 1fr)" (equal flexible share). */
|
|
29
|
+
width?: string;
|
|
30
|
+
/** Horizontal alignment of the column's cells. */
|
|
31
|
+
align?: 'left' | 'center' | 'right';
|
|
32
|
+
/** Extra cell classes (e.g. "font-mono tabular-nums truncate"). */
|
|
33
|
+
className?: string;
|
|
34
|
+
/** Render the cell value with the given font weight. */
|
|
35
|
+
weight?: 'normal' | 'medium' | 'semibold';
|
|
36
|
+
/** Value formatting hint. `badge` renders a status Badge. */
|
|
37
|
+
format?: 'badge' | 'date' | 'currency' | 'number' | 'percent' | 'boolean';
|
|
38
|
+
/** Lucide icon shown before the header label. */
|
|
39
|
+
icon?: string;
|
|
40
|
+
/** Allow click-to-sort on this column's header (emits `sortEvent`). */
|
|
41
|
+
sortable?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface TableViewItemAction {
|
|
44
|
+
/** Button label. */
|
|
45
|
+
label: string;
|
|
46
|
+
/** Event name to emit (dispatched as UI:{event} with { id, row }). */
|
|
47
|
+
event: EventKey;
|
|
48
|
+
/** Lucide icon name. */
|
|
49
|
+
icon?: string;
|
|
50
|
+
/** Button variant. */
|
|
51
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
52
|
+
}
|
|
53
|
+
export interface TableViewProps<T extends EntityRow = EntityRow> extends DataDndProps {
|
|
54
|
+
/** Schema entity data — single record or collection. */
|
|
55
|
+
entity: T | readonly T[];
|
|
56
|
+
/** Column definitions. The compiler emits `columns`; `fields` is the alias. */
|
|
57
|
+
columns?: readonly TableViewColumn[];
|
|
58
|
+
/** Alias for `columns`. */
|
|
59
|
+
fields?: readonly TableViewColumn[];
|
|
60
|
+
/** Per-row action buttons (trailing column). */
|
|
61
|
+
itemActions?: readonly TableViewItemAction[];
|
|
62
|
+
/** Render a leading checkbox column. Selection changes emit `selectEvent`. */
|
|
63
|
+
selectable?: boolean;
|
|
64
|
+
/** Event emitted on selection change: UI:{selectEvent} with { ids, rows }. */
|
|
65
|
+
selectEvent?: EventKey;
|
|
66
|
+
/** Currently-selected ids (controlled). Falls back to local state when omitted. */
|
|
67
|
+
selectedIds?: readonly string[];
|
|
68
|
+
/** Event emitted on sortable-header click: UI:{sortEvent} with { column, direction }. */
|
|
69
|
+
sortEvent?: EventKey;
|
|
70
|
+
/** Current sort column (display hint for the active header arrow). */
|
|
71
|
+
sortColumn?: string;
|
|
72
|
+
/** Current sort direction (display hint). */
|
|
73
|
+
sortDirection?: 'asc' | 'desc';
|
|
74
|
+
/** Additional CSS classes applied to the table root. */
|
|
75
|
+
className?: string;
|
|
76
|
+
/** Message shown when there are no rows. */
|
|
77
|
+
emptyMessage?: string;
|
|
78
|
+
/** Loading state. */
|
|
79
|
+
isLoading?: boolean;
|
|
80
|
+
/** Error state. */
|
|
81
|
+
error?: Error | null;
|
|
82
|
+
/** Group rows under section headers by a field value. */
|
|
83
|
+
groupBy?: string;
|
|
84
|
+
/** Max rows before a "Show More" button. Defaults to 0 (show all). */
|
|
85
|
+
pageSize?: number;
|
|
86
|
+
/**
|
|
87
|
+
* Custom per-row render. When provided, the whole row content is delegated
|
|
88
|
+
* to this function (columns are ignored for the body; the header still
|
|
89
|
+
* renders). Mirrors DataList's children render prop.
|
|
90
|
+
*/
|
|
91
|
+
children?: (item: T, index: number) => React.ReactNode;
|
|
92
|
+
/**
|
|
93
|
+
* Per-row render function (schema alias). In .orb: ["fn","item",{...}].
|
|
94
|
+
* The compiler converts this to the children render prop.
|
|
95
|
+
* @deprecated Use children in React code; exists for pattern registry sync.
|
|
96
|
+
*/
|
|
97
|
+
renderItem?: (item: T, index: number) => React.ReactNode;
|
|
98
|
+
/**
|
|
99
|
+
* Layer 2 visual treatment — mirrors the data-list / entity-table look enum
|
|
100
|
+
* so authors share one knob name across row renderers.
|
|
101
|
+
*/
|
|
102
|
+
look?: 'dense' | 'spacious' | 'striped' | 'borderless' | 'bordered';
|
|
103
|
+
}
|
|
104
|
+
export declare function TableView<T extends EntityRow = EntityRow>({ entity, columns, fields, itemActions, selectable, selectEvent, selectedIds, sortEvent, sortColumn, sortDirection, className, emptyMessage, isLoading, error, groupBy, pageSize, children, renderItem: _schemaRenderItem, look, dragGroup, accepts, sortable, dropEvent, reorderEvent, positionEvent, dndItemIdField, dndRoot, }: TableViewProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
105
|
+
export declare namespace TableView {
|
|
106
|
+
var displayName: string;
|
|
107
|
+
}
|
|
@@ -53,6 +53,7 @@ export { UploadDropZone, type UploadDropZoneProps } from './UploadDropZone';
|
|
|
53
53
|
export { Lightbox, type LightboxProps, type LightboxImage } from './Lightbox';
|
|
54
54
|
export { DataGrid, type DataGridProps, type DataGridField, type DataGridItemAction } from './DataGrid';
|
|
55
55
|
export { DataList, type DataListProps, type DataListField, type DataListItemAction } from './DataList';
|
|
56
|
+
export { TableView, type TableViewProps, type TableViewColumn } from './TableView';
|
|
56
57
|
export { StatDisplay, type StatDisplayProps } from './StatDisplay';
|
|
57
58
|
export { Meter, type MeterProps, type MeterVariant, type MeterThreshold, type MeterAction } from './Meter';
|
|
58
59
|
export { SwipeableRow, type SwipeableRowProps, type SwipeAction } from './SwipeableRow';
|
package/dist/docs/index.d.cts
CHANGED
|
@@ -16,6 +16,8 @@ type BoxBg = "transparent" | "primary" | "secondary" | "muted" | "accent" | "sur
|
|
|
16
16
|
type BoxRounded = "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
17
17
|
type BoxShadow = "none" | "sm" | "md" | "lg" | "xl";
|
|
18
18
|
interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
/** Additional CSS classes applied to the root element. */
|
|
20
|
+
className?: string;
|
|
19
21
|
/** Padding on all sides */
|
|
20
22
|
padding?: BoxPadding;
|
|
21
23
|
/** Horizontal padding (overrides padding for x-axis) */
|
|
@@ -169,6 +171,8 @@ declare const Typography: React.FC<TypographyProps>;
|
|
|
169
171
|
type ButtonVariant = "primary" | "secondary" | "ghost" | "danger" | "success" | "warning" | "default";
|
|
170
172
|
type ButtonSize = "sm" | "md" | "lg";
|
|
171
173
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
174
|
+
/** Additional CSS classes applied to the root element. */
|
|
175
|
+
className?: string;
|
|
172
176
|
variant?: ButtonVariant;
|
|
173
177
|
size?: ButtonSize;
|
|
174
178
|
isLoading?: boolean;
|
|
@@ -234,6 +238,8 @@ type CardShadow = "none" | "sm" | "md" | "lg";
|
|
|
234
238
|
*/
|
|
235
239
|
type CardLook = "elevated" | "flat-bordered" | "borderless-divider" | "ticket" | "invoice" | "chip" | "tile-image-first";
|
|
236
240
|
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
241
|
+
/** Additional CSS classes applied to the root element. */
|
|
242
|
+
className?: string;
|
|
237
243
|
variant?: "default" | "bordered" | "elevated" | "interactive";
|
|
238
244
|
padding?: "none" | "sm" | "md" | "lg";
|
|
239
245
|
/** Card title - renders in header if provided */
|
|
@@ -284,6 +290,8 @@ interface SelectOption {
|
|
|
284
290
|
label: string;
|
|
285
291
|
}
|
|
286
292
|
interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "onChange"> {
|
|
293
|
+
/** Additional CSS classes applied to the root element. */
|
|
294
|
+
className?: string;
|
|
287
295
|
/** Placeholder text */
|
|
288
296
|
placeholder?: string;
|
|
289
297
|
/** Current value */
|
|
@@ -15,6 +15,8 @@ type BoxBg = "transparent" | "primary" | "secondary" | "muted" | "accent" | "sur
|
|
|
15
15
|
type BoxRounded = "none" | "sm" | "md" | "lg" | "xl" | "2xl" | "full";
|
|
16
16
|
type BoxShadow = "none" | "sm" | "md" | "lg" | "xl";
|
|
17
17
|
interface BoxProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
18
|
+
/** Additional CSS classes applied to the root element. */
|
|
19
|
+
className?: string;
|
|
18
20
|
/** Padding on all sides */
|
|
19
21
|
padding?: BoxPadding;
|
|
20
22
|
/** Horizontal padding (overrides padding for x-axis) */
|
|
@@ -168,6 +170,8 @@ declare const Typography: React.FC<TypographyProps>;
|
|
|
168
170
|
type ButtonVariant = "primary" | "secondary" | "ghost" | "danger" | "success" | "warning" | "default";
|
|
169
171
|
type ButtonSize = "sm" | "md" | "lg";
|
|
170
172
|
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
173
|
+
/** Additional CSS classes applied to the root element. */
|
|
174
|
+
className?: string;
|
|
171
175
|
variant?: ButtonVariant;
|
|
172
176
|
size?: ButtonSize;
|
|
173
177
|
isLoading?: boolean;
|
|
@@ -193,6 +197,8 @@ declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAtt
|
|
|
193
197
|
type BadgeVariant = "default" | "primary" | "secondary" | "success" | "warning" | "danger" | "error" | "info" | "neutral";
|
|
194
198
|
type BadgeSize = "sm" | "md" | "lg";
|
|
195
199
|
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
200
|
+
/** Additional CSS classes applied to the root element. */
|
|
201
|
+
className?: string;
|
|
196
202
|
variant?: BadgeVariant;
|
|
197
203
|
size?: BadgeSize;
|
|
198
204
|
/** Numeric count or amount to display in badge */
|
|
@@ -256,6 +262,8 @@ type CardShadow = "none" | "sm" | "md" | "lg";
|
|
|
256
262
|
*/
|
|
257
263
|
type CardLook = "elevated" | "flat-bordered" | "borderless-divider" | "ticket" | "invoice" | "chip" | "tile-image-first";
|
|
258
264
|
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
265
|
+
/** Additional CSS classes applied to the root element. */
|
|
266
|
+
className?: string;
|
|
259
267
|
variant?: "default" | "bordered" | "elevated" | "interactive";
|
|
260
268
|
padding?: "none" | "sm" | "md" | "lg";
|
|
261
269
|
/** Card title - renders in header if provided */
|
|
@@ -859,6 +867,8 @@ declare const AnimatedCounter: React.FC<AnimatedCounterProps>;
|
|
|
859
867
|
type RevealTrigger = 'scroll' | 'hover' | 'manual';
|
|
860
868
|
type RevealAnimation = 'fade-up' | 'fade-down' | 'fade-in' | 'fade-left' | 'fade-right' | 'scale' | 'scale-up' | 'none';
|
|
861
869
|
interface AnimatedRevealProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
870
|
+
/** Additional CSS classes applied to the root element. */
|
|
871
|
+
className?: string;
|
|
862
872
|
/** What triggers the animation */
|
|
863
873
|
trigger?: RevealTrigger;
|
|
864
874
|
/** Built-in animation preset */
|
|
@@ -882,6 +892,8 @@ declare const AnimatedReveal: React.ForwardRefExoticComponent<AnimatedRevealProp
|
|
|
882
892
|
|
|
883
893
|
type GraphicAnimation = 'draw' | 'fill' | 'pulse' | 'morph';
|
|
884
894
|
interface AnimatedGraphicProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
895
|
+
/** Additional CSS classes applied to the root element. */
|
|
896
|
+
className?: string;
|
|
885
897
|
/** URL to an SVG file. Fetched and inlined to enable stroke/fill animations. */
|
|
886
898
|
src?: string;
|
|
887
899
|
/** Inline SVG string. Takes precedence over src if both provided. */
|