@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.js
CHANGED
|
@@ -23699,7 +23699,7 @@ var init_FormField = __esm({
|
|
|
23699
23699
|
FormField.displayName = "FormField";
|
|
23700
23700
|
}
|
|
23701
23701
|
});
|
|
23702
|
-
var resolveFilterType, lookStyles6, FilterGroup;
|
|
23702
|
+
var resolveFilterType, lookStyles6, FilterGroupControls, FilterGroupPopover, FilterGroup;
|
|
23703
23703
|
var init_FilterGroup = __esm({
|
|
23704
23704
|
"components/core/molecules/FilterGroup.tsx"() {
|
|
23705
23705
|
"use client";
|
|
@@ -23717,10 +23717,10 @@ var init_FilterGroup = __esm({
|
|
|
23717
23717
|
toolbar: "",
|
|
23718
23718
|
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",
|
|
23719
23719
|
pills: "gap-2 [&_input]:rounded-pill [&_select]:rounded-pill [&_button]:rounded-pill",
|
|
23720
|
-
"popover-trigger": "
|
|
23720
|
+
"popover-trigger": "",
|
|
23721
23721
|
"inline-column-header": "hidden"
|
|
23722
23722
|
};
|
|
23723
|
-
|
|
23723
|
+
FilterGroupControls = ({
|
|
23724
23724
|
entity,
|
|
23725
23725
|
filters,
|
|
23726
23726
|
onFilterChange,
|
|
@@ -24056,7 +24056,7 @@ var init_FilterGroup = __esm({
|
|
|
24056
24056
|
className: "text-muted-foreground",
|
|
24057
24057
|
children: [
|
|
24058
24058
|
/* @__PURE__ */ jsx(Icon, { name: "filter", className: "h-4 w-4" }),
|
|
24059
|
-
/* @__PURE__ */ jsx("span", { className: "text-
|
|
24059
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs font-bold uppercase tracking-wide", children: t("filterGroup.filters") })
|
|
24060
24060
|
]
|
|
24061
24061
|
}
|
|
24062
24062
|
),
|
|
@@ -24147,6 +24147,42 @@ var init_FilterGroup = __esm({
|
|
|
24147
24147
|
}
|
|
24148
24148
|
);
|
|
24149
24149
|
};
|
|
24150
|
+
FilterGroupControls.displayName = "FilterGroupControls";
|
|
24151
|
+
FilterGroupPopover = (props) => {
|
|
24152
|
+
const { t } = useTranslate();
|
|
24153
|
+
const [open, setOpen] = useState(false);
|
|
24154
|
+
const queryState = useQuerySingleton(props.query);
|
|
24155
|
+
const activeFilterCount = queryState?.filters ? Object.values(queryState.filters).filter((v) => v !== null && v !== void 0).length : 0;
|
|
24156
|
+
return /* @__PURE__ */ jsxs("div", { className: cn("relative inline-block", props.className), children: [
|
|
24157
|
+
/* @__PURE__ */ jsx(
|
|
24158
|
+
Button,
|
|
24159
|
+
{
|
|
24160
|
+
variant: activeFilterCount > 0 ? "secondary" : "ghost",
|
|
24161
|
+
size: "sm",
|
|
24162
|
+
leftIcon: "filter",
|
|
24163
|
+
onClick: () => setOpen((o) => !o),
|
|
24164
|
+
"aria-expanded": open,
|
|
24165
|
+
"aria-haspopup": "true",
|
|
24166
|
+
children: /* @__PURE__ */ jsxs(HStack, { gap: "xs", align: "center", children: [
|
|
24167
|
+
/* @__PURE__ */ jsx("span", { children: t("filterGroup.filters") }),
|
|
24168
|
+
activeFilterCount > 0 && /* @__PURE__ */ jsx(Badge, { variant: "primary", size: "sm", children: activeFilterCount })
|
|
24169
|
+
] })
|
|
24170
|
+
}
|
|
24171
|
+
),
|
|
24172
|
+
open && /* @__PURE__ */ 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__ */ jsx(
|
|
24173
|
+
FilterGroupControls,
|
|
24174
|
+
{
|
|
24175
|
+
...props,
|
|
24176
|
+
className: void 0,
|
|
24177
|
+
look: "toolbar",
|
|
24178
|
+
variant: "vertical",
|
|
24179
|
+
showIcon: false
|
|
24180
|
+
}
|
|
24181
|
+
) })
|
|
24182
|
+
] });
|
|
24183
|
+
};
|
|
24184
|
+
FilterGroupPopover.displayName = "FilterGroupPopover";
|
|
24185
|
+
FilterGroup = (props) => props.look === "popover-trigger" ? /* @__PURE__ */ jsx(FilterGroupPopover, { ...props }) : /* @__PURE__ */ jsx(FilterGroupControls, { ...props });
|
|
24150
24186
|
FilterGroup.displayName = "FilterGroup";
|
|
24151
24187
|
}
|
|
24152
24188
|
});
|
|
@@ -26804,12 +26840,12 @@ var init_MapView = __esm({
|
|
|
26804
26840
|
shadowSize: [41, 41]
|
|
26805
26841
|
});
|
|
26806
26842
|
L.Marker.prototype.options.icon = defaultIcon;
|
|
26807
|
-
const { useEffect: useEffect59, useRef:
|
|
26843
|
+
const { useEffect: useEffect59, useRef: useRef60, useCallback: useCallback87, useState: useState89 } = React82__default;
|
|
26808
26844
|
const { Typography: Typography2 } = await Promise.resolve().then(() => (init_Typography(), Typography_exports));
|
|
26809
26845
|
const { useEventBus: useEventBus2 } = await Promise.resolve().then(() => (init_useEventBus(), useEventBus_exports));
|
|
26810
26846
|
function MapUpdater({ centerLat, centerLng, zoom }) {
|
|
26811
26847
|
const map = useMap();
|
|
26812
|
-
const prevRef =
|
|
26848
|
+
const prevRef = useRef60({ centerLat, centerLng, zoom });
|
|
26813
26849
|
useEffect59(() => {
|
|
26814
26850
|
const prev = prevRef.current;
|
|
26815
26851
|
if (prev.centerLat !== centerLat || prev.centerLng !== centerLng || prev.zoom !== zoom) {
|
|
@@ -27788,9 +27824,19 @@ function TableView({
|
|
|
27788
27824
|
const inlineActionCount = hasActions ? maxInlineActions != null ? Math.min(itemActions.length, maxInlineActions) : itemActions.length : 0;
|
|
27789
27825
|
const hasOverflowActions = hasActions && maxInlineActions != null && itemActions.length > maxInlineActions;
|
|
27790
27826
|
const actionsTrack = hasActions ? `${inlineActionCount * 6 + (hasOverflowActions ? 3 : 0)}rem` : null;
|
|
27827
|
+
const colFloors = React82__default.useMemo(
|
|
27828
|
+
() => colDefs.map((col) => {
|
|
27829
|
+
const longest = data.reduce((widest, row) => {
|
|
27830
|
+
const cell = formatCell(asFieldValue(getNestedValue(row, col.field ?? col.key)), col.format);
|
|
27831
|
+
return Math.max(widest, cell.length);
|
|
27832
|
+
}, columnLabel(col).length);
|
|
27833
|
+
return Math.min(longest, MAX_MEASURED_COL_CH);
|
|
27834
|
+
}),
|
|
27835
|
+
[colDefs, data]
|
|
27836
|
+
);
|
|
27791
27837
|
const gridTemplateColumns = [
|
|
27792
27838
|
selectable ? "auto" : null,
|
|
27793
|
-
...colDefs.map((c) => c.width ??
|
|
27839
|
+
...colDefs.map((c, i) => c.width ?? `minmax(${colFloors[i]}ch, 1fr)`),
|
|
27794
27840
|
actionsTrack
|
|
27795
27841
|
].filter(Boolean).join(" ");
|
|
27796
27842
|
const header = /* @__PURE__ */ jsxs(
|
|
@@ -27957,7 +28003,7 @@ function TableView({
|
|
|
27957
28003
|
}
|
|
27958
28004
|
);
|
|
27959
28005
|
}
|
|
27960
|
-
var alignClass, weightClass, LOOKS;
|
|
28006
|
+
var MAX_MEASURED_COL_CH, alignClass, weightClass, LOOKS;
|
|
27961
28007
|
var init_TableView = __esm({
|
|
27962
28008
|
"components/core/molecules/TableView.tsx"() {
|
|
27963
28009
|
"use client";
|
|
@@ -27975,6 +28021,7 @@ var init_TableView = __esm({
|
|
|
27975
28021
|
init_Menu();
|
|
27976
28022
|
init_useDataDnd();
|
|
27977
28023
|
createLogger("almadar:ui:table-view");
|
|
28024
|
+
MAX_MEASURED_COL_CH = 32;
|
|
27978
28025
|
alignClass = {
|
|
27979
28026
|
left: "justify-start text-left",
|
|
27980
28027
|
center: "justify-center text-center",
|
|
@@ -35861,6 +35908,290 @@ var init_GraphCanvas = __esm({
|
|
|
35861
35908
|
GraphCanvas.displayName = "GraphCanvas";
|
|
35862
35909
|
}
|
|
35863
35910
|
});
|
|
35911
|
+
var ImportSourcePicker;
|
|
35912
|
+
var init_ImportSourcePicker = __esm({
|
|
35913
|
+
"components/core/molecules/import/ImportSourcePicker.tsx"() {
|
|
35914
|
+
"use client";
|
|
35915
|
+
init_Box();
|
|
35916
|
+
init_Icon();
|
|
35917
|
+
init_Typography();
|
|
35918
|
+
init_cn();
|
|
35919
|
+
ImportSourcePicker = ({
|
|
35920
|
+
sources,
|
|
35921
|
+
onSelect,
|
|
35922
|
+
onFilesSelected,
|
|
35923
|
+
title,
|
|
35924
|
+
moreSources,
|
|
35925
|
+
className
|
|
35926
|
+
}) => {
|
|
35927
|
+
const fileInputRef = useRef(null);
|
|
35928
|
+
const handlePick = (source) => {
|
|
35929
|
+
if (source.disabled) return;
|
|
35930
|
+
if (source.kind === "file") {
|
|
35931
|
+
const input = fileInputRef.current;
|
|
35932
|
+
if (!input) return;
|
|
35933
|
+
input.accept = source.accept ?? "";
|
|
35934
|
+
input.multiple = source.multiple ?? false;
|
|
35935
|
+
input.click();
|
|
35936
|
+
return;
|
|
35937
|
+
}
|
|
35938
|
+
onSelect?.(source.id);
|
|
35939
|
+
};
|
|
35940
|
+
const handleFiles = (event) => {
|
|
35941
|
+
const files = event.target.files ? Array.from(event.target.files) : [];
|
|
35942
|
+
event.target.value = "";
|
|
35943
|
+
if (files.length > 0) onFilesSelected?.(files);
|
|
35944
|
+
};
|
|
35945
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col gap-2", className), children: [
|
|
35946
|
+
title ? /* @__PURE__ */ jsx(Typography, { variant: "h4", children: title }) : null,
|
|
35947
|
+
sources.map((source) => /* @__PURE__ */ jsxs(
|
|
35948
|
+
Box,
|
|
35949
|
+
{
|
|
35950
|
+
role: "button",
|
|
35951
|
+
tabIndex: source.disabled ? -1 : 0,
|
|
35952
|
+
"aria-disabled": source.disabled,
|
|
35953
|
+
onClick: () => handlePick(source),
|
|
35954
|
+
onKeyDown: (event) => {
|
|
35955
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
35956
|
+
event.preventDefault();
|
|
35957
|
+
handlePick(source);
|
|
35958
|
+
}
|
|
35959
|
+
},
|
|
35960
|
+
className: cn(
|
|
35961
|
+
"flex items-center gap-3 rounded-md border border-border bg-card px-4 py-3 text-left",
|
|
35962
|
+
source.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:bg-accent hover:text-accent-foreground"
|
|
35963
|
+
),
|
|
35964
|
+
children: [
|
|
35965
|
+
source.icon ? /* @__PURE__ */ jsx(Icon, { icon: source.icon, size: "md" }) : null,
|
|
35966
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex flex-col", children: [
|
|
35967
|
+
/* @__PURE__ */ jsx(Typography, { variant: "label", children: source.label }),
|
|
35968
|
+
source.description ? /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: source.description }) : null
|
|
35969
|
+
] })
|
|
35970
|
+
]
|
|
35971
|
+
},
|
|
35972
|
+
source.id
|
|
35973
|
+
)),
|
|
35974
|
+
moreSources,
|
|
35975
|
+
/* @__PURE__ */ jsx(
|
|
35976
|
+
"input",
|
|
35977
|
+
{
|
|
35978
|
+
ref: fileInputRef,
|
|
35979
|
+
type: "file",
|
|
35980
|
+
className: "hidden",
|
|
35981
|
+
onChange: handleFiles,
|
|
35982
|
+
"data-testid": "import-source-file-input"
|
|
35983
|
+
}
|
|
35984
|
+
)
|
|
35985
|
+
] });
|
|
35986
|
+
};
|
|
35987
|
+
}
|
|
35988
|
+
});
|
|
35989
|
+
function formatFieldValue(value) {
|
|
35990
|
+
if (value === null) return "\u2014";
|
|
35991
|
+
if (value instanceof Date) return value.toISOString();
|
|
35992
|
+
if (Array.isArray(value)) return value.map(formatFieldValue).join(", ");
|
|
35993
|
+
if (typeof value === "object") return JSON.stringify(value);
|
|
35994
|
+
return String(value);
|
|
35995
|
+
}
|
|
35996
|
+
function unitTitle(unit) {
|
|
35997
|
+
for (const key of TITLE_KEYS) {
|
|
35998
|
+
const value = unit.fields[key];
|
|
35999
|
+
if (typeof value === "string" && value.length > 0) return value;
|
|
36000
|
+
}
|
|
36001
|
+
return unit.ref;
|
|
36002
|
+
}
|
|
36003
|
+
function fieldSummary(unit) {
|
|
36004
|
+
return Object.entries(unit.fields).filter(([key]) => !TITLE_KEYS.includes(key)).map(([key, value]) => `${key}: ${formatFieldValue(value)}`).join(" \xB7 ");
|
|
36005
|
+
}
|
|
36006
|
+
var TITLE_KEYS, ImportPreviewTree;
|
|
36007
|
+
var init_ImportPreviewTree = __esm({
|
|
36008
|
+
"components/core/molecules/import/ImportPreviewTree.tsx"() {
|
|
36009
|
+
"use client";
|
|
36010
|
+
init_Box();
|
|
36011
|
+
init_Badge();
|
|
36012
|
+
init_Button();
|
|
36013
|
+
init_Icon();
|
|
36014
|
+
init_Typography();
|
|
36015
|
+
init_cn();
|
|
36016
|
+
TITLE_KEYS = ["title", "name", "label"];
|
|
36017
|
+
ImportPreviewTree = ({
|
|
36018
|
+
units,
|
|
36019
|
+
skipped = [],
|
|
36020
|
+
entityDisplay,
|
|
36021
|
+
onConfirm,
|
|
36022
|
+
onCancel,
|
|
36023
|
+
confirmLabel = "Confirm import",
|
|
36024
|
+
cancelLabel = "Cancel",
|
|
36025
|
+
indent = 16,
|
|
36026
|
+
className
|
|
36027
|
+
}) => {
|
|
36028
|
+
const groups = /* @__PURE__ */ new Map();
|
|
36029
|
+
for (const unit of units) {
|
|
36030
|
+
const group = groups.get(unit.targetEntity);
|
|
36031
|
+
if (group) group.push(unit);
|
|
36032
|
+
else groups.set(unit.targetEntity, [unit]);
|
|
36033
|
+
}
|
|
36034
|
+
const renderUnit = (unit, childrenByParent, depth) => {
|
|
36035
|
+
const summary = fieldSummary(unit);
|
|
36036
|
+
const children = childrenByParent.get(unit.ref) ?? [];
|
|
36037
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
36038
|
+
/* @__PURE__ */ jsxs(
|
|
36039
|
+
Box,
|
|
36040
|
+
{
|
|
36041
|
+
className: "flex flex-col py-1",
|
|
36042
|
+
style: { paddingLeft: depth * indent },
|
|
36043
|
+
"data-testid": `import-preview-unit-${unit.ref}`,
|
|
36044
|
+
children: [
|
|
36045
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
36046
|
+
/* @__PURE__ */ jsx(Icon, { icon: "file-text", size: "xs", className: "text-muted-foreground" }),
|
|
36047
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", children: unitTitle(unit) })
|
|
36048
|
+
] }),
|
|
36049
|
+
summary ? /* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: summary }) : null
|
|
36050
|
+
]
|
|
36051
|
+
}
|
|
36052
|
+
),
|
|
36053
|
+
children.map((child) => renderUnit(child, childrenByParent, depth + 1))
|
|
36054
|
+
] }, unit.ref);
|
|
36055
|
+
};
|
|
36056
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col gap-4", className), children: [
|
|
36057
|
+
units.length === 0 ? /* @__PURE__ */ jsx(Typography, { variant: "body2", className: "text-muted-foreground", children: "No units staged." }) : null,
|
|
36058
|
+
Array.from(groups.entries()).map(([entity, groupUnits]) => {
|
|
36059
|
+
const refs = new Set(groupUnits.map((unit) => unit.ref));
|
|
36060
|
+
const childrenByParent = /* @__PURE__ */ new Map();
|
|
36061
|
+
const roots = [];
|
|
36062
|
+
for (const unit of groupUnits) {
|
|
36063
|
+
if (unit.parentRef && refs.has(unit.parentRef)) {
|
|
36064
|
+
const siblings = childrenByParent.get(unit.parentRef);
|
|
36065
|
+
if (siblings) siblings.push(unit);
|
|
36066
|
+
else childrenByParent.set(unit.parentRef, [unit]);
|
|
36067
|
+
} else {
|
|
36068
|
+
roots.push(unit);
|
|
36069
|
+
}
|
|
36070
|
+
}
|
|
36071
|
+
const label = entityDisplay[entity]?.plural ?? entity;
|
|
36072
|
+
return /* @__PURE__ */ jsxs(Box, { border: true, className: "rounded-md border-border bg-card p-3", children: [
|
|
36073
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2 pb-2", children: [
|
|
36074
|
+
/* @__PURE__ */ jsx(Typography, { variant: "label", children: label }),
|
|
36075
|
+
/* @__PURE__ */ jsx(Badge, { amount: groupUnits.length })
|
|
36076
|
+
] }),
|
|
36077
|
+
roots.map((unit) => renderUnit(unit, childrenByParent, 0))
|
|
36078
|
+
] }, entity);
|
|
36079
|
+
}),
|
|
36080
|
+
skipped.length > 0 ? /* @__PURE__ */ jsxs(Box, { border: true, className: "rounded-md border-border bg-card p-3", children: [
|
|
36081
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2 pb-2", children: [
|
|
36082
|
+
/* @__PURE__ */ jsx(Typography, { variant: "label", children: "Skipped" }),
|
|
36083
|
+
/* @__PURE__ */ jsx(Badge, { amount: skipped.length })
|
|
36084
|
+
] }),
|
|
36085
|
+
skipped.map((element) => /* @__PURE__ */ jsxs(Box, { className: "flex items-baseline gap-2 py-1", children: [
|
|
36086
|
+
/* @__PURE__ */ jsx(Typography, { variant: "body2", children: element.ref }),
|
|
36087
|
+
/* @__PURE__ */ jsx(Typography, { variant: "caption", className: "text-muted-foreground", children: element.reason })
|
|
36088
|
+
] }, element.ref))
|
|
36089
|
+
] }) : null,
|
|
36090
|
+
onConfirm || onCancel ? /* @__PURE__ */ jsxs(Box, { className: "flex items-center justify-end gap-2", children: [
|
|
36091
|
+
onCancel ? /* @__PURE__ */ jsx(Button, { variant: "default", label: cancelLabel, onClick: onCancel }) : null,
|
|
36092
|
+
onConfirm ? /* @__PURE__ */ jsx(Button, { variant: "primary", label: confirmLabel, onClick: onConfirm }) : null
|
|
36093
|
+
] }) : null
|
|
36094
|
+
] });
|
|
36095
|
+
};
|
|
36096
|
+
}
|
|
36097
|
+
});
|
|
36098
|
+
var PIPELINE, DEFAULT_LABELS, ImportProgress;
|
|
36099
|
+
var init_ImportProgress = __esm({
|
|
36100
|
+
"components/core/molecules/import/ImportProgress.tsx"() {
|
|
36101
|
+
"use client";
|
|
36102
|
+
init_Box();
|
|
36103
|
+
init_Badge();
|
|
36104
|
+
init_Icon();
|
|
36105
|
+
init_Typography();
|
|
36106
|
+
init_cn();
|
|
36107
|
+
PIPELINE = [
|
|
36108
|
+
"fetching",
|
|
36109
|
+
"mapping",
|
|
36110
|
+
"reviewing",
|
|
36111
|
+
"committing"
|
|
36112
|
+
];
|
|
36113
|
+
DEFAULT_LABELS = {
|
|
36114
|
+
fetching: "Fetching",
|
|
36115
|
+
mapping: "Mapping",
|
|
36116
|
+
reviewing: "Reviewing",
|
|
36117
|
+
committing: "Committing",
|
|
36118
|
+
done: "Done",
|
|
36119
|
+
failed: "Failed"
|
|
36120
|
+
};
|
|
36121
|
+
ImportProgress = ({
|
|
36122
|
+
step,
|
|
36123
|
+
counts,
|
|
36124
|
+
labels,
|
|
36125
|
+
className
|
|
36126
|
+
}) => {
|
|
36127
|
+
const label = (key) => labels?.[key] ?? DEFAULT_LABELS[key];
|
|
36128
|
+
const currentIndex = step === "done" || step === "failed" ? PIPELINE.length : PIPELINE.indexOf(step);
|
|
36129
|
+
return /* @__PURE__ */ jsxs(Box, { className: cn("flex flex-col gap-3", className), children: [
|
|
36130
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
36131
|
+
PIPELINE.map((key, index) => {
|
|
36132
|
+
const isComplete = index < currentIndex;
|
|
36133
|
+
const isActive = index === currentIndex;
|
|
36134
|
+
return /* @__PURE__ */ jsxs(React82__default.Fragment, { children: [
|
|
36135
|
+
index > 0 ? /* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }) : null,
|
|
36136
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${key}`, children: [
|
|
36137
|
+
/* @__PURE__ */ jsx(
|
|
36138
|
+
Icon,
|
|
36139
|
+
{
|
|
36140
|
+
icon: isComplete ? "check" : isActive ? "loader" : "circle",
|
|
36141
|
+
size: "sm",
|
|
36142
|
+
className: cn(
|
|
36143
|
+
isComplete ? "text-success" : isActive ? "text-primary" : "text-muted-foreground"
|
|
36144
|
+
)
|
|
36145
|
+
}
|
|
36146
|
+
),
|
|
36147
|
+
/* @__PURE__ */ jsx(
|
|
36148
|
+
Typography,
|
|
36149
|
+
{
|
|
36150
|
+
variant: "caption",
|
|
36151
|
+
className: cn(isActive ? "text-foreground" : "text-muted-foreground"),
|
|
36152
|
+
children: label(key)
|
|
36153
|
+
}
|
|
36154
|
+
)
|
|
36155
|
+
] })
|
|
36156
|
+
] }, key);
|
|
36157
|
+
}),
|
|
36158
|
+
step === "done" || step === "failed" ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
36159
|
+
/* @__PURE__ */ jsx(Box, { className: "h-px w-4 bg-border" }),
|
|
36160
|
+
/* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-1", "data-testid": `import-progress-step-${step}`, children: [
|
|
36161
|
+
/* @__PURE__ */ jsx(
|
|
36162
|
+
Icon,
|
|
36163
|
+
{
|
|
36164
|
+
icon: step === "done" ? "check" : "x",
|
|
36165
|
+
size: "sm",
|
|
36166
|
+
className: step === "done" ? "text-success" : "text-error"
|
|
36167
|
+
}
|
|
36168
|
+
),
|
|
36169
|
+
/* @__PURE__ */ jsx(
|
|
36170
|
+
Typography,
|
|
36171
|
+
{
|
|
36172
|
+
variant: "caption",
|
|
36173
|
+
className: step === "done" ? "text-success" : "text-error",
|
|
36174
|
+
children: label(step)
|
|
36175
|
+
}
|
|
36176
|
+
)
|
|
36177
|
+
] })
|
|
36178
|
+
] }) : null
|
|
36179
|
+
] }),
|
|
36180
|
+
counts ? /* @__PURE__ */ jsxs(Box, { className: "flex items-center gap-2", children: [
|
|
36181
|
+
counts.staged !== void 0 ? /* @__PURE__ */ jsx(Badge, { label: `Staged ${counts.staged}` }) : null,
|
|
36182
|
+
counts.committed !== void 0 ? /* @__PURE__ */ jsx(Badge, { variant: "success", label: `Committed ${counts.committed}` }) : null,
|
|
36183
|
+
counts.failed !== void 0 ? /* @__PURE__ */ jsx(Badge, { variant: "danger", label: `Failed ${counts.failed}` }) : null
|
|
36184
|
+
] }) : null
|
|
36185
|
+
] });
|
|
36186
|
+
};
|
|
36187
|
+
}
|
|
36188
|
+
});
|
|
36189
|
+
|
|
36190
|
+
// components/core/molecules/import/index.ts
|
|
36191
|
+
var init_import = __esm({
|
|
36192
|
+
"components/core/molecules/import/index.ts"() {
|
|
36193
|
+
}
|
|
36194
|
+
});
|
|
35864
36195
|
var ReflectionBlock;
|
|
35865
36196
|
var init_ReflectionBlock = __esm({
|
|
35866
36197
|
"components/core/molecules/ReflectionBlock.tsx"() {
|
|
@@ -35935,6 +36266,7 @@ var init_molecules2 = __esm({
|
|
|
35935
36266
|
init_EmptyState();
|
|
35936
36267
|
init_Pagination();
|
|
35937
36268
|
init_molecules();
|
|
36269
|
+
init_import();
|
|
35938
36270
|
}
|
|
35939
36271
|
});
|
|
35940
36272
|
|
|
@@ -36415,7 +36747,7 @@ function getBadgeVariant(fieldName, value) {
|
|
|
36415
36747
|
function formatFieldLabel(fieldName) {
|
|
36416
36748
|
return fieldName.replace(/([A-Z])/g, " $1").replace(/^./, (str) => str.toUpperCase());
|
|
36417
36749
|
}
|
|
36418
|
-
function
|
|
36750
|
+
function formatFieldValue2(value, fieldName) {
|
|
36419
36751
|
if (typeof value === "number") {
|
|
36420
36752
|
if (fieldName.toLowerCase().includes("progress") || fieldName.toLowerCase().includes("percent")) {
|
|
36421
36753
|
return `${value}%`;
|
|
@@ -36510,7 +36842,7 @@ function renderRichFieldValue(value, fieldName, fieldType) {
|
|
|
36510
36842
|
return str;
|
|
36511
36843
|
}
|
|
36512
36844
|
default:
|
|
36513
|
-
return
|
|
36845
|
+
return formatFieldValue2(value, fieldName);
|
|
36514
36846
|
}
|
|
36515
36847
|
}
|
|
36516
36848
|
function normalizeFieldDefs(fields) {
|
|
@@ -36621,7 +36953,7 @@ var init_DetailPanel = __esm({
|
|
|
36621
36953
|
const value = getNestedValue(normalizedData, field);
|
|
36622
36954
|
return {
|
|
36623
36955
|
label: labelFor(field),
|
|
36624
|
-
value:
|
|
36956
|
+
value: formatFieldValue2(value, field),
|
|
36625
36957
|
icon: getFieldIcon(field)
|
|
36626
36958
|
};
|
|
36627
36959
|
}
|
|
@@ -42652,6 +42984,9 @@ var init_component_registry_generated = __esm({
|
|
|
42652
42984
|
init_HeroOrganism();
|
|
42653
42985
|
init_HeroSection();
|
|
42654
42986
|
init_Icon();
|
|
42987
|
+
init_ImportPreviewTree();
|
|
42988
|
+
init_ImportProgress();
|
|
42989
|
+
init_ImportSourcePicker();
|
|
42655
42990
|
init_InfiniteScrollSentinel();
|
|
42656
42991
|
init_Input();
|
|
42657
42992
|
init_InputGroup();
|
|
@@ -42915,6 +43250,9 @@ var init_component_registry_generated = __esm({
|
|
|
42915
43250
|
"HeroOrganism": HeroOrganism,
|
|
42916
43251
|
"HeroSection": HeroSection,
|
|
42917
43252
|
"Icon": Icon,
|
|
43253
|
+
"ImportPreviewTree": ImportPreviewTree,
|
|
43254
|
+
"ImportProgress": ImportProgress,
|
|
43255
|
+
"ImportSourcePicker": ImportSourcePicker,
|
|
42918
43256
|
"InfiniteScrollSentinel": InfiniteScrollSentinel,
|
|
42919
43257
|
"Input": Input,
|
|
42920
43258
|
"InputGroup": InputGroup,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@almadar/ui",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.130.0",
|
|
4
4
|
"description": "React UI components, hooks, and providers for Almadar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
"index.css",
|
|
111
111
|
"themes",
|
|
112
112
|
"locales",
|
|
113
|
+
"scripts",
|
|
113
114
|
"tailwind-preset.cjs"
|
|
114
115
|
],
|
|
115
116
|
"publishConfig": {
|
|
@@ -117,12 +118,12 @@
|
|
|
117
118
|
"access": "public"
|
|
118
119
|
},
|
|
119
120
|
"dependencies": {
|
|
120
|
-
"@almadar/core": "^10.
|
|
121
|
+
"@almadar/core": "^10.38.0",
|
|
121
122
|
"@almadar/evaluator": "^2.37.0",
|
|
122
123
|
"@almadar/logger": "^1.10.0",
|
|
123
|
-
"@almadar/runtime": "^6.
|
|
124
|
-
"@almadar/std": "^16.
|
|
125
|
-
"@almadar/syntax": "^1.
|
|
124
|
+
"@almadar/runtime": "^6.41.0",
|
|
125
|
+
"@almadar/std": "^16.148.0",
|
|
126
|
+
"@almadar/syntax": "^1.13.0",
|
|
126
127
|
"@dnd-kit/core": "^6.3.1",
|
|
127
128
|
"@dnd-kit/sortable": "^10.0.0",
|
|
128
129
|
"@dnd-kit/utilities": "^3.2.2",
|