@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/runtime/index.cjs
CHANGED
|
@@ -23773,7 +23773,7 @@ var init_FormField = __esm({
|
|
|
23773
23773
|
FormField.displayName = "FormField";
|
|
23774
23774
|
}
|
|
23775
23775
|
});
|
|
23776
|
-
var resolveFilterType, lookStyles6, FilterGroup;
|
|
23776
|
+
var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
|
|
23777
23777
|
var init_FilterGroup = __esm({
|
|
23778
23778
|
"components/core/molecules/FilterGroup.tsx"() {
|
|
23779
23779
|
"use client";
|
|
@@ -23791,10 +23791,10 @@ var init_FilterGroup = __esm({
|
|
|
23791
23791
|
toolbar: "",
|
|
23792
23792
|
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",
|
|
23793
23793
|
pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
|
|
23794
|
-
"popover-trigger": "
|
|
23794
|
+
"popover-trigger": "",
|
|
23795
23795
|
"inline-column-header": "hidden"
|
|
23796
23796
|
};
|
|
23797
|
-
|
|
23797
|
+
FilterGroupControls = ({
|
|
23798
23798
|
entity,
|
|
23799
23799
|
filters,
|
|
23800
23800
|
onFilterChange,
|
|
@@ -24130,7 +24130,7 @@ var init_FilterGroup = __esm({
|
|
|
24130
24130
|
className: "text-muted-foreground",
|
|
24131
24131
|
children: [
|
|
24132
24132
|
/* @__PURE__ */ jsxRuntime.jsx(Icon, { name: "filter", className: "h-4 w-4" }),
|
|
24133
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-
|
|
24133
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
|
|
24134
24134
|
]
|
|
24135
24135
|
}
|
|
24136
24136
|
),
|
|
@@ -24221,6 +24221,42 @@ var init_FilterGroup = __esm({
|
|
|
24221
24221
|
}
|
|
24222
24222
|
);
|
|
24223
24223
|
};
|
|
24224
|
+
FilterGroupControls.displayName = "FilterGroupControls";
|
|
24225
|
+
FilterGroupPopover = (props) => {
|
|
24226
|
+
const { t } = hooks.useTranslate();
|
|
24227
|
+
const [open, setOpen] = React82.useState(false);
|
|
24228
|
+
const queryState = useQuerySingleton(props.query);
|
|
24229
|
+
const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
|
|
24230
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("relative inline-block", props.className), children: [
|
|
24231
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
24232
|
+
Button,
|
|
24233
|
+
{
|
|
24234
|
+
variant: activeFilterCount > 0 ? "secondary" : "ghost",
|
|
24235
|
+
size: "sm",
|
|
24236
|
+
leftIcon: "filter",
|
|
24237
|
+
onClick: () => setOpen((o) => !o),
|
|
24238
|
+
"aria-expanded": open,
|
|
24239
|
+
"aria-haspopup": "true",
|
|
24240
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
24241
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: t("filterGroup.filters") }),
|
|
24242
|
+
activeFilterCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
|
|
24243
|
+
] })
|
|
24244
|
+
}
|
|
24245
|
+
),
|
|
24246
|
+
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(
|
|
24247
|
+
FilterGroupControls,
|
|
24248
|
+
{
|
|
24249
|
+
...props,
|
|
24250
|
+
className: void 0,
|
|
24251
|
+
look: "toolbar",
|
|
24252
|
+
variant: "vertical",
|
|
24253
|
+
showIcon: false
|
|
24254
|
+
}
|
|
24255
|
+
) })
|
|
24256
|
+
] });
|
|
24257
|
+
};
|
|
24258
|
+
FilterGroupPopover.displayName = "FilterGroupPopover";
|
|
24259
|
+
FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsxRuntime.jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(FilterGroupControls, { ...props });
|
|
24224
24260
|
FilterGroup.displayName = "FilterGroup";
|
|
24225
24261
|
}
|
|
24226
24262
|
});
|
|
@@ -26878,12 +26914,12 @@ var init_MapView = __esm({
|
|
|
26878
26914
|
shadowSize: [41, 41]
|
|
26879
26915
|
});
|
|
26880
26916
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
26881
|
-
const { useEffect: useEffect59, useRef:
|
|
26917
|
+
const { useEffect: useEffect59, useRef: useRef60, useCallback: useCallback87, useState: useState89 } = React82__namespace.default;
|
|
26882
26918
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
26883
26919
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
26884
26920
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
26885
26921
|
const map = useMap();
|
|
26886
|
-
const prevRef =
|
|
26922
|
+
const prevRef = useRef60({ centerLat, centerLng, zoom });
|
|
26887
26923
|
useEffect59(() => {
|
|
26888
26924
|
const prev = prevRef.current;
|
|
26889
26925
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
@@ -27862,9 +27898,19 @@ function TableView({
|
|
|
27862
27898
|
const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
|
|
27863
27899
|
const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
|
|
27864
27900
|
const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
|
|
27901
|
+
const colFloors = React82__namespace.default.useMemo(
|
|
27902
|
+
() => colDefs.map((col) => {
|
|
27903
|
+
const longest = data.reduce((widest, row) => {
|
|
27904
|
+
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
27905
|
+
return Math.max(widest, cell.length);
|
|
27906
|
+
}, columnLabel(col).length);
|
|
27907
|
+
return Math.min(longest, MAX_MEASURED_COL_CH);
|
|
27908
|
+
}),
|
|
27909
|
+
[colDefs, data]
|
|
27910
|
+
);
|
|
27865
27911
|
const gridTemplateColumns = [
|
|
27866
27912
|
selectable ? "auto" : null,
|
|
27867
|
-
...colDefs.map((c) => c.width ??
|
|
27913
|
+
...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
|
|
27868
27914
|
actionsTrack
|
|
27869
27915
|
].filter(Boolean).join(" ");
|
|
27870
27916
|
const header = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -28031,7 +28077,7 @@ function TableView({
|
|
|
28031
28077
|
}
|
|
28032
28078
|
);
|
|
28033
28079
|
}
|
|
28034
|
-
var alignClass, weightClass, LOOKS;
|
|
28080
|
+
var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
|
|
28035
28081
|
var init_TableView = __esm({
|
|
28036
28082
|
"components/core/molecules/TableView.tsx"() {
|
|
28037
28083
|
"use client";
|
|
@@ -28049,6 +28095,7 @@ var init_TableView = __esm({
|
|
|
28049
28095
|
init_Menu();
|
|
28050
28096
|
init_useDataDnd();
|
|
28051
28097
|
logger.createLogger("almadar:ui:table-view");
|
|
28098
|
+
MAX_MEASURED_COL_CH = 32;
|
|
28052
28099
|
alignClass = {
|
|
28053
28100
|
left: "justify-start text-left",
|
|
28054
28101
|
center: "justify-center text-center",
|
|
@@ -35935,6 +35982,290 @@ var init_GraphCanvas = __esm({
|
|
|
35935
35982
|
GraphCanvas.displayName = "GraphCanvas";
|
|
35936
35983
|
}
|
|
35937
35984
|
});
|
|
35985
|
+
var ImportSourcePicker;
|
|
35986
|
+
var init_ImportSourcePicker = __esm({
|
|
35987
|
+
"components/core/molecules/import/ImportSourcePicker.tsx"() {
|
|
35988
|
+
"use client";
|
|
35989
|
+
init_Box();
|
|
35990
|
+
init_Icon();
|
|
35991
|
+
init_Typography();
|
|
35992
|
+
init_cn();
|
|
35993
|
+
ImportSourcePicker = ({
|
|
35994
|
+
sources,
|
|
35995
|
+
onSelect,
|
|
35996
|
+
onFilesSelected,
|
|
35997
|
+
title,
|
|
35998
|
+
moreSources,
|
|
35999
|
+
className
|
|
36000
|
+
}) => {
|
|
36001
|
+
const fileInputRef = React82.useRef(null);
|
|
36002
|
+
const handlePick = (source) => {
|
|
36003
|
+
if (source.disabled) return;
|
|
36004
|
+
if (source.kind === "file") {
|
|
36005
|
+
const input = fileInputRef.current;
|
|
36006
|
+
if (!input) return;
|
|
36007
|
+
input.accept = source.accept ?? "";
|
|
36008
|
+
input.multiple = source.multiple ?? false;
|
|
36009
|
+
input.click();
|
|
36010
|
+
return;
|
|
36011
|
+
}
|
|
36012
|
+
onSelect?.(source.id);
|
|
36013
|
+
};
|
|
36014
|
+
const handleFiles = (event) => {
|
|
36015
|
+
const files = event.target.files ? Array.from(event.target.files) : [];
|
|
36016
|
+
event.target.value = "";
|
|
36017
|
+
if (files.length > 0) onFilesSelected?.(files);
|
|
36018
|
+
};
|
|
36019
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("flex flex-col gap-2", className), children: [
|
|
36020
|
+
title ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "h4", children: title }) : null,
|
|
36021
|
+
sources.map((source) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
36022
|
+
Box,
|
|
36023
|
+
{
|
|
36024
|
+
role: "button",
|
|
36025
|
+
tabIndex: source.disabled ? -1 : 0,
|
|
36026
|
+
"aria-disabled": source.disabled,
|
|
36027
|
+
onClick: () => handlePick(source),
|
|
36028
|
+
onKeyDown: (event) => {
|
|
36029
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
36030
|
+
event.preventDefault();
|
|
36031
|
+
handlePick(source);
|
|
36032
|
+
}
|
|
36033
|
+
},
|
|
36034
|
+
className: cn(
|
|
36035
|
+
"flex items-center gap-3 rounded-md border border-border bg-card px-4 py-3 text-left",
|
|
36036
|
+
source.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-accent hover:text-accent-foreground"
|
|
36037
|
+
),
|
|
36038
|
+
children: [
|
|
36039
|
+
source.icon ? /* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: source.icon, size: "md" }) : null,
|
|
36040
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex flex-col", children: [
|
|
36041
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "label", children: source.label }),
|
|
36042
|
+
source.description ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: source.description }) : null
|
|
36043
|
+
] })
|
|
36044
|
+
]
|
|
36045
|
+
},
|
|
36046
|
+
source.id
|
|
36047
|
+
)),
|
|
36048
|
+
moreSources,
|
|
36049
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36050
|
+
"input",
|
|
36051
|
+
{
|
|
36052
|
+
ref: fileInputRef,
|
|
36053
|
+
type: "file",
|
|
36054
|
+
className: "hidden",
|
|
36055
|
+
onChange: handleFiles,
|
|
36056
|
+
"data-testid": "import-source-file-input"
|
|
36057
|
+
}
|
|
36058
|
+
)
|
|
36059
|
+
] });
|
|
36060
|
+
};
|
|
36061
|
+
}
|
|
36062
|
+
});
|
|
36063
|
+
function formatFieldValue(value) {
|
|
36064
|
+
if (value === null) return "\u2014";
|
|
36065
|
+
if (value instanceof Date) return value.toISOString();
|
|
36066
|
+
if (Array.isArray(value)) return value.map(formatFieldValue).join(", ");
|
|
36067
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
36068
|
+
return String(value);
|
|
36069
|
+
}
|
|
36070
|
+
function unitTitle(unit) {
|
|
36071
|
+
for (const key of TITLE_KEYS) {
|
|
36072
|
+
const value = unit.fields[key];
|
|
36073
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
36074
|
+
}
|
|
36075
|
+
return unit.ref;
|
|
36076
|
+
}
|
|
36077
|
+
function fieldSummary(unit) {
|
|
36078
|
+
return Object.entries(unit.fields).filter(([key]) => !TITLE_KEYS.includes(key)).map(([key, value]) => `${key}: ${formatFieldValue(value)}`).join(" \xB7 ");
|
|
36079
|
+
}
|
|
36080
|
+
var TITLE_KEYS, ImportPreviewTree;
|
|
36081
|
+
var init_ImportPreviewTree = __esm({
|
|
36082
|
+
"components/core/molecules/import/ImportPreviewTree.tsx"() {
|
|
36083
|
+
"use client";
|
|
36084
|
+
init_Box();
|
|
36085
|
+
init_Badge();
|
|
36086
|
+
init_Button();
|
|
36087
|
+
init_Icon();
|
|
36088
|
+
init_Typography();
|
|
36089
|
+
init_cn();
|
|
36090
|
+
TITLE_KEYS = ["title", "name", "label"];
|
|
36091
|
+
ImportPreviewTree = ({
|
|
36092
|
+
units,
|
|
36093
|
+
skipped = [],
|
|
36094
|
+
entityDisplay,
|
|
36095
|
+
onConfirm,
|
|
36096
|
+
onCancel,
|
|
36097
|
+
confirmLabel = "Confirm import",
|
|
36098
|
+
cancelLabel = "Cancel",
|
|
36099
|
+
indent = 16,
|
|
36100
|
+
className
|
|
36101
|
+
}) => {
|
|
36102
|
+
const groups = /* @__PURE__ */ new Map();
|
|
36103
|
+
for (const unit of units) {
|
|
36104
|
+
const group = groups.get(unit.targetEntity);
|
|
36105
|
+
if (group) group.push(unit);
|
|
36106
|
+
else groups.set(unit.targetEntity, [unit]);
|
|
36107
|
+
}
|
|
36108
|
+
const renderUnit = (unit, childrenByParent, depth) => {
|
|
36109
|
+
const summary = fieldSummary(unit);
|
|
36110
|
+
const children = childrenByParent.get(unit.ref) ?? [];
|
|
36111
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React82__namespace.default.Fragment, { children: [
|
|
36112
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
36113
|
+
Box,
|
|
36114
|
+
{
|
|
36115
|
+
className: "flex flex-col py-1",
|
|
36116
|
+
style: { paddingLeft: depth * indent },
|
|
36117
|
+
"data-testid": `import-preview-unit-${unit.ref}`,
|
|
36118
|
+
children: [
|
|
36119
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
36120
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon, { icon: "file-text", size: "xs", className: "text-muted-foreground" }),
|
|
36121
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", children: unitTitle(unit) })
|
|
36122
|
+
] }),
|
|
36123
|
+
summary ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: summary }) : null
|
|
36124
|
+
]
|
|
36125
|
+
}
|
|
36126
|
+
),
|
|
36127
|
+
children.map((child) => renderUnit(child, childrenByParent, depth + 1))
|
|
36128
|
+
] }, unit.ref);
|
|
36129
|
+
};
|
|
36130
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("flex flex-col gap-4", className), children: [
|
|
36131
|
+
units.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", className: "text-muted-foreground", children: "No units staged." }) : null,
|
|
36132
|
+
Array.from(groups.entries()).map(([entity, groupUnits]) => {
|
|
36133
|
+
const refs = new Set(groupUnits.map((unit) => unit.ref));
|
|
36134
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
36135
|
+
const roots = [];
|
|
36136
|
+
for (const unit of groupUnits) {
|
|
36137
|
+
if (unit.parentRef && refs.has(unit.parentRef)) {
|
|
36138
|
+
const siblings = childrenByParent.get(unit.parentRef);
|
|
36139
|
+
if (siblings) siblings.push(unit);
|
|
36140
|
+
else childrenByParent.set(unit.parentRef, [unit]);
|
|
36141
|
+
} else {
|
|
36142
|
+
roots.push(unit);
|
|
36143
|
+
}
|
|
36144
|
+
}
|
|
36145
|
+
const label = entityDisplay[entity]?.plural ?? entity;
|
|
36146
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { border: true, className: "rounded-md border-border bg-card p-3", children: [
|
|
36147
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2 pb-2", children: [
|
|
36148
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "label", children: label }),
|
|
36149
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { amount: groupUnits.length })
|
|
36150
|
+
] }),
|
|
36151
|
+
roots.map((unit) => renderUnit(unit, childrenByParent, 0))
|
|
36152
|
+
] }, entity);
|
|
36153
|
+
}),
|
|
36154
|
+
skipped.length > 0 ? /* @__PURE__ */ jsxRuntime.jsxs(Box, { border: true, className: "rounded-md border-border bg-card p-3", children: [
|
|
36155
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2 pb-2", children: [
|
|
36156
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "label", children: "Skipped" }),
|
|
36157
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { amount: skipped.length })
|
|
36158
|
+
] }),
|
|
36159
|
+
skipped.map((element) => /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-baseline gap-2 py-1", children: [
|
|
36160
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "body2", children: element.ref }),
|
|
36161
|
+
/* @__PURE__ */ jsxRuntime.jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: element.reason })
|
|
36162
|
+
] }, element.ref))
|
|
36163
|
+
] }) : null,
|
|
36164
|
+
onConfirm || onCancel ? /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center justify-end gap-2", children: [
|
|
36165
|
+
onCancel ? /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "default", label: cancelLabel, onClick: onCancel }) : null,
|
|
36166
|
+
onConfirm ? /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "primary", label: confirmLabel, onClick: onConfirm }) : null
|
|
36167
|
+
] }) : null
|
|
36168
|
+
] });
|
|
36169
|
+
};
|
|
36170
|
+
}
|
|
36171
|
+
});
|
|
36172
|
+
var PIPELINE, DEFAULT_LABELS, ImportProgress;
|
|
36173
|
+
var init_ImportProgress = __esm({
|
|
36174
|
+
"components/core/molecules/import/ImportProgress.tsx"() {
|
|
36175
|
+
"use client";
|
|
36176
|
+
init_Box();
|
|
36177
|
+
init_Badge();
|
|
36178
|
+
init_Icon();
|
|
36179
|
+
init_Typography();
|
|
36180
|
+
init_cn();
|
|
36181
|
+
PIPELINE = [
|
|
36182
|
+
"fetching",
|
|
36183
|
+
"mapping",
|
|
36184
|
+
"reviewing",
|
|
36185
|
+
"committing"
|
|
36186
|
+
];
|
|
36187
|
+
DEFAULT_LABELS = {
|
|
36188
|
+
fetching: "Fetching",
|
|
36189
|
+
mapping: "Mapping",
|
|
36190
|
+
reviewing: "Reviewing",
|
|
36191
|
+
committing: "Committing",
|
|
36192
|
+
done: "Done",
|
|
36193
|
+
failed: "Failed"
|
|
36194
|
+
};
|
|
36195
|
+
ImportProgress = ({
|
|
36196
|
+
step,
|
|
36197
|
+
counts,
|
|
36198
|
+
labels,
|
|
36199
|
+
className
|
|
36200
|
+
}) => {
|
|
36201
|
+
const label = (key) => labels?.[key] ?? DEFAULT_LABELS[key];
|
|
36202
|
+
const currentIndex = step === "done" || step === "failed" ? PIPELINE.length : PIPELINE.indexOf(step);
|
|
36203
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: cn("flex flex-col gap-3", className), children: [
|
|
36204
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
36205
|
+
PIPELINE.map((key, index) => {
|
|
36206
|
+
const isComplete = index < currentIndex;
|
|
36207
|
+
const isActive = index === currentIndex;
|
|
36208
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(React82__namespace.default.Fragment, { children: [
|
|
36209
|
+
index > 0 ? /* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
36210
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
36211
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36212
|
+
Icon,
|
|
36213
|
+
{
|
|
36214
|
+
icon: isComplete ? "check" : isActive ? "loader" : "circle",
|
|
36215
|
+
size: "sm",
|
|
36216
|
+
className: cn(
|
|
36217
|
+
isComplete ? "text-success" : isActive ? "text-primary" : "text-muted-foreground"
|
|
36218
|
+
)
|
|
36219
|
+
}
|
|
36220
|
+
),
|
|
36221
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36222
|
+
Typography,
|
|
36223
|
+
{
|
|
36224
|
+
variant: "caption",
|
|
36225
|
+
className: cn(isActive ? "text-foreground" : "text-muted-foreground"),
|
|
36226
|
+
children: label(key)
|
|
36227
|
+
}
|
|
36228
|
+
)
|
|
36229
|
+
] })
|
|
36230
|
+
] }, key);
|
|
36231
|
+
}),
|
|
36232
|
+
step === "done" || step === "failed" ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
36233
|
+
/* @__PURE__ */ jsxRuntime.jsx(Box, { className: "h-px w-4 bg-border" }),
|
|
36234
|
+
/* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${step}`, children: [
|
|
36235
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36236
|
+
Icon,
|
|
36237
|
+
{
|
|
36238
|
+
icon: step === "done" ? "check" : "x",
|
|
36239
|
+
size: "sm",
|
|
36240
|
+
className: step === "done" ? "text-success" : "text-error"
|
|
36241
|
+
}
|
|
36242
|
+
),
|
|
36243
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
36244
|
+
Typography,
|
|
36245
|
+
{
|
|
36246
|
+
variant: "caption",
|
|
36247
|
+
className: step === "done" ? "text-success" : "text-error",
|
|
36248
|
+
children: label(step)
|
|
36249
|
+
}
|
|
36250
|
+
)
|
|
36251
|
+
] })
|
|
36252
|
+
] }) : null
|
|
36253
|
+
] }),
|
|
36254
|
+
counts ? /* @__PURE__ */ jsxRuntime.jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
36255
|
+
counts.staged !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { label: `Staged ${counts.staged}` }) : null,
|
|
36256
|
+
counts.committed !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "success", label: `Committed ${counts.committed}` }) : null,
|
|
36257
|
+
counts.failed !== void 0 ? /* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: "danger", label: `Failed ${counts.failed}` }) : null
|
|
36258
|
+
] }) : null
|
|
36259
|
+
] });
|
|
36260
|
+
};
|
|
36261
|
+
}
|
|
36262
|
+
});
|
|
36263
|
+
|
|
36264
|
+
// components/core/molecules/import/index.ts
|
|
36265
|
+
var init_import = __esm({
|
|
36266
|
+
"components/core/molecules/import/index.ts"() {
|
|
36267
|
+
}
|
|
36268
|
+
});
|
|
35938
36269
|
var ReflectionBlock;
|
|
35939
36270
|
var init_ReflectionBlock = __esm({
|
|
35940
36271
|
"components/core/molecules/ReflectionBlock.tsx"() {
|
|
@@ -36009,6 +36340,7 @@ var init_molecules2 = __esm({
|
|
|
36009
36340
|
init_EmptyState();
|
|
36010
36341
|
init_Pagination();
|
|
36011
36342
|
init_molecules();
|
|
36343
|
+
init_import();
|
|
36012
36344
|
}
|
|
36013
36345
|
});
|
|
36014
36346
|
|
|
@@ -36489,7 +36821,7 @@ function getBadgeVariant(fieldName, value) {
|
|
|
36489
36821
|
function formatFieldLabel(fieldName) {
|
|
36490
36822
|
return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase());
|
|
36491
36823
|
}
|
|
36492
|
-
function
|
|
36824
|
+
function formatFieldValue2(value, fieldName) {
|
|
36493
36825
|
if (typeof value === "number") {
|
|
36494
36826
|
if (fieldName.toLowerCase().includes("progress") || fieldName.toLowerCase().includes("percent")) {
|
|
36495
36827
|
return `${value}%`;
|
|
@@ -36584,7 +36916,7 @@ function renderRichFieldValue(value, fieldName, fieldType) {
|
|
|
36584
36916
|
return str;
|
|
36585
36917
|
}
|
|
36586
36918
|
default:
|
|
36587
|
-
return
|
|
36919
|
+
return formatFieldValue2(value, fieldName);
|
|
36588
36920
|
}
|
|
36589
36921
|
}
|
|
36590
36922
|
function normalizeFieldDefs(fields) {
|
|
@@ -36695,7 +37027,7 @@ var init_DetailPanel = __esm({
|
|
|
36695
37027
|
const value = getNestedValue(normalizedData, field);
|
|
36696
37028
|
return {
|
|
36697
37029
|
label: labelFor(field),
|
|
36698
|
-
value:
|
|
37030
|
+
value: formatFieldValue2(value, field),
|
|
36699
37031
|
icon: getFieldIcon(field)
|
|
36700
37032
|
};
|
|
36701
37033
|
}
|
|
@@ -42726,6 +43058,9 @@ var init_component_registry_generated = __esm({
|
|
|
42726
43058
|
init_HeroOrganism();
|
|
42727
43059
|
init_HeroSection();
|
|
42728
43060
|
init_Icon();
|
|
43061
|
+
init_ImportPreviewTree();
|
|
43062
|
+
init_ImportProgress();
|
|
43063
|
+
init_ImportSourcePicker();
|
|
42729
43064
|
init_InfiniteScrollSentinel();
|
|
42730
43065
|
init_Input();
|
|
42731
43066
|
init_InputGroup();
|
|
@@ -42989,6 +43324,9 @@ var init_component_registry_generated = __esm({
|
|
|
42989
43324
|
"HeroOrganism": HeroOrganism,
|
|
42990
43325
|
"HeroSection": HeroSection,
|
|
42991
43326
|
"Icon": Icon,
|
|
43327
|
+
"ImportPreviewTree": ImportPreviewTree,
|
|
43328
|
+
"ImportProgress": ImportProgress,
|
|
43329
|
+
"ImportSourcePicker": ImportSourcePicker,
|
|
42992
43330
|
"InfiniteScrollSentinel": InfiniteScrollSentinel,
|
|
42993
43331
|
"Input": Input,
|
|
42994
43332
|
"InputGroup": InputGroup,
|