import { Meta, Story, ArgsTable, Canvas } from '@storybook/addon-docs/blocks';
import { TextInput } from './text-input.component';
import {
  FlowPropsTable,
  ExternalReferenceLink,
} from '../../../../utils/storybook/docs-support';

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

# Text Input

- [Form Input Accessibility
  Tips](/?path=/story/components-inputs-accessibility-tips--page)

A text input field. Supports the following masking modes:

- date
- email
- number
- text
- password'

## Stories

### Default

<Canvas>
  <Story id="components-inputs-textinput--default" />
</Canvas>

### Large

<Canvas>
  <Story id="components-inputs-textinput--large" />
</Canvas>

### Specifying Font Size

<Canvas>
  <Story id="components-inputs-textinput--specify-font-size" />
</Canvas>

### With Button Text

<Canvas>
  <Story id="components-inputs-textinput--with-button-text" />
</Canvas>

### With Button Text and Error

<Canvas>
  <Story id="components-inputs-textinput--with-button-text-and-error" />
</Canvas>

### With Value Disabled

<Canvas>
  <Story id="components-inputs-textinput--with-value-disabled" />
</Canvas>

### With Icon Left

<Canvas>
  <Story id="components-inputs-textinput--with-icon-left" />
</Canvas>

### With Icon Right

<Canvas>
  <Story id="components-inputs-textinput--with-icon-right" />
</Canvas>

### Checkmark Icon Right, Large

<Canvas>
  <Story id="components-inputs-textinput--with-checkmark-icon-right-large" />
</Canvas>

### With Icon Right, Disabled

<Canvas>
  <Story id="components-inputs-textinput--with-icon-right-disabled" />
</Canvas>

### With Error Icon

<Canvas>
  <Story id="components-inputs-textinput--with-error-icon" />
</Canvas>

### With Error

<Canvas>
  <Story id="components-inputs-textinput--with-error" />
</Canvas>

### With Error (Array)

<Canvas>
  <Story id="components-inputs-textinput--error-array" />
</Canvas>

### Focus on Mount

<Canvas>
  <Story id="components-inputs-textinput--focus-on-mount" />
</Canvas>

### Extended Styles

<Canvas>
  <Story id="components-inputs-textinput--with-extended-styles" />
</Canvas>

### Date Formatting Mask

<Canvas>
  <Story id="components-inputs-textinput--date-formatting-mask" />
</Canvas>

### Date Formatting Mask (Large)

<Canvas>
  <Story id="components-inputs-textinput--date-formatting-mask-large" />
</Canvas>

### Date Formatting Mask (Error)

<Canvas>
  <Story id="components-inputs-textinput--date-formatting-mask-error" />
</Canvas>

### Date Formatting Mask (Icon Left)

<Canvas>
  <Story id="components-inputs-textinput--date-formatting-mask-icon-left" />
</Canvas>

### Date Formatting Mask (Icon Right)

<Canvas>
  <Story id="components-inputs-textinput--date-formatting-mask-icon-right" />
</Canvas>

### Phone Number Mask

<Canvas>
  <Story id="components-inputs-textinput--phone-number-mask" />
</Canvas>

### Numeric

<Canvas>
  <Story id="components-inputs-textinput--numeric" />
</Canvas>

### Password

<Canvas>
  <Story id="components-inputs-textinput--password" />
  <Story id="components-inputs-textinput--password-disabled" />
</Canvas>

### Password with Floating Label

<Canvas>
  <Story id="components-inputs-textinput--floating-label-password" />
  <Story id="components-inputs-textinput--floating-label-password-disabled" />
</Canvas>

### Currency Mask

<Canvas>
  <Story id="components-inputs-textinput--currency-mask" />
</Canvas>

### No Border

<Canvas>
  <Story id="components-inputs-textinput--no-border" />
</Canvas>

## Supported Property Mixins

Margin-only spacing:

<Canvas>
  <Story id="components-inputs-textinput--mixins-margin-only-spacing" />
</Canvas>

Stackee:

<Canvas>
  <Story id="components-inputs-textinput--mixins-stackee" />
</Canvas>

## Props

<FlowPropsTable ofComponent={TextInput} />

## External Reference

<ExternalReferenceLink
  src="https://www.figma.com/file/r5zKXblbSt0b869OEcOWXu/Patchwork-Web?node-id=637%3A66"
  type="figma"
/>
<ExternalReferenceLink
  src="https://github.com/wealthsimple/patchwork/tree/master/core/forms/text-input"
  type="github"
/>
