import { linkPropDefs } from "@radix-ui/themes/props" import type { Meta, StoryObj } from "@storybook/react" import { Link } from "./Link" const meta = { title: "base/communication/Link", component: Link, tags: ["autodocs"], argTypes: { children: { control: "text", description: "The link text content", }, href: { control: "text", description: "The URL the link points to", }, size: { control: "select", options: linkPropDefs.size.values, description: "The size of the link", }, color: { control: "select", options: linkPropDefs.color.values, description: "The color theme of the link", }, highContrast: { control: "boolean", description: "Whether to use high contrast colors", }, underline: { control: "select", options: linkPropDefs.underline.values, description: "The underline style of the link", }, }, parameters: { layout: "centered", }, args: { children: "Click here", href: "#", }, } satisfies Meta export default meta type Story = StoryObj /** * Default link. */ export const Default: Story = {} /** * Link with different sizes. */ export const Sizes: Story = { render: () => (
Small link Medium link Large link
), } /** * Link with different colors. */ export const Colors: Story = { render: () => (
Gray link Blue link Green link Red link Yellow link Purple link
), } /** * Link with different underline styles. */ export const UnderlineStyles: Story = { render: () => (
Auto underline Hover underline Always underline No underline
), } /** * Link with high contrast. */ export const HighContrast: Story = { args: { highContrast: true, children: "High contrast link", }, } /** * External link example. */ export const ExternalLink: Story = { args: { children: "Visit our website", href: "https://example.com", }, } /** * Link in context. */ export const InContext: Story = { render: () => (

This is a paragraph with a link embedded within the text to show how it looks in context.

), }