@mediaradar/design-components 0.59.0 → 0.61.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, HTMLAttributes, RefObject, ButtonHTMLAttributes, Ref, ReactElement, MouseEventHandler, InputHTMLAttributes, AnchorHTMLAttributes, ComponentType } from 'react';
2
+ import { ReactNode, HTMLAttributes, RefObject, ButtonHTMLAttributes, Ref, ReactElement, MouseEventHandler, InputHTMLAttributes, AnchorHTMLAttributes, ComponentType, CSSProperties } from 'react';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
  import * as class_variance_authority_types from 'class-variance-authority/types';
5
5
  import { VariantProps } from 'class-variance-authority';
@@ -1168,6 +1168,19 @@ interface CardProps extends Omit<React.HTMLAttributes<HTMLElement>, "title">, Co
1168
1168
  action?: ReactNode;
1169
1169
  /** Card body. Rendered edge to edge without `title`; inside the standard padding with it. */
1170
1170
  children?: ReactNode;
1171
+ /**
1172
+ * First load: the title stays and the body shows `skeleton` (a chart's
1173
+ * shape by default), from 300ms in and for at least 500ms.
1174
+ */
1175
+ loading?: boolean;
1176
+ /** The placeholder while `loading`. Default `ChartSkeleton`. */
1177
+ skeleton?: ReactNode;
1178
+ /** New data loading over what's shown (a filter changed): the body dims and a thin line runs along the top. */
1179
+ refreshing?: boolean;
1180
+ /** The card couldn't load: "Couldn't load this." and Try again, in the card's own space. */
1181
+ error?: boolean;
1182
+ /** Try again after `error`, or after a load that takes over 30 seconds. */
1183
+ onRetry?: () => void;
1171
1184
  }
1172
1185
  declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLElement>>;
1173
1186
 
