@mediaradar/design-components 0.43.0 → 0.45.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/approved-components.json +1 -1
- package/dist/index.cjs +94 -73
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +41 -15
- package/dist/index.d.ts +41 -15
- package/dist/index.js +94 -73
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -66,7 +66,7 @@ declare function InfoTip({ text, size, label, trigger }: InfoTipProps): react.JS
|
|
|
66
66
|
* the copy props make it reusable for any dimension that's also search-first
|
|
67
67
|
* in its own filter tray, so the dimension reads the same in the quick bar as
|
|
68
68
|
* it does there.
|
|
69
|
-
* @tokens text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
69
|
+
* @tokens text-dense, text-micro, text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
70
70
|
* border-border-interactive, border-border-focus, bg-surface, bg-input,
|
|
71
71
|
* shadow-overlay, text-xs, text-text-primary, text-text-secondary, text-text-tertiary,
|
|
72
72
|
* text-text-link, bg-brand-primaryAction, text-brand-onprimary,
|
|
@@ -461,7 +461,7 @@ declare function CheckBoxBox({ checked, indeterminate, disabled, className }: Ch
|
|
|
461
461
|
* a chevron that opens a two-pane picker: preset shortcuts on the left, a
|
|
462
462
|
* dual-month calendar with range highlighting on the right, Start/End fields,
|
|
463
463
|
* and Cancel/Apply. Shared by Creative Intel and the Account Review.
|
|
464
|
-
* @tokens text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
464
|
+
* @tokens text-micro, text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
465
465
|
* bg-surface, bg-input, bg-subtle, bg-ai-tint, bg-brand-primaryAction, text-brand-onprimary,
|
|
466
466
|
* shadow-overlay, text-text-primary, text-text-secondary, text-text-tertiary,
|
|
467
467
|
* hover:bg-subtle, hover:text-text-primary, focus-visible:outline-border-focus, text-dense
|
|
@@ -800,7 +800,7 @@ declare function SectionRail({ title, titleSerif, subtitle, viewAllLabel, viewAl
|
|
|
800
800
|
* formats, for stable report-ready numbers). One boolean, one control,
|
|
801
801
|
* shared across every dashboard that has this data-finality concept
|
|
802
802
|
* (Publisher Intel, Opportunities, Sports).
|
|
803
|
-
* @tokens text-control-caption, rounded-control, border-border-strong, bg-input, hover:bg-subtle,
|
|
803
|
+
* @tokens text-dense, text-control-caption, rounded-control, border-border-strong, bg-input, hover:bg-subtle,
|
|
804
804
|
* hover:text-text-primary, focus-visible:outline-border-focus, rounded-card,
|
|
805
805
|
* border-border-default, bg-surface, shadow-overlay, text-text-primary,
|
|
806
806
|
* text-text-secondary, text-text-tertiary, text-brand-primaryAction
|
|
@@ -872,12 +872,17 @@ declare function DataScopeFilter({ value, onChange, align }: DataScopeFilterProp
|
|
|
872
872
|
* @use for picking one value from a short list in a filter row or a form --
|
|
873
873
|
* the caption-over-value chip is the one dropdown trigger.
|
|
874
874
|
* @use the caption everywhere except tight spots where the field is obvious.
|
|
875
|
+
* @use `size="sm"` (32px) for a control in a card or panel header (a card's
|
|
876
|
+
* Measure or Compare by), with `inlineCaption` when the value alone doesn't
|
|
877
|
+
* say what it sets ("Sort by: Name"). There is no 36px step.
|
|
878
|
+
* @avoid a hand-built 36px "slim" chip; use `sm`.
|
|
875
879
|
* @avoid a native <select> or a hand-built dropdown.
|
|
876
880
|
* @avoid it for several values at once -- that's MultiSelectFilter.
|
|
877
881
|
* @usage
|
|
878
882
|
* ```tsx
|
|
879
883
|
* <SelectFilter caption="Rank" value={rankFilter} onChange={setRankFilter} options={['All', 'VP / Director', 'Manager', 'Coordinator']} />
|
|
880
884
|
* <SelectFilter caption="Group by" value={groupBy} onChange={setGroupBy} options={['Parent', 'Advertiser', 'Brand']} fullWidth testIdPrefix="dropdown-group-by" />
|
|
885
|
+
* <SelectFilter caption="Sort by" size="sm" inlineCaption value={sort} onChange={setSort} options={['Name', 'Spend']} align="right" />
|
|
881
886
|
* <SelectFilter caption="Country" value={country} onChange={setCountry} options={['United States', 'Canada', 'United Kingdom']} renderIcon={(c) => <img src={FLAGS[c]} alt="" />} />
|
|
882
887
|
* ```
|
|
883
888
|
*/
|
|
@@ -915,6 +920,12 @@ interface SelectFilterProps {
|
|
|
915
920
|
* control in TablePagination. Defaults to 'md', the 44px caption chip.
|
|
916
921
|
*/
|
|
917
922
|
size?: "md" | "sm";
|
|
923
|
+
/**
|
|
924
|
+
* With `size="sm"`: show the caption in the trigger, "Sort by: Name",
|
|
925
|
+
* instead of only the value. For a compact control whose value alone
|
|
926
|
+
* doesn't say what it sets.
|
|
927
|
+
*/
|
|
928
|
+
inlineCaption?: boolean;
|
|
918
929
|
/** Fades the trigger to 40% and blocks it, e.g. while a table loads. */
|
|
919
930
|
disabled?: boolean;
|
|
920
931
|
/**
|
|
@@ -926,7 +937,7 @@ interface SelectFilterProps {
|
|
|
926
937
|
*/
|
|
927
938
|
renderIcon?: (option: string) => ReactNode;
|
|
928
939
|
}
|
|
929
|
-
declare function SelectFilter({ caption, value, options, onChange, align, fullWidth, className, testIdPrefix, loading, error, onRetry, size, disabled, renderIcon, }: SelectFilterProps): react.JSX.Element;
|
|
940
|
+
declare function SelectFilter({ caption, value, options, onChange, align, fullWidth, className, testIdPrefix, loading, error, onRetry, size, inlineCaption, disabled, renderIcon, }: SelectFilterProps): react.JSX.Element;
|
|
930
941
|
|
|
931
942
|
/**
|
|
932
943
|
* @pattern Card
|
|
@@ -1021,8 +1032,8 @@ interface NoResultsAction {
|
|
|
1021
1032
|
/** Rendered as the filled button; every other action renders as the quiet link/button. */
|
|
1022
1033
|
primary?: boolean;
|
|
1023
1034
|
}
|
|
1024
|
-
declare const PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-
|
|
1025
|
-
declare const QUIET_ACTION_CLASS = "rounded-control text-
|
|
1035
|
+
declare const PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-dense font-semibold text-brand-onprimary transition-colors hover:opacity-90";
|
|
1036
|
+
declare const QUIET_ACTION_CLASS = "rounded-control text-dense font-medium text-text-link transition-colors hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus";
|
|
1026
1037
|
/**
|
|
1027
1038
|
* @pattern NoResultsEmptyState
|
|
1028
1039
|
* @status stable
|
|
@@ -1035,7 +1046,7 @@ declare const QUIET_ACTION_CLASS = "rounded-control text-[13px] font-medium text
|
|
|
1035
1046
|
* stack -- no border, background, or fixed height -- so it can sit directly
|
|
1036
1047
|
* in a colSpan table cell (or a card, or a chart body) that already owns
|
|
1037
1048
|
* that chrome, without imposing its own.
|
|
1038
|
-
* @tokens bg-subtle, text-text-tertiary, text-base, text-text-primary,
|
|
1049
|
+
* @tokens text-dense, bg-subtle, text-text-tertiary, text-base, text-text-primary,
|
|
1039
1050
|
* text-text-secondary, rounded-control, bg-brand-primaryAction, text-brand-onprimary, text-text-link,
|
|
1040
1051
|
* focus-visible:outline-border-focus
|
|
1041
1052
|
* @dependencies lucide-react
|
|
@@ -1433,7 +1444,7 @@ declare function Tooltip({ label, children, anchorRef, className, whenTruncated,
|
|
|
1433
1444
|
* `NoResultsEmptyState` (a whole-board "no results match your filters"
|
|
1434
1445
|
* state) -- this one is scoped to a single search box returning nothing,
|
|
1435
1446
|
* inline within a picker's option list.
|
|
1436
|
-
* @tokens text-text-primary, text-text-tertiary
|
|
1447
|
+
* @tokens text-dense, text-text-primary, text-text-tertiary
|
|
1437
1448
|
* @usage
|
|
1438
1449
|
* ```tsx
|
|
1439
1450
|
* <AdvertiserNoResults query={query} />
|
|
@@ -1496,7 +1507,7 @@ declare function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }
|
|
|
1496
1507
|
* row content (plain rows, opacity-dimmed "parked" rows, per-tray custom
|
|
1497
1508
|
* columns), so a fixed row shape would have forced a compromise none of them
|
|
1498
1509
|
* need. Self-hides at `count === 0` so a caller can render it unconditionally.
|
|
1499
|
-
* @tokens rounded-control, text-text-tertiary, hover:text-text-primary
|
|
1510
|
+
* @tokens text-micro, rounded-control, text-text-tertiary, hover:text-text-primary
|
|
1500
1511
|
* @dependencies lucide-react
|
|
1501
1512
|
* @a11y The disclosure header is a button reporting aria-expanded, and the
|
|
1502
1513
|
* chevron is aria-hidden. It is a disclosure, not a selection control --
|
|
@@ -1729,7 +1740,7 @@ interface PublisherBreakdownListProps {
|
|
|
1729
1740
|
* deliberately NOT merged into this component -- see the escape-hatch note
|
|
1730
1741
|
* below. `renderLogo` lets a caller plug in real per-row logos; without it,
|
|
1731
1742
|
* rows show a plain initials monogram.
|
|
1732
|
-
* @tokens text-text-primary, text-text-tertiary, text-text-secondary,
|
|
1743
|
+
* @tokens text-micro, text-text-primary, text-text-tertiary, text-text-secondary,
|
|
1733
1744
|
* text-text-link, text-text-warning, text-text-success, text-text-danger,
|
|
1734
1745
|
* border-border-default, bg-surface, bg-subtle, rounded-control, rounded-full,
|
|
1735
1746
|
* shadow-overlay, text-badge
|
|
@@ -1916,7 +1927,7 @@ interface NameListModalProps {
|
|
|
1916
1927
|
* checkboxes under it. Shared by the Account Lists table and the list detail
|
|
1917
1928
|
* page so create/rename look identical; `fieldLabel`/`placeholder` relabel it
|
|
1918
1929
|
* for dialogs that name something other than a list.
|
|
1919
|
-
* @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-visible:outline-border-focus, text-dense, z-modal
|
|
1930
|
+
* @tokens text-base, 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-visible:outline-border-focus, text-dense, z-modal
|
|
1920
1931
|
* @behavior Escape closes the dialog via `onCancel`, same as clicking the
|
|
1921
1932
|
* scrim backdrop. Submit is disabled until the name is non-empty (trimmed).
|
|
1922
1933
|
* When `options` are given they render as CheckBox rows below the field, and
|
|
@@ -2000,7 +2011,7 @@ interface FilterChipBarProps<T extends ChipLike> {
|
|
|
2000
2011
|
* (tooltip + outline). "Clear all" trails the chips. Generic over the
|
|
2001
2012
|
* page's own chip type — only the shared key/label/groupLabel fields are
|
|
2002
2013
|
* used.
|
|
2003
|
-
* @tokens rounded-full, bg-subtle, text-text-secondary, text-text-link, text-text-tertiary, bg-text-primary, border-border-default, group-hover:bg-border-default, group-hover:ring-border-interactive, group-hover:text-text-primary, group-hover:text-text-secondary, hover:text-text-primary, shadow-raised, text-surface
|
|
2014
|
+
* @tokens text-micro, rounded-full, bg-subtle, text-text-secondary, text-text-link, text-text-tertiary, bg-text-primary, border-border-default, group-hover:bg-border-default, group-hover:ring-border-interactive, group-hover:text-text-primary, group-hover:text-text-secondary, hover:text-text-primary, shadow-raised, text-surface
|
|
2004
2015
|
* @dependencies lucide-react
|
|
2005
2016
|
* @behavior A parked chip (key in `parkedKeys`) renders with no fill and a
|
|
2006
2017
|
* dashed edge instead of the solid applied style, and its hover tooltip
|
|
@@ -2127,7 +2138,7 @@ interface PagerProps {
|
|
|
2127
2138
|
* the left if the reader needs it.
|
|
2128
2139
|
* @avoid under a full-page table -- use TablePagination, which adds the
|
|
2129
2140
|
* first/last steps, the range readout and the rows-per-page select.
|
|
2130
|
-
* @tokens rounded-control, text-text-secondary, bg-subtle, text-text-primary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary
|
|
2141
|
+
* @tokens text-dense, rounded-control, text-text-secondary, bg-subtle, text-text-primary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary
|
|
2131
2142
|
* @dependencies lucide-react
|
|
2132
2143
|
* @a11y Renders its own <nav aria-label="Pagination"> landmark, like
|
|
2133
2144
|
* TablePagination, so don't wrap it in another <nav>. Pass `label` to name it
|
|
@@ -2418,7 +2429,7 @@ interface MultiSelectGroup {
|
|
|
2418
2429
|
* button shape (two-line caption + value with a chevron) and opens a
|
|
2419
2430
|
* searchable checkbox popover. Used for the page-level Media type /
|
|
2420
2431
|
* Advertiser filters that share state with the filter tray.
|
|
2421
|
-
* @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, focus-within:outline-border-focus
|
|
2432
|
+
* @tokens text-dense, 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, focus-within:outline-border-focus
|
|
2422
2433
|
* @dependencies lucide-react
|
|
2423
2434
|
* @behavior `variant` picks the trigger's chip stroke: `box` (default, the
|
|
2424
2435
|
* boxed two-line chip on the default border) or `inline` (same fill,
|
|
@@ -2438,15 +2449,22 @@ interface MultiSelectGroup {
|
|
|
2438
2449
|
* Escape closes it. Option rows carry their own checkbox semantics. Focus
|
|
2439
2450
|
* is not moved into the menu on open, so keyboard users tab into it in DOM
|
|
2440
2451
|
* order. The loading rows carry role="status" and the error line role="alert".
|
|
2452
|
+
* @behavior `valueLabel` replaces the trigger's value text, for when a picked
|
|
2453
|
+
* option's own label is ambiguous outside its group ("All" for a market
|
|
2454
|
+
* filter where nothing and everything mean the same). `hints` puts a short
|
|
2455
|
+
* definition under an option's label, keyed by option or group id, for a term
|
|
2456
|
+
* the user may not know. `note` is one line of explanation under the list.
|
|
2441
2457
|
* @behavior `loading` swaps the list for grey placeholder rows and `error`
|
|
2442
2458
|
* for a plain "Couldn't load options." line with a Try again link
|
|
2443
2459
|
* (`onRetry`). The trigger never changes in either state.
|
|
2444
2460
|
* @usage
|
|
2445
2461
|
* ```tsx
|
|
2446
2462
|
* <MultiSelectFilter caption="Media" options={mediaOptions} selected={selected} onChange={setSelected} />
|
|
2463
|
+
* <MultiSelectFilter caption="Market" options={markets} selected={selected} onChange={setSelected}
|
|
2464
|
+
* hints={{ national: "Ads that run nationwide" }} note="Nothing picked means every market." />
|
|
2447
2465
|
* ```
|
|
2448
2466
|
*/
|
|
2449
|
-
declare function MultiSelectFilter({ caption, options, groups, counts, variant, selected, onChange, allLabel, searchable, searchPlaceholder, align, fullIsAll, min, icon, showFooter, clearValue, menuWidthClass, plainParent, fullWidth, loading, error, onRetry, }: {
|
|
2467
|
+
declare function MultiSelectFilter({ caption, options, groups, counts, variant, selected, onChange, allLabel, searchable, searchPlaceholder, align, fullIsAll, min, icon, showFooter, clearValue, menuWidthClass, plainParent, fullWidth, loading, error, onRetry, valueLabel, hints, note, }: {
|
|
2450
2468
|
caption: string;
|
|
2451
2469
|
/**
|
|
2452
2470
|
* Live option-id -> result count. Supplying it makes the menu faceted:
|
|
@@ -2496,6 +2514,14 @@ declare function MultiSelectFilter({ caption, options, groups, counts, variant,
|
|
|
2496
2514
|
error?: boolean;
|
|
2497
2515
|
/** Called by the Try again link in the error state. */
|
|
2498
2516
|
onRetry?: () => void;
|
|
2517
|
+
/** Trigger text in place of the default ("All", the one label, "n selected"),
|
|
2518
|
+
* when a picked option's own label is ambiguous outside its group. */
|
|
2519
|
+
valueLabel?: string;
|
|
2520
|
+
/** A short definition under an option's label, by option or group id, for a
|
|
2521
|
+
* term the user may not know. */
|
|
2522
|
+
hints?: Record<string, string>;
|
|
2523
|
+
/** One line of explanation under the list, above the footer. */
|
|
2524
|
+
note?: React.ReactNode;
|
|
2499
2525
|
}): react.JSX.Element;
|
|
2500
2526
|
type MultiSelectFilterProps = Parameters<typeof MultiSelectFilter>[0];
|
|
2501
2527
|
|
package/dist/index.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ declare function InfoTip({ text, size, label, trigger }: InfoTipProps): react.JS
|
|
|
66
66
|
* the copy props make it reusable for any dimension that's also search-first
|
|
67
67
|
* in its own filter tray, so the dimension reads the same in the quick bar as
|
|
68
68
|
* it does there.
|
|
69
|
-
* @tokens text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
69
|
+
* @tokens text-dense, text-micro, text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
70
70
|
* border-border-interactive, border-border-focus, bg-surface, bg-input,
|
|
71
71
|
* shadow-overlay, text-xs, text-text-primary, text-text-secondary, text-text-tertiary,
|
|
72
72
|
* text-text-link, bg-brand-primaryAction, text-brand-onprimary,
|
|
@@ -461,7 +461,7 @@ declare function CheckBoxBox({ checked, indeterminate, disabled, className }: Ch
|
|
|
461
461
|
* a chevron that opens a two-pane picker: preset shortcuts on the left, a
|
|
462
462
|
* dual-month calendar with range highlighting on the right, Start/End fields,
|
|
463
463
|
* and Cancel/Apply. Shared by Creative Intel and the Account Review.
|
|
464
|
-
* @tokens text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
464
|
+
* @tokens text-micro, text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
465
465
|
* bg-surface, bg-input, bg-subtle, bg-ai-tint, bg-brand-primaryAction, text-brand-onprimary,
|
|
466
466
|
* shadow-overlay, text-text-primary, text-text-secondary, text-text-tertiary,
|
|
467
467
|
* hover:bg-subtle, hover:text-text-primary, focus-visible:outline-border-focus, text-dense
|
|
@@ -800,7 +800,7 @@ declare function SectionRail({ title, titleSerif, subtitle, viewAllLabel, viewAl
|
|
|
800
800
|
* formats, for stable report-ready numbers). One boolean, one control,
|
|
801
801
|
* shared across every dashboard that has this data-finality concept
|
|
802
802
|
* (Publisher Intel, Opportunities, Sports).
|
|
803
|
-
* @tokens text-control-caption, rounded-control, border-border-strong, bg-input, hover:bg-subtle,
|
|
803
|
+
* @tokens text-dense, text-control-caption, rounded-control, border-border-strong, bg-input, hover:bg-subtle,
|
|
804
804
|
* hover:text-text-primary, focus-visible:outline-border-focus, rounded-card,
|
|
805
805
|
* border-border-default, bg-surface, shadow-overlay, text-text-primary,
|
|
806
806
|
* text-text-secondary, text-text-tertiary, text-brand-primaryAction
|
|
@@ -872,12 +872,17 @@ declare function DataScopeFilter({ value, onChange, align }: DataScopeFilterProp
|
|
|
872
872
|
* @use for picking one value from a short list in a filter row or a form --
|
|
873
873
|
* the caption-over-value chip is the one dropdown trigger.
|
|
874
874
|
* @use the caption everywhere except tight spots where the field is obvious.
|
|
875
|
+
* @use `size="sm"` (32px) for a control in a card or panel header (a card's
|
|
876
|
+
* Measure or Compare by), with `inlineCaption` when the value alone doesn't
|
|
877
|
+
* say what it sets ("Sort by: Name"). There is no 36px step.
|
|
878
|
+
* @avoid a hand-built 36px "slim" chip; use `sm`.
|
|
875
879
|
* @avoid a native <select> or a hand-built dropdown.
|
|
876
880
|
* @avoid it for several values at once -- that's MultiSelectFilter.
|
|
877
881
|
* @usage
|
|
878
882
|
* ```tsx
|
|
879
883
|
* <SelectFilter caption="Rank" value={rankFilter} onChange={setRankFilter} options={['All', 'VP / Director', 'Manager', 'Coordinator']} />
|
|
880
884
|
* <SelectFilter caption="Group by" value={groupBy} onChange={setGroupBy} options={['Parent', 'Advertiser', 'Brand']} fullWidth testIdPrefix="dropdown-group-by" />
|
|
885
|
+
* <SelectFilter caption="Sort by" size="sm" inlineCaption value={sort} onChange={setSort} options={['Name', 'Spend']} align="right" />
|
|
881
886
|
* <SelectFilter caption="Country" value={country} onChange={setCountry} options={['United States', 'Canada', 'United Kingdom']} renderIcon={(c) => <img src={FLAGS[c]} alt="" />} />
|
|
882
887
|
* ```
|
|
883
888
|
*/
|
|
@@ -915,6 +920,12 @@ interface SelectFilterProps {
|
|
|
915
920
|
* control in TablePagination. Defaults to 'md', the 44px caption chip.
|
|
916
921
|
*/
|
|
917
922
|
size?: "md" | "sm";
|
|
923
|
+
/**
|
|
924
|
+
* With `size="sm"`: show the caption in the trigger, "Sort by: Name",
|
|
925
|
+
* instead of only the value. For a compact control whose value alone
|
|
926
|
+
* doesn't say what it sets.
|
|
927
|
+
*/
|
|
928
|
+
inlineCaption?: boolean;
|
|
918
929
|
/** Fades the trigger to 40% and blocks it, e.g. while a table loads. */
|
|
919
930
|
disabled?: boolean;
|
|
920
931
|
/**
|
|
@@ -926,7 +937,7 @@ interface SelectFilterProps {
|
|
|
926
937
|
*/
|
|
927
938
|
renderIcon?: (option: string) => ReactNode;
|
|
928
939
|
}
|
|
929
|
-
declare function SelectFilter({ caption, value, options, onChange, align, fullWidth, className, testIdPrefix, loading, error, onRetry, size, disabled, renderIcon, }: SelectFilterProps): react.JSX.Element;
|
|
940
|
+
declare function SelectFilter({ caption, value, options, onChange, align, fullWidth, className, testIdPrefix, loading, error, onRetry, size, inlineCaption, disabled, renderIcon, }: SelectFilterProps): react.JSX.Element;
|
|
930
941
|
|
|
931
942
|
/**
|
|
932
943
|
* @pattern Card
|
|
@@ -1021,8 +1032,8 @@ interface NoResultsAction {
|
|
|
1021
1032
|
/** Rendered as the filled button; every other action renders as the quiet link/button. */
|
|
1022
1033
|
primary?: boolean;
|
|
1023
1034
|
}
|
|
1024
|
-
declare const PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-
|
|
1025
|
-
declare const QUIET_ACTION_CLASS = "rounded-control text-
|
|
1035
|
+
declare const PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-dense font-semibold text-brand-onprimary transition-colors hover:opacity-90";
|
|
1036
|
+
declare const QUIET_ACTION_CLASS = "rounded-control text-dense font-medium text-text-link transition-colors hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus";
|
|
1026
1037
|
/**
|
|
1027
1038
|
* @pattern NoResultsEmptyState
|
|
1028
1039
|
* @status stable
|
|
@@ -1035,7 +1046,7 @@ declare const QUIET_ACTION_CLASS = "rounded-control text-[13px] font-medium text
|
|
|
1035
1046
|
* stack -- no border, background, or fixed height -- so it can sit directly
|
|
1036
1047
|
* in a colSpan table cell (or a card, or a chart body) that already owns
|
|
1037
1048
|
* that chrome, without imposing its own.
|
|
1038
|
-
* @tokens bg-subtle, text-text-tertiary, text-base, text-text-primary,
|
|
1049
|
+
* @tokens text-dense, bg-subtle, text-text-tertiary, text-base, text-text-primary,
|
|
1039
1050
|
* text-text-secondary, rounded-control, bg-brand-primaryAction, text-brand-onprimary, text-text-link,
|
|
1040
1051
|
* focus-visible:outline-border-focus
|
|
1041
1052
|
* @dependencies lucide-react
|
|
@@ -1433,7 +1444,7 @@ declare function Tooltip({ label, children, anchorRef, className, whenTruncated,
|
|
|
1433
1444
|
* `NoResultsEmptyState` (a whole-board "no results match your filters"
|
|
1434
1445
|
* state) -- this one is scoped to a single search box returning nothing,
|
|
1435
1446
|
* inline within a picker's option list.
|
|
1436
|
-
* @tokens text-text-primary, text-text-tertiary
|
|
1447
|
+
* @tokens text-dense, text-text-primary, text-text-tertiary
|
|
1437
1448
|
* @usage
|
|
1438
1449
|
* ```tsx
|
|
1439
1450
|
* <AdvertiserNoResults query={query} />
|
|
@@ -1496,7 +1507,7 @@ declare function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }
|
|
|
1496
1507
|
* row content (plain rows, opacity-dimmed "parked" rows, per-tray custom
|
|
1497
1508
|
* columns), so a fixed row shape would have forced a compromise none of them
|
|
1498
1509
|
* need. Self-hides at `count === 0` so a caller can render it unconditionally.
|
|
1499
|
-
* @tokens rounded-control, text-text-tertiary, hover:text-text-primary
|
|
1510
|
+
* @tokens text-micro, rounded-control, text-text-tertiary, hover:text-text-primary
|
|
1500
1511
|
* @dependencies lucide-react
|
|
1501
1512
|
* @a11y The disclosure header is a button reporting aria-expanded, and the
|
|
1502
1513
|
* chevron is aria-hidden. It is a disclosure, not a selection control --
|
|
@@ -1729,7 +1740,7 @@ interface PublisherBreakdownListProps {
|
|
|
1729
1740
|
* deliberately NOT merged into this component -- see the escape-hatch note
|
|
1730
1741
|
* below. `renderLogo` lets a caller plug in real per-row logos; without it,
|
|
1731
1742
|
* rows show a plain initials monogram.
|
|
1732
|
-
* @tokens text-text-primary, text-text-tertiary, text-text-secondary,
|
|
1743
|
+
* @tokens text-micro, text-text-primary, text-text-tertiary, text-text-secondary,
|
|
1733
1744
|
* text-text-link, text-text-warning, text-text-success, text-text-danger,
|
|
1734
1745
|
* border-border-default, bg-surface, bg-subtle, rounded-control, rounded-full,
|
|
1735
1746
|
* shadow-overlay, text-badge
|
|
@@ -1916,7 +1927,7 @@ interface NameListModalProps {
|
|
|
1916
1927
|
* checkboxes under it. Shared by the Account Lists table and the list detail
|
|
1917
1928
|
* page so create/rename look identical; `fieldLabel`/`placeholder` relabel it
|
|
1918
1929
|
* for dialogs that name something other than a list.
|
|
1919
|
-
* @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-visible:outline-border-focus, text-dense, z-modal
|
|
1930
|
+
* @tokens text-base, 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-visible:outline-border-focus, text-dense, z-modal
|
|
1920
1931
|
* @behavior Escape closes the dialog via `onCancel`, same as clicking the
|
|
1921
1932
|
* scrim backdrop. Submit is disabled until the name is non-empty (trimmed).
|
|
1922
1933
|
* When `options` are given they render as CheckBox rows below the field, and
|
|
@@ -2000,7 +2011,7 @@ interface FilterChipBarProps<T extends ChipLike> {
|
|
|
2000
2011
|
* (tooltip + outline). "Clear all" trails the chips. Generic over the
|
|
2001
2012
|
* page's own chip type — only the shared key/label/groupLabel fields are
|
|
2002
2013
|
* used.
|
|
2003
|
-
* @tokens rounded-full, bg-subtle, text-text-secondary, text-text-link, text-text-tertiary, bg-text-primary, border-border-default, group-hover:bg-border-default, group-hover:ring-border-interactive, group-hover:text-text-primary, group-hover:text-text-secondary, hover:text-text-primary, shadow-raised, text-surface
|
|
2014
|
+
* @tokens text-micro, rounded-full, bg-subtle, text-text-secondary, text-text-link, text-text-tertiary, bg-text-primary, border-border-default, group-hover:bg-border-default, group-hover:ring-border-interactive, group-hover:text-text-primary, group-hover:text-text-secondary, hover:text-text-primary, shadow-raised, text-surface
|
|
2004
2015
|
* @dependencies lucide-react
|
|
2005
2016
|
* @behavior A parked chip (key in `parkedKeys`) renders with no fill and a
|
|
2006
2017
|
* dashed edge instead of the solid applied style, and its hover tooltip
|
|
@@ -2127,7 +2138,7 @@ interface PagerProps {
|
|
|
2127
2138
|
* the left if the reader needs it.
|
|
2128
2139
|
* @avoid under a full-page table -- use TablePagination, which adds the
|
|
2129
2140
|
* first/last steps, the range readout and the rows-per-page select.
|
|
2130
|
-
* @tokens rounded-control, text-text-secondary, bg-subtle, text-text-primary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary
|
|
2141
|
+
* @tokens text-dense, rounded-control, text-text-secondary, bg-subtle, text-text-primary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary
|
|
2131
2142
|
* @dependencies lucide-react
|
|
2132
2143
|
* @a11y Renders its own <nav aria-label="Pagination"> landmark, like
|
|
2133
2144
|
* TablePagination, so don't wrap it in another <nav>. Pass `label` to name it
|
|
@@ -2418,7 +2429,7 @@ interface MultiSelectGroup {
|
|
|
2418
2429
|
* button shape (two-line caption + value with a chevron) and opens a
|
|
2419
2430
|
* searchable checkbox popover. Used for the page-level Media type /
|
|
2420
2431
|
* Advertiser filters that share state with the filter tray.
|
|
2421
|
-
* @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, focus-within:outline-border-focus
|
|
2432
|
+
* @tokens text-dense, 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, focus-within:outline-border-focus
|
|
2422
2433
|
* @dependencies lucide-react
|
|
2423
2434
|
* @behavior `variant` picks the trigger's chip stroke: `box` (default, the
|
|
2424
2435
|
* boxed two-line chip on the default border) or `inline` (same fill,
|
|
@@ -2438,15 +2449,22 @@ interface MultiSelectGroup {
|
|
|
2438
2449
|
* Escape closes it. Option rows carry their own checkbox semantics. Focus
|
|
2439
2450
|
* is not moved into the menu on open, so keyboard users tab into it in DOM
|
|
2440
2451
|
* order. The loading rows carry role="status" and the error line role="alert".
|
|
2452
|
+
* @behavior `valueLabel` replaces the trigger's value text, for when a picked
|
|
2453
|
+
* option's own label is ambiguous outside its group ("All" for a market
|
|
2454
|
+
* filter where nothing and everything mean the same). `hints` puts a short
|
|
2455
|
+
* definition under an option's label, keyed by option or group id, for a term
|
|
2456
|
+
* the user may not know. `note` is one line of explanation under the list.
|
|
2441
2457
|
* @behavior `loading` swaps the list for grey placeholder rows and `error`
|
|
2442
2458
|
* for a plain "Couldn't load options." line with a Try again link
|
|
2443
2459
|
* (`onRetry`). The trigger never changes in either state.
|
|
2444
2460
|
* @usage
|
|
2445
2461
|
* ```tsx
|
|
2446
2462
|
* <MultiSelectFilter caption="Media" options={mediaOptions} selected={selected} onChange={setSelected} />
|
|
2463
|
+
* <MultiSelectFilter caption="Market" options={markets} selected={selected} onChange={setSelected}
|
|
2464
|
+
* hints={{ national: "Ads that run nationwide" }} note="Nothing picked means every market." />
|
|
2447
2465
|
* ```
|
|
2448
2466
|
*/
|
|
2449
|
-
declare function MultiSelectFilter({ caption, options, groups, counts, variant, selected, onChange, allLabel, searchable, searchPlaceholder, align, fullIsAll, min, icon, showFooter, clearValue, menuWidthClass, plainParent, fullWidth, loading, error, onRetry, }: {
|
|
2467
|
+
declare function MultiSelectFilter({ caption, options, groups, counts, variant, selected, onChange, allLabel, searchable, searchPlaceholder, align, fullIsAll, min, icon, showFooter, clearValue, menuWidthClass, plainParent, fullWidth, loading, error, onRetry, valueLabel, hints, note, }: {
|
|
2450
2468
|
caption: string;
|
|
2451
2469
|
/**
|
|
2452
2470
|
* Live option-id -> result count. Supplying it makes the menu faceted:
|
|
@@ -2496,6 +2514,14 @@ declare function MultiSelectFilter({ caption, options, groups, counts, variant,
|
|
|
2496
2514
|
error?: boolean;
|
|
2497
2515
|
/** Called by the Try again link in the error state. */
|
|
2498
2516
|
onRetry?: () => void;
|
|
2517
|
+
/** Trigger text in place of the default ("All", the one label, "n selected"),
|
|
2518
|
+
* when a picked option's own label is ambiguous outside its group. */
|
|
2519
|
+
valueLabel?: string;
|
|
2520
|
+
/** A short definition under an option's label, by option or group id, for a
|
|
2521
|
+
* term the user may not know. */
|
|
2522
|
+
hints?: Record<string, string>;
|
|
2523
|
+
/** One line of explanation under the list, above the footer. */
|
|
2524
|
+
note?: React.ReactNode;
|
|
2499
2525
|
}): react.JSX.Element;
|
|
2500
2526
|
type MultiSelectFilterProps = Parameters<typeof MultiSelectFilter>[0];
|
|
2501
2527
|
|