Skip to content

Commit a994e57

Browse files
authored
docs: Use bold icon for badge and banner examples (#2753)
## Summary: Use bold icons in badge and banner docs. Note: Since consumers pass icons into components, it'll be up to consumers to use the correct icon. For now, we make sure the badge and banner docs show examples using bold icons Issue: WB-2025 ## Test plan: 1. Confirm icons in Badge, StatusBadge, and Banner examples are bold Author: beaesguerra Reviewers: marcysutton Required Reviewers: Approved By: marcysutton Checks: ✅ 29 checks were successful, ⏭️ 7 checks have been skipped, ⏹️ 8 checks were cancelled Pull Request URL: #2753
1 parent 6b3b22b commit a994e57

File tree

6 files changed

+20
-16
lines changed

6 files changed

+20
-16
lines changed

.changeset/long-keys-applaud.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

__docs__/wonder-blocks-badge/badge-testing-snapshots.stories.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,15 +75,15 @@ export const StateSheetStory: StoryComponentType = {
7575
name: "Label with icon",
7676
props: {
7777
label: "Badge",
78-
icon: <PhosphorIcon icon={IconMappings.cookie} />,
78+
icon: <PhosphorIcon icon={IconMappings.cookieBold} />,
7979
},
8080
},
8181
{
8282
name: "Icon only",
8383
props: {
8484
icon: (
8585
<PhosphorIcon
86-
icon={IconMappings.cookie}
86+
icon={IconMappings.cookieBold}
8787
aria-label="Cookie"
8888
/>
8989
),
@@ -184,7 +184,7 @@ export const Scenarios: StoryComponentType = {
184184
name: "Long label with icon",
185185
props: {
186186
label: longText,
187-
icon: <PhosphorIcon icon={IconMappings.cookie} />,
187+
icon: <PhosphorIcon icon={IconMappings.cookieBold} />,
188188
},
189189
},
190190
{
@@ -197,7 +197,7 @@ export const Scenarios: StoryComponentType = {
197197
name: "Long label with no word break with icon",
198198
props: {
199199
label: longTextWithNoWordBreak,
200-
icon: <PhosphorIcon icon={IconMappings.cookie} />,
200+
icon: <PhosphorIcon icon={IconMappings.cookieBold} />,
201201
},
202202
},
203203
];
@@ -303,7 +303,7 @@ export const AllBadgesScenarios: StoryComponentType = {
303303
)),
304304
].map((component) =>
305305
React.cloneElement(component, {
306-
icon: <PhosphorIcon icon={IconMappings.cookie} />,
306+
icon: <PhosphorIcon icon={IconMappings.cookieBold} />,
307307
}),
308308
);
309309

__docs__/wonder-blocks-badge/badge.stories.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ type StoryComponentType = StoryObj<
6464
export const Default = {
6565
args: {
6666
label: "Badge",
67-
icon: "cookie",
67+
icon: "cookieBold",
6868
},
6969
};
7070

@@ -82,7 +82,7 @@ export const LabelOnly: StoryComponentType = {
8282
*/
8383
export const IconOnly: StoryComponentType = {
8484
args: {
85-
icon: "cookie",
85+
icon: "cookieBold",
8686
},
8787
};
8888

@@ -180,7 +180,7 @@ export const CustomIcons: StoryComponentType = {
180180
export const CustomStyles: StoryComponentType = {
181181
args: {
182182
label: "Badge",
183-
icon: "cookie",
183+
icon: "cookieBold",
184184
},
185185
render: (args) => {
186186
return (
@@ -219,7 +219,7 @@ export const CustomStyles: StoryComponentType = {
219219
export const Tag: StoryComponentType = {
220220
args: {
221221
label: "Badge",
222-
icon: "cookie",
222+
icon: "cookieBold",
223223
tag: "strong",
224224
},
225225
};
@@ -252,7 +252,7 @@ export const BadgeWithTooltip: StoryComponentType = {
252252
},
253253
args: {
254254
label: "Badge",
255-
icon: "cookie",
255+
icon: "cookieBold",
256256
},
257257
};
258258

@@ -264,6 +264,6 @@ export const BadgeWithTooltip: StoryComponentType = {
264264
export const BadgeTruncation: StoryComponentType = {
265265
args: {
266266
label: "Badge with a long label that should be truncated",
267-
icon: "cookie",
267+
icon: "cookieBold",
268268
},
269269
};

__docs__/wonder-blocks-badge/status-badge.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const kinds = ["info", "success", "warning", "critical"] as const;
7979
export const Default = {
8080
args: {
8181
label: "Badge",
82-
icon: "cookie",
82+
icon: "cookieBold",
8383
},
8484
render: (
8585
args: Omit<PropsFor<typeof StatusBadge>, "icon"> & {icon: string},
@@ -101,7 +101,7 @@ export const Default = {
101101
*/
102102
export const Kinds = {
103103
args: {
104-
icon: "cookie",
104+
icon: "cookieBold",
105105
},
106106
render(args: Omit<PropsFor<typeof StatusBadge>, "icon"> & {icon: string}) {
107107
return (
@@ -142,7 +142,7 @@ export const LabelOnly: StoryComponentType = {
142142
*/
143143
export const IconOnly: StoryComponentType = {
144144
args: {
145-
icon: "cookie",
145+
icon: "cookieBold",
146146
},
147147
};
148148

__docs__/wonder-blocks-banner/banner-testing-snapshots.stories.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export const AllVariantsStory: StoryComponentType = {
125125
<Banner
126126
{...props}
127127
text={`Custom Icon. ${longText}`}
128-
icon={IconMappings.cookie}
128+
icon={IconMappings.cookieBold}
129129
/>
130130
<Banner
131131
{...props}
@@ -260,7 +260,7 @@ const scenarios = [
260260
{
261261
name: "With custom Phosphor icon",
262262
props: {
263-
icon: IconMappings.cookie,
263+
icon: IconMappings.cookieBold,
264264
},
265265
},
266266
{

__docs__/wonder-blocks-icon/phosphor-icon.argtypes.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import playCircle from "@phosphor-icons/core/regular/play-circle.svg";
5050
import playCircleBold from "@phosphor-icons/core/bold/play-circle-bold.svg";
5151
import gear from "@phosphor-icons/core/regular/gear.svg";
5252
import cookie from "@phosphor-icons/core/regular/cookie.svg";
53+
import cookieBold from "@phosphor-icons/core/bold/cookie-bold.svg";
5354
import iceCream from "@phosphor-icons/core/regular/ice-cream.svg";
5455

5556
import {color} from "@khanacademy/wonder-blocks-tokens";
@@ -108,6 +109,7 @@ export const IconMappings = {
108109
playCircleBold,
109110
gear,
110111
cookie,
112+
cookieBold,
111113
iceCream,
112114
} as const;
113115

0 commit comments

Comments
 (0)