@@ -3592,6 +3605,10 @@ interface DataTableProps<T, K extends string = string> extends CommonProps {
3592
3605
  loading?: boolean;
3593
3606
  /** How many skeleton rows while `loading`. Match the page size. */
3594
3607
  loadingRows?: number;
3608
+ /** New rows loading over the current ones (sort, page, filter): rows dim and a thin line runs along the top. */
3609
+ refreshing?: boolean;
3610
+ /** Retry offered once a load has taken over 30 seconds. */
3611
+ onRetry?: () => void;
3595
3612
  /** What the body shows when `rows` is empty. Defaults to NoResultsEmptyState. */
3596
3613
  empty?: ReactNode;
3597
3614
  /** Caps the height so the body scrolls under a pinned header: sm 320, md 480, lg 640. */
@@ -3703,7 +3720,7 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
3703
3720
  * />
3704
3721
  * ```
3705
3722
  */
3706
- declare function DataTable<T, K extends string = string>({ columns, rows, rowKey, title, subtitle, action, variant, titleAs, sort, onSortChange, defaultSort, renderExpanded, canExpand, rowLabel, density, loading, loadingRows, empty, maxHeight, footer, className, testIdPrefix, ...rest }: DataTableProps<T, K>): react.JSX.Element;
3723
+ declare function DataTable<T, K extends string = string>({ columns, rows, rowKey, title, subtitle, action, variant, titleAs, sort, onSortChange, defaultSort, renderExpanded, canExpand, rowLabel, density, loading, loadingRows, refreshing, onRetry, empty, maxHeight, footer, className, testIdPrefix, ...rest }: DataTableProps<T, K>): react.JSX.Element;
3707
3724
 
3708
3725
  type MediaType = "TV" | "CTV" | "Digital" | "Social" | "Radio" | "Newspaper" | "Magazine";
3709
3726
  interface MediaLabelProps extends CommonProps {
@@ -3928,7 +3945,13 @@ interface FilterDrawerSection<Id extends string = string> {
3928
3945
  className?: string;
3929
3946
  "aria-hidden"?: boolean | "true" | "false";
3930
3947
  }>;
3931
- /** Shown on the row once the filter narrows anything: "3 selected", "Off". Empty hides it. */
3948
+ /**
3949
+ * How many picks the filter holds. Above 0 it shows as a count badge on the
3950
+ * row and beside the filter's title in its panel ("3"; screen readers hear
3951
+ * "3 selected").
3952
+ */
3953
+ count?: number;
3954
+ /** For a filter that isn't a count ("Off"): a text badge on the row instead. Ignored when `count` is above 0. */
3932
3955
  badge?: string | null;
3933
3956
  /** One line saying what the filter means; an info tip beside its name in its panel. */
3934
3957
  info?: string;
@@ -3940,7 +3963,10 @@ interface FilterDrawerProps<Id extends string = string> extends CommonProps {
3940
3963
  sections: FilterDrawerSection<Id>[];
3941
3964
  /** One filter's contents, shown when its row is opened. The page owns the draft. */
3942
3965
  renderSection: (id: Id) => ReactNode;
3943
- /** Filters narrowing anything in the draft -- the count beside the title. */
3966
+ /**
3967
+ * @deprecated No longer shown: the AllFiltersButton on the page carries the
3968
+ * total, and each row carries its own count. Kept so existing pages compile.
3969
+ */
3944
3970
  activeCount?: number;
3945
3971
  /** Empties one filter in the draft: Clear inside a filter's panel. */
3946
3972
  onClearSection: (id: Id) => void;
@@ -3963,7 +3989,10 @@ interface FilterDrawerProps<Id extends string = string> extends CommonProps {
3963
3989
  * title. The page keeps the draft and renders each filter's contents;
3964
3990
  * FilterDrawer owns the list, the navigation, the slide between the two and
3965
3991
  * the footer: Clear inside a filter; Clear all, Cancel and See
3966
- * results on the list. Opened from AllFiltersButton.
3992
+ * results on the list. Opened from AllFiltersButton, which carries the
3993
+ * total. A filter with picks shows their number as a count badge (the
3994
+ * style guide's Badge, brandSolid, count) on its row and beside its title
3995
+ * in its panel.
3967
3996
  * @tokens border-t, border-b, border-border-default, px-5, py-3.5, text-sm,
3968
3997
  * font-medium, text-text-primary, text-text-secondary, text-brand-primaryAction,
3969
3998
  * hover:bg-subtle, rounded-control, focus-visible:outline-border-focus,
@@ -3996,8 +4025,7 @@ interface FilterDrawerProps<Id extends string = string> extends CommonProps {
3996
4025
  * <FilterDrawer
3997
4026
  * open={open}
3998
4027
  * onClose={() => setOpen(false)}
3999
- * activeCount={count(draft)}
4000
- * sections={[{ id: "brand", label: "Brand", icon: Package, badge: draft.brands.length ? `${draft.brands.length} selected` : null }]}
4028
+ * sections={[{ id: "brand", label: "Brand", icon: Package, count: draft.brands.length }]}
4001
4029
  * renderSection={(id) => <BrandPicker value={draft.brands} onChange={...} />}
4002
4030
  * onClearSection={(id) => setDraft((d) => ({ ...d, [id]: [] }))}
4003
4031
  * onClearAll={() => setDraft(empty)}
@@ -4005,7 +4033,7 @@ interface FilterDrawerProps<Id extends string = string> extends CommonProps {
4005
4033
  * />
4006
4034
  * ```
4007
4035
  */
4008
- declare function FilterDrawer<Id extends string>({ open, onClose, sections, renderSection, activeCount, onClearSection, onClearAll, onApply, focus, size, testIdPrefix, }: FilterDrawerProps<Id>): react.JSX.Element;
4036
+ declare function FilterDrawer<Id extends string>({ open, onClose, sections, renderSection, activeCount: _activeCount, onClearSection, onClearAll, onApply, focus, size, testIdPrefix, }: FilterDrawerProps<Id>): react.JSX.Element;
4009
4037
 
4010
4038
  interface AllFiltersButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">, CommonProps {
4011
4039
  /** Filters narrowing the page; the badge shows when above 0. */
@@ -4229,4 +4257,71 @@ interface FigureProps extends MoneyFormatOptions {
4229
4257
  }
4230
4258
  declare function Figure({ value, kind, missing, ...opts }: FigureProps): react.JSX.Element;
4231
4259
 
4232
- 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, 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, 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, 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, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, StatStrip, type StatStripProps, StatTile, type StatTileProps, 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 };
4260
+ /**
4261
+ * Whether to show a loading state: only once loading has lasted `delay` ms
4262
+ * (most loads finish sooner), and then for at least `min` ms, so it never
4263
+ * flashes.
4264
+ */
4265
+ declare function useDelayedLoading(loading: boolean, delay?: number, min?: number): boolean;
4266
+ /**
4267
+ * @pattern Skeleton
4268
+ * @since 0.60.0
4269
+ * @description The loading placeholder: a grey shape in the layout of the
4270
+ * content that's coming, with a soft shimmer. Presets draw the common
4271
+ * layouts (`SkeletonLines`, `ChartSkeleton`, `StatStripSkeleton`), and
4272
+ * `Card` and `DataTable` draw their own with `loading`. Never a spinner,
4273
+ * except inside a button.
4274
+ * @variant shape: line | block | circle
4275
+ * @tokens bg-subtle, rounded-pill, rounded-control, rounded-full
4276
+ * @a11y Decorative and hidden: the loading container carries `aria-busy`
4277
+ * (Card and DataTable set it), so screen readers hear the content once.
4278
+ * @behavior Shimmer sweeps left to right every 1.5s; under reduced motion
4279
+ * the shapes are plain grey. Use `useDelayedLoading` so a fast load shows
4280
+ * nothing and a slow one shows for at least 0.5s.
4281
+ * @use one shape per thing that's coming, in its real size and place.
4282
+ * @avoid a spinner in a card, or one big skeleton for the whole page.
4283
+ * @usage
4284
+ * ```tsx
4285
+ * <Skeleton className="h-3 w-32" />
4286
+ * <ChartSkeleton />
4287
+ * ```
4288
+ */
4289
+ interface SkeletonProps extends CommonProps {
4290
+ shape?: "line" | "block" | "circle";
4291
+ className?: string;
4292
+ style?: CSSProperties;
4293
+ }
4294
+ declare function Skeleton({ shape, className, style, testIdPrefix }: SkeletonProps): react.JSX.Element;
4295
+ /** Lines of text: the last one shorter, like a paragraph. */
4296
+ declare function SkeletonLines({ lines, className }: {
4297
+ lines?: number;
4298
+ className?: string;
4299
+ }): react.JSX.Element;
4300
+ /** A chart's area: a few bars rising from a baseline, with axis labels. */
4301
+ declare function ChartSkeleton({ className }: {
4302
+ className?: string;
4303
+ }): react.JSX.Element;
4304
+ /** The headline figures: a label and a figure per tile. Wrap in `StatStrip`'s frame or a card. */
4305
+ declare function StatStripSkeleton({ tiles, className }: {
4306
+ tiles?: number;
4307
+ className?: string;
4308
+ }): react.JSX.Element;
4309
+ /**
4310
+ * Shown under a loading card once it has taken a while: after 5s a quiet
4311
+ * line, after 30s an offer to try again.
4312
+ */
4313
+ declare function LongWait({ loading, onRetry, hint, className }: {
4314
+ loading: boolean;
4315
+ onRetry?: () => void;
4316
+ hint?: string;
4317
+ className?: string;
4318
+ }): react.JSX.Element | null;
4319
+ /** A card that couldn't load: one line and Retry, in the card's own space. */
4320
+ declare function LoadError({ onRetry, children }: {
4321
+ onRetry?: () => void;
4322
+ children?: ReactNode;
4323
+ }): react.JSX.Element;
4324
+ /** The thin moving line along a card's top edge while new data loads over old. */
4325
+ declare function RefreshLine(): react.JSX.Element;
4326
+
4327
+ 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, 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
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { ReactNode, HTMLAttributes, RefObject, ButtonHTMLAttributes, Ref, ReactElement, MouseEventHandler, InputHTMLAttributes, AnchorHTMLAttributes, ComponentType } from 'react';
2
+ import { ReactNode, HTMLAttributes, RefObject, ButtonHTMLAttributes, Ref, ReactElement, MouseEventHandler, InputHTMLAttributes, AnchorHTMLAttributes, ComponentType, CSSProperties } from 'react';
3
3
  import { LucideIcon } from 'lucide-react';
