@orangecheck/design 0.7.0 → 0.7.2
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/components.d.mts +1 -1
- package/dist/components.d.ts +1 -1
- package/dist/components.js +29 -0
- package/dist/components.js.map +1 -1
- package/dist/components.mjs +29 -1
- package/dist/components.mjs.map +1 -1
- package/dist/composites.d.mts +15 -1
- package/dist/composites.d.ts +15 -1
- package/dist/composites.js +29 -0
- package/dist/composites.js.map +1 -1
- package/dist/composites.mjs +29 -1
- package/dist/composites.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +40 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -4
- package/dist/index.mjs.map +1 -1
- package/dist/primitives.d.mts +8 -3
- package/dist/primitives.d.ts +8 -3
- package/dist/primitives.js +36 -3
- package/dist/primitives.js.map +1 -1
- package/dist/primitives.mjs +36 -3
- package/dist/primitives.mjs.map +1 -1
- package/package.json +1 -1
package/dist/primitives.mjs
CHANGED
|
@@ -1411,7 +1411,37 @@ var TONE = {
|
|
|
1411
1411
|
primary: "text-primary",
|
|
1412
1412
|
info: "text-info"
|
|
1413
1413
|
};
|
|
1414
|
-
|
|
1414
|
+
var BORDER_TONE = {
|
|
1415
|
+
success: "border-success/40 text-success",
|
|
1416
|
+
warning: "border-warning/40 text-warning",
|
|
1417
|
+
destructive: "border-destructive/40 text-destructive",
|
|
1418
|
+
muted: "border-muted-foreground/40 text-muted-foreground",
|
|
1419
|
+
primary: "border-primary/40 text-primary",
|
|
1420
|
+
info: "border-info/40 text-info"
|
|
1421
|
+
};
|
|
1422
|
+
function StatusPill({
|
|
1423
|
+
label,
|
|
1424
|
+
tone = "muted",
|
|
1425
|
+
variant = "plain",
|
|
1426
|
+
icon,
|
|
1427
|
+
className
|
|
1428
|
+
}) {
|
|
1429
|
+
if (variant === "bordered") {
|
|
1430
|
+
return /* @__PURE__ */ jsxs(
|
|
1431
|
+
"span",
|
|
1432
|
+
{
|
|
1433
|
+
className: cn(
|
|
1434
|
+
"inline-flex items-center gap-1.5 border px-1.5 py-0.5 font-mono text-[9px] tracking-widest uppercase",
|
|
1435
|
+
BORDER_TONE[tone],
|
|
1436
|
+
className
|
|
1437
|
+
),
|
|
1438
|
+
children: [
|
|
1439
|
+
icon,
|
|
1440
|
+
label
|
|
1441
|
+
]
|
|
1442
|
+
}
|
|
1443
|
+
);
|
|
1444
|
+
}
|
|
1415
1445
|
return /* @__PURE__ */ jsxs(
|
|
1416
1446
|
"span",
|
|
1417
1447
|
{
|
|
@@ -1427,15 +1457,18 @@ function StatusPill({ label, tone = "muted", icon, className }) {
|
|
|
1427
1457
|
}
|
|
1428
1458
|
);
|
|
1429
1459
|
}
|
|
1430
|
-
function makeStatusPill(map) {
|
|
1460
|
+
function makeStatusPill(map, options) {
|
|
1461
|
+
const variant = options?.variant ?? "plain";
|
|
1462
|
+
const fallbackTone = options?.fallbackTone ?? "muted";
|
|
1431
1463
|
function DomainStatusPill({ status, className }) {
|
|
1432
1464
|
const spec = map[status];
|
|
1433
1465
|
return /* @__PURE__ */ jsx(
|
|
1434
1466
|
StatusPill,
|
|
1435
1467
|
{
|
|
1436
|
-
tone: spec?.tone ??
|
|
1468
|
+
tone: spec?.tone ?? fallbackTone,
|
|
1437
1469
|
label: spec?.label ?? status,
|
|
1438
1470
|
icon: spec?.icon,
|
|
1471
|
+
variant,
|
|
1439
1472
|
className
|
|
1440
1473
|
}
|
|
1441
1474
|
);
|