@mediaradar/design-components 0.12.0 → 0.13.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 +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +5 -4
- package/dist/index.d.ts +5 -4
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -151,7 +151,7 @@ declare function AdvertiserSearchPrompt({ label }: AdvertiserSearchPromptProps):
|
|
|
151
151
|
* colour do I want" -- a caller reaching for `danger` because red looks good
|
|
152
152
|
* is the start of the drift this component replaces.
|
|
153
153
|
*/
|
|
154
|
-
type BadgeTone = "neutral" | "brand" | "success" | "warning" | "danger" | "ai" | "overlay";
|
|
154
|
+
type BadgeTone = "neutral" | "brand" | "brandSolid" | "success" | "warning" | "danger" | "ai" | "overlay";
|
|
155
155
|
/**
|
|
156
156
|
* Shape and case. Orthogonal to tone: any tone can be any kind, which is what
|
|
157
157
|
* keeps this two small props instead of one list of every combination the
|
|
@@ -174,10 +174,10 @@ interface BadgeProps {
|
|
|
174
174
|
* props -- `tone` (what kind of thing) and `kind` (shape and case) -- which
|
|
175
175
|
* between them cover every badge treatment in the product.
|
|
176
176
|
* @props
|
|
177
|
-
* tone?: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
|
|
177
|
+
* tone?: 'neutral' | 'brand' | 'brandSolid' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
|
|
178
178
|
* kind?: 'label' | 'count' | 'eyebrow' (default 'label')
|
|
179
179
|
* children: ReactNode
|
|
180
|
-
* @tokens text-micro, rounded-full, bg-subtle, bg-brand-primarySoft,
|
|
180
|
+
* @tokens text-micro, rounded-full, bg-subtle, bg-brand-primarySoft, bg-brand-primaryAction,
|
|
181
181
|
* bg-status-success/15, bg-status-warning/30, bg-status-danger/15, bg-scrim,
|
|
182
182
|
* text-text-secondary, text-brand-primaryAction, text-text-success,
|
|
183
183
|
* text-text-warning, text-text-danger, text-ai-ontint, text-brand-onprimary,
|
|
@@ -189,6 +189,7 @@ interface BadgeProps {
|
|
|
189
189
|
* that competes with the content it annotates has stopped being a badge.
|
|
190
190
|
* @variant neutral - Default. A category, a count of something unremarkable, a quiet flag.
|
|
191
191
|
* @variant brand - This item is special in a way the product cares about -- primary, selected, yours.
|
|
192
|
+
* @variant brandSolid - Full brand fill, for a count that has to be noticed: active filters, unread, selected.
|
|
192
193
|
* @variant success - A finished or healthy state. Never just "green because it is good news".
|
|
193
194
|
* @variant warning - Needs attention but is not broken. Partial data, an approaching limit.
|
|
194
195
|
* @variant danger - Failed, expired, or over a hard limit. Not merely "important".
|
|
@@ -210,7 +211,7 @@ interface BadgeProps {
|
|
|
210
211
|
* @usage
|
|
211
212
|
* ```tsx
|
|
212
213
|
* <Badge>Financial Services</Badge>
|
|
213
|
-
* <Badge tone="
|
|
214
|
+
* <Badge tone="brandSolid" kind="count">{activeFilters}</Badge>
|
|
214
215
|
* <Badge tone="warning">Partial month</Badge>
|
|
215
216
|
* <Badge kind="eyebrow" tone="neutral">Saved view</Badge>
|
|
216
217
|
* <Badge tone="brand"><Check size={11} aria-hidden="true" />Primary</Badge>
|
package/dist/index.d.ts
CHANGED
|
@@ -151,7 +151,7 @@ declare function AdvertiserSearchPrompt({ label }: AdvertiserSearchPromptProps):
|
|
|
151
151
|
* colour do I want" -- a caller reaching for `danger` because red looks good
|
|
152
152
|
* is the start of the drift this component replaces.
|
|
153
153
|
*/
|
|
154
|
-
type BadgeTone = "neutral" | "brand" | "success" | "warning" | "danger" | "ai" | "overlay";
|
|
154
|
+
type BadgeTone = "neutral" | "brand" | "brandSolid" | "success" | "warning" | "danger" | "ai" | "overlay";
|
|
155
155
|
/**
|
|
156
156
|
* Shape and case. Orthogonal to tone: any tone can be any kind, which is what
|
|
157
157
|
* keeps this two small props instead of one list of every combination the
|
|
@@ -174,10 +174,10 @@ interface BadgeProps {
|
|
|
174
174
|
* props -- `tone` (what kind of thing) and `kind` (shape and case) -- which
|
|
175
175
|
* between them cover every badge treatment in the product.
|
|
176
176
|
* @props
|
|
177
|
-
* tone?: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
|
|
177
|
+
* tone?: 'neutral' | 'brand' | 'brandSolid' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
|
|
178
178
|
* kind?: 'label' | 'count' | 'eyebrow' (default 'label')
|
|
179
179
|
* children: ReactNode
|
|
180
|
-
* @tokens text-micro, rounded-full, bg-subtle, bg-brand-primarySoft,
|
|
180
|
+
* @tokens text-micro, rounded-full, bg-subtle, bg-brand-primarySoft, bg-brand-primaryAction,
|
|
181
181
|
* bg-status-success/15, bg-status-warning/30, bg-status-danger/15, bg-scrim,
|
|
182
182
|
* text-text-secondary, text-brand-primaryAction, text-text-success,
|
|
183
183
|
* text-text-warning, text-text-danger, text-ai-ontint, text-brand-onprimary,
|
|
@@ -189,6 +189,7 @@ interface BadgeProps {
|
|
|
189
189
|
* that competes with the content it annotates has stopped being a badge.
|
|
190
190
|
* @variant neutral - Default. A category, a count of something unremarkable, a quiet flag.
|
|
191
191
|
* @variant brand - This item is special in a way the product cares about -- primary, selected, yours.
|
|
192
|
+
* @variant brandSolid - Full brand fill, for a count that has to be noticed: active filters, unread, selected.
|
|
192
193
|
* @variant success - A finished or healthy state. Never just "green because it is good news".
|
|
193
194
|
* @variant warning - Needs attention but is not broken. Partial data, an approaching limit.
|
|
194
195
|
* @variant danger - Failed, expired, or over a hard limit. Not merely "important".
|
|
@@ -210,7 +211,7 @@ interface BadgeProps {
|
|
|
210
211
|
* @usage
|
|
211
212
|
* ```tsx
|
|
212
213
|
* <Badge>Financial Services</Badge>
|
|
213
|
-
* <Badge tone="
|
|
214
|
+
* <Badge tone="brandSolid" kind="count">{activeFilters}</Badge>
|
|
214
215
|
* <Badge tone="warning">Partial month</Badge>
|
|
215
216
|
* <Badge kind="eyebrow" tone="neutral">Saved view</Badge>
|
|
216
217
|
* <Badge tone="brand"><Check size={11} aria-hidden="true" />Primary</Badge>
|
package/dist/index.js
CHANGED
|
@@ -407,6 +407,12 @@ import { jsx as jsx4 } from "react/jsx-runtime";
|
|
|
407
407
|
var TONE = {
|
|
408
408
|
neutral: "bg-subtle text-text-secondary",
|
|
409
409
|
brand: "bg-brand-primarySoft text-brand-primaryAction",
|
|
410
|
+
// Solid, not a tint. A filter count's whole job is to be noticed -- it is
|
|
411
|
+
// what tells you the view you are looking at is filtered at all -- so it
|
|
412
|
+
// carries the full brand fill rather than the soft wash `brand` uses for a
|
|
413
|
+
// label like "Primary". Missed in the first pass, which collapsed both into
|
|
414
|
+
// one tone; the swap onto real call sites is what surfaced it.
|
|
415
|
+
brandSolid: "bg-brand-primaryAction text-brand-onprimary",
|
|
410
416
|
success: "bg-status-success/15 text-text-success",
|
|
411
417
|
// Heavier tint than success and danger on purpose. Equal opacity does not
|
|
412
418
|
// give equal presence: the warning amber (#b8843a) sits far closer to the
|