Skip to content

Commit

Permalink
tests: added more button state stories
Browse files Browse the repository at this point in the history
  • Loading branch information
mwargan committed Mar 7, 2024
1 parent f9b5980 commit 712b1d1
Showing 1 changed file with 58 additions and 1 deletion.
59 changes: 58 additions & 1 deletion src/stories/BaseButton.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ const meta: Meta<typeof BaseButton> = {
table: { category: "Links" },
description:
"The URL to link to. Use this if you are linking to external sites. Otherwise, you should use the `to` prop instead.",
type: { required: false },
},
to: {
control: "text",
table: { category: "Links" },
description:
"The path to link to. Use this if you are linking to internal sites. Otherwise, you should use the `href` prop instead.",
},
ariaBusy: {
control: "boolean",
Expand All @@ -30,6 +35,19 @@ const meta: Meta<typeof BaseButton> = {
table: { category: "Accessibility" },
description: "If the button is disabled",
},
class: {
// Is an enum of undefined, primary, or secondary
options: [
undefined,
"secondary",
"contrast",
"outline",
"outline secondary",
"outline contrast",
],
control: { type: "select" },
table: { category: "Styles" },
},
},
args: {
default: "Button",
Expand Down Expand Up @@ -74,3 +92,42 @@ export const WithOverflowingText: Story = {
default: overflowFixture.text,
},
};

export const Secondary: Story = {
args: {
class: "secondary",
},
};

export const Contrast: Story = {
args: {
class: "contrast",
},
};

export const Outline: Story = {
args: {
class: "outline",
},
};

export const OutlineSecondary: Story = {
args: {
class: "outline secondary",
},
};

export const OutlineContrast: Story = {
args: {
class: "outline contrast",
},
};

// Use a decorator to show a grouped
export const Grouped: Story = {
decorators: [
(story: any) => ({
template: `<div role=group><story /><story /><story /></div>`,
}),
],
};

0 comments on commit 712b1d1

Please sign in to comment.