This repository has been archived by the owner on Apr 27, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #147 from klarna/add-default-name-to-form-components
Add default name to form components
- Loading branch information
Showing
24 changed files
with
208 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,14 +19,15 @@ export default { | |
Regular: <Field label='Enter your email' />, | ||
|
||
Controlled: <Field | ||
name='field-controlled' | ||
label='Enter your email' | ||
value='[email protected]' | ||
focus | ||
/>, | ||
/>, | ||
|
||
Big: <Field label='Enter your email' big />, | ||
|
||
'With name': <Field name='email' label='Enter your email' />, | ||
|
||
'With fake focus': <Field label='Enter your email' focus='fake' />, | ||
|
||
Disabled: <Field disabled label='Address' defaultValue='16, Corn street' />, | ||
|
@@ -35,22 +36,21 @@ export default { | |
mouseflowExclude | ||
label='Address' | ||
defaultValue='16, Corn street' | ||
/>, | ||
/>, | ||
|
||
'With error': <Field label='Invalid email' error defaultValue='invalid@' />, | ||
|
||
'With warning': <Field | ||
label='Are you sure the domain is exanple?' | ||
warning | ||
defaultValue='[email protected]' | ||
/>, | ||
/>, | ||
|
||
'With customizations': <Field | ||
name='with-customizations' | ||
customize={{ borderColor: '#3500C8', borderColorSelected: '#3500C8', borderRadius: '15px', inputColor: 'green', labelColor: 'red' }} | ||
label='Favorite color' | ||
defaultValue='Purple' | ||
/> | ||
/> | ||
} | ||
}, | ||
|
||
|
@@ -67,7 +67,8 @@ import ReactMaskedInput from 'react-maskedinput'`, | |
Input={ReactMaskedInput} | ||
mask='1111 1111 1111 1111' | ||
placeholder=' ' | ||
/>, | ||
/>, | ||
|
||
code: `<Field | ||
label='Credit card number' | ||
Input={ReactMaskedInput} | ||
|
@@ -164,20 +165,20 @@ import Fieldset from '@klarna/ui/Fieldset'`, | |
|
||
examples: { | ||
'Two fields': <Fieldset margins> | ||
<Field left size='1/2' name='two-given-name' label='Given name' /> | ||
<Field right size='1/2' name='two-middle-name' label='Middle name' /> | ||
<Field left size='1/2' label='Given name' /> | ||
<Field right size='1/2' label='Middle name' /> | ||
</Fieldset>, | ||
|
||
Many: <Fieldset margins> | ||
<Field top left size='1/2' name='many-given-name' label='Given name' /> | ||
<Field center size='1/4' name='many-middle-name' label='Middle name' /> | ||
<Field top right size='1/4' name='many-last-name' label='Last name' /> | ||
<Field left square size='1/5' name='many-number' label='Number' /> | ||
<Field right square size='4/5' name='many-street-address' label='Street Address' /> | ||
<Field left square size='1/3' name='many-pokemon' label='Your favorite pokémon' /> | ||
<Field right square size='2/3' name='many-android-iphone' label='Android or iPhone: please explain' /> | ||
<Field left bottom size='2/5' name='many-date-of-birth' label='Date of Birth' /> | ||
<Field right bottom size='3/5' name='many-mobile-phone-number' label='Mobile phone number' /> | ||
<Field top left size='1/2' label='Given name' /> | ||
<Field center size='1/4' label='Middle name' /> | ||
<Field top right size='1/4' label='Last name' /> | ||
<Field left square size='1/5' label='Number' /> | ||
<Field right square size='4/5' label='Street Address' /> | ||
<Field left square size='1/3' label='Your favorite pokémon' /> | ||
<Field right square size='2/3' label='Android or iPhone: please explain' /> | ||
<Field left bottom size='2/5' label='Date of Birth' /> | ||
<Field right bottom size='3/5' label='Mobile phone number' /> | ||
</Fieldset> | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.