@mediaradar/design-components 0.45.3 → 0.46.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 +592 -492
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +199 -128
- package/dist/index.d.ts +199 -128
- package/dist/index.js +440 -340
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,8 +1,27 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, RefObject, ButtonHTMLAttributes, MouseEventHandler, InputHTMLAttributes } from 'react';
|
|
2
|
+
import { ReactNode, RefObject, ButtonHTMLAttributes, Ref, ReactElement, MouseEventHandler, InputHTMLAttributes } from 'react';
|
|
3
3
|
import * as class_variance_authority_types from 'class-variance-authority/types';
|
|
4
4
|
import { VariantProps } from 'class-variance-authority';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Props every component in this package accepts (PLA-357's consistency
|
|
8
|
+
* rules), so an app can place, adjust and test any of them the same way.
|
|
9
|
+
*/
|
|
10
|
+
interface CommonProps {
|
|
11
|
+
/**
|
|
12
|
+
* Extra classes on the component's root element. They're merged last with
|
|
13
|
+
* `cn`, so for the same property they win over the component's own class
|
|
14
|
+
* (`className="w-full"` beats a built-in width).
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Sets `data-testid` on the component's root element. Parts that have
|
|
19
|
+
* their own test ids use it as their prefix (`${testIdPrefix}-trigger`,
|
|
20
|
+
* ...); each component documents its own.
|
|
21
|
+
*/
|
|
22
|
+
testIdPrefix?: string;
|
|
23
|
+
}
|
|
24
|
+
|
|
6
25
|
/**
|
|
7
26
|
* @pattern InfoTip
|
|
8
27
|
* @status stable
|
|
@@ -37,7 +56,7 @@ import { VariantProps } from 'class-variance-authority';
|
|
|
37
56
|
* <InfoTip text="Hover variant" trigger="hover" />
|
|
38
57
|
* ```
|
|
39
58
|
*/
|
|
40
|
-
interface InfoTipProps {
|
|
59
|
+
interface InfoTipProps extends CommonProps {
|
|
41
60
|
/** The bubble's content. */
|
|
42
61
|
text: string;
|
|
43
62
|
/** Glyph size in pixels. */
|
|
@@ -49,8 +68,12 @@ interface InfoTipProps {
|
|
|
49
68
|
* also on keyboard focus so it stays reachable without a pointer.
|
|
50
69
|
*/
|
|
51
70
|
trigger?: "click" | "hover";
|
|
71
|
+
/** Classes on the trigger button. */
|
|
72
|
+
className?: string;
|
|
73
|
+
/** `data-testid` on the trigger button. */
|
|
74
|
+
testIdPrefix?: string;
|
|
52
75
|
}
|
|
53
|
-
declare function InfoTip({ text, size, label, trigger }: InfoTipProps): react.JSX.Element;
|
|
76
|
+
declare function InfoTip({ text, size, label, trigger, className, testIdPrefix }: InfoTipProps): react.JSX.Element;
|
|
54
77
|
|
|
55
78
|
/**
|
|
56
79
|
* @pattern AdvertiserQuickFilter
|
|
@@ -95,7 +118,7 @@ declare function InfoTip({ text, size, label, trigger }: InfoTipProps): react.JS
|
|
|
95
118
|
* <AdvertiserQuickFilter caption="League" options={leagues} selected={selected} onChange={setSelected} prepopulate pageSize={10} />
|
|
96
119
|
* ```
|
|
97
120
|
*/
|
|
98
|
-
interface AdvertiserQuickFilterProps {
|
|
121
|
+
interface AdvertiserQuickFilterProps extends CommonProps {
|
|
99
122
|
/** Small uppercase label above the value. */
|
|
100
123
|
caption?: string;
|
|
101
124
|
options: {
|
|
@@ -146,7 +169,7 @@ interface AdvertiserQuickFilterProps {
|
|
|
146
169
|
/** The clear link in footerless mode (unused when `showFooter` is set). */
|
|
147
170
|
clearLabel?: string;
|
|
148
171
|
/**
|
|
149
|
-
*
|
|
172
|
+
* `data-testid` on the wrapper, and the prefix for the trigger
|
|
150
173
|
* (`${testIdPrefix}-trigger`), the popover (`-popover`), the search input
|
|
151
174
|
* (`-search`), the selected-section toggle (`-selected-toggle`), the
|
|
152
175
|
* select-all-visible row (`-select-all-visible`), each option row
|
|
@@ -159,7 +182,7 @@ interface AdvertiserQuickFilterProps {
|
|
|
159
182
|
*/
|
|
160
183
|
testIdPrefix?: string;
|
|
161
184
|
}
|
|
162
|
-
declare function AdvertiserQuickFilter({ caption, options, selected, onChange, align, icon, showFooter, clearValue, parked, prepopulate, pageSize, searchPlaceholder, promptLabel, noResultsHint, clearLabel, testIdPrefix, }: AdvertiserQuickFilterProps): react.JSX.Element;
|
|
185
|
+
declare function AdvertiserQuickFilter({ caption, options, selected, onChange, align, icon, showFooter, clearValue, parked, prepopulate, pageSize, searchPlaceholder, promptLabel, noResultsHint, clearLabel, className, testIdPrefix, }: AdvertiserQuickFilterProps): react.JSX.Element;
|
|
163
186
|
|
|
164
187
|
/**
|
|
165
188
|
* @pattern AdvertiserSearchPrompt
|
|
@@ -178,11 +201,11 @@ declare function AdvertiserQuickFilter({ caption, options, selected, onChange, a
|
|
|
178
201
|
* <AdvertiserSearchPrompt label="a league name" />
|
|
179
202
|
* ```
|
|
180
203
|
*/
|
|
181
|
-
interface AdvertiserSearchPromptProps {
|
|
204
|
+
interface AdvertiserSearchPromptProps extends CommonProps {
|
|
182
205
|
/** Completes "Start typing … to filter." */
|
|
183
206
|
label?: string;
|
|
184
207
|
}
|
|
185
|
-
declare function AdvertiserSearchPrompt({ label }: AdvertiserSearchPromptProps): react.JSX.Element;
|
|
208
|
+
declare function AdvertiserSearchPrompt({ label, className, testIdPrefix }: AdvertiserSearchPromptProps): react.JSX.Element;
|
|
186
209
|
|
|
187
210
|
/**
|
|
188
211
|
* Fill and ink. `tone` answers "what kind of thing is this", never "what
|
|
@@ -196,7 +219,7 @@ type BadgeTone = "neutral" | "brand" | "brandSolid" | "success" | "warning" | "d
|
|
|
196
219
|
* product happens to use today.
|
|
197
220
|
*/
|
|
198
221
|
type BadgeKind = "label" | "count" | "eyebrow" | "category";
|
|
199
|
-
interface BadgeProps {
|
|
222
|
+
interface BadgeProps extends CommonProps {
|
|
200
223
|
/** What kind of thing this marks. Not a colour choice. */
|
|
201
224
|
tone?: BadgeTone;
|
|
202
225
|
/**
|
|
@@ -270,9 +293,9 @@ interface BadgeProps {
|
|
|
270
293
|
* <Badge tone="brand"><Check size={11} aria-hidden="true" />Primary</Badge>
|
|
271
294
|
* ```
|
|
272
295
|
*/
|
|
273
|
-
declare function Badge({ tone, kind, dot, children, className }: BadgeProps): react.JSX.Element;
|
|
296
|
+
declare function Badge({ tone, kind, dot, children, className, testIdPrefix }: BadgeProps): react.JSX.Element;
|
|
274
297
|
|
|
275
|
-
interface DeltaProps {
|
|
298
|
+
interface DeltaProps extends CommonProps {
|
|
276
299
|
/** The change itself. Its sign picks the direction; render the absolute value. */
|
|
277
300
|
value: number;
|
|
278
301
|
/** What the number is in -- "%" for a percentage, "pts" for share points. */
|
|
@@ -325,7 +348,7 @@ interface DeltaProps {
|
|
|
325
348
|
* <Delta value={1.4} suffix="pts" arrow />
|
|
326
349
|
* ```
|
|
327
350
|
*/
|
|
328
|
-
declare function Delta({ value, suffix, arrow, period, className }: DeltaProps): react.JSX.Element;
|
|
351
|
+
declare function Delta({ value, suffix, arrow, period, className, testIdPrefix }: DeltaProps): react.JSX.Element;
|
|
329
352
|
|
|
330
353
|
/**
|
|
331
354
|
* @pattern CheckBox
|
|
@@ -372,7 +395,7 @@ declare function Delta({ value, suffix, arrow, period, className }: DeltaProps):
|
|
|
372
395
|
* <CheckBox checked={false} disabled ariaLabel="Select row" title="Max 5 rows -- remove one first" onChange={toggle} />
|
|
373
396
|
* ```
|
|
374
397
|
*/
|
|
375
|
-
interface CheckBoxProps {
|
|
398
|
+
interface CheckBoxProps extends CommonProps {
|
|
376
399
|
/** Whether the box is checked. Controlled: the parent owns this value. */
|
|
377
400
|
checked: boolean;
|
|
378
401
|
/**
|
|
@@ -398,7 +421,9 @@ interface CheckBoxProps {
|
|
|
398
421
|
* selects and opens a detail panel.
|
|
399
422
|
*/
|
|
400
423
|
stopPropagation?: boolean;
|
|
401
|
-
/**
|
|
424
|
+
/** Sets `data-testid` on the `<button>`, for Playwright/test selectors. */
|
|
425
|
+
testIdPrefix?: string;
|
|
426
|
+
/** @deprecated Use `testIdPrefix`; it sets the same `data-testid`. Still works, and wins if both are set. */
|
|
402
427
|
testId?: string;
|
|
403
428
|
/**
|
|
404
429
|
* Native tooltip -- e.g. explaining why a disabled box is disabled. Forwarded
|
|
@@ -409,7 +434,7 @@ interface CheckBoxProps {
|
|
|
409
434
|
/** Extra classes merged onto the box -- e.g. a cursor or margin override. */
|
|
410
435
|
className?: string;
|
|
411
436
|
}
|
|
412
|
-
declare
|
|
437
|
+
declare const CheckBox: react.ForwardRefExoticComponent<CheckBoxProps & react.RefAttributes<HTMLButtonElement>>;
|
|
413
438
|
/**
|
|
414
439
|
* @pattern CheckBoxBox
|
|
415
440
|
* @status stable
|
|
@@ -442,7 +467,7 @@ declare function CheckBox({ checked, indeterminate, onChange, ariaLabel, disable
|
|
|
442
467
|
* </button>
|
|
443
468
|
* ```
|
|
444
469
|
*/
|
|
445
|
-
interface CheckBoxBoxProps {
|
|
470
|
+
interface CheckBoxBoxProps extends CommonProps {
|
|
446
471
|
/** Whether the box is checked. The owning element reports this to AT. */
|
|
447
472
|
checked: boolean;
|
|
448
473
|
/** Some-but-not-all state -- shows a dash instead of a check. */
|
|
@@ -452,7 +477,7 @@ interface CheckBoxBoxProps {
|
|
|
452
477
|
/** Extra classes merged onto the box. */
|
|
453
478
|
className?: string;
|
|
454
479
|
}
|
|
455
|
-
declare
|
|
480
|
+
declare const CheckBoxBox: react.ForwardRefExoticComponent<CheckBoxBoxProps & react.RefAttributes<HTMLSpanElement>>;
|
|
456
481
|
|
|
457
482
|
/**
|
|
458
483
|
* @pattern DateRangeFilter
|
|
@@ -511,7 +536,7 @@ declare function CheckBoxBox({ checked, indeterminate, disabled, className }: Ch
|
|
|
511
536
|
* />
|
|
512
537
|
* ```
|
|
513
538
|
*/
|
|
514
|
-
interface DateRangeFilterProps {
|
|
539
|
+
interface DateRangeFilterProps extends CommonProps {
|
|
515
540
|
/** Static label shown above the value when `showDates` is false. */
|
|
516
541
|
caption?: string;
|
|
517
542
|
/** Initial preset (matched case-insensitively against the active preset set) or, if unmatched, treated as a custom label. Ignored once `value`/`range` are given -- see those. */
|
|
@@ -580,7 +605,7 @@ interface DateRangeFilterProps {
|
|
|
580
605
|
*/
|
|
581
606
|
onApply?: (label: string, start: Date, end: Date, compare?: string) => void;
|
|
582
607
|
/**
|
|
583
|
-
*
|
|
608
|
+
* `data-testid` on the wrapper, and the prefix for the trigger (`${testIdPrefix}-trigger`),
|
|
584
609
|
* the popover (`-popover`), each preset (`-option-<slugified-label>`, e.g.
|
|
585
610
|
* `-option-last-7-days`), each `compare` option (`-compare-<slugified-id>`),
|
|
586
611
|
* and Cancel (`-cancel`) / Apply (`-apply`). Omit for no test-id wiring.
|
|
@@ -610,7 +635,7 @@ interface DateRangeFilterProps {
|
|
|
610
635
|
*/
|
|
611
636
|
formatRange?: (start: Date, end: Date) => string;
|
|
612
637
|
}
|
|
613
|
-
declare function DateRangeFilter({ caption, defaultValue, value: controlledValue, range: controlledRange, align, placement, onChange, onRangeChange, showDates, shortDates, icon, presetSet, excludePresets, emptyLabel, today: todayProp, initialRange, compare, onApply, testIdPrefix, granularity, formatDate, formatRange, }: DateRangeFilterProps): react.JSX.Element;
|
|
638
|
+
declare function DateRangeFilter({ caption, defaultValue, value: controlledValue, range: controlledRange, align, placement, onChange, onRangeChange, showDates, shortDates, icon, presetSet, excludePresets, emptyLabel, today: todayProp, initialRange, compare, onApply, className, testIdPrefix, granularity, formatDate, formatRange, }: DateRangeFilterProps): react.JSX.Element;
|
|
614
639
|
|
|
615
640
|
/**
|
|
616
641
|
* @pattern SearchBar
|
|
@@ -693,7 +718,7 @@ interface SearchMatchValue {
|
|
|
693
718
|
wordJoin: "Or" | "And";
|
|
694
719
|
}
|
|
695
720
|
declare const DEFAULT_SEARCH_MATCH: SearchMatchValue;
|
|
696
|
-
interface SearchBarProps {
|
|
721
|
+
interface SearchBarProps extends CommonProps {
|
|
697
722
|
/** Input placeholder text. Also used as the input's `aria-label`. */
|
|
698
723
|
placeholder?: string;
|
|
699
724
|
value?: string;
|
|
@@ -722,7 +747,8 @@ interface SearchBarProps {
|
|
|
722
747
|
onDownloadAdCodes?: (codes: string[]) => void;
|
|
723
748
|
className?: string;
|
|
724
749
|
/**
|
|
725
|
-
*
|
|
750
|
+
* `data-testid` on the field's frame (`testIdPrefix` itself, 0.46.0+), and
|
|
751
|
+
* the prefix for `data-testid` attributes on the input
|
|
726
752
|
* (`${testIdPrefix}-search`), its clear button (`-clear`), the match-type
|
|
727
753
|
* trigger (`-mode-trigger`) and popover (`-mode-popover`), each mode row
|
|
728
754
|
* (`-mode-anyWord`, `-mode-exactMatch`, `-mode-contextual`, `-mode-adCode`),
|
|
@@ -738,7 +764,7 @@ interface SearchBarProps {
|
|
|
738
764
|
*/
|
|
739
765
|
testIdPrefix?: string;
|
|
740
766
|
}
|
|
741
|
-
declare
|
|
767
|
+
declare const SearchBar: react.ForwardRefExoticComponent<SearchBarProps & react.RefAttributes<HTMLInputElement>>;
|
|
742
768
|
|
|
743
769
|
/**
|
|
744
770
|
* @pattern SectionRail
|
|
@@ -776,7 +802,7 @@ declare function SearchBar({ placeholder, value, onChange, variant, size, matchV
|
|
|
776
802
|
* </SectionRail>
|
|
777
803
|
* ```
|
|
778
804
|
*/
|
|
779
|
-
interface SectionRailProps {
|
|
805
|
+
interface SectionRailProps extends CommonProps {
|
|
780
806
|
/** Section heading. */
|
|
781
807
|
title: string;
|
|
782
808
|
/** Use the serif display treatment instead of the default sans heading. */
|
|
@@ -790,7 +816,7 @@ interface SectionRailProps {
|
|
|
790
816
|
/** The row's cards. Any content works — width is handled by the row, not the card. */
|
|
791
817
|
children: React.ReactNode;
|
|
792
818
|
}
|
|
793
|
-
declare function SectionRail({ title, titleSerif, subtitle, viewAllLabel, viewAllHref, children, }: SectionRailProps): react.JSX.Element;
|
|
819
|
+
declare function SectionRail({ title, titleSerif, subtitle, viewAllLabel, viewAllHref, children, className, testIdPrefix, }: SectionRailProps): react.JSX.Element;
|
|
794
820
|
|
|
795
821
|
/**
|
|
796
822
|
* @pattern DataScopeFilter
|
|
@@ -822,14 +848,19 @@ declare function SectionRail({ title, titleSerif, subtitle, viewAllLabel, viewAl
|
|
|
822
848
|
* <DataScopeFilter value={finalOnly} onChange={setFinalOnly} />
|
|
823
849
|
* ```
|
|
824
850
|
*/
|
|
825
|
-
interface DataScopeFilterProps {
|
|
851
|
+
interface DataScopeFilterProps extends CommonProps {
|
|
826
852
|
value: boolean;
|
|
827
853
|
onChange: (v: boolean) => void;
|
|
828
854
|
/** Which edge of the trigger the popover aligns to. Both known consumers
|
|
829
855
|
* anchor this at the right edge of a filter bar, hence the default. */
|
|
830
856
|
align?: "left" | "right";
|
|
857
|
+
/**
|
|
858
|
+
* `data-testid` on the wrapper, and the prefix for the trigger
|
|
859
|
+
* (`${testIdPrefix}-trigger`) and the open menu (`${testIdPrefix}-popover`).
|
|
860
|
+
*/
|
|
861
|
+
testIdPrefix?: string;
|
|
831
862
|
}
|
|
832
|
-
declare function DataScopeFilter({ value, onChange, align }: DataScopeFilterProps): react.JSX.Element;
|
|
863
|
+
declare function DataScopeFilter({ value, onChange, align, className, testIdPrefix }: DataScopeFilterProps): react.JSX.Element;
|
|
833
864
|
|
|
834
865
|
/**
|
|
835
866
|
* @pattern SelectFilter
|
|
@@ -886,7 +917,7 @@ declare function DataScopeFilter({ value, onChange, align }: DataScopeFilterProp
|
|
|
886
917
|
* <SelectFilter caption="Country" value={country} onChange={setCountry} options={['United States', 'Canada', 'United Kingdom']} renderIcon={(c) => <img src={FLAGS[c]} alt="" />} />
|
|
887
918
|
* ```
|
|
888
919
|
*/
|
|
889
|
-
interface SelectFilterProps {
|
|
920
|
+
interface SelectFilterProps extends CommonProps {
|
|
890
921
|
caption: string;
|
|
891
922
|
value: string;
|
|
892
923
|
options: string[];
|
|
@@ -896,10 +927,11 @@ interface SelectFilterProps {
|
|
|
896
927
|
/** Stretch the trigger (and the popover, when true) to fill its container. */
|
|
897
928
|
fullWidth?: boolean;
|
|
898
929
|
/** Extra classes merged onto the trigger button -- e.g. a background
|
|
899
|
-
* override for a filter bar that isn't sitting on a filter-tray canvas.
|
|
930
|
+
* override for a filter bar that isn't sitting on a filter-tray canvas.
|
|
931
|
+
* (The trigger, not the wrapper: kept from before the package-wide rule.) */
|
|
900
932
|
className?: string;
|
|
901
933
|
/**
|
|
902
|
-
*
|
|
934
|
+
* `data-testid` on the wrapper, and the prefix for the trigger
|
|
903
935
|
* (`${testIdPrefix}-trigger`), the popover (`${testIdPrefix}-popover`),
|
|
904
936
|
* and each option (`${testIdPrefix}-option-<slugified-label>`). Omit
|
|
905
937
|
* entirely for no test-id wiring at all -- added specifically so an
|
|
@@ -987,7 +1019,7 @@ declare function SelectFilter({ caption, value, options, onChange, align, fullWi
|
|
|
987
1019
|
* </Card>
|
|
988
1020
|
* ```
|
|
989
1021
|
*/
|
|
990
|
-
interface CardProps extends Omit<React.HTMLAttributes<HTMLElement>, "title"
|
|
1022
|
+
interface CardProps extends Omit<React.HTMLAttributes<HTMLElement>, "title">, CommonProps {
|
|
991
1023
|
/** Disable interactive hover treatment (when card isn't clickable). */
|
|
992
1024
|
staticCard?: boolean;
|
|
993
1025
|
/**
|
|
@@ -1032,7 +1064,7 @@ interface NoResultsAction {
|
|
|
1032
1064
|
/** Rendered as the filled button; every other action renders as the quiet link/button. */
|
|
1033
1065
|
primary?: boolean;
|
|
1034
1066
|
}
|
|
1035
|
-
declare const PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-dense font-semibold text-brand-onprimary transition-colors hover:opacity-90";
|
|
1067
|
+
declare const PRIMARY_ACTION_CLASS = "rounded-control bg-brand-primaryAction px-3.5 py-2 text-dense font-semibold text-brand-onprimary transition-colors hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-border-focus";
|
|
1036
1068
|
declare const QUIET_ACTION_CLASS = "rounded-control text-dense font-medium text-text-link transition-colors hover:underline focus-visible:outline-solid focus-visible:outline-2 focus-visible:outline-border-focus";
|
|
1037
1069
|
/**
|
|
1038
1070
|
* @pattern NoResultsEmptyState
|
|
@@ -1073,7 +1105,7 @@ declare const QUIET_ACTION_CLASS = "rounded-control text-dense font-medium text-
|
|
|
1073
1105
|
* />
|
|
1074
1106
|
* ```
|
|
1075
1107
|
*/
|
|
1076
|
-
interface NoResultsEmptyStateProps {
|
|
1108
|
+
interface NoResultsEmptyStateProps extends CommonProps {
|
|
1077
1109
|
/** @default NO_RESULTS_TITLE */
|
|
1078
1110
|
title?: string;
|
|
1079
1111
|
/** Replaces the default body wholesale, workspace name included. */
|
|
@@ -1100,7 +1132,7 @@ interface NoResultsEmptyStateProps {
|
|
|
1100
1132
|
*/
|
|
1101
1133
|
testIdPrefix?: string;
|
|
1102
1134
|
}
|
|
1103
|
-
declare function NoResultsEmptyState({ title, body, workspaceName, hasFilters, onClearFilters, onEditFilters, actions, testIdPrefix, }: NoResultsEmptyStateProps): react.JSX.Element;
|
|
1135
|
+
declare function NoResultsEmptyState({ title, body, workspaceName, hasFilters, onClearFilters, onEditFilters, actions, className, testIdPrefix, }: NoResultsEmptyStateProps): react.JSX.Element;
|
|
1104
1136
|
|
|
1105
1137
|
interface SummaryGroupItemValue {
|
|
1106
1138
|
id: string;
|
|
@@ -1142,7 +1174,7 @@ interface SummaryGroup {
|
|
|
1142
1174
|
* naming maps to this package's `shadow-raised`/`shadow-overlay` respectively
|
|
1143
1175
|
* (raised: a static card like this one; overlay: a floating popover/menu),
|
|
1144
1176
|
* not a 1:1 name swap.
|
|
1145
|
-
* @tokens text-micro, text-dense, rounded-card, border-border-default, bg-surface, shadow-raised,
|
|
1177
|
+
* @tokens text-micro, text-dense, rounded-card, border-border-default, bg-surface, shadow-raised, focus-visible:outline-border-focus,
|
|
1146
1178
|
* text-text-secondary, text-text-primary, rounded-full, bg-subtle,
|
|
1147
1179
|
* rounded-control, bg-canvas, hover:bg-subtle, hover:text-text-danger,
|
|
1148
1180
|
* text-text-link, divide-border-default
|
|
@@ -1163,19 +1195,18 @@ interface SummaryGroup {
|
|
|
1163
1195
|
* <WorkspaceSelectedCard groups={[{ id: 'advertisers', label: 'Advertisers', items: selected, onRemove: removeOne, onRemoveAll: clearAll }]} />
|
|
1164
1196
|
* ```
|
|
1165
1197
|
*/
|
|
1166
|
-
interface WorkspaceSelectedCardProps {
|
|
1198
|
+
interface WorkspaceSelectedCardProps extends CommonProps {
|
|
1167
1199
|
groups: SummaryGroup[];
|
|
1168
1200
|
/**
|
|
1169
|
-
*
|
|
1201
|
+
* `data-testid` on the card (`testIdPrefix` itself, 0.46.0+), and the
|
|
1202
|
+
* prefix for `data-testid` attributes on each group's toggle
|
|
1170
1203
|
* (`${testIdPrefix}-group-<group.id>`) and its "Remove all" button
|
|
1171
1204
|
* (`${testIdPrefix}-remove-all-<group.id>`), applied recursively to
|
|
1172
1205
|
* sub-groups too. Omit for no test-id wiring.
|
|
1173
1206
|
*
|
|
1174
1207
|
* NOTE: this does not reproduce mr-clientapps-insights-studio's current
|
|
1175
1208
|
* fixed ids byte-for-byte -- its container carries a separate, unrelated
|
|
1176
|
-
* `workspace-selected-summary` id
|
|
1177
|
-
* element those groups sit inside, by design, so there's nothing to attach
|
|
1178
|
-
* an equivalent id to) while its groups use a *different* prefix,
|
|
1209
|
+
* `workspace-selected-summary` id while its groups use a *different* prefix,
|
|
1179
1210
|
* `workspace-summary-group-<type>` / `workspace-summary-remove-all-<type>`.
|
|
1180
1211
|
* A consumer with existing Playwright locators keyed off those exact
|
|
1181
1212
|
* strings needs to update them, or the caller needs its own id mapping --
|
|
@@ -1184,7 +1215,7 @@ interface WorkspaceSelectedCardProps {
|
|
|
1184
1215
|
*/
|
|
1185
1216
|
testIdPrefix?: string;
|
|
1186
1217
|
}
|
|
1187
|
-
declare function WorkspaceSelectedCard({ groups, testIdPrefix }: WorkspaceSelectedCardProps): react.JSX.Element;
|
|
1218
|
+
declare function WorkspaceSelectedCard({ groups, className, testIdPrefix }: WorkspaceSelectedCardProps): react.JSX.Element;
|
|
1188
1219
|
|
|
1189
1220
|
/**
|
|
1190
1221
|
* @pattern BarChartPlaceholder
|
|
@@ -1211,11 +1242,11 @@ declare function WorkspaceSelectedCard({ groups, testIdPrefix }: WorkspaceSelect
|
|
|
1211
1242
|
* <BarChartPlaceholder height={180} />
|
|
1212
1243
|
* ```
|
|
1213
1244
|
*/
|
|
1214
|
-
interface BarChartPlaceholderProps {
|
|
1245
|
+
interface BarChartPlaceholderProps extends CommonProps {
|
|
1215
1246
|
/** Chart height in pixels. */
|
|
1216
1247
|
height?: number;
|
|
1217
1248
|
}
|
|
1218
|
-
declare function BarChartPlaceholder({ height }: BarChartPlaceholderProps): react.JSX.Element;
|
|
1249
|
+
declare function BarChartPlaceholder({ height, className, testIdPrefix }: BarChartPlaceholderProps): react.JSX.Element;
|
|
1219
1250
|
|
|
1220
1251
|
/**
|
|
1221
1252
|
* @pattern LineChartPlaceholder
|
|
@@ -1243,11 +1274,11 @@ declare function BarChartPlaceholder({ height }: BarChartPlaceholderProps): reac
|
|
|
1243
1274
|
* <LineChartPlaceholder height={200} />
|
|
1244
1275
|
* ```
|
|
1245
1276
|
*/
|
|
1246
|
-
interface LineChartPlaceholderProps {
|
|
1277
|
+
interface LineChartPlaceholderProps extends CommonProps {
|
|
1247
1278
|
/** Chart height in pixels. */
|
|
1248
1279
|
height?: number;
|
|
1249
1280
|
}
|
|
1250
|
-
declare function LineChartPlaceholder({ height }: LineChartPlaceholderProps): react.JSX.Element;
|
|
1281
|
+
declare function LineChartPlaceholder({ height, className, testIdPrefix }: LineChartPlaceholderProps): react.JSX.Element;
|
|
1251
1282
|
|
|
1252
1283
|
/**
|
|
1253
1284
|
* @pattern PieChartPlaceholder
|
|
@@ -1273,13 +1304,13 @@ declare function LineChartPlaceholder({ height }: LineChartPlaceholderProps): re
|
|
|
1273
1304
|
* <PieChartPlaceholder legendRows={4} />
|
|
1274
1305
|
* ```
|
|
1275
1306
|
*/
|
|
1276
|
-
interface PieChartPlaceholderProps {
|
|
1307
|
+
interface PieChartPlaceholderProps extends CommonProps {
|
|
1277
1308
|
/** Chart height in pixels. */
|
|
1278
1309
|
height?: number;
|
|
1279
1310
|
/** Number of blank legend rows to render beside the disc. */
|
|
1280
1311
|
legendRows?: number;
|
|
1281
1312
|
}
|
|
1282
|
-
declare function PieChartPlaceholder({ height, legendRows }: PieChartPlaceholderProps): react.JSX.Element;
|
|
1313
|
+
declare function PieChartPlaceholder({ height, legendRows, className, testIdPrefix }: PieChartPlaceholderProps): react.JSX.Element;
|
|
1283
1314
|
|
|
1284
1315
|
/**
|
|
1285
1316
|
* @pattern StackedColumnPlaceholder
|
|
@@ -1306,7 +1337,7 @@ declare function PieChartPlaceholder({ height, legendRows }: PieChartPlaceholder
|
|
|
1306
1337
|
* <StackedColumnPlaceholder axis />
|
|
1307
1338
|
* ```
|
|
1308
1339
|
*/
|
|
1309
|
-
interface StackedColumnPlaceholderProps {
|
|
1340
|
+
interface StackedColumnPlaceholderProps extends CommonProps {
|
|
1310
1341
|
/** Chart height in pixels. */
|
|
1311
1342
|
height?: number;
|
|
1312
1343
|
/** Column width in pixels. */
|
|
@@ -1316,7 +1347,7 @@ interface StackedColumnPlaceholderProps {
|
|
|
1316
1347
|
/** Wrap the column in a 0-100% axis frame, matching a live share-of-total chart. */
|
|
1317
1348
|
axis?: boolean;
|
|
1318
1349
|
}
|
|
1319
|
-
declare function StackedColumnPlaceholder({ height, width, legendRows, axis, }: StackedColumnPlaceholderProps): react.JSX.Element;
|
|
1350
|
+
declare function StackedColumnPlaceholder({ height, width, legendRows, axis, className, testIdPrefix, }: StackedColumnPlaceholderProps): react.JSX.Element;
|
|
1320
1351
|
|
|
1321
1352
|
/**
|
|
1322
1353
|
* @pattern Tooltip
|
|
@@ -1379,7 +1410,7 @@ declare function StackedColumnPlaceholder({ height, width, legendRows, axis, }:
|
|
|
1379
1410
|
* <Tooltip label="Sports" anchorRef={ref} placement="right" delay={500} variant="inverted" />
|
|
1380
1411
|
* ```
|
|
1381
1412
|
*/
|
|
1382
|
-
interface TooltipProps {
|
|
1413
|
+
interface TooltipProps extends CommonProps {
|
|
1383
1414
|
/** Tooltip content shown on hover/focus. */
|
|
1384
1415
|
label: ReactNode;
|
|
1385
1416
|
/** The trigger content, wrapped inline. Omit when using `anchorRef`. */
|
|
@@ -1427,7 +1458,10 @@ interface TooltipProps {
|
|
|
1427
1458
|
delay?: number;
|
|
1428
1459
|
/** 'surface' (default) or 'inverted' -- see the pattern description. */
|
|
1429
1460
|
variant?: "surface" | "inverted";
|
|
1430
|
-
/**
|
|
1461
|
+
/**
|
|
1462
|
+
* `data-testid` on the inline trigger wrapper (none with `anchorRef`), and the
|
|
1463
|
+
* prefix for the floating bubble's (`${testIdPrefix}-tooltip`).
|
|
1464
|
+
*/
|
|
1431
1465
|
testIdPrefix?: string;
|
|
1432
1466
|
}
|
|
1433
1467
|
declare function Tooltip({ label, children, anchorRef, className, whenTruncated, interactive, placement, align, delay, variant, testIdPrefix, }: TooltipProps): react.JSX.Element | null;
|
|
@@ -1451,13 +1485,13 @@ declare function Tooltip({ label, children, anchorRef, className, whenTruncated,
|
|
|
1451
1485
|
* <AdvertiserNoResults query={query} hint="Try a different spelling, or switch the Agency Type." />
|
|
1452
1486
|
* ```
|
|
1453
1487
|
*/
|
|
1454
|
-
interface AdvertiserNoResultsProps {
|
|
1488
|
+
interface AdvertiserNoResultsProps extends CommonProps {
|
|
1455
1489
|
/** The search term that returned nothing. */
|
|
1456
1490
|
query: string;
|
|
1457
1491
|
/** The actionable next step under the message. */
|
|
1458
1492
|
hint?: string;
|
|
1459
1493
|
}
|
|
1460
|
-
declare function AdvertiserNoResults({ query, hint, }: AdvertiserNoResultsProps): react.JSX.Element;
|
|
1494
|
+
declare function AdvertiserNoResults({ query, hint, className, testIdPrefix, }: AdvertiserNoResultsProps): react.JSX.Element;
|
|
1461
1495
|
|
|
1462
1496
|
/**
|
|
1463
1497
|
* @pattern SelectAllVisible
|
|
@@ -1469,7 +1503,7 @@ declare function AdvertiserNoResults({ query, hint, }: AdvertiserNoResultsProps)
|
|
|
1469
1503
|
* `ScopedSearchSection` uses the identical threshold and copy for its own
|
|
1470
1504
|
* scoped search sections). Communicates how many are visible and toggles
|
|
1471
1505
|
* between "Select all" and "Deselect" based on `allSelected`.
|
|
1472
|
-
* @tokens rounded-control, text-text-link, hover:bg-subtle
|
|
1506
|
+
* @tokens rounded-control, text-text-link, hover:bg-subtle, focus-visible:outline-border-focus
|
|
1473
1507
|
* @dependencies lucide-react
|
|
1474
1508
|
* @a11y A plain <button>, not a checkbox -- it performs a bulk action rather
|
|
1475
1509
|
* than holding a checked state, so it deliberately carries no
|
|
@@ -1482,16 +1516,16 @@ declare function AdvertiserNoResults({ query, hint, }: AdvertiserNoResultsProps)
|
|
|
1482
1516
|
* )}
|
|
1483
1517
|
* ```
|
|
1484
1518
|
*/
|
|
1485
|
-
interface SelectAllVisibleProps {
|
|
1519
|
+
interface SelectAllVisibleProps extends CommonProps {
|
|
1486
1520
|
/** Number of currently visible results. */
|
|
1487
1521
|
count: number;
|
|
1488
1522
|
/** Whether every visible result is already selected. */
|
|
1489
1523
|
allSelected: boolean;
|
|
1490
1524
|
onToggle: () => void;
|
|
1491
|
-
/** Optional prefix for the row's `data-testid` (`${testIdPrefix}-select-all-visible
|
|
1525
|
+
/** Optional prefix for the row's `data-testid` (`${testIdPrefix}-select-all-visible`, on the root `<button>`). */
|
|
1492
1526
|
testIdPrefix?: string;
|
|
1493
1527
|
}
|
|
1494
|
-
declare function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }: SelectAllVisibleProps): react.JSX.Element;
|
|
1528
|
+
declare function SelectAllVisible({ count, allSelected, onToggle, className, testIdPrefix }: SelectAllVisibleProps): react.JSX.Element;
|
|
1495
1529
|
|
|
1496
1530
|
/**
|
|
1497
1531
|
* @pattern SelectedSection
|
|
@@ -1507,7 +1541,7 @@ declare function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }
|
|
|
1507
1541
|
* row content (plain rows, opacity-dimmed "parked" rows, per-tray custom
|
|
1508
1542
|
* columns), so a fixed row shape would have forced a compromise none of them
|
|
1509
1543
|
* need. Self-hides at `count === 0` so a caller can render it unconditionally.
|
|
1510
|
-
* @tokens text-micro, rounded-control, text-text-tertiary, hover:text-text-primary
|
|
1544
|
+
* @tokens text-micro, rounded-control, text-text-tertiary, hover:text-text-primary, focus-visible:outline-border-focus
|
|
1511
1545
|
* @dependencies lucide-react
|
|
1512
1546
|
* @a11y The disclosure header is a button reporting aria-expanded, and the
|
|
1513
1547
|
* chevron is aria-hidden. It is a disclosure, not a selection control --
|
|
@@ -1519,16 +1553,16 @@ declare function SelectAllVisible({ count, allSelected, onToggle, testIdPrefix }
|
|
|
1519
1553
|
* </SelectedSection>
|
|
1520
1554
|
* ```
|
|
1521
1555
|
*/
|
|
1522
|
-
interface SelectedSectionProps {
|
|
1556
|
+
interface SelectedSectionProps extends CommonProps {
|
|
1523
1557
|
count: number;
|
|
1524
1558
|
open: boolean;
|
|
1525
1559
|
onToggle: () => void;
|
|
1526
1560
|
/** The caller renders each selected row itself. */
|
|
1527
1561
|
children: React.ReactNode;
|
|
1528
|
-
/**
|
|
1562
|
+
/** `data-testid` on the section, and the prefix for the toggle button's (`${testIdPrefix}-selected-toggle`). */
|
|
1529
1563
|
testIdPrefix?: string;
|
|
1530
1564
|
}
|
|
1531
|
-
declare function SelectedSection({ count, open, onToggle, children, testIdPrefix }: SelectedSectionProps): react.JSX.Element | null;
|
|
1565
|
+
declare function SelectedSection({ count, open, onToggle, children, className, testIdPrefix }: SelectedSectionProps): react.JSX.Element | null;
|
|
1532
1566
|
|
|
1533
1567
|
interface PickerRow {
|
|
1534
1568
|
id: string;
|
|
@@ -1559,7 +1593,7 @@ interface SelectionPickerAccountList {
|
|
|
1559
1593
|
entityTypes: string[];
|
|
1560
1594
|
updatedAt: string;
|
|
1561
1595
|
}
|
|
1562
|
-
interface SelectionPickerProps<T extends PickerRow> {
|
|
1596
|
+
interface SelectionPickerProps<T extends PickerRow> extends CommonProps {
|
|
1563
1597
|
/** Full catalog to search/filter over client-side. Ignored when `results`
|
|
1564
1598
|
* is given instead -- that's the async/paginated mode, see `results`. */
|
|
1565
1599
|
catalog?: T[];
|
|
@@ -1626,7 +1660,8 @@ interface SelectionPickerProps<T extends PickerRow> {
|
|
|
1626
1660
|
* slot; this component has no opinion on what it renders. */
|
|
1627
1661
|
toolbarExtra?: ReactNode;
|
|
1628
1662
|
/**
|
|
1629
|
-
*
|
|
1663
|
+
* `data-testid` on the picker's wrapper, and the prefix for `data-testid`
|
|
1664
|
+
* attributes on the search input
|
|
1630
1665
|
* (`${testIdPrefix}-search`), the source toggle buttons
|
|
1631
1666
|
* (`${testIdPrefix}-source-search` / `${testIdPrefix}-source-lists`),
|
|
1632
1667
|
* each filter dropdown trigger (`${testIdPrefix}-filter-<slug>`) and each
|
|
@@ -1702,7 +1737,7 @@ interface SelectionPickerProps<T extends PickerRow> {
|
|
|
1702
1737
|
* />
|
|
1703
1738
|
* ```
|
|
1704
1739
|
*/
|
|
1705
|
-
declare function SelectionPicker<T extends PickerRow>({ catalog, selected, onChange, columns, filters, searchPlaceholder, getChildren, helper, showInfoColumn, defaultFilters, requireQuery, showResultsWithoutSearch, accountLists, selectedListIds, onToggleList, lockedIds, results, onQueryChange, loading, error, errorMessage, hasMore, loadingMore, onLoadMore, toolbarExtra, testIdPrefix, }: SelectionPickerProps<T>): react.JSX.Element;
|
|
1740
|
+
declare function SelectionPicker<T extends PickerRow>({ catalog, selected, onChange, columns, filters, searchPlaceholder, getChildren, helper, showInfoColumn, defaultFilters, requireQuery, showResultsWithoutSearch, accountLists, selectedListIds, onToggleList, lockedIds, results, onQueryChange, loading, error, errorMessage, hasMore, loadingMore, onLoadMore, toolbarExtra, className, testIdPrefix, }: SelectionPickerProps<T>): react.JSX.Element;
|
|
1706
1741
|
|
|
1707
1742
|
interface PubBreak {
|
|
1708
1743
|
brand: string;
|
|
@@ -1712,7 +1747,7 @@ interface PubBreak {
|
|
|
1712
1747
|
pct: number;
|
|
1713
1748
|
yoy: number | "NEW";
|
|
1714
1749
|
}
|
|
1715
|
-
interface PublisherBreakdownListProps {
|
|
1750
|
+
interface PublisherBreakdownListProps extends CommonProps {
|
|
1716
1751
|
rows: PubBreak[];
|
|
1717
1752
|
/** @default 10 */
|
|
1718
1753
|
defaultVisibleCount?: number;
|
|
@@ -1740,7 +1775,7 @@ interface PublisherBreakdownListProps {
|
|
|
1740
1775
|
* deliberately NOT merged into this component -- see the escape-hatch note
|
|
1741
1776
|
* below. `renderLogo` lets a caller plug in real per-row logos; without it,
|
|
1742
1777
|
* rows show a plain initials monogram.
|
|
1743
|
-
* @tokens text-micro, text-text-primary, text-text-tertiary, text-text-secondary,
|
|
1778
|
+
* @tokens text-micro, text-text-primary, text-text-tertiary, text-text-secondary, focus-visible:outline-border-focus,
|
|
1744
1779
|
* text-text-link, text-text-warning, text-text-success, text-text-danger,
|
|
1745
1780
|
* border-border-default, bg-surface, bg-subtle, rounded-control, rounded-full,
|
|
1746
1781
|
* shadow-overlay, text-badge
|
|
@@ -1771,14 +1806,14 @@ interface PublisherBreakdownListProps {
|
|
|
1771
1806
|
* <PublisherBreakdownList rows={publishers} defaultVisibleCount={10} />
|
|
1772
1807
|
* ```
|
|
1773
1808
|
*/
|
|
1774
|
-
declare function PublisherBreakdownList({ rows, defaultVisibleCount, padded, viewAllHref, renderLogo }: PublisherBreakdownListProps): react.JSX.Element;
|
|
1809
|
+
declare function PublisherBreakdownList({ rows, defaultVisibleCount, padded, viewAllHref, renderLogo, className, testIdPrefix, }: PublisherBreakdownListProps): react.JSX.Element;
|
|
1775
1810
|
|
|
1776
1811
|
declare const buttonVariants: (props?: ({
|
|
1777
1812
|
variant?: "link" | "danger" | "primary" | "secondary" | "ghost" | "dangerGhost" | null | undefined;
|
|
1778
1813
|
size?: "sm" | "md" | "lg" | "xs" | null | undefined;
|
|
1779
1814
|
iconOnly?: boolean | null | undefined;
|
|
1780
1815
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1781
|
-
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants
|
|
1816
|
+
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants>, CommonProps {
|
|
1782
1817
|
/**
|
|
1783
1818
|
* Render the button styling onto the single child element instead of a
|
|
1784
1819
|
* `<button>` (e.g. a router `<Link>` or an `<a>`). The child must be exactly
|
|
@@ -1864,7 +1899,7 @@ interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantPr
|
|
|
1864
1899
|
*/
|
|
1865
1900
|
declare const Button: react.ForwardRefExoticComponent<ButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
1866
1901
|
|
|
1867
|
-
interface FilterDropdownFooterProps {
|
|
1902
|
+
interface FilterDropdownFooterProps extends CommonProps {
|
|
1868
1903
|
/** Omit to hide the Clear All action for dropdowns that don't need it. */
|
|
1869
1904
|
onClear?: () => void;
|
|
1870
1905
|
/** Fires when the primary action is pressed. */
|
|
@@ -1888,9 +1923,13 @@ interface FilterDropdownFooterProps {
|
|
|
1888
1923
|
* <FilterDropdownFooter onApply={handleApply} onClear={handleClear} />
|
|
1889
1924
|
* ```
|
|
1890
1925
|
*/
|
|
1891
|
-
declare function FilterDropdownFooter({ onClear, onApply, clearLabel, applyLabel, }: FilterDropdownFooterProps): react.JSX.Element;
|
|
1926
|
+
declare function FilterDropdownFooter({ onClear, onApply, clearLabel, applyLabel, className, testIdPrefix, }: FilterDropdownFooterProps): react.JSX.Element;
|
|
1892
1927
|
|
|
1893
|
-
interface NameListModalProps {
|
|
1928
|
+
interface NameListModalProps extends CommonProps {
|
|
1929
|
+
/** Classes on the dialog panel (the visible surface), not the backdrop. */
|
|
1930
|
+
className?: string;
|
|
1931
|
+
/** `data-testid` on the dialog panel. */
|
|
1932
|
+
testIdPrefix?: string;
|
|
1894
1933
|
title: string;
|
|
1895
1934
|
initialName: string;
|
|
1896
1935
|
submitLabel: string;
|
|
@@ -1942,7 +1981,7 @@ interface NameListModalProps {
|
|
|
1942
1981
|
* <NameListModal title="Rename list" initialName={list.name} submitLabel="Save" onCancel={close} onSubmit={rename} />
|
|
1943
1982
|
* ```
|
|
1944
1983
|
*/
|
|
1945
|
-
declare function NameListModal({ title, initialName, submitLabel, onCancel, onSubmit, fieldLabel, placeholder, options, }: NameListModalProps): react.ReactPortal;
|
|
1984
|
+
declare function NameListModal({ title, initialName, submitLabel, onCancel, onSubmit, fieldLabel, placeholder, options, className, testIdPrefix, }: NameListModalProps): react.ReactPortal;
|
|
1946
1985
|
|
|
1947
1986
|
/**
|
|
1948
1987
|
* Kept for compatibility. Since 0.18.5 both variants draw the same
|
|
@@ -1953,7 +1992,7 @@ declare function NameListModal({ title, initialName, submitLabel, onCancel, onSu
|
|
|
1953
1992
|
type ChipVariant = "box" | "inline";
|
|
1954
1993
|
/** Shared styling for filter-bar chip triggers, so every dropdown chip matches. */
|
|
1955
1994
|
declare function chipTriggerClass(_variant?: ChipVariant): string;
|
|
1956
|
-
interface ChipContentProps {
|
|
1995
|
+
interface ChipContentProps extends CommonProps {
|
|
1957
1996
|
/** Small uppercase label above the value. */
|
|
1958
1997
|
caption: string;
|
|
1959
1998
|
/** The current selection, shown below the caption. */
|
|
@@ -1985,14 +2024,14 @@ interface ChipContentProps {
|
|
|
1985
2024
|
* </button>
|
|
1986
2025
|
* ```
|
|
1987
2026
|
*/
|
|
1988
|
-
declare function ChipContent({ caption, value, icon }: ChipContentProps): react.JSX.Element;
|
|
2027
|
+
declare function ChipContent({ caption, value, icon, className, testIdPrefix }: ChipContentProps): react.JSX.Element;
|
|
1989
2028
|
|
|
1990
2029
|
interface ChipLike {
|
|
1991
2030
|
key: string;
|
|
1992
2031
|
label: string;
|
|
1993
2032
|
groupLabel: string;
|
|
1994
2033
|
}
|
|
1995
|
-
interface FilterChipBarProps<T extends ChipLike> {
|
|
2034
|
+
interface FilterChipBarProps<T extends ChipLike> extends CommonProps {
|
|
1996
2035
|
/** Any `{ key, label, groupLabel }` shape — only those fields are read. */
|
|
1997
2036
|
chips: T[];
|
|
1998
2037
|
onRemove: (chip: T) => void;
|
|
@@ -2011,7 +2050,7 @@ interface FilterChipBarProps<T extends ChipLike> {
|
|
|
2011
2050
|
* (tooltip + outline). "Clear all" trails the chips. Generic over the
|
|
2012
2051
|
* page's own chip type — only the shared key/label/groupLabel fields are
|
|
2013
2052
|
* used.
|
|
2014
|
-
* @tokens text-micro, rounded-full, bg-subtle, text-text-secondary, text-text-link, text-text-tertiary, bg-text-primary, border-border-default, group-hover:bg-border-default, group-hover:ring-border-interactive, group-hover:text-text-primary, group-hover:text-text-secondary, hover:text-text-primary, shadow-raised, text-surface
|
|
2053
|
+
* @tokens text-micro, rounded-full, bg-subtle, text-text-secondary, text-text-link, text-text-tertiary, bg-text-primary, border-border-default, group-hover:bg-border-default, group-hover:ring-border-interactive, group-hover:text-text-primary, group-hover:text-text-secondary, hover:text-text-primary, shadow-raised, text-surface, focus-visible:outline-border-focus, rounded-small
|
|
2015
2054
|
* @dependencies lucide-react
|
|
2016
2055
|
* @behavior A parked chip (key in `parkedKeys`) renders with no fill and a
|
|
2017
2056
|
* dashed edge instead of the solid applied style, and its hover tooltip
|
|
@@ -2024,7 +2063,7 @@ interface FilterChipBarProps<T extends ChipLike> {
|
|
|
2024
2063
|
* <FilterChipBar chips={activeChips} onRemove={removeChip} onClearAll={clearAll} />
|
|
2025
2064
|
* ```
|
|
2026
2065
|
*/
|
|
2027
|
-
declare function FilterChipBar<T extends ChipLike>({ chips, onRemove, onClearAll, parkedKeys }: FilterChipBarProps<T>): react.JSX.Element | null;
|
|
2066
|
+
declare function FilterChipBar<T extends ChipLike>({ chips, onRemove, onClearAll, parkedKeys, className, testIdPrefix }: FilterChipBarProps<T>): react.JSX.Element | null;
|
|
2028
2067
|
|
|
2029
2068
|
type SortDir = "asc" | "desc";
|
|
2030
2069
|
/** An active column and direction, or `null` for the unsorted state. */
|
|
@@ -2056,7 +2095,7 @@ declare function ariaSortFor<K extends string>(sort: SortState<K> | {
|
|
|
2056
2095
|
dir: SortDir;
|
|
2057
2096
|
}, key: K): "ascending" | "descending" | undefined;
|
|
2058
2097
|
|
|
2059
|
-
interface SortButtonProps<K extends string> {
|
|
2098
|
+
interface SortButtonProps<K extends string> extends CommonProps {
|
|
2060
2099
|
label: string;
|
|
2061
2100
|
sortKey: K;
|
|
2062
2101
|
/** Current sort; a null `key` renders every SortButton inactive. See `sortProp`. */
|
|
@@ -2074,7 +2113,10 @@ interface SortButtonProps<K extends string> {
|
|
|
2074
2113
|
sortable?: boolean;
|
|
2075
2114
|
/** Matches the column's alignment, so a label that wraps lines up with the cells under it. */
|
|
2076
2115
|
align?: "left" | "center" | "right";
|
|
2077
|
-
/**
|
|
2116
|
+
/**
|
|
2117
|
+
* Optional prefix for the button's `data-testid` (`${testIdPrefix}-sort-${sortKey}`, on the root `<button>`;
|
|
2118
|
+
* the plain-text form for `sortable={false}` gets none). Omit for no test-id wiring.
|
|
2119
|
+
*/
|
|
2078
2120
|
testIdPrefix?: string;
|
|
2079
2121
|
}
|
|
2080
2122
|
/**
|
|
@@ -2110,9 +2152,13 @@ interface SortButtonProps<K extends string> {
|
|
|
2110
2152
|
* </th>
|
|
2111
2153
|
* ```
|
|
2112
2154
|
*/
|
|
2113
|
-
declare
|
|
2155
|
+
declare const SortButton: (<K extends string>(props: SortButtonProps<K> & {
|
|
2156
|
+
ref?: Ref<HTMLButtonElement>;
|
|
2157
|
+
}) => ReactElement | null) & {
|
|
2158
|
+
displayName?: string;
|
|
2159
|
+
};
|
|
2114
2160
|
|
|
2115
|
-
interface PagerProps {
|
|
2161
|
+
interface PagerProps extends CommonProps {
|
|
2116
2162
|
/** The current page, 1-indexed. */
|
|
2117
2163
|
page: number;
|
|
2118
2164
|
totalPages: number;
|
|
@@ -2138,7 +2184,7 @@ interface PagerProps {
|
|
|
2138
2184
|
* the left if the reader needs it.
|
|
2139
2185
|
* @avoid under a full-page table -- use TablePagination, which adds the
|
|
2140
2186
|
* first/last steps, the range readout and the rows-per-page select.
|
|
2141
|
-
* @tokens text-dense, rounded-control, text-text-secondary, bg-subtle, text-text-primary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary
|
|
2187
|
+
* @tokens text-dense, rounded-control, text-text-secondary, bg-subtle, text-text-primary, hover:bg-subtle, hover:text-text-primary, text-text-tertiary, focus-visible:outline-border-focus
|
|
2142
2188
|
* @dependencies lucide-react
|
|
2143
2189
|
* @a11y Renders its own <nav aria-label="Pagination"> landmark, like
|
|
2144
2190
|
* TablePagination, so don't wrap it in another <nav>. Pass `label` to name it
|
|
@@ -2151,7 +2197,7 @@ interface PagerProps {
|
|
|
2151
2197
|
* <Pager page={page} totalPages={totalPages} onPage={setPage} />
|
|
2152
2198
|
* ```
|
|
2153
2199
|
*/
|
|
2154
|
-
declare function Pager({ page, totalPages, onPage, disabled, label }: PagerProps): react.JSX.Element;
|
|
2200
|
+
declare function Pager({ page, totalPages, onPage, disabled, label, className, testIdPrefix }: PagerProps): react.JSX.Element;
|
|
2155
2201
|
|
|
2156
2202
|
declare const SIZES$1: {
|
|
2157
2203
|
/** Matches a 15px lucide icon exactly, so a workspace name in a menu row
|
|
@@ -2164,7 +2210,7 @@ declare const SIZES$1: {
|
|
|
2164
2210
|
readonly md: "h-7 w-7 text-micro";
|
|
2165
2211
|
readonly lg: "h-11 w-11 text-panel-title";
|
|
2166
2212
|
};
|
|
2167
|
-
interface WorkspaceAvatarProps {
|
|
2213
|
+
interface WorkspaceAvatarProps extends CommonProps {
|
|
2168
2214
|
/** Omit for the unscoped "All data workspace". */
|
|
2169
2215
|
name?: string;
|
|
2170
2216
|
size?: keyof typeof SIZES$1;
|
|
@@ -2185,10 +2231,10 @@ interface WorkspaceAvatarProps {
|
|
|
2185
2231
|
* <WorkspaceAvatar name="Capital One" size="sm" />
|
|
2186
2232
|
* ```
|
|
2187
2233
|
*/
|
|
2188
|
-
declare function WorkspaceAvatar({ name, size }: WorkspaceAvatarProps): react.JSX.Element;
|
|
2234
|
+
declare function WorkspaceAvatar({ name, size, className, testIdPrefix }: WorkspaceAvatarProps): react.JSX.Element;
|
|
2189
2235
|
|
|
2190
2236
|
type ToastTone = "neutral" | "success" | "warning";
|
|
2191
|
-
interface ToastProps {
|
|
2237
|
+
interface ToastProps extends CommonProps {
|
|
2192
2238
|
/** What happened, in a short sentence. Past tense: "12 accounts removed". */
|
|
2193
2239
|
message: ReactNode;
|
|
2194
2240
|
/**
|
|
@@ -2276,9 +2322,9 @@ interface ToastProps {
|
|
|
2276
2322
|
* <Toast tone="success" message="Account created" onClose={clear} />
|
|
2277
2323
|
* ```
|
|
2278
2324
|
*/
|
|
2279
|
-
declare function Toast({ message, action, onClose, tone, duration, className }: ToastProps): react.ReactPortal;
|
|
2325
|
+
declare function Toast({ message, action, onClose, tone, duration, className, testIdPrefix }: ToastProps): react.ReactPortal;
|
|
2280
2326
|
|
|
2281
|
-
interface TagProps {
|
|
2327
|
+
interface TagProps extends CommonProps {
|
|
2282
2328
|
/** The tag's text, e.g. "Digital". Keep it short: the chip doesn't wrap or truncate. */
|
|
2283
2329
|
children: ReactNode;
|
|
2284
2330
|
/** Extra classes merged onto the chip. */
|
|
@@ -2298,7 +2344,7 @@ interface TagProps {
|
|
|
2298
2344
|
* ```
|
|
2299
2345
|
*/
|
|
2300
2346
|
/** @deprecated Use `<Badge kind="category">`. */
|
|
2301
|
-
declare function Tag({ children, className }: TagProps): react.JSX.Element;
|
|
2347
|
+
declare function Tag({ children, className, testIdPrefix }: TagProps): react.JSX.Element;
|
|
2302
2348
|
|
|
2303
2349
|
/**
|
|
2304
2350
|
* @pattern TablePagination
|
|
@@ -2315,7 +2361,7 @@ declare function Tag({ children, className }: TagProps): react.JSX.Element;
|
|
|
2315
2361
|
* works through, where the total and the page size matter.
|
|
2316
2362
|
* @avoid in a card or a compact list -- use Pager, which is only the page
|
|
2317
2363
|
* controls and fits the narrower space.
|
|
2318
|
-
* @tokens text-dense, rounded-control, text-text-primary, text-text-secondary, text-text-tertiary, bg-subtle, hover:bg-subtle, hover:text-text-primary
|
|
2364
|
+
* @tokens text-dense, rounded-control, text-text-primary, text-text-secondary, text-text-tertiary, bg-subtle, hover:bg-subtle, hover:text-text-primary, focus-visible:outline-border-focus
|
|
2319
2365
|
* @behavior The current page is a quiet grey fill with a dark bold number,
|
|
2320
2366
|
* keeping blue for actions. The rows-per-page control is the compact
|
|
2321
2367
|
* SelectFilter (`size="sm"`), our own menu, not the browser's. First/prev disable on page 1, next/last on the last
|
|
@@ -2360,7 +2406,7 @@ declare function TablePagination({ page, perPage, totalItems, onPageChange, onPe
|
|
|
2360
2406
|
className?: string;
|
|
2361
2407
|
/**
|
|
2362
2408
|
* Optional prefix for `data-testid` attributes on the bar (`testIdPrefix`
|
|
2363
|
-
* itself), the rows-per-page menu (a `SelectFilter`: its button
|
|
2409
|
+
* itself), the rows-per-page menu (a `SelectFilter`: its wrapper `-per-page`, its button
|
|
2364
2410
|
* `-per-page-trigger`, its list `-per-page-popover` and each size
|
|
2365
2411
|
* `-per-page-option-<n>`, e.g. `-per-page-option-50`), the step buttons
|
|
2366
2412
|
* (`-first`, `-prev`, `-next`, `-last`) and each page button (`-page-<n>`).
|
|
@@ -2375,7 +2421,7 @@ type DateGranularity = 'month' | 'quarter' | 'year';
|
|
|
2375
2421
|
/** Resolve a label to its actual [start, end] span, ending at `today`. */
|
|
2376
2422
|
declare function resolveRange(label: string, today?: Date): [Date, Date];
|
|
2377
2423
|
/** @deprecated Use DateRangeFilter, with `granularity="month"` for monthly data. */
|
|
2378
|
-
declare function DateRangePicker({ defaultValue, granularity, align, presets, onChange, onRangeChange, showFooter, today, years, formatDate, formatRange, }: {
|
|
2424
|
+
declare function DateRangePicker({ defaultValue, granularity, align, presets, onChange, onRangeChange, showFooter, today, years, formatDate, formatRange, className, testIdPrefix, }: CommonProps & {
|
|
2379
2425
|
defaultValue?: string;
|
|
2380
2426
|
align?: 'left' | 'right';
|
|
2381
2427
|
/**
|
|
@@ -2464,7 +2510,12 @@ interface MultiSelectGroup {
|
|
|
2464
2510
|
* hints={{ national: "Ads that run nationwide" }} note="Nothing picked means every market." />
|
|
2465
2511
|
* ```
|
|
2466
2512
|
*/
|
|
2467
|
-
declare function MultiSelectFilter({ caption, options, groups, counts, variant, selected, onChange, allLabel, searchable, searchPlaceholder, align, fullIsAll, min, icon, showFooter, clearValue, menuWidthClass, plainParent, fullWidth, loading, error, onRetry, valueLabel, hints, note, }: {
|
|
2513
|
+
declare function MultiSelectFilter({ caption, options, groups, counts, variant, selected, onChange, allLabel, searchable, searchPlaceholder, align, fullIsAll, min, icon, showFooter, clearValue, menuWidthClass, plainParent, fullWidth, loading, error, onRetry, valueLabel, hints, note, className, testIdPrefix, }: Omit<CommonProps, 'testIdPrefix'> & {
|
|
2514
|
+
/**
|
|
2515
|
+
* `data-testid` on the wrapper, and the prefix for the trigger
|
|
2516
|
+
* (`${testIdPrefix}-trigger`) and the open menu (`${testIdPrefix}-popover`).
|
|
2517
|
+
*/
|
|
2518
|
+
testIdPrefix?: string;
|
|
2468
2519
|
caption: string;
|
|
2469
2520
|
/**
|
|
2470
2521
|
* Live option-id -> result count. Supplying it makes the menu faceted:
|
|
@@ -2542,7 +2593,7 @@ declare const SIZES: {
|
|
|
2542
2593
|
readonly on: "translate-x-[22px]";
|
|
2543
2594
|
};
|
|
2544
2595
|
};
|
|
2545
|
-
interface ToggleProps {
|
|
2596
|
+
interface ToggleProps extends CommonProps {
|
|
2546
2597
|
/** Whether the switch is on. Controlled: the parent owns this value. */
|
|
2547
2598
|
checked: boolean;
|
|
2548
2599
|
/** Receives the value being switched TO, not the current one. */
|
|
@@ -2555,7 +2606,7 @@ interface ToggleProps {
|
|
|
2555
2606
|
disabled?: boolean;
|
|
2556
2607
|
/** Extra classes merged onto the track (the outer `<button>`). */
|
|
2557
2608
|
className?: string;
|
|
2558
|
-
/** Optional prefix for the switch's `data-testid` (`${testIdPrefix}-toggle
|
|
2609
|
+
/** Optional prefix for the switch's `data-testid` (`${testIdPrefix}-toggle`, on the root `<button>`). Omit for no test-id wiring. */
|
|
2559
2610
|
testIdPrefix?: string;
|
|
2560
2611
|
}
|
|
2561
2612
|
/**
|
|
@@ -2588,10 +2639,11 @@ interface ToggleProps {
|
|
|
2588
2639
|
* <Toggle size="sm" checked={enabled} onChange={setEnabled} label="Only include enriched creatives" />
|
|
2589
2640
|
* ```
|
|
2590
2641
|
*/
|
|
2591
|
-
declare
|
|
2642
|
+
declare const Toggle: react.ForwardRefExoticComponent<ToggleProps & react.RefAttributes<HTMLButtonElement>>;
|
|
2592
2643
|
|
|
2593
|
-
interface AISparkProps {
|
|
2644
|
+
interface AISparkProps extends CommonProps {
|
|
2594
2645
|
size?: number;
|
|
2646
|
+
/** Classes on the sparkle icon, the visible root (its gradient definition is a hidden sibling). `testIdPrefix` lands on the icon too. */
|
|
2595
2647
|
className?: string;
|
|
2596
2648
|
}
|
|
2597
2649
|
/**
|
|
@@ -2606,10 +2658,10 @@ interface AISparkProps {
|
|
|
2606
2658
|
* <AISpark size={14} />
|
|
2607
2659
|
* ```
|
|
2608
2660
|
*/
|
|
2609
|
-
declare function AISpark({ size, className }: AISparkProps): react.JSX.Element;
|
|
2661
|
+
declare function AISpark({ size, className, testIdPrefix }: AISparkProps): react.JSX.Element;
|
|
2610
2662
|
|
|
2611
2663
|
type FreshnessLevel = "fresh" | "recent" | "stale";
|
|
2612
|
-
interface FreshnessProps {
|
|
2664
|
+
interface FreshnessProps extends CommonProps {
|
|
2613
2665
|
level: FreshnessLevel;
|
|
2614
2666
|
}
|
|
2615
2667
|
/**
|
|
@@ -2628,9 +2680,9 @@ interface FreshnessProps {
|
|
|
2628
2680
|
* <Freshness level="fresh" />
|
|
2629
2681
|
* ```
|
|
2630
2682
|
*/
|
|
2631
|
-
declare function Freshness({ level }: FreshnessProps): react.JSX.Element;
|
|
2683
|
+
declare function Freshness({ level, className, testIdPrefix }: FreshnessProps): react.JSX.Element;
|
|
2632
2684
|
|
|
2633
|
-
interface SectionHeadingProps {
|
|
2685
|
+
interface SectionHeadingProps extends CommonProps {
|
|
2634
2686
|
/** The section's name, in sentence case -- "Saved reports". */
|
|
2635
2687
|
title: ReactNode;
|
|
2636
2688
|
/** One line under the title saying what the section is or how it works. */
|
|
@@ -2680,9 +2732,9 @@ interface SectionHeadingProps {
|
|
|
2680
2732
|
* </section>
|
|
2681
2733
|
* ```
|
|
2682
2734
|
*/
|
|
2683
|
-
declare function SectionHeading({ title, description, actions, as: Tag, id, className }: SectionHeadingProps): react.JSX.Element;
|
|
2735
|
+
declare function SectionHeading({ title, description, actions, as: Tag, id, className, testIdPrefix }: SectionHeadingProps): react.JSX.Element;
|
|
2684
2736
|
|
|
2685
|
-
interface PageHeaderProps {
|
|
2737
|
+
interface PageHeaderProps extends CommonProps {
|
|
2686
2738
|
/** The page's name -- "Report Builder". Title Case for a feature name. */
|
|
2687
2739
|
title: ReactNode;
|
|
2688
2740
|
/** One line under the title saying what the user can do on this page. */
|
|
@@ -2749,10 +2801,10 @@ interface PageHeaderProps {
|
|
|
2749
2801
|
* <PageHeader title="Northwind" back={{ label: "Accounts", href: "/accounts" }} meta={<Badge tone="success">Active</Badge>} />
|
|
2750
2802
|
* ```
|
|
2751
2803
|
*/
|
|
2752
|
-
declare function PageHeader({ title, description, actions, meta, back, className }: PageHeaderProps): react.JSX.Element;
|
|
2804
|
+
declare function PageHeader({ title, description, actions, meta, back, className, testIdPrefix }: PageHeaderProps): react.JSX.Element;
|
|
2753
2805
|
|
|
2754
2806
|
type ModalSize = "sm" | "md" | "lg" | "xl";
|
|
2755
|
-
interface ModalProps {
|
|
2807
|
+
interface ModalProps extends CommonProps {
|
|
2756
2808
|
/** Whether the dialog is showing. */
|
|
2757
2809
|
open: boolean;
|
|
2758
2810
|
/** Called on Escape, a click on the dimmed background, or the close button. */
|
|
@@ -2766,7 +2818,10 @@ interface ModalProps {
|
|
|
2766
2818
|
/** The buttons along the bottom, right-aligned -- primary last. */
|
|
2767
2819
|
footer?: ReactNode;
|
|
2768
2820
|
children?: ReactNode;
|
|
2821
|
+
/** Classes on the dialog panel (the visible surface), not the backdrop. */
|
|
2769
2822
|
className?: string;
|
|
2823
|
+
/** `data-testid` on the dialog panel. */
|
|
2824
|
+
testIdPrefix?: string;
|
|
2770
2825
|
}
|
|
2771
2826
|
/**
|
|
2772
2827
|
* @pattern Modal
|
|
@@ -2814,10 +2869,10 @@ interface ModalProps {
|
|
|
2814
2869
|
* />
|
|
2815
2870
|
* ```
|
|
2816
2871
|
*/
|
|
2817
|
-
declare function Modal({ open, onClose, title, description, size, footer, children, className }: ModalProps): react.ReactPortal | null;
|
|
2872
|
+
declare function Modal({ open, onClose, title, description, size, footer, children, className, testIdPrefix }: ModalProps): react.ReactPortal | null;
|
|
2818
2873
|
|
|
2819
2874
|
type EmptyStateSize = "sm" | "md";
|
|
2820
|
-
interface EmptyStateProps {
|
|
2875
|
+
interface EmptyStateProps extends CommonProps {
|
|
2821
2876
|
/** A lucide icon, about 20px -- `<SearchX size={20} />`. Optional but expected. */
|
|
2822
2877
|
icon?: ReactNode;
|
|
2823
2878
|
/** What's empty, in plain words -- "No brands match". */
|
|
@@ -2857,7 +2912,7 @@ interface EmptyStateProps {
|
|
|
2857
2912
|
* />
|
|
2858
2913
|
* ```
|
|
2859
2914
|
*/
|
|
2860
|
-
declare function EmptyState({ icon, title, description, action, size, className }: EmptyStateProps): react.JSX.Element;
|
|
2915
|
+
declare function EmptyState({ icon, title, description, action, size, className, testIdPrefix }: EmptyStateProps): react.JSX.Element;
|
|
2861
2916
|
|
|
2862
2917
|
interface TabItem<T extends string = string> {
|
|
2863
2918
|
value: T;
|
|
@@ -2866,7 +2921,7 @@ interface TabItem<T extends string = string> {
|
|
|
2866
2921
|
count?: number;
|
|
2867
2922
|
disabled?: boolean;
|
|
2868
2923
|
}
|
|
2869
|
-
interface TabsProps<T extends string = string> {
|
|
2924
|
+
interface TabsProps<T extends string = string> extends CommonProps {
|
|
2870
2925
|
items: TabItem<T>[];
|
|
2871
2926
|
value: T;
|
|
2872
2927
|
onChange: (value: T) => void;
|
|
@@ -2879,6 +2934,8 @@ interface TabsProps<T extends string = string> {
|
|
|
2879
2934
|
*/
|
|
2880
2935
|
idPrefix?: string;
|
|
2881
2936
|
className?: string;
|
|
2937
|
+
/** `data-testid` on the tab list, and the prefix for each tab's (`${testIdPrefix}-tab-<value>`). */
|
|
2938
|
+
testIdPrefix?: string;
|
|
2882
2939
|
}
|
|
2883
2940
|
/**
|
|
2884
2941
|
* @pattern Tabs
|
|
@@ -2911,7 +2968,7 @@ interface TabsProps<T extends string = string> {
|
|
|
2911
2968
|
* />
|
|
2912
2969
|
* ```
|
|
2913
2970
|
*/
|
|
2914
|
-
declare function Tabs<T extends string>({ items, value, onChange, idPrefix, className, ...rest }: TabsProps<T>): react.JSX.Element;
|
|
2971
|
+
declare function Tabs<T extends string>({ items, value, onChange, idPrefix, className, testIdPrefix, ...rest }: TabsProps<T>): react.JSX.Element;
|
|
2915
2972
|
type SegmentedControlSize = "sm" | "md";
|
|
2916
2973
|
interface SegmentedOption<T extends string = string> {
|
|
2917
2974
|
value: T;
|
|
@@ -2919,7 +2976,7 @@ interface SegmentedOption<T extends string = string> {
|
|
|
2919
2976
|
/** Rendered as data-testid on this option's button. */
|
|
2920
2977
|
testId?: string;
|
|
2921
2978
|
}
|
|
2922
|
-
interface SegmentedControlProps<T extends string = string> {
|
|
2979
|
+
interface SegmentedControlProps<T extends string = string> extends CommonProps {
|
|
2923
2980
|
options: SegmentedOption<T>[];
|
|
2924
2981
|
value: T;
|
|
2925
2982
|
onChange: (value: T) => void;
|
|
@@ -2928,6 +2985,11 @@ interface SegmentedControlProps<T extends string = string> {
|
|
|
2928
2985
|
/** sm 32 in toolbars and card headers; md 40 beside md controls. */
|
|
2929
2986
|
size?: SegmentedControlSize;
|
|
2930
2987
|
className?: string;
|
|
2988
|
+
/**
|
|
2989
|
+
* `data-testid` on the group, and the prefix for each option's
|
|
2990
|
+
* (`${testIdPrefix}-option-<value>`) when the option has no `testId` of its own.
|
|
2991
|
+
*/
|
|
2992
|
+
testIdPrefix?: string;
|
|
2931
2993
|
}
|
|
2932
2994
|
/**
|
|
2933
2995
|
* @pattern SegmentedControl
|
|
@@ -2959,10 +3021,14 @@ interface SegmentedControlProps<T extends string = string> {
|
|
|
2959
3021
|
* />
|
|
2960
3022
|
* ```
|
|
2961
3023
|
*/
|
|
2962
|
-
declare function SegmentedControl<T extends string>({ options, value, onChange, size, className, ...rest }: SegmentedControlProps<T>): react.JSX.Element;
|
|
3024
|
+
declare function SegmentedControl<T extends string>({ options, value, onChange, size, className, testIdPrefix, ...rest }: SegmentedControlProps<T>): react.JSX.Element;
|
|
2963
3025
|
|
|
2964
3026
|
type TextFieldSize = "sm" | "md" | "lg";
|
|
2965
|
-
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size"
|
|
3027
|
+
interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "size">, CommonProps {
|
|
3028
|
+
/** Classes on the outer wrapper (label, field and note), not the `<input>`. */
|
|
3029
|
+
className?: string;
|
|
3030
|
+
/** `data-testid` on the outer wrapper. A `data-testid` passed directly goes to the `<input>`, as before. */
|
|
3031
|
+
testIdPrefix?: string;
|
|
2966
3032
|
/** The visible label above the field. Leave it out only when something else on screen names the field, and pass `aria-label`. */
|
|
2967
3033
|
label?: ReactNode;
|
|
2968
3034
|
/** One line under the field -- a format, a limit. Replaced by `error` when there is one. */
|
|
@@ -3006,7 +3072,7 @@ interface TextFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "si
|
|
|
3006
3072
|
declare const TextField: react.ForwardRefExoticComponent<TextFieldProps & react.RefAttributes<HTMLInputElement>>;
|
|
3007
3073
|
|
|
3008
3074
|
type DrawerSize = "sm" | "md" | "lg";
|
|
3009
|
-
interface DrawerProps {
|
|
3075
|
+
interface DrawerProps extends CommonProps {
|
|
3010
3076
|
/** Whether the drawer is showing. It slides in when this turns true and out when it turns false. */
|
|
3011
3077
|
open: boolean;
|
|
3012
3078
|
/** Called on Escape, a click on the dimmed page, or the close button. */
|
|
@@ -3020,7 +3086,10 @@ interface DrawerProps {
|
|
|
3020
3086
|
/** Pinned at the bottom, right-aligned -- "Clear all" and "Apply" for filters. */
|
|
3021
3087
|
footer?: ReactNode;
|
|
3022
3088
|
children?: ReactNode;
|
|
3089
|
+
/** Classes on the dialog panel (the visible surface), not the backdrop. */
|
|
3023
3090
|
className?: string;
|
|
3091
|
+
/** `data-testid` on the dialog panel. */
|
|
3092
|
+
testIdPrefix?: string;
|
|
3024
3093
|
}
|
|
3025
3094
|
/**
|
|
3026
3095
|
* @pattern Drawer
|
|
@@ -3074,7 +3143,7 @@ interface DrawerProps {
|
|
|
3074
3143
|
* </Drawer>
|
|
3075
3144
|
* ```
|
|
3076
3145
|
*/
|
|
3077
|
-
declare function Drawer({ open, onClose, title, description, size, footer, children, className }: DrawerProps): react.ReactPortal | null;
|
|
3146
|
+
declare function Drawer({ open, onClose, title, description, size, footer, children, className, testIdPrefix }: DrawerProps): react.ReactPortal | null;
|
|
3078
3147
|
|
|
3079
3148
|
type DataTableColumnWidth = "fill" | "sm" | "md" | "lg";
|
|
3080
3149
|
type DataTableDensity = "default" | "compact";
|
|
@@ -3097,7 +3166,7 @@ interface DataTableColumn<T, K extends string = string> {
|
|
|
3097
3166
|
/** The first click's direction: names A→Z (`asc`), numbers largest first (`desc`, the numeric default). */
|
|
3098
3167
|
firstDir?: SortDir;
|
|
3099
3168
|
}
|
|
3100
|
-
interface DataTableProps<T, K extends string = string> {
|
|
3169
|
+
interface DataTableProps<T, K extends string = string> extends CommonProps {
|
|
3101
3170
|
columns: DataTableColumn<T, K>[];
|
|
3102
3171
|
rows: T[];
|
|
3103
3172
|
/** A stable key per row -- an id, not the index. */
|
|
@@ -3125,6 +3194,8 @@ interface DataTableProps<T, K extends string = string> {
|
|
|
3125
3194
|
/** Inside the frame, under the rows -- a `Pager`. A full-page table puts `TablePagination` after the table instead. */
|
|
3126
3195
|
footer?: ReactNode;
|
|
3127
3196
|
className?: string;
|
|
3197
|
+
/** `data-testid` on the frame; each sortable header's button gets `${testIdPrefix}-sort-<key>`. */
|
|
3198
|
+
testIdPrefix?: string;
|
|
3128
3199
|
}
|
|
3129
3200
|
/**
|
|
3130
3201
|
* @pattern DataTable
|
|
@@ -3185,10 +3256,10 @@ interface DataTableProps<T, K extends string = string> {
|
|
|
3185
3256
|
* />
|
|
3186
3257
|
* ```
|
|
3187
3258
|
*/
|
|
3188
|
-
declare function DataTable<T, K extends string = string>({ columns, rows, rowKey, title, subtitle, action, sort, onSortChange, density, loading, loadingRows, empty, maxHeight, footer, className, ...rest }: DataTableProps<T, K>): react.JSX.Element;
|
|
3259
|
+
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;
|
|
3189
3260
|
|
|
3190
3261
|
type MediaType = "TV" | "CTV" | "Digital" | "Social" | "Radio" | "Newspaper" | "Magazine";
|
|
3191
|
-
interface MediaLabelProps {
|
|
3262
|
+
interface MediaLabelProps extends CommonProps {
|
|
3192
3263
|
/** The media type. Any other string gets the grey "other" fill, so a new type still renders. */
|
|
3193
3264
|
type: MediaType | (string & {});
|
|
3194
3265
|
/** Extra classes for placement, e.g. `absolute bottom-2 left-2` on a thumbnail. */
|
|
@@ -3228,9 +3299,9 @@ interface MediaLabelProps {
|
|
|
3228
3299
|
* </div>
|
|
3229
3300
|
* ```
|
|
3230
3301
|
*/
|
|
3231
|
-
declare function MediaLabel({ type, className }: MediaLabelProps): react.JSX.Element;
|
|
3302
|
+
declare function MediaLabel({ type, className, testIdPrefix }: MediaLabelProps): react.JSX.Element;
|
|
3232
3303
|
|
|
3233
|
-
interface SuggestionChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"
|
|
3304
|
+
interface SuggestionChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children">, CommonProps {
|
|
3234
3305
|
/** The suggestion itself, in normal case: "Luxury SUV brands", "Where are we wasting seats?". */
|
|
3235
3306
|
children: ReactNode;
|
|
3236
3307
|
}
|
|
@@ -3263,9 +3334,9 @@ interface SuggestionChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElemen
|
|
|
3263
3334
|
* </div>
|
|
3264
3335
|
* ```
|
|
3265
3336
|
*/
|
|
3266
|
-
declare
|
|
3337
|
+
declare const SuggestionChip: react.ForwardRefExoticComponent<SuggestionChipProps & react.RefAttributes<HTMLButtonElement>>;
|
|
3267
3338
|
|
|
3268
|
-
interface ToggleChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "onChange"
|
|
3339
|
+
interface ToggleChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "onChange">, CommonProps {
|
|
3269
3340
|
/** Whether this chip is switched on. */
|
|
3270
3341
|
selected: boolean;
|
|
3271
3342
|
/** Called with the new value when the chip is clicked. */
|
|
@@ -3301,9 +3372,9 @@ interface ToggleChipProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>,
|
|
|
3301
3372
|
* ))}
|
|
3302
3373
|
* ```
|
|
3303
3374
|
*/
|
|
3304
|
-
declare
|
|
3375
|
+
declare const ToggleChip: react.ForwardRefExoticComponent<ToggleChipProps & react.RefAttributes<HTMLButtonElement>>;
|
|
3305
3376
|
|
|
3306
|
-
interface CopyButtonProps {
|
|
3377
|
+
interface CopyButtonProps extends CommonProps {
|
|
3307
3378
|
/** What to copy, or a function that builds it at click time. */
|
|
3308
3379
|
value: string | (() => string);
|
|
3309
3380
|
/** A visible label ("Copy summary"). Leave it out for the icon-only button. */
|
|
@@ -3340,10 +3411,10 @@ interface CopyButtonProps {
|
|
|
3340
3411
|
* <CopyButton value={buildSummary} label="Copy summary" size="sm" />
|
|
3341
3412
|
* ```
|
|
3342
3413
|
*/
|
|
3343
|
-
declare
|
|
3414
|
+
declare const CopyButton: react.ForwardRefExoticComponent<CopyButtonProps & react.RefAttributes<HTMLButtonElement>>;
|
|
3344
3415
|
|
|
3345
3416
|
type InlineMessageTone = "info" | "success" | "warning" | "danger";
|
|
3346
|
-
interface InlineMessageProps {
|
|
3417
|
+
interface InlineMessageProps extends CommonProps {
|
|
3347
3418
|
/** info (default), success, warning or danger. */
|
|
3348
3419
|
tone?: InlineMessageTone;
|
|
3349
3420
|
/** One short line: "A similar organization already exists". */
|
|
@@ -3393,6 +3464,6 @@ interface InlineMessageProps {
|
|
|
3393
3464
|
* actions={<SuggestionChip onClick={useExisting}>Use Acme Corp</SuggestionChip>} />
|
|
3394
3465
|
* ```
|
|
3395
3466
|
*/
|
|
3396
|
-
declare function InlineMessage({ tone, title, children, actions, onDismiss, className }: InlineMessageProps): react.JSX.Element;
|
|
3467
|
+
declare function InlineMessage({ tone, title, children, actions, onDismiss, className, testIdPrefix }: InlineMessageProps): react.JSX.Element;
|
|
3397
3468
|
|
|
3398
|
-
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, Badge, type BadgeKind, type BadgeProps, type BadgeTone, BarChartPlaceholder, type BarChartPlaceholderProps, Button, type ButtonProps, Card, type CardProps, CheckBox, CheckBoxBox, type CheckBoxBoxProps, type CheckBoxProps, ChipContent, type ChipContentProps, type ChipVariant, CopyButton, type CopyButtonProps, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, Drawer, type DrawerProps, type DrawerSize, EmptyState, type EmptyStateProps, type EmptyStateSize, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LineChartPlaceholder, type LineChartPlaceholderProps, MediaLabel, type MediaLabelProps, type MediaType, Modal, type ModalProps, type ModalSize, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, SectionHeading, type SectionHeadingProps, SectionRail, type SectionRailProps, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type SegmentedOption, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, TablePagination, type TablePaginationProps, Tabs, type TabsProps, Tag, type TagProps, TextField, type TextFieldProps, type TextFieldSize, Toast, type ToastProps, type ToastTone, Toggle, ToggleChip, type ToggleChipProps, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, ariaSortFor, buttonVariants, chipTriggerClass, cycleSort, noResultsBody, resolveRange, sortProp };
|
|
3469
|
+
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, type CommonProps, CopyButton, type CopyButtonProps, DEFAULT_SEARCH_MATCH, DataScopeFilter, type DataScopeFilterProps, DataTable, type DataTableColumn, type DataTableColumnWidth, type DataTableDensity, type DataTableProps, type DateGranularity, DateRangeFilter, type DateRangeFilterProps, DateRangePicker, type DateRangePickerProps, Delta, type DeltaProps, Drawer, type DrawerProps, type DrawerSize, EmptyState, type EmptyStateProps, type EmptyStateSize, FilterChipBar, type FilterChipBarProps, FilterDropdownFooter, type FilterDropdownFooterProps, Freshness, type FreshnessLevel, type FreshnessProps, InfoTip, type InfoTipProps, InlineMessage, type InlineMessageProps, type InlineMessageTone, LineChartPlaceholder, type LineChartPlaceholderProps, MediaLabel, type MediaLabelProps, type MediaType, Modal, type ModalProps, type ModalSize, MultiSelectFilter, type MultiSelectFilterProps, type MultiSelectGroup, NO_RESULTS_BODY, NO_RESULTS_TITLE, NameListModal, type NameListModalProps, type NoResultsAction, NoResultsEmptyState, type NoResultsEmptyStateProps, PRIMARY_ACTION_CLASS, PageHeader, type PageHeaderProps, Pager, type PagerProps, type PickerColumn, type PickerFilter, type PickerRow, PieChartPlaceholder, type PieChartPlaceholderProps, type PubBreak, PublisherBreakdownList, type PublisherBreakdownListProps, QUIET_ACTION_CLASS, SearchBar, type SearchBarProps, type SearchBarSize, type SearchBarVariant, type SearchMatchMode, type SearchMatchValue, SectionHeading, type SectionHeadingProps, SectionRail, type SectionRailProps, SegmentedControl, type SegmentedControlProps, type SegmentedControlSize, type SegmentedOption, SelectAllVisible, type SelectAllVisibleProps, SelectFilter, type SelectFilterProps, SelectedSection, type SelectedSectionProps, SelectionPicker, type SelectionPickerAccountList, type SelectionPickerProps, SortButton, type SortButtonProps, type SortDir, type SortState, StackedColumnPlaceholder, type StackedColumnPlaceholderProps, SuggestionChip, type SuggestionChipProps, type SummaryGroup, type SummaryGroupItemValue, type TabItem, TablePagination, type TablePaginationProps, Tabs, type TabsProps, Tag, type TagProps, TextField, type TextFieldProps, type TextFieldSize, Toast, type ToastProps, type ToastTone, Toggle, ToggleChip, type ToggleChipProps, type ToggleProps, Tooltip, type TooltipProps, WorkspaceAvatar, type WorkspaceAvatarProps, WorkspaceSelectedCard, type WorkspaceSelectedCardProps, ariaSortFor, buttonVariants, chipTriggerClass, cycleSort, noResultsBody, resolveRange, sortProp };
|