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

fix: change name of Field component #579

Merged
merged 1 commit into from
Jan 17, 2020
Merged
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
1 change: 0 additions & 1 deletion src/components/Field/index.ts

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,64 +3,64 @@ import { storiesOf } from '@storybook/react'
import * as React from 'react'
import styled from 'styled-components'

import { Field } from './Field'
import { FieldSet } from './FieldSet'

storiesOf('Field', module).add('all', () => (
storiesOf('FieldSet', module).add('all', () => (
<List>
<li>
<Field label="string" defaultValue="string" />
<FieldSet label="string" defaultValue="string" />
</li>
<li>
<Field type="number" label="number" defaultValue={1} />
<FieldSet type="number" label="number" defaultValue={1} />
</li>
<li>
<Field type="password" label="password" defaultValue="password" />
<FieldSet type="password" label="password" defaultValue="password" />
</li>
<li>
<Field
<FieldSet
name="sample"
label="long title.........................................."
defaultValue="string"
/>
</li>
<li>
<Field label="required" defaultValue="string" required />
<FieldSet label="required" defaultValue="string" required />
</li>
<li>
<Field label="disabled" disabled />
<FieldSet label="disabled" disabled />
</li>
<li>
<Field label="width" defaultValue="width: 100%" width="100%" />
<FieldSet label="width" defaultValue="width: 100%" width="100%" />
</li>
<li>
<Field label="placeholder" placeholder="placeholder" />
<FieldSet label="placeholder" placeholder="placeholder" />
</li>
<li>
<Field label="onChange" onChange={action('onChange!!')} />
<FieldSet label="onChange" onChange={action('onChange!!')} />
</li>
<li>
<Field label="onBlur" onBlur={action('onBlur!!')} />
<FieldSet label="onBlur" onBlur={action('onBlur!!')} />
</li>
<li>
<Field label="help message" helpMessage="This is help message." width={400} />
<FieldSet label="help message" helpMessage="This is help message." width={400} />
</li>
<li>
<Field label="error message" errorMessage="An error occurred" />
<FieldSet label="error message" errorMessage="An error occurred" />
</li>
<li>
<Field label="custom field">
<FieldSet label="custom field">
<CustomTag>It is a field where tags can be freely inserted.</CustomTag>
</Field>
</FieldSet>
</li>
<li>
<Field
<FieldSet
label="custom field"
errorMessage="custom error"
helpMessage="This is help message."
required
>
<CustomTag>It is a field where tags can be freely inserted.</CustomTag>
</Field>
</FieldSet>
</li>
</List>
))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ type Props = Omit<InputProps, 'error'> & {
children?: ReactNode
}

export const Field: FC<Props> = ({
export const FieldSet: FC<Props> = ({
label,
labelType = 'subBlockTitle',
labelTagType = 'span',
Expand Down
1 change: 1 addition & 0 deletions src/components/FieldSet/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './FieldSet'
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export { LightBalloon, DarkBalloon } from './components/Balloon'
export { CheckBox } from './components/CheckBox'
export { CheckBoxLabel } from './components/CheckBoxLabel'
export { Dropdown, DropdownTrigger, DropdownContent, DropdownCloser } from './components/Dropdown'
export { Field } from './components/Field'
export { FieldSet } from './components/FieldSet'
export { FlashMessage } from './components/FlashMessage'
export { Input } from './components/Input'
export { Loader } from './components/Loader'
Expand Down