@mediaradar/design-components 0.12.0 → 0.14.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/index.cjs +19 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -5
- package/dist/index.d.ts +16 -5
- package/dist/index.js +199 -185
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -482,6 +482,12 @@ var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
|
482
482
|
var TONE = {
|
|
483
483
|
neutral: "bg-subtle text-text-secondary",
|
|
484
484
|
brand: "bg-brand-primarySoft text-brand-primaryAction",
|
|
485
|
+
// Solid, not a tint. A filter count's whole job is to be noticed -- it is
|
|
486
|
+
// what tells you the view you are looking at is filtered at all -- so it
|
|
487
|
+
// carries the full brand fill rather than the soft wash `brand` uses for a
|
|
488
|
+
// label like "Primary". Missed in the first pass, which collapsed both into
|
|
489
|
+
// one tone; the swap onto real call sites is what surfaced it.
|
|
490
|
+
brandSolid: "bg-brand-primaryAction text-brand-onprimary",
|
|
485
491
|
success: "bg-status-success/15 text-text-success",
|
|
486
492
|
// Heavier tint than success and danger on purpose. Equal opacity does not
|
|
487
493
|
// give equal presence: the warning amber (#b8843a) sits far closer to the
|
|
@@ -511,17 +517,22 @@ var TONE_STYLE = {
|
|
|
511
517
|
}
|
|
512
518
|
};
|
|
513
519
|
var KIND = {
|
|
514
|
-
|
|
520
|
+
// Twice the vertical room the first version had. At py-0.5 the pill hugged
|
|
521
|
+
// its text and read as a tight little tag; at py-1 it reads as a deliberate
|
|
522
|
+
// object. Taken from the status pills the product had already arrived at by
|
|
523
|
+
// hand, which were noticeably more comfortable than anything else -- the
|
|
524
|
+
// breathing room was what made them so, not their extra pixel of type.
|
|
525
|
+
label: "px-2.5 py-1",
|
|
515
526
|
// Square-ish and centred, with a floor width so a 1-digit and a 3-digit
|
|
516
527
|
// count are the same shape, and lining figures so the width does not shift
|
|
517
528
|
// as the number changes.
|
|
518
529
|
count: "h-[18px] min-w-[18px] justify-center px-1.5 tabular-nums",
|
|
519
530
|
// The only kind that shouts. Caps need the letterspacing -- caps set tight
|
|
520
531
|
// are harder to read than the sentence case they replaced.
|
|
521
|
-
eyebrow: "px-2 py-
|
|
532
|
+
eyebrow: "px-2.5 py-1 uppercase tracking-wider"
|
|
522
533
|
};
|
|
523
|
-
function Badge({ tone = "neutral", kind = "label", children, className }) {
|
|
524
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.
|
|
534
|
+
function Badge({ tone = "neutral", kind = "label", dot = false, children, className }) {
|
|
535
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(
|
|
525
536
|
"span",
|
|
526
537
|
{
|
|
527
538
|
style: TONE_STYLE[tone],
|
|
@@ -535,7 +546,10 @@ function Badge({ tone = "neutral", kind = "label", children, className }) {
|
|
|
535
546
|
KIND[kind],
|
|
536
547
|
className
|
|
537
548
|
),
|
|
538
|
-
children
|
|
549
|
+
children: [
|
|
550
|
+
dot && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { "aria-hidden": "true", className: "size-1.5 shrink-0 rounded-full bg-current" }),
|
|
551
|
+
children
|
|
552
|
+
]
|
|
539
553
|
}
|
|
540
554
|
);
|
|
541
555
|
}
|