stimulus-password-strength 0.1.6 → 0.1.7

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: 8eb8fff2974f0d1592af56c22934ea06428cda3cba5893338656745f62d70492
4
- data.tar.gz: 674058bb56631a421faf85b5a227fc34be63ecb555e72659ab51a776e5178e2a
3
+ metadata.gz: e8db6a3dd5826692d0a4fdf72856eff0c4ff1af8bbbb0856e8fbe190af7a38fb
4
+ data.tar.gz: e7d93096a263ba4216770f5b5adcf991ef2e7c8469a5aea4f35e19e937ad52ac
5
5
  SHA512:
6
- metadata.gz: 8955c89b723f03cd4be13805b7e061f2cf24d88711abb69546f1586b2e6e162b8e8ee61279c990b93a240e5d7c39629ebd3e1137edbe8fbba316c790ce082c0b
7
- data.tar.gz: dc643f160942db34b00db8ea4f89af98579993e0c1ec9a029eb56dd9128e270716d3fee9da59e35bffbfbd06739e86f1aec8fe448bbede5283b53cb789612dc0
6
+ metadata.gz: faefa1a93a66cf022dcff4e2c5ca250dd0f383d4309f536fc54f73a7280cfd03c6d48dd9d0945c521dee19a45b1ec42795c5f16a537266b083304399d29ddda3
7
+ data.tar.gz: 3b22e075de4ddc07fb000df11dbf6233a58f3767784b41c4708e8a95801d1847bc8052c465c6386cb593f28da48188e59dffd47913b50e3ad2b164bbdd433a4f
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.7
4
+
5
+ - moved password toggle positioning into inline style defaults so the show/hide icon stays inside the input even when host-app Tailwind utilities are incomplete
6
+ - removed the `linked_flow` adaptation section from the public README
7
+
3
8
  ## 0.1.6
4
9
 
5
10
  - darkened the default password strength track so the bar rail stays visible against light host-app backgrounds
data/README.md CHANGED
@@ -114,8 +114,9 @@ The gem does not try to infer rules from the model and does not add hidden fallb
114
114
  ```ruby
115
115
  StimulusPasswordStrength.configure do |config|
116
116
  config.input_class = "w-full rounded-md border px-3 py-2 pr-16"
117
- config.text_style = "min-width: 2.5rem; text-align: right; white-space: nowrap;"
118
- config.status_row_class = "flex min-h-5 items-center gap-2"
117
+ config.toggle_style = "position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);"
118
+ config.text_style = "width: 5.5rem; text-align: right; white-space: nowrap;"
119
+ config.status_row_class = "flex min-h-5 flex-row-reverse items-center justify-start gap-2"
119
120
  config.requirements_style = "min-height: 1rem;"
120
121
  config.requirement_pending_style = "color: #6b7280;"
121
122
  config.requirement_met_style = "color: #047857;"
@@ -187,14 +188,6 @@ If you are installing this gem through an AI coding agent, use:
187
188
 
188
189
  These files contain agent-specific project screening, rollout, and simplification guidance. They tell the agent how to inspect the host app, which questions to ask before changing auth UX, and how to choose between compatibility mode and conversion-focused simplification. Keep that logic there, not in this README.
189
190
 
190
- ## Example Adaptation: `linked_flow`
191
-
192
- The gem was also used in `../linked_flow` as an example of a more opinionated UX simplification:
193
-
194
- - signup and password reset work without `password_confirmation`
195
- - the UI uses `password_strength_field`
196
- - backend validation and UI both use a shared `PasswordPolicy` with minimum password length
197
-
198
191
  ## Development
199
192
 
200
193
  ```bash
@@ -96,7 +96,8 @@
96
96
  data-show-label="<%= toggle_labels[:show] %>"
97
97
  data-hide-label="<%= toggle_labels[:hide] %>"
98
98
  data-action="click->password-strength#toggle"
99
- class="<%= toggle_class %>">
99
+ class="<%= toggle_class %>"
100
+ style="<%= toggle_style %>">
100
101
  <svg data-password-strength-target="showIcon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" style="width: 1rem; height: 1rem;" aria-hidden="true">
101
102
  <path stroke-linecap="round" stroke-linejoin="round" d="M2.458 12C3.732 7.943 7.523 5 12 5c4.478 0 8.27 2.943 9.542 7-1.273 4.057-5.064 7-9.542 7-4.477 0-8.268-2.943-9.542-7Z" />
102
103
  <circle cx="12" cy="12" r="3" />
@@ -15,6 +15,7 @@ module StimulusPasswordStrength
15
15
  :requirement_style,
16
16
  :input_class,
17
17
  :toggle_class,
18
+ :toggle_style,
18
19
  :bar_track_class,
19
20
  :bar_track_style,
20
21
  :bar_base_class,
@@ -42,6 +43,7 @@ module StimulusPasswordStrength
42
43
  @requirement_style = "font-size: 0.75rem; line-height: 1rem; text-align: right;"
43
44
  @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"
44
45
  @toggle_class = "absolute right-3 top-1/2 -translate-y-1/2 cursor-pointer text-xs font-medium text-gray-500 hover:text-gray-700"
46
+ @toggle_style = "position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center;"
45
47
  @bar_track_class = "h-1.5 w-20 overflow-hidden rounded-full bg-gray-100"
46
48
  @bar_track_style = "height: 0.375rem; width: 5rem; overflow: hidden; border-radius: 9999px; background-color: #e5e7eb; visibility: hidden; flex-shrink: 0;"
47
49
  @bar_base_class = "h-full rounded-full transition-all duration-300"
@@ -24,6 +24,7 @@ module StimulusPasswordStrength
24
24
  requirement_class = options.delete(:requirement_class) || config.requirement_class
25
25
  requirement_style = options.delete(:requirement_style) || config.requirement_style
26
26
  toggle_class = options.delete(:toggle_class) || config.toggle_class
27
+ toggle_style = options.delete(:toggle_style) || config.toggle_style
27
28
  bar_track_class = options.delete(:bar_track_class) || config.bar_track_class
28
29
  bar_track_style = options.delete(:bar_track_style) || config.bar_track_style
29
30
  bar_base_class = options.delete(:bar_base_class) || config.bar_base_class
@@ -58,6 +59,7 @@ module StimulusPasswordStrength
58
59
  requirement_class: requirement_class,
59
60
  requirement_style: requirement_style,
60
61
  toggle_class: toggle_class,
62
+ toggle_style: toggle_style,
61
63
  bar_track_class: bar_track_class,
62
64
  bar_track_style: bar_track_style,
63
65
  bar_base_class: bar_base_class,
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module StimulusPasswordStrength
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.7"
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justyna Wojtczak