@@ -10,17 +10,11 @@ import TabButton from "../../../../../reusecore/Button";
10
10
import { useStyledDarkMode } from "../../../../../theme/app/useStyledDarkMode" ;
11
11
12
12
const codes = [
13
- "<Input placeholder=\"Placeholder goes here\" type=\"text \" />" ,
13
+ "<Input placeholder=\"Enter your name \" />" ,
14
14
`<Input
15
- placeholder="Placeholder goes here"
16
- type="text"
17
- size="medium"
15
+ placeholder="Share your thoughts..."
16
+ multiline
18
17
/>` ,
19
- `<Input
20
- placeholder="Placeholder goes here"
21
- type="text"
22
- size="small"
23
- />`
24
18
] ;
25
19
26
20
const TextInputCode = ( ) => {
@@ -34,11 +28,8 @@ const TextInputCode = () => {
34
28
< h2 > Text Input</ h2 >
35
29
</ a >
36
30
< p >
37
- Text inputs are important elements that help users interact with an
38
- experience by providing text commands that will in turn return
39
- expected results. These commands can range from providing a free range
40
- of personal information to entering a limited number of characters for
41
- a use case.
31
+ The < code > Input</ code > component enables users to enter text data in forms and interfaces.
32
+ It provides a clean, accessible way to collect user information with support for different input types and multiline text.
42
33
</ p >
43
34
< div className = "filterBtns" >
44
35
< TabButton
@@ -76,112 +67,48 @@ const TextInputCode = () => {
76
67
/>
77
68
</ div >
78
69
< div className = "main-content" >
79
- < a id = "Design" >
80
- < h2 > Design</ h2 >
81
- </ a >
82
70
< p >
83
- Instead of various types for use across designs, the text input has
84
- just one type to ensure simplicity and efficiency. It is preferable
85
- that inputs are as minimal as possible since the sole function that
86
- they generally perform is to ensure that users are able to send in
87
- data and receive corresponding information.
71
+ The Input component provides flexible text input capabilities with minimal configuration.
72
+ It integrates with Sistent's theming system while maintaining native HTML input behavior
73
+ for optimal performance and accessibility.
88
74
</ p >
89
- < div className = "showcase" >
90
- < div className = "tf-items" >
91
- < Row $Hcenter >
92
- < SistentThemeProvider initialMode = { isDark ? "dark" : "light" } >
93
- < div style = { { margin : "20px 0" } } >
94
- < Input placeholder = "Placeholder goes here" type = "text" />
95
- </ div >
96
- </ SistentThemeProvider >
97
- </ Row >
98
- </ div >
99
- < CodeBlock name = "basic-input" code = { codes [ 0 ] } />
100
- </ div >
101
- < a id = "Sizes" >
102
- < h2 > Sizes</ h2 >
75
+
76
+ < a id = "Basic Input" >
77
+ < h2 > Basic Input</ h2 >
103
78
</ a >
104
79
< p >
105
- Since input fields have a responsive width that adjusts depending on
106
- the need and use case, size considerations are mostly directed at
107
- the height of the field. This means that the size of text inputs
108
- adjust only relative to the height of the text field. Because text
109
- inputs are mostly used in tandem with buttons, to ensure design
110
- consistency, text inputs and buttons have similar size requirements.
111
- </ p >
112
- < h3 > 56px / 3.5rem</ h3 >
113
- < p >
114
- The 56px text input is the first field size. It is the largest text
115
- input available for use and it is available for both mobile and
116
- desktop resolutions, but it serves in different capacities across
117
- these different resolutions.
80
+ A simple input field for collecting single-line text data. This is the most common form of text input.
118
81
</ p >
119
82
< div className = "showcase" >
120
- < div className = "tf-items" >
121
- < Row $Hcenter >
122
- < SistentThemeProvider initialMode = { isDark ? "dark" : "light" } >
123
- < div style = { { margin : "20px 0" } } >
124
- < Input
125
- placeholder = "Placeholder goes here"
126
- type = "text"
127
- size = "medium"
128
- />
129
- </ div >
130
- </ SistentThemeProvider >
131
- </ Row >
83
+ < div className = "items" >
84
+ < SistentThemeProvider initialMode = { isDark ? "dark" : "light" } >
85
+ < Input placeholder = "Enter your name" />
86
+ </ SistentThemeProvider >
132
87
</ div >
133
- < CodeBlock name = "medium -input" code = { codes [ 1 ] } />
88
+ < CodeBlock name = "basic -input" code = { codes [ 0 ] } />
134
89
</ div >
135
- < h3 > 48px / 3rem</ h3 >
90
+
91
+ < a id = "Multiline Input" >
92
+ < h2 > Multiline Input</ h2 >
93
+ </ a >
136
94
< p >
137
- The 48px text input is the second field size in use and it is
138
- available from mobile to desktop resolutions, even though it serves
139
- in different capacities across these screen sizes.
95
+ For longer text content that may span multiple lines. The input automatically expands vertically as users type.
140
96
</ p >
141
97
< div className = "showcase" >
142
- < div className = "tf-items" >
143
- < Row $Hcenter >
144
- < SistentThemeProvider initialMode = { isDark ? "dark" : "light" } >
145
- < div style = { { margin : "20px 0" } } >
146
- < Input
147
- placeholder = "Placeholder goes here"
148
- type = "text"
149
- size = "small"
150
- />
151
- </ div >
152
- </ SistentThemeProvider >
153
- </ Row >
98
+ < div className = "items" >
99
+ < SistentThemeProvider initialMode = { isDark ? "dark" : "light" } >
100
+ < Input
101
+ placeholder = "Share your thoughts..."
102
+ multiline
103
+ />
104
+ </ SistentThemeProvider >
154
105
</ div >
155
- < CodeBlock name = "small -input" code = { codes [ 2 ] } />
106
+ < CodeBlock name = "multiline -input" code = { codes [ 1 ] } />
156
107
</ div >
157
- < p >
158
- < strong > NOTE:</ strong >
159
- </ p >
160
- < p >
161
- These sizes are being specified with numerical values because though
162
- the same size is used across screen resolutions, they have different
163
- roles. On desktop for instance, the 56px text input is a the default
164
- size, and 48px the small size, while on mobile, 56px is large and
165
- 48px is the default size. Preferred text input sizes (height) are
166
- usually arrived at through exploration and proper consideration of
167
- industry standards and best practices.
168
- </ p >
169
- < a id = "Adding Icons" >
170
- < h2 > Adding Icons</ h2 >
171
- </ a >
172
- < p >
173
- Icons can be used often in text inputs to aid in understanding the
174
- required parameters for a given field or to provide options that can
175
- help to improve the experience as a user navigates a given set of
176
- text inputs. Depending on the context, icons can be placed on the
177
- left and right at different times or even at the same time. The
178
- icons should be aligned to the left or right side of the input field
179
- and not to the center, while text remains left aligned.
180
- </ p >
181
108
</ div >
182
109
</ div >
183
110
</ SistentLayout >
184
111
) ;
185
112
} ;
186
113
187
- export default TextInputCode ;
114
+ export default TextInputCode ;
0 commit comments