Skip to content

Commit

Permalink
fix: change name of Field component (#579)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: change name of Field to FieldSet
  • Loading branch information
ouji-miyahara authored and nabeliwo committed Jan 17, 2020
1 parent 613e810 commit f2655c8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
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

0 comments on commit f2655c8

Please sign in to comment.