@mediaradar/design-components 0.41.0 → 0.42.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
@@ -2627,6 +2627,11 @@ interface PageHeaderProps {
2627
2627
  description?: ReactNode;
2628
2628
  /** The page's main actions, right-aligned -- usually one primary Button. */
2629
2629
  actions?: ReactNode;
2630
+ /**
2631
+ * A status on the title line, after the title -- one Badge saying what
2632
+ * state the thing this page shows is in ("Active", "Trial").
2633
+ */
2634
+ meta?: ReactNode;
2630
2635
  /**
2631
2636
  * The way back up, above the title: an arrow and the parent section's name,
2632
2637
  * "Competitive intel". Give `href`; add `onClick` to route client-side
@@ -2651,6 +2656,7 @@ interface PageHeaderProps {
2651
2656
  * title: ReactNode -- the page's name
2652
2657
  * description?: ReactNode -- one line, about 70 characters at most, on what the user can do here
2653
2658
  * actions?: ReactNode -- primary actions, right-aligned
2659
+ * meta?: ReactNode -- one status Badge on the title line
2654
2660
  * @tokens text-micro, uppercase, tracking-wider, text-text-tertiary,
2655
2661
  * hover:text-text-primary, focus-visible:outline-border-focus, rounded-control, text-xl, font-semibold, tracking-tight, text-text-primary, text-sm, text-text-secondary, max-w-2xl
2656
2662
  * @use at the top of every top-level page.
@@ -2661,6 +2667,10 @@ interface PageHeaderProps {
2661
2667
  * @avoid putting the description to the right of the title. It competes with
2662
2668
  * the actions and wraps unpredictably on narrow screens.
2663
2669
  * @avoid more than one primary action in `actions`.
2670
+ * @use `meta` on a detail page for the one status of the thing it shows (an
2671
+ * account's "Active" Badge), on the title line.
2672
+ * @avoid putting counts, dates or several pills in `meta`; that belongs in the
2673
+ * page body.
2664
2674
  * @avoid a description on every page by habit. Use one only where a first-time
2665
2675
  * user would not know what the page is for; a pipe-separated subtitle beside
2666
2676
  * the title is the pattern this replaces.
@@ -2674,9 +2684,10 @@ interface PageHeaderProps {
2674
2684
  * description="Build tables from MediaRadar data and export them whenever you need."
2675
2685
  * actions={<Button><Plus /> New report</Button>}
2676
2686
  * />
2687
+ * <PageHeader title="Northwind" back={{ label: "Accounts", href: "/accounts" }} meta={<Badge tone="success">Active</Badge>} />
2677
2688
  * ```
2678
2689
  */
2679
- declare function PageHeader({ title, description, actions, back, className }: PageHeaderProps): react.JSX.Element;
2690
+ declare function PageHeader({ title, description, actions, meta, back, className }: PageHeaderProps): react.JSX.Element;
2680
2691
 
2681
2692
  type ModalSize = "sm" | "md" | "lg" | "xl";
2682
2693
  interface ModalProps {
package/dist/index.d.ts CHANGED
@@ -2627,6 +2627,11 @@ interface PageHeaderProps {
2627
2627
  description?: ReactNode;
2628
2628
  /** The page's main actions, right-aligned -- usually one primary Button. */
2629
2629
  actions?: ReactNode;
2630
+ /**
2631
+ * A status on the title line, after the title -- one Badge saying what
2632
+ * state the thing this page shows is in ("Active", "Trial").
2633
+ */
2634
+ meta?: ReactNode;
2630
2635
  /**
2631
2636
  * The way back up, above the title: an arrow and the parent section's name,
2632
2637
  * "Competitive intel". Give `href`; add `onClick` to route client-side
@@ -2651,6 +2656,7 @@ interface PageHeaderProps {
2651
2656
  * title: ReactNode -- the page's name
2652
2657
  * description?: ReactNode -- one line, about 70 characters at most, on what the user can do here
2653
2658
  * actions?: ReactNode -- primary actions, right-aligned
2659
+ * meta?: ReactNode -- one status Badge on the title line
2654
2660
  * @tokens text-micro, uppercase, tracking-wider, text-text-tertiary,
2655
2661
  * hover:text-text-primary, focus-visible:outline-border-focus, rounded-control, text-xl, font-semibold, tracking-tight, text-text-primary, text-sm, text-text-secondary, max-w-2xl
2656
2662
  * @use at the top of every top-level page.
@@ -2661,6 +2667,10 @@ interface PageHeaderProps {
2661
2667
  * @avoid putting the description to the right of the title. It competes with
2662
2668
  * the actions and wraps unpredictably on narrow screens.
2663
2669
  * @avoid more than one primary action in `actions`.
2670
+ * @use `meta` on a detail page for the one status of the thing it shows (an
2671
+ * account's "Active" Badge), on the title line.
2672
+ * @avoid putting counts, dates or several pills in `meta`; that belongs in the
2673
+ * page body.
2664
2674
  * @avoid a description on every page by habit. Use one only where a first-time
2665
2675
  * user would not know what the page is for; a pipe-separated subtitle beside
2666
2676
  * the title is the pattern this replaces.
@@ -2674,9 +2684,10 @@ interface PageHeaderProps {
2674
2684
  * description="Build tables from MediaRadar data and export them whenever you need."
2675
2685
  * actions={<Button><Plus /> New report</Button>}
2676
2686
  * />
2687
+ * <PageHeader title="Northwind" back={{ label: "Accounts", href: "/accounts" }} meta={<Badge tone="success">Active</Badge>} />
2677
2688
  * ```
2678
2689
  */
2679
- declare function PageHeader({ title, description, actions, back, className }: PageHeaderProps): react.JSX.Element;
2690
+ declare function PageHeader({ title, description, actions, meta, back, className }: PageHeaderProps): react.JSX.Element;
2680
2691
 
2681
2692
  type ModalSize = "sm" | "md" | "lg" | "xl";
2682
2693
  interface ModalProps {
package/dist/index.js CHANGED
@@ -4449,7 +4449,7 @@ function SectionHeading({ title, description, actions, as: Tag2 = "h2", id, clas
4449
4449
  // src/PageHeader.tsx
4450
4450
  import { ArrowLeft } from "lucide-react";
4451
4451
  import { jsx as jsx45, jsxs as jsxs39 } from "react/jsx-runtime";
4452
- function PageHeader({ title, description, actions, back, className }) {
4452
+ function PageHeader({ title, description, actions, meta, back, className }) {
4453
4453
  return /* @__PURE__ */ jsxs39("header", { className: cn("flex flex-wrap items-center justify-between gap-x-6 gap-y-3", className), children: [
4454
4454
  /* @__PURE__ */ jsxs39("div", { className: "min-w-0", children: [
4455
4455
  back && /* @__PURE__ */ jsxs39(
@@ -4464,7 +4464,10 @@ function PageHeader({ title, description, actions, back, className }) {
4464
4464
  ]
4465
4465
  }
4466
4466
  ),
4467
- /* @__PURE__ */ jsx45("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4467
+ meta ? /* @__PURE__ */ jsxs39("div", { className: "flex flex-wrap items-center gap-x-2.5 gap-y-1", children: [
4468
+ /* @__PURE__ */ jsx45("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4469
+ meta
4470
+ ] }) : /* @__PURE__ */ jsx45("h1", { className: "text-xl font-semibold tracking-tight text-text-primary", children: title }),
4468
4471
  description && /* @__PURE__ */ jsx45("p", { className: "mt-0.5 max-w-2xl text-sm text-text-secondary", children: description })
4469
4472
  ] }),
4470
4473
  actions && /* @__PURE__ */ jsx45("div", { className: "flex shrink-0 items-center gap-2", children: actions })