4
4
  import * as class_variance_authority_types from 'class-variance-authority/types';
5
5
  import { VariantProps } from 'class-variance-authority';
@@ -1168,6 +1168,19 @@ interface CardProps extends Omit<React.HTMLAttributes<HTMLElement>, "title">, Co
1168
1168
  action?: ReactNode;
1169
1169
  /** Card body. Rendered edge to edge without `title`; inside the standard padding with it. */
1170
1170
  children?: ReactNode;
1171
+ /**
1172
+ * First load: the title stays and the body shows `skeleton` (a chart's
1173
+ * shape by default), from 300ms in and for at least 500ms.
1174
+ */
1175
+ loading?: boolean;
1176
+ /** The placeholder while `loading`. Default `ChartSkeleton`. */
1177
+ skeleton?: ReactNode;
1178
+ /** New data loading over what's shown (a filter changed): the body dims and a thin line runs along the top. */
1179
+ refreshing?: boolean;
1180
+ /** The card couldn't load: "Couldn't load this." and Try again, in the card's own space. */
1181
+ error?: boolean;
1182
+ /** Try again after `error`, or after a load that takes over 30 seconds. */
1183
+ onRetry?: () => void;
1171
1184
  }
1172
1185
  declare const Card: react.ForwardRefExoticComponent<CardProps & react.RefAttributes<HTMLElement>>;
