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

Form Select: React documentation update #1810

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
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
140 changes: 0 additions & 140 deletions packages/sage-react/lib/Select/Select.story.jsx

This file was deleted.

80 changes: 80 additions & 0 deletions packages/sage-react/lib/Select/Select.story.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import { Meta, Story, Canvas, ArgsTable } from '@storybook/addon-docs/blocks';
import { Select } from './Select';
import { Card } from '../Card';

<Meta title="Sage/Select" component={Select} />

# Select
The Select component is a user-friendly form control designed to let users pick an option or multiple options from a set. Upon selection, it presents a dialog showcasing all choices in an easily navigable list, with features like added context messages, error indications, and a disabled mode.

## Usage Guidelines

### When to use

-

### When not to use

-

## Accessibility

## Properties

<ArgsTable story="Default" />

## Variants
### Default
The Default variation of the Select component is a simple HTML form element.

<Canvas>
<Story name="Default">
<Select
id="language-select"
label="Language"
options={[
'en - English',
'es - Spanish',
'fi - Finnish',
'fr - French'
]}
/>
</Story>
</Canvas>

### Select with Message
The Select component can be used with a message to provide additional context.

<Canvas>
<Story name="Select with Message">
<Select
id="current-select"
label="Currency"
message="The default currency will be used for formatting and calculation purposes."
options={[
'USD - United States Dollar',
'AED - United Arab Emirates Dirham',
'AFN - Afghan Afghani',
'ALL - Albanian Lek'
]}
/>
</Story>
</Canvas>

### Error State
The Select component can indicate an error state.

<Canvas>
<Story name="Select with Error State">
<Select
id="current-select"
label="Currency"
message="This field is required."
hasError
options={[
'Left to right (ltr)',
'Right to left (rtl)'
]}
/>
</Story>
</Canvas>
Loading