-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also refactors some older components to use newer Storybook components.
- Loading branch information
Showing
9 changed files
with
73 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,15 @@ | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import Badge from './Badge'; | ||
|
||
export default { | ||
title: 'Design-System/Badge', | ||
component: Badge, | ||
} as ComponentMeta<typeof Badge>; | ||
tags: ['autodocs'], | ||
} as Meta; | ||
|
||
const Template: ComponentStory<typeof Badge> = (args) => <Badge {...args} />; | ||
|
||
export const Primary = Template.bind({}); | ||
|
||
Primary.args = { | ||
children: 'Primary badge', | ||
export const Default: StoryObj<typeof Badge> = { | ||
render: () => { | ||
return <Badge>Badge</Badge>; | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,55 @@ | ||
import { ComponentStory, ComponentMeta } from '@storybook/react'; | ||
import { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import Button from './Button'; | ||
import Icon from '../Icon/Icon'; | ||
|
||
export default { | ||
title: 'Design-System/Button', | ||
component: Button, | ||
tags: ['autodocs'], | ||
args: { | ||
variant: 'primary', | ||
htmlElement: 'button', | ||
href: 'www.google.com', | ||
}, | ||
argTypes: { | ||
children: { table: { disable: true } }, | ||
variant: { table: { disable: true } }, | ||
variant: { | ||
options: ['primary', 'secondary'], | ||
control: { type: 'radio' }, | ||
}, | ||
htmlElement: { | ||
options: ['button', 'a'], | ||
control: { type: 'radio' }, | ||
}, | ||
href: { | ||
control: 'text', | ||
description: 'Only required when using the button as a link', | ||
}, | ||
}, | ||
args: { href: 'www.google.com' }, | ||
} as ComponentMeta<typeof Button>; | ||
|
||
const Template: ComponentStory<typeof Button> = (args) => <Button {...args} />; | ||
} as Meta; | ||
|
||
export const Primary = Template.bind({}); | ||
|
||
Primary.args = { | ||
children: <span>Primary button</span>, | ||
variant: 'primary', | ||
htmlElement: 'button', | ||
export const Primary: StoryObj<typeof Button> = { | ||
render: (args) => { | ||
return <Button {...args}>Primary</Button>; | ||
}, | ||
}; | ||
|
||
export const Secondary = Template.bind({}); | ||
|
||
Secondary.args = { | ||
children: 'Secondary button', | ||
variant: 'secondary', | ||
htmlElement: 'button', | ||
export const Secondary: StoryObj<typeof Button> = { | ||
render: () => { | ||
return ( | ||
<Button variant="secondary" htmlElement="button"> | ||
Secondary | ||
</Button> | ||
); | ||
}, | ||
}; | ||
|
||
export const WithIcon = Template.bind({}); | ||
|
||
WithIcon.args = { | ||
children: <Icon icon="xmark" size="small" />, | ||
variant: 'secondary', | ||
htmlElement: 'button', | ||
export const WithIcon: StoryObj<typeof Button> = { | ||
render: () => { | ||
return ( | ||
<Button variant="secondary" htmlElement="button"> | ||
<Icon icon="xmark" size="small" /> | ||
</Button> | ||
); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9488e8f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
toiletmap – ./
www.toiletmap.org.uk
toiletmap-public-convenience-ltd.vercel.app
toiletmap-git-main-public-convenience-ltd.vercel.app
toiletmap.org.uk
*.toiletmap.org.uk