1173
1186
 
@@ -3592,6 +3605,10 @@ interface DataTableProps<T, K extends string = string> extends CommonProps {
3592
3605
  loading?: boolean;
3593
3606
  /** How many skeleton rows while `loading`. Match the page size. */
3594
3607
  loadingRows?: number;
3608
+ /** New rows loading over the current ones (sort, page, filter): rows dim and a thin line runs along the top. */
3609
+ refreshing?: boolean;
3610
+ /** Retry offered once a load has taken over 30 seconds. */
3611
+ onRetry?: () => void;
3595
3612
  /** What the body shows when `rows` is empty. Defaults to NoResultsEmptyState. */
3596
3613
  empty?: ReactNode;
3597
3614
  /** Caps the height so the body scrolls under a pinned header: sm 320, md 480, lg 640. */
@@ -3703,7 +3720,7 @@ declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnc
3703
3720
  * />
3704
3721
  * ```
3705
3722
  */
3706
- declare function DataTable<T, K extends string = string>({ columns, rows, rowKey, title, subtitle, action, variant, titleAs, sort, onSortChange, defaultSort, renderExpanded, canExpand, rowLabel, density, loading, loadingRows, empty, maxHeight, footer, className, testIdPrefix, ...rest }: DataTableProps<T, K>): react.JSX.Element;
3723
+ declare function DataTable<T, K extends string = string>({ columns, rows, rowKey, title, subtitle, action, variant, titleAs, sort, onSortChange, defaultSort, renderExpanded, canExpand, rowLabel, density, loading, loadingRows, refreshing, onRetry, empty, maxHeight, footer, className, testIdPrefix, ...rest }: DataTableProps<T, K>): react.JSX.Element;
3707
3724
 
3708
3725
  type MediaType = "TV" | "CTV" | "Digital" | "Social" | "Radio" | "Newspaper" | "Magazine";
3709
3726
  interface MediaLabelProps extends CommonProps {
@@ -3928,7 +3945,13 @@ interface FilterDrawerSection<Id extends string = string> {
3928
3945
  className?: string;
3929
3946
  "aria-hidden"?: boolean | "true" | "false";
3930
3947
  }>;
3931
- /** Shown on the row once the filter narrows anything: "3 selected", "Off". Empty hides it. */
3948
+ /**
3949
+ * How many picks the filter holds. Above 0 it shows as a count badge on the
3950
+ * row and beside the filter's title in its panel ("3"; screen readers hear
3951
+ * "3 selected").
3952
+ */
3953
+ count?: number;
3954
+ /** For a filter that isn't a count ("Off"): a text badge on the row instead. Ignored when `count` is above 0. */
3932
3955
  badge?: string | null;
3933
3956
  /** One line saying what the filter means; an info tip beside its name in its panel. */
3934
3957
  info?: string;
@@ -3940,7 +3963,10 @@ interface FilterDrawerProps<Id extends string = string> extends CommonProps {
3940
3963
  sections: FilterDrawerSection<Id>[];
3941
3964
  /** One filter's contents, shown when its row is opened. The page owns the draft. */
3942
3965
  renderSection: (id: Id) => ReactNode;
3943
- /** Filters narrowing anything in the draft -- the count beside the title. */
3966
+ /**
3967
+ * @deprecated No longer shown: the AllFiltersButton on the page carries the
3968
+ * total, and each row carries its own count. Kept so existing pages compile.
3969
+ */
3944
3970
  activeCount?: number;
3945
3971
  /** Empties one filter in the draft: Clear inside a filter's panel. */
3946
3972
  onClearSection: (id: Id) => void;
@@ -3963,7 +3989,10 @@ interface FilterDrawerProps<Id extends string = string> extends CommonProps {
3963
3989
  * title. The page keeps the draft and renders each filter's contents;
3964
3990
  * FilterDrawer owns the list, the navigation, the slide between the two and
3965
3991
  * the footer: Clear inside a filter; Clear all, Cancel and See
3966
- * results on the list. Opened from AllFiltersButton.
3992
+ * results on the list. Opened from AllFiltersButton, which carries the
3993
+ * total. A filter with picks shows their number as a count badge (the
3994
+ * style guide's Badge, brandSolid, count) on its row and beside its title
3995
+ * in its panel.
3967
3996
  * @tokens border-t, border-b, border-border-default, px-5, py-3.5, text-sm,
3968
3997
  * font-medium, text-text-primary, text-text-secondary, text-brand-primaryAction,
3969
3998
  * hover:bg-subtle, rounded-control, focus-visible:outline-border-focus,
@@ -3996,8 +4025,7 @@ interface FilterDrawerProps<Id extends string = string> extends CommonProps {
3996
4025
  * <FilterDrawer
3997
4026
  * open={open}
3998
4027
  * onClose={() => setOpen(false)}
3999
- * activeCount={count(draft)}
4000
- * sections={[{ id: "brand", label: "Brand", icon: Package, badge: draft.brands.length ? `${draft.brands.length} selected` : null }]}
4028
+ * sections={[{ id: "brand", label: "Brand", icon: Package, count: draft.brands.length }]}
4001
4029
  * renderSection={(id) => <BrandPicker value={draft.brands} onChange={...} />}
4002
4030
  * onClearSection={(id) => setDraft((d) => ({ ...d, [id]: [] }))}
4003
4031
  * onClearAll={() => setDraft(empty)}
@@ -4005,7 +4033,7 @@ interface FilterDrawerProps<Id extends string = string> extends CommonProps {
4005
4033
  * />
4006
4034
  * ```
4007
4035
  */
4008
- declare function FilterDrawer<Id extends string>({ open, onClose, sections, renderSection, activeCount, onClearSection, onClearAll, onApply, focus, size, testIdPrefix, }: FilterDrawerProps<Id>): react.JSX.Element;
4036
+ declare function FilterDrawer<Id extends string>({ open, onClose, sections, renderSection, activeCount: _activeCount, onClearSection, onClearAll, onApply, focus, size, testIdPrefix, }: FilterDrawerProps<Id>): react.JSX.Element;
4009
4037
 
4010
4038
  interface AllFiltersButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">, CommonProps {
4011
4039
  /** Filters narrowing the page; the badge shows when above 0. */
@@ -4229,4 +4257,71 @@ interface FigureProps extends MoneyFormatOptions {
4229
4257
  }
4230
4258
  declare function Figure({ value, kind, missing, ...opts }: FigureProps): react.JSX.Element;
4231
4259
 
4232
- 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, 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, 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, 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, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, StatStrip, type StatStripProps, StatTile, type StatTileProps, 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 };
4260
+ /**
4261
+ * Whether to show a loading state: only once loading has lasted `delay` ms
4262
+ * (most loads finish sooner), and then for at least `min` ms, so it never
4263
+ * flashes.
4264
+ */
4265
+ declare function useDelayedLoading(loading: boolean, delay?: number, min?: number): boolean;
4266
+ /**
4267
+ * @pattern Skeleton
4268
+ * @since 0.60.0
4269
+ * @description The loading placeholder: a grey shape in the layout of the
4270
+ * content that's coming, with a soft shimmer. Presets draw the common
4271
+ * layouts (`SkeletonLines`, `ChartSkeleton`, `StatStripSkeleton`), and
4272
+ * `Card` and `DataTable` draw their own with `loading`. Never a spinner,
4273
+ * except inside a button.
4274
+ * @variant shape: line | block | circle
4275
+ * @tokens bg-subtle, rounded-pill, rounded-control, rounded-full
4276
+ * @a11y Decorative and hidden: the loading container carries `aria-busy`
4277
+ * (Card and DataTable set it), so screen readers hear the content once.
4278
+ * @behavior Shimmer sweeps left to right every 1.5s; under reduced motion
4279
+ * the shapes are plain grey. Use `useDelayedLoading` so a fast load shows
4280
+ * nothing and a slow one shows for at least 0.5s.
4281
+ * @use one shape per thing that's coming, in its real size and place.
4282
+ * @avoid a spinner in a card, or one big skeleton for the whole page.
4283
+ * @usage
4284
+ * ```tsx
4285
+ * <Skeleton className="h-3 w-32" />
4286
+ * <ChartSkeleton />
4287
+ * ```
4288
+ */
4289
+ interface SkeletonProps extends CommonProps {
4290
+ shape?: "line" | "block" | "circle";
4291
+ className?: string;
4292
+ style?: CSSProperties;
4293
+ }
4294
+ declare function Skeleton({ shape, className, style, testIdPrefix }: SkeletonProps): react.JSX.Element;
4295
+ /** Lines of text: the last one shorter, like a paragraph. */
4296
+ declare function SkeletonLines({ lines, className }: {
4297
+ lines?: number;
4298
+ className?: string;
4299
+ }): react.JSX.Element;
4300
+ /** A chart's area: a few bars rising from a baseline, with axis labels. */
4301
+ declare function ChartSkeleton({ className }: {
4302
+ className?: string;
4303
+ }): react.JSX.Element;
4304
+ /** The headline figures: a label and a figure per tile. Wrap in `StatStrip`'s frame or a card. */
4305
+ declare function StatStripSkeleton({ tiles, className }: {
4306
+ tiles?: number;
4307
+ className?: string;
4308
+ }): react.JSX.Element;
4309
+ /**
4310
+ * Shown under a loading card once it has taken a while: after 5s a quiet
4311
+ * line, after 30s an offer to try again.
4312
+ */
4313
+ declare function LongWait({ loading, onRetry, hint, className }: {
4314
+ loading: boolean;
4315
+ onRetry?: () => void;
4316
+ hint?: string;
4317
+ className?: string;
4318
+ }): react.JSX.Element | null;
4319
+ /** A card that couldn't load: one line and Retry, in the card's own space. */
4320
+ declare function LoadError({ onRetry, children }: {
4321
+ onRetry?: () => void;
4322
+ children?: ReactNode;
4323
+ }): react.JSX.Element;
4324
+ /** The thin moving line along a card's top edge while new data loads over old. */
4325
+ declare function RefreshLine(): react.JSX.Element;
4326
+
4327
+ 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, 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 };