stimulus-password-strength 0.1.9 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +2 -2
- data/app/views/stimulus_password_strength/_field.html.erb +9 -17
- data/lib/generators/stimulus_password_strength/install/templates/stimulus_password_strength.rb.tt +2 -2
- data/lib/stimulus_password_strength/configuration.rb +6 -6
- data/lib/stimulus_password_strength/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e076bf216c6fa63a6dd532f6bad5752ac31ee45b683b55eb49d49a195a562fc8
|
|
4
|
+
data.tar.gz: 56e4e5731a05785411f46886423930bcea82447429849ae2995bbaa4facc50d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6e12645fbe9707b15b0a9d465fb4afa838f17b22b8e9b14f3d58a141e8613fe5942d730998fb88263016719ad041de9d947da1f62d81aa36103cfd8bcd35cf17
|
|
7
|
+
data.tar.gz: 5674b82638a142bee431e74eefad4f40969f8f268d72a30e9403a4dc3dfbb0f8804f86273456e31f43a6ea5bd5968598783f890177bdc64d3e4213b491cdcc15
|
data/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
## 0.1.9
|
|
4
4
|
|
|
5
5
|
- removed positional Tailwind utilities from the default `toggle_class` so the show/hide icon no longer gets a second vertical translation on host apps that also use the inline `toggle_style`
|
|
6
|
+
- removed default layout utility classes from the label row, status row, requirements row, and strength bar wrappers so layout mechanics now live in `*_style` only
|
|
6
7
|
- documented that `toggle_class` should stay visual only and must not reintroduce `absolute`, `right-*`, `top-1/2`, or `-translate-y-1/2`
|
|
8
|
+
- documented that other row and bar `*_class` settings should also stay visual-only
|
|
7
9
|
- refreshed the installer template to reflect the new toggle customization contract
|
|
8
10
|
|
|
9
11
|
## 0.1.8
|
data/README.md
CHANGED
|
@@ -118,7 +118,7 @@ StimulusPasswordStrength.configure do |config|
|
|
|
118
118
|
config.toggle_style = "position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);"
|
|
119
119
|
config.toggle_class = "cursor-pointer text-xs font-medium text-gray-500 hover:text-gray-700"
|
|
120
120
|
config.text_style = "width: 5.5rem; text-align: right; white-space: nowrap;"
|
|
121
|
-
config.status_row_class = "
|
|
121
|
+
config.status_row_class = ""
|
|
122
122
|
config.requirements_style = "min-height: 1rem;"
|
|
123
123
|
config.requirement_pending_style = "color: #6b7280;"
|
|
124
124
|
config.requirement_met_style = "color: #047857;"
|
|
@@ -146,7 +146,7 @@ The gem now treats critical layout as component mechanics, not host-app theme:
|
|
|
146
146
|
|
|
147
147
|
If you override these settings, preserve the same mechanics and keep right-side padding on the input (`pr-16` or equivalent) so typed text does not collide with the toggle.
|
|
148
148
|
|
|
149
|
-
Do not put positional utility classes
|
|
149
|
+
Do not put layout or positional utility classes into `toggle_class`, `status_row_class`, `requirements_class`, `label_row_class`, or `bar_track_class`. Mechanics already live in the corresponding `*_style` settings. Keep classes visual only.
|
|
150
150
|
|
|
151
151
|
## Post-Install Checklist
|
|
152
152
|
|
|
@@ -14,6 +14,14 @@
|
|
|
14
14
|
data-password-strength-fair-text-color="<%= text_colors[:fair] %>"
|
|
15
15
|
data-password-strength-good-text-color="<%= text_colors[:good] %>"
|
|
16
16
|
data-password-strength-strong-text-color="<%= text_colors[:strong] %>">
|
|
17
|
+
<div data-password-strength-target="statusRow" class="<%= status_row_class %>" style="<%= status_row_style %>; visibility: hidden;">
|
|
18
|
+
<div data-password-strength-target="strengthTrack" class="<%= bar_track_class %>" style="<%= bar_track_style %>">
|
|
19
|
+
<div data-password-strength-target="strengthBar" class="<%= bar_base_class %>" style="<%= bar_style %>; width: 0%"></div>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<p data-password-strength-target="strengthText" class="<%= text_base_class %>" style="<%= text_style %>" aria-live="polite"></p>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
17
25
|
<% if label.present? %>
|
|
18
26
|
<div class="<%= label_row_class %>" style="<%= label_row_style %>">
|
|
19
27
|
<%= form.label attribute, label, class: label_class %>
|
|
@@ -40,14 +48,6 @@
|
|
|
40
48
|
<% end %>
|
|
41
49
|
</div>
|
|
42
50
|
</div>
|
|
43
|
-
|
|
44
|
-
<div data-password-strength-target="statusRow" class="<%= status_row_class %>" style="<%= status_row_style %>; visibility: hidden;">
|
|
45
|
-
<div data-password-strength-target="strengthTrack" class="<%= bar_track_class %>" style="<%= bar_track_style %>">
|
|
46
|
-
<div data-password-strength-target="strengthBar" class="<%= bar_base_class %>" style="<%= bar_style %>; width: 0%"></div>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<p data-password-strength-target="strengthText" class="<%= text_base_class %>" style="<%= text_style %>" aria-live="polite"></p>
|
|
50
|
-
</div>
|
|
51
51
|
<% else %>
|
|
52
52
|
<% if requirements.any? %>
|
|
53
53
|
<div class="<%= requirements_class %>" style="<%= requirements_style %>">
|
|
@@ -68,17 +68,9 @@
|
|
|
68
68
|
<% end %>
|
|
69
69
|
</div>
|
|
70
70
|
<% end %>
|
|
71
|
-
|
|
72
|
-
<div data-password-strength-target="statusRow" class="<%= status_row_class %>" style="<%= status_row_style %>; visibility: hidden;">
|
|
73
|
-
<div data-password-strength-target="strengthTrack" class="<%= bar_track_class %>" style="<%= bar_track_style %>">
|
|
74
|
-
<div data-password-strength-target="strengthBar" class="<%= bar_base_class %>" style="<%= bar_style %>; width: 0%"></div>
|
|
75
|
-
</div>
|
|
76
|
-
|
|
77
|
-
<p data-password-strength-target="strengthText" class="<%= text_base_class %>" style="<%= text_style %>" aria-live="polite"></p>
|
|
78
|
-
</div>
|
|
79
71
|
<% end %>
|
|
80
72
|
|
|
81
|
-
<div
|
|
73
|
+
<div style="<%= wrapper_style %>">
|
|
82
74
|
<%= form.password_field attribute,
|
|
83
75
|
required: required,
|
|
84
76
|
autocomplete: autocomplete,
|
data/lib/generators/stimulus_password_strength/install/templates/stimulus_password_strength.rb.tt
CHANGED
|
@@ -4,9 +4,9 @@ StimulusPasswordStrength.configure do |config|
|
|
|
4
4
|
# Example customization:
|
|
5
5
|
# config.input_class = "w-full rounded-md border px-3 py-2 pr-16"
|
|
6
6
|
# config.toggle_class = "cursor-pointer text-xs font-medium text-gray-500 hover:text-gray-700"
|
|
7
|
+
# config.status_row_class = ""
|
|
7
8
|
# config.text_style = "display: inline-block; width: 5.5rem; text-align: right; white-space: nowrap;"
|
|
8
|
-
# config.
|
|
9
|
-
# config.status_row_style = "min-height: 1rem;"
|
|
9
|
+
# config.status_row_style = "display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-start; gap: 0.5rem; min-height: 1rem;"
|
|
10
10
|
# config.requirements_style = "min-height: 1rem;"
|
|
11
11
|
# config.requirement_pending_style = "color: #6b7280;"
|
|
12
12
|
# config.requirement_met_style = "color: #047857;"
|
|
@@ -33,14 +33,14 @@ module StimulusPasswordStrength
|
|
|
33
33
|
|
|
34
34
|
def initialize
|
|
35
35
|
@container_class = "space-y-1"
|
|
36
|
-
@label_row_class = "
|
|
36
|
+
@label_row_class = ""
|
|
37
37
|
@label_row_style = "display: flex; justify-content: space-between; align-items: flex-end; gap: 0.75rem;"
|
|
38
38
|
@label_class = "block text-sm font-medium text-gray-700"
|
|
39
|
-
@header_aux_class = "
|
|
39
|
+
@header_aux_class = ""
|
|
40
40
|
@header_aux_style = "display: flex; justify-content: flex-end; align-items: center;"
|
|
41
|
-
@status_row_class = "
|
|
41
|
+
@status_row_class = ""
|
|
42
42
|
@status_row_style = "display: flex; flex-direction: row-reverse; align-items: center; justify-content: flex-start; gap: 0.5rem; min-height: 1rem;"
|
|
43
|
-
@requirements_class = "
|
|
43
|
+
@requirements_class = ""
|
|
44
44
|
@requirements_style = "display: flex; justify-content: flex-end; align-items: center; gap: 0.5rem; min-height: 1rem;"
|
|
45
45
|
@requirement_class = "text-xs text-right leading-tight"
|
|
46
46
|
@requirement_style = "font-size: 0.75rem; line-height: 1rem; text-align: right;"
|
|
@@ -48,9 +48,9 @@ module StimulusPasswordStrength
|
|
|
48
48
|
@input_class = "w-full rounded-xl border border-gray-300 px-4 py-3 pr-16 shadow-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-200"
|
|
49
49
|
@toggle_class = "cursor-pointer text-xs font-medium text-gray-500 hover:text-gray-700"
|
|
50
50
|
@toggle_style = "position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; padding: 0; border: 0; background: transparent; line-height: 0; z-index: 1;"
|
|
51
|
-
@bar_track_class = "
|
|
51
|
+
@bar_track_class = ""
|
|
52
52
|
@bar_track_style = "height: 0.375rem; width: 5rem; overflow: hidden; border-radius: 9999px; background-color: #e5e7eb; visibility: hidden; flex-shrink: 0;"
|
|
53
|
-
@bar_base_class = "
|
|
53
|
+
@bar_base_class = ""
|
|
54
54
|
@bar_style = "display: block; height: 100%; border-radius: 9999px; visibility: hidden; transition: width 300ms ease, background-color 300ms ease;"
|
|
55
55
|
@text_base_class = "text-xs"
|
|
56
56
|
@text_style = "display: inline-block; width: 5.5rem; text-align: right; white-space: nowrap;"
|