@mediaradar/design-components 0.32.1 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +266 -63
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +122 -6
- package/dist/index.d.ts +122 -6
- package/dist/index.js +278 -76
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -433,13 +433,20 @@ declare function CheckBoxBox({ checked, indeterminate, disabled, className }: Ch
|
|
|
433
433
|
* @tokens text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
434
434
|
* bg-surface, bg-input, bg-subtle, bg-ai-tint, bg-brand-primaryAction, text-brand-onprimary,
|
|
435
435
|
* shadow-overlay, text-text-primary, text-text-secondary, text-text-tertiary,
|
|
436
|
-
* hover:bg-subtle, hover:text-text-primary, focus-visible:outline-border-focus
|
|
436
|
+
* hover:bg-subtle, hover:text-text-primary, focus-visible:outline-border-focus, text-dense
|
|
437
437
|
* @dependencies lucide-react
|
|
438
438
|
* @behavior Escape and outside-click both close the popup. Opening always
|
|
439
439
|
* resets the draft (shortcut/start/end/visible month) to the last committed
|
|
440
440
|
* values, so a previous unsaved edit never lingers into the next open. Only
|
|
441
441
|
* the Apply button commits -- Cancel, Escape, and outside-click all discard
|
|
442
|
-
* the draft silently.
|
|
442
|
+
* the draft silently. "Last 30 days" is a hidden preset: a `defaultValue` or
|
|
443
|
+
* `value` naming it resolves to its dates, but the rail never offers it.
|
|
444
|
+
* `excludePresets` drops presets from the rail. `emptyLabel` starts the chip
|
|
445
|
+
* with no range chosen (Apply stays disabled until a day is picked).
|
|
446
|
+
* `compare` adds a "Compare to" radio group under the calendar, staged with
|
|
447
|
+
* the dates until Apply; the chip then reads "Last 7 days · vs prior period".
|
|
448
|
+
* `today` sets the day presets end on, for data that stops before the real
|
|
449
|
+
* today.
|
|
443
450
|
* `granularity="month"` rounds every range out to whole months (presets,
|
|
444
451
|
* clicked days and Apply alike), shows months on the trigger, and adds a
|
|
445
452
|
* "Data is monthly" note beside Cancel/Apply.
|
|
@@ -454,6 +461,17 @@ declare function CheckBoxBox({ checked, indeterminate, disabled, className }: Ch
|
|
|
454
461
|
* <DateRangeFilter caption="Dates" showDates shortDates placement="right" />
|
|
455
462
|
* <DateRangeFilter presetSet="creativeIntel" defaultValue="Last 7 days" onChange={setRange} />
|
|
456
463
|
* <DateRangeFilter presetSet="creativeIntel" value={preset} range={[start, end]} onChange={setPreset} onRangeChange={(s, e) => setRange({ start: s, end: e })} />
|
|
464
|
+
* <DateRangeFilter presetSet="creativeIntel" excludePresets={["Rolling 3 months", "Rolling 6 months"]} emptyLabel="Any time" onRangeChange={setRange} />
|
|
465
|
+
* <DateRangeFilter
|
|
466
|
+
* presetSet="creativeIntel"
|
|
467
|
+
* defaultValue={filters.range}
|
|
468
|
+
* initialRange={customDates}
|
|
469
|
+
* today={dataDay}
|
|
470
|
+
* showDates
|
|
471
|
+
* shortDates
|
|
472
|
+
* compare={{ value: filters.compare, options: [{ id: "prior", label: "Prior period" }, { id: "year", label: "Same period last year" }] }}
|
|
473
|
+
* onApply={(label, start, end, compare) => update({ range: label, compare })}
|
|
474
|
+
* />
|
|
457
475
|
* ```
|
|
458
476
|
*/
|
|
459
477
|
interface DateRangeFilterProps {
|
|
@@ -496,11 +514,39 @@ interface DateRangeFilterProps {
|
|
|
496
514
|
icon?: React.ReactNode;
|
|
497
515
|
/** 'creativeIntel' swaps in the day-level shortcut list (Today/Yesterday/Last N days/All available history) used by that dashboard. */
|
|
498
516
|
presetSet?: "default" | "creativeIntel";
|
|
517
|
+
/** Preset labels to leave out of the rail, e.g. the rolling-month ones. */
|
|
518
|
+
excludePresets?: readonly string[];
|
|
519
|
+
/**
|
|
520
|
+
* Start with no range chosen and show this label ("Any time") until a range
|
|
521
|
+
* is applied. Uncontrolled only. Remount (change `key`) to reset.
|
|
522
|
+
*/
|
|
523
|
+
emptyLabel?: string;
|
|
524
|
+
/** The day presets end on: the data's last day. Defaults to the real today. */
|
|
525
|
+
today?: Date;
|
|
526
|
+
/** The dates behind a `defaultValue` that isn't a preset (a custom span). Uncontrolled only. */
|
|
527
|
+
initialRange?: [Date, Date];
|
|
528
|
+
/**
|
|
529
|
+
* What changes are measured against, picked under the calendar and staged
|
|
530
|
+
* with the dates until Apply. The chip reads "· vs <label>" for the applied
|
|
531
|
+
* pick; a new `compare.value` from the parent replaces it.
|
|
532
|
+
*/
|
|
533
|
+
compare?: {
|
|
534
|
+
value?: string;
|
|
535
|
+
options: {
|
|
536
|
+
id: string;
|
|
537
|
+
label: string;
|
|
538
|
+
}[];
|
|
539
|
+
};
|
|
540
|
+
/**
|
|
541
|
+
* Fired on Apply only: the preset's name (or a custom span as "Oct 1, 2025 – Oct 17, 2026"),
|
|
542
|
+
* its dates, and the compare-to pick.
|
|
543
|
+
*/
|
|
544
|
+
onApply?: (label: string, start: Date, end: Date, compare?: string) => void;
|
|
499
545
|
/**
|
|
500
546
|
* Prefix for `data-testid` attributes on the trigger (`${testIdPrefix}-trigger`),
|
|
501
547
|
* the popover (`-popover`), each preset (`-option-<slugified-label>`, e.g.
|
|
502
|
-
* `-option-last-7-days`),
|
|
503
|
-
* no test-id wiring.
|
|
548
|
+
* `-option-last-7-days`), each `compare` option (`-compare-<slugified-id>`),
|
|
549
|
+
* and Cancel (`-cancel`) / Apply (`-apply`). Omit for no test-id wiring.
|
|
504
550
|
*/
|
|
505
551
|
testIdPrefix?: string;
|
|
506
552
|
/**
|
|
@@ -510,7 +556,7 @@ interface DateRangeFilterProps {
|
|
|
510
556
|
*/
|
|
511
557
|
granularity?: "day" | "month";
|
|
512
558
|
}
|
|
513
|
-
declare function DateRangeFilter({ caption, defaultValue, value: controlledValue, range: controlledRange, align, placement, onChange, onRangeChange, showDates, shortDates, icon, presetSet, testIdPrefix, granularity, }: DateRangeFilterProps): react.JSX.Element;
|
|
559
|
+
declare function DateRangeFilter({ caption, defaultValue, value: controlledValue, range: controlledRange, align, placement, onChange, onRangeChange, showDates, shortDates, icon, presetSet, excludePresets, emptyLabel, today: todayProp, initialRange, compare, onApply, testIdPrefix, granularity, }: DateRangeFilterProps): react.JSX.Element;
|
|
514
560
|
|
|
515
561
|
/**
|
|
516
562
|
* @pattern SearchBar
|
|
@@ -2769,6 +2815,76 @@ interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "si
|
|
|
2769
2815
|
*/
|
|
2770
2816
|
declare const TextField: react.ForwardRefExoticComponent<TextFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
2771
2817
|
|
|
2818
|
+
type DrawerSize = "sm" | "md" | "lg";
|
|
2819
|
+
interface DrawerProps {
|
|
2820
|
+
/** Whether the drawer is showing. It slides in when this turns true and out when it turns false. */
|
|
2821
|
+
open: boolean;
|
|
2822
|
+
/** Called on Escape, a click on the dimmed page, or the close button. */
|
|
2823
|
+
onClose: () => void;
|
|
2824
|
+
/** The drawer's title -- "Filters", "Saved views", the advertiser's name. */
|
|
2825
|
+
title: ReactNode;
|
|
2826
|
+
/** One line under the title. */
|
|
2827
|
+
description?: ReactNode;
|
|
2828
|
+
/** sm 440 for filters, md 640 for lists and saved views, lg 920 for a detail panel. */
|
|
2829
|
+
size?: DrawerSize;
|
|
2830
|
+
/** Pinned at the bottom, right-aligned -- "Clear all" and "Apply" for filters. */
|
|
2831
|
+
footer?: ReactNode;
|
|
2832
|
+
children?: ReactNode;
|
|
2833
|
+
className?: string;
|
|
2834
|
+
}
|
|
2835
|
+
/**
|
|
2836
|
+
* @pattern Drawer
|
|
2837
|
+
* @description A panel that slides in from the right over the dimmed page:
|
|
2838
|
+
* title, optional one-line description, a scrolling body, and an optional
|
|
2839
|
+
* footer pinned at the bottom. Three widths -- sm 440 for filters, md 640 for
|
|
2840
|
+
* lists and saved views, lg 920 for a detail panel -- over the same warm
|
|
2841
|
+
* scrim as Modal, with no blur. Same header, footer and keyboard behaviour as
|
|
2842
|
+
* Modal, so the two read as one family.
|
|
2843
|
+
* @variant sm - 440px. Default. Filters.
|
|
2844
|
+
* @variant md - 640px. A list, saved views, a comparison.
|
|
2845
|
+
* @variant lg - 920px. A detail panel: a battle card, an event breakdown.
|
|
2846
|
+
* @tokens bg-scrim, z-modal, transition-opacity,
|
|
2847
|
+
* duration-(--mr-motion-duration-interactive), ease-interactive,
|
|
2848
|
+
* motion-reduce:transition-none, border-l, border-border-default, bg-surface,
|
|
2849
|
+
* shadow-overlay, transition-transform, text-base, font-semibold,
|
|
2850
|
+
* text-text-primary, text-sm, text-text-secondary, text-text-tertiary,
|
|
2851
|
+
* hover:bg-subtle, hover:text-text-primary, rounded-control, border-t,
|
|
2852
|
+
* focus-visible:outline-border-focus
|
|
2853
|
+
* @dependencies lucide-react, react-dom
|
|
2854
|
+
* @behavior Portals to <body>. Slides in from the right over 200ms while the
|
|
2855
|
+
* scrim fades in, and slides back out before it unmounts; with reduced motion
|
|
2856
|
+
* it appears and goes without moving. Escape, a click on the dimmed page and
|
|
2857
|
+
* the × all call `onClose` -- in a filter drawer, unapplied changes are dropped,
|
|
2858
|
+
* as with Cancel. Focus moves to the first field (else the first footer
|
|
2859
|
+
* button) on open, Tab stays inside, and focus goes back to whatever opened it
|
|
2860
|
+
* on close. The page behind stops scrolling while it's open.
|
|
2861
|
+
* @a11y role="dialog" with aria-modal, named by its title and described by
|
|
2862
|
+
* `description`. The close button is labelled "Close".
|
|
2863
|
+
* @use for work alongside the page that the page's own context explains:
|
|
2864
|
+
* filters, saved views, a detail panel for a row.
|
|
2865
|
+
* @use `sm` for filters, `md` for lists, `lg` for a detail panel -- pick by
|
|
2866
|
+
* content, never a custom width.
|
|
2867
|
+
* @use the footer for the drawer's actions, primary last: "Clear all" then
|
|
2868
|
+
* "Apply".
|
|
2869
|
+
* @avoid a drawer for a decision that needs the user's full attention -- a
|
|
2870
|
+
* confirm or a short form is a Modal.
|
|
2871
|
+
* @avoid a drawer opened from another drawer. A Modal opened from a drawer is
|
|
2872
|
+
* fine and sits on top.
|
|
2873
|
+
* @avoid a `className` width override, or a blur behind it.
|
|
2874
|
+
* @usage
|
|
2875
|
+
* ```tsx
|
|
2876
|
+
* <Drawer
|
|
2877
|
+
* open={open}
|
|
2878
|
+
* onClose={() => setOpen(false)}
|
|
2879
|
+
* title="Filters"
|
|
2880
|
+
* footer={<><Button variant="secondary" onClick={clear}>Clear all</Button><Button onClick={apply}>Apply</Button></>}
|
|
2881
|
+
* >
|
|
2882
|
+
* …filter groups…
|
|
2883
|
+
* </Drawer>
|
|
2884
|
+
* ```
|
|
2885
|
+
*/
|
|
2886
|
+
declare function Drawer({ open, onClose, title, description, size, footer, children, className }: DrawerProps): react.ReactPortal | null;
|
|
2887
|
+
|
|
2772
2888
|
type DataTableColumnWidth = "fill" | "sm" | "md" | "lg";
|
|
2773
2889
|
type DataTableDensity = "default" | "compact";
|
|
2774
2890
|
interface DataTableColumn<T, K extends string = string> {
|
|
@@ -3082,4 +3198,4 @@ interface InlineMessageProps {
|
|
|
3082
3198
|
*/
|
|
3083
3199
|
declare function InlineMessage({ tone, title, children, actions, onDismiss, className }: InlineMessageProps): react.JSX.Element;
|
|
3084
3200
|
|
|
3085
|
-
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, Badge, type BadgeKind, type BadgeProps, type BadgeTone, BarChartPlaceholder, type BarChartPlaceholderProps, Button, type ButtonProps, Card, type CardProps, CheckBox, CheckBoxBox, type CheckBoxBoxProps, type CheckBoxProps, ChipContent, type ChipContentProps, type ChipVariant, CopyButton, type CopyButtonProps, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, EmptyState, type EmptyStateProps, type EmptyStateSize, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LineChartPlaceholder, type LineChartPlaceholderProps, MediaLabel, type MediaLabelProps, type MediaType, Modal, type ModalProps, type ModalSize, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, 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, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, 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, noResultsBody, resolveRange, sortProp };
|
|
3201
|
+
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, Badge, type BadgeKind, type BadgeProps, type BadgeTone, BarChartPlaceholder, type BarChartPlaceholderProps, Button, type ButtonProps, Card, type CardProps, CheckBox, CheckBoxBox, type CheckBoxBoxProps, type CheckBoxProps, ChipContent, type ChipContentProps, type ChipVariant, CopyButton, type CopyButtonProps, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, Drawer, type DrawerProps, type DrawerSize, EmptyState, type EmptyStateProps, type EmptyStateSize, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LineChartPlaceholder, type LineChartPlaceholderProps, MediaLabel, type MediaLabelProps, type MediaType, Modal, type ModalProps, type ModalSize, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, 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, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, 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, noResultsBody, resolveRange, sortProp };
|
package/dist/index.d.ts
CHANGED
|
@@ -433,13 +433,20 @@ declare function CheckBoxBox({ checked, indeterminate, disabled, className }: Ch
|
|
|
433
433
|
* @tokens text-control-caption, rounded-control, rounded-card, border-border-default, border-border-strong,
|
|
434
434
|
* bg-surface, bg-input, bg-subtle, bg-ai-tint, bg-brand-primaryAction, text-brand-onprimary,
|
|
435
435
|
* shadow-overlay, text-text-primary, text-text-secondary, text-text-tertiary,
|
|
436
|
-
* hover:bg-subtle, hover:text-text-primary, focus-visible:outline-border-focus
|
|
436
|
+
* hover:bg-subtle, hover:text-text-primary, focus-visible:outline-border-focus, text-dense
|
|
437
437
|
* @dependencies lucide-react
|
|
438
438
|
* @behavior Escape and outside-click both close the popup. Opening always
|
|
439
439
|
* resets the draft (shortcut/start/end/visible month) to the last committed
|
|
440
440
|
* values, so a previous unsaved edit never lingers into the next open. Only
|
|
441
441
|
* the Apply button commits -- Cancel, Escape, and outside-click all discard
|
|
442
|
-
* the draft silently.
|
|
442
|
+
* the draft silently. "Last 30 days" is a hidden preset: a `defaultValue` or
|
|
443
|
+
* `value` naming it resolves to its dates, but the rail never offers it.
|
|
444
|
+
* `excludePresets` drops presets from the rail. `emptyLabel` starts the chip
|
|
445
|
+
* with no range chosen (Apply stays disabled until a day is picked).
|
|
446
|
+
* `compare` adds a "Compare to" radio group under the calendar, staged with
|
|
447
|
+
* the dates until Apply; the chip then reads "Last 7 days · vs prior period".
|
|
448
|
+
* `today` sets the day presets end on, for data that stops before the real
|
|
449
|
+
* today.
|
|
443
450
|
* `granularity="month"` rounds every range out to whole months (presets,
|
|
444
451
|
* clicked days and Apply alike), shows months on the trigger, and adds a
|
|
445
452
|
* "Data is monthly" note beside Cancel/Apply.
|
|
@@ -454,6 +461,17 @@ declare function CheckBoxBox({ checked, indeterminate, disabled, className }: Ch
|
|
|
454
461
|
* <DateRangeFilter caption="Dates" showDates shortDates placement="right" />
|
|
455
462
|
* <DateRangeFilter presetSet="creativeIntel" defaultValue="Last 7 days" onChange={setRange} />
|
|
456
463
|
* <DateRangeFilter presetSet="creativeIntel" value={preset} range={[start, end]} onChange={setPreset} onRangeChange={(s, e) => setRange({ start: s, end: e })} />
|
|
464
|
+
* <DateRangeFilter presetSet="creativeIntel" excludePresets={["Rolling 3 months", "Rolling 6 months"]} emptyLabel="Any time" onRangeChange={setRange} />
|
|
465
|
+
* <DateRangeFilter
|
|
466
|
+
* presetSet="creativeIntel"
|
|
467
|
+
* defaultValue={filters.range}
|
|
468
|
+
* initialRange={customDates}
|
|
469
|
+
* today={dataDay}
|
|
470
|
+
* showDates
|
|
471
|
+
* shortDates
|
|
472
|
+
* compare={{ value: filters.compare, options: [{ id: "prior", label: "Prior period" }, { id: "year", label: "Same period last year" }] }}
|
|
473
|
+
* onApply={(label, start, end, compare) => update({ range: label, compare })}
|
|
474
|
+
* />
|
|
457
475
|
* ```
|
|
458
476
|
*/
|
|
459
477
|
interface DateRangeFilterProps {
|
|
@@ -496,11 +514,39 @@ interface DateRangeFilterProps {
|
|
|
496
514
|
icon?: React.ReactNode;
|
|
497
515
|
/** 'creativeIntel' swaps in the day-level shortcut list (Today/Yesterday/Last N days/All available history) used by that dashboard. */
|
|
498
516
|
presetSet?: "default" | "creativeIntel";
|
|
517
|
+
/** Preset labels to leave out of the rail, e.g. the rolling-month ones. */
|
|
518
|
+
excludePresets?: readonly string[];
|
|
519
|
+
/**
|
|
520
|
+
* Start with no range chosen and show this label ("Any time") until a range
|
|
521
|
+
* is applied. Uncontrolled only. Remount (change `key`) to reset.
|
|
522
|
+
*/
|
|
523
|
+
emptyLabel?: string;
|
|
524
|
+
/** The day presets end on: the data's last day. Defaults to the real today. */
|
|
525
|
+
today?: Date;
|
|
526
|
+
/** The dates behind a `defaultValue` that isn't a preset (a custom span). Uncontrolled only. */
|
|
527
|
+
initialRange?: [Date, Date];
|
|
528
|
+
/**
|
|
529
|
+
* What changes are measured against, picked under the calendar and staged
|
|
530
|
+
* with the dates until Apply. The chip reads "· vs <label>" for the applied
|
|
531
|
+
* pick; a new `compare.value` from the parent replaces it.
|
|
532
|
+
*/
|
|
533
|
+
compare?: {
|
|
534
|
+
value?: string;
|
|
535
|
+
options: {
|
|
536
|
+
id: string;
|
|
537
|
+
label: string;
|
|
538
|
+
}[];
|
|
539
|
+
};
|
|
540
|
+
/**
|
|
541
|
+
* Fired on Apply only: the preset's name (or a custom span as "Oct 1, 2025 – Oct 17, 2026"),
|
|
542
|
+
* its dates, and the compare-to pick.
|
|
543
|
+
*/
|
|
544
|
+
onApply?: (label: string, start: Date, end: Date, compare?: string) => void;
|
|
499
545
|
/**
|
|
500
546
|
* Prefix for `data-testid` attributes on the trigger (`${testIdPrefix}-trigger`),
|
|
501
547
|
* the popover (`-popover`), each preset (`-option-<slugified-label>`, e.g.
|
|
502
|
-
* `-option-last-7-days`),
|
|
503
|
-
* no test-id wiring.
|
|
548
|
+
* `-option-last-7-days`), each `compare` option (`-compare-<slugified-id>`),
|
|
549
|
+
* and Cancel (`-cancel`) / Apply (`-apply`). Omit for no test-id wiring.
|
|
504
550
|
*/
|
|
505
551
|
testIdPrefix?: string;
|
|
506
552
|
/**
|
|
@@ -510,7 +556,7 @@ interface DateRangeFilterProps {
|
|
|
510
556
|
*/
|
|
511
557
|
granularity?: "day" | "month";
|
|
512
558
|
}
|
|
513
|
-
declare function DateRangeFilter({ caption, defaultValue, value: controlledValue, range: controlledRange, align, placement, onChange, onRangeChange, showDates, shortDates, icon, presetSet, testIdPrefix, granularity, }: DateRangeFilterProps): react.JSX.Element;
|
|
559
|
+
declare function DateRangeFilter({ caption, defaultValue, value: controlledValue, range: controlledRange, align, placement, onChange, onRangeChange, showDates, shortDates, icon, presetSet, excludePresets, emptyLabel, today: todayProp, initialRange, compare, onApply, testIdPrefix, granularity, }: DateRangeFilterProps): react.JSX.Element;
|
|
514
560
|
|
|
515
561
|
/**
|
|
516
562
|
* @pattern SearchBar
|
|
@@ -2769,6 +2815,76 @@ interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "si
|
|
|
2769
2815
|
*/
|
|
2770
2816
|
declare const TextField: react.ForwardRefExoticComponent<TextFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
2771
2817
|
|
|
2818
|
+
type DrawerSize = "sm" | "md" | "lg";
|
|
2819
|
+
interface DrawerProps {
|
|
2820
|
+
/** Whether the drawer is showing. It slides in when this turns true and out when it turns false. */
|
|
2821
|
+
open: boolean;
|
|
2822
|
+
/** Called on Escape, a click on the dimmed page, or the close button. */
|
|
2823
|
+
onClose: () => void;
|
|
2824
|
+
/** The drawer's title -- "Filters", "Saved views", the advertiser's name. */
|
|
2825
|
+
title: ReactNode;
|
|
2826
|
+
/** One line under the title. */
|
|
2827
|
+
description?: ReactNode;
|
|
2828
|
+
/** sm 440 for filters, md 640 for lists and saved views, lg 920 for a detail panel. */
|
|
2829
|
+
size?: DrawerSize;
|
|
2830
|
+
/** Pinned at the bottom, right-aligned -- "Clear all" and "Apply" for filters. */
|
|
2831
|
+
footer?: ReactNode;
|
|
2832
|
+
children?: ReactNode;
|
|
2833
|
+
className?: string;
|
|
2834
|
+
}
|
|
2835
|
+
/**
|
|
2836
|
+
* @pattern Drawer
|
|
2837
|
+
* @description A panel that slides in from the right over the dimmed page:
|
|
2838
|
+
* title, optional one-line description, a scrolling body, and an optional
|
|
2839
|
+
* footer pinned at the bottom. Three widths -- sm 440 for filters, md 640 for
|
|
2840
|
+
* lists and saved views, lg 920 for a detail panel -- over the same warm
|
|
2841
|
+
* scrim as Modal, with no blur. Same header, footer and keyboard behaviour as
|
|
2842
|
+
* Modal, so the two read as one family.
|
|
2843
|
+
* @variant sm - 440px. Default. Filters.
|
|
2844
|
+
* @variant md - 640px. A list, saved views, a comparison.
|
|
2845
|
+
* @variant lg - 920px. A detail panel: a battle card, an event breakdown.
|
|
2846
|
+
* @tokens bg-scrim, z-modal, transition-opacity,
|
|
2847
|
+
* duration-(--mr-motion-duration-interactive), ease-interactive,
|
|
2848
|
+
* motion-reduce:transition-none, border-l, border-border-default, bg-surface,
|
|
2849
|
+
* shadow-overlay, transition-transform, text-base, font-semibold,
|
|
2850
|
+
* text-text-primary, text-sm, text-text-secondary, text-text-tertiary,
|
|
2851
|
+
* hover:bg-subtle, hover:text-text-primary, rounded-control, border-t,
|
|
2852
|
+
* focus-visible:outline-border-focus
|
|
2853
|
+
* @dependencies lucide-react, react-dom
|
|
2854
|
+
* @behavior Portals to <body>. Slides in from the right over 200ms while the
|
|
2855
|
+
* scrim fades in, and slides back out before it unmounts; with reduced motion
|
|
2856
|
+
* it appears and goes without moving. Escape, a click on the dimmed page and
|
|
2857
|
+
* the × all call `onClose` -- in a filter drawer, unapplied changes are dropped,
|
|
2858
|
+
* as with Cancel. Focus moves to the first field (else the first footer
|
|
2859
|
+
* button) on open, Tab stays inside, and focus goes back to whatever opened it
|
|
2860
|
+
* on close. The page behind stops scrolling while it's open.
|
|
2861
|
+
* @a11y role="dialog" with aria-modal, named by its title and described by
|
|
2862
|
+
* `description`. The close button is labelled "Close".
|
|
2863
|
+
* @use for work alongside the page that the page's own context explains:
|
|
2864
|
+
* filters, saved views, a detail panel for a row.
|
|
2865
|
+
* @use `sm` for filters, `md` for lists, `lg` for a detail panel -- pick by
|
|
2866
|
+
* content, never a custom width.
|
|
2867
|
+
* @use the footer for the drawer's actions, primary last: "Clear all" then
|
|
2868
|
+
* "Apply".
|
|
2869
|
+
* @avoid a drawer for a decision that needs the user's full attention -- a
|
|
2870
|
+
* confirm or a short form is a Modal.
|
|
2871
|
+
* @avoid a drawer opened from another drawer. A Modal opened from a drawer is
|
|
2872
|
+
* fine and sits on top.
|
|
2873
|
+
* @avoid a `className` width override, or a blur behind it.
|
|
2874
|
+
* @usage
|
|
2875
|
+
* ```tsx
|
|
2876
|
+
* <Drawer
|
|
2877
|
+
* open={open}
|
|
2878
|
+
* onClose={() => setOpen(false)}
|
|
2879
|
+
* title="Filters"
|
|
2880
|
+
* footer={<><Button variant="secondary" onClick={clear}>Clear all</Button><Button onClick={apply}>Apply</Button></>}
|
|
2881
|
+
* >
|
|
2882
|
+
* …filter groups…
|
|
2883
|
+
* </Drawer>
|
|
2884
|
+
* ```
|
|
2885
|
+
*/
|
|
2886
|
+
declare function Drawer({ open, onClose, title, description, size, footer, children, className }: DrawerProps): react.ReactPortal | null;
|
|
2887
|
+
|
|
2772
2888
|
type DataTableColumnWidth = "fill" | "sm" | "md" | "lg";
|
|
2773
2889
|
type DataTableDensity = "default" | "compact";
|
|
2774
2890
|
interface DataTableColumn<T, K extends string = string> {
|
|
@@ -3082,4 +3198,4 @@ interface InlineMessageProps {
|
|
|
3082
3198
|
*/
|
|
3083
3199
|
declare function InlineMessage({ tone, title, children, actions, onDismiss, className }: InlineMessageProps): react.JSX.Element;
|
|
3084
3200
|
|
|
3085
|
-
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, Badge, type BadgeKind, type BadgeProps, type BadgeTone, BarChartPlaceholder, type BarChartPlaceholderProps, Button, type ButtonProps, Card, type CardProps, CheckBox, CheckBoxBox, type CheckBoxBoxProps, type CheckBoxProps, ChipContent, type ChipContentProps, type ChipVariant, CopyButton, type CopyButtonProps, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, EmptyState, type EmptyStateProps, type EmptyStateSize, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LineChartPlaceholder, type LineChartPlaceholderProps, MediaLabel, type MediaLabelProps, type MediaType, Modal, type ModalProps, type ModalSize, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, 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, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, 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, noResultsBody, resolveRange, sortProp };
|
|
3201
|
+
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, Badge, type BadgeKind, type BadgeProps, type BadgeTone, BarChartPlaceholder, type BarChartPlaceholderProps, Button, type ButtonProps, Card, type CardProps, CheckBox, CheckBoxBox, type CheckBoxBoxProps, type CheckBoxProps, ChipContent, type ChipContentProps, type ChipVariant, CopyButton, type CopyButtonProps, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, Drawer, type DrawerProps, type DrawerSize, EmptyState, type EmptyStateProps, type EmptyStateSize, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LineChartPlaceholder, type LineChartPlaceholderProps, MediaLabel, type MediaLabelProps, type MediaType, Modal, type ModalProps, type ModalSize, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, 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, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, 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, noResultsBody, resolveRange, sortProp };
|