@almadar/ui 4.1.0 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/avl/index.cjs +23 -2
- package/dist/avl/index.js +23 -2
- package/dist/components/index.cjs +23 -2
- package/dist/components/index.js +23 -2
- package/dist/components/molecules/DataGrid.d.ts +10 -0
- package/dist/providers/index.cjs +23 -2
- package/dist/providers/index.js +23 -2
- package/dist/runtime/index.cjs +23 -2
- package/dist/runtime/index.js +23 -2
- package/package.json +1 -1
package/dist/avl/index.cjs
CHANGED
|
@@ -21738,6 +21738,16 @@ function statusVariant2(value) {
|
|
|
21738
21738
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
21739
21739
|
return "default";
|
|
21740
21740
|
}
|
|
21741
|
+
function resolveBadgeVariant(field, value) {
|
|
21742
|
+
const fromMap = field.colorMap?.[value];
|
|
21743
|
+
if (fromMap) {
|
|
21744
|
+
const normalised = fromMap === "destructive" ? "danger" : fromMap;
|
|
21745
|
+
if (BADGE_VARIANTS.has(normalised)) {
|
|
21746
|
+
return normalised;
|
|
21747
|
+
}
|
|
21748
|
+
}
|
|
21749
|
+
return statusVariant2(value);
|
|
21750
|
+
}
|
|
21741
21751
|
function formatDate2(value) {
|
|
21742
21752
|
if (!value) return "";
|
|
21743
21753
|
const d = new Date(String(value));
|
|
@@ -21951,7 +21961,7 @@ function DataGrid({
|
|
|
21951
21961
|
if (val === void 0 || val === null) return null;
|
|
21952
21962
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
21953
21963
|
field.icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: field.icon, size: "xs" }),
|
|
21954
|
-
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant:
|
|
21964
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
|
|
21955
21965
|
] }, field.name);
|
|
21956
21966
|
}) })
|
|
21957
21967
|
] }),
|
|
@@ -22044,7 +22054,7 @@ function DataGrid({
|
|
|
22044
22054
|
)
|
|
22045
22055
|
] });
|
|
22046
22056
|
}
|
|
22047
|
-
var gapStyles6;
|
|
22057
|
+
var BADGE_VARIANTS, gapStyles6;
|
|
22048
22058
|
var init_DataGrid = __esm({
|
|
22049
22059
|
"components/molecules/DataGrid.tsx"() {
|
|
22050
22060
|
"use client";
|
|
@@ -22059,6 +22069,17 @@ var init_DataGrid = __esm({
|
|
|
22059
22069
|
init_Button();
|
|
22060
22070
|
init_Icon();
|
|
22061
22071
|
init_InfiniteScrollSentinel();
|
|
22072
|
+
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
22073
|
+
"default",
|
|
22074
|
+
"primary",
|
|
22075
|
+
"secondary",
|
|
22076
|
+
"success",
|
|
22077
|
+
"warning",
|
|
22078
|
+
"danger",
|
|
22079
|
+
"error",
|
|
22080
|
+
"info",
|
|
22081
|
+
"neutral"
|
|
22082
|
+
]);
|
|
22062
22083
|
gapStyles6 = {
|
|
22063
22084
|
none: "gap-0",
|
|
22064
22085
|
sm: "gap-2",
|
package/dist/avl/index.js
CHANGED
|
@@ -21692,6 +21692,16 @@ function statusVariant2(value) {
|
|
|
21692
21692
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
21693
21693
|
return "default";
|
|
21694
21694
|
}
|
|
21695
|
+
function resolveBadgeVariant(field, value) {
|
|
21696
|
+
const fromMap = field.colorMap?.[value];
|
|
21697
|
+
if (fromMap) {
|
|
21698
|
+
const normalised = fromMap === "destructive" ? "danger" : fromMap;
|
|
21699
|
+
if (BADGE_VARIANTS.has(normalised)) {
|
|
21700
|
+
return normalised;
|
|
21701
|
+
}
|
|
21702
|
+
}
|
|
21703
|
+
return statusVariant2(value);
|
|
21704
|
+
}
|
|
21695
21705
|
function formatDate2(value) {
|
|
21696
21706
|
if (!value) return "";
|
|
21697
21707
|
const d = new Date(String(value));
|
|
@@ -21905,7 +21915,7 @@ function DataGrid({
|
|
|
21905
21915
|
if (val === void 0 || val === null) return null;
|
|
21906
21916
|
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
21907
21917
|
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
|
|
21908
|
-
/* @__PURE__ */ jsx(Badge, { variant:
|
|
21918
|
+
/* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
|
|
21909
21919
|
] }, field.name);
|
|
21910
21920
|
}) })
|
|
21911
21921
|
] }),
|
|
@@ -21998,7 +22008,7 @@ function DataGrid({
|
|
|
21998
22008
|
)
|
|
21999
22009
|
] });
|
|
22000
22010
|
}
|
|
22001
|
-
var gapStyles6;
|
|
22011
|
+
var BADGE_VARIANTS, gapStyles6;
|
|
22002
22012
|
var init_DataGrid = __esm({
|
|
22003
22013
|
"components/molecules/DataGrid.tsx"() {
|
|
22004
22014
|
"use client";
|
|
@@ -22013,6 +22023,17 @@ var init_DataGrid = __esm({
|
|
|
22013
22023
|
init_Button();
|
|
22014
22024
|
init_Icon();
|
|
22015
22025
|
init_InfiniteScrollSentinel();
|
|
22026
|
+
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
22027
|
+
"default",
|
|
22028
|
+
"primary",
|
|
22029
|
+
"secondary",
|
|
22030
|
+
"success",
|
|
22031
|
+
"warning",
|
|
22032
|
+
"danger",
|
|
22033
|
+
"error",
|
|
22034
|
+
"info",
|
|
22035
|
+
"neutral"
|
|
22036
|
+
]);
|
|
22016
22037
|
gapStyles6 = {
|
|
22017
22038
|
none: "gap-0",
|
|
22018
22039
|
sm: "gap-2",
|
|
@@ -17266,6 +17266,16 @@ function statusVariant2(value) {
|
|
|
17266
17266
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
17267
17267
|
return "default";
|
|
17268
17268
|
}
|
|
17269
|
+
function resolveBadgeVariant(field, value) {
|
|
17270
|
+
const fromMap = field.colorMap?.[value];
|
|
17271
|
+
if (fromMap) {
|
|
17272
|
+
const normalised = fromMap === "destructive" ? "danger" : fromMap;
|
|
17273
|
+
if (BADGE_VARIANTS.has(normalised)) {
|
|
17274
|
+
return normalised;
|
|
17275
|
+
}
|
|
17276
|
+
}
|
|
17277
|
+
return statusVariant2(value);
|
|
17278
|
+
}
|
|
17269
17279
|
function formatDate2(value) {
|
|
17270
17280
|
if (!value) return "";
|
|
17271
17281
|
const d = new Date(String(value));
|
|
@@ -17479,7 +17489,7 @@ function DataGrid({
|
|
|
17479
17489
|
if (val === void 0 || val === null) return null;
|
|
17480
17490
|
return /* @__PURE__ */ jsxRuntime.jsxs(exports.HStack, { gap: "xs", className: "items-center", children: [
|
|
17481
17491
|
field.icon && /* @__PURE__ */ jsxRuntime.jsx(exports.Icon, { name: field.icon, size: "xs" }),
|
|
17482
|
-
/* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant:
|
|
17492
|
+
/* @__PURE__ */ jsxRuntime.jsx(exports.Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
|
|
17483
17493
|
] }, field.name);
|
|
17484
17494
|
}) })
|
|
17485
17495
|
] }),
|
|
@@ -17572,7 +17582,7 @@ function DataGrid({
|
|
|
17572
17582
|
)
|
|
17573
17583
|
] });
|
|
17574
17584
|
}
|
|
17575
|
-
var gapStyles6;
|
|
17585
|
+
var BADGE_VARIANTS, gapStyles6;
|
|
17576
17586
|
var init_DataGrid = __esm({
|
|
17577
17587
|
"components/molecules/DataGrid.tsx"() {
|
|
17578
17588
|
"use client";
|
|
@@ -17587,6 +17597,17 @@ var init_DataGrid = __esm({
|
|
|
17587
17597
|
init_Button();
|
|
17588
17598
|
init_Icon();
|
|
17589
17599
|
init_InfiniteScrollSentinel();
|
|
17600
|
+
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
17601
|
+
"default",
|
|
17602
|
+
"primary",
|
|
17603
|
+
"secondary",
|
|
17604
|
+
"success",
|
|
17605
|
+
"warning",
|
|
17606
|
+
"danger",
|
|
17607
|
+
"error",
|
|
17608
|
+
"info",
|
|
17609
|
+
"neutral"
|
|
17610
|
+
]);
|
|
17590
17611
|
gapStyles6 = {
|
|
17591
17612
|
none: "gap-0",
|
|
17592
17613
|
sm: "gap-2",
|
package/dist/components/index.js
CHANGED
|
@@ -17221,6 +17221,16 @@ function statusVariant2(value) {
|
|
|
17221
17221
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
17222
17222
|
return "default";
|
|
17223
17223
|
}
|
|
17224
|
+
function resolveBadgeVariant(field, value) {
|
|
17225
|
+
const fromMap = field.colorMap?.[value];
|
|
17226
|
+
if (fromMap) {
|
|
17227
|
+
const normalised = fromMap === "destructive" ? "danger" : fromMap;
|
|
17228
|
+
if (BADGE_VARIANTS.has(normalised)) {
|
|
17229
|
+
return normalised;
|
|
17230
|
+
}
|
|
17231
|
+
}
|
|
17232
|
+
return statusVariant2(value);
|
|
17233
|
+
}
|
|
17224
17234
|
function formatDate2(value) {
|
|
17225
17235
|
if (!value) return "";
|
|
17226
17236
|
const d = new Date(String(value));
|
|
@@ -17434,7 +17444,7 @@ function DataGrid({
|
|
|
17434
17444
|
if (val === void 0 || val === null) return null;
|
|
17435
17445
|
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
17436
17446
|
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
|
|
17437
|
-
/* @__PURE__ */ jsx(Badge, { variant:
|
|
17447
|
+
/* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
|
|
17438
17448
|
] }, field.name);
|
|
17439
17449
|
}) })
|
|
17440
17450
|
] }),
|
|
@@ -17527,7 +17537,7 @@ function DataGrid({
|
|
|
17527
17537
|
)
|
|
17528
17538
|
] });
|
|
17529
17539
|
}
|
|
17530
|
-
var gapStyles6;
|
|
17540
|
+
var BADGE_VARIANTS, gapStyles6;
|
|
17531
17541
|
var init_DataGrid = __esm({
|
|
17532
17542
|
"components/molecules/DataGrid.tsx"() {
|
|
17533
17543
|
"use client";
|
|
@@ -17542,6 +17552,17 @@ var init_DataGrid = __esm({
|
|
|
17542
17552
|
init_Button();
|
|
17543
17553
|
init_Icon();
|
|
17544
17554
|
init_InfiniteScrollSentinel();
|
|
17555
|
+
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
17556
|
+
"default",
|
|
17557
|
+
"primary",
|
|
17558
|
+
"secondary",
|
|
17559
|
+
"success",
|
|
17560
|
+
"warning",
|
|
17561
|
+
"danger",
|
|
17562
|
+
"error",
|
|
17563
|
+
"info",
|
|
17564
|
+
"neutral"
|
|
17565
|
+
]);
|
|
17545
17566
|
gapStyles6 = {
|
|
17546
17567
|
none: "gap-0",
|
|
17547
17568
|
sm: "gap-2",
|
|
@@ -24,6 +24,16 @@ export interface DataGridField {
|
|
|
24
24
|
variant?: 'h3' | 'h4' | 'body' | 'caption' | 'badge' | 'small' | 'progress';
|
|
25
25
|
/** Optional format function name: 'date', 'currency', 'number', 'boolean' */
|
|
26
26
|
format?: 'date' | 'currency' | 'number' | 'boolean' | 'percent';
|
|
27
|
+
/**
|
|
28
|
+
* Per-value color mapping for `variant: 'badge'`. Keys are exact field
|
|
29
|
+
* values; values are Badge variant names. Accepts the shadcn-style
|
|
30
|
+
* `destructive` alias and normalises it to `danger` at render time. When
|
|
31
|
+
* present, takes precedence over the built-in `statusVariant` heuristic.
|
|
32
|
+
*
|
|
33
|
+
* Example:
|
|
34
|
+
* colorMap: { active: 'success', pending: 'warning', failed: 'destructive' }
|
|
35
|
+
*/
|
|
36
|
+
colorMap?: Record<string, string>;
|
|
27
37
|
}
|
|
28
38
|
export interface DataGridItemAction {
|
|
29
39
|
/** Button label */
|
package/dist/providers/index.cjs
CHANGED
|
@@ -18578,6 +18578,16 @@ function statusVariant2(value) {
|
|
|
18578
18578
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
18579
18579
|
return "default";
|
|
18580
18580
|
}
|
|
18581
|
+
function resolveBadgeVariant(field, value) {
|
|
18582
|
+
const fromMap = field.colorMap?.[value];
|
|
18583
|
+
if (fromMap) {
|
|
18584
|
+
const normalised = fromMap === "destructive" ? "danger" : fromMap;
|
|
18585
|
+
if (BADGE_VARIANTS.has(normalised)) {
|
|
18586
|
+
return normalised;
|
|
18587
|
+
}
|
|
18588
|
+
}
|
|
18589
|
+
return statusVariant2(value);
|
|
18590
|
+
}
|
|
18581
18591
|
function formatDate2(value) {
|
|
18582
18592
|
if (!value) return "";
|
|
18583
18593
|
const d = new Date(String(value));
|
|
@@ -18791,7 +18801,7 @@ function DataGrid({
|
|
|
18791
18801
|
if (val === void 0 || val === null) return null;
|
|
18792
18802
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
18793
18803
|
field.icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: field.icon, size: "xs" }),
|
|
18794
|
-
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant:
|
|
18804
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
|
|
18795
18805
|
] }, field.name);
|
|
18796
18806
|
}) })
|
|
18797
18807
|
] }),
|
|
@@ -18884,7 +18894,7 @@ function DataGrid({
|
|
|
18884
18894
|
)
|
|
18885
18895
|
] });
|
|
18886
18896
|
}
|
|
18887
|
-
var gapStyles6;
|
|
18897
|
+
var BADGE_VARIANTS, gapStyles6;
|
|
18888
18898
|
var init_DataGrid = __esm({
|
|
18889
18899
|
"components/molecules/DataGrid.tsx"() {
|
|
18890
18900
|
"use client";
|
|
@@ -18899,6 +18909,17 @@ var init_DataGrid = __esm({
|
|
|
18899
18909
|
init_Button();
|
|
18900
18910
|
init_Icon();
|
|
18901
18911
|
init_InfiniteScrollSentinel();
|
|
18912
|
+
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
18913
|
+
"default",
|
|
18914
|
+
"primary",
|
|
18915
|
+
"secondary",
|
|
18916
|
+
"success",
|
|
18917
|
+
"warning",
|
|
18918
|
+
"danger",
|
|
18919
|
+
"error",
|
|
18920
|
+
"info",
|
|
18921
|
+
"neutral"
|
|
18922
|
+
]);
|
|
18902
18923
|
gapStyles6 = {
|
|
18903
18924
|
none: "gap-0",
|
|
18904
18925
|
sm: "gap-2",
|
package/dist/providers/index.js
CHANGED
|
@@ -18533,6 +18533,16 @@ function statusVariant2(value) {
|
|
|
18533
18533
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
18534
18534
|
return "default";
|
|
18535
18535
|
}
|
|
18536
|
+
function resolveBadgeVariant(field, value) {
|
|
18537
|
+
const fromMap = field.colorMap?.[value];
|
|
18538
|
+
if (fromMap) {
|
|
18539
|
+
const normalised = fromMap === "destructive" ? "danger" : fromMap;
|
|
18540
|
+
if (BADGE_VARIANTS.has(normalised)) {
|
|
18541
|
+
return normalised;
|
|
18542
|
+
}
|
|
18543
|
+
}
|
|
18544
|
+
return statusVariant2(value);
|
|
18545
|
+
}
|
|
18536
18546
|
function formatDate2(value) {
|
|
18537
18547
|
if (!value) return "";
|
|
18538
18548
|
const d = new Date(String(value));
|
|
@@ -18746,7 +18756,7 @@ function DataGrid({
|
|
|
18746
18756
|
if (val === void 0 || val === null) return null;
|
|
18747
18757
|
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
18748
18758
|
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
|
|
18749
|
-
/* @__PURE__ */ jsx(Badge, { variant:
|
|
18759
|
+
/* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
|
|
18750
18760
|
] }, field.name);
|
|
18751
18761
|
}) })
|
|
18752
18762
|
] }),
|
|
@@ -18839,7 +18849,7 @@ function DataGrid({
|
|
|
18839
18849
|
)
|
|
18840
18850
|
] });
|
|
18841
18851
|
}
|
|
18842
|
-
var gapStyles6;
|
|
18852
|
+
var BADGE_VARIANTS, gapStyles6;
|
|
18843
18853
|
var init_DataGrid = __esm({
|
|
18844
18854
|
"components/molecules/DataGrid.tsx"() {
|
|
18845
18855
|
"use client";
|
|
@@ -18854,6 +18864,17 @@ var init_DataGrid = __esm({
|
|
|
18854
18864
|
init_Button();
|
|
18855
18865
|
init_Icon();
|
|
18856
18866
|
init_InfiniteScrollSentinel();
|
|
18867
|
+
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
18868
|
+
"default",
|
|
18869
|
+
"primary",
|
|
18870
|
+
"secondary",
|
|
18871
|
+
"success",
|
|
18872
|
+
"warning",
|
|
18873
|
+
"danger",
|
|
18874
|
+
"error",
|
|
18875
|
+
"info",
|
|
18876
|
+
"neutral"
|
|
18877
|
+
]);
|
|
18857
18878
|
gapStyles6 = {
|
|
18858
18879
|
none: "gap-0",
|
|
18859
18880
|
sm: "gap-2",
|
package/dist/runtime/index.cjs
CHANGED
|
@@ -18382,6 +18382,16 @@ function statusVariant2(value) {
|
|
|
18382
18382
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
18383
18383
|
return "default";
|
|
18384
18384
|
}
|
|
18385
|
+
function resolveBadgeVariant(field, value) {
|
|
18386
|
+
const fromMap = field.colorMap?.[value];
|
|
18387
|
+
if (fromMap) {
|
|
18388
|
+
const normalised = fromMap === "destructive" ? "danger" : fromMap;
|
|
18389
|
+
if (BADGE_VARIANTS.has(normalised)) {
|
|
18390
|
+
return normalised;
|
|
18391
|
+
}
|
|
18392
|
+
}
|
|
18393
|
+
return statusVariant2(value);
|
|
18394
|
+
}
|
|
18385
18395
|
function formatDate2(value) {
|
|
18386
18396
|
if (!value) return "";
|
|
18387
18397
|
const d = new Date(String(value));
|
|
@@ -18595,7 +18605,7 @@ function DataGrid({
|
|
|
18595
18605
|
if (val === void 0 || val === null) return null;
|
|
18596
18606
|
return /* @__PURE__ */ jsxRuntime.jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
18597
18607
|
field.icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { name: field.icon, size: "xs" }),
|
|
18598
|
-
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant:
|
|
18608
|
+
/* @__PURE__ */ jsxRuntime.jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
|
|
18599
18609
|
] }, field.name);
|
|
18600
18610
|
}) })
|
|
18601
18611
|
] }),
|
|
@@ -18688,7 +18698,7 @@ function DataGrid({
|
|
|
18688
18698
|
)
|
|
18689
18699
|
] });
|
|
18690
18700
|
}
|
|
18691
|
-
var gapStyles6;
|
|
18701
|
+
var BADGE_VARIANTS, gapStyles6;
|
|
18692
18702
|
var init_DataGrid = __esm({
|
|
18693
18703
|
"components/molecules/DataGrid.tsx"() {
|
|
18694
18704
|
"use client";
|
|
@@ -18703,6 +18713,17 @@ var init_DataGrid = __esm({
|
|
|
18703
18713
|
init_Button();
|
|
18704
18714
|
init_Icon();
|
|
18705
18715
|
init_InfiniteScrollSentinel();
|
|
18716
|
+
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
18717
|
+
"default",
|
|
18718
|
+
"primary",
|
|
18719
|
+
"secondary",
|
|
18720
|
+
"success",
|
|
18721
|
+
"warning",
|
|
18722
|
+
"danger",
|
|
18723
|
+
"error",
|
|
18724
|
+
"info",
|
|
18725
|
+
"neutral"
|
|
18726
|
+
]);
|
|
18706
18727
|
gapStyles6 = {
|
|
18707
18728
|
none: "gap-0",
|
|
18708
18729
|
sm: "gap-2",
|
package/dist/runtime/index.js
CHANGED
|
@@ -18337,6 +18337,16 @@ function statusVariant2(value) {
|
|
|
18337
18337
|
if (["new", "created", "scheduled", "queued", "info"].includes(v)) return "info";
|
|
18338
18338
|
return "default";
|
|
18339
18339
|
}
|
|
18340
|
+
function resolveBadgeVariant(field, value) {
|
|
18341
|
+
const fromMap = field.colorMap?.[value];
|
|
18342
|
+
if (fromMap) {
|
|
18343
|
+
const normalised = fromMap === "destructive" ? "danger" : fromMap;
|
|
18344
|
+
if (BADGE_VARIANTS.has(normalised)) {
|
|
18345
|
+
return normalised;
|
|
18346
|
+
}
|
|
18347
|
+
}
|
|
18348
|
+
return statusVariant2(value);
|
|
18349
|
+
}
|
|
18340
18350
|
function formatDate2(value) {
|
|
18341
18351
|
if (!value) return "";
|
|
18342
18352
|
const d = new Date(String(value));
|
|
@@ -18550,7 +18560,7 @@ function DataGrid({
|
|
|
18550
18560
|
if (val === void 0 || val === null) return null;
|
|
18551
18561
|
return /* @__PURE__ */ jsxs(HStack, { gap: "xs", className: "items-center", children: [
|
|
18552
18562
|
field.icon && /* @__PURE__ */ jsx(Icon, { name: field.icon, size: "xs" }),
|
|
18553
|
-
/* @__PURE__ */ jsx(Badge, { variant:
|
|
18563
|
+
/* @__PURE__ */ jsx(Badge, { variant: resolveBadgeVariant(field, String(val)), children: String(val) })
|
|
18554
18564
|
] }, field.name);
|
|
18555
18565
|
}) })
|
|
18556
18566
|
] }),
|
|
@@ -18643,7 +18653,7 @@ function DataGrid({
|
|
|
18643
18653
|
)
|
|
18644
18654
|
] });
|
|
18645
18655
|
}
|
|
18646
|
-
var gapStyles6;
|
|
18656
|
+
var BADGE_VARIANTS, gapStyles6;
|
|
18647
18657
|
var init_DataGrid = __esm({
|
|
18648
18658
|
"components/molecules/DataGrid.tsx"() {
|
|
18649
18659
|
"use client";
|
|
@@ -18658,6 +18668,17 @@ var init_DataGrid = __esm({
|
|
|
18658
18668
|
init_Button();
|
|
18659
18669
|
init_Icon();
|
|
18660
18670
|
init_InfiniteScrollSentinel();
|
|
18671
|
+
BADGE_VARIANTS = /* @__PURE__ */ new Set([
|
|
18672
|
+
"default",
|
|
18673
|
+
"primary",
|
|
18674
|
+
"secondary",
|
|
18675
|
+
"success",
|
|
18676
|
+
"warning",
|
|
18677
|
+
"danger",
|
|
18678
|
+
"error",
|
|
18679
|
+
"info",
|
|
18680
|
+
"neutral"
|
|
18681
|
+
]);
|
|
18661
18682
|
gapStyles6 = {
|
|
18662
18683
|
none: "gap-0",
|
|
18663
18684
|
sm: "gap-2",
|