@mediaradar/design-components 0.12.0 → 0.14.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.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
@@ -163,6 +163,14 @@ interface BadgeProps {
163
163
  tone?: BadgeTone;
164
164
  /** Shape and case. `count` for a number, `eyebrow` for a category label. */
165
165
  kind?: BadgeKind;
166
+ /**
167
+ * Draws a small filled dot before the label, in the tone's own ink. For a
168
+ * status that is scanned down a column rather than read -- the dot is what
169
+ * the eye follows, and it carries the colour at a size the text cannot.
170
+ * Purely decorative: the label is the accessible content, so the dot is
171
+ * hidden from assistive tech rather than announced as a second thing.
172
+ */
173
+ dot?: boolean;
166
174
  /** Text, or an icon plus text. Keep it to a few words -- a badge annotates, it does not explain. */
167
175
  children: ReactNode;
168
176
  className?: string;
@@ -174,10 +182,11 @@ interface BadgeProps {
174
182
  * props -- `tone` (what kind of thing) and `kind` (shape and case) -- which
175
183
  * between them cover every badge treatment in the product.
176
184
  * @props
177
- * tone?: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
185
+ * tone?: 'neutral' | 'brand' | 'brandSolid' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
178
186
  * kind?: 'label' | 'count' | 'eyebrow' (default 'label')
187
+ * dot?: boolean (default false) -- a filled dot before the label, in the tone's ink
179
188
  * children: ReactNode
180
- * @tokens text-micro, rounded-full, bg-subtle, bg-brand-primarySoft,
189
+ * @tokens text-micro, rounded-full, bg-current, bg-subtle, bg-brand-primarySoft, bg-brand-primaryAction,
181
190
  * bg-status-success/15, bg-status-warning/30, bg-status-danger/15, bg-scrim,
182
191
  * text-text-secondary, text-brand-primaryAction, text-text-success,
183
192
  * text-text-warning, text-text-danger, text-ai-ontint, text-brand-onprimary,
@@ -189,6 +198,7 @@ interface BadgeProps {
189
198
  * that competes with the content it annotates has stopped being a badge.
190
199
  * @variant neutral - Default. A category, a count of something unremarkable, a quiet flag.
191
200
  * @variant brand - This item is special in a way the product cares about -- primary, selected, yours.
201
+ * @variant brandSolid - Full brand fill, for a count that has to be noticed: active filters, unread, selected.
192
202
  * @variant success - A finished or healthy state. Never just "green because it is good news".
193
203
  * @variant warning - Needs attention but is not broken. Partial data, an approaching limit.
194
204
  * @variant danger - Failed, expired, or over a hard limit. Not merely "important".
@@ -210,13 +220,14 @@ interface BadgeProps {
210
220
  * @usage
211
221
  * ```tsx
212
222
  * <Badge>Financial Services</Badge>
213
- * <Badge tone="brand" kind="count">{selected.length}</Badge>
223
+ * <Badge tone="brandSolid" kind="count">{activeFilters}</Badge>
214
224
  * <Badge tone="warning">Partial month</Badge>
225
+ * <Badge tone="success" dot>Completed</Badge>
215
226
  * <Badge kind="eyebrow" tone="neutral">Saved view</Badge>
216
227
  * <Badge tone="brand"><Check size={11} aria-hidden="true" />Primary</Badge>
217
228
  * ```
218
229
  */
219
- declare function Badge({ tone, kind, children, className }: BadgeProps): react.JSX.Element;
230
+ declare function Badge({ tone, kind, dot, children, className }: BadgeProps): react.JSX.Element;
220
231
 
221
232
  /**
222
233
  * @pattern CheckBox
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
@@ -163,6 +163,14 @@ interface BadgeProps {
163
163
  tone?: BadgeTone;
164
164
  /** Shape and case. `count` for a number, `eyebrow` for a category label. */
165
165
  kind?: BadgeKind;
166
+ /**
167
+ * Draws a small filled dot before the label, in the tone's own ink. For a
168
+ * status that is scanned down a column rather than read -- the dot is what
169
+ * the eye follows, and it carries the colour at a size the text cannot.
170
+ * Purely decorative: the label is the accessible content, so the dot is
171
+ * hidden from assistive tech rather than announced as a second thing.
172
+ */
173
+ dot?: boolean;
166
174
  /** Text, or an icon plus text. Keep it to a few words -- a badge annotates, it does not explain. */
167
175
  children: ReactNode;
168
176
  className?: string;
@@ -174,10 +182,11 @@ interface BadgeProps {
174
182
  * props -- `tone` (what kind of thing) and `kind` (shape and case) -- which
175
183
  * between them cover every badge treatment in the product.
176
184
  * @props
177
- * tone?: 'neutral' | 'brand' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
185
+ * tone?: 'neutral' | 'brand' | 'brandSolid' | 'success' | 'warning' | 'danger' | 'ai' | 'overlay' (default 'neutral')
178
186
  * kind?: 'label' | 'count' | 'eyebrow' (default 'label')
187
+ * dot?: boolean (default false) -- a filled dot before the label, in the tone's ink
179
188
  * children: ReactNode
180
- * @tokens text-micro, rounded-full, bg-subtle, bg-brand-primarySoft,
189
+ * @tokens text-micro, rounded-full, bg-current, bg-subtle, bg-brand-primarySoft, bg-brand-primaryAction,
181
190
  * bg-status-success/15, bg-status-warning/30, bg-status-danger/15, bg-scrim,
182
191
  * text-text-secondary, text-brand-primaryAction, text-text-success,
183
192
  * text-text-warning, text-text-danger, text-ai-ontint, text-brand-onprimary,
@@ -189,6 +198,7 @@ interface BadgeProps {
189
198
  * that competes with the content it annotates has stopped being a badge.
190
199
  * @variant neutral - Default. A category, a count of something unremarkable, a quiet flag.
191
200
  * @variant brand - This item is special in a way the product cares about -- primary, selected, yours.
201
+ * @variant brandSolid - Full brand fill, for a count that has to be noticed: active filters, unread, selected.
192
202
  * @variant success - A finished or healthy state. Never just "green because it is good news".
193
203
  * @variant warning - Needs attention but is not broken. Partial data, an approaching limit.
194
204
  * @variant danger - Failed, expired, or over a hard limit. Not merely "important".
@@ -210,13 +220,14 @@ interface BadgeProps {
210
220
  * @usage
211
221
  * ```tsx
212
222
  * <Badge>Financial Services</Badge>
213
- * <Badge tone="brand" kind="count">{selected.length}</Badge>
223
+ * <Badge tone="brandSolid" kind="count">{activeFilters}</Badge>
214
224
  * <Badge tone="warning">Partial month</Badge>
225
+ * <Badge tone="success" dot>Completed</Badge>
215
226
  * <Badge kind="eyebrow" tone="neutral">Saved view</Badge>
216
227
  * <Badge tone="brand"><Check size={11} aria-hidden="true" />Primary</Badge>
217
228
  * ```
218
229
  */
219
- declare function Badge({ tone, kind, children, className }: BadgeProps): react.JSX.Element;
230
+ declare function Badge({ tone, kind, dot, children, className }: BadgeProps): react.JSX.Element;
220
231
 
221
232
  /**
222
233
  * @pattern CheckBox