@mediaradar/design-components 0.46.0 → 0.48.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.d.cts CHANGED
@@ -28,7 +28,7 @@ interface CommonProps {
28
28
  * @description Info tooltip — a small info glyph that opens a portalled,
29
29
  * viewport-clamped bubble. Mirrors the Publisher Intel header affordance so
30
30
  * page subtitles can collapse into the eyebrow.
31
- * @tokens text-text-tertiary, rounded-control, border-border-default, bg-surface,
31
+ * @tokens z-tooltip, text-text-tertiary, rounded-control, border-border-default, bg-surface,
32
32
  * shadow-overlay, text-text-secondary, focus-visible:outline-border-focus,
33
33
  * hover:text-text-primary, tracking-normal
34
34
  * @dependencies lucide-react
@@ -224,7 +224,7 @@ interface BadgeProps extends CommonProps {
224
224
  tone?: BadgeTone;
225
225
  /**
226
226
  * Shape and case. `count` for a number, `eyebrow` for a small-caps label,
227
- * `category` for what a thing is (a topic, a category): always quiet grey,
227
+ * `category` for what a thing is (a topic, a category): quiet grey unless `highlight`,
228
228
  * `tone` is ignored.
229
229
  */
230
230
  kind?: BadgeKind;
@@ -236,6 +236,12 @@ interface BadgeProps extends CommonProps {
236
236
  * hidden from assistive tech rather than announced as a second thing.
237
237
  */
238
238
  dot?: boolean;
239
+ /**
240
+ * Only with `kind="category"`. Marks the one original or primary item in a
241
+ * set of versions -- "Original" among a creative's revisions -- in the pale
242
+ * brand tint instead of grey. At most one per set.
243
+ */
244
+ highlight?: boolean;
239
245
  /** Text, or an icon plus text. Keep it to a few words -- a badge annotates, it does not explain. */
240
246
  children: ReactNode;
241
247
  className?: string;
@@ -249,8 +255,9 @@ interface BadgeProps extends CommonProps {
249
255
  * between them cover every badge treatment in the product.
250
256
  * @props
251
257
  * tone?: 'neutral' | 'brand' | 'brandSolid' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
252
- * kind?: 'label' | 'count' | 'eyebrow' | 'category' (default 'label') -- category is always grey, tone ignored
258
+ * kind?: 'label' | 'count' | 'eyebrow' | 'category' (default 'label') -- category is grey unless highlight, tone ignored
253
259
  * dot?: boolean (default false) -- a filled dot before the label, in the tone's ink
260
+ * highlight?: boolean (default false) -- with kind="category" only: pale brand tint for the one original/primary item in a set
254
261
  * children: ReactNode
255
262
  * @tokens text-micro, rounded-full, bg-current, bg-subtle, bg-brand-primarySoft, bg-brand-primaryAction,
256
263
  * bg-status-success/15, bg-status-warning/30, bg-status-danger/15, bg-scrim,
@@ -281,11 +288,16 @@ interface BadgeProps extends CommonProps {
281
288
  * has become a callout; use one.
282
289
  * @avoid when you are choosing the tone by colour rather than by meaning. A
283
290
  * red badge that does not mean failure teaches readers to ignore red.
291
+ * @use highlight on a category only to mark the one original or primary item
292
+ * in a set of versions, e.g. "Original" among a creative's revisions.
293
+ * @avoid highlight on more than one category in a set, or to make a category
294
+ * stand out for emphasis -- then nothing stands out.
284
295
  * @avoid when several sit in a row and all say something different -- that is
285
296
  * a definition list wearing badges, and reads as noise.
286
297
  * @usage
287
298
  * ```tsx
288
299
  * <Badge>Financial Services</Badge>
300
+ * <Badge kind="category" highlight>Original</Badge>
289
301
  * <Badge tone="brandSolid" kind="count">{activeFilters}</Badge>
290
302
  * <Badge tone="warning">Partial month</Badge>
291
303
  * <Badge tone="success" dot>Completed</Badge>
@@ -293,7 +305,7 @@ interface BadgeProps extends CommonProps {
293
305
  * <Badge tone="brand"><Check size={11} aria-hidden="true" />Primary</Badge>
294
306
  * ```
295
307
  */
296
- declare function Badge({ tone, kind, dot, children, className, testIdPrefix }: BadgeProps): react.JSX.Element;
308
+ declare function Badge({ tone, kind, dot, highlight, children, className, testIdPrefix }: BadgeProps): react.JSX.Element;
297
309
 
298
310
  interface DeltaProps extends CommonProps {
299
311
  /** The change itself. Its sign picks the direction; render the absolute value. */
@@ -871,7 +883,7 @@ declare function DataScopeFilter({ value, onChange, align, className, testIdPref
871
883
  * `document.body` so the popover is never clipped by a scrollable ancestor
872
884
  * (e.g. inside a modal) -- unlike this package's other chip popovers, none
873
885
  * of which are known to sit inside a clipping container today.
874
- * @tokens text-control-caption, rounded-control, rounded-card, border-border-default,
886
+ * @tokens z-dropdown, text-control-caption, rounded-control, rounded-card, border-border-default,
875
887
  * border-border-strong, bg-input, bg-surface, shadow-overlay,
876
888
  * text-text-primary, text-text-secondary,
877
889
  * text-text-tertiary, hover:bg-subtle, hover:text-text-primary,
@@ -1362,7 +1374,7 @@ declare function StackedColumnPlaceholder({ height, width, legendRows, axis, cla
1362
1374
  * bounding rect and rendered through a portal to `document.body`, so it
1363
1375
  * escapes both `overflow` clipping inside scrollable panels and the broken
1364
1376
  * `fixed` containing block a transformed ancestor creates.
1365
- * @tokens rounded-control, border-border-default, bg-surface, shadow-overlay,
1377
+ * @tokens z-tooltip, rounded-control, border-border-default, bg-surface, shadow-overlay,
1366
1378
  * text-text-primary, bg-text-primary, text-surface,
1367
1379
  * duration-(--mr-motion-duration-interactive)
1368
1380
  * @variant surface - Default. Themed surface/border bubble -- matches the
@@ -1677,6 +1689,7 @@ interface SelectionPickerProps<T extends PickerRow> extends CommonProps {
1677
1689
  }
1678
1690
  /**
1679
1691
  * @pattern SelectionPicker
1692
+ * @audited 2026-11-13
1680
1693
  * @status stable
1681
1694
  * @description Generic search-and-filter picker for building a selection out
1682
1695
  * of a larger catalog -- a search box plus filter dropdowns above a checkbox
@@ -1688,7 +1701,7 @@ interface SelectionPickerProps<T extends PickerRow> extends CommonProps {
1688
1701
  * filtered client-side (the default), or externally-computed `results` for a
1689
1702
  * caller whose search is server-side/async, with `loading`/`error`/
1690
1703
  * `hasMore`/`onLoadMore` covering that mode's states.
1691
- * @tokens text-micro, text-dense, border-border-strong, rounded-control, rounded-card, border-border-default, bg-input, focus-within:outline-border-focus,
1704
+ * @tokens tracking-wider, z-dropdown, text-micro, text-dense, border-border-strong, rounded-control, rounded-card, border-border-default, bg-input, focus-within:outline-border-focus,
1692
1705
  * bg-canvas, bg-surface, shadow-raised, shadow-overlay, text-text-primary,
1693
1706
  * text-text-secondary, text-text-tertiary, text-text-link,
1694
1707
  * text-brand-primaryAction, border-brand-primaryAction, bg-brand-primaryAction,
package/dist/index.d.ts CHANGED
@@ -28,7 +28,7 @@ interface CommonProps {
28
28
  * @description Info tooltip — a small info glyph that opens a portalled,
29
29
  * viewport-clamped bubble. Mirrors the Publisher Intel header affordance so
30
30
  * page subtitles can collapse into the eyebrow.
31
- * @tokens text-text-tertiary, rounded-control, border-border-default, bg-surface,
31
+ * @tokens z-tooltip, text-text-tertiary, rounded-control, border-border-default, bg-surface,
32
32
  * shadow-overlay, text-text-secondary, focus-visible:outline-border-focus,
33
33
  * hover:text-text-primary, tracking-normal
34
34
  * @dependencies lucide-react
@@ -224,7 +224,7 @@ interface BadgeProps extends CommonProps {
224
224
  tone?: BadgeTone;
225
225
  /**
226
226
  * Shape and case. `count` for a number, `eyebrow` for a small-caps label,
227
- * `category` for what a thing is (a topic, a category): always quiet grey,
227
+ * `category` for what a thing is (a topic, a category): quiet grey unless `highlight`,
228
228
  * `tone` is ignored.
229
229
  */
230
230
  kind?: BadgeKind;
@@ -236,6 +236,12 @@ interface BadgeProps extends CommonProps {
236
236
  * hidden from assistive tech rather than announced as a second thing.
237
237
  */
238
238
  dot?: boolean;
239
+ /**
240
+ * Only with `kind="category"`. Marks the one original or primary item in a
241
+ * set of versions -- "Original" among a creative's revisions -- in the pale
242
+ * brand tint instead of grey. At most one per set.
243
+ */
244
+ highlight?: boolean;
239
245
  /** Text, or an icon plus text. Keep it to a few words -- a badge annotates, it does not explain. */
240
246
  children: ReactNode;
241
247
  className?: string;
@@ -249,8 +255,9 @@ interface BadgeProps extends CommonProps {
249
255
  * between them cover every badge treatment in the product.
250
256
  * @props
251
257
  * tone?: 'neutral' | 'brand' | 'brandSolid' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
252
- * kind?: 'label' | 'count' | 'eyebrow' | 'category' (default 'label') -- category is always grey, tone ignored
258
+ * kind?: 'label' | 'count' | 'eyebrow' | 'category' (default 'label') -- category is grey unless highlight, tone ignored
253
259
  * dot?: boolean (default false) -- a filled dot before the label, in the tone's ink
260
+ * highlight?: boolean (default false) -- with kind="category" only: pale brand tint for the one original/primary item in a set
254
261
  * children: ReactNode
255
262
  * @tokens text-micro, rounded-full, bg-current, bg-subtle, bg-brand-primarySoft, bg-brand-primaryAction,
256
263
  * bg-status-success/15, bg-status-warning/30, bg-status-danger/15, bg-scrim,
@@ -281,11 +288,16 @@ interface BadgeProps extends CommonProps {
281
288
  * has become a callout; use one.
282
289
  * @avoid when you are choosing the tone by colour rather than by meaning. A
283
290
  * red badge that does not mean failure teaches readers to ignore red.
291
+ * @use highlight on a category only to mark the one original or primary item
292
+ * in a set of versions, e.g. "Original" among a creative's revisions.
293
+ * @avoid highlight on more than one category in a set, or to make a category
294
+ * stand out for emphasis -- then nothing stands out.
284
295
  * @avoid when several sit in a row and all say something different -- that is
285
296
  * a definition list wearing badges, and reads as noise.
286
297
  * @usage
287
298
  * ```tsx
288
299
  * <Badge>Financial Services</Badge>
300
+ * <Badge kind="category" highlight>Original</Badge>
289
301
  * <Badge tone="brandSolid" kind="count">{activeFilters}</Badge>
290
302
  * <Badge tone="warning">Partial month</Badge>
291
303
  * <Badge tone="success" dot>Completed</Badge>
@@ -293,7 +305,7 @@ interface BadgeProps extends CommonProps {
293
305
  * <Badge tone="brand"><Check size={11} aria-hidden="true" />Primary</Badge>
294
306
  * ```
295
307
  */
296
- declare function Badge({ tone, kind, dot, children, className, testIdPrefix }: BadgeProps): react.JSX.Element;
308
+ declare function Badge({ tone, kind, dot, highlight, children, className, testIdPrefix }: BadgeProps): react.JSX.Element;
297
309
 
298
310
  interface DeltaProps extends CommonProps {
299
311
  /** The change itself. Its sign picks the direction; render the absolute value. */
@@ -871,7 +883,7 @@ declare function DataScopeFilter({ value, onChange, align, className, testIdPref
871
883
  * `document.body` so the popover is never clipped by a scrollable ancestor
872
884
  * (e.g. inside a modal) -- unlike this package's other chip popovers, none
873
885
  * of which are known to sit inside a clipping container today.
874
- * @tokens text-control-caption, rounded-control, rounded-card, border-border-default,
886
+ * @tokens z-dropdown, text-control-caption, rounded-control, rounded-card, border-border-default,
875
887
  * border-border-strong, bg-input, bg-surface, shadow-overlay,
876
888
  * text-text-primary, text-text-secondary,
877
889
  * text-text-tertiary, hover:bg-subtle, hover:text-text-primary,
@@ -1362,7 +1374,7 @@ declare function StackedColumnPlaceholder({ height, width, legendRows, axis, cla
1362
1374
  * bounding rect and rendered through a portal to `document.body`, so it
1363
1375
  * escapes both `overflow` clipping inside scrollable panels and the broken
1364
1376
  * `fixed` containing block a transformed ancestor creates.
1365
- * @tokens rounded-control, border-border-default, bg-surface, shadow-overlay,
1377
+ * @tokens z-tooltip, rounded-control, border-border-default, bg-surface, shadow-overlay,
1366
1378
  * text-text-primary, bg-text-primary, text-surface,
1367
1379
  * duration-(--mr-motion-duration-interactive)
1368
1380
  * @variant surface - Default. Themed surface/border bubble -- matches the
@@ -1677,6 +1689,7 @@ interface SelectionPickerProps<T extends PickerRow> extends CommonProps {
1677
1689
  }
1678
1690
  /**
1679
1691
  * @pattern SelectionPicker
1692
+ * @audited 2026-11-13
1680
1693
  * @status stable
1681
1694
  * @description Generic search-and-filter picker for building a selection out
1682
1695
  * of a larger catalog -- a search box plus filter dropdowns above a checkbox
@@ -1688,7 +1701,7 @@ interface SelectionPickerProps<T extends PickerRow> extends CommonProps {
1688
1701
  * filtered client-side (the default), or externally-computed `results` for a
1689
1702
  * caller whose search is server-side/async, with `loading`/`error`/
1690
1703
  * `hasMore`/`onLoadMore` covering that mode's states.
1691
- * @tokens text-micro, text-dense, border-border-strong, rounded-control, rounded-card, border-border-default, bg-input, focus-within:outline-border-focus,
1704
+ * @tokens tracking-wider, z-dropdown, text-micro, text-dense, border-border-strong, rounded-control, rounded-card, border-border-default, bg-input, focus-within:outline-border-focus,
1692
1705
  * bg-canvas, bg-surface, shadow-raised, shadow-overlay, text-text-primary,
1693
1706
  * text-text-secondary, text-text-tertiary, text-text-link,
1694
1707
  * text-brand-primaryAction, border-brand-primaryAction, bg-brand-primaryAction,
package/dist/index.js CHANGED
@@ -103,7 +103,7 @@ function InfoTip({ text, size = 11, label = "More information", trigger = "click
103
103
  onMouseEnter: trigger === "hover" ? cancelClose : void 0,
104
104
  onMouseLeave: trigger === "hover" ? closeSoon : void 0,
105
105
  style: { position: "fixed", top: pos.top, left: pos.left, width: pos.width },
106
- className: "z-[90] rounded-control border border-border-default bg-surface px-3 py-2 text-xs font-normal not-italic normal-case leading-relaxed tracking-normal text-text-secondary shadow-overlay",
106
+ className: "z-tooltip rounded-control border border-border-default bg-surface px-3 py-2 text-xs font-normal not-italic normal-case leading-relaxed tracking-normal text-text-secondary shadow-overlay",
107
107
  children: text
108
108
  }
109
109
  ),
@@ -557,12 +557,13 @@ var KIND = {
557
557
  // are harder to read than the sentence case they replaced.
558
558
  eyebrow: "px-2.5 py-1 uppercase tracking-wider",
559
559
  // What a thing IS (a topic, a category) rather than a signal about it.
560
- // Always the same quiet grey whatever `tone` says: colour here would read
560
+ // Quiet grey whatever `tone` says (only `highlight` changes it): colour here would read
561
561
  // as meaning, and a category has none. This is the old Tag.
562
562
  category: "px-2 py-1"
563
563
  };
564
564
  var CATEGORY = "bg-subtle font-medium text-text-tertiary";
565
- function Badge({ tone = "neutral", kind = "label", dot = false, children, className, testIdPrefix }) {
565
+ var CATEGORY_HIGHLIGHT = "bg-brand-primarySoft font-semibold text-brand-primaryAction";
566
+ function Badge({ tone = "neutral", kind = "label", dot = false, highlight = false, children, className, testIdPrefix }) {
566
567
  return /* @__PURE__ */ jsxs5(
567
568
  "span",
568
569
  {
@@ -574,7 +575,7 @@ function Badge({ tone = "neutral", kind = "label", dot = false, children, classN
574
575
  // badge is almost always beside flexible text that would otherwise
575
576
  // squash it. `whitespace-nowrap` because a wrapped badge is a bug.
576
577
  "inline-flex shrink-0 items-center gap-1 whitespace-nowrap rounded-full text-micro leading-none",
577
- kind === "category" ? CATEGORY : cn("font-semibold", TONE[tone]),
578
+ kind === "category" ? highlight ? CATEGORY_HIGHLIGHT : CATEGORY : cn("font-semibold", TONE[tone]),
578
579
  KIND[kind],
579
580
  className
580
581
  ),
@@ -1930,7 +1931,7 @@ function SelectFilter({
1930
1931
  "data-testid": testIdPrefix && `${testIdPrefix}-popover`,
1931
1932
  style: { position: "fixed", top: pos.top, left: pos.left, right: pos.right, width: fullWidth ? pos.width : void 0 },
1932
1933
  className: cn(
1933
- "z-[65] flex flex-col overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay",
1934
+ "z-dropdown flex flex-col overflow-hidden rounded-card border border-border-default bg-surface shadow-overlay",
1934
1935
  !fullWidth && (sm ? "w-max min-w-28 max-w-72" : "w-56")
1935
1936
  ),
1936
1937
  role: loading || error ? "group" : "listbox",
@@ -2556,7 +2557,7 @@ function Tooltip({
2556
2557
  onMouseLeave: interactive ? hide : void 0,
2557
2558
  onTransitionEnd: onBoxTransitionEnd,
2558
2559
  className: cn(
2559
- "fixed z-[90] w-max max-w-xs whitespace-normal break-words px-2.5 py-1.5 text-xs leading-snug",
2560
+ "fixed z-tooltip w-max max-w-xs whitespace-normal break-words px-2.5 py-1.5 text-xs leading-snug",
2560
2561
  // Fade in/out. The sys duration token rather than a ref one:
2561
2562
  // it is what Button's hover/press transition uses, and a
2562
2563
  // tooltip's fade is the same kind of interactive feedback.
@@ -2918,7 +2919,7 @@ function SelectionPicker({
2918
2919
  "div",
2919
2920
  {
2920
2921
  className: cn(
2921
- "grid items-center gap-2 border-b border-border-default bg-canvas px-3 py-2 text-micro font-semibold uppercase tracking-[0.06em] text-text-secondary",
2922
+ "grid items-center gap-2 border-b border-border-default bg-canvas px-3 py-2 text-micro font-semibold uppercase tracking-wider text-text-secondary",
2922
2923
  rowGridCols
2923
2924
  ),
2924
2925
  children: [
@@ -3206,7 +3207,7 @@ function FilterDropdown({
3206
3207
  role: "group",
3207
3208
  "aria-label": filter.label,
3208
3209
  style: { top: pos.top, left: pos.left },
3209
- className: "fixed z-[80] min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
3210
+ className: "fixed z-dropdown min-w-55 rounded-card border border-border-default bg-surface p-2 shadow-overlay",
3210
3211
  children: [
3211
3212
  searchable && /* @__PURE__ */ jsxs25("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
3212
3213
  /* @__PURE__ */ jsx27(Search4, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),