-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix: resolve <Badge /> incorrect sizes
#22539
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1f7da15
fix: resolve badge sizing
jakehwll 95e695c
fix: remove `border` from `<Badge />`
jakehwll e6903bd
Merge branch 'main' into jakehwll/badge-refactor
jakehwll 97cf346
fix: resolve lint issues
jakehwll 9fbdec6
fix: manual size as no tailwind 5
jakehwll 9ecacb7
fix: resolve github feedback
jakehwll b8057ef
Merge branch 'main' into jakehwll/badge-refactor
jakehwll ccf4a78
fix: resolve border not showing
jakehwll 6ce23ea
Merge branch 'main' into jakehwll/badge-refactor
jakehwll File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,56 +1,150 @@ | ||
| import type { Meta, StoryObj } from "@storybook/react-vite"; | ||
| import { Settings, TriangleAlert } from "lucide-react"; | ||
| import { Database, Settings, TriangleAlert } from "lucide-react"; | ||
| import { Badges } from "#/components/Badges/Badges"; | ||
| import { Badge } from "./Badge"; | ||
|
|
||
| const meta: Meta<typeof Badge> = { | ||
| title: "components/Badge", | ||
| component: Badge, | ||
| args: { | ||
| children: "Badge", | ||
| }, | ||
| }; | ||
|
|
||
| export default meta; | ||
| type Story = StoryObj<typeof Badge>; | ||
|
|
||
| export const Default: Story = {}; | ||
| export const Default: Story = { | ||
| render: () => ( | ||
| <Badges> | ||
| <Badge size="xs"> | ||
| <Database /> | ||
| Text | ||
| </Badge> | ||
| <Badge size="sm"> | ||
| <Database /> | ||
| Text | ||
| </Badge> | ||
| <Badge size="md"> | ||
| <Database /> | ||
| Text | ||
| </Badge> | ||
| </Badges> | ||
| ), | ||
| }; | ||
|
|
||
| export const Warning: Story = { | ||
| args: { | ||
| variant: "warning", | ||
| }, | ||
| render: () => ( | ||
| <Badges> | ||
| <Badge variant="warning" size="xs"> | ||
| Warning | ||
| <TriangleAlert /> | ||
| </Badge> | ||
| <Badge variant="warning" size="sm"> | ||
| <TriangleAlert /> | ||
| Warning | ||
| </Badge> | ||
| <Badge variant="warning" size="md"> | ||
| <TriangleAlert /> | ||
| Warning | ||
| </Badge> | ||
| </Badges> | ||
| ), | ||
| }; | ||
|
|
||
| export const Destructive: Story = { | ||
| args: { | ||
| variant: "destructive", | ||
| }, | ||
| render: () => ( | ||
| <Badges> | ||
| <Badge variant="destructive" size="xs"> | ||
| Destructive | ||
| <TriangleAlert /> | ||
| </Badge> | ||
| <Badge variant="destructive" size="sm"> | ||
| <TriangleAlert /> | ||
| Destructive | ||
| </Badge> | ||
| <Badge variant="destructive" size="md"> | ||
| <TriangleAlert /> | ||
| Destructive | ||
| </Badge> | ||
| </Badges> | ||
| ), | ||
| }; | ||
|
|
||
| export const Info: Story = { | ||
| args: { | ||
| variant: "info", | ||
| }, | ||
| render: () => ( | ||
| <Badges> | ||
| <Badge variant="info" size="xs"> | ||
| Info | ||
| </Badge> | ||
| <Badge variant="info" size="sm"> | ||
| Info | ||
| </Badge> | ||
| <Badge variant="info" size="md"> | ||
| Info | ||
| </Badge> | ||
| </Badges> | ||
| ), | ||
| }; | ||
|
|
||
| export const Green: Story = { | ||
| args: { | ||
| variant: "green", | ||
| }, | ||
| render: () => ( | ||
| <Badges> | ||
| <Badge variant="green" size="xs"> | ||
| Green | ||
| </Badge> | ||
| <Badge variant="green" size="sm"> | ||
| Green | ||
| </Badge> | ||
| <Badge variant="green" size="md"> | ||
| Green | ||
| </Badge> | ||
| </Badges> | ||
| ), | ||
| }; | ||
|
|
||
| export const Purple: Story = { | ||
| render: () => ( | ||
| <Badges> | ||
| <Badge variant="purple" size="xs"> | ||
| Purple | ||
| </Badge> | ||
| <Badge variant="purple" size="sm"> | ||
| Purple | ||
| </Badge> | ||
| <Badge variant="purple" size="md"> | ||
| Purple | ||
| </Badge> | ||
| </Badges> | ||
| ), | ||
| }; | ||
|
|
||
| export const Magenta: Story = { | ||
| render: () => ( | ||
| <Badges> | ||
| <Badge variant="magenta" size="xs"> | ||
| Magenta | ||
| </Badge> | ||
| <Badge variant="magenta" size="sm"> | ||
| Magenta | ||
| </Badge> | ||
| <Badge variant="magenta" size="md"> | ||
| Magenta | ||
| </Badge> | ||
| </Badges> | ||
| ), | ||
| }; | ||
|
|
||
| export const SmallWithIcon: Story = { | ||
| args: { | ||
| variant: "default", | ||
| size: "sm", | ||
| children: <>{<Settings />} Preset</>, | ||
| }, | ||
| render: () => ( | ||
| <Badge variant="default" size="sm"> | ||
| <Settings /> | ||
| Preset | ||
| </Badge> | ||
| ), | ||
| }; | ||
|
|
||
| export const MediumWithIcon: Story = { | ||
| args: { | ||
| variant: "warning", | ||
| size: "md", | ||
| children: <>{<TriangleAlert />} Immutable</>, | ||
| }, | ||
| render: () => ( | ||
| <Badge variant="warning" size="md"> | ||
| <TriangleAlert /> | ||
| Immutable | ||
| </Badge> | ||
| ), | ||
| }; |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.