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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7c21137ca8a5f181ad4bd726edc6692074146eb5c8ffb89299b16792398e5b2
4
- data.tar.gz: 5da199bf30c539c22a71666bb9ef7fd163526bac6f17c3553f0b1b2af6d119ff
3
+ metadata.gz: e076bf216c6fa63a6dd532f6bad5752ac31ee45b683b55eb49d49a195a562fc8
4
+ data.tar.gz: 56e4e5731a05785411f46886423930bcea82447429849ae2995bbaa4facc50d7
5
5
  SHA512:
6
- metadata.gz: 93e8e495a10b7eb5378f08d2cf1b58b360436b0baa21ece47b97d4f9a6c0eb78c07d7f026af4374abc7207809e7db80a3a74d5db7ecb256cb7eace382adffa54
7
- data.tar.gz: 846abdc66278229d5fb8773467937ab38b63fd9ac73ee58a42b97f1e691467156f98ea84d8ca42908afbdcf2566715eb007f281fbe6e00a002252da0a46dd863
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 = "flex min-h-5 flex-row-reverse items-center justify-start gap-2"
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 such as `absolute`, `right-*`, `top-1/2`, or `-translate-y-1/2` into `toggle_class`. Positioning is already owned by `toggle_style`; duplicating it can shift the icon upward.
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 class="relative" style="<%= wrapper_style %>">
73
+ <div style="<%= wrapper_style %>">
82
74
  <%= form.password_field attribute,
83
75
  required: required,
84
76
  autocomplete: autocomplete,
@@ -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.status_row_class = "flex min-h-5 items-center gap-2"
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 = "flex items-end justify-between gap-3"
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 = "flex justify-end"
39
+ @header_aux_class = ""
40
40
  @header_aux_style = "display: flex; justify-content: flex-end; align-items: center;"
41
- @status_row_class = "flex min-h-5 flex-row-reverse items-center justify-start gap-2"
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 = "flex justify-end gap-2"
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 = "h-1.5 w-20 overflow-hidden rounded-full bg-gray-100"
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 = "h-full rounded-full transition-all duration-300"
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;"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StimulusPasswordStrength
4
- VERSION = "0.1.9"
4
+ VERSION = "0.2.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stimulus-password-strength
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.9
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justyna Wojtczak