@almadar/ui 5.128.0 → 5.130.0
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 +349 -11
- package/dist/avl/index.js +349 -11
- package/dist/components/index.cjs +352 -11
- package/dist/components/index.d.cts +119 -5
- package/dist/components/index.d.ts +119 -5
- package/dist/components/index.js +353 -12
- package/dist/providers/index.cjs +349 -11
- package/dist/providers/index.js +349 -11
- package/dist/runtime/index.cjs +349 -11
- package/dist/runtime/index.js +349 -11
- package/package.json +6 -5
- package/scripts/audit-tailwind-safelist.ts +237 -0
- package/scripts/export-static.js +61 -0
- package/scripts/generate-design-system.ts +344 -0
- package/scripts/generate-theme-from-schema.ts +480 -0
- package/scripts/generate.ts +835 -0
- package/scripts/strip-base-tokens-from-themes.mjs +179 -0
- package/scripts/suggest-components.ts +508 -0
- package/scripts/theme-contrast-audit.mjs +132 -0
- package/scripts/types.ts +282 -0
- package/themes/_contract.md +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -26549,7 +26549,7 @@ var init_useQuerySingleton = __esm({
|
|
|
26549
26549
|
queryStores = /* @__PURE__ */ new Map();
|
|
26550
26550
|
}
|
|
26551
26551
|
});
|
|
26552
|
-
var resolveFilterType, lookStyles6, FilterGroup;
|
|
26552
|
+
var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
|
|
26553
26553
|
var init_FilterGroup = __esm({
|
|
26554
26554
|
"components/core/molecules/FilterGroup.tsx"() {
|
|
26555
26555
|
"use client";
|
|
@@ -26567,10 +26567,10 @@ var init_FilterGroup = __esm({
|
|
|
26567
26567
|
toolbar: "",
|
|
26568
26568
|
chips: "gap-1 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill [&_input]:!px-3 [&_select]:!px-3 [&_input]:bg-muted [&_select]:bg-muted [&_label]:hidden",
|
|
26569
26569
|
pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
|
|
26570
|
-
"popover-trigger": "
|
|
26570
|
+
"popover-trigger": "",
|
|
26571
26571
|
"inline-column-header": "hidden"
|
|
26572
26572
|
};
|
|
26573
|
-
|
|
26573
|
+
FilterGroupControls = ({
|
|
26574
26574
|
entity,
|
|
26575
26575
|
filters,
|
|
26576
26576
|
onFilterChange,
|
|
@@ -26906,7 +26906,7 @@ var init_FilterGroup = __esm({
|
|
|
26906
26906
|
className: "text-muted-foreground",
|
|
26907
26907
|
children: [
|
|
26908
26908
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "filter", className: "h-4 w-4" }),
|
|
26909
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
26909
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
|
|
26910
26910
|
]
|
|
26911
26911
|
}
|
|
26912
26912
|
),
|
|
@@ -26997,6 +26997,42 @@ var init_FilterGroup = __esm({
|
|
|
26997
26997
|
}
|
|
26998
26998
|
);
|
|
26999
26999
|
};
|
|
27000
|
+
FilterGroupControls.displayName = "FilterGroupControls";
|
|
27001
|
+
FilterGroupPopover = (props) => {
|
|
27002
|
+
const { t } = hooks.useTranslate();
|
|
27003
|
+
const [open, setOpen] = React91.useState(false);
|
|
27004
|
+
const queryState = useQuerySingleton(props.query);
|
|
27005
|
+
const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
|
|
27006
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative inline-block", props.className), children: [
|
|
27007
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
27008
|
+
Button,
|
|
27009
|
+
{
|
|
27010
|
+
variant: activeFilterCount > 0 ? "secondary" : "ghost",
|
|
27011
|
+
size: "sm",
|
|
27012
|
+
leftIcon: "filter",
|
|
27013
|
+
onClick: () => setOpen((o) => !o),
|
|
27014
|
+
"aria-expanded": open,
|
|
27015
|
+
"aria-haspopup": "true",
|
|
27016
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
27017
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: t("filterGroup.filters") }),
|
|
27018
|
+
activeFilterCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
|
|
27019
|
+
] })
|
|
27020
|
+
}
|
|
27021
|
+
),
|
|
27022
|
+
open && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute left-0 z-50 mt-2 min-w-[16rem] rounded-lg border border-[var(--color-border)] bg-[var(--color-card)] p-card-md shadow-main", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
27023
|
+
FilterGroupControls,
|
|
27024
|
+
{
|
|
27025
|
+
...props,
|
|
27026
|
+
className: void 0,
|
|
27027
|
+
look: "toolbar",
|
|
27028
|
+
variant: "vertical",
|
|
27029
|
+
showIcon: false
|
|
27030
|
+
}
|
|
27031
|
+
) })
|
|
27032
|
+
] });
|
|
27033
|
+
};
|
|
27034
|
+
FilterGroupPopover.displayName = "FilterGroupPopover";
|
|
27035
|
+
FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsxRuntime.jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(FilterGroupControls, { ...props });
|
|
27000
27036
|
FilterGroup.displayName = "FilterGroup";
|
|
27001
27037
|
}
|
|
27002
27038
|
});
|
|
@@ -29654,12 +29690,12 @@ var init_MapView = __esm({
|
|
|
29654
29690
|
shadowSize: [41, 41]
|
|
29655
29691
|
});
|
|
29656
29692
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
29657
|
-
const { useEffect: useEffect63, useRef:
|
|
29693
|
+
const { useEffect: useEffect63, useRef: useRef62, useCallback: useCallback93, useState: useState97 } = React91__namespace.default;
|
|
29658
29694
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
29659
29695
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
29660
29696
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
29661
29697
|
const map = useMap();
|
|
29662
|
-
const prevRef =
|
|
29698
|
+
const prevRef = useRef62({ centerLat, centerLng, zoom });
|
|
29663
29699
|
useEffect63(() => {
|
|
29664
29700
|
const prev = prevRef.current;
|
|
29665
29701
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
@@ -30638,9 +30674,19 @@ function TableView({
|
|
|
30638
30674
|
const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
|
|
30639
30675
|
const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
|
|
30640
30676
|
const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
|
|
30677
|
+
const colFloors = React91__namespace.default.useMemo(
|
|
30678
|
+
() => colDefs.map((col) => {
|
|
30679
|
+
const longest = data.reduce((widest, row) => {
|
|
30680
|
+
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
30681
|
+
return Math.max(widest, cell.length);
|
|
30682
|
+
}, columnLabel(col).length);
|
|
30683
|
+
return Math.min(longest, MAX_MEASURED_COL_CH);
|
|
30684
|
+
}),
|
|
30685
|
+
[colDefs, data]
|
|
30686
|
+
);
|
|
30641
30687
|
const gridTemplateColumns = [
|
|
30642
30688
|
selectable ? "auto" : null,
|
|
30643
|
-
...colDefs.map((c) => c.width ??
|
|
30689
|
+
...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
|
|
30644
30690
|
actionsTrack
|
|
30645
30691
|
].filter(Boolean).join(" ");
|
|
30646
30692
|
const header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -30807,7 +30853,7 @@ function TableView({
|
|
|
30807
30853
|
}
|
|
30808
30854
|
);
|
|
30809
30855
|
}
|
|
30810
|
-
var alignClass, weightClass, LOOKS;
|
|
30856
|
+
var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
|
|
30811
30857
|
var init_TableView = __esm({
|
|
30812
30858
|
"components/core/molecules/TableView.tsx"() {
|
|
30813
30859
|
"use client";
|
|
@@ -30825,6 +30871,7 @@ var init_TableView = __esm({
|
|
|
30825
30871
|
init_Menu();
|
|
30826
30872
|
init_useDataDnd();
|
|
30827
30873
|
logger.createLogger("almadar:ui:table-view");
|
|
30874
|
+
MAX_MEASURED_COL_CH = 32;
|
|
30828
30875
|
alignClass = {
|
|
30829
30876
|
left: "justify-start text-left",
|
|
30830
30877
|
center: "justify-center text-center",
|
|
@@ -38440,6 +38487,290 @@ var init_GraphCanvas = __esm({
|
|
|
38440
38487
|
GraphCanvas.displayName = "GraphCanvas";
|
|
38441
38488
|
}
|
|
38442
38489
|
});
|
|
38490
|
+
var ImportSourcePicker;
|
|
38491
|
+
var init_ImportSourcePicker = __esm({
|
|
38492
|
+
"components/core/molecules/import/ImportSourcePicker.tsx"() {
|
|
38493
|
+
"use client";
|
|
38494
|
+
init_Box();
|
|
38495
|
+
init_Icon();
|
|
38496
|
+
init_Typography();
|
|
38497
|
+
init_cn();
|
|
38498
|
+
ImportSourcePicker = ({
|
|
38499
|
+
sources,
|
|
38500
|
+
onSelect,
|
|
38501
|
+
onFilesSelected,
|
|
38502
|
+
title,
|
|
38503
|
+
moreSources,
|
|
38504
|
+
className
|
|
38505
|
+
}) => {
|
|
38506
|
+
const fileInputRef = React91.useRef(null);
|
|
38507
|
+
const handlePick = (source) => {
|
|
38508
|
+
if (source.disabled) return;
|
|
38509
|
+
if (source.kind === "file") {
|
|
38510
|
+
const input = fileInputRef.current;
|
|
38511
|
+
if (!input) return;
|
|
38512
|
+
input.accept = source.accept ?? "";
|
|
38513
|
+
input.multiple = source.multiple ?? false;
|
|
38514
|
+
input.click();
|
|
38515
|
+
return;
|
|
38516
|
+
}
|
|
38517
|
+
onSelect?.(source.id);
|
|
38518
|
+
};
|
|
38519
|
+
const handleFiles = (event) => {
|
|
38520
|
+
const files = event.target.files ? Array.from(event.target.files) : [];
|
|
38521
|
+
event.target.value = "";
|
|
38522
|
+
if (files.length > 0) onFilesSelected?.(files);
|
|
38523
|
+
};
|
|
38524
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("flex flex-col gap-2", className), children: [
|
|
38525
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h4", children: title }) : null,
|
|
38526
|
+
sources.map((source) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
38527
|
+
Box,
|
|
38528
|
+
{
|
|
38529
|
+
role: "button",
|
|
38530
|
+
tabIndex: source.disabled ? -1 : 0,
|
|
38531
|
+
"aria-disabled": source.disabled,
|
|
38532
|
+
onClick: () => handlePick(source),
|
|
38533
|
+
onKeyDown: (event) => {
|
|
38534
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
38535
|
+
event.preventDefault();
|
|
38536
|
+
handlePick(source);
|
|
38537
|
+
}
|
|
38538
|
+
},
|
|
38539
|
+
className: cn(
|
|
38540
|
+
"flex items-center gap-3 rounded-md border border-border bg-card px-4 py-3 text-left",
|
|
38541
|
+
source.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-accent hover:text-accent-foreground"
|
|
38542
|
+
),
|
|
38543
|
+
children: [
|
|
38544
|
+
source.icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: source.icon, size: "md" }) : null,
|
|
38545
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex flex-col", children: [
|
|
38546
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "label", children: source.label }),
|
|
38547
|
+
source.description ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: source.description }) : null
|
|
38548
|
+
] })
|
|
38549
|
+
]
|
|
38550
|
+
},
|
|
38551
|
+
source.id
|
|
38552
|
+
)),
|
|
38553
|
+
moreSources,
|
|
38554
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38555
|
+
"input",
|
|
38556
|
+
{
|
|
38557
|
+
ref: fileInputRef,
|
|
38558
|
+
type: "file",
|
|
38559
|
+
className: "hidden",
|
|
38560
|
+
onChange: handleFiles,
|
|
38561
|
+
"data-testid": "import-source-file-input"
|
|
38562
|
+
}
|
|
38563
|
+
)
|
|
38564
|
+
] });
|
|
38565
|
+
};
|
|
38566
|
+
}
|
|
38567
|
+
});
|
|
38568
|
+
function formatFieldValue(value) {
|
|
38569
|
+
if (value === null) return "\u2014";
|
|
38570
|
+
if (value instanceof Date) return value.toISOString();
|
|
38571
|
+
if (Array.isArray(value)) return value.map(formatFieldValue).join(", ");
|
|
38572
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
38573
|
+
return String(value);
|
|
38574
|
+
}
|
|
38575
|
+
function unitTitle(unit) {
|
|
38576
|
+
for (const key of TITLE_KEYS) {
|
|
38577
|
+
const value = unit.fields[key];
|
|
38578
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
38579
|
+
}
|
|
38580
|
+
return unit.ref;
|
|
38581
|
+
}
|
|
38582
|
+
function fieldSummary(unit) {
|
|
38583
|
+
return Object.entries(unit.fields).filter(([key]) => !TITLE_KEYS.includes(key)).map(([key, value]) => `${key}: ${formatFieldValue(value)}`).join(" \xB7 ");
|
|
38584
|
+
}
|
|
38585
|
+
var TITLE_KEYS, ImportPreviewTree;
|
|
38586
|
+
var init_ImportPreviewTree = __esm({
|
|
38587
|
+
"components/core/molecules/import/ImportPreviewTree.tsx"() {
|
|
38588
|
+
"use client";
|
|
38589
|
+
init_Box();
|
|
38590
|
+
init_Badge();
|
|
38591
|
+
init_Button();
|
|
38592
|
+
init_Icon();
|
|
38593
|
+
init_Typography();
|
|
38594
|
+
init_cn();
|
|
38595
|
+
TITLE_KEYS = ["title", "name", "label"];
|
|
38596
|
+
ImportPreviewTree = ({
|
|
38597
|
+
units,
|
|
38598
|
+
skipped = [],
|
|
38599
|
+
entityDisplay,
|
|
38600
|
+
onConfirm,
|
|
38601
|
+
onCancel,
|
|
38602
|
+
confirmLabel = "Confirm import",
|
|
38603
|
+
cancelLabel = "Cancel",
|
|
38604
|
+
indent = 16,
|
|
38605
|
+
className
|
|
38606
|
+
}) => {
|
|
38607
|
+
const groups = /* @__PURE__ */ new Map();
|
|
38608
|
+
for (const unit of units) {
|
|
38609
|
+
const group = groups.get(unit.targetEntity);
|
|
38610
|
+
if (group) group.push(unit);
|
|
38611
|
+
else groups.set(unit.targetEntity, [unit]);
|
|
38612
|
+
}
|
|
38613
|
+
const renderUnit = (unit, childrenByParent, depth) => {
|
|
38614
|
+
const summary = fieldSummary(unit);
|
|
38615
|
+
const children = childrenByParent.get(unit.ref) ?? [];
|
|
38616
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React91__namespace.default.Fragment, { children: [
|
|
38617
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
38618
|
+
Box,
|
|
38619
|
+
{
|
|
38620
|
+
className: "flex flex-col py-1",
|
|
38621
|
+
style: { paddingLeft: depth * indent },
|
|
38622
|
+
"data-testid": `import-preview-unit-${unit.ref}`,
|
|
38623
|
+
children: [
|
|
38624
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
38625
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: "file-text", size: "xs", className: "text-muted-foreground" }),
|
|
38626
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", children: unitTitle(unit) })
|
|
38627
|
+
] }),
|
|
38628
|
+
summary ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: summary }) : null
|
|
38629
|
+
]
|
|
38630
|
+
}
|
|
38631
|
+
),
|
|
38632
|
+
children.map((child) => renderUnit(child, childrenByParent, depth + 1))
|
|
38633
|
+
] }, unit.ref);
|
|
38634
|
+
};
|
|
38635
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("flex flex-col gap-4", className), children: [
|
|
38636
|
+
units.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", className: "text-muted-foreground", children: "No units staged." }) : null,
|
|
38637
|
+
Array.from(groups.entries()).map(([entity, groupUnits]) => {
|
|
38638
|
+
const refs = new Set(groupUnits.map((unit) => unit.ref));
|
|
38639
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
38640
|
+
const roots = [];
|
|
38641
|
+
for (const unit of groupUnits) {
|
|
38642
|
+
if (unit.parentRef && refs.has(unit.parentRef)) {
|
|
38643
|
+
const siblings = childrenByParent.get(unit.parentRef);
|
|
38644
|
+
if (siblings) siblings.push(unit);
|
|
38645
|
+
else childrenByParent.set(unit.parentRef, [unit]);
|
|
38646
|
+
} else {
|
|
38647
|
+
roots.push(unit);
|
|
38648
|
+
}
|
|
38649
|
+
}
|
|
38650
|
+
const label = entityDisplay[entity]?.plural ?? entity;
|
|
38651
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { border: true, className: "rounded-md border-border bg-card p-3", children: [
|
|
38652
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2 pb-2", children: [
|
|
38653
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "label", children: label }),
|
|
38654
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { amount: groupUnits.length })
|
|
38655
|
+
] }),
|
|
38656
|
+
roots.map((unit) => renderUnit(unit, childrenByParent, 0))
|
|
38657
|
+
] }, entity);
|
|
38658
|
+
}),
|
|
38659
|
+
skipped.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(Box, { border: true, className: "rounded-md border-border bg-card p-3", children: [
|
|
38660
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2 pb-2", children: [
|
|
38661
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "label", children: "Skipped" }),
|
|
38662
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { amount: skipped.length })
|
|
38663
|
+
] }),
|
|
38664
|
+
skipped.map((element) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-baseline gap-2 py-1", children: [
|
|
38665
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", children: element.ref }),
|
|
38666
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: element.reason })
|
|
38667
|
+
] }, element.ref))
|
|
38668
|
+
] }) : null,
|
|
38669
|
+
onConfirm || onCancel ? /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center justify-end gap-2", children: [
|
|
38670
|
+
onCancel ? /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "default", label: cancelLabel, onClick: onCancel }) : null,
|
|
38671
|
+
onConfirm ? /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", label: confirmLabel, onClick: onConfirm }) : null
|
|
38672
|
+
] }) : null
|
|
38673
|
+
] });
|
|
38674
|
+
};
|
|
38675
|
+
}
|
|
38676
|
+
});
|
|
38677
|
+
var PIPELINE, DEFAULT_LABELS, ImportProgress;
|
|
38678
|
+
var init_ImportProgress = __esm({
|
|
38679
|
+
"components/core/molecules/import/ImportProgress.tsx"() {
|
|
38680
|
+
"use client";
|
|
38681
|
+
init_Box();
|
|
38682
|
+
init_Badge();
|
|
38683
|
+
init_Icon();
|
|
38684
|
+
init_Typography();
|
|
38685
|
+
init_cn();
|
|
38686
|
+
PIPELINE = [
|
|
38687
|
+
"fetching",
|
|
38688
|
+
"mapping",
|
|
38689
|
+
"reviewing",
|
|
38690
|
+
"committing"
|
|
38691
|
+
];
|
|
38692
|
+
DEFAULT_LABELS = {
|
|
38693
|
+
fetching: "Fetching",
|
|
38694
|
+
mapping: "Mapping",
|
|
38695
|
+
reviewing: "Reviewing",
|
|
38696
|
+
committing: "Committing",
|
|
38697
|
+
done: "Done",
|
|
38698
|
+
failed: "Failed"
|
|
38699
|
+
};
|
|
38700
|
+
ImportProgress = ({
|
|
38701
|
+
step,
|
|
38702
|
+
counts,
|
|
38703
|
+
labels,
|
|
38704
|
+
className
|
|
38705
|
+
}) => {
|
|
38706
|
+
const label = (key) => labels?.[key] ?? DEFAULT_LABELS[key];
|
|
38707
|
+
const currentIndex = step === "done" || step === "failed" ? PIPELINE.length : PIPELINE.indexOf(step);
|
|
38708
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("flex flex-col gap-3", className), children: [
|
|
38709
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
38710
|
+
PIPELINE.map((key, index) => {
|
|
38711
|
+
const isComplete = index < currentIndex;
|
|
38712
|
+
const isActive = index === currentIndex;
|
|
38713
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React91__namespace.default.Fragment, { children: [
|
|
38714
|
+
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
38715
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
38716
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38717
|
+
Icon,
|
|
38718
|
+
{
|
|
38719
|
+
icon: isComplete ? "check" : isActive ? "loader" : "circle",
|
|
38720
|
+
size: "sm",
|
|
38721
|
+
className: cn(
|
|
38722
|
+
isComplete ? "text-success" : isActive ? "text-primary" : "text-muted-foreground"
|
|
38723
|
+
)
|
|
38724
|
+
}
|
|
38725
|
+
),
|
|
38726
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38727
|
+
Typography,
|
|
38728
|
+
{
|
|
38729
|
+
variant: "caption",
|
|
38730
|
+
className: cn(isActive ? "text-foreground" : "text-muted-foreground"),
|
|
38731
|
+
children: label(key)
|
|
38732
|
+
}
|
|
38733
|
+
)
|
|
38734
|
+
] })
|
|
38735
|
+
] }, key);
|
|
38736
|
+
}),
|
|
38737
|
+
step === "done" || step === "failed" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
38738
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-px w-4 bg-border" }),
|
|
38739
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${step}`, children: [
|
|
38740
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38741
|
+
Icon,
|
|
38742
|
+
{
|
|
38743
|
+
icon: step === "done" ? "check" : "x",
|
|
38744
|
+
size: "sm",
|
|
38745
|
+
className: step === "done" ? "text-success" : "text-error"
|
|
38746
|
+
}
|
|
38747
|
+
),
|
|
38748
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
38749
|
+
Typography,
|
|
38750
|
+
{
|
|
38751
|
+
variant: "caption",
|
|
38752
|
+
className: step === "done" ? "text-success" : "text-error",
|
|
38753
|
+
children: label(step)
|
|
38754
|
+
}
|
|
38755
|
+
)
|
|
38756
|
+
] })
|
|
38757
|
+
] }) : null
|
|
38758
|
+
] }),
|
|
38759
|
+
counts ? /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
38760
|
+
counts.staged !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { label: `Staged ${counts.staged}` }) : null,
|
|
38761
|
+
counts.committed !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", label: `Committed ${counts.committed}` }) : null,
|
|
38762
|
+
counts.failed !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "danger", label: `Failed ${counts.failed}` }) : null
|
|
38763
|
+
] }) : null
|
|
38764
|
+
] });
|
|
38765
|
+
};
|
|
38766
|
+
}
|
|
38767
|
+
});
|
|
38768
|
+
|
|
38769
|
+
// components/core/molecules/import/index.ts
|
|
38770
|
+
var init_import = __esm({
|
|
38771
|
+
"components/core/molecules/import/index.ts"() {
|
|
38772
|
+
}
|
|
38773
|
+
});
|
|
38443
38774
|
var ReflectionBlock;
|
|
38444
38775
|
var init_ReflectionBlock = __esm({
|
|
38445
38776
|
"components/core/molecules/ReflectionBlock.tsx"() {
|
|
@@ -38514,6 +38845,7 @@ var init_molecules2 = __esm({
|
|
|
38514
38845
|
init_EmptyState();
|
|
38515
38846
|
init_Pagination();
|
|
38516
38847
|
init_molecules();
|
|
38848
|
+
init_import();
|
|
38517
38849
|
}
|
|
38518
38850
|
});
|
|
38519
38851
|
|
|
@@ -38994,7 +39326,7 @@ function getBadgeVariant(fieldName, value) {
|
|
|
38994
39326
|
function formatFieldLabel(fieldName) {
|
|
38995
39327
|
return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase());
|
|
38996
39328
|
}
|
|
38997
|
-
function
|
|
39329
|
+
function formatFieldValue2(value, fieldName) {
|
|
38998
39330
|
if (typeof value === "number") {
|
|
38999
39331
|
if (fieldName.toLowerCase().includes("progress") || fieldName.toLowerCase().includes("percent")) {
|
|
39000
39332
|
return `${value}%`;
|
|
@@ -39089,7 +39421,7 @@ function renderRichFieldValue(value, fieldName, fieldType) {
|
|
|
39089
39421
|
return str;
|
|
39090
39422
|
}
|
|
39091
39423
|
default:
|
|
39092
|
-
return
|
|
39424
|
+
return formatFieldValue2(value, fieldName);
|
|
39093
39425
|
}
|
|
39094
39426
|
}
|
|
39095
39427
|
function normalizeFieldDefs(fields) {
|
|
@@ -39200,7 +39532,7 @@ var init_DetailPanel = __esm({
|
|
|
39200
39532
|
const value = getNestedValue(normalizedData, field);
|
|
39201
39533
|
return {
|
|
39202
39534
|
label: labelFor(field),
|
|
39203
|
-
value:
|
|
39535
|
+
value: formatFieldValue2(value, field),
|
|
39204
39536
|
icon: getFieldIcon(field)
|
|
39205
39537
|
};
|
|
39206
39538
|
}
|
|
@@ -45231,6 +45563,9 @@ var init_component_registry_generated = __esm({
|
|
|
45231
45563
|
init_HeroOrganism();
|
|
45232
45564
|
init_HeroSection();
|
|
45233
45565
|
init_Icon();
|
|
45566
|
+
init_ImportPreviewTree();
|
|
45567
|
+
init_ImportProgress();
|
|
45568
|
+
init_ImportSourcePicker();
|
|
45234
45569
|
init_InfiniteScrollSentinel();
|
|
45235
45570
|
init_Input();
|
|
45236
45571
|
init_InputGroup();
|
|
@@ -45494,6 +45829,9 @@ var init_component_registry_generated = __esm({
|
|
|
45494
45829
|
"HeroOrganism": HeroOrganism,
|
|
45495
45830
|
"HeroSection": HeroSection,
|
|
45496
45831
|
"Icon": Icon,
|
|
45832
|
+
"ImportPreviewTree": ImportPreviewTree,
|
|
45833
|
+
"ImportProgress": ImportProgress,
|
|
45834
|
+
"ImportSourcePicker": ImportSourcePicker,
|
|
45497
45835
|
"InfiniteScrollSentinel": InfiniteScrollSentinel,
|
|
45498
45836
|
"Input": Input,
|
|
45499
45837
|
"InputGroup": InputGroup,
|