@mediaradar/design-components 0.58.0 → 0.60.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 +1110 -817
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +241 -29
- package/dist/index.d.ts +241 -29
- package/dist/index.js +1037 -755
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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, 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
|
|
|
@@ -2393,7 +2406,12 @@ type SortState<K extends string> = {
|
|
|
2393
2406
|
* since the useful first look differs by column: counts and dates want the
|
|
2394
2407
|
* largest or newest first, names want A→Z.
|
|
2395
2408
|
*/
|
|
2396
|
-
declare function cycleSort<K extends string>(current: SortState<K>, key: K, firstDir?: SortDir
|
|
2409
|
+
declare function cycleSort<K extends string>(current: SortState<K>, key: K, firstDir?: SortDir,
|
|
2410
|
+
/**
|
|
2411
|
+
* The table's default sort. The third click returns here instead of to
|
|
2412
|
+
* "unsorted", so the table is never in an order nobody chose (UXD-196).
|
|
2413
|
+
*/
|
|
2414
|
+
fallback?: SortState<K>): SortState<K>;
|
|
2397
2415
|
/**
|
|
2398
2416
|
* `SortState` in the shape SortButton takes. SortButton wants a non-null
|
|
2399
2417
|
* object and reads `key: null` as "no column active".
|
|
@@ -2430,6 +2448,12 @@ interface SortButtonProps<K extends string> extends CommonProps {
|
|
|
2430
2448
|
sortable?: boolean;
|
|
2431
2449
|
/** Matches the column's alignment, so a label that wraps lines up with the cells under it. */
|
|
2432
2450
|
align?: "left" | "center" | "right";
|
|
2451
|
+
/**
|
|
2452
|
+
* What the column means, for a non-obvious measure ("Share of the set's
|
|
2453
|
+
* total spend"). The label gets a dotted underline and this shows on hover
|
|
2454
|
+
* and keyboard focus; a click still sorts. One or two sentences, plain text.
|
|
2455
|
+
*/
|
|
2456
|
+
description?: string;
|
|
2433
2457
|
/**
|
|
2434
2458
|
* Optional prefix for the button's `data-testid` (`${testIdPrefix}-sort-${sortKey}`, on the root `<button>`;
|
|
2435
2459
|
* the plain-text form for `sortable={false}` gets none). Omit for no test-id wiring.
|
|
@@ -2442,14 +2466,18 @@ interface SortButtonProps<K extends string> extends CommonProps {
|
|
|
2442
2466
|
* @status stable
|
|
2443
2467
|
* @audited 2026-11-12
|
|
2444
2468
|
* @description Design-system rule: every sortable table column header uses
|
|
2445
|
-
* this exact icon/color treatment.
|
|
2446
|
-
*
|
|
2447
|
-
*
|
|
2448
|
-
*
|
|
2449
|
-
*
|
|
2469
|
+
* this exact icon/color treatment. The sorted column always shows its
|
|
2470
|
+
* direction arrow (ArrowUp/ArrowDown) in the brand action blue, including a
|
|
2471
|
+
* table's default sort before anyone clicks. Every other sortable column's
|
|
2472
|
+
* ArrowUpDown is hidden until the header is hovered or focused (faint on
|
|
2473
|
+
* touch screens, which can't hover); its space is always kept, so nothing
|
|
2474
|
+
* shifts. A header with a `description` gets a dotted underline and shows
|
|
2475
|
+
* the description on hover and focus (UXD-196).
|
|
2476
|
+
* @tokens text-text-tertiary, text-brand-primaryAction, hover:text-text-primary, focus-visible:outline-border-focus, decoration-text-tertiary
|
|
2450
2477
|
* @dependencies lucide-react
|
|
2451
2478
|
* @behavior Pair with `cycleSort`/`sortProp` (exported alongside) for the
|
|
2452
|
-
* standard
|
|
2479
|
+
* standard cycle — sort, reverse, then back to the table's default sort
|
|
2480
|
+
* (or unsorted when it has none). `disabled` keeps
|
|
2453
2481
|
* the column's inherited header color rather than dimming it — the column
|
|
2454
2482
|
* isn't unavailable, there's just no data under it.
|
|
2455
2483
|
* `sortable={false}` renders just the label, for a column that is never
|
|
@@ -3501,8 +3529,22 @@ interface DataTableColumn<T, K extends string = string> {
|
|
|
3501
3529
|
label: string;
|
|
3502
3530
|
/** What one row shows in this column. Free content: text, a logo, a Tag, a Delta. */
|
|
3503
3531
|
cell: (row: T) => ReactNode;
|
|
3504
|
-
/**
|
|
3532
|
+
/**
|
|
3533
|
+
* Figures: amounts, counts, percentages, changes. Right-aligned (header
|
|
3534
|
+
* too), lining figures, a fixed width. Not dates: they're words now
|
|
3535
|
+
* ("Nov 4, 2026") and sit left like text.
|
|
3536
|
+
*/
|
|
3505
3537
|
numeric?: boolean;
|
|
3538
|
+
/** The rank (1, 2, 3 …) before the name: narrow, right-aligned, grey. */
|
|
3539
|
+
rank?: boolean;
|
|
3540
|
+
/**
|
|
3541
|
+
* What the column means, for a non-obvious measure only ("Share of the
|
|
3542
|
+
* set's total spend"). Dotted underline on the header; shows on hover and
|
|
3543
|
+
* focus. One or two sentences from the shared glossary.
|
|
3544
|
+
*/
|
|
3545
|
+
info?: string;
|
|
3546
|
+
/** Why a cell is empty when `cell` returns nothing. Default "No data". */
|
|
3547
|
+
missing?: string;
|
|
3506
3548
|
/**
|
|
3507
3549
|
* `fill` takes what's left (the default for text columns); `sm` 96, `md` 144
|
|
3508
3550
|
* (the default for numeric columns) and `lg` 192 are fixed.
|
|
@@ -3518,22 +3560,55 @@ interface DataTableProps<T, K extends string = string> extends CommonProps {
|
|
|
3518
3560
|
rows: T[];
|
|
3519
3561
|
/** A stable key per row -- an id, not the index. */
|
|
3520
3562
|
rowKey: (row: T) => string;
|
|
3521
|
-
/**
|
|
3563
|
+
/**
|
|
3564
|
+
* The table's title, "Top publishers". Drawn above the frame as a Section
|
|
3565
|
+
* heading, so the frame starts with the header band. With `variant="chart"`
|
|
3566
|
+
* (a dashboard) it sits inside the frame, styled like the chart Card.
|
|
3567
|
+
* Leave out for a table the page already names.
|
|
3568
|
+
*/
|
|
3522
3569
|
title?: ReactNode;
|
|
3523
|
-
/** One
|
|
3570
|
+
/** One line under the title. */
|
|
3524
3571
|
subtitle?: ReactNode;
|
|
3525
|
-
/** Right
|
|
3572
|
+
/** Right of the title: a "View all" link, an export Button. */
|
|
3526
3573
|
action?: ReactNode;
|
|
3574
|
+
/**
|
|
3575
|
+
* `chart` for a table on a dashboard, beside chart cards: the title goes
|
|
3576
|
+
* inside the frame and matches the chart Card's (15px title, subtitle,
|
|
3577
|
+
* padding). Default: the title goes above the frame.
|
|
3578
|
+
*/
|
|
3579
|
+
variant?: "default" | "chart";
|
|
3580
|
+
/** Heading level of an outside `title`. Default `h2`; `h3` under a section heading. */
|
|
3581
|
+
titleAs?: "h2" | "h3";
|
|
3527
3582
|
/** Names the table for screen readers when there's no `title`. */
|
|
3528
3583
|
"aria-label"?: string;
|
|
3529
3584
|
sort?: SortState<K>;
|
|
3530
3585
|
onSortChange?: (sort: SortState<K>) => void;
|
|
3586
|
+
/**
|
|
3587
|
+
* The order the table opens in (main figure highest first; names A–Z;
|
|
3588
|
+
* dates newest first). Its arrow shows before anyone clicks, and the third
|
|
3589
|
+
* click on a column comes back to it. Start `sort` here, and keep `sort`
|
|
3590
|
+
* in the page address so refresh and shared links keep it.
|
|
3591
|
+
*/
|
|
3592
|
+
defaultSort?: SortState<K>;
|
|
3593
|
+
/**
|
|
3594
|
+
* Rows that open in place (a trend, the top publishers). A chevron at the
|
|
3595
|
+
* start of the row opens it, and so does a click anywhere else on the row.
|
|
3596
|
+
*/
|
|
3597
|
+
renderExpanded?: (row: T) => ReactNode;
|
|
3598
|
+
/** Which rows can open. Default: every row, when `renderExpanded` is set. */
|
|
3599
|
+
canExpand?: (row: T) => boolean;
|
|
3600
|
+
/** Names a row for the chevron's screen-reader label ("Show details for Nike"). */
|
|
3601
|
+
rowLabel?: (row: T) => string;
|
|
3531
3602
|
/** `default` for tables people read and act on; `compact` for reference data and long lists. */
|
|
3532
3603
|
density?: DataTableDensity;
|
|
3533
3604
|
/** Shows skeleton rows in the real columns, at the real row height. */
|
|
3534
3605
|
loading?: boolean;
|
|
3535
3606
|
/** How many skeleton rows while `loading`. Match the page size. */
|
|
3536
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;
|
|
3537
3612
|
/** What the body shows when `rows` is empty. Defaults to NoResultsEmptyState. */
|
|
3538
3613
|
empty?: ReactNode;
|
|
3539
3614
|
/** Caps the height so the body scrolls under a pinned header: sm 320, md 480, lg 640. */
|
|
@@ -3544,48 +3619,89 @@ interface DataTableProps<T, K extends string = string> extends CommonProps {
|
|
|
3544
3619
|
/** `data-testid` on the frame; each sortable header's button gets `${testIdPrefix}-sort-<key>`. */
|
|
3545
3620
|
testIdPrefix?: string;
|
|
3546
3621
|
}
|
|
3622
|
+
/**
|
|
3623
|
+
* The grey dash for a missing value. Hover says why ("No data", "New this
|
|
3624
|
+
* period"); screen readers hear the reason, not "dash". Return it from a
|
|
3625
|
+
* `cell` for a reason other than the column's `missing`.
|
|
3626
|
+
*/
|
|
3627
|
+
declare function NoValue({ reason }: {
|
|
3628
|
+
reason?: string;
|
|
3629
|
+
}): react.JSX.Element;
|
|
3630
|
+
/**
|
|
3631
|
+
* The entity name in a row, as a real link to its overview: plain text at
|
|
3632
|
+
* rest, underlined on hover, so Cmd/Ctrl-click opens a new tab.
|
|
3633
|
+
*/
|
|
3634
|
+
declare function TableLink({ className, ...props }: AnchorHTMLAttributes<HTMLAnchorElement>): react.JSX.Element;
|
|
3547
3635
|
/**
|
|
3548
3636
|
* @pattern DataTable
|
|
3549
3637
|
* @since 0.24.0
|
|
3550
3638
|
* @status stable
|
|
3551
|
-
* @description The shared table: a card frame
|
|
3552
|
-
*
|
|
3639
|
+
* @description The shared table: a card frame that starts with the header
|
|
3640
|
+
* band (its title sits above it as a Section heading; on a dashboard,
|
|
3641
|
+
* `variant="chart"` puts it inside, like the chart Card), then rows with hairline dividers and a hover wash, and the empty
|
|
3553
3642
|
* and loading states. Each screen describes its columns -- label, cell,
|
|
3554
3643
|
* numeric, width, sortable -- and the shell draws them, so a column can't be
|
|
3555
3644
|
* mis-aligned or mis-padded. Body 13px, header 11px uppercase and
|
|
3556
3645
|
* letterspaced in secondary ink on the subtle band. Text columns fill the
|
|
3557
|
-
* width; numeric columns are fixed, right-aligned and use
|
|
3558
|
-
* figures sit together at the right edge.
|
|
3646
|
+
* width; numeric columns are fixed, right-aligned (header included) and use
|
|
3647
|
+
* lining figures, so figures sit together at the right edge. Dates are text
|
|
3648
|
+
* and sit left. A cell with nothing to show is a grey dash that says why on
|
|
3649
|
+
* hover. The default sort's arrow shows before anyone clicks. Rows can open
|
|
3650
|
+
* in place, and the name links to the entity's overview (UXD-196).
|
|
3559
3651
|
* @variant default - Default. Tables people read and act on.
|
|
3560
3652
|
* @variant compact - Reference data and long lists.
|
|
3561
3653
|
* @tokens rounded-card, border, border-border-default, bg-surface,
|
|
3562
|
-
* p-card-padding, text-
|
|
3654
|
+
* p-card-padding, text-panel-title, text-xs, text-text-tertiary, gap-3,
|
|
3563
3655
|
* text-left, border-collapse, bg-subtle, text-micro, font-semibold, uppercase,
|
|
3564
3656
|
* tracking-wider, text-text-secondary, text-right, text-dense,
|
|
3565
3657
|
* text-text-primary, hover:bg-subtle, tabular-nums, rounded-full,
|
|
3566
|
-
* animate-pulse, border-t
|
|
3658
|
+
* animate-pulse, border-t, decoration-text-tertiary, rounded-control,
|
|
3659
|
+
* focus-visible:outline-border-focus
|
|
3567
3660
|
* @behavior Sorting: a `sortable` column's header gets a SortButton; clicks
|
|
3568
|
-
* cycle the column's `firstDir`, then the reverse, then
|
|
3569
|
-
* (`cycleSort`), and call `onSortChange`. The
|
|
3661
|
+
* cycle the column's `firstDir`, then the reverse, then back to
|
|
3662
|
+
* `defaultSort` (`cycleSort`), and call `onSortChange`. The sorted column
|
|
3663
|
+
* always shows its arrow; the others show theirs on hover and focus. The table doesn't sort the rows
|
|
3570
3664
|
* itself: sort them before passing `rows`. `loading` keeps the header and
|
|
3571
3665
|
* draws `loadingRows` skeleton rows. An empty `rows` keeps the header and
|
|
3572
3666
|
* shows `empty` in one cell across every column, padded 48px top and bottom
|
|
3573
|
-
* and 24px at the sides (pass a bare stack such as NoResultsEmptyState).
|
|
3667
|
+
* and 24px at the sides (pass a bare stack such as NoResultsEmptyState).
|
|
3668
|
+
* A `cell` that returns nothing shows `NoValue` with the column's `missing`
|
|
3669
|
+
* reason ("No data"); return `<NoValue reason="New this period" />` for
|
|
3670
|
+
* another reason. A real zero is "0", never a dash.
|
|
3671
|
+
* With `renderExpanded`, a chevron at the row's start opens the row; a click
|
|
3672
|
+
* anywhere else on it does too, except on its own controls (links, buttons,
|
|
3673
|
+
* checkboxes, menus) or while selecting text. Several rows can be open;
|
|
3674
|
+
* sorting or paging closes them. Rows that can't open have no pointer.
|
|
3675
|
+
* `maxHeight` makes the body
|
|
3574
3676
|
* scroll under a pinned header; wide tables always scroll sideways rather than
|
|
3575
3677
|
* squeeze.
|
|
3576
3678
|
* @a11y A real <table>. Named by `title` (aria-labelledby) or `aria-label`.
|
|
3577
3679
|
* Sorted columns carry aria-sort on the header cell; the sort control is a
|
|
3578
|
-
* button inside it. `
|
|
3680
|
+
* button inside it. A header's `info` shows on hover and keyboard focus and
|
|
3681
|
+
* is announced with it. The row's chevron is a button with aria-expanded and
|
|
3682
|
+
* a label naming the row ("Show details for Nike"); the row click is only a
|
|
3683
|
+
* shortcut for it. `NoValue` reads its reason, not "dash". `loading` sets aria-busy.
|
|
3579
3684
|
* @use for every table of rows and columns, in a page or in a card.
|
|
3580
|
-
* @use `title`
|
|
3685
|
+
* @use `title` for the table's name: it sits above the frame as a Section
|
|
3686
|
+
* heading, with `subtitle` and `action` beside it. On a dashboard, beside
|
|
3687
|
+
* chart cards, add `variant="chart"` to put it inside, matching them. The table runs edge to edge;
|
|
3581
3688
|
* never put it inside a padded Card.
|
|
3582
|
-
* @use `numeric` for amounts, counts, percentages and dates,
|
|
3583
|
-
*
|
|
3689
|
+
* @use `numeric` for amounts, counts, percentages and changes (not dates),
|
|
3690
|
+
* written by `formatMoney` / `formatCount` / `formatPercent`, and `Delta` in
|
|
3691
|
+
* the cell of a change column. A bar or badge beside a figure goes before
|
|
3692
|
+
* it, so the figure ends at the right edge.
|
|
3693
|
+
* @use `rank` for a 1, 2, 3 … column before the name.
|
|
3694
|
+
* @use a total column right after the name, styled like every other figure:
|
|
3695
|
+
* no fill, no bold.
|
|
3696
|
+
* @use `info` only for non-obvious measures (share of spend, index), never
|
|
3697
|
+
* an icon in the header.
|
|
3698
|
+
* @use `TableLink` for the name, to the entity's overview; end an expanded
|
|
3699
|
+
* row with a "View overview" link.
|
|
3584
3700
|
* @use `footer={<Pager />}` in a card; `TablePagination` after a full-page table.
|
|
3585
3701
|
* @avoid a hand-built <table> -- the padding and header drift is what this
|
|
3586
3702
|
* replaces.
|
|
3587
|
-
* @avoid zebra stripes or a
|
|
3588
|
-
*
|
|
3703
|
+
* @avoid zebra stripes, or a row click that navigates: a row click only
|
|
3704
|
+
* opens the row, and only the name goes to another page.
|
|
3589
3705
|
* @avoid a layout of label/value pairs -- that's a description list, not a table.
|
|
3590
3706
|
* @usage
|
|
3591
3707
|
* ```tsx
|
|
@@ -3604,7 +3720,7 @@ interface DataTableProps<T, K extends string = string> extends CommonProps {
|
|
|
3604
3720
|
* />
|
|
3605
3721
|
* ```
|
|
3606
3722
|
*/
|
|
3607
|
-
declare function DataTable<T, K extends string = string>({ columns, rows, rowKey, title, subtitle, action, sort, onSortChange, 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;
|
|
3608
3724
|
|
|
3609
3725
|
type MediaType = "TV" | "CTV" | "Digital" | "Social" | "Radio" | "Newspaper" | "Magazine";
|
|
3610
3726
|
interface MediaLabelProps extends CommonProps {
|
|
@@ -4101,4 +4217,100 @@ declare function formatMoneyFull(value: number | null | undefined, opts?: MoneyF
|
|
|
4101
4217
|
*/
|
|
4102
4218
|
declare function formatPercent(value: number | null | undefined, _opts?: NumberFormatOptions): string;
|
|
4103
4219
|
|
|
4104
|
-
|
|
4220
|
+
/**
|
|
4221
|
+
* @pattern Figure
|
|
4222
|
+
* @since 0.59.0
|
|
4223
|
+
* @description One amount or count, written short ("$448.7M") with the full
|
|
4224
|
+
* figure ("$448,700,000") on hover, as the numbers rule (COPY-04) asks
|
|
4225
|
+
* wherever a figure is shortened. Figures under 10,000 are already in full
|
|
4226
|
+
* and get no hover. A missing value is the grey dash with its reason.
|
|
4227
|
+
* @variant kind: money | count
|
|
4228
|
+
* @tokens text-text-tertiary
|
|
4229
|
+
* @dependencies Tooltip, NoValue
|
|
4230
|
+
* @a11y Screen readers hear the full figure, not the short one: "$448.7M"
|
|
4231
|
+
* could be read as "448.7 meters".
|
|
4232
|
+
* @use in table cells, KPI tiles and cards: anywhere a single amount or count shows.
|
|
4233
|
+
* @avoid writing figures by hand or with `toLocaleString`.
|
|
4234
|
+
* @usage
|
|
4235
|
+
* ```tsx
|
|
4236
|
+
* <Figure value={448_700_000} />
|
|
4237
|
+
* <Figure value={12_400} kind="count" language="en-GB" />
|
|
4238
|
+
* ```
|
|
4239
|
+
*/
|
|
4240
|
+
interface FigureProps extends MoneyFormatOptions {
|
|
4241
|
+
value: number | null | undefined;
|
|
4242
|
+
/** `money` (default) or `count`. */
|
|
4243
|
+
kind?: "money" | "count";
|
|
4244
|
+
/** Why the value is missing, when it is. Default "No data". */
|
|
4245
|
+
missing?: string;
|
|
4246
|
+
}
|
|
4247
|
+
declare function Figure({ value, kind, missing, ...opts }: FigureProps): react.JSX.Element;
|
|
4248
|
+
|
|
4249
|
+
/**
|
|
4250
|
+
* Whether to show a loading state: only once loading has lasted `delay` ms
|
|
4251
|
+
* (most loads finish sooner), and then for at least `min` ms, so it never
|
|
4252
|
+
* flashes.
|
|
4253
|
+
*/
|
|
4254
|
+
declare function useDelayedLoading(loading: boolean, delay?: number, min?: number): boolean;
|
|
4255
|
+
/**
|
|
4256
|
+
* @pattern Skeleton
|
|
4257
|
+
* @since 0.60.0
|
|
4258
|
+
* @description The loading placeholder: a grey shape in the layout of the
|
|
4259
|
+
* content that's coming, with a soft shimmer. Presets draw the common
|
|
4260
|
+
* layouts (`SkeletonLines`, `ChartSkeleton`, `StatStripSkeleton`), and
|
|
4261
|
+
* `Card` and `DataTable` draw their own with `loading`. Never a spinner,
|
|
4262
|
+
* except inside a button.
|
|
4263
|
+
* @variant shape: line | block | circle
|
|
4264
|
+
* @tokens bg-subtle, rounded-pill, rounded-control, rounded-full
|
|
4265
|
+
* @a11y Decorative and hidden: the loading container carries `aria-busy`
|
|
4266
|
+
* (Card and DataTable set it), so screen readers hear the content once.
|
|
4267
|
+
* @behavior Shimmer sweeps left to right every 1.5s; under reduced motion
|
|
4268
|
+
* the shapes are plain grey. Use `useDelayedLoading` so a fast load shows
|
|
4269
|
+
* nothing and a slow one shows for at least 0.5s.
|
|
4270
|
+
* @use one shape per thing that's coming, in its real size and place.
|
|
4271
|
+
* @avoid a spinner in a card, or one big skeleton for the whole page.
|
|
4272
|
+
* @usage
|
|
4273
|
+
* ```tsx
|
|
4274
|
+
* <Skeleton className="h-3 w-32" />
|
|
4275
|
+
* <ChartSkeleton />
|
|
4276
|
+
* ```
|
|
4277
|
+
*/
|
|
4278
|
+
interface SkeletonProps extends CommonProps {
|
|
4279
|
+
shape?: "line" | "block" | "circle";
|
|
4280
|
+
className?: string;
|
|
4281
|
+
style?: CSSProperties;
|
|
4282
|
+
}
|
|
4283
|
+
declare function Skeleton({ shape, className, style, testIdPrefix }: SkeletonProps): react.JSX.Element;
|
|
4284
|
+
/** Lines of text: the last one shorter, like a paragraph. */
|
|
4285
|
+
declare function SkeletonLines({ lines, className }: {
|
|
4286
|
+
lines?: number;
|
|
4287
|
+
className?: string;
|
|
4288
|
+
}): react.JSX.Element;
|
|
4289
|
+
/** A chart's area: a few bars rising from a baseline, with axis labels. */
|
|
4290
|
+
declare function ChartSkeleton({ className }: {
|
|
4291
|
+
className?: string;
|
|
4292
|
+
}): react.JSX.Element;
|
|
4293
|
+
/** The headline figures: a label and a figure per tile. Wrap in `StatStrip`'s frame or a card. */
|
|
4294
|
+
declare function StatStripSkeleton({ tiles, className }: {
|
|
4295
|
+
tiles?: number;
|
|
4296
|
+
className?: string;
|
|
4297
|
+
}): react.JSX.Element;
|
|
4298
|
+
/**
|
|
4299
|
+
* Shown under a loading card once it has taken a while: after 5s a quiet
|
|
4300
|
+
* line, after 30s an offer to try again.
|
|
4301
|
+
*/
|
|
4302
|
+
declare function LongWait({ loading, onRetry, hint, className }: {
|
|
4303
|
+
loading: boolean;
|
|
4304
|
+
onRetry?: () => void;
|
|
4305
|
+
hint?: string;
|
|
4306
|
+
className?: string;
|
|
4307
|
+
}): react.JSX.Element | null;
|
|
4308
|
+
/** A card that couldn't load: one line and Retry, in the card's own space. */
|
|
4309
|
+
declare function LoadError({ onRetry, children }: {
|
|
4310
|
+
onRetry?: () => void;
|
|
4311
|
+
children?: ReactNode;
|
|
4312
|
+
}): react.JSX.Element;
|
|
4313
|
+
/** The thin moving line along a card's top edge while new data loads over old. */
|
|
4314
|
+
declare function RefreshLine(): react.JSX.Element;
|
|
4315
|
+
|
|
4316
|
+
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 };
|