diff --git a/packages/api/src/stories/ButtonLink.mdx b/packages/api/src/stories/ButtonLink.mdx new file mode 100644 index 00000000..a0bcae7b --- /dev/null +++ b/packages/api/src/stories/ButtonLink.mdx @@ -0,0 +1,7 @@ +import { Meta } from "@storybook/blocks"; + +import AutoDoc from "../helpers/AutoDoc"; +import * as Stories from "./ButtonLink.stories"; + + + diff --git a/packages/api/src/stories/ButtonLink.stories.tsx b/packages/api/src/stories/ButtonLink.stories.tsx new file mode 100644 index 00000000..6df2d799 --- /dev/null +++ b/packages/api/src/stories/ButtonLink.stories.tsx @@ -0,0 +1,69 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { fn } from "@storybook/test"; + +import { ButtonLink } from "@versini/ui-button/src/components"; + +type Story = StoryObj; + +const meta: Meta = { + parameters: { + layout: "centered", + docs: { + controls: { exclude: ["spacing"] }, + }, + }, + title: "Components/ButtonLink", + + component: ButtonLink, + args: { onClick: fn() }, +}; + +export default meta; + +export const Basic: Story = { + render: (args) => ( +
+ Anchor as a button + Anchor as a button lorem ipsum + Anchor as a button lorem ipsum dolor + + Anchor as a button lorem ipsum dolor sit amet + +
+ ), +}; + +export const NewWindow: Story = { + args: { target: "_blank" }, + render: (args) => ( +
+ Anchor as a button + Anchor as a button lorem ipsum + Anchor as a button lorem ipsum dolor + + Anchor as a button lorem ipsum dolor sit amet + +
+ ), +}; + +export const Truncate: Story = { + args: { className: "w-44 sm:w-52" }, + render: (args) => ( + <> +
+ Anchor as a button + Anchor as a button lorem ipsum + Anchor as a button lorem ipsum dolor + + Anchor as a button lorem ipsum dolor sit amet + +
+
+

For text to truncate, you need to limit the width of the buttons.

+

This can be done by using Tailwind width classes, for example

+ className={args.className} +
+ + ), +};