Skip to content
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

docs: Button stories are now in sync with legacy Ladle #757

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 63 additions & 4 deletions packages/api/src/stories/ButtonIcon.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import type { Meta, StoryObj } from "@storybook/react";
import { fn } from "@storybook/test";

import { ButtonIcon } from "@versini/ui-button/src/components";
import { IconSettings } from "@versini/ui-icons";
import {
IconEdit,
IconNext,
IconPrevious,
IconSettings,
} from "@versini/ui-icons";

type Story = StoryObj<typeof ButtonIcon>;

Expand All @@ -22,8 +27,62 @@ const meta: Meta<typeof ButtonIcon> = {
export default meta;
export const Basic: Story = {
render: (args) => (
<ButtonIcon {...args}>
<IconSettings />
</ButtonIcon>
<div className="flex flex-wrap gap-2">
<ButtonIcon {...args}>
<IconSettings />
</ButtonIcon>
<ButtonIcon {...args}>
<IconSettings />
</ButtonIcon>
<ButtonIcon {...args}>
<IconEdit className="h-3 w-3" />
</ButtonIcon>
<ButtonIcon {...args}>
<IconEdit />
</ButtonIcon>
</div>
),
};

export const WithLabel: Story = {
render: (args) => (
<>
<div className="flex flex-wrap gap-2">
<ButtonIcon labelRight="Settings" {...args}>
<IconSettings />
</ButtonIcon>
<ButtonIcon labelRight="Settings" {...args}>
<IconSettings />
</ButtonIcon>
<ButtonIcon labelRight="Edit" {...args}>
<IconEdit className="h-3 w-3" />
</ButtonIcon>
<ButtonIcon labelRight="Edit" {...args}>
<IconEdit />
</ButtonIcon>
</div>
<div className="mt-2 flex flex-wrap gap-2">
<ButtonIcon labelLeft="Settings" {...args}>
<IconSettings />
</ButtonIcon>
<ButtonIcon labelLeft="Settings" {...args}>
<IconSettings />
</ButtonIcon>
<ButtonIcon labelLeft="Edit" {...args}>
<IconEdit className="h-3 w-3" />
</ButtonIcon>
<ButtonIcon labelLeft="Edit" {...args}>
<IconEdit />
</ButtonIcon>
</div>
<div className="mt-2 flex flex-wrap gap-2">
<ButtonIcon labelRight="Previous page" {...args}>
<IconPrevious monotone />
</ButtonIcon>
<ButtonIcon labelLeft="Next page" {...args}>
<IconNext monotone />
</ButtonIcon>
</div>
</>
),
};
Loading