Skip to content

Commit e588113

Browse files
authored
fix(button): link button example in storybook was using base appearance (#1176)
1 parent e8181d2 commit e588113

File tree

1 file changed

+167
-8
lines changed

1 file changed

+167
-8
lines changed

src/components/Button/Button.stories.tsx

Lines changed: 167 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,13 @@ export const Default: Story = {
4040
args: {
4141
children: "Button",
4242
},
43+
parameters: {
44+
docs: {
45+
description: {
46+
story: "Button with default appearance",
47+
},
48+
},
49+
},
4350
};
4451

4552
export const DefaultDisabled: Story = {
@@ -49,6 +56,13 @@ export const DefaultDisabled: Story = {
4956
children: "Button",
5057
disabled: true,
5158
},
59+
parameters: {
60+
docs: {
61+
description: {
62+
story: "Disabled button with default appearance",
63+
},
64+
},
65+
},
5266
};
5367

5468
export const Base: Story = {
@@ -58,6 +72,13 @@ export const Base: Story = {
5872
children: "Base button",
5973
appearance: "base",
6074
},
75+
parameters: {
76+
docs: {
77+
description: {
78+
story: "Button with base appearance",
79+
},
80+
},
81+
},
6182
};
6283

6384
export const BaseDisabled: Story = {
@@ -68,29 +89,46 @@ export const BaseDisabled: Story = {
6889
appearance: "base",
6990
disabled: true,
7091
},
92+
parameters: {
93+
docs: {
94+
description: {
95+
story: "Disabled button with base appearance",
96+
},
97+
},
98+
},
7199
};
72100

73101
export const Link = {
74102
name: "Link",
75103

76104
args: {
77105
children: "Link button",
78-
appearance: "base",
79-
element: "a",
80-
href: "#test",
106+
appearance: "link",
107+
},
108+
parameters: {
109+
docs: {
110+
description: {
111+
story: "Button with link appearance",
112+
},
113+
},
81114
},
82115
};
83116

84-
export const LinkDisabled: Story<HTMLProps<HTMLAnchorElement>> = {
117+
export const LinkDisabled = {
85118
name: "Link disabled",
86119

87120
args: {
88121
children: "Link button disabled",
89-
appearance: "base",
90-
element: "a",
91-
href: "#test",
122+
appearance: "link",
92123
disabled: true,
93124
},
125+
parameters: {
126+
docs: {
127+
description: {
128+
story: "Disabled button with link appearance",
129+
},
130+
},
131+
},
94132
};
95133

96134
export const Positive: Story = {
@@ -100,6 +138,13 @@ export const Positive: Story = {
100138
children: "Positive button",
101139
appearance: "positive",
102140
},
141+
parameters: {
142+
docs: {
143+
description: {
144+
story: "Button with positive appearance",
145+
},
146+
},
147+
},
103148
};
104149

105150
export const PositiveDisabled: Story = {
@@ -110,6 +155,13 @@ export const PositiveDisabled: Story = {
110155
appearance: "positive",
111156
disabled: true,
112157
},
158+
parameters: {
159+
docs: {
160+
description: {
161+
story: "Disabled button with positive appearance",
162+
},
163+
},
164+
},
113165
};
114166

115167
export const Negative: Story = {
@@ -119,6 +171,13 @@ export const Negative: Story = {
119171
children: "Negative button",
120172
appearance: "negative",
121173
},
174+
parameters: {
175+
docs: {
176+
description: {
177+
story: "Button with negative appearance",
178+
},
179+
},
180+
},
122181
};
123182

124183
export const NegativeDisabled: Story = {
@@ -129,6 +188,13 @@ export const NegativeDisabled: Story = {
129188
appearance: "negative",
130189
disabled: true,
131190
},
191+
parameters: {
192+
docs: {
193+
description: {
194+
story: "Disabled button with negative appearance",
195+
},
196+
},
197+
},
132198
};
133199

134200
export const Brand: Story = {
@@ -138,6 +204,13 @@ export const Brand: Story = {
138204
children: "Brand button",
139205
appearance: "brand",
140206
},
207+
parameters: {
208+
docs: {
209+
description: {
210+
story: "Button with brand appearance",
211+
},
212+
},
213+
},
141214
};
142215

143216
export const BrandDisabled: Story = {
@@ -148,6 +221,13 @@ export const BrandDisabled: Story = {
148221
appearance: "brand",
149222
disabled: true,
150223
},
224+
parameters: {
225+
docs: {
226+
description: {
227+
story: "Disabled button with brand appearance",
228+
},
229+
},
230+
},
151231
};
152232

153233
export const Inline: Story = {
@@ -161,6 +241,13 @@ export const Inline: Story = {
161241
),
162242

163243
name: "Inline",
244+
parameters: {
245+
docs: {
246+
description: {
247+
story: "Button that displays on the same line as the sibling elements",
248+
},
249+
},
250+
},
164251
};
165252

166253
export const Dense: Story = {
@@ -172,6 +259,13 @@ export const Dense: Story = {
172259
),
173260

174261
name: "Dense",
262+
parameters: {
263+
docs: {
264+
description: {
265+
story: "Button with reduced vertical padding",
266+
},
267+
},
268+
},
175269
};
176270

177271
export const Small: Story = {
@@ -185,6 +279,13 @@ export const Small: Story = {
185279
),
186280

187281
name: "Small",
282+
parameters: {
283+
docs: {
284+
description: {
285+
story: "Button that can fit small text inside",
286+
},
287+
},
288+
},
188289
};
189290

190291
export const Icon: Story = {
@@ -194,6 +295,13 @@ export const Icon: Story = {
194295
children: <i className="p-icon--plus"></i>,
195296
hasIcon: true,
196297
},
298+
parameters: {
299+
docs: {
300+
description: {
301+
story: "Button with an icon inside",
302+
},
303+
},
304+
},
197305
};
198306

199307
export const IconText: Story = {
@@ -208,9 +316,16 @@ export const IconText: Story = {
208316

209317
hasIcon: true,
210318
},
319+
parameters: {
320+
docs: {
321+
description: {
322+
story: "Button with both an icon and text inside",
323+
},
324+
},
325+
},
211326
};
212327

213-
export const IconWithTooltip: Story = {
328+
export const DisabledWithTooltip: Story = {
214329
name: "Disabled with tooltip",
215330

216331
args: {
@@ -224,4 +339,48 @@ export const IconWithTooltip: Story = {
224339
</Tooltip>
225340
</div>
226341
),
342+
parameters: {
343+
docs: {
344+
description: {
345+
story: "Disabled button that displays a tooltip when hovered",
346+
},
347+
},
348+
},
349+
};
350+
351+
export const ButtonAsLink = {
352+
name: "Button as link",
353+
354+
args: {
355+
children: "Button as link",
356+
appearance: "base",
357+
element: "a",
358+
href: "#test",
359+
},
360+
parameters: {
361+
docs: {
362+
description: {
363+
story: "Button that is rendered as an `a` element",
364+
},
365+
},
366+
},
367+
};
368+
369+
export const ButtonAsLinkDisabled: Story<HTMLProps<HTMLAnchorElement>> = {
370+
name: "Button as link disabled",
371+
372+
args: {
373+
children: "Button as link disabled",
374+
appearance: "base",
375+
element: "a",
376+
href: "#test",
377+
disabled: true,
378+
},
379+
parameters: {
380+
docs: {
381+
description: {
382+
story: "Disabled button that is rendered as an `a` element",
383+
},
384+
},
385+
},
227386
};

0 commit comments

Comments
 (0)