x
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
<div class="space-y-4 p-4"> <div> <div class="form-field-wrapper"> <label for="password_xs" class="block font-medium text-gray-700 mb-1 text-xs"> Size: xs </label> <div class="relative flex items-center" data-controller="better-ui--forms--password-input"> <input name="password_xs" placeholder="XS password input" class="block w-full rounded-md border shadow-sm transition-colors duration-200 text-xs py-1 px-2 border-gray-300 bg-white text-gray-900 placeholder-gray-400 focus:border-primary-500 focus:ring-2 focus:ring-primary-500 focus:ring-opacity-20 focus:outline-none pr-6" type="password" data-better-ui--forms--password-input-target="input" /> <div class="absolute inset-y-0 right-0 flex items-center px-2"> <button type="button" tabindex="-1" class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 transition-colors duration-150" data-action="mousedown->better-ui--forms--password-input#toggle" aria-label="Toggle password visibility" > <!-- Eye icon (shown when password is hidden) --> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /> </svg> <!-- Eye-slash icon (shown when password is visible) --> <svg class="w-4 h-4 hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeSlashIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" /> </svg> </button> </div> </div> </div> </div> <div> <div class="form-field-wrapper"> <label for="password_sm" class="block font-medium text-gray-700 mb-1 text-sm"> Size: sm </label> <div class="relative flex items-center" data-controller="better-ui--forms--password-input"> <input name="password_sm" placeholder="SM password input" class="block w-full rounded-md border shadow-sm transition-colors duration-200 text-sm py-1.5 px-3 border-gray-300 bg-white text-gray-900 placeholder-gray-400 focus:border-primary-500 focus:ring-2 focus:ring-primary-500 focus:ring-opacity-20 focus:outline-none pr-8" type="password" data-better-ui--forms--password-input-target="input" /> <div class="absolute inset-y-0 right-0 flex items-center px-3"> <button type="button" tabindex="-1" class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 transition-colors duration-150" data-action="mousedown->better-ui--forms--password-input#toggle" aria-label="Toggle password visibility" > <!-- Eye icon (shown when password is hidden) --> <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /> </svg> <!-- Eye-slash icon (shown when password is visible) --> <svg class="w-4 h-4 hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeSlashIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" /> </svg> </button> </div> </div> </div> </div> <div> <div class="form-field-wrapper"> <label for="password_md" class="block font-medium text-gray-700 mb-1 text-sm"> Size: md </label> <div class="relative flex items-center" data-controller="better-ui--forms--password-input"> <input name="password_md" placeholder="MD password input" class="block w-full rounded-md border shadow-sm transition-colors duration-200 text-base py-2 px-4 border-gray-300 bg-white text-gray-900 placeholder-gray-400 focus:border-primary-500 focus:ring-2 focus:ring-primary-500 focus:ring-opacity-20 focus:outline-none pr-10" type="password" data-better-ui--forms--password-input-target="input" /> <div class="absolute inset-y-0 right-0 flex items-center px-4"> <button type="button" tabindex="-1" class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 transition-colors duration-150" data-action="mousedown->better-ui--forms--password-input#toggle" aria-label="Toggle password visibility" > <!-- Eye icon (shown when password is hidden) --> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /> </svg> <!-- Eye-slash icon (shown when password is visible) --> <svg class="w-5 h-5 hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeSlashIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" /> </svg> </button> </div> </div> </div> </div> <div> <div class="form-field-wrapper"> <label for="password_lg" class="block font-medium text-gray-700 mb-1 text-base"> Size: lg </label> <div class="relative flex items-center" data-controller="better-ui--forms--password-input"> <input name="password_lg" placeholder="LG password input" class="block w-full rounded-md border shadow-sm transition-colors duration-200 text-lg py-2.5 px-5 border-gray-300 bg-white text-gray-900 placeholder-gray-400 focus:border-primary-500 focus:ring-2 focus:ring-primary-500 focus:ring-opacity-20 focus:outline-none pr-12" type="password" data-better-ui--forms--password-input-target="input" /> <div class="absolute inset-y-0 right-0 flex items-center px-5"> <button type="button" tabindex="-1" class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 transition-colors duration-150" data-action="mousedown->better-ui--forms--password-input#toggle" aria-label="Toggle password visibility" > <!-- Eye icon (shown when password is hidden) --> <svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /> </svg> <!-- Eye-slash icon (shown when password is visible) --> <svg class="w-5 h-5 hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeSlashIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" /> </svg> </button> </div> </div> </div> </div> <div> <div class="form-field-wrapper"> <label for="password_xl" class="block font-medium text-gray-700 mb-1 text-lg"> Size: xl </label> <div class="relative flex items-center" data-controller="better-ui--forms--password-input"> <input name="password_xl" placeholder="XL password input" class="block w-full rounded-md border shadow-sm transition-colors duration-200 text-xl py-3 px-6 border-gray-300 bg-white text-gray-900 placeholder-gray-400 focus:border-primary-500 focus:ring-2 focus:ring-primary-500 focus:ring-opacity-20 focus:outline-none pr-14" type="password" data-better-ui--forms--password-input-target="input" /> <div class="absolute inset-y-0 right-0 flex items-center px-6"> <button type="button" tabindex="-1" class="text-gray-400 hover:text-gray-600 focus:outline-none focus:text-gray-600 transition-colors duration-150" data-action="mousedown->better-ui--forms--password-input#toggle" aria-label="Toggle password visibility" > <!-- Eye icon (shown when password is hidden) --> <svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z" /> <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.268 2.943 9.542 7-1.274 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7z" /> </svg> <!-- Eye-slash icon (shown when password is visible) --> <svg class="w-6 h-6 hidden" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-better-ui--forms--password-input-target="eyeSlashIcon" > <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13.875 18.825A10.05 10.05 0 0112 19c-4.478 0-8.268-2.943-9.543-7a9.97 9.97 0 011.563-3.029m5.858.908a3 3 0 114.243 4.243M9.878 9.878l4.242 4.242M9.88 9.88l-3.29-3.29m7.532 7.532l3.29 3.29M3 3l3.59 3.59m0 0A9.953 9.953 0 0112 5c4.478 0 8.268 2.943 9.543 7a10.025 10.025 0 01-4.132 5.411m0 0L21 21" /> </svg> </button> </div> </div> </div> </div></div>1
2
3
4
5
6
7
8
9
10
11
12
<div class="space-y-4 p-4"> <% BetterUi::Forms::BaseComponent::SIZES.each do |size| %> <div> <%= render BetterUi::Forms::PasswordInputComponent.new( name: "password_#{size}", label: "Size: #{size}", placeholder: "#{size.to_s.upcase} password input", size: size ) %> </div> <% end %></div>No notes provided.
No params configured.