Skip to content
This repository was archived by the owner on Jan 9, 2023. It is now read-only.

Commit 71a344d

Browse files
committed
fix(textinput): add password, search, tel, url input types
#226
1 parent 1362eff commit 71a344d

2 files changed

Lines changed: 33 additions & 1 deletion

File tree

src/components/TextInput/TextInput.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import Form from 'react-bootstrap/Form'
33

44
interface Props {
55
/** Defines the type of the input. Defaults to 'text' if not specified. */
6-
type?: 'text' | 'number' | 'email'
6+
type?: 'text' | 'number' | 'email' | 'password' | 'search' | 'tel' | 'url'
77
/** Defines the size of the input. Defaults to 'lg' */
88
size?: 'sm' | 'lg'
99
/** The value of the input */

stories/textinput.stories.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,38 @@ storiesOf('TextInput', module)
4343
/>
4444
</div>
4545
))
46+
.add('Default password input', () => (
47+
<div>
48+
<TextInput type="password" name="text-input" id="text-input" size="lg" value="12345678" />
49+
</div>
50+
))
51+
.add('Default search input', () => (
52+
<div>
53+
<TextInput
54+
type="search"
55+
name="text-input"
56+
id="text-input"
57+
size="lg"
58+
value="testsearchstring"
59+
/>
60+
</div>
61+
))
62+
.add('Default tel input', () => (
63+
<div>
64+
<TextInput type="tel" name="text-input" id="text-input" size="lg" value="123-456-7890" />
65+
</div>
66+
))
67+
.add('Default url input', () => (
68+
<div>
69+
<TextInput
70+
type="url"
71+
name="text-input"
72+
id="text-input"
73+
size="lg"
74+
value="https://www.google.com"
75+
/>
76+
</div>
77+
))
4678
.add('Disabled text input', () => (
4779
<div>
4880
<TextInput

0 commit comments

Comments
 (0)