-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23765 from storybookjs/charles-improve-buttons
UI: Improve new `Button` component
- Loading branch information
Showing
6 changed files
with
245 additions
and
120 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
62 changes: 62 additions & 0 deletions
62
code/ui/components/src/new/IconButton/IconButton.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import React from 'react'; | ||
import { IconButton } from './IconButton'; | ||
|
||
const meta: Meta<typeof IconButton> = { | ||
title: 'IconButton', | ||
component: IconButton, | ||
tags: ['autodocs'], | ||
}; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof IconButton>; | ||
|
||
export const Base = { | ||
args: { icon: 'FaceHappy' }, | ||
}; | ||
|
||
export const Types: Story = { | ||
render: () => ( | ||
<div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}> | ||
<IconButton variant="solid" icon="FaceHappy" /> | ||
<IconButton variant="outline" icon="FaceHappy" /> | ||
<IconButton variant="ghost" icon="FaceHappy" /> | ||
</div> | ||
), | ||
}; | ||
|
||
export const Active: Story = { | ||
render: () => ( | ||
<div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}> | ||
<IconButton variant="solid" icon="FaceHappy" active /> | ||
<IconButton variant="outline" icon="FaceHappy" active /> | ||
<IconButton variant="ghost" icon="FaceHappy" active /> | ||
</div> | ||
), | ||
}; | ||
|
||
export const Sizes: Story = { | ||
render: () => ( | ||
<div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}> | ||
<IconButton size="small" icon="FaceHappy" /> | ||
<IconButton size="medium" icon="FaceHappy" /> | ||
</div> | ||
), | ||
}; | ||
|
||
export const Disabled: Story = { | ||
args: { | ||
...Base.args, | ||
icon: 'FaceHappy', | ||
disabled: true, | ||
}, | ||
}; | ||
|
||
export const WithHref: Story = { | ||
render: () => ( | ||
<div style={{ display: 'flex', alignItems: 'center', gap: '1rem' }}> | ||
<IconButton icon="FaceHappy" onClick={() => console.log('Hello')} /> | ||
<IconButton as="a" href="https://storybook.js.org/" icon="FaceHappy" /> | ||
</div> | ||
), | ||
}; |
Oops, something went wrong.