@sfperusacdev/sf-ui 0.1.32 → 0.1.33
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/sf-ui.css +1 -1
- package/dist/sf-ui.js +45 -45
- package/dist/sf-ui.js.map +1 -1
- package/dist/sf-ui.umd.cjs +1 -1
- package/dist/sf-ui.umd.cjs.map +1 -1
- package/dist/types/src/components/cards/KPICard.d.ts +4 -1
- package/dist/types/src/components/dashboard/DetailSidePanel.d.ts +4 -1
- package/package.json +1 -1
package/dist/sf-ui.js
CHANGED
|
@@ -9325,13 +9325,13 @@ var dr = (e) => {
|
|
|
9325
9325
|
red: "var(--sf-kpi-accent-red)",
|
|
9326
9326
|
teal: "var(--sf-kpi-accent-teal)",
|
|
9327
9327
|
slate: "var(--sf-kpi-accent-slate)"
|
|
9328
|
-
}, Ho = (e) => `${e > 0 ? "+" : ""}${e}%`, Uo = (e) => typeof e == "number" ? e.toLocaleString("es-PE") : e, Wo = (e, t) => !Number.isFinite(e) || !Number.isFinite(t) || t <= 0 ? null : Math.min(100, Math.max(0, e / t * 100)), Go = ({ label: e, value: t, sublabel: n, icon: r, iconClassName: i, trend: a, trendLabel: o, accentTone: s, progress: c, layout: l = "stacked", accentBar: u, iconStyle: d = "solid",
|
|
9329
|
-
let
|
|
9330
|
-
|
|
9331
|
-
},
|
|
9328
|
+
}, Ho = (e) => `${e > 0 ? "+" : ""}${e}%`, Uo = (e) => typeof e == "number" ? e.toLocaleString("es-PE") : e, Wo = (e, t) => !Number.isFinite(e) || !Number.isFinite(t) || t <= 0 ? null : Math.min(100, Math.max(0, e / t * 100)), Go = ({ label: e, value: t, sublabel: n, icon: r, iconClassName: i, trend: a, trendLabel: o, accentTone: s, progress: c, layout: l = "stacked", accentBar: u, iconStyle: d = "solid", labelWrap: f = !1, className: p, onClick: m }) => {
|
|
9329
|
+
let h = a != null, g = h && a >= 0, _ = c ? Wo(c.value, c.max) : null, b = c?.label ?? (_ === null ? void 0 : `${Math.round(_)}%`), x = u ?? l === "stacked", S = (e) => {
|
|
9330
|
+
m && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), m());
|
|
9331
|
+
}, C = _ !== null && /* @__PURE__ */ y("div", {
|
|
9332
9332
|
className: "mt-2 flex items-center gap-2",
|
|
9333
9333
|
role: "progressbar",
|
|
9334
|
-
"aria-valuenow": Math.round(
|
|
9334
|
+
"aria-valuenow": Math.round(_),
|
|
9335
9335
|
"aria-valuemin": 0,
|
|
9336
9336
|
"aria-valuemax": 100,
|
|
9337
9337
|
children: [/* @__PURE__ */ v("div", {
|
|
@@ -9339,13 +9339,13 @@ var dr = (e) => {
|
|
|
9339
9339
|
children: /* @__PURE__ */ v("div", {
|
|
9340
9340
|
className: "h-full rounded-full transition-[width]",
|
|
9341
9341
|
style: {
|
|
9342
|
-
width: `${
|
|
9342
|
+
width: `${_}%`,
|
|
9343
9343
|
backgroundColor: s ? Vo[s] : "var(--sf-kpi-accent-slate)"
|
|
9344
9344
|
}
|
|
9345
9345
|
})
|
|
9346
|
-
}),
|
|
9346
|
+
}), b && /* @__PURE__ */ v("span", {
|
|
9347
9347
|
className: "shrink-0 text-xs font-semibold tabular-nums sf-card-muted",
|
|
9348
|
-
children:
|
|
9348
|
+
children: b
|
|
9349
9349
|
})]
|
|
9350
9350
|
});
|
|
9351
9351
|
if (l === "leading-icon") {
|
|
@@ -9354,11 +9354,11 @@ var dr = (e) => {
|
|
|
9354
9354
|
color: a
|
|
9355
9355
|
} : { background: a };
|
|
9356
9356
|
return /* @__PURE__ */ y("div", {
|
|
9357
|
-
className: (0, Y.default)("sf-card p-5 flex items-center gap-3", s &&
|
|
9358
|
-
onClick:
|
|
9359
|
-
onKeyDown:
|
|
9360
|
-
role:
|
|
9361
|
-
tabIndex:
|
|
9357
|
+
className: (0, Y.default)("sf-card p-5 flex items-center gap-3", s && x && "sf-kpi-card", s && x && Bo[s], m && "sf-card--interactive", p),
|
|
9358
|
+
onClick: m,
|
|
9359
|
+
onKeyDown: S,
|
|
9360
|
+
role: m ? "button" : void 0,
|
|
9361
|
+
tabIndex: m ? 0 : void 0,
|
|
9362
9362
|
children: [
|
|
9363
9363
|
r && /* @__PURE__ */ v("span", {
|
|
9364
9364
|
className: (0, Y.default)("sf-kpi-tile", d === "soft" && "sf-kpi-tile--soft", i),
|
|
@@ -9370,20 +9370,20 @@ var dr = (e) => {
|
|
|
9370
9370
|
className: "min-w-0 flex-1",
|
|
9371
9371
|
children: [
|
|
9372
9372
|
/* @__PURE__ */ v("p", {
|
|
9373
|
-
className: "truncate text-sm font-medium sf-card-subtitle",
|
|
9373
|
+
className: (0, Y.default)(f ? "sf-kpi-card__label--wrap" : "truncate", "text-sm font-medium sf-card-subtitle"),
|
|
9374
9374
|
children: e
|
|
9375
9375
|
}),
|
|
9376
9376
|
/* @__PURE__ */ v("p", {
|
|
9377
9377
|
className: "text-[28px] font-bold tabular-nums sf-card-title",
|
|
9378
9378
|
children: Uo(t)
|
|
9379
9379
|
}),
|
|
9380
|
-
|
|
9380
|
+
_ === null ? n && /* @__PURE__ */ v("p", {
|
|
9381
9381
|
className: "mt-1 text-xs sf-card-muted",
|
|
9382
9382
|
children: n
|
|
9383
|
-
}) :
|
|
9383
|
+
}) : C
|
|
9384
9384
|
]
|
|
9385
9385
|
}),
|
|
9386
|
-
|
|
9386
|
+
m && /* @__PURE__ */ v("span", {
|
|
9387
9387
|
className: "sf-kpi-chevron",
|
|
9388
9388
|
"aria-hidden": "true",
|
|
9389
9389
|
children: /* @__PURE__ */ v(st, {})
|
|
@@ -9392,11 +9392,11 @@ var dr = (e) => {
|
|
|
9392
9392
|
});
|
|
9393
9393
|
}
|
|
9394
9394
|
return /* @__PURE__ */ y("div", {
|
|
9395
|
-
className: (0, Y.default)("sf-card p-4", s &&
|
|
9396
|
-
onClick:
|
|
9397
|
-
onKeyDown:
|
|
9398
|
-
role:
|
|
9399
|
-
tabIndex:
|
|
9395
|
+
className: (0, Y.default)("sf-card p-4", s && x && "sf-kpi-card", s && x && Bo[s], m && "sf-card--interactive", p),
|
|
9396
|
+
onClick: m,
|
|
9397
|
+
onKeyDown: S,
|
|
9398
|
+
role: m ? "button" : void 0,
|
|
9399
|
+
tabIndex: m ? 0 : void 0,
|
|
9400
9400
|
children: [
|
|
9401
9401
|
/* @__PURE__ */ y("div", {
|
|
9402
9402
|
className: "mb-2 flex items-start justify-between gap-2",
|
|
@@ -9407,14 +9407,14 @@ var dr = (e) => {
|
|
|
9407
9407
|
"aria-hidden": "true",
|
|
9408
9408
|
children: r
|
|
9409
9409
|
}), /* @__PURE__ */ v("span", {
|
|
9410
|
-
className: "truncate text-sm font-medium sf-card-subtitle",
|
|
9410
|
+
className: (0, Y.default)(f ? "sf-kpi-card__label--wrap" : "truncate", "text-sm font-medium sf-card-subtitle"),
|
|
9411
9411
|
children: e
|
|
9412
9412
|
})]
|
|
9413
|
-
}),
|
|
9414
|
-
className: (0, Y.default)("flex shrink-0 items-center gap-0.5 text-xs font-semibold tabular-nums",
|
|
9413
|
+
}), h && /* @__PURE__ */ y("span", {
|
|
9414
|
+
className: (0, Y.default)("flex shrink-0 items-center gap-0.5 text-xs font-semibold tabular-nums", g ? "text-[var(--sf-success)]" : "text-[var(--sf-danger)]"),
|
|
9415
9415
|
children: [/* @__PURE__ */ v("span", {
|
|
9416
9416
|
"aria-hidden": "true",
|
|
9417
|
-
children:
|
|
9417
|
+
children: g ? "↑" : "↓"
|
|
9418
9418
|
}), Ho(a)]
|
|
9419
9419
|
})]
|
|
9420
9420
|
}),
|
|
@@ -9422,7 +9422,7 @@ var dr = (e) => {
|
|
|
9422
9422
|
className: "text-2xl font-semibold tabular-nums sf-card-title",
|
|
9423
9423
|
children: Uo(t)
|
|
9424
9424
|
}),
|
|
9425
|
-
|
|
9425
|
+
C,
|
|
9426
9426
|
(n || o) && /* @__PURE__ */ y("div", {
|
|
9427
9427
|
className: "mt-1.5 flex items-center justify-between gap-2",
|
|
9428
9428
|
children: [n && /* @__PURE__ */ v("span", {
|
|
@@ -10572,12 +10572,12 @@ var dr = (e) => {
|
|
|
10572
10572
|
children: n
|
|
10573
10573
|
})
|
|
10574
10574
|
]
|
|
10575
|
-
}), cc = ({ title: e, onClose: t, headerAction: n, icon: r,
|
|
10576
|
-
let
|
|
10575
|
+
}), cc = ({ title: e, onClose: t, headerAction: n, icon: r, iconSize: i = "sm", heading: a, badge: o, rows: s = [], align: c = "stack", actions: l, sectionTitle: u, items: d = [], width: f = 320, className: p }) => {
|
|
10576
|
+
let m = typeof f == "number" ? `${f}px` : f;
|
|
10577
10577
|
return /* @__PURE__ */ y("aside", {
|
|
10578
|
-
className: (0, Y.default)("sf-detail-side-panel",
|
|
10579
|
-
style: { width:
|
|
10580
|
-
"aria-label": e ??
|
|
10578
|
+
className: (0, Y.default)("sf-detail-side-panel", p),
|
|
10579
|
+
style: { width: m },
|
|
10580
|
+
"aria-label": e ?? a,
|
|
10581
10581
|
children: [
|
|
10582
10582
|
/* @__PURE__ */ y("div", {
|
|
10583
10583
|
className: "sf-detail-side-panel__topbar",
|
|
@@ -10599,24 +10599,24 @@ var dr = (e) => {
|
|
|
10599
10599
|
/* @__PURE__ */ y("div", {
|
|
10600
10600
|
className: "sf-detail-side-panel__identity",
|
|
10601
10601
|
children: [r && /* @__PURE__ */ v("span", {
|
|
10602
|
-
className: "sf-detail-side-panel__icon",
|
|
10602
|
+
className: (0, Y.default)("sf-detail-side-panel__icon", i === "lg" && "sf-detail-side-panel__icon--lg"),
|
|
10603
10603
|
"aria-hidden": "true",
|
|
10604
10604
|
children: r
|
|
10605
10605
|
}), /* @__PURE__ */ y("div", {
|
|
10606
10606
|
className: "sf-detail-side-panel__identity-body",
|
|
10607
10607
|
children: [/* @__PURE__ */ v("p", {
|
|
10608
10608
|
className: "sf-detail-side-panel__heading",
|
|
10609
|
-
children: i
|
|
10610
|
-
}), a && /* @__PURE__ */ v("div", {
|
|
10611
|
-
className: "sf-detail-side-panel__badge",
|
|
10612
10609
|
children: a
|
|
10610
|
+
}), o && /* @__PURE__ */ v("div", {
|
|
10611
|
+
className: "sf-detail-side-panel__badge",
|
|
10612
|
+
children: o
|
|
10613
10613
|
})]
|
|
10614
10614
|
})]
|
|
10615
10615
|
}),
|
|
10616
|
-
|
|
10616
|
+
s.length > 0 && /* @__PURE__ */ v("div", {
|
|
10617
10617
|
className: "sf-detail-side-panel__rows",
|
|
10618
|
-
children:
|
|
10619
|
-
className: (0, Y.default)("sf-detail-side-panel__row",
|
|
10618
|
+
children: s.map((e, t) => /* @__PURE__ */ y("div", {
|
|
10619
|
+
className: (0, Y.default)("sf-detail-side-panel__row", c === "inline" && "sf-detail-side-panel__row--inline"),
|
|
10620
10620
|
children: [/* @__PURE__ */ y("div", {
|
|
10621
10621
|
className: "sf-detail-side-panel__row-label-wrap",
|
|
10622
10622
|
children: [e.icon && /* @__PURE__ */ v("span", {
|
|
@@ -10639,16 +10639,16 @@ var dr = (e) => {
|
|
|
10639
10639
|
})]
|
|
10640
10640
|
}, t))
|
|
10641
10641
|
}),
|
|
10642
|
-
|
|
10642
|
+
l && /* @__PURE__ */ v("div", {
|
|
10643
10643
|
className: "sf-detail-side-panel__actions",
|
|
10644
|
-
children:
|
|
10644
|
+
children: l
|
|
10645
10645
|
}),
|
|
10646
|
-
(
|
|
10646
|
+
(u || d.length > 0) && /* @__PURE__ */ y("div", {
|
|
10647
10647
|
className: "sf-detail-side-panel__section",
|
|
10648
|
-
children: [
|
|
10648
|
+
children: [u && /* @__PURE__ */ v("p", {
|
|
10649
10649
|
className: "sf-detail-side-panel__section-title",
|
|
10650
|
-
children:
|
|
10651
|
-
}),
|
|
10650
|
+
children: u
|
|
10651
|
+
}), d.map((e, t) => /* @__PURE__ */ y("div", {
|
|
10652
10652
|
className: "sf-detail-side-panel__section-item",
|
|
10653
10653
|
children: [/* @__PURE__ */ y("span", {
|
|
10654
10654
|
className: "sf-detail-side-panel__section-label",
|