@mediaradar/design-components 0.11.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +522 -439
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +74 -2
- package/dist/index.d.ts +74 -2
- package/dist/index.js +381 -299
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/scripts/tailwind-coverage.mjs +11 -0
package/dist/index.d.cts
CHANGED
|
@@ -146,6 +146,78 @@ interface AdvertiserSearchPromptProps {
|
|
|
146
146
|
}
|
|
147
147
|
declare function AdvertiserSearchPrompt({ label }: AdvertiserSearchPromptProps): react.JSX.Element;
|
|
148
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Fill and ink. `tone` answers "what kind of thing is this", never "what
|
|
151
|
+
* colour do I want" -- a caller reaching for `danger` because red looks good
|
|
152
|
+
* is the start of the drift this component replaces.
|
|
153
|
+
*/
|
|
154
|
+
type BadgeTone = "neutral" | "brand" | "success" | "warning" | "danger" | "ai" | "overlay";
|
|
155
|
+
/**
|
|
156
|
+
* Shape and case. Orthogonal to tone: any tone can be any kind, which is what
|
|
157
|
+
* keeps this two small props instead of one list of every combination the
|
|
158
|
+
* product happens to use today.
|
|
159
|
+
*/
|
|
160
|
+
type BadgeKind = "label" | "count" | "eyebrow";
|
|
161
|
+
interface BadgeProps {
|
|
162
|
+
/** What kind of thing this marks. Not a colour choice. */
|
|
163
|
+
tone?: BadgeTone;
|
|
164
|
+
/** Shape and case. `count` for a number, `eyebrow` for a category label. */
|
|
165
|
+
kind?: BadgeKind;
|
|
166
|
+
/** Text, or an icon plus text. Keep it to a few words -- a badge annotates, it does not explain. */
|
|
167
|
+
children: ReactNode;
|
|
168
|
+
className?: string;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* @pattern Badge
|
|
172
|
+
* @description The one small label that annotates something else: a count on
|
|
173
|
+
* a filter, a status, a category, an AI marker, a flag over artwork. Two
|
|
174
|
+
* props -- `tone` (what kind of thing) and `kind` (shape and case) -- which
|
|
175
|
+
* between them cover every badge treatment in the product.
|
|
176
|
+
* @props
|
|
177
|
+
* tone?: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
|
|
178
|
+
* kind?: 'label' | 'count' | 'eyebrow' (default 'label')
|
|
179
|
+
* children: ReactNode
|
|
180
|
+
* @tokens text-micro, rounded-full, bg-subtle, bg-brand-primarySoft,
|
|
181
|
+
* bg-status-success/15, bg-status-warning/30, bg-status-danger/15, bg-scrim,
|
|
182
|
+
* text-text-secondary, text-brand-primaryAction, text-text-success,
|
|
183
|
+
* text-text-warning, text-text-danger, text-ai-ontint, text-brand-onprimary,
|
|
184
|
+
* border-transparent
|
|
185
|
+
* @behavior Not interactive and carries no role: a badge is a label on
|
|
186
|
+
* something else, so it is read as part of that thing rather than announced
|
|
187
|
+
* separately. Anything clickable is a Button or a filter chip, not a Badge.
|
|
188
|
+
* Every badge is one size -- the `micro` step (11px) -- because a badge
|
|
189
|
+
* that competes with the content it annotates has stopped being a badge.
|
|
190
|
+
* @variant neutral - Default. A category, a count of something unremarkable, a quiet flag.
|
|
191
|
+
* @variant brand - This item is special in a way the product cares about -- primary, selected, yours.
|
|
192
|
+
* @variant success - A finished or healthy state. Never just "green because it is good news".
|
|
193
|
+
* @variant warning - Needs attention but is not broken. Partial data, an approaching limit.
|
|
194
|
+
* @variant danger - Failed, expired, or over a hard limit. Not merely "important".
|
|
195
|
+
* @variant ai - Generated or AI-assisted content, so the reader knows where it came from.
|
|
196
|
+
* @variant overlay - Sits on top of an image or video still, where no theme surface exists behind it.
|
|
197
|
+
* @use when you need to annotate something else -- a status on a row, a count
|
|
198
|
+
* on a filter tab, a category on a card, a flag over a thumbnail.
|
|
199
|
+
* @use when the label is a few words at most and the reader does not need to
|
|
200
|
+
* act on it.
|
|
201
|
+
* @avoid when the thing is clickable -- use Button, or a filter chip. A badge
|
|
202
|
+
* has no role, no focus state and no hit target, so making one clickable
|
|
203
|
+
* hides the action from keyboard and screen-reader users entirely.
|
|
204
|
+
* @avoid when the text is a sentence, or needs to wrap. A badge that wraps
|
|
205
|
+
* has become a callout; use one.
|
|
206
|
+
* @avoid when you are choosing the tone by colour rather than by meaning. A
|
|
207
|
+
* red badge that does not mean failure teaches readers to ignore red.
|
|
208
|
+
* @avoid when several sit in a row and all say something different -- that is
|
|
209
|
+
* a definition list wearing badges, and reads as noise.
|
|
210
|
+
* @usage
|
|
211
|
+
* ```tsx
|
|
212
|
+
* <Badge>Financial Services</Badge>
|
|
213
|
+
* <Badge tone="brand" kind="count">{selected.length}</Badge>
|
|
214
|
+
* <Badge tone="warning">Partial month</Badge>
|
|
215
|
+
* <Badge kind="eyebrow" tone="neutral">Saved view</Badge>
|
|
216
|
+
* <Badge tone="brand"><Check size={11} aria-hidden="true" />Primary</Badge>
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
declare function Badge({ tone, kind, children, className }: BadgeProps): react.JSX.Element;
|
|
220
|
+
|
|
149
221
|
/**
|
|
150
222
|
* @pattern CheckBox
|
|
151
223
|
* @description Tri-state checkbox rendered as a `<button>` (not a native
|
|
@@ -1315,7 +1387,7 @@ interface PublisherBreakdownListProps {
|
|
|
1315
1387
|
declare function PublisherBreakdownList({ rows, defaultVisibleCount, padded, viewAllHref, renderLogo }: PublisherBreakdownListProps): react.JSX.Element;
|
|
1316
1388
|
|
|
1317
1389
|
declare const buttonVariants: (props?: ({
|
|
1318
|
-
variant?: "link" | "
|
|
1390
|
+
variant?: "link" | "danger" | "primary" | "secondary" | "ghost" | null | undefined;
|
|
1319
1391
|
size?: "icon" | "sm" | "md" | "lg" | null | undefined;
|
|
1320
1392
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1321
1393
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -1903,4 +1975,4 @@ interface FreshnessProps {
|
|
|
1903
1975
|
*/
|
|
1904
1976
|
declare function Freshness({ level }: FreshnessProps): react.JSX.Element;
|
|
1905
1977
|
|
|
1906
|
-
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, 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 };
|
|
1978
|
+
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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -146,6 +146,78 @@ interface AdvertiserSearchPromptProps {
|
|
|
146
146
|
}
|
|
147
147
|
declare function AdvertiserSearchPrompt({ label }: AdvertiserSearchPromptProps): react.JSX.Element;
|
|
148
148
|
|
|
149
|
+
/**
|
|
150
|
+
* Fill and ink. `tone` answers "what kind of thing is this", never "what
|
|
151
|
+
* colour do I want" -- a caller reaching for `danger` because red looks good
|
|
152
|
+
* is the start of the drift this component replaces.
|
|
153
|
+
*/
|
|
154
|
+
type BadgeTone = "neutral" | "brand" | "success" | "warning" | "danger" | "ai" | "overlay";
|
|
155
|
+
/**
|
|
156
|
+
* Shape and case. Orthogonal to tone: any tone can be any kind, which is what
|
|
157
|
+
* keeps this two small props instead of one list of every combination the
|
|
158
|
+
* product happens to use today.
|
|
159
|
+
*/
|
|
160
|
+
type BadgeKind = "label" | "count" | "eyebrow";
|
|
161
|
+
interface BadgeProps {
|
|
162
|
+
/** What kind of thing this marks. Not a colour choice. */
|
|
163
|
+
tone?: BadgeTone;
|
|
164
|
+
/** Shape and case. `count` for a number, `eyebrow` for a category label. */
|
|
165
|
+
kind?: BadgeKind;
|
|
166
|
+
/** Text, or an icon plus text. Keep it to a few words -- a badge annotates, it does not explain. */
|
|
167
|
+
children: ReactNode;
|
|
168
|
+
className?: string;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* @pattern Badge
|
|
172
|
+
* @description The one small label that annotates something else: a count on
|
|
173
|
+
* a filter, a status, a category, an AI marker, a flag over artwork. Two
|
|
174
|
+
* props -- `tone` (what kind of thing) and `kind` (shape and case) -- which
|
|
175
|
+
* between them cover every badge treatment in the product.
|
|
176
|
+
* @props
|
|
177
|
+
* tone?: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
|
|
178
|
+
* kind?: 'label' | 'count' | 'eyebrow' (default 'label')
|
|
179
|
+
* children: ReactNode
|
|
180
|
+
* @tokens text-micro, rounded-full, bg-subtle, bg-brand-primarySoft,
|
|
181
|
+
* bg-status-success/15, bg-status-warning/30, bg-status-danger/15, bg-scrim,
|
|
182
|
+
* text-text-secondary, text-brand-primaryAction, text-text-success,
|
|
183
|
+
* text-text-warning, text-text-danger, text-ai-ontint, text-brand-onprimary,
|
|
184
|
+
* border-transparent
|
|
185
|
+
* @behavior Not interactive and carries no role: a badge is a label on
|
|
186
|
+
* something else, so it is read as part of that thing rather than announced
|
|
187
|
+
* separately. Anything clickable is a Button or a filter chip, not a Badge.
|
|
188
|
+
* Every badge is one size -- the `micro` step (11px) -- because a badge
|
|
189
|
+
* that competes with the content it annotates has stopped being a badge.
|
|
190
|
+
* @variant neutral - Default. A category, a count of something unremarkable, a quiet flag.
|
|
191
|
+
* @variant brand - This item is special in a way the product cares about -- primary, selected, yours.
|
|
192
|
+
* @variant success - A finished or healthy state. Never just "green because it is good news".
|
|
193
|
+
* @variant warning - Needs attention but is not broken. Partial data, an approaching limit.
|
|
194
|
+
* @variant danger - Failed, expired, or over a hard limit. Not merely "important".
|
|
195
|
+
* @variant ai - Generated or AI-assisted content, so the reader knows where it came from.
|
|
196
|
+
* @variant overlay - Sits on top of an image or video still, where no theme surface exists behind it.
|
|
197
|
+
* @use when you need to annotate something else -- a status on a row, a count
|
|
198
|
+
* on a filter tab, a category on a card, a flag over a thumbnail.
|
|
199
|
+
* @use when the label is a few words at most and the reader does not need to
|
|
200
|
+
* act on it.
|
|
201
|
+
* @avoid when the thing is clickable -- use Button, or a filter chip. A badge
|
|
202
|
+
* has no role, no focus state and no hit target, so making one clickable
|
|
203
|
+
* hides the action from keyboard and screen-reader users entirely.
|
|
204
|
+
* @avoid when the text is a sentence, or needs to wrap. A badge that wraps
|
|
205
|
+
* has become a callout; use one.
|
|
206
|
+
* @avoid when you are choosing the tone by colour rather than by meaning. A
|
|
207
|
+
* red badge that does not mean failure teaches readers to ignore red.
|
|
208
|
+
* @avoid when several sit in a row and all say something different -- that is
|
|
209
|
+
* a definition list wearing badges, and reads as noise.
|
|
210
|
+
* @usage
|
|
211
|
+
* ```tsx
|
|
212
|
+
* <Badge>Financial Services</Badge>
|
|
213
|
+
* <Badge tone="brand" kind="count">{selected.length}</Badge>
|
|
214
|
+
* <Badge tone="warning">Partial month</Badge>
|
|
215
|
+
* <Badge kind="eyebrow" tone="neutral">Saved view</Badge>
|
|
216
|
+
* <Badge tone="brand"><Check size={11} aria-hidden="true" />Primary</Badge>
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
declare function Badge({ tone, kind, children, className }: BadgeProps): react.JSX.Element;
|
|
220
|
+
|
|
149
221
|
/**
|
|
150
222
|
* @pattern CheckBox
|
|
151
223
|
* @description Tri-state checkbox rendered as a `<button>` (not a native
|
|
@@ -1315,7 +1387,7 @@ interface PublisherBreakdownListProps {
|
|
|
1315
1387
|
declare function PublisherBreakdownList({ rows, defaultVisibleCount, padded, viewAllHref, renderLogo }: PublisherBreakdownListProps): react.JSX.Element;
|
|
1316
1388
|
|
|
1317
1389
|
declare const buttonVariants: (props?: ({
|
|
1318
|
-
variant?: "link" | "
|
|
1390
|
+
variant?: "link" | "danger" | "primary" | "secondary" | "ghost" | null | undefined;
|
|
1319
1391
|
size?: "icon" | "sm" | "md" | "lg" | null | undefined;
|
|
1320
1392
|
} & class_variance_authority_types.ClassProp) | undefined) => string;
|
|
1321
1393
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement>, VariantProps<typeof buttonVariants> {
|
|
@@ -1903,4 +1975,4 @@ interface FreshnessProps {
|
|
|
1903
1975
|
*/
|
|
1904
1976
|
declare function Freshness({ level }: FreshnessProps): react.JSX.Element;
|
|
1905
1977
|
|
|
1906
|
-
export { AISpark, type AISparkProps, AdvertiserNoResults, type AdvertiserNoResultsProps, AdvertiserQuickFilter, type AdvertiserQuickFilterProps, AdvertiserSearchPrompt, type AdvertiserSearchPromptProps, 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 };
|
|
1978
|
+
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 };
|