Skip to content

Commit eccae17

Browse files
style: Adjusted Badges so we only refer to using tint appearence and circular shape
1 parent 0021ba7 commit eccae17

1 file changed

Lines changed: 20 additions & 61 deletions

File tree

examples/src/storybook/ui-patterns/stories/BadgePatterns.stories.tsx

Lines changed: 20 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import {
22
Badge,
3-
CounterBadge,
43
PresenceBadge,
54
Table,
65
TableBody,
@@ -246,7 +245,7 @@ function MultipleBadgesTable() {
246245
}
247246
aria-label={row.connectivity}
248247
/>
249-
<Badge appearance="outline" color={severityMap[row.severity]}>
248+
<Badge appearance="tint" color={severityMap[row.severity]}>
250249
{row.severity}
251250
</Badge>
252251
</span>
@@ -296,12 +295,15 @@ function CounterBadgeTable() {
296295
<TableCell>
297296
<TableCellLayout>
298297
{row.alerts > 0 ? (
299-
<CounterBadge
300-
count={row.alerts}
298+
<Badge
301299
color="danger"
302-
appearance="filled"
300+
appearance="tint"
301+
shape="circular"
302+
size="medium"
303303
aria-label={`${row.alerts} active alerts`}
304-
/>
304+
>
305+
{row.alerts}
306+
</Badge>
305307
) : (
306308
<span aria-hidden="true"></span>
307309
)}
@@ -310,12 +312,15 @@ function CounterBadgeTable() {
310312
<TableCell>
311313
<TableCellLayout>
312314
{row.incidents > 0 ? (
313-
<CounterBadge
314-
count={row.incidents}
315+
<Badge
315316
color="important"
316-
appearance="filled"
317+
appearance="tint"
318+
shape="circular"
319+
size="medium"
317320
aria-label={`${row.incidents} open incidents`}
318-
/>
321+
>
322+
{row.incidents}
323+
</Badge>
319324
) : (
320325
<span aria-hidden="true"></span>
321326
)}
@@ -461,10 +466,7 @@ function DoAndDontTable() {
461466
</TableCell>
462467
<TableCell>
463468
<TableCellLayout>
464-
<Badge
465-
appearance="outline"
466-
color={statusColorMap[row.status]}
467-
>
469+
<Badge appearance="tint" color={statusColorMap[row.status]}>
468470
{row.status}
469471
</Badge>
470472
</TableCellLayout>
@@ -518,39 +520,6 @@ function DoAndDontTable() {
518520
);
519521
}
520522

521-
// ---------------------------------------------------------------------------
522-
// Story: FilledVsOutlined comparison
523-
// ---------------------------------------------------------------------------
524-
525-
function FilledVsOutlinedTable() {
526-
const styles = useTableStyles();
527-
return (
528-
<div className={styles.section}>
529-
<div>
530-
<Text className={styles.sectionLabel}>
531-
✅ Do: Outlined (default) — use when badges appear on many rows.
532-
Reduces cognitive load and creates visual balance.
533-
</Text>
534-
<StatusTable appearance="outline" />
535-
</div>
536-
<div>
537-
<Text className={styles.sectionLabel}>
538-
✅ Do: Tint — use when you want more emphasis than outlined while
539-
preserving readable contrast in this theme.
540-
</Text>
541-
<StatusTable appearance="tint" />
542-
</div>
543-
<div>
544-
<Text className={styles.sectionLabel}>
545-
❌ Don't: Filled — avoid in this yellow brand theme because on-brand
546-
foreground colors are black and conflict with the filled badge token.
547-
</Text>
548-
<StatusTable appearance="filled" />
549-
</div>
550-
</div>
551-
);
552-
}
553-
554523
// ---------------------------------------------------------------------------
555524
// Storybook meta
556525
// ---------------------------------------------------------------------------
@@ -568,7 +537,7 @@ They use short text, color, and icons for quick recognition and are placed near
568537
569538
This story covers how to use Fluent \`Badge\`, \`CounterBadge\`, and \`PresenceBadge\` inside data tables.
570539
571-
In Axis yellow brand themes, prefer outlined and tint badges. Avoid filled badges because
540+
In Axis we use the **tint** appearance with **circular** shape. Avoid filled badges because
572541
on-brand black foreground colors conflict with filled badge token usage.
573542
`,
574543
},
@@ -580,27 +549,16 @@ export default meta;
580549
type Story = StoryObj<typeof meta>;
581550

582551
/**
583-
* Use tinted badges when badges appear on many rows. This minimises cognitive load and
552+
* Use tinted badges when badges appear on many rows. This minimizes cognitive load and
584553
* creates visual balance across the table.
585554
*
586555
* The status column is **never** the first column — badges are secondary and supportive.
587556
*/
588557
export const OutlinedStatusBadge: Story = {
589-
name: "Status badge (tint — recommended)",
558+
name: "Status badge",
590559
render: () => <StatusTable appearance="tint" />,
591560
};
592561

593-
/**
594-
* Choose the badge appearance based on context:
595-
* - **Outlined** — default for tables; low visual weight when many badges are visible
596-
* - **Tint** — suitable when you need extra emphasis while preserving readable contrast
597-
* - **Filled** — don't use in our yellow brand theme due to on-brand foreground token collision
598-
*/
599-
export const AppearanceComparison: Story = {
600-
name: "Outlined + tint (filled is don't)",
601-
render: () => <FilledVsOutlinedTable />,
602-
};
603-
604562
/**
605563
* Use multiple badges in a single cell when the facts they represent are **independent**.
606564
* Here a `PresenceBadge` (connectivity state) is combined with a `Badge` (severity level).
@@ -614,6 +572,7 @@ export const MultipleBadgesPerCell: Story = {
614572

615573
/**
616574
* `CounterBadge` is best for showing aggregate counts such as open alerts or unread items.
575+
* However because of the problem of using on-brand black foreground colors conflicting with filled badge token usage, it is recommended to use the badge component instead. Use medium size and tint appearance with circular shape.
617576
* Show a neutral placeholder (e.g. `—`) instead of a zero counter to reduce noise.
618577
*/
619578
export const CounterBadgeInTable: Story = {

0 commit comments

Comments
 (0)