@mediaradar/design-components 0.15.0 → 0.16.1
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 +542 -478
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +114 -20
- package/dist/index.d.ts +114 -20
- package/dist/index.js +514 -451
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -229,6 +229,60 @@ interface BadgeProps {
|
|
|
229
229
|
*/
|
|
230
230
|
declare function Badge({ tone, kind, dot, children, className }: BadgeProps): react.JSX.Element;
|
|
231
231
|
|
|
232
|
+
interface DeltaProps {
|
|
233
|
+
/** The change itself. Its sign picks the direction; render the absolute value. */
|
|
234
|
+
value: number;
|
|
235
|
+
/** What the number is in -- "%" for a percentage, "pts" for share points. */
|
|
236
|
+
suffix?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Adds a direction arrow before the number. For a column of deltas scanned
|
|
239
|
+
* rather than read, where the arrow is what the eye follows. A single delta
|
|
240
|
+
* beside a figure does not need one -- the sign already says which way.
|
|
241
|
+
*/
|
|
242
|
+
arrow?: boolean;
|
|
243
|
+
/** Appended after the suffix, e.g. "YoY". Keep it to one or two words. */
|
|
244
|
+
period?: string;
|
|
245
|
+
className?: string;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @pattern Delta
|
|
249
|
+
* @description A change over time -- the +6.2% / -2.1% beside a figure. Green
|
|
250
|
+
* up, red down, always with an explicit sign.
|
|
251
|
+
* @props
|
|
252
|
+
* value: number -- sign picks the direction
|
|
253
|
+
* suffix?: string -- "%" or "pts"
|
|
254
|
+
* arrow?: boolean (default false) -- direction arrow, for a column scanned rather than read
|
|
255
|
+
* period?: string -- e.g. "YoY"
|
|
256
|
+
* @tokens text-text-success, text-text-danger
|
|
257
|
+
* @dependencies lucide-react
|
|
258
|
+
* @behavior Takes the type size of whatever contains it rather than setting
|
|
259
|
+
* its own, because it is inline text inside a table cell or a card rather
|
|
260
|
+
* than a box of its own -- a fixed size would fight the density its table
|
|
261
|
+
* already chose.
|
|
262
|
+
* @a11y The sign is the point: colour alone cannot carry direction, for
|
|
263
|
+
* anyone who cannot distinguish the two and for anyone reading it printed or
|
|
264
|
+
* in greyscale. `+` and `-` are always rendered, so the colour is
|
|
265
|
+
* reinforcement rather than the only signal. The arrow is decorative and
|
|
266
|
+
* hidden, since the sign beside it already says the same thing.
|
|
267
|
+
* @use when showing a change against a previous period beside the figure it
|
|
268
|
+
* relates to.
|
|
269
|
+
* @use with `arrow` when deltas run down a column and the reader is scanning
|
|
270
|
+
* for the ones that moved.
|
|
271
|
+
* @avoid when the number is not a change -- a share, a total or a rate is
|
|
272
|
+
* just a number, and colouring it green or red tells the reader something
|
|
273
|
+
* untrue about it.
|
|
274
|
+
* @avoid when up is not good. Green-for-up reads as green-for-better, so a
|
|
275
|
+
* rising cost or a rising error rate needs its own treatment rather than this
|
|
276
|
+
* one inverted, which nobody will notice.
|
|
277
|
+
* @usage
|
|
278
|
+
* ```tsx
|
|
279
|
+
* <Delta value={6.2} suffix="%" />
|
|
280
|
+
* <Delta value={-2.1} suffix="%" period="YoY" />
|
|
281
|
+
* <Delta value={1.4} suffix="pts" arrow />
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
declare function Delta({ value, suffix, arrow, period, className }: DeltaProps): react.JSX.Element;
|
|
285
|
+
|
|
232
286
|
/**
|
|
233
287
|
* @pattern CheckBox
|
|
234
288
|
* @description Tri-state checkbox rendered as a `<button>` (not a native
|
|
@@ -882,7 +936,9 @@ declare function BarChartPlaceholder({ height }: BarChartPlaceholderProps): reac
|
|
|
882
936
|
* the card, and a stretched `<circle>` would go oval. Same no-results use
|
|
883
937
|
* as `BarChartPlaceholder` -- no real value ever appears, and the shape
|
|
884
938
|
* holds the card's layout steady so nothing jumps when real data arrives.
|
|
885
|
-
*
|
|
939
|
+
* Paths and points share the `bg-subtle` fill of the axis labels, so the
|
|
940
|
+
* whole placeholder reads as one tint, the way the bars do.
|
|
941
|
+
* @tokens bg-subtle, border-border-default, rounded-xs
|
|
886
942
|
* @behavior Purely presentational -- `role="presentation"` and
|
|
887
943
|
* `aria-hidden="true"` throughout (inherited from `AxisFrame`). The series
|
|
888
944
|
* count and shapes are fixed; `height` is the only variable.
|
|
@@ -909,10 +965,11 @@ declare function LineChartPlaceholder({ height }: LineChartPlaceholderProps): re
|
|
|
909
965
|
* `BarChartPlaceholder`: an unsatisfiable filter reads as "a chart belongs
|
|
910
966
|
* here" rather than a failed load, with no real value (names, media types,
|
|
911
967
|
* dollar amounts, percentages, series colors) ever appearing.
|
|
912
|
-
* @tokens bg-subtle,
|
|
968
|
+
* @tokens bg-subtle, bg-surface, rounded-xs
|
|
913
969
|
* @behavior Purely presentational -- `role="presentation"` and
|
|
914
970
|
* `aria-hidden="true"` throughout. `legendRows` controls the blank legend
|
|
915
|
-
* only; the disc's seam count is a fixed shape.
|
|
971
|
+
* only; the disc's seam count is a fixed shape. Seams are cut in the
|
|
972
|
+
* card's `bg-surface` color, as `StackedColumnPlaceholder`'s bands are.
|
|
916
973
|
* @a11y role="presentation" with aria-hidden marks: it is a visual stand-in with
|
|
917
974
|
* no data, deliberately invisible to assistive tech. Don't add a caption
|
|
918
975
|
* expecting it to be announced.
|
|
@@ -938,12 +995,12 @@ declare function PieChartPlaceholder({ height, legendRows }: PieChartPlaceholder
|
|
|
938
995
|
* `axis`, a bare stack with no scale (e.g. a share-of-voice column) omits
|
|
939
996
|
* it. Same no-results use as `BarChartPlaceholder` -- no real value ever
|
|
940
997
|
* appears, and the shape holds the card's layout steady.
|
|
941
|
-
* @tokens bg-subtle,
|
|
998
|
+
* @tokens bg-subtle, bg-surface, border-border-default, rounded-control
|
|
942
999
|
* @behavior Purely presentational -- `role="presentation"` and
|
|
943
|
-
* `aria-hidden="true"` throughout. Band seams
|
|
944
|
-
* rather than
|
|
945
|
-
* `bg-subtle` fill
|
|
946
|
-
*
|
|
1000
|
+
* `aria-hidden="true"` throughout. Band seams are 1px gaps in the card's
|
|
1001
|
+
* `bg-surface` color rather than a border tone: a `border-border-default`
|
|
1002
|
+
* seam disappears on the `bg-subtle` fill, and `border-border-strong` reads
|
|
1003
|
+
* darker than the rest of the placeholder. Legend rows are reversed (bottom-up) when `axis`
|
|
947
1004
|
* is off, matching a bare stack's usual bottom-anchored reading order.
|
|
948
1005
|
* @a11y role="presentation" with aria-hidden marks: a visual stand-in with no
|
|
949
1006
|
* data, deliberately invisible to assistive tech.
|
|
@@ -1409,8 +1466,9 @@ interface PublisherBreakdownListProps {
|
|
|
1409
1466
|
declare function PublisherBreakdownList({ rows, defaultVisibleCount, padded, viewAllHref, renderLogo }: PublisherBreakdownListProps): react.JSX.Element;
|
|
1410
1467
|
|
|
1411
1468
|
declare const buttonVariants: (props?: ({
|
|
1412
|
-
variant?: "link" | "danger" | "primary" | "secondary" | "ghost" | null | undefined;
|
|
1413
|
-
size?: "
|
|
1469
|
+
variant?: "link" | "danger" | "primary" | "secondary" | "ghost" | "dangerGhost" | null | undefined;
|
|
1470
|
+
size?: "xs" | "sm" | "md" | null | undefined;
|
|
1471
|
+
iconOnly?: boolean | null | undefined;
|
|
1414
1472
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1415
1473
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
1416
1474
|
/**
|
|
@@ -1433,18 +1491,21 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantPr
|
|
|
1433
1491
|
}
|
|
1434
1492
|
/**
|
|
1435
1493
|
* @pattern Button
|
|
1436
|
-
* @description
|
|
1437
|
-
*
|
|
1494
|
+
* @description The one control for every clickable action, from the main call
|
|
1495
|
+
* to action on a screen down to a quiet toolbar utility. Six variants
|
|
1496
|
+
* (primary, secondary, ghost, danger, dangerGhost, link) across three sizes
|
|
1497
|
+
* (xs, sm, md), labelled or icon-only.
|
|
1438
1498
|
* Supports polymorphic rendering via `asChild` (Radix Slot) to apply button
|
|
1439
1499
|
* styling to a different element, e.g. a router `<Link>`. Also exports the
|
|
1440
1500
|
* raw `buttonVariants` cva function for consumers composing button styling
|
|
1441
1501
|
* onto something other than this component.
|
|
1442
|
-
* @tokens bg-brand-primaryAction, text-brand-onprimary, bg-surface, text-text-primary, border-border-interactive, hover:bg-subtle, bg-status-danger, text-status-onstatus, text-text-link, rounded-control, duration-(--mr-motion-duration-interactive), ease-interactive
|
|
1502
|
+
* @tokens bg-brand-primaryAction, text-brand-onprimary, bg-surface, text-text-primary, border-border-strong, hover:border-border-interactive, hover:bg-subtle, bg-status-danger, text-status-onstatus, text-text-secondary, hover:text-text-danger, text-text-link, rounded-control, duration-(--mr-motion-duration-interactive), ease-interactive
|
|
1443
1503
|
* @dependencies class-variance-authority, @radix-ui/react-slot, lucide-react
|
|
1444
1504
|
* @variant primary - The one primary action on a screen. Solid brand fill.
|
|
1445
1505
|
* @variant secondary - Any other real action competing for attention (Cancel, Export). Bordered, neutral fill.
|
|
1446
1506
|
* @variant ghost - Low-emphasis action inside a dense toolbar or row where a border would add visual noise.
|
|
1447
|
-
* @variant danger -
|
|
1507
|
+
* @variant danger - Filled red. Only for a confirmed destructive action, typically the confirm button in a dialog. Never pair with `primary` in the same control group.
|
|
1508
|
+
* @variant dangerGhost - Neutral at rest, red on hover. For a destructive affordance inline in a row or toolbar -- what the product reaches for far more often than filled danger.
|
|
1448
1509
|
* @variant link - Reads as inline text, not a control. Use inside body copy or where a full button would overpower the surrounding content.
|
|
1449
1510
|
* @behavior `disabled` removes pointer events entirely (not just a style
|
|
1450
1511
|
* change) and dims to 40% opacity. Focus handling is a deliberate exception:
|
|
@@ -1461,9 +1522,29 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantPr
|
|
|
1461
1522
|
* (with `asChild`, the child element's own semantics apply instead).
|
|
1462
1523
|
* `loading` sets aria-busy, and the spinner is aria-hidden. Icon-only
|
|
1463
1524
|
* usage needs an aria-label from the caller -- nothing here supplies one.
|
|
1525
|
+
* @use when the user is triggering an action in place -- saving, applying,
|
|
1526
|
+
* confirming, opening a dialog, running an export.
|
|
1527
|
+
* @use when you need a destructive affordance: dangerGhost inline in a row or
|
|
1528
|
+
* toolbar, danger only as the confirm button in a dialog already opened.
|
|
1529
|
+
* @use when an action sits inside a sentence -- variant="link", which drops
|
|
1530
|
+
* the box and the semibold weight so it does not read as emphasis.
|
|
1531
|
+
* @use when the action is icon-only in a dense toolbar -- iconOnly squares the
|
|
1532
|
+
* box at whichever size you picked, so it lines up with labelled buttons
|
|
1533
|
+
* beside it. Supply an aria-label; nothing here does.
|
|
1534
|
+
* @avoid when the control navigates to a different route -- render a real link
|
|
1535
|
+
* via asChild, so middle-click, right-click and open-in-new-tab keep working.
|
|
1536
|
+
* variant="link" styles a button as text; it does not make a button a link.
|
|
1537
|
+
* @avoid when there is already a primary on the screen -- a second primary
|
|
1538
|
+
* means neither reads as the main action. Use secondary or ghost.
|
|
1539
|
+
* @avoid when the control toggles a persistent on/off state -- use CheckBox or
|
|
1540
|
+
* a switch. A button fires; it does not hold a state.
|
|
1541
|
+
* @avoid when you are about to hand-roll a button with raw classes. There is
|
|
1542
|
+
* no case this does not cover, and every copy is a divergence in hover, focus,
|
|
1543
|
+
* disabled and loading behaviour at once.
|
|
1464
1544
|
* @usage
|
|
1465
1545
|
* ```tsx
|
|
1466
1546
|
* <Button variant="primary" size="md">Save changes</Button>
|
|
1547
|
+
* <Button variant="dangerGhost" size="sm" iconOnly aria-label="Remove row"><X size={15} /></Button>
|
|
1467
1548
|
* <Button variant="secondary" size="sm">Cancel</Button>
|
|
1468
1549
|
* <Button variant="danger">Delete</Button>
|
|
1469
1550
|
* <Button variant="primary" loading>Saving…</Button>
|
|
@@ -1748,11 +1829,24 @@ interface TagProps {
|
|
|
1748
1829
|
}
|
|
1749
1830
|
/**
|
|
1750
1831
|
* @pattern Tag
|
|
1751
|
-
* @description Canonical descriptive tag
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
1754
|
-
*
|
|
1755
|
-
*
|
|
1832
|
+
* @description Canonical descriptive tag -- a neutral chip naming what a
|
|
1833
|
+
* thing IS: a category, a media type, a focus area. Always neutral, never
|
|
1834
|
+
* semantic, never removable.
|
|
1835
|
+
*
|
|
1836
|
+
* The product separates three jobs that most systems collapse into one, by
|
|
1837
|
+
* who authored the label. Badge is the system's view of a thing (status,
|
|
1838
|
+
* count, AI-generated) and its colour means something. Tag is the thing
|
|
1839
|
+
* describing itself, and stays neutral. FilterChipBar is the user describing
|
|
1840
|
+
* what they want to see, and is the only one you can remove.
|
|
1841
|
+
* @use when labelling what something is -- a category, a media type, a focus
|
|
1842
|
+
* area, a property of the row rather than a judgement about it.
|
|
1843
|
+
* @avoid when the colour would mean something. A status, a count, an
|
|
1844
|
+
* AI marker or anything the system decided is a Badge.
|
|
1845
|
+
* @avoid when the user should be able to dismiss it. An applied filter is a
|
|
1846
|
+
* FilterChipBar chip, which belongs to the filter bar rather than to the row.
|
|
1847
|
+
* @avoid when there are more than a handful in a row. Tags are scanned, and a
|
|
1848
|
+
* dozen neutral chips read as texture rather than as information.
|
|
1849
|
+
* @tokens text-micro, bg-subtle, text-text-tertiary, rounded-full
|
|
1756
1850
|
* @usage
|
|
1757
1851
|
* ```tsx
|
|
1758
1852
|
* <Tag>Digital</Tag>
|
|
@@ -2014,4 +2108,4 @@ interface FreshnessProps {
|
|
|
2014
2108
|
*/
|
|
2015
2109
|
declare function Freshness({ level }: FreshnessProps): react.JSX.Element;
|
|
2016
2110
|
|
|
2017
|
-
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, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, LineChartPlaceholder, type LineChartPlaceholderProps, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, SectionRail, type SectionRailProps, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, type SummaryGroup, type SummaryGroupItemValue, TablePagination, type TablePaginationProps, Tag, type TagProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, buttonVariants, chipTriggerClass, cycleSort, noResultsBody, resolveRange, sortProp };
|
|
2111
|
+
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, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, LineChartPlaceholder, type LineChartPlaceholderProps, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, SectionRail, type SectionRailProps, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, type SummaryGroup, type SummaryGroupItemValue, TablePagination, type TablePaginationProps, Tag, type TagProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, buttonVariants, chipTriggerClass, cycleSort, noResultsBody, resolveRange, sortProp };
|
package/dist/index.d.ts
CHANGED
|
@@ -229,6 +229,60 @@ interface BadgeProps {
|
|
|
229
229
|
*/
|
|
230
230
|
declare function Badge({ tone, kind, dot, children, className }: BadgeProps): react.JSX.Element;
|
|
231
231
|
|
|
232
|
+
interface DeltaProps {
|
|
233
|
+
/** The change itself. Its sign picks the direction; render the absolute value. */
|
|
234
|
+
value: number;
|
|
235
|
+
/** What the number is in -- "%" for a percentage, "pts" for share points. */
|
|
236
|
+
suffix?: string;
|
|
237
|
+
/**
|
|
238
|
+
* Adds a direction arrow before the number. For a column of deltas scanned
|
|
239
|
+
* rather than read, where the arrow is what the eye follows. A single delta
|
|
240
|
+
* beside a figure does not need one -- the sign already says which way.
|
|
241
|
+
*/
|
|
242
|
+
arrow?: boolean;
|
|
243
|
+
/** Appended after the suffix, e.g. "YoY". Keep it to one or two words. */
|
|
244
|
+
period?: string;
|
|
245
|
+
className?: string;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* @pattern Delta
|
|
249
|
+
* @description A change over time -- the +6.2% / -2.1% beside a figure. Green
|
|
250
|
+
* up, red down, always with an explicit sign.
|
|
251
|
+
* @props
|
|
252
|
+
* value: number -- sign picks the direction
|
|
253
|
+
* suffix?: string -- "%" or "pts"
|
|
254
|
+
* arrow?: boolean (default false) -- direction arrow, for a column scanned rather than read
|
|
255
|
+
* period?: string -- e.g. "YoY"
|
|
256
|
+
* @tokens text-text-success, text-text-danger
|
|
257
|
+
* @dependencies lucide-react
|
|
258
|
+
* @behavior Takes the type size of whatever contains it rather than setting
|
|
259
|
+
* its own, because it is inline text inside a table cell or a card rather
|
|
260
|
+
* than a box of its own -- a fixed size would fight the density its table
|
|
261
|
+
* already chose.
|
|
262
|
+
* @a11y The sign is the point: colour alone cannot carry direction, for
|
|
263
|
+
* anyone who cannot distinguish the two and for anyone reading it printed or
|
|
264
|
+
* in greyscale. `+` and `-` are always rendered, so the colour is
|
|
265
|
+
* reinforcement rather than the only signal. The arrow is decorative and
|
|
266
|
+
* hidden, since the sign beside it already says the same thing.
|
|
267
|
+
* @use when showing a change against a previous period beside the figure it
|
|
268
|
+
* relates to.
|
|
269
|
+
* @use with `arrow` when deltas run down a column and the reader is scanning
|
|
270
|
+
* for the ones that moved.
|
|
271
|
+
* @avoid when the number is not a change -- a share, a total or a rate is
|
|
272
|
+
* just a number, and colouring it green or red tells the reader something
|
|
273
|
+
* untrue about it.
|
|
274
|
+
* @avoid when up is not good. Green-for-up reads as green-for-better, so a
|
|
275
|
+
* rising cost or a rising error rate needs its own treatment rather than this
|
|
276
|
+
* one inverted, which nobody will notice.
|
|
277
|
+
* @usage
|
|
278
|
+
* ```tsx
|
|
279
|
+
* <Delta value={6.2} suffix="%" />
|
|
280
|
+
* <Delta value={-2.1} suffix="%" period="YoY" />
|
|
281
|
+
* <Delta value={1.4} suffix="pts" arrow />
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
declare function Delta({ value, suffix, arrow, period, className }: DeltaProps): react.JSX.Element;
|
|
285
|
+
|
|
232
286
|
/**
|
|
233
287
|
* @pattern CheckBox
|
|
234
288
|
* @description Tri-state checkbox rendered as a `<button>` (not a native
|
|
@@ -882,7 +936,9 @@ declare function BarChartPlaceholder({ height }: BarChartPlaceholderProps): reac
|
|
|
882
936
|
* the card, and a stretched `<circle>` would go oval. Same no-results use
|
|
883
937
|
* as `BarChartPlaceholder` -- no real value ever appears, and the shape
|
|
884
938
|
* holds the card's layout steady so nothing jumps when real data arrives.
|
|
885
|
-
*
|
|
939
|
+
* Paths and points share the `bg-subtle` fill of the axis labels, so the
|
|
940
|
+
* whole placeholder reads as one tint, the way the bars do.
|
|
941
|
+
* @tokens bg-subtle, border-border-default, rounded-xs
|
|
886
942
|
* @behavior Purely presentational -- `role="presentation"` and
|
|
887
943
|
* `aria-hidden="true"` throughout (inherited from `AxisFrame`). The series
|
|
888
944
|
* count and shapes are fixed; `height` is the only variable.
|
|
@@ -909,10 +965,11 @@ declare function LineChartPlaceholder({ height }: LineChartPlaceholderProps): re
|
|
|
909
965
|
* `BarChartPlaceholder`: an unsatisfiable filter reads as "a chart belongs
|
|
910
966
|
* here" rather than a failed load, with no real value (names, media types,
|
|
911
967
|
* dollar amounts, percentages, series colors) ever appearing.
|
|
912
|
-
* @tokens bg-subtle,
|
|
968
|
+
* @tokens bg-subtle, bg-surface, rounded-xs
|
|
913
969
|
* @behavior Purely presentational -- `role="presentation"` and
|
|
914
970
|
* `aria-hidden="true"` throughout. `legendRows` controls the blank legend
|
|
915
|
-
* only; the disc's seam count is a fixed shape.
|
|
971
|
+
* only; the disc's seam count is a fixed shape. Seams are cut in the
|
|
972
|
+
* card's `bg-surface` color, as `StackedColumnPlaceholder`'s bands are.
|
|
916
973
|
* @a11y role="presentation" with aria-hidden marks: it is a visual stand-in with
|
|
917
974
|
* no data, deliberately invisible to assistive tech. Don't add a caption
|
|
918
975
|
* expecting it to be announced.
|
|
@@ -938,12 +995,12 @@ declare function PieChartPlaceholder({ height, legendRows }: PieChartPlaceholder
|
|
|
938
995
|
* `axis`, a bare stack with no scale (e.g. a share-of-voice column) omits
|
|
939
996
|
* it. Same no-results use as `BarChartPlaceholder` -- no real value ever
|
|
940
997
|
* appears, and the shape holds the card's layout steady.
|
|
941
|
-
* @tokens bg-subtle,
|
|
998
|
+
* @tokens bg-subtle, bg-surface, border-border-default, rounded-control
|
|
942
999
|
* @behavior Purely presentational -- `role="presentation"` and
|
|
943
|
-
* `aria-hidden="true"` throughout. Band seams
|
|
944
|
-
* rather than
|
|
945
|
-
* `bg-subtle` fill
|
|
946
|
-
*
|
|
1000
|
+
* `aria-hidden="true"` throughout. Band seams are 1px gaps in the card's
|
|
1001
|
+
* `bg-surface` color rather than a border tone: a `border-border-default`
|
|
1002
|
+
* seam disappears on the `bg-subtle` fill, and `border-border-strong` reads
|
|
1003
|
+
* darker than the rest of the placeholder. Legend rows are reversed (bottom-up) when `axis`
|
|
947
1004
|
* is off, matching a bare stack's usual bottom-anchored reading order.
|
|
948
1005
|
* @a11y role="presentation" with aria-hidden marks: a visual stand-in with no
|
|
949
1006
|
* data, deliberately invisible to assistive tech.
|
|
@@ -1409,8 +1466,9 @@ interface PublisherBreakdownListProps {
|
|
|
1409
1466
|
declare function PublisherBreakdownList({ rows, defaultVisibleCount, padded, viewAllHref, renderLogo }: PublisherBreakdownListProps): react.JSX.Element;
|
|
1410
1467
|
|
|
1411
1468
|
declare const buttonVariants: (props?: ({
|
|
1412
|
-
variant?: "link" | "danger" | "primary" | "secondary" | "ghost" | null | undefined;
|
|
1413
|
-
size?: "
|
|
1469
|
+
variant?: "link" | "danger" | "primary" | "secondary" | "ghost" | "dangerGhost" | null | undefined;
|
|
1470
|
+
size?: "xs" | "sm" | "md" | null | undefined;
|
|
1471
|
+
iconOnly?: boolean | null | undefined;
|
|
1414
1472
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1415
1473
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
1416
1474
|
/**
|
|
@@ -1433,18 +1491,21 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantPr
|
|
|
1433
1491
|
}
|
|
1434
1492
|
/**
|
|
1435
1493
|
* @pattern Button
|
|
1436
|
-
* @description
|
|
1437
|
-
*
|
|
1494
|
+
* @description The one control for every clickable action, from the main call
|
|
1495
|
+
* to action on a screen down to a quiet toolbar utility. Six variants
|
|
1496
|
+
* (primary, secondary, ghost, danger, dangerGhost, link) across three sizes
|
|
1497
|
+
* (xs, sm, md), labelled or icon-only.
|
|
1438
1498
|
* Supports polymorphic rendering via `asChild` (Radix Slot) to apply button
|
|
1439
1499
|
* styling to a different element, e.g. a router `<Link>`. Also exports the
|
|
1440
1500
|
* raw `buttonVariants` cva function for consumers composing button styling
|
|
1441
1501
|
* onto something other than this component.
|
|
1442
|
-
* @tokens bg-brand-primaryAction, text-brand-onprimary, bg-surface, text-text-primary, border-border-interactive, hover:bg-subtle, bg-status-danger, text-status-onstatus, text-text-link, rounded-control, duration-(--mr-motion-duration-interactive), ease-interactive
|
|
1502
|
+
* @tokens bg-brand-primaryAction, text-brand-onprimary, bg-surface, text-text-primary, border-border-strong, hover:border-border-interactive, hover:bg-subtle, bg-status-danger, text-status-onstatus, text-text-secondary, hover:text-text-danger, text-text-link, rounded-control, duration-(--mr-motion-duration-interactive), ease-interactive
|
|
1443
1503
|
* @dependencies class-variance-authority, @radix-ui/react-slot, lucide-react
|
|
1444
1504
|
* @variant primary - The one primary action on a screen. Solid brand fill.
|
|
1445
1505
|
* @variant secondary - Any other real action competing for attention (Cancel, Export). Bordered, neutral fill.
|
|
1446
1506
|
* @variant ghost - Low-emphasis action inside a dense toolbar or row where a border would add visual noise.
|
|
1447
|
-
* @variant danger -
|
|
1507
|
+
* @variant danger - Filled red. Only for a confirmed destructive action, typically the confirm button in a dialog. Never pair with `primary` in the same control group.
|
|
1508
|
+
* @variant dangerGhost - Neutral at rest, red on hover. For a destructive affordance inline in a row or toolbar -- what the product reaches for far more often than filled danger.
|
|
1448
1509
|
* @variant link - Reads as inline text, not a control. Use inside body copy or where a full button would overpower the surrounding content.
|
|
1449
1510
|
* @behavior `disabled` removes pointer events entirely (not just a style
|
|
1450
1511
|
* change) and dims to 40% opacity. Focus handling is a deliberate exception:
|
|
@@ -1461,9 +1522,29 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantPr
|
|
|
1461
1522
|
* (with `asChild`, the child element's own semantics apply instead).
|
|
1462
1523
|
* `loading` sets aria-busy, and the spinner is aria-hidden. Icon-only
|
|
1463
1524
|
* usage needs an aria-label from the caller -- nothing here supplies one.
|
|
1525
|
+
* @use when the user is triggering an action in place -- saving, applying,
|
|
1526
|
+
* confirming, opening a dialog, running an export.
|
|
1527
|
+
* @use when you need a destructive affordance: dangerGhost inline in a row or
|
|
1528
|
+
* toolbar, danger only as the confirm button in a dialog already opened.
|
|
1529
|
+
* @use when an action sits inside a sentence -- variant="link", which drops
|
|
1530
|
+
* the box and the semibold weight so it does not read as emphasis.
|
|
1531
|
+
* @use when the action is icon-only in a dense toolbar -- iconOnly squares the
|
|
1532
|
+
* box at whichever size you picked, so it lines up with labelled buttons
|
|
1533
|
+
* beside it. Supply an aria-label; nothing here does.
|
|
1534
|
+
* @avoid when the control navigates to a different route -- render a real link
|
|
1535
|
+
* via asChild, so middle-click, right-click and open-in-new-tab keep working.
|
|
1536
|
+
* variant="link" styles a button as text; it does not make a button a link.
|
|
1537
|
+
* @avoid when there is already a primary on the screen -- a second primary
|
|
1538
|
+
* means neither reads as the main action. Use secondary or ghost.
|
|
1539
|
+
* @avoid when the control toggles a persistent on/off state -- use CheckBox or
|
|
1540
|
+
* a switch. A button fires; it does not hold a state.
|
|
1541
|
+
* @avoid when you are about to hand-roll a button with raw classes. There is
|
|
1542
|
+
* no case this does not cover, and every copy is a divergence in hover, focus,
|
|
1543
|
+
* disabled and loading behaviour at once.
|
|
1464
1544
|
* @usage
|
|
1465
1545
|
* ```tsx
|
|
1466
1546
|
* <Button variant="primary" size="md">Save changes</Button>
|
|
1547
|
+
* <Button variant="dangerGhost" size="sm" iconOnly aria-label="Remove row"><X size={15} /></Button>
|
|
1467
1548
|
* <Button variant="secondary" size="sm">Cancel</Button>
|
|
1468
1549
|
* <Button variant="danger">Delete</Button>
|
|
1469
1550
|
* <Button variant="primary" loading>Saving…</Button>
|
|
@@ -1748,11 +1829,24 @@ interface TagProps {
|
|
|
1748
1829
|
}
|
|
1749
1830
|
/**
|
|
1750
1831
|
* @pattern Tag
|
|
1751
|
-
* @description Canonical descriptive tag
|
|
1752
|
-
*
|
|
1753
|
-
*
|
|
1754
|
-
*
|
|
1755
|
-
*
|
|
1832
|
+
* @description Canonical descriptive tag -- a neutral chip naming what a
|
|
1833
|
+
* thing IS: a category, a media type, a focus area. Always neutral, never
|
|
1834
|
+
* semantic, never removable.
|
|
1835
|
+
*
|
|
1836
|
+
* The product separates three jobs that most systems collapse into one, by
|
|
1837
|
+
* who authored the label. Badge is the system's view of a thing (status,
|
|
1838
|
+
* count, AI-generated) and its colour means something. Tag is the thing
|
|
1839
|
+
* describing itself, and stays neutral. FilterChipBar is the user describing
|
|
1840
|
+
* what they want to see, and is the only one you can remove.
|
|
1841
|
+
* @use when labelling what something is -- a category, a media type, a focus
|
|
1842
|
+
* area, a property of the row rather than a judgement about it.
|
|
1843
|
+
* @avoid when the colour would mean something. A status, a count, an
|
|
1844
|
+
* AI marker or anything the system decided is a Badge.
|
|
1845
|
+
* @avoid when the user should be able to dismiss it. An applied filter is a
|
|
1846
|
+
* FilterChipBar chip, which belongs to the filter bar rather than to the row.
|
|
1847
|
+
* @avoid when there are more than a handful in a row. Tags are scanned, and a
|
|
1848
|
+
* dozen neutral chips read as texture rather than as information.
|
|
1849
|
+
* @tokens text-micro, bg-subtle, text-text-tertiary, rounded-full
|
|
1756
1850
|
* @usage
|
|
1757
1851
|
* ```tsx
|
|
1758
1852
|
* <Tag>Digital</Tag>
|
|
@@ -2014,4 +2108,4 @@ interface FreshnessProps {
|
|
|
2014
2108
|
*/
|
|
2015
2109
|
declare function Freshness({ level }: FreshnessProps): react.JSX.Element;
|
|
2016
2110
|
|
|
2017
|
-
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, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, LineChartPlaceholder, type LineChartPlaceholderProps, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, SectionRail, type SectionRailProps, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, type SummaryGroup, type SummaryGroupItemValue, TablePagination, type TablePaginationProps, Tag, type TagProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, buttonVariants, chipTriggerClass, cycleSort, noResultsBody, resolveRange, sortProp };
|
|
2111
|
+
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, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, LineChartPlaceholder, type LineChartPlaceholderProps, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, SectionRail, type SectionRailProps, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, type SummaryGroup, type SummaryGroupItemValue, TablePagination, type TablePaginationProps, Tag, type TagProps, Toggle, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, buttonVariants, chipTriggerClass, cycleSort, noResultsBody, resolveRange, sortProp };
|