import { Meta, Story, ArgsTable, Canvas } from '@storybook/addon-docs/blocks';
import { Link } from './link.component';
import { FlowPropsTable, ExternalReferenceLink } from '../../../utils';

<Meta title="Link" component={Link} />

# Link

A link component that accepts an `href` or an `onClick`. Renders with the primary branded color variant.

## Accessibility notes

This component will render a `button` or an `a` tag depending on whether it is provided with an `href` or an `onClick`.

## Variations

### Defaults

<Canvas withToolbar>
  <Story id="link--default-href" />
  <Story id="link--default-on-click" />
</Canvas>

### Size

<Canvas withToolbar>
  <Story id="link--size" />
</Canvas>

### Color

<Canvas withToolbar>
  <Story id="link--color" />
</Canvas>

### Span Styling

<Canvas withToolbar>
  <Story id="link--span-styling" />
</Canvas>

## Props

<FlowPropsTable ofComponent={Link} />

## External Reference

<ExternalReferenceLink src="" type="figma" />
<ExternalReferenceLink
  src="https://github.com/wealthsimple/patchwork/tree/master/core/typography/link"
  type="github"
/>
