@mediaradar/design-components 0.18.6 → 0.18.7
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 +14 -15
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -15
- package/dist/index.d.ts +13 -15
- package/dist/index.js +14 -15
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1376,7 +1376,7 @@ interface SelectionPickerProps<T extends PickerRow> {
|
|
|
1376
1376
|
* filtered client-side (the default), or externally-computed `results` for a
|
|
1377
1377
|
* caller whose search is server-side/async, with `loading`/`error`/
|
|
1378
1378
|
* `hasMore`/`onLoadMore` covering that mode's states.
|
|
1379
|
-
* @tokens rounded-control, rounded-card, border-border-default, bg-input,
|
|
1379
|
+
* @tokens border-border-strong, rounded-control, rounded-card, border-border-default, bg-input,
|
|
1380
1380
|
* bg-canvas, bg-surface, shadow-raised, shadow-overlay, text-text-primary,
|
|
1381
1381
|
* text-text-secondary, text-text-tertiary, text-text-link,
|
|
1382
1382
|
* text-brand-primaryAction, border-brand-primaryAction, bg-brand-primaryAction,
|
|
@@ -1646,7 +1646,7 @@ interface NameListModalProps {
|
|
|
1646
1646
|
* checkboxes under it. Shared by the Account Lists table and the list detail
|
|
1647
1647
|
* page so create/rename look identical; `fieldLabel`/`placeholder` relabel it
|
|
1648
1648
|
* for dialogs that name something other than a list.
|
|
1649
|
-
* @tokens bg-scrim, rounded-card, border-border-default, bg-surface, shadow-overlay, text-text-primary, text-text-secondary, rounded-control, bg-input, focus:border-brand-primaryAction
|
|
1649
|
+
* @tokens border-border-strong, bg-scrim, rounded-card, border-border-default, bg-surface, shadow-overlay, text-text-primary, text-text-secondary, rounded-control, bg-input, focus:border-brand-primaryAction
|
|
1650
1650
|
* @behavior Escape closes the dialog via `onCancel`, same as clicking the
|
|
1651
1651
|
* scrim backdrop. Submit is disabled until the name is non-empty (trimmed).
|
|
1652
1652
|
* When `options` are given they render as CheckBox rows below the field, and
|
|
@@ -1664,15 +1664,14 @@ interface NameListModalProps {
|
|
|
1664
1664
|
declare function NameListModal({ title, initialName, submitLabel, onCancel, onSubmit, fieldLabel, placeholder, options, }: NameListModalProps): react.ReactPortal;
|
|
1665
1665
|
|
|
1666
1666
|
/**
|
|
1667
|
-
*
|
|
1668
|
-
*
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1671
|
-
* directly on the warm canvas with no boxed shell around them.
|
|
1667
|
+
* Kept for compatibility. Since 0.18.5 both variants draw the same
|
|
1668
|
+
* `border-strong` stroke, matching SelectFilter, DateRangeFilter,
|
|
1669
|
+
* DataScopeFilter, AdvertiserQuickFilter and SearchBar, so every dropdown
|
|
1670
|
+
* trigger in a filter row has one border colour.
|
|
1672
1671
|
*/
|
|
1673
1672
|
type ChipVariant = "box" | "inline";
|
|
1674
1673
|
/** Shared styling for filter-bar chip triggers, so every dropdown chip matches. */
|
|
1675
|
-
declare function chipTriggerClass(
|
|
1674
|
+
declare function chipTriggerClass(_variant?: ChipVariant): string;
|
|
1676
1675
|
interface ChipContentProps {
|
|
1677
1676
|
/** Small uppercase label above the value. */
|
|
1678
1677
|
caption: string;
|
|
@@ -1686,11 +1685,10 @@ interface ChipContentProps {
|
|
|
1686
1685
|
* @description Shared foundation for filter-bar chip triggers — pairs
|
|
1687
1686
|
* `chipTriggerClass` with `ChipContent` for the caption/value/icon layout, so
|
|
1688
1687
|
* every dropdown chip across the app matches.
|
|
1689
|
-
* @tokens text-control-caption, rounded-control, bg-input, border-border-
|
|
1690
|
-
* @behavior `chipTriggerClass`
|
|
1691
|
-
*
|
|
1692
|
-
* stroke
|
|
1693
|
-
* that function, not a prop on `ChipContent`.
|
|
1688
|
+
* @tokens text-control-caption, rounded-control, bg-input, border-border-strong, text-text-secondary, text-text-tertiary, text-text-primary, hover:bg-subtle, focus-visible:outline-border-focus, hover:text-text-primary
|
|
1689
|
+
* @behavior `chipTriggerClass` still accepts a `ChipVariant` (`box` or
|
|
1690
|
+
* `inline`) so existing calls compile, but both draw the same `border-strong`
|
|
1691
|
+
* stroke as every other dropdown trigger.
|
|
1694
1692
|
* Provides only the shared `focus-visible:outline-2` keyboard-focus
|
|
1695
1693
|
* treatment every dropdown trigger depends on — open/close, Escape, and
|
|
1696
1694
|
* outside-click dismissal all live in each consumer, not here. A new dropdown
|
|
@@ -1921,7 +1919,7 @@ declare function Tag({ children, className }: TagProps): react.JSX.Element;
|
|
|
1921
1919
|
* first/prev/pages/next/last pager, and the resolved "1 – 25 of N results"
|
|
1922
1920
|
* range. Owns no state — the host page holds `page` and `perPage` so the
|
|
1923
1921
|
* paged slice and the bar can't disagree.
|
|
1924
|
-
* @tokens
|
|
1922
|
+
* @tokens border-border-strong, rounded-control, bg-input, text-text-primary, text-text-secondary, text-text-tertiary, bg-brand-primaryAction, text-brand-onprimary, hover:bg-subtle, hover:text-text-primary, focus:outline-border-focus
|
|
1925
1923
|
* @behavior The current page is filled with the brand action color (matching
|
|
1926
1924
|
* the Contacts pager). First/prev disable on page 1, next/last on the last
|
|
1927
1925
|
* page — disabled controls stay in the layout so the row never reflows.
|
|
@@ -2007,7 +2005,7 @@ interface MultiSelectGroup {
|
|
|
2007
2005
|
* button shape (two-line caption + value with a chevron) and opens a
|
|
2008
2006
|
* searchable checkbox popover. Used for the page-level Media Type /
|
|
2009
2007
|
* Advertiser filters that share state with the filter tray.
|
|
2010
|
-
* @tokens rounded-control, rounded-card, border-border-default, bg-surface, shadow-overlay, text-text-primary, text-text-secondary, text-text-tertiary, text-text-link, border-border-interactive, bg-brand-primaryAction, bg-input, hover:bg-subtle, hover:text-text-primary, placeholder:text-text-tertiary, text-brand-onprimary
|
|
2008
|
+
* @tokens border-border-strong, rounded-control, rounded-card, border-border-default, bg-surface, shadow-overlay, text-text-primary, text-text-secondary, text-text-tertiary, text-text-link, border-border-interactive, bg-brand-primaryAction, bg-input, hover:bg-subtle, hover:text-text-primary, placeholder:text-text-tertiary, text-brand-onprimary
|
|
2011
2009
|
* @dependencies lucide-react
|
|
2012
2010
|
* @behavior `variant` picks the trigger's chip stroke: `box` (default, the
|
|
2013
2011
|
* boxed two-line chip on the default border) or `inline` (same fill,
|
package/dist/index.d.ts
CHANGED
|
@@ -1376,7 +1376,7 @@ interface SelectionPickerProps<T extends PickerRow> {
|
|
|
1376
1376
|
* filtered client-side (the default), or externally-computed `results` for a
|
|
1377
1377
|
* caller whose search is server-side/async, with `loading`/`error`/
|
|
1378
1378
|
* `hasMore`/`onLoadMore` covering that mode's states.
|
|
1379
|
-
* @tokens rounded-control, rounded-card, border-border-default, bg-input,
|
|
1379
|
+
* @tokens border-border-strong, rounded-control, rounded-card, border-border-default, bg-input,
|
|
1380
1380
|
* bg-canvas, bg-surface, shadow-raised, shadow-overlay, text-text-primary,
|
|
1381
1381
|
* text-text-secondary, text-text-tertiary, text-text-link,
|
|
1382
1382
|
* text-brand-primaryAction, border-brand-primaryAction, bg-brand-primaryAction,
|
|
@@ -1646,7 +1646,7 @@ interface NameListModalProps {
|
|
|
1646
1646
|
* checkboxes under it. Shared by the Account Lists table and the list detail
|
|
1647
1647
|
* page so create/rename look identical; `fieldLabel`/`placeholder` relabel it
|
|
1648
1648
|
* for dialogs that name something other than a list.
|
|
1649
|
-
* @tokens bg-scrim, rounded-card, border-border-default, bg-surface, shadow-overlay, text-text-primary, text-text-secondary, rounded-control, bg-input, focus:border-brand-primaryAction
|
|
1649
|
+
* @tokens border-border-strong, bg-scrim, rounded-card, border-border-default, bg-surface, shadow-overlay, text-text-primary, text-text-secondary, rounded-control, bg-input, focus:border-brand-primaryAction
|
|
1650
1650
|
* @behavior Escape closes the dialog via `onCancel`, same as clicking the
|
|
1651
1651
|
* scrim backdrop. Submit is disabled until the name is non-empty (trimmed).
|
|
1652
1652
|
* When `options` are given they render as CheckBox rows below the field, and
|
|
@@ -1664,15 +1664,14 @@ interface NameListModalProps {
|
|
|
1664
1664
|
declare function NameListModal({ title, initialName, submitLabel, onCancel, onSubmit, fieldLabel, placeholder, options, }: NameListModalProps): react.ReactPortal;
|
|
1665
1665
|
|
|
1666
1666
|
/**
|
|
1667
|
-
*
|
|
1668
|
-
*
|
|
1669
|
-
*
|
|
1670
|
-
*
|
|
1671
|
-
* directly on the warm canvas with no boxed shell around them.
|
|
1667
|
+
* Kept for compatibility. Since 0.18.5 both variants draw the same
|
|
1668
|
+
* `border-strong` stroke, matching SelectFilter, DateRangeFilter,
|
|
1669
|
+
* DataScopeFilter, AdvertiserQuickFilter and SearchBar, so every dropdown
|
|
1670
|
+
* trigger in a filter row has one border colour.
|
|
1672
1671
|
*/
|
|
1673
1672
|
type ChipVariant = "box" | "inline";
|
|
1674
1673
|
/** Shared styling for filter-bar chip triggers, so every dropdown chip matches. */
|
|
1675
|
-
declare function chipTriggerClass(
|
|
1674
|
+
declare function chipTriggerClass(_variant?: ChipVariant): string;
|
|
1676
1675
|
interface ChipContentProps {
|
|
1677
1676
|
/** Small uppercase label above the value. */
|
|
1678
1677
|
caption: string;
|
|
@@ -1686,11 +1685,10 @@ interface ChipContentProps {
|
|
|
1686
1685
|
* @description Shared foundation for filter-bar chip triggers — pairs
|
|
1687
1686
|
* `chipTriggerClass` with `ChipContent` for the caption/value/icon layout, so
|
|
1688
1687
|
* every dropdown chip across the app matches.
|
|
1689
|
-
* @tokens text-control-caption, rounded-control, bg-input, border-border-
|
|
1690
|
-
* @behavior `chipTriggerClass`
|
|
1691
|
-
*
|
|
1692
|
-
* stroke
|
|
1693
|
-
* that function, not a prop on `ChipContent`.
|
|
1688
|
+
* @tokens text-control-caption, rounded-control, bg-input, border-border-strong, text-text-secondary, text-text-tertiary, text-text-primary, hover:bg-subtle, focus-visible:outline-border-focus, hover:text-text-primary
|
|
1689
|
+
* @behavior `chipTriggerClass` still accepts a `ChipVariant` (`box` or
|
|
1690
|
+
* `inline`) so existing calls compile, but both draw the same `border-strong`
|
|
1691
|
+
* stroke as every other dropdown trigger.
|
|
1694
1692
|
* Provides only the shared `focus-visible:outline-2` keyboard-focus
|
|
1695
1693
|
* treatment every dropdown trigger depends on — open/close, Escape, and
|
|
1696
1694
|
* outside-click dismissal all live in each consumer, not here. A new dropdown
|
|
@@ -1921,7 +1919,7 @@ declare function Tag({ children, className }: TagProps): react.JSX.Element;
|
|
|
1921
1919
|
* first/prev/pages/next/last pager, and the resolved "1 – 25 of N results"
|
|
1922
1920
|
* range. Owns no state — the host page holds `page` and `perPage` so the
|
|
1923
1921
|
* paged slice and the bar can't disagree.
|
|
1924
|
-
* @tokens
|
|
1922
|
+
* @tokens border-border-strong, rounded-control, bg-input, text-text-primary, text-text-secondary, text-text-tertiary, bg-brand-primaryAction, text-brand-onprimary, hover:bg-subtle, hover:text-text-primary, focus:outline-border-focus
|
|
1925
1923
|
* @behavior The current page is filled with the brand action color (matching
|
|
1926
1924
|
* the Contacts pager). First/prev disable on page 1, next/last on the last
|
|
1927
1925
|
* page — disabled controls stay in the layout so the row never reflows.
|
|
@@ -2007,7 +2005,7 @@ interface MultiSelectGroup {
|
|
|
2007
2005
|
* button shape (two-line caption + value with a chevron) and opens a
|
|
2008
2006
|
* searchable checkbox popover. Used for the page-level Media Type /
|
|
2009
2007
|
* Advertiser filters that share state with the filter tray.
|
|
2010
|
-
* @tokens rounded-control, rounded-card, border-border-default, bg-surface, shadow-overlay, text-text-primary, text-text-secondary, text-text-tertiary, text-text-link, border-border-interactive, bg-brand-primaryAction, bg-input, hover:bg-subtle, hover:text-text-primary, placeholder:text-text-tertiary, text-brand-onprimary
|
|
2008
|
+
* @tokens border-border-strong, rounded-control, rounded-card, border-border-default, bg-surface, shadow-overlay, text-text-primary, text-text-secondary, text-text-tertiary, text-text-link, border-border-interactive, bg-brand-primaryAction, bg-input, hover:bg-subtle, hover:text-text-primary, placeholder:text-text-tertiary, text-brand-onprimary
|
|
2011
2009
|
* @dependencies lucide-react
|
|
2012
2010
|
* @behavior `variant` picks the trigger's chip stroke: `box` (default, the
|
|
2013
2011
|
* boxed two-line chip on the default border) or `inline` (same fill,
|
package/dist/index.js
CHANGED
|
@@ -233,7 +233,7 @@ function AdvertiserQuickFilter({
|
|
|
233
233
|
"aria-label": caption,
|
|
234
234
|
"data-testid": testIdPrefix && `${testIdPrefix}-popover`,
|
|
235
235
|
children: [
|
|
236
|
-
/* @__PURE__ */ jsx3("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ jsxs3("div", { className: "flex h-9 items-center gap-2 rounded-control border border-border-
|
|
236
|
+
/* @__PURE__ */ jsx3("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ jsxs3("div", { className: "flex h-9 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 focus-within:border-border-focus focus-within:ring-2 focus-within:ring-border-focus/30", children: [
|
|
237
237
|
/* @__PURE__ */ jsx3(Search2, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
|
|
238
238
|
/* @__PURE__ */ jsx3(
|
|
239
239
|
"input",
|
|
@@ -892,7 +892,7 @@ function DateRangeFilter({
|
|
|
892
892
|
function Field({ label, value }) {
|
|
893
893
|
return /* @__PURE__ */ jsxs6("div", { className: "flex flex-col gap-1.5", children: [
|
|
894
894
|
/* @__PURE__ */ jsx7("span", { className: "text-[12px] font-medium text-text-secondary", children: label }),
|
|
895
|
-
/* @__PURE__ */ jsx7("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-
|
|
895
|
+
/* @__PURE__ */ jsx7("div", { className: "flex h-10 min-w-[140px] items-center rounded-control border border-border-strong bg-input px-3 text-[14px] font-medium text-text-primary", children: value })
|
|
896
896
|
] });
|
|
897
897
|
}
|
|
898
898
|
function NavBtn({ children, onClick, ...rest }) {
|
|
@@ -2313,7 +2313,7 @@ function SelectionPicker({
|
|
|
2313
2313
|
}) }),
|
|
2314
2314
|
source === "search" && /* @__PURE__ */ jsxs22("div", { className: "flex min-w-0 flex-col gap-3", children: [
|
|
2315
2315
|
/* @__PURE__ */ jsxs22("div", { className: "flex flex-wrap items-center gap-2", children: [
|
|
2316
|
-
/* @__PURE__ */ jsxs22("div", { className: "flex h-9 min-w-[200px] flex-1 items-center gap-2 rounded-control border border-border-
|
|
2316
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex h-9 min-w-[200px] flex-1 items-center gap-2 rounded-control border border-border-strong bg-input px-3", children: [
|
|
2317
2317
|
/* @__PURE__ */ jsx24(Search4, { size: 15, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
2318
2318
|
/* @__PURE__ */ jsx24(
|
|
2319
2319
|
"input",
|
|
@@ -2627,7 +2627,7 @@ function FilterDropdown({
|
|
|
2627
2627
|
onClick: () => setOpen((v) => !v),
|
|
2628
2628
|
"aria-expanded": open,
|
|
2629
2629
|
"data-testid": testIdPrefix && `${testIdPrefix}-filter-${filterSlug}`,
|
|
2630
|
-
className: "inline-flex h-9 items-center gap-1.5 whitespace-nowrap rounded-control border border-border-
|
|
2630
|
+
className: "inline-flex h-9 items-center gap-1.5 whitespace-nowrap rounded-control border border-border-strong bg-input px-3 text-[13px] font-medium text-text-secondary transition-colors hover:bg-subtle",
|
|
2631
2631
|
children: [
|
|
2632
2632
|
label,
|
|
2633
2633
|
/* @__PURE__ */ jsx24(ChevronDown8, { size: 13, "aria-hidden": "true", className: cx8("transition-transform", open && "rotate-180") })
|
|
@@ -2644,7 +2644,7 @@ function FilterDropdown({
|
|
|
2644
2644
|
style: { top: pos.top, left: pos.left },
|
|
2645
2645
|
className: "fixed z-[80] min-w-[220px] rounded-card border border-border-default bg-surface p-2 shadow-overlay",
|
|
2646
2646
|
children: [
|
|
2647
|
-
searchable && /* @__PURE__ */ jsxs22("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-
|
|
2647
|
+
searchable && /* @__PURE__ */ jsxs22("div", { className: "mb-1.5 flex h-8 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
|
|
2648
2648
|
/* @__PURE__ */ jsx24(Search4, { size: 14, className: "shrink-0 text-text-secondary", "aria-hidden": "true" }),
|
|
2649
2649
|
/* @__PURE__ */ jsx24(
|
|
2650
2650
|
"input",
|
|
@@ -2984,7 +2984,7 @@ function NameListModal({
|
|
|
2984
2984
|
value: name,
|
|
2985
2985
|
onChange: (e) => setName(e.target.value),
|
|
2986
2986
|
placeholder,
|
|
2987
|
-
className: "h-10 rounded-control border border-border-
|
|
2987
|
+
className: "h-10 rounded-control border border-border-strong bg-input px-3 text-sm outline-hidden focus:border-brand-primaryAction"
|
|
2988
2988
|
}
|
|
2989
2989
|
)
|
|
2990
2990
|
] }),
|
|
@@ -3007,13 +3007,12 @@ function NameListModal({
|
|
|
3007
3007
|
|
|
3008
3008
|
// src/ChipTrigger.tsx
|
|
3009
3009
|
import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
|
|
3010
|
-
function chipTriggerClass(
|
|
3010
|
+
function chipTriggerClass(_variant = "box") {
|
|
3011
3011
|
return cn(
|
|
3012
|
-
"flex h-11 items-center gap-2 rounded-control border bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus"
|
|
3013
|
-
//
|
|
3014
|
-
//
|
|
3015
|
-
//
|
|
3016
|
-
variant === "inline" ? "border-border-strong" : "border-border-default"
|
|
3012
|
+
"flex h-11 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5 text-text-secondary transition-colors hover:bg-subtle hover:text-text-primary focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus"
|
|
3013
|
+
// One stroke for every trigger: a `box` chip on the lighter default
|
|
3014
|
+
// border sat beside SelectFilter's darker one in the same row and read as
|
|
3015
|
+
// a different kind of control. The variant no longer changes anything.
|
|
3017
3016
|
);
|
|
3018
3017
|
}
|
|
3019
3018
|
function ChipContent({ caption, value, icon }) {
|
|
@@ -3316,7 +3315,7 @@ function TablePagination({
|
|
|
3316
3315
|
onChange: (e) => onPerPageChange(Number(e.target.value)),
|
|
3317
3316
|
"aria-label": "Items per page",
|
|
3318
3317
|
"data-testid": testIdPrefix && `${testIdPrefix}-per-page`,
|
|
3319
|
-
className: "appearance-none rounded-control border border-border-
|
|
3318
|
+
className: "appearance-none rounded-control border border-border-strong bg-input py-1 pl-2.5 pr-7 text-[13px] font-medium text-text-primary focus:outline focus:outline-2 focus:outline-border-focus",
|
|
3320
3319
|
children: perPageOptions.map((n) => /* @__PURE__ */ jsx35("option", { value: n, children: n }, n))
|
|
3321
3320
|
}
|
|
3322
3321
|
),
|
|
@@ -3457,7 +3456,7 @@ function MiniSelect({ value, onChange, options }) {
|
|
|
3457
3456
|
const opt = options.find((o) => String(o.value) === e.target.value);
|
|
3458
3457
|
if (opt) onChange(opt.value);
|
|
3459
3458
|
},
|
|
3460
|
-
className: "rounded-control border border-border-
|
|
3459
|
+
className: "rounded-control border border-border-strong bg-input px-1.5 py-1 text-[12px] text-text-primary outline-hidden focus:border-border-focus",
|
|
3461
3460
|
children: options.map((o) => /* @__PURE__ */ jsx36("option", { value: String(o.value), children: o.label }, String(o.value)))
|
|
3462
3461
|
}
|
|
3463
3462
|
);
|
|
@@ -3710,7 +3709,7 @@ function MultiSelectFilter({
|
|
|
3710
3709
|
role: "dialog",
|
|
3711
3710
|
"aria-label": caption,
|
|
3712
3711
|
children: [
|
|
3713
|
-
searchable && /* @__PURE__ */ jsx37("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ jsxs33("div", { className: "flex h-9 items-center gap-2 rounded-control border border-border-
|
|
3712
|
+
searchable && /* @__PURE__ */ jsx37("div", { className: "border-b border-border-default p-2", children: /* @__PURE__ */ jsxs33("div", { className: "flex h-9 items-center gap-2 rounded-control border border-border-strong bg-input px-2.5", children: [
|
|
3714
3713
|
/* @__PURE__ */ jsx37(Search5, { size: 14, className: "text-text-secondary", "aria-hidden": "true" }),
|
|
3715
3714
|
/* @__PURE__ */ jsx37(
|
|
3716
3715
|
"input",
|