@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/providers/index.cjs
CHANGED
|
@@ -24283,7 +24283,7 @@ var init_useQuerySingleton = __esm({
|
|
|
24283
24283
|
queryStores = /* @__PURE__ */ new Map();
|
|
24284
24284
|
}
|
|
24285
24285
|
});
|
|
24286
|
-
var resolveFilterType, lookStyles6, FilterGroup;
|
|
24286
|
+
var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
|
|
24287
24287
|
var init_FilterGroup = __esm({
|
|
24288
24288
|
"components/core/molecules/FilterGroup.tsx"() {
|
|
24289
24289
|
"use client";
|
|
@@ -24301,10 +24301,10 @@ var init_FilterGroup = __esm({
|
|
|
24301
24301
|
toolbar: "",
|
|
24302
24302
|
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",
|
|
24303
24303
|
pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
|
|
24304
|
-
"popover-trigger": "
|
|
24304
|
+
"popover-trigger": "",
|
|
24305
24305
|
"inline-column-header": "hidden"
|
|
24306
24306
|
};
|
|
24307
|
-
|
|
24307
|
+
FilterGroupControls = ({
|
|
24308
24308
|
entity,
|
|
24309
24309
|
filters,
|
|
24310
24310
|
onFilterChange,
|
|
@@ -24640,7 +24640,7 @@ var init_FilterGroup = __esm({
|
|
|
24640
24640
|
className: "text-muted-foreground",
|
|
24641
24641
|
children: [
|
|
24642
24642
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "filter", className: "h-4 w-4" }),
|
|
24643
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
24643
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
|
|
24644
24644
|
]
|
|
24645
24645
|
}
|
|
24646
24646
|
),
|
|
@@ -24731,6 +24731,42 @@ var init_FilterGroup = __esm({
|
|
|
24731
24731
|
}
|
|
24732
24732
|
);
|
|
24733
24733
|
};
|
|
24734
|
+
FilterGroupControls.displayName = "FilterGroupControls";
|
|
24735
|
+
FilterGroupPopover = (props) => {
|
|
24736
|
+
const { t } = hooks.useTranslate();
|
|
24737
|
+
const [open, setOpen] = React84.useState(false);
|
|
24738
|
+
const queryState = useQuerySingleton(props.query);
|
|
24739
|
+
const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
|
|
24740
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative inline-block", props.className), children: [
|
|
24741
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24742
|
+
Button,
|
|
24743
|
+
{
|
|
24744
|
+
variant: activeFilterCount > 0 ? "secondary" : "ghost",
|
|
24745
|
+
size: "sm",
|
|
24746
|
+
leftIcon: "filter",
|
|
24747
|
+
onClick: () => setOpen((o) => !o),
|
|
24748
|
+
"aria-expanded": open,
|
|
24749
|
+
"aria-haspopup": "true",
|
|
24750
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
24751
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: t("filterGroup.filters") }),
|
|
24752
|
+
activeFilterCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
|
|
24753
|
+
] })
|
|
24754
|
+
}
|
|
24755
|
+
),
|
|
24756
|
+
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(
|
|
24757
|
+
FilterGroupControls,
|
|
24758
|
+
{
|
|
24759
|
+
...props,
|
|
24760
|
+
className: void 0,
|
|
24761
|
+
look: "toolbar",
|
|
24762
|
+
variant: "vertical",
|
|
24763
|
+
showIcon: false
|
|
24764
|
+
}
|
|
24765
|
+
) })
|
|
24766
|
+
] });
|
|
24767
|
+
};
|
|
24768
|
+
FilterGroupPopover.displayName = "FilterGroupPopover";
|
|
24769
|
+
FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsxRuntime.jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(FilterGroupControls, { ...props });
|
|
24734
24770
|
FilterGroup.displayName = "FilterGroup";
|
|
24735
24771
|
}
|
|
24736
24772
|
});
|
|
@@ -27388,12 +27424,12 @@ var init_MapView = __esm({
|
|
|
27388
27424
|
shadowSize: [41, 41]
|
|
27389
27425
|
});
|
|
27390
27426
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
27391
|
-
const { useEffect: useEffect62, useRef:
|
|
27427
|
+
const { useEffect: useEffect62, useRef: useRef60, useCallback: useCallback93, useState: useState91 } = React84__namespace.default;
|
|
27392
27428
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
27393
27429
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
27394
27430
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
27395
27431
|
const map = useMap();
|
|
27396
|
-
const prevRef =
|
|
27432
|
+
const prevRef = useRef60({ centerLat, centerLng, zoom });
|
|
27397
27433
|
useEffect62(() => {
|
|
27398
27434
|
const prev = prevRef.current;
|
|
27399
27435
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
@@ -28372,9 +28408,19 @@ function TableView({
|
|
|
28372
28408
|
const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
|
|
28373
28409
|
const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
|
|
28374
28410
|
const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
|
|
28411
|
+
const colFloors = React84__namespace.default.useMemo(
|
|
28412
|
+
() => colDefs.map((col) => {
|
|
28413
|
+
const longest = data.reduce((widest, row) => {
|
|
28414
|
+
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
28415
|
+
return Math.max(widest, cell.length);
|
|
28416
|
+
}, columnLabel(col).length);
|
|
28417
|
+
return Math.min(longest, MAX_MEASURED_COL_CH);
|
|
28418
|
+
}),
|
|
28419
|
+
[colDefs, data]
|
|
28420
|
+
);
|
|
28375
28421
|
const gridTemplateColumns = [
|
|
28376
28422
|
selectable ? "auto" : null,
|
|
28377
|
-
...colDefs.map((c) => c.width ??
|
|
28423
|
+
...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
|
|
28378
28424
|
actionsTrack
|
|
28379
28425
|
].filter(Boolean).join(" ");
|
|
28380
28426
|
const header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -28541,7 +28587,7 @@ function TableView({
|
|
|
28541
28587
|
}
|
|
28542
28588
|
);
|
|
28543
28589
|
}
|
|
28544
|
-
var alignClass, weightClass, LOOKS;
|
|
28590
|
+
var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
|
|
28545
28591
|
var init_TableView = __esm({
|
|
28546
28592
|
"components/core/molecules/TableView.tsx"() {
|
|
28547
28593
|
"use client";
|
|
@@ -28559,6 +28605,7 @@ var init_TableView = __esm({
|
|
|
28559
28605
|
init_Menu();
|
|
28560
28606
|
init_useDataDnd();
|
|
28561
28607
|
logger.createLogger("almadar:ui:table-view");
|
|
28608
|
+
MAX_MEASURED_COL_CH = 32;
|
|
28562
28609
|
alignClass = {
|
|
28563
28610
|
left: "justify-start text-left",
|
|
28564
28611
|
center: "justify-center text-center",
|
|
@@ -36583,6 +36630,290 @@ var init_GraphCanvas = __esm({
|
|
|
36583
36630
|
GraphCanvas.displayName = "GraphCanvas";
|
|
36584
36631
|
}
|
|
36585
36632
|
});
|
|
36633
|
+
var ImportSourcePicker;
|
|
36634
|
+
var init_ImportSourcePicker = __esm({
|
|
36635
|
+
"components/core/molecules/import/ImportSourcePicker.tsx"() {
|
|
36636
|
+
"use client";
|
|
36637
|
+
init_Box();
|
|
36638
|
+
init_Icon();
|
|
36639
|
+
init_Typography();
|
|
36640
|
+
init_cn();
|
|
36641
|
+
ImportSourcePicker = ({
|
|
36642
|
+
sources,
|
|
36643
|
+
onSelect,
|
|
36644
|
+
onFilesSelected,
|
|
36645
|
+
title,
|
|
36646
|
+
moreSources,
|
|
36647
|
+
className
|
|
36648
|
+
}) => {
|
|
36649
|
+
const fileInputRef = React84.useRef(null);
|
|
36650
|
+
const handlePick = (source) => {
|
|
36651
|
+
if (source.disabled) return;
|
|
36652
|
+
if (source.kind === "file") {
|
|
36653
|
+
const input = fileInputRef.current;
|
|
36654
|
+
if (!input) return;
|
|
36655
|
+
input.accept = source.accept ?? "";
|
|
36656
|
+
input.multiple = source.multiple ?? false;
|
|
36657
|
+
input.click();
|
|
36658
|
+
return;
|
|
36659
|
+
}
|
|
36660
|
+
onSelect?.(source.id);
|
|
36661
|
+
};
|
|
36662
|
+
const handleFiles = (event) => {
|
|
36663
|
+
const files = event.target.files ? Array.from(event.target.files) : [];
|
|
36664
|
+
event.target.value = "";
|
|
36665
|
+
if (files.length > 0) onFilesSelected?.(files);
|
|
36666
|
+
};
|
|
36667
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("flex flex-col gap-2", className), children: [
|
|
36668
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h4", children: title }) : null,
|
|
36669
|
+
sources.map((source) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
36670
|
+
Box,
|
|
36671
|
+
{
|
|
36672
|
+
role: "button",
|
|
36673
|
+
tabIndex: source.disabled ? -1 : 0,
|
|
36674
|
+
"aria-disabled": source.disabled,
|
|
36675
|
+
onClick: () => handlePick(source),
|
|
36676
|
+
onKeyDown: (event) => {
|
|
36677
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
36678
|
+
event.preventDefault();
|
|
36679
|
+
handlePick(source);
|
|
36680
|
+
}
|
|
36681
|
+
},
|
|
36682
|
+
className: cn(
|
|
36683
|
+
"flex items-center gap-3 rounded-md border border-border bg-card px-4 py-3 text-left",
|
|
36684
|
+
source.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-accent hover:text-accent-foreground"
|
|
36685
|
+
),
|
|
36686
|
+
children: [
|
|
36687
|
+
source.icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: source.icon, size: "md" }) : null,
|
|
36688
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex flex-col", children: [
|
|
36689
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "label", children: source.label }),
|
|
36690
|
+
source.description ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: source.description }) : null
|
|
36691
|
+
] })
|
|
36692
|
+
]
|
|
36693
|
+
},
|
|
36694
|
+
source.id
|
|
36695
|
+
)),
|
|
36696
|
+
moreSources,
|
|
36697
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36698
|
+
"input",
|
|
36699
|
+
{
|
|
36700
|
+
ref: fileInputRef,
|
|
36701
|
+
type: "file",
|
|
36702
|
+
className: "hidden",
|
|
36703
|
+
onChange: handleFiles,
|
|
36704
|
+
"data-testid": "import-source-file-input"
|
|
36705
|
+
}
|
|
36706
|
+
)
|
|
36707
|
+
] });
|
|
36708
|
+
};
|
|
36709
|
+
}
|
|
36710
|
+
});
|
|
36711
|
+
function formatFieldValue(value) {
|
|
36712
|
+
if (value === null) return "\u2014";
|
|
36713
|
+
if (value instanceof Date) return value.toISOString();
|
|
36714
|
+
if (Array.isArray(value)) return value.map(formatFieldValue).join(", ");
|
|
36715
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
36716
|
+
return String(value);
|
|
36717
|
+
}
|
|
36718
|
+
function unitTitle(unit) {
|
|
36719
|
+
for (const key of TITLE_KEYS) {
|
|
36720
|
+
const value = unit.fields[key];
|
|
36721
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
36722
|
+
}
|
|
36723
|
+
return unit.ref;
|
|
36724
|
+
}
|
|
36725
|
+
function fieldSummary(unit) {
|
|
36726
|
+
return Object.entries(unit.fields).filter(([key]) => !TITLE_KEYS.includes(key)).map(([key, value]) => `${key}: ${formatFieldValue(value)}`).join(" \xB7 ");
|
|
36727
|
+
}
|
|
36728
|
+
var TITLE_KEYS, ImportPreviewTree;
|
|
36729
|
+
var init_ImportPreviewTree = __esm({
|
|
36730
|
+
"components/core/molecules/import/ImportPreviewTree.tsx"() {
|
|
36731
|
+
"use client";
|
|
36732
|
+
init_Box();
|
|
36733
|
+
init_Badge();
|
|
36734
|
+
init_Button();
|
|
36735
|
+
init_Icon();
|
|
36736
|
+
init_Typography();
|
|
36737
|
+
init_cn();
|
|
36738
|
+
TITLE_KEYS = ["title", "name", "label"];
|
|
36739
|
+
ImportPreviewTree = ({
|
|
36740
|
+
units,
|
|
36741
|
+
skipped = [],
|
|
36742
|
+
entityDisplay,
|
|
36743
|
+
onConfirm,
|
|
36744
|
+
onCancel,
|
|
36745
|
+
confirmLabel = "Confirm import",
|
|
36746
|
+
cancelLabel = "Cancel",
|
|
36747
|
+
indent = 16,
|
|
36748
|
+
className
|
|
36749
|
+
}) => {
|
|
36750
|
+
const groups = /* @__PURE__ */ new Map();
|
|
36751
|
+
for (const unit of units) {
|
|
36752
|
+
const group = groups.get(unit.targetEntity);
|
|
36753
|
+
if (group) group.push(unit);
|
|
36754
|
+
else groups.set(unit.targetEntity, [unit]);
|
|
36755
|
+
}
|
|
36756
|
+
const renderUnit = (unit, childrenByParent, depth) => {
|
|
36757
|
+
const summary = fieldSummary(unit);
|
|
36758
|
+
const children = childrenByParent.get(unit.ref) ?? [];
|
|
36759
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React84__namespace.default.Fragment, { children: [
|
|
36760
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
36761
|
+
Box,
|
|
36762
|
+
{
|
|
36763
|
+
className: "flex flex-col py-1",
|
|
36764
|
+
style: { paddingLeft: depth * indent },
|
|
36765
|
+
"data-testid": `import-preview-unit-${unit.ref}`,
|
|
36766
|
+
children: [
|
|
36767
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
36768
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: "file-text", size: "xs", className: "text-muted-foreground" }),
|
|
36769
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", children: unitTitle(unit) })
|
|
36770
|
+
] }),
|
|
36771
|
+
summary ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: summary }) : null
|
|
36772
|
+
]
|
|
36773
|
+
}
|
|
36774
|
+
),
|
|
36775
|
+
children.map((child) => renderUnit(child, childrenByParent, depth + 1))
|
|
36776
|
+
] }, unit.ref);
|
|
36777
|
+
};
|
|
36778
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("flex flex-col gap-4", className), children: [
|
|
36779
|
+
units.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", className: "text-muted-foreground", children: "No units staged." }) : null,
|
|
36780
|
+
Array.from(groups.entries()).map(([entity, groupUnits]) => {
|
|
36781
|
+
const refs = new Set(groupUnits.map((unit) => unit.ref));
|
|
36782
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
36783
|
+
const roots = [];
|
|
36784
|
+
for (const unit of groupUnits) {
|
|
36785
|
+
if (unit.parentRef && refs.has(unit.parentRef)) {
|
|
36786
|
+
const siblings = childrenByParent.get(unit.parentRef);
|
|
36787
|
+
if (siblings) siblings.push(unit);
|
|
36788
|
+
else childrenByParent.set(unit.parentRef, [unit]);
|
|
36789
|
+
} else {
|
|
36790
|
+
roots.push(unit);
|
|
36791
|
+
}
|
|
36792
|
+
}
|
|
36793
|
+
const label = entityDisplay[entity]?.plural ?? entity;
|
|
36794
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { border: true, className: "rounded-md border-border bg-card p-3", children: [
|
|
36795
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2 pb-2", children: [
|
|
36796
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "label", children: label }),
|
|
36797
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { amount: groupUnits.length })
|
|
36798
|
+
] }),
|
|
36799
|
+
roots.map((unit) => renderUnit(unit, childrenByParent, 0))
|
|
36800
|
+
] }, entity);
|
|
36801
|
+
}),
|
|
36802
|
+
skipped.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(Box, { border: true, className: "rounded-md border-border bg-card p-3", children: [
|
|
36803
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2 pb-2", children: [
|
|
36804
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "label", children: "Skipped" }),
|
|
36805
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { amount: skipped.length })
|
|
36806
|
+
] }),
|
|
36807
|
+
skipped.map((element) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-baseline gap-2 py-1", children: [
|
|
36808
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", children: element.ref }),
|
|
36809
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: element.reason })
|
|
36810
|
+
] }, element.ref))
|
|
36811
|
+
] }) : null,
|
|
36812
|
+
onConfirm || onCancel ? /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center justify-end gap-2", children: [
|
|
36813
|
+
onCancel ? /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "default", label: cancelLabel, onClick: onCancel }) : null,
|
|
36814
|
+
onConfirm ? /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", label: confirmLabel, onClick: onConfirm }) : null
|
|
36815
|
+
] }) : null
|
|
36816
|
+
] });
|
|
36817
|
+
};
|
|
36818
|
+
}
|
|
36819
|
+
});
|
|
36820
|
+
var PIPELINE, DEFAULT_LABELS, ImportProgress;
|
|
36821
|
+
var init_ImportProgress = __esm({
|
|
36822
|
+
"components/core/molecules/import/ImportProgress.tsx"() {
|
|
36823
|
+
"use client";
|
|
36824
|
+
init_Box();
|
|
36825
|
+
init_Badge();
|
|
36826
|
+
init_Icon();
|
|
36827
|
+
init_Typography();
|
|
36828
|
+
init_cn();
|
|
36829
|
+
PIPELINE = [
|
|
36830
|
+
"fetching",
|
|
36831
|
+
"mapping",
|
|
36832
|
+
"reviewing",
|
|
36833
|
+
"committing"
|
|
36834
|
+
];
|
|
36835
|
+
DEFAULT_LABELS = {
|
|
36836
|
+
fetching: "Fetching",
|
|
36837
|
+
mapping: "Mapping",
|
|
36838
|
+
reviewing: "Reviewing",
|
|
36839
|
+
committing: "Committing",
|
|
36840
|
+
done: "Done",
|
|
36841
|
+
failed: "Failed"
|
|
36842
|
+
};
|
|
36843
|
+
ImportProgress = ({
|
|
36844
|
+
step,
|
|
36845
|
+
counts,
|
|
36846
|
+
labels,
|
|
36847
|
+
className
|
|
36848
|
+
}) => {
|
|
36849
|
+
const label = (key) => labels?.[key] ?? DEFAULT_LABELS[key];
|
|
36850
|
+
const currentIndex = step === "done" || step === "failed" ? PIPELINE.length : PIPELINE.indexOf(step);
|
|
36851
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("flex flex-col gap-3", className), children: [
|
|
36852
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
36853
|
+
PIPELINE.map((key, index) => {
|
|
36854
|
+
const isComplete = index < currentIndex;
|
|
36855
|
+
const isActive = index === currentIndex;
|
|
36856
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React84__namespace.default.Fragment, { children: [
|
|
36857
|
+
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
36858
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
36859
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36860
|
+
Icon,
|
|
36861
|
+
{
|
|
36862
|
+
icon: isComplete ? "check" : isActive ? "loader" : "circle",
|
|
36863
|
+
size: "sm",
|
|
36864
|
+
className: cn(
|
|
36865
|
+
isComplete ? "text-success" : isActive ? "text-primary" : "text-muted-foreground"
|
|
36866
|
+
)
|
|
36867
|
+
}
|
|
36868
|
+
),
|
|
36869
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36870
|
+
Typography,
|
|
36871
|
+
{
|
|
36872
|
+
variant: "caption",
|
|
36873
|
+
className: cn(isActive ? "text-foreground" : "text-muted-foreground"),
|
|
36874
|
+
children: label(key)
|
|
36875
|
+
}
|
|
36876
|
+
)
|
|
36877
|
+
] })
|
|
36878
|
+
] }, key);
|
|
36879
|
+
}),
|
|
36880
|
+
step === "done" || step === "failed" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
36881
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-px w-4 bg-border" }),
|
|
36882
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${step}`, children: [
|
|
36883
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36884
|
+
Icon,
|
|
36885
|
+
{
|
|
36886
|
+
icon: step === "done" ? "check" : "x",
|
|
36887
|
+
size: "sm",
|
|
36888
|
+
className: step === "done" ? "text-success" : "text-error"
|
|
36889
|
+
}
|
|
36890
|
+
),
|
|
36891
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36892
|
+
Typography,
|
|
36893
|
+
{
|
|
36894
|
+
variant: "caption",
|
|
36895
|
+
className: step === "done" ? "text-success" : "text-error",
|
|
36896
|
+
children: label(step)
|
|
36897
|
+
}
|
|
36898
|
+
)
|
|
36899
|
+
] })
|
|
36900
|
+
] }) : null
|
|
36901
|
+
] }),
|
|
36902
|
+
counts ? /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
36903
|
+
counts.staged !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { label: `Staged ${counts.staged}` }) : null,
|
|
36904
|
+
counts.committed !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", label: `Committed ${counts.committed}` }) : null,
|
|
36905
|
+
counts.failed !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "danger", label: `Failed ${counts.failed}` }) : null
|
|
36906
|
+
] }) : null
|
|
36907
|
+
] });
|
|
36908
|
+
};
|
|
36909
|
+
}
|
|
36910
|
+
});
|
|
36911
|
+
|
|
36912
|
+
// components/core/molecules/import/index.ts
|
|
36913
|
+
var init_import = __esm({
|
|
36914
|
+
"components/core/molecules/import/index.ts"() {
|
|
36915
|
+
}
|
|
36916
|
+
});
|
|
36586
36917
|
var ReflectionBlock;
|
|
36587
36918
|
var init_ReflectionBlock = __esm({
|
|
36588
36919
|
"components/core/molecules/ReflectionBlock.tsx"() {
|
|
@@ -36657,6 +36988,7 @@ var init_molecules2 = __esm({
|
|
|
36657
36988
|
init_EmptyState();
|
|
36658
36989
|
init_Pagination();
|
|
36659
36990
|
init_molecules();
|
|
36991
|
+
init_import();
|
|
36660
36992
|
}
|
|
36661
36993
|
});
|
|
36662
36994
|
|
|
@@ -37137,7 +37469,7 @@ function getBadgeVariant(fieldName, value) {
|
|
|
37137
37469
|
function formatFieldLabel(fieldName) {
|
|
37138
37470
|
return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase());
|
|
37139
37471
|
}
|
|
37140
|
-
function
|
|
37472
|
+
function formatFieldValue2(value, fieldName) {
|
|
37141
37473
|
if (typeof value === "number") {
|
|
37142
37474
|
if (fieldName.toLowerCase().includes("progress") || fieldName.toLowerCase().includes("percent")) {
|
|
37143
37475
|
return `${value}%`;
|
|
@@ -37232,7 +37564,7 @@ function renderRichFieldValue(value, fieldName, fieldType) {
|
|
|
37232
37564
|
return str;
|
|
37233
37565
|
}
|
|
37234
37566
|
default:
|
|
37235
|
-
return
|
|
37567
|
+
return formatFieldValue2(value, fieldName);
|
|
37236
37568
|
}
|
|
37237
37569
|
}
|
|
37238
37570
|
function normalizeFieldDefs(fields) {
|
|
@@ -37343,7 +37675,7 @@ var init_DetailPanel = __esm({
|
|
|
37343
37675
|
const value = getNestedValue(normalizedData, field);
|
|
37344
37676
|
return {
|
|
37345
37677
|
label: labelFor(field),
|
|
37346
|
-
value:
|
|
37678
|
+
value: formatFieldValue2(value, field),
|
|
37347
37679
|
icon: getFieldIcon(field)
|
|
37348
37680
|
};
|
|
37349
37681
|
}
|
|
@@ -43355,6 +43687,9 @@ var init_component_registry_generated = __esm({
|
|
|
43355
43687
|
init_HeroOrganism();
|
|
43356
43688
|
init_HeroSection();
|
|
43357
43689
|
init_Icon();
|
|
43690
|
+
init_ImportPreviewTree();
|
|
43691
|
+
init_ImportProgress();
|
|
43692
|
+
init_ImportSourcePicker();
|
|
43358
43693
|
init_InfiniteScrollSentinel();
|
|
43359
43694
|
init_Input();
|
|
43360
43695
|
init_InputGroup();
|
|
@@ -43618,6 +43953,9 @@ var init_component_registry_generated = __esm({
|
|
|
43618
43953
|
"HeroOrganism": HeroOrganism,
|
|
43619
43954
|
"HeroSection": HeroSection,
|
|
43620
43955
|
"Icon": Icon,
|
|
43956
|
+
"ImportPreviewTree": ImportPreviewTree,
|
|
43957
|
+
"ImportProgress": ImportProgress,
|
|
43958
|
+
"ImportSourcePicker": ImportSourcePicker,
|
|
43621
43959
|
"InfiniteScrollSentinel": InfiniteScrollSentinel,
|
|
43622
43960
|
"Input": Input,
|
|
43623
43961
|
"InputGroup": InputGroup,
|