@mediaradar/design-components 0.64.0 → 0.66.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 +551 -293
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -14
- package/dist/index.d.ts +142 -14
- package/dist/index.js +548 -290
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -2254,6 +2254,12 @@ interface FilterDropdownFooterProps extends CommonProps {
|
|
|
2254
2254
|
onApply: () => void;
|
|
2255
2255
|
clearLabel?: string;
|
|
2256
2256
|
applyLabel?: string;
|
|
2257
|
+
/**
|
|
2258
|
+
* Adds a Cancel button (secondary) before Apply, for a dropdown that stages
|
|
2259
|
+
* picks: it should close and drop them. Omit for no Cancel.
|
|
2260
|
+
*/
|
|
2261
|
+
onCancel?: () => void;
|
|
2262
|
+
cancelLabel?: string;
|
|
2257
2263
|
}
|
|
2258
2264
|
/**
|
|
2259
2265
|
* @pattern FilterDropdownFooter
|
|
@@ -2262,17 +2268,20 @@ interface FilterDropdownFooterProps extends CommonProps {
|
|
|
2262
2268
|
* @description Fixed Apply/Clear All footer for quick-filter dropdowns —
|
|
2263
2269
|
* pinned below the (independently scrollable) option list so it's always
|
|
2264
2270
|
* visible. Shared by the Media/Advertiser/Date/Group By/Time Increment quick
|
|
2265
|
-
* filters on Sports Dashboard, Publisher Intel, and Opportunities.
|
|
2271
|
+
* filters on Sports Dashboard, Publisher Intel, and Opportunities. With
|
|
2272
|
+
* `onCancel`, a secondary Cancel sits right before Apply (DataTable's header
|
|
2273
|
+
* menu), Clear all, if any, staying on the left.
|
|
2266
2274
|
* @tokens border-border-default
|
|
2267
|
-
* @a11y Clear and Apply are real Buttons with visible text as their
|
|
2268
|
-
* names, in that DOM order. It adds no roles or live regions of its own --
|
|
2275
|
+
* @a11y Clear, Cancel and Apply are real Buttons with visible text as their
|
|
2276
|
+
* accessible names, in that DOM order. It adds no roles or live regions of its own --
|
|
2269
2277
|
* the menu that contains it owns dismissal and focus.
|
|
2270
2278
|
* @usage
|
|
2271
2279
|
* ```tsx
|
|
2272
2280
|
* <FilterDropdownFooter onApply={handleApply} onClear={handleClear} />
|
|
2281
|
+
* <FilterDropdownFooter onApply={apply} onCancel={discard} />
|
|
2273
2282
|
* ```
|
|
2274
2283
|
*/
|
|
2275
|
-
declare function FilterDropdownFooter({ onClear, onApply, clearLabel, applyLabel, className, testIdPrefix, }: FilterDropdownFooterProps): react.JSX.Element;
|
|
2284
|
+
declare function FilterDropdownFooter({ onClear, onApply, clearLabel, applyLabel, onCancel, cancelLabel, className, testIdPrefix, }: FilterDropdownFooterProps): react.JSX.Element;
|
|
2276
2285
|
|
|
2277
2286
|
interface NameListModalProps extends CommonProps {
|
|
2278
2287
|
/** Classes on the dialog panel (the visible surface), not the backdrop. */
|
|
@@ -2469,7 +2478,11 @@ interface SortButtonProps<K extends string> extends CommonProps {
|
|
|
2469
2478
|
* that can never be sorted. Unlike `disabled`, nothing about it is a control.
|
|
2470
2479
|
*/
|
|
2471
2480
|
sortable?: boolean;
|
|
2472
|
-
/**
|
|
2481
|
+
/**
|
|
2482
|
+
* Matches the column's alignment, so a label that wraps lines up with the
|
|
2483
|
+
* cells under it. `right` (a figure column) also puts the arrow before the
|
|
2484
|
+
* label, so the label ends exactly where the figures do.
|
|
2485
|
+
*/
|
|
2473
2486
|
align?: "left" | "center" | "right";
|
|
2474
2487
|
/**
|
|
2475
2488
|
* What the column means, for a non-obvious measure ("Share of the set's
|
|
@@ -2494,7 +2507,10 @@ interface SortButtonProps<K extends string> extends CommonProps {
|
|
|
2494
2507
|
* table's default sort before anyone clicks. Every other sortable column's
|
|
2495
2508
|
* ArrowUpDown is hidden until the header is hovered or focused (faint on
|
|
2496
2509
|
* touch screens, which can't hover); its space is always kept, so nothing
|
|
2497
|
-
* shifts.
|
|
2510
|
+
* shifts. On a right-aligned (figure) column the arrow sits before the
|
|
2511
|
+
* label, its space kept on the left, so the label's right edge lines up
|
|
2512
|
+
* exactly with the figures under it; on a left-aligned column it follows the
|
|
2513
|
+
* label. A header with a `description` gets a dotted underline and shows
|
|
2498
2514
|
* the description on hover and focus (UXD-196).
|
|
2499
2515
|
* @tokens text-text-tertiary, text-brand-primaryAction, hover:text-text-primary, focus-visible:outline-border-focus, decoration-text-tertiary
|
|
2500
2516
|
* @dependencies lucide-react
|
|
@@ -2797,7 +2813,7 @@ type DateGranularity = 'month' | 'quarter' | 'year';
|
|
|
2797
2813
|
/** Resolve a label to its actual [start, end] span, ending at `today`. */
|
|
2798
2814
|
declare function resolveRange(label: string, today?: Date): [Date, Date];
|
|
2799
2815
|
/** @deprecated Use DateRangeFilter, with `granularity="month"` for monthly data. */
|
|
2800
|
-
declare function DateRangePicker({ defaultValue, granularity, align, presets, onChange, onRangeChange, showFooter, today, years, formatDate, formatRange, className, testIdPrefix, }: CommonProps & {
|
|
2816
|
+
declare function DateRangePicker({ defaultValue, granularity, align, presets, onChange, onRangeChange, showFooter, today, years, formatDate, formatRange, caption, className, testIdPrefix, }: CommonProps & {
|
|
2801
2817
|
defaultValue?: string;
|
|
2802
2818
|
align?: 'left' | 'right';
|
|
2803
2819
|
/**
|
|
@@ -2833,6 +2849,12 @@ declare function DateRangePicker({ defaultValue, granularity, align, presets, on
|
|
|
2833
2849
|
* `${formatDate(start)} – ${formatDate(end)}`.
|
|
2834
2850
|
*/
|
|
2835
2851
|
formatRange?: (start: Date, end: Date) => string;
|
|
2852
|
+
/**
|
|
2853
|
+
* A caption over the label, for a page header ("Date range"): the chip
|
|
2854
|
+
* reads caption over value like SelectFilter, and the dates move into a
|
|
2855
|
+
* tooltip on hover and focus. Leave out for the dates line on top.
|
|
2856
|
+
*/
|
|
2857
|
+
caption?: string;
|
|
2836
2858
|
}): react.JSX.Element;
|
|
2837
2859
|
type DateRangePickerProps = Parameters<typeof DateRangePicker>[0];
|
|
2838
2860
|
|
|
@@ -2895,19 +2917,27 @@ interface MultiSelectGroup {
|
|
|
2895
2917
|
* @behavior `loading` swaps the list for grey placeholder rows and `error`
|
|
2896
2918
|
* for a plain "Couldn't load options." line with a Try again link
|
|
2897
2919
|
* (`onRetry`). The trigger never changes in either state.
|
|
2920
|
+
* @behavior `size="sm"` is SelectFilter's compact trigger: 32px, 13px
|
|
2921
|
+
* (text-dense), value only, the caption as its aria-label; `inlineCaption`
|
|
2922
|
+
* shows "Caption: value" instead. The menu doesn't change.
|
|
2898
2923
|
* @use `hideCaption` in a toolbar above a table, beside a SearchBar `md`,
|
|
2899
2924
|
* when the value names itself; `max` with `valueLabel` ("Charted · 3 of 3")
|
|
2900
2925
|
* for picking what a chart above the table shows.
|
|
2926
|
+
* @use `size="sm"` for a control in a card or panel header, beside a
|
|
2927
|
+
* SelectFilter `size="sm"` (the chart's "Charted · 2 of 3" next to its
|
|
2928
|
+
* "Spend"); add `inlineCaption` when the value alone doesn't say what it sets.
|
|
2901
2929
|
* @usage
|
|
2902
2930
|
* ```tsx
|
|
2903
2931
|
* <MultiSelectFilter caption="Media" options={mediaOptions} selected={selected} onChange={setSelected} />
|
|
2904
2932
|
* <MultiSelectFilter caption="Charted brands" hideCaption max={3} valueLabel={`Charted · ${picked.length} of 3`}
|
|
2905
2933
|
* options={brands} selected={picked} onChange={setPicked} />
|
|
2934
|
+
* <MultiSelectFilter caption="Charted brands" size="sm" max={3} valueLabel={`Charted · ${picked.length} of 3`}
|
|
2935
|
+
* options={brands} selected={picked} onChange={setPicked} />
|
|
2906
2936
|
* <MultiSelectFilter caption="Market" options={markets} selected={selected} onChange={setSelected}
|
|
2907
2937
|
* hints={{ national: "Ads that run nationwide" }} note="Nothing picked means every market." />
|
|
2908
2938
|
* ```
|
|
2909
2939
|
*/
|
|
2910
|
-
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, hideCaption, max, maxReason, className, testIdPrefix, }: Omit<CommonProps, 'testIdPrefix'> & {
|
|
2940
|
+
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, hideCaption, size, inlineCaption, max, maxReason, className, testIdPrefix, }: Omit<CommonProps, 'testIdPrefix'> & {
|
|
2911
2941
|
/**
|
|
2912
2942
|
* `data-testid` on the wrapper, and the prefix for the trigger
|
|
2913
2943
|
* (`${testIdPrefix}-trigger`) and the open menu (`${testIdPrefix}-popover`).
|
|
@@ -2981,6 +3011,17 @@ declare function MultiSelectFilter({ caption, options, groups, counts, variant,
|
|
|
2981
3011
|
* caption becomes the trigger's accessible name.
|
|
2982
3012
|
*/
|
|
2983
3013
|
hideCaption?: boolean;
|
|
3014
|
+
/**
|
|
3015
|
+
* 'sm' is SelectFilter's compact 32px trigger, value only (the caption
|
|
3016
|
+
* becomes its accessible name), for a control in a card or panel header.
|
|
3017
|
+
* `hideCaption` changes nothing at this size. Defaults to 'md'.
|
|
3018
|
+
*/
|
|
3019
|
+
size?: 'md' | 'sm';
|
|
3020
|
+
/**
|
|
3021
|
+
* With `size="sm"`: show the caption in the trigger, "Charted: 2 of 3",
|
|
3022
|
+
* as SelectFilter's `inlineCaption`, for a value that doesn't say what it sets.
|
|
3023
|
+
*/
|
|
3024
|
+
inlineCaption?: boolean;
|
|
2984
3025
|
/**
|
|
2985
3026
|
* The most options that can be ticked. Once that many are, the others grey
|
|
2986
3027
|
* out and say why on hover and focus (`maxReason`); ticking past it does
|
|
@@ -3578,6 +3619,36 @@ interface DrawerProps extends CommonProps {
|
|
|
3578
3619
|
*/
|
|
3579
3620
|
declare function Drawer({ open, onClose, title, description, size, footer, children, className, testIdPrefix }: DrawerProps): react.ReactPortal | null;
|
|
3580
3621
|
|
|
3622
|
+
/** One choice in a header menu section: "Subsidiary", "League". */
|
|
3623
|
+
interface DataTableHeaderMenuOption {
|
|
3624
|
+
id: string;
|
|
3625
|
+
label: string;
|
|
3626
|
+
}
|
|
3627
|
+
/** A pick-one section of the name column's header menu. */
|
|
3628
|
+
interface DataTableHeaderMenuChoice<V = string> {
|
|
3629
|
+
/** The section's heading. Defaults: "Group rows by", "Then break out by". */
|
|
3630
|
+
label?: string;
|
|
3631
|
+
options: DataTableHeaderMenuOption[];
|
|
3632
|
+
value: V;
|
|
3633
|
+
onChange: (id: V) => void;
|
|
3634
|
+
}
|
|
3635
|
+
/**
|
|
3636
|
+
* Turns the name column's header into a dropdown for how the rows are built:
|
|
3637
|
+
* what they're grouped by and what each group breaks out into, side by side
|
|
3638
|
+
* in two columns. The header reads the choices ("Subsidiary › League").
|
|
3639
|
+
*/
|
|
3640
|
+
interface DataTableHeaderMenu {
|
|
3641
|
+
/** What each row is: "Subsidiary", "Brand". One pick, required. */
|
|
3642
|
+
groupBy: DataTableHeaderMenuChoice<string>;
|
|
3643
|
+
/**
|
|
3644
|
+
* What each row breaks out into, as sub-rows: "League". The menu adds a
|
|
3645
|
+
* "None" row first, which is `null`. An option equal to the group-by is
|
|
3646
|
+
* unavailable; picking a group-by equal to the break-out sets it to None
|
|
3647
|
+
* (staged, like every pick, until Apply).
|
|
3648
|
+
*/
|
|
3649
|
+
breakOutBy?: DataTableHeaderMenuChoice<string | null>;
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3581
3652
|
type DataTableColumnWidth = "fill" | "sm" | "md" | "lg";
|
|
3582
3653
|
type DataTableDensity = "default" | "compact";
|
|
3583
3654
|
interface DataTableColumn<T, K extends string = string> {
|
|
@@ -3625,6 +3696,16 @@ interface DataTableColumn<T, K extends string = string> {
|
|
|
3625
3696
|
* ("You") in the header or cells: the tint isn't the only cue.
|
|
3626
3697
|
*/
|
|
3627
3698
|
highlight?: boolean;
|
|
3699
|
+
/**
|
|
3700
|
+
* The name column only: its header becomes a dropdown ("Subsidiary ›
|
|
3701
|
+
* League") for what the rows are grouped by and what they break out into,
|
|
3702
|
+
* in two columns. A click opens it, never sorts. Picks are staged until
|
|
3703
|
+
* Apply, which calls each changed choice's `onChange`; every other close
|
|
3704
|
+
* drops them. The
|
|
3705
|
+
* header shows the choices instead of `label`, which names the panel for
|
|
3706
|
+
* screen readers.
|
|
3707
|
+
*/
|
|
3708
|
+
headerMenu?: DataTableHeaderMenu;
|
|
3628
3709
|
}
|
|
3629
3710
|
interface DataTableProps<T, K extends string = string> extends CommonProps {
|
|
3630
3711
|
columns: DataTableColumn<T, K>[];
|
|
@@ -3816,7 +3897,10 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3816
3897
|
* light brand fill on its row or column. A full-page table (`sticky`) keeps
|
|
3817
3898
|
* its header row in view under the page's StickyBar and pins its pager to the
|
|
3818
3899
|
* bottom of the screen once the page scrolls. A table wider than its space
|
|
3819
|
-
* always shows a thin scroll bar.
|
|
3900
|
+
* always shows a thin scroll bar. A figure column's sort arrow sits before
|
|
3901
|
+
* its label, so the label ends where the figures do. The name column's
|
|
3902
|
+
* header can be a dropdown (`headerMenu`) for how the rows are grouped and
|
|
3903
|
+
* broken out, in two columns.
|
|
3820
3904
|
* @variant default - Default. Tables people read and act on.
|
|
3821
3905
|
* @variant compact - Reference data and long lists.
|
|
3822
3906
|
* @tokens rounded-card, rounded-small, border, border-border-default, bg-surface,
|
|
@@ -3830,11 +3914,16 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3830
3914
|
* bg-linear-to-r, from-brand-primaryAction/10, border-border-focus,
|
|
3831
3915
|
* [&::-webkit-scrollbar-thumb]:bg-border-strong, bg-canvas,
|
|
3832
3916
|
* duration-(--mr-motion-duration-interactive), ease-interactive,
|
|
3833
|
-
* supports-[not_selector(::-webkit-scrollbar)]:[scrollbar-color:var(--mr-color-border-strong)_var(--mr-color-subtle)]
|
|
3917
|
+
* supports-[not_selector(::-webkit-scrollbar)]:[scrollbar-color:var(--mr-color-border-strong)_var(--mr-color-subtle)],
|
|
3918
|
+
* px-2, hover:bg-border-default, aria-expanded:bg-border-default, z-dropdown,
|
|
3919
|
+
* shadow-overlay
|
|
3834
3920
|
* @behavior Sorting: a `sortable` column's header gets a SortButton; clicks
|
|
3835
3921
|
* cycle the column's `firstDir`, then the reverse, then back to
|
|
3836
3922
|
* `defaultSort` (`cycleSort`), and call `onSortChange`. The sorted column
|
|
3837
|
-
* always shows its arrow; the others show theirs on hover and focus.
|
|
3923
|
+
* always shows its arrow; the others show theirs on hover and focus. On a
|
|
3924
|
+
* numeric column the arrow sits before the label (its space kept while
|
|
3925
|
+
* hidden), so the label's right edge lines up with the figures; on a text
|
|
3926
|
+
* column it follows the label. The table doesn't sort the rows
|
|
3838
3927
|
* itself: sort them before passing `rows`. `loading` keeps the header and
|
|
3839
3928
|
* draws `loadingRows` skeleton rows. An empty `rows` keeps the header and
|
|
3840
3929
|
* shows `empty` in one cell across every column, padded 48px top and bottom
|
|
@@ -3842,6 +3931,7 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3842
3931
|
* A `cell` that returns nothing shows `NoValue` with the column's `missing`
|
|
3843
3932
|
* reason ("No data"); return `<NoValue reason="New this period" />` for
|
|
3844
3933
|
* another reason. A real zero is "0", never a dash.
|
|
3934
|
+
* The chevron column is 40px wide in both densities, the 24px button centred.
|
|
3845
3935
|
* With `renderExpanded`, a chevron at the row's start opens the row; a click
|
|
3846
3936
|
* anywhere else on it does too, except on its own controls (links, buttons,
|
|
3847
3937
|
* checkboxes, menus) or while selecting text. Several rows can be open;
|
|
@@ -3891,6 +3981,21 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3891
3981
|
* computer (a rounded border-strong thumb on a subtle track; drawn by the
|
|
3892
3982
|
* table, so a Mac trackpad's hide-while-idle setting doesn't hide it; Firefox
|
|
3893
3983
|
* gets the same colours and follows the system setting).
|
|
3984
|
+
* `headerMenu` on the name column turns its header into a quiet dropdown
|
|
3985
|
+
* trigger reading the current choices ("Subsidiary › League", a chevron
|
|
3986
|
+
* after), with a darker fill on hover and while open. A click opens a panel
|
|
3987
|
+
* (never sorts) with two pick-one groups side by side, as Advertising
|
|
3988
|
+
* Trends' Group by (420px, a hairline between them): "Group rows by" and
|
|
3989
|
+
* "Then break out by" ("None" first, then the options; the one equal to the
|
|
3990
|
+
* staged group-by is unavailable), and a FilterDropdownFooter with Apply
|
|
3991
|
+
* only. No sort in it: the column isn't sorted from its header. Picks are
|
|
3992
|
+
* staged: the ticks move, the table doesn't. Apply calls `onChange` only
|
|
3993
|
+
* for what changed and closes; with nothing changed it just closes. Escape,
|
|
3994
|
+
* a click outside and tabbing out
|
|
3995
|
+
* close it and drop the staged picks, without asking; it reopens on the
|
|
3996
|
+
* applied values. Picking a group-by equal to the break-out stages the
|
|
3997
|
+
* break-out back to None. The panel is portalled, so the frame never clips
|
|
3998
|
+
* it. `headerMenu` wins over `sortable` on the same column.
|
|
3894
3999
|
* `sticky` (a full-page table only): once the header row scrolls up to the
|
|
3895
4000
|
* page's StickyBar (or `stickyTop` pixels from the top), a copy of it stays
|
|
3896
4001
|
* there, right under the bar, until the last row goes by. The copy scrolls
|
|
@@ -3926,6 +4031,16 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3926
4031
|
* The brand fill is never the only cue: the app puts a "You" badge in the
|
|
3927
4032
|
* row or column header beside it, and colour alone says nothing to someone
|
|
3928
4033
|
* who can't see it. `NoValue` reads its reason, not "dash". `loading` sets aria-busy.
|
|
4034
|
+
* The `headerMenu` trigger is a button with aria-haspopup="dialog" and
|
|
4035
|
+
* aria-expanded (the panel holds Apply, so it's a dialog, as
|
|
4036
|
+
* MultiSelectFilter's, not a menu); Enter, Space or the down arrow opens it
|
|
4037
|
+
* and focus moves to the first group's picked row. Each group is a
|
|
4038
|
+
* radiogroup named by its heading, its rows role="radio" with aria-checked
|
|
4039
|
+
* and one tab stop; the arrows, Home and End move the pick within a group,
|
|
4040
|
+
* Tab goes to the next group, then Apply. Escape, Apply and tabbing past
|
|
4041
|
+
* either end close it and return focus to the trigger. The "›" is
|
|
4042
|
+
* hidden from screen readers, which hear "Subsidiary then League"; the panel
|
|
4043
|
+
* is named by the column's `label`.
|
|
3929
4044
|
* With `sticky`, the header copy is aria-hidden and out of the tab order
|
|
3930
4045
|
* (tabindex -1 on its buttons): screen readers and the keyboard use the real
|
|
3931
4046
|
* header, so nothing is announced or reached twice.
|
|
@@ -3939,6 +4054,9 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3939
4054
|
* the cell of a change column. A bar or badge beside a figure goes before
|
|
3940
4055
|
* it, so the figure ends at the right edge.
|
|
3941
4056
|
* @use `rank` for a 1, 2, 3 … column before the name.
|
|
4057
|
+
* @use `headerMenu` on the name column when the screen lets people choose
|
|
4058
|
+
* what the rows are (group by, break out by): the header is where the choice
|
|
4059
|
+
* shows, next to the rows it shapes.
|
|
3942
4060
|
* @use `lead` for another column before the name (a trend sparkline); it
|
|
3943
4061
|
* pins with the name on a wide table and is blank on sub-rows and totals.
|
|
3944
4062
|
* @use a total column right after the name, styled like every other figure:
|
|
@@ -4011,6 +4129,15 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
4011
4129
|
* columns={columns}
|
|
4012
4130
|
* />
|
|
4013
4131
|
*
|
|
4132
|
+
* // The name column's header picks what the rows are
|
|
4133
|
+
* const nameColumn = {
|
|
4134
|
+
* key: "name", label: "Name", cell: (r) => r.name,
|
|
4135
|
+
* headerMenu: {
|
|
4136
|
+
* groupBy: { options: [{ id: "subsidiary", label: "Subsidiary" }, { id: "brand", label: "Brand" }], value: groupBy, onChange: setGroupBy },
|
|
4137
|
+
* breakOutBy: { options: [{ id: "league", label: "League" }, { id: "brand", label: "Brand" }], value: breakOut, onChange: setBreakOut },
|
|
4138
|
+
* },
|
|
4139
|
+
* }
|
|
4140
|
+
*
|
|
4014
4141
|
* // A full-page table: the header stays under the filters, the pager at the bottom
|
|
4015
4142
|
* <StickyBar><FilterChipBar … /></StickyBar>
|
|
4016
4143
|
* <DataTable
|
|
@@ -4487,9 +4614,10 @@ interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement>, CommonP
|
|
|
4487
4614
|
asChild?: boolean;
|
|
4488
4615
|
}
|
|
4489
4616
|
declare const MenuItem: react.ForwardRefExoticComponent<MenuItemProps & react.RefAttributes<HTMLButtonElement>>;
|
|
4490
|
-
/** A small heading over a group of rows ("Workspace"). */
|
|
4491
|
-
declare function MenuLabel({ className, testIdPrefix, children }: CommonProps & {
|
|
4617
|
+
/** A small heading over a group of rows ("Workspace"). `id` lets a group name itself by it (aria-labelledby). */
|
|
4618
|
+
declare function MenuLabel({ className, testIdPrefix, id, children }: CommonProps & {
|
|
4492
4619
|
children: ReactNode;
|
|
4620
|
+
id?: string;
|
|
4493
4621
|
}): react.JSX.Element;
|
|
4494
4622
|
/** A line between groups of rows. */
|
|
4495
4623
|
declare function MenuSeparator({ className, testIdPrefix }: CommonProps): react.JSX.Element;
|
|
@@ -4692,4 +4820,4 @@ declare function LoadError({ onRetry, children }: {
|
|
|
4692
4820
|
/** The thin moving line along a card's top edge while new data loads over old. */
|
|
4693
4821
|
declare function RefreshLine(): react.JSX.Element;
|
|
4694
4822
|
|
|
4695
|
-
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, AllFiltersButton, type AllFiltersButtonProps, type AxisMonthLabel, Badge, type BadgeKind, type BadgeProps, type BadgeTone, BarChartPlaceholder, type BarChartPlaceholderProps, BarList, type BarListProps, type BarListRow, Button, type ButtonProps, Card, type CardProps, ChartLegend, type ChartLegendProps, ChartSkeleton, CheckBox, CheckBoxBox, type CheckBoxBoxProps, type CheckBoxProps, ChipContent, type ChipContentProps, type ChipVariant, type CommonProps, CopyButton, type CopyButtonProps, type Currency, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableProps, type DateFormatOptions, type DateGranularity, type DateOrder, DateRangeFilter, type DateRangeFilterProps, type DateRangeFormatOptions, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, Drawer, type DrawerProps, type DrawerSize, EmptyState, type EmptyStateProps, type EmptyStateSize, Figure, type FigureProps, FilterChipBar, type FilterChipBarProps, FilterDrawer, type FilterDrawerProps, type FilterDrawerSection, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LegendItem, type LegendItemProps, type LegendMark, LineChartPlaceholder, type LineChartPlaceholderProps, LoadError, LongWait, MediaLabel, type MediaLabelProps, type MediaType, Menu, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuSeparator, Modal, type ModalProps, type ModalSize, type MoneyFormatOptions, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NO_VALUE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, NoValue, type NumberFormatOptions, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, PrimaryBadge, type PrimaryBadgeProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, RefreshLine, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, type SearchScope, SectionHeading, type SectionHeadingProps, SectionRail, type SectionRailProps, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type SegmentedOption, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, Skeleton, SkeletonLines, type SkeletonProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, StatStrip, type StatStripProps, StatStripSkeleton, StatTile, type StatTileProps, StickyBar, type StickyBarProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, TableLink, TablePagination, type TablePaginationProps, Tabs, type TabsProps, Tag, type TagProps, TextField, type TextFieldProps, type TextFieldSize, Toast, type ToastProps, type ToastTone, Toggle, ToggleChip, type ToggleChipProps, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, ariaSortFor, buttonVariants, chipTriggerClass, cycleSort, defaultDateOrder, formatCount, formatCountFull, formatDate, formatDateRange, formatDateTime, formatIsoDate, formatMoney, formatMoneyFull, formatMonth, formatMonthAxis, formatOpenRange, formatPercent, formatQuarter, formatRelative, formatTime, formatWeek, noResultsBody, resolveRange, sortProp, useDelayedLoading };
|
|
4823
|
+
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, AllFiltersButton, type AllFiltersButtonProps, type AxisMonthLabel, Badge, type BadgeKind, type BadgeProps, type BadgeTone, BarChartPlaceholder, type BarChartPlaceholderProps, BarList, type BarListProps, type BarListRow, Button, type ButtonProps, Card, type CardProps, ChartLegend, type ChartLegendProps, ChartSkeleton, CheckBox, CheckBoxBox, type CheckBoxBoxProps, type CheckBoxProps, ChipContent, type ChipContentProps, type ChipVariant, type CommonProps, CopyButton, type CopyButtonProps, type Currency, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableHeaderMenu, type DataTableHeaderMenuChoice, type DataTableHeaderMenuOption, type DataTableProps, type DateFormatOptions, type DateGranularity, type DateOrder, DateRangeFilter, type DateRangeFilterProps, type DateRangeFormatOptions, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, Drawer, type DrawerProps, type DrawerSize, EmptyState, type EmptyStateProps, type EmptyStateSize, Figure, type FigureProps, FilterChipBar, type FilterChipBarProps, FilterDrawer, type FilterDrawerProps, type FilterDrawerSection, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LegendItem, type LegendItemProps, type LegendMark, LineChartPlaceholder, type LineChartPlaceholderProps, LoadError, LongWait, MediaLabel, type MediaLabelProps, type MediaType, Menu, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuSeparator, Modal, type ModalProps, type ModalSize, type MoneyFormatOptions, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NO_VALUE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, NoValue, type NumberFormatOptions, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, PrimaryBadge, type PrimaryBadgeProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, RefreshLine, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, type SearchScope, SectionHeading, type SectionHeadingProps, SectionRail, type SectionRailProps, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type SegmentedOption, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, Skeleton, SkeletonLines, type SkeletonProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, StatStrip, type StatStripProps, StatStripSkeleton, StatTile, type StatTileProps, StickyBar, type StickyBarProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, TableLink, TablePagination, type TablePaginationProps, Tabs, type TabsProps, Tag, type TagProps, TextField, type TextFieldProps, type TextFieldSize, Toast, type ToastProps, type ToastTone, Toggle, ToggleChip, type ToggleChipProps, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, ariaSortFor, buttonVariants, chipTriggerClass, cycleSort, defaultDateOrder, formatCount, formatCountFull, formatDate, formatDateRange, formatDateTime, formatIsoDate, formatMoney, formatMoneyFull, formatMonth, formatMonthAxis, formatOpenRange, formatPercent, formatQuarter, formatRelative, formatTime, formatWeek, noResultsBody, resolveRange, sortProp, useDelayedLoading };
|
package/dist/index.d.ts
CHANGED
|
@@ -2254,6 +2254,12 @@ interface FilterDropdownFooterProps extends CommonProps {
|
|
|
2254
2254
|
onApply: () => void;
|
|
2255
2255
|
clearLabel?: string;
|
|
2256
2256
|
applyLabel?: string;
|
|
2257
|
+
/**
|
|
2258
|
+
* Adds a Cancel button (secondary) before Apply, for a dropdown that stages
|
|
2259
|
+
* picks: it should close and drop them. Omit for no Cancel.
|
|
2260
|
+
*/
|
|
2261
|
+
onCancel?: () => void;
|
|
2262
|
+
cancelLabel?: string;
|
|
2257
2263
|
}
|
|
2258
2264
|
/**
|
|
2259
2265
|
* @pattern FilterDropdownFooter
|
|
@@ -2262,17 +2268,20 @@ interface FilterDropdownFooterProps extends CommonProps {
|
|
|
2262
2268
|
* @description Fixed Apply/Clear All footer for quick-filter dropdowns —
|
|
2263
2269
|
* pinned below the (independently scrollable) option list so it's always
|
|
2264
2270
|
* visible. Shared by the Media/Advertiser/Date/Group By/Time Increment quick
|
|
2265
|
-
* filters on Sports Dashboard, Publisher Intel, and Opportunities.
|
|
2271
|
+
* filters on Sports Dashboard, Publisher Intel, and Opportunities. With
|
|
2272
|
+
* `onCancel`, a secondary Cancel sits right before Apply (DataTable's header
|
|
2273
|
+
* menu), Clear all, if any, staying on the left.
|
|
2266
2274
|
* @tokens border-border-default
|
|
2267
|
-
* @a11y Clear and Apply are real Buttons with visible text as their
|
|
2268
|
-
* names, in that DOM order. It adds no roles or live regions of its own --
|
|
2275
|
+
* @a11y Clear, Cancel and Apply are real Buttons with visible text as their
|
|
2276
|
+
* accessible names, in that DOM order. It adds no roles or live regions of its own --
|
|
2269
2277
|
* the menu that contains it owns dismissal and focus.
|
|
2270
2278
|
* @usage
|
|
2271
2279
|
* ```tsx
|
|
2272
2280
|
* <FilterDropdownFooter onApply={handleApply} onClear={handleClear} />
|
|
2281
|
+
* <FilterDropdownFooter onApply={apply} onCancel={discard} />
|
|
2273
2282
|
* ```
|
|
2274
2283
|
*/
|
|
2275
|
-
declare function FilterDropdownFooter({ onClear, onApply, clearLabel, applyLabel, className, testIdPrefix, }: FilterDropdownFooterProps): react.JSX.Element;
|
|
2284
|
+
declare function FilterDropdownFooter({ onClear, onApply, clearLabel, applyLabel, onCancel, cancelLabel, className, testIdPrefix, }: FilterDropdownFooterProps): react.JSX.Element;
|
|
2276
2285
|
|
|
2277
2286
|
interface NameListModalProps extends CommonProps {
|
|
2278
2287
|
/** Classes on the dialog panel (the visible surface), not the backdrop. */
|
|
@@ -2469,7 +2478,11 @@ interface SortButtonProps<K extends string> extends CommonProps {
|
|
|
2469
2478
|
* that can never be sorted. Unlike `disabled`, nothing about it is a control.
|
|
2470
2479
|
*/
|
|
2471
2480
|
sortable?: boolean;
|
|
2472
|
-
/**
|
|
2481
|
+
/**
|
|
2482
|
+
* Matches the column's alignment, so a label that wraps lines up with the
|
|
2483
|
+
* cells under it. `right` (a figure column) also puts the arrow before the
|
|
2484
|
+
* label, so the label ends exactly where the figures do.
|
|
2485
|
+
*/
|
|
2473
2486
|
align?: "left" | "center" | "right";
|
|
2474
2487
|
/**
|
|
2475
2488
|
* What the column means, for a non-obvious measure ("Share of the set's
|
|
@@ -2494,7 +2507,10 @@ interface SortButtonProps<K extends string> extends CommonProps {
|
|
|
2494
2507
|
* table's default sort before anyone clicks. Every other sortable column's
|
|
2495
2508
|
* ArrowUpDown is hidden until the header is hovered or focused (faint on
|
|
2496
2509
|
* touch screens, which can't hover); its space is always kept, so nothing
|
|
2497
|
-
* shifts.
|
|
2510
|
+
* shifts. On a right-aligned (figure) column the arrow sits before the
|
|
2511
|
+
* label, its space kept on the left, so the label's right edge lines up
|
|
2512
|
+
* exactly with the figures under it; on a left-aligned column it follows the
|
|
2513
|
+
* label. A header with a `description` gets a dotted underline and shows
|
|
2498
2514
|
* the description on hover and focus (UXD-196).
|
|
2499
2515
|
* @tokens text-text-tertiary, text-brand-primaryAction, hover:text-text-primary, focus-visible:outline-border-focus, decoration-text-tertiary
|
|
2500
2516
|
* @dependencies lucide-react
|
|
@@ -2797,7 +2813,7 @@ type DateGranularity = 'month' | 'quarter' | 'year';
|
|
|
2797
2813
|
/** Resolve a label to its actual [start, end] span, ending at `today`. */
|
|
2798
2814
|
declare function resolveRange(label: string, today?: Date): [Date, Date];
|
|
2799
2815
|
/** @deprecated Use DateRangeFilter, with `granularity="month"` for monthly data. */
|
|
2800
|
-
declare function DateRangePicker({ defaultValue, granularity, align, presets, onChange, onRangeChange, showFooter, today, years, formatDate, formatRange, className, testIdPrefix, }: CommonProps & {
|
|
2816
|
+
declare function DateRangePicker({ defaultValue, granularity, align, presets, onChange, onRangeChange, showFooter, today, years, formatDate, formatRange, caption, className, testIdPrefix, }: CommonProps & {
|
|
2801
2817
|
defaultValue?: string;
|
|
2802
2818
|
align?: 'left' | 'right';
|
|
2803
2819
|
/**
|
|
@@ -2833,6 +2849,12 @@ declare function DateRangePicker({ defaultValue, granularity, align, presets, on
|
|
|
2833
2849
|
* `${formatDate(start)} – ${formatDate(end)}`.
|
|
2834
2850
|
*/
|
|
2835
2851
|
formatRange?: (start: Date, end: Date) => string;
|
|
2852
|
+
/**
|
|
2853
|
+
* A caption over the label, for a page header ("Date range"): the chip
|
|
2854
|
+
* reads caption over value like SelectFilter, and the dates move into a
|
|
2855
|
+
* tooltip on hover and focus. Leave out for the dates line on top.
|
|
2856
|
+
*/
|
|
2857
|
+
caption?: string;
|
|
2836
2858
|
}): react.JSX.Element;
|
|
2837
2859
|
type DateRangePickerProps = Parameters<typeof DateRangePicker>[0];
|
|
2838
2860
|
|
|
@@ -2895,19 +2917,27 @@ interface MultiSelectGroup {
|
|
|
2895
2917
|
* @behavior `loading` swaps the list for grey placeholder rows and `error`
|
|
2896
2918
|
* for a plain "Couldn't load options." line with a Try again link
|
|
2897
2919
|
* (`onRetry`). The trigger never changes in either state.
|
|
2920
|
+
* @behavior `size="sm"` is SelectFilter's compact trigger: 32px, 13px
|
|
2921
|
+
* (text-dense), value only, the caption as its aria-label; `inlineCaption`
|
|
2922
|
+
* shows "Caption: value" instead. The menu doesn't change.
|
|
2898
2923
|
* @use `hideCaption` in a toolbar above a table, beside a SearchBar `md`,
|
|
2899
2924
|
* when the value names itself; `max` with `valueLabel` ("Charted · 3 of 3")
|
|
2900
2925
|
* for picking what a chart above the table shows.
|
|
2926
|
+
* @use `size="sm"` for a control in a card or panel header, beside a
|
|
2927
|
+
* SelectFilter `size="sm"` (the chart's "Charted · 2 of 3" next to its
|
|
2928
|
+
* "Spend"); add `inlineCaption` when the value alone doesn't say what it sets.
|
|
2901
2929
|
* @usage
|
|
2902
2930
|
* ```tsx
|
|
2903
2931
|
* <MultiSelectFilter caption="Media" options={mediaOptions} selected={selected} onChange={setSelected} />
|
|
2904
2932
|
* <MultiSelectFilter caption="Charted brands" hideCaption max={3} valueLabel={`Charted · ${picked.length} of 3`}
|
|
2905
2933
|
* options={brands} selected={picked} onChange={setPicked} />
|
|
2934
|
+
* <MultiSelectFilter caption="Charted brands" size="sm" max={3} valueLabel={`Charted · ${picked.length} of 3`}
|
|
2935
|
+
* options={brands} selected={picked} onChange={setPicked} />
|
|
2906
2936
|
* <MultiSelectFilter caption="Market" options={markets} selected={selected} onChange={setSelected}
|
|
2907
2937
|
* hints={{ national: "Ads that run nationwide" }} note="Nothing picked means every market." />
|
|
2908
2938
|
* ```
|
|
2909
2939
|
*/
|
|
2910
|
-
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, hideCaption, max, maxReason, className, testIdPrefix, }: Omit<CommonProps, 'testIdPrefix'> & {
|
|
2940
|
+
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, hideCaption, size, inlineCaption, max, maxReason, className, testIdPrefix, }: Omit<CommonProps, 'testIdPrefix'> & {
|
|
2911
2941
|
/**
|
|
2912
2942
|
* `data-testid` on the wrapper, and the prefix for the trigger
|
|
2913
2943
|
* (`${testIdPrefix}-trigger`) and the open menu (`${testIdPrefix}-popover`).
|
|
@@ -2981,6 +3011,17 @@ declare function MultiSelectFilter({ caption, options, groups, counts, variant,
|
|
|
2981
3011
|
* caption becomes the trigger's accessible name.
|
|
2982
3012
|
*/
|
|
2983
3013
|
hideCaption?: boolean;
|
|
3014
|
+
/**
|
|
3015
|
+
* 'sm' is SelectFilter's compact 32px trigger, value only (the caption
|
|
3016
|
+
* becomes its accessible name), for a control in a card or panel header.
|
|
3017
|
+
* `hideCaption` changes nothing at this size. Defaults to 'md'.
|
|
3018
|
+
*/
|
|
3019
|
+
size?: 'md' | 'sm';
|
|
3020
|
+
/**
|
|
3021
|
+
* With `size="sm"`: show the caption in the trigger, "Charted: 2 of 3",
|
|
3022
|
+
* as SelectFilter's `inlineCaption`, for a value that doesn't say what it sets.
|
|
3023
|
+
*/
|
|
3024
|
+
inlineCaption?: boolean;
|
|
2984
3025
|
/**
|
|
2985
3026
|
* The most options that can be ticked. Once that many are, the others grey
|
|
2986
3027
|
* out and say why on hover and focus (`maxReason`); ticking past it does
|
|
@@ -3578,6 +3619,36 @@ interface DrawerProps extends CommonProps {
|
|
|
3578
3619
|
*/
|
|
3579
3620
|
declare function Drawer({ open, onClose, title, description, size, footer, children, className, testIdPrefix }: DrawerProps): react.ReactPortal | null;
|
|
3580
3621
|
|
|
3622
|
+
/** One choice in a header menu section: "Subsidiary", "League". */
|
|
3623
|
+
interface DataTableHeaderMenuOption {
|
|
3624
|
+
id: string;
|
|
3625
|
+
label: string;
|
|
3626
|
+
}
|
|
3627
|
+
/** A pick-one section of the name column's header menu. */
|
|
3628
|
+
interface DataTableHeaderMenuChoice<V = string> {
|
|
3629
|
+
/** The section's heading. Defaults: "Group rows by", "Then break out by". */
|
|
3630
|
+
label?: string;
|
|
3631
|
+
options: DataTableHeaderMenuOption[];
|
|
3632
|
+
value: V;
|
|
3633
|
+
onChange: (id: V) => void;
|
|
3634
|
+
}
|
|
3635
|
+
/**
|
|
3636
|
+
* Turns the name column's header into a dropdown for how the rows are built:
|
|
3637
|
+
* what they're grouped by and what each group breaks out into, side by side
|
|
3638
|
+
* in two columns. The header reads the choices ("Subsidiary › League").
|
|
3639
|
+
*/
|
|
3640
|
+
interface DataTableHeaderMenu {
|
|
3641
|
+
/** What each row is: "Subsidiary", "Brand". One pick, required. */
|
|
3642
|
+
groupBy: DataTableHeaderMenuChoice<string>;
|
|
3643
|
+
/**
|
|
3644
|
+
* What each row breaks out into, as sub-rows: "League". The menu adds a
|
|
3645
|
+
* "None" row first, which is `null`. An option equal to the group-by is
|
|
3646
|
+
* unavailable; picking a group-by equal to the break-out sets it to None
|
|
3647
|
+
* (staged, like every pick, until Apply).
|
|
3648
|
+
*/
|
|
3649
|
+
breakOutBy?: DataTableHeaderMenuChoice<string | null>;
|
|
3650
|
+
}
|
|
3651
|
+
|
|
3581
3652
|
type DataTableColumnWidth = "fill" | "sm" | "md" | "lg";
|
|
3582
3653
|
type DataTableDensity = "default" | "compact";
|
|
3583
3654
|
interface DataTableColumn<T, K extends string = string> {
|
|
@@ -3625,6 +3696,16 @@ interface DataTableColumn<T, K extends string = string> {
|
|
|
3625
3696
|
* ("You") in the header or cells: the tint isn't the only cue.
|
|
3626
3697
|
*/
|
|
3627
3698
|
highlight?: boolean;
|
|
3699
|
+
/**
|
|
3700
|
+
* The name column only: its header becomes a dropdown ("Subsidiary ›
|
|
3701
|
+
* League") for what the rows are grouped by and what they break out into,
|
|
3702
|
+
* in two columns. A click opens it, never sorts. Picks are staged until
|
|
3703
|
+
* Apply, which calls each changed choice's `onChange`; every other close
|
|
3704
|
+
* drops them. The
|
|
3705
|
+
* header shows the choices instead of `label`, which names the panel for
|
|
3706
|
+
* screen readers.
|
|
3707
|
+
*/
|
|
3708
|
+
headerMenu?: DataTableHeaderMenu;
|
|
3628
3709
|
}
|
|
3629
3710
|
interface DataTableProps<T, K extends string = string> extends CommonProps {
|
|
3630
3711
|
columns: DataTableColumn<T, K>[];
|
|
@@ -3816,7 +3897,10 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3816
3897
|
* light brand fill on its row or column. A full-page table (`sticky`) keeps
|
|
3817
3898
|
* its header row in view under the page's StickyBar and pins its pager to the
|
|
3818
3899
|
* bottom of the screen once the page scrolls. A table wider than its space
|
|
3819
|
-
* always shows a thin scroll bar.
|
|
3900
|
+
* always shows a thin scroll bar. A figure column's sort arrow sits before
|
|
3901
|
+
* its label, so the label ends where the figures do. The name column's
|
|
3902
|
+
* header can be a dropdown (`headerMenu`) for how the rows are grouped and
|
|
3903
|
+
* broken out, in two columns.
|
|
3820
3904
|
* @variant default - Default. Tables people read and act on.
|
|
3821
3905
|
* @variant compact - Reference data and long lists.
|
|
3822
3906
|
* @tokens rounded-card, rounded-small, border, border-border-default, bg-surface,
|
|
@@ -3830,11 +3914,16 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3830
3914
|
* bg-linear-to-r, from-brand-primaryAction/10, border-border-focus,
|
|
3831
3915
|
* [&::-webkit-scrollbar-thumb]:bg-border-strong, bg-canvas,
|
|
3832
3916
|
* duration-(--mr-motion-duration-interactive), ease-interactive,
|
|
3833
|
-
* supports-[not_selector(::-webkit-scrollbar)]:[scrollbar-color:var(--mr-color-border-strong)_var(--mr-color-subtle)]
|
|
3917
|
+
* supports-[not_selector(::-webkit-scrollbar)]:[scrollbar-color:var(--mr-color-border-strong)_var(--mr-color-subtle)],
|
|
3918
|
+
* px-2, hover:bg-border-default, aria-expanded:bg-border-default, z-dropdown,
|
|
3919
|
+
* shadow-overlay
|
|
3834
3920
|
* @behavior Sorting: a `sortable` column's header gets a SortButton; clicks
|
|
3835
3921
|
* cycle the column's `firstDir`, then the reverse, then back to
|
|
3836
3922
|
* `defaultSort` (`cycleSort`), and call `onSortChange`. The sorted column
|
|
3837
|
-
* always shows its arrow; the others show theirs on hover and focus.
|
|
3923
|
+
* always shows its arrow; the others show theirs on hover and focus. On a
|
|
3924
|
+
* numeric column the arrow sits before the label (its space kept while
|
|
3925
|
+
* hidden), so the label's right edge lines up with the figures; on a text
|
|
3926
|
+
* column it follows the label. The table doesn't sort the rows
|
|
3838
3927
|
* itself: sort them before passing `rows`. `loading` keeps the header and
|
|
3839
3928
|
* draws `loadingRows` skeleton rows. An empty `rows` keeps the header and
|
|
3840
3929
|
* shows `empty` in one cell across every column, padded 48px top and bottom
|
|
@@ -3842,6 +3931,7 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3842
3931
|
* A `cell` that returns nothing shows `NoValue` with the column's `missing`
|
|
3843
3932
|
* reason ("No data"); return `<NoValue reason="New this period" />` for
|
|
3844
3933
|
* another reason. A real zero is "0", never a dash.
|
|
3934
|
+
* The chevron column is 40px wide in both densities, the 24px button centred.
|
|
3845
3935
|
* With `renderExpanded`, a chevron at the row's start opens the row; a click
|
|
3846
3936
|
* anywhere else on it does too, except on its own controls (links, buttons,
|
|
3847
3937
|
* checkboxes, menus) or while selecting text. Several rows can be open;
|
|
@@ -3891,6 +3981,21 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3891
3981
|
* computer (a rounded border-strong thumb on a subtle track; drawn by the
|
|
3892
3982
|
* table, so a Mac trackpad's hide-while-idle setting doesn't hide it; Firefox
|
|
3893
3983
|
* gets the same colours and follows the system setting).
|
|
3984
|
+
* `headerMenu` on the name column turns its header into a quiet dropdown
|
|
3985
|
+
* trigger reading the current choices ("Subsidiary › League", a chevron
|
|
3986
|
+
* after), with a darker fill on hover and while open. A click opens a panel
|
|
3987
|
+
* (never sorts) with two pick-one groups side by side, as Advertising
|
|
3988
|
+
* Trends' Group by (420px, a hairline between them): "Group rows by" and
|
|
3989
|
+
* "Then break out by" ("None" first, then the options; the one equal to the
|
|
3990
|
+
* staged group-by is unavailable), and a FilterDropdownFooter with Apply
|
|
3991
|
+
* only. No sort in it: the column isn't sorted from its header. Picks are
|
|
3992
|
+
* staged: the ticks move, the table doesn't. Apply calls `onChange` only
|
|
3993
|
+
* for what changed and closes; with nothing changed it just closes. Escape,
|
|
3994
|
+
* a click outside and tabbing out
|
|
3995
|
+
* close it and drop the staged picks, without asking; it reopens on the
|
|
3996
|
+
* applied values. Picking a group-by equal to the break-out stages the
|
|
3997
|
+
* break-out back to None. The panel is portalled, so the frame never clips
|
|
3998
|
+
* it. `headerMenu` wins over `sortable` on the same column.
|
|
3894
3999
|
* `sticky` (a full-page table only): once the header row scrolls up to the
|
|
3895
4000
|
* page's StickyBar (or `stickyTop` pixels from the top), a copy of it stays
|
|
3896
4001
|
* there, right under the bar, until the last row goes by. The copy scrolls
|
|
@@ -3926,6 +4031,16 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3926
4031
|
* The brand fill is never the only cue: the app puts a "You" badge in the
|
|
3927
4032
|
* row or column header beside it, and colour alone says nothing to someone
|
|
3928
4033
|
* who can't see it. `NoValue` reads its reason, not "dash". `loading` sets aria-busy.
|
|
4034
|
+
* The `headerMenu` trigger is a button with aria-haspopup="dialog" and
|
|
4035
|
+
* aria-expanded (the panel holds Apply, so it's a dialog, as
|
|
4036
|
+
* MultiSelectFilter's, not a menu); Enter, Space or the down arrow opens it
|
|
4037
|
+
* and focus moves to the first group's picked row. Each group is a
|
|
4038
|
+
* radiogroup named by its heading, its rows role="radio" with aria-checked
|
|
4039
|
+
* and one tab stop; the arrows, Home and End move the pick within a group,
|
|
4040
|
+
* Tab goes to the next group, then Apply. Escape, Apply and tabbing past
|
|
4041
|
+
* either end close it and return focus to the trigger. The "›" is
|
|
4042
|
+
* hidden from screen readers, which hear "Subsidiary then League"; the panel
|
|
4043
|
+
* is named by the column's `label`.
|
|
3929
4044
|
* With `sticky`, the header copy is aria-hidden and out of the tab order
|
|
3930
4045
|
* (tabindex -1 on its buttons): screen readers and the keyboard use the real
|
|
3931
4046
|
* header, so nothing is announced or reached twice.
|
|
@@ -3939,6 +4054,9 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
3939
4054
|
* the cell of a change column. A bar or badge beside a figure goes before
|
|
3940
4055
|
* it, so the figure ends at the right edge.
|
|
3941
4056
|
* @use `rank` for a 1, 2, 3 … column before the name.
|
|
4057
|
+
* @use `headerMenu` on the name column when the screen lets people choose
|
|
4058
|
+
* what the rows are (group by, break out by): the header is where the choice
|
|
4059
|
+
* shows, next to the rows it shapes.
|
|
3942
4060
|
* @use `lead` for another column before the name (a trend sparkline); it
|
|
3943
4061
|
* pins with the name on a wide table and is blank on sub-rows and totals.
|
|
3944
4062
|
* @use a total column right after the name, styled like every other figure:
|
|
@@ -4011,6 +4129,15 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
|
|
|
4011
4129
|
* columns={columns}
|
|
4012
4130
|
* />
|
|
4013
4131
|
*
|
|
4132
|
+
* // The name column's header picks what the rows are
|
|
4133
|
+
* const nameColumn = {
|
|
4134
|
+
* key: "name", label: "Name", cell: (r) => r.name,
|
|
4135
|
+
* headerMenu: {
|
|
4136
|
+
* groupBy: { options: [{ id: "subsidiary", label: "Subsidiary" }, { id: "brand", label: "Brand" }], value: groupBy, onChange: setGroupBy },
|
|
4137
|
+
* breakOutBy: { options: [{ id: "league", label: "League" }, { id: "brand", label: "Brand" }], value: breakOut, onChange: setBreakOut },
|
|
4138
|
+
* },
|
|
4139
|
+
* }
|
|
4140
|
+
*
|
|
4014
4141
|
* // A full-page table: the header stays under the filters, the pager at the bottom
|
|
4015
4142
|
* <StickyBar><FilterChipBar … /></StickyBar>
|
|
4016
4143
|
* <DataTable
|
|
@@ -4487,9 +4614,10 @@ interface MenuItemProps extends ButtonHTMLAttributes<HTMLButtonElement>, CommonP
|
|
|
4487
4614
|
asChild?: boolean;
|
|
4488
4615
|
}
|
|
4489
4616
|
declare const MenuItem: react.ForwardRefExoticComponent<MenuItemProps & react.RefAttributes<HTMLButtonElement>>;
|
|
4490
|
-
/** A small heading over a group of rows ("Workspace"). */
|
|
4491
|
-
declare function MenuLabel({ className, testIdPrefix, children }: CommonProps & {
|
|
4617
|
+
/** A small heading over a group of rows ("Workspace"). `id` lets a group name itself by it (aria-labelledby). */
|
|
4618
|
+
declare function MenuLabel({ className, testIdPrefix, id, children }: CommonProps & {
|
|
4492
4619
|
children: ReactNode;
|
|
4620
|
+
id?: string;
|
|
4493
4621
|
}): react.JSX.Element;
|
|
4494
4622
|
/** A line between groups of rows. */
|
|
4495
4623
|
declare function MenuSeparator({ className, testIdPrefix }: CommonProps): react.JSX.Element;
|
|
@@ -4692,4 +4820,4 @@ declare function LoadError({ onRetry, children }: {
|
|
|
4692
4820
|
/** The thin moving line along a card's top edge while new data loads over old. */
|
|
4693
4821
|
declare function RefreshLine(): react.JSX.Element;
|
|
4694
4822
|
|
|
4695
|
-
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, AllFiltersButton, type AllFiltersButtonProps, type AxisMonthLabel, Badge, type BadgeKind, type BadgeProps, type BadgeTone, BarChartPlaceholder, type BarChartPlaceholderProps, BarList, type BarListProps, type BarListRow, Button, type ButtonProps, Card, type CardProps, ChartLegend, type ChartLegendProps, ChartSkeleton, CheckBox, CheckBoxBox, type CheckBoxBoxProps, type CheckBoxProps, ChipContent, type ChipContentProps, type ChipVariant, type CommonProps, CopyButton, type CopyButtonProps, type Currency, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableProps, type DateFormatOptions, type DateGranularity, type DateOrder, DateRangeFilter, type DateRangeFilterProps, type DateRangeFormatOptions, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, Drawer, type DrawerProps, type DrawerSize, EmptyState, type EmptyStateProps, type EmptyStateSize, Figure, type FigureProps, FilterChipBar, type FilterChipBarProps, FilterDrawer, type FilterDrawerProps, type FilterDrawerSection, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LegendItem, type LegendItemProps, type LegendMark, LineChartPlaceholder, type LineChartPlaceholderProps, LoadError, LongWait, MediaLabel, type MediaLabelProps, type MediaType, Menu, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuSeparator, Modal, type ModalProps, type ModalSize, type MoneyFormatOptions, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NO_VALUE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, NoValue, type NumberFormatOptions, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, PrimaryBadge, type PrimaryBadgeProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, RefreshLine, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, type SearchScope, SectionHeading, type SectionHeadingProps, SectionRail, type SectionRailProps, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type SegmentedOption, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, Skeleton, SkeletonLines, type SkeletonProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, StatStrip, type StatStripProps, StatStripSkeleton, StatTile, type StatTileProps, StickyBar, type StickyBarProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, TableLink, TablePagination, type TablePaginationProps, Tabs, type TabsProps, Tag, type TagProps, TextField, type TextFieldProps, type TextFieldSize, Toast, type ToastProps, type ToastTone, Toggle, ToggleChip, type ToggleChipProps, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, ariaSortFor, buttonVariants, chipTriggerClass, cycleSort, defaultDateOrder, formatCount, formatCountFull, formatDate, formatDateRange, formatDateTime, formatIsoDate, formatMoney, formatMoneyFull, formatMonth, formatMonthAxis, formatOpenRange, formatPercent, formatQuarter, formatRelative, formatTime, formatWeek, noResultsBody, resolveRange, sortProp, useDelayedLoading };
|
|
4823
|
+
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, AllFiltersButton, type AllFiltersButtonProps, type AxisMonthLabel, Badge, type BadgeKind, type BadgeProps, type BadgeTone, BarChartPlaceholder, type BarChartPlaceholderProps, BarList, type BarListProps, type BarListRow, Button, type ButtonProps, Card, type CardProps, ChartLegend, type ChartLegendProps, ChartSkeleton, CheckBox, CheckBoxBox, type CheckBoxBoxProps, type CheckBoxProps, ChipContent, type ChipContentProps, type ChipVariant, type CommonProps, CopyButton, type CopyButtonProps, type Currency, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableHeaderMenu, type DataTableHeaderMenuChoice, type DataTableHeaderMenuOption, type DataTableProps, type DateFormatOptions, type DateGranularity, type DateOrder, DateRangeFilter, type DateRangeFilterProps, type DateRangeFormatOptions, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, Drawer, type DrawerProps, type DrawerSize, EmptyState, type EmptyStateProps, type EmptyStateSize, Figure, type FigureProps, FilterChipBar, type FilterChipBarProps, FilterDrawer, type FilterDrawerProps, type FilterDrawerSection, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LegendItem, type LegendItemProps, type LegendMark, LineChartPlaceholder, type LineChartPlaceholderProps, LoadError, LongWait, MediaLabel, type MediaLabelProps, type MediaType, Menu, MenuItem, type MenuItemProps, MenuLabel, type MenuProps, MenuSeparator, Modal, type ModalProps, type ModalSize, type MoneyFormatOptions, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NO_VALUE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, NoValue, type NumberFormatOptions, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, PrimaryBadge, type PrimaryBadgeProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, RefreshLine, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, type SearchScope, SectionHeading, type SectionHeadingProps, SectionRail, type SectionRailProps, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type SegmentedOption, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, Skeleton, SkeletonLines, type SkeletonProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, StatStrip, type StatStripProps, StatStripSkeleton, StatTile, type StatTileProps, StickyBar, type StickyBarProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, TableLink, TablePagination, type TablePaginationProps, Tabs, type TabsProps, Tag, type TagProps, TextField, type TextFieldProps, type TextFieldSize, Toast, type ToastProps, type ToastTone, Toggle, ToggleChip, type ToggleChipProps, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, ariaSortFor, buttonVariants, chipTriggerClass, cycleSort, defaultDateOrder, formatCount, formatCountFull, formatDate, formatDateRange, formatDateTime, formatIsoDate, formatMoney, formatMoneyFull, formatMonth, formatMonthAxis, formatOpenRange, formatPercent, formatQuarter, formatRelative, formatTime, formatWeek, noResultsBody, resolveRange, sortProp, useDelayedLoading };
|