-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'styled-components' of https://github.com/cmpsr/composer …
…into styled-expandabletextfieldicon * 'styled-components' of https://github.com/cmpsr/composer: Use typescript config in tests and stories too (#191) Image customCss Implementation (#186) Styled TextField (#185)
- Loading branch information
Showing
23 changed files
with
368 additions
and
41 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
4 changes: 2 additions & 2 deletions
4
packages/styled-components/src/components/primitives/Asset/Asset.tsx
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
73 changes: 73 additions & 0 deletions
73
packages/styled-components/src/components/primitives/Form/TextField/TextField.stories.tsx
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
import React from 'react'; | ||
import { TextField } from '.'; | ||
import { action } from '@storybook/addon-actions'; | ||
import { boolean, text, select, number } from '@storybook/addon-knobs'; | ||
|
||
export default { | ||
title: 'Primitives/Form/TextField', | ||
component: TextField, | ||
}; | ||
|
||
export const Shapes = () => ( | ||
<> | ||
<h1>TextField shapes</h1> | ||
{Object.keys(TextField.Shapes).map((shape: any, i) => ( | ||
<div key={i}> | ||
<TextField | ||
shape={TextField.Shapes[shape]} | ||
placeholder={shape} | ||
name={shape} | ||
/> | ||
<br /> | ||
</div> | ||
))} | ||
</> | ||
); | ||
|
||
export const Modes = () => ( | ||
<> | ||
<h1>TextField Modes</h1> | ||
{Object.keys(TextField.Modes).map((mode: any, i) => ( | ||
<div key={i}> | ||
<TextField | ||
inputMode={TextField.Modes[mode]} | ||
placeholder={mode} | ||
name={mode} | ||
/> | ||
<br /> | ||
</div> | ||
))} | ||
</> | ||
); | ||
|
||
export const Disabled = () => ( | ||
<> | ||
<h1>TextField disabled</h1> | ||
<TextField disabled placeholder="disabled" name="disabled" /> | ||
</> | ||
); | ||
|
||
export const Invalid = () => ( | ||
<> | ||
<h1>TextField invalid</h1> | ||
<TextField invalid placeholder="invalid" name="invalid" /> | ||
</> | ||
); | ||
|
||
export const Playground = () => ( | ||
<> | ||
<h1>Playground</h1> | ||
<TextField | ||
name="name" | ||
placeholder={text('Placeholder', 'Placeholder')} | ||
disabled={boolean('Disabled', false)} | ||
invalid={boolean('Invalid', false)} | ||
required={boolean('Required', false)} | ||
maxLength={number('Max length', 12)} | ||
shape={select('Shape', TextField.Shapes, TextField.Shapes.Rectangle)} | ||
inputMode={select('Mode', TextField.Modes, TextField.Modes.Text)} | ||
onChange={action('On change')} | ||
customCss={text('Custom css', 'padding: 10px; border: 1px dashed blue;')} | ||
/> | ||
</> | ||
); |
Oops, something went wrong.