stimulus_plumbers_tailwind 0.4.14 → 0.4.15

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: 3fade9eb057604db9bcfaa34e4b5465436cf4121ca2fac2fc0135d8923d8fc15
4
- data.tar.gz: 55d4ca0db20ba21adeba78c644be9a0da03d5136c55f549d697a20b290a38c39
3
+ metadata.gz: e3d393c9720a8f4e5b218bf27a64fcf9f87a52fb4ff2a3bf5dbcfa1a25268e46
4
+ data.tar.gz: 9f9fa3e2094157e15a0fd8b7be384ee2d84121e4511b978833318d5b350eb22d
5
5
  SHA512:
6
- metadata.gz: e06686efbc235d53f5b6621f23595d3f234e79ad28ce67f02579a354e25db36cde73f567a1952113084507b3344677a81c4cd19657883b80786dfadd62a903f7
7
- data.tar.gz: 10406b395a531faf1ccf516168673471bf4ebe0833958e7ca1b10457c239c04bfba2556dc58d12fc3b1263b7accdb80e3500b4eb79ded11962817623ecd28c50
6
+ metadata.gz: 9087c3f484f01a1a7ce2594722b0aec3c0773777587907ef455c02e87d86a47c7827620b15fec76bd8cdb437da022136b2328b69132e70d5faa58aec7d6c0f09
7
+ data.tar.gz: 1a2311457ecd926e7f90bd13ca3b4307e738eb57f6b117bd32ceec9d4b2c119541c0f45e992890ff065418ec02563308a4ace77297feb58c4a83278b2cf860b4
data/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [conventional commits](https://www.conventionalcommits.org/) for commit guidelines.
4
4
 
5
+ ---
6
+ ## [0.4.14](https://github.com/ryancyq/stimulus-plumbers/compare/stimulus-plumbers-tailwind/v0.4.13..stimulus-plumbers-tailwind/v0.4.14) - 2026-07-20
7
+
8
+ ### Bug Fixes
9
+
10
+ - icon schema now returns aria/data attributes from svg files ([#189](https://github.com/ryancyq/stimulus-plumbers/issues/189)) - ([ea9d079](https://github.com/ryancyq/stimulus-plumbers/commit/ea9d079d10b3f802284f9fd963fda8e9cec5f02d)) - Ryan Chang
11
+
5
12
  ---
6
13
  ## [0.4.13](https://github.com/ryancyq/stimulus-plumbers/compare/stimulus-plumbers-tailwind/v0.4.12..stimulus-plumbers-tailwind/v0.4.13) - 2026-07-20
7
14
 
@@ -1,5 +1,6 @@
1
1
  @theme {
2
- --animate-progress-slide: sp-progress-slide 1.5s ease-in-out infinite;
2
+ --sp-progress-slide-duration: 1.5s;
3
+ --animate-progress-slide: sp-progress-slide var(--sp-progress-slide-duration) ease-in-out infinite;
3
4
  }
4
5
 
5
6
  @keyframes sp-progress-slide {
@@ -7,11 +8,56 @@
7
8
  100% { transform: translateX(300%); }
8
9
  }
9
10
 
11
+ /* Segmented indeterminate: travel spans slot + chunk so the chunk clears the slot (clipped by
12
+ `overflow-hidden`) instead of parking in it, then waits its turn. */
13
+ @keyframes sp-progress-relay {
14
+ 0% { transform: translateX(-100%); }
15
+ 25% { transform: translateX(400%); }
16
+ 100% { transform: translateX(400%); }
17
+ }
18
+
19
+ /* Last slot ends the relay: chunk stops flush with the slot's far edge and fades out.
20
+ Shorter travel over a shorter window, so the glide speed is unchanged. */
21
+ @keyframes sp-progress-relay-end {
22
+ 0% { transform: translateX(-100%); opacity: 1; }
23
+ 20% { transform: translateX(300%); opacity: 1; }
24
+ 30% { transform: translateX(300%); opacity: 0; }
25
+ 100% { transform: translateX(300%); opacity: 0; }
26
+ }
27
+
10
28
  /* Ring-only; core's transition covers width, not stroke-dashoffset. */
11
29
  [data-progress-target="fill"] {
12
30
  transition: stroke-dashoffset 0.3s ease;
13
31
  }
14
32
 
33
+ /* Relay one chunk left-to-right across the segments at the bar's speed: the cycle scales with segment
34
+ count (1/0.2 = 5 slots fit the bar's 1.5s), each slot taking its turn 1/count later. The 25% glide
35
+ runs longer than that handoff — the overlap is what keeps the wave whole across the gap.
36
+ `backwards` holds a waiting slot at the first keyframe (off-screen left) so it stays hidden. */
37
+ @media (prefers-reduced-motion: no-preference) {
38
+ .sp-progress-indeterminate [aria-hidden="true"] > [data-progress-target="fill"] {
39
+ animation-name: sp-progress-relay;
40
+ animation-duration: calc(var(--sp-progress-slide-duration) / var(--sp-progress-count, 1) / 0.2);
41
+ animation-delay: calc(
42
+ var(--sp-progress-index, 0) / var(--sp-progress-count, 1) * var(--sp-progress-slide-duration)
43
+ );
44
+ /* The per-slot windows are contiguous, so a constant-speed glide reads as one continuous
45
+ wave; ease-in-out would decelerate to a stop each slot and look like a pause. */
46
+ animation-timing-function: linear;
47
+ animation-fill-mode: backwards;
48
+ }
49
+
50
+ /* Ramp the whole relay in/out at its ends only — the first slot accelerates from rest,
51
+ the last decelerates to a stop and fades; every slot between stays constant speed. */
52
+ .sp-progress-indeterminate [aria-hidden="true"]:first-child > [data-progress-target="fill"] {
53
+ animation-timing-function: ease-in;
54
+ }
55
+ .sp-progress-indeterminate [aria-hidden="true"]:last-child > [data-progress-target="fill"] {
56
+ animation-name: sp-progress-relay-end;
57
+ animation-timing-function: ease-out;
58
+ }
59
+ }
60
+
15
61
  /* Track color — kept out of the SVG so consumers can retheme it via CSS. */
16
62
  svg[role="progressbar"] .track {
17
63
  stroke: var(--sp-color-muted);
@@ -2,6 +2,6 @@
2
2
 
3
3
  module StimulusPlumbers
4
4
  module Tailwind
5
- VERSION = "0.4.14"
5
+ VERSION = "0.4.15"
6
6
  end
7
7
  end
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module StimulusPlumbers
4
+ module Themes
5
+ module Tailwind
6
+ module PasswordStrength
7
+ private
8
+
9
+ def password_strength_wrapper_classes
10
+ { classes: klasses("flex", "flex-col", "gap-(--sp-space-2)") }
11
+ end
12
+
13
+ def password_strength_rules_heading_classes
14
+ { classes: klasses("text-(length:--sp-text-sm)", "text-(--sp-color-muted-fg)") }
15
+ end
16
+
17
+ def password_strength_rules_classes
18
+ { classes: klasses("flex", "flex-col", "gap-(--sp-space-1)") }
19
+ end
20
+
21
+ # State styling keys off data-satisfied (toggled client-side by the controller),
22
+ # not a server-computed flag — the server always renders the initial (unmet) state.
23
+ def password_strength_rule_classes
24
+ state = [
25
+ "text-(--sp-color-muted-fg)",
26
+ "data-[satisfied=true]:text-(--sp-color-success)",
27
+ "data-[satisfied=true]:line-through"
28
+ ]
29
+ { classes: klasses("flex", "items-center", "gap-(--sp-space-1)", *state) }
30
+ end
31
+
32
+ def password_strength_rule_icon_classes
33
+ { classes: klasses("size-(--sp-icon-sm)", "shrink-0") }
34
+ end
35
+
36
+ def password_strength_level_classes
37
+ { classes: klasses("text-(length:--sp-text-base)", "font-semibold") }
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -9,12 +9,24 @@ module StimulusPlumbers
9
9
  bg-(--sp-color-muted)
10
10
  ].freeze
11
11
 
12
+ # `data-intent` (set per-segment by a ramp) overrides the default primary fill color.
12
13
  BAR_FILL = %w[
13
14
  h-full rounded-full bg-(--sp-color-primary)
15
+ [&[data-intent=danger]]:bg-(--sp-color-destructive)
16
+ [&[data-intent=warning]]:bg-(--sp-color-warning)
17
+ [&[data-intent=success]]:bg-(--sp-color-success)
14
18
  [.sp-progress-indeterminate_&]:animate-progress-slide
15
19
  [.sp-progress-indeterminate_&]:motion-reduce:animate-none
16
20
  ].freeze
17
21
 
22
+ # Row of equal-width slots; each slot is its own track with a BAR_FILL inside.
23
+ SEGMENTED = %w[flex w-full gap-(--sp-space-1)].freeze
24
+
25
+ SEGMENT = %w[
26
+ flex-1 h-2 overflow-hidden rounded-full
27
+ bg-(--sp-color-muted)
28
+ ].freeze
29
+
18
30
  # Circle stroke/fill live in icons/customs/progress-ring.svg — @source never scans
19
31
  # .svg files, so Tailwind classes there are inert.
20
32
  # Indeterminate class and utility land on this same svg, so this needs the compound
@@ -24,6 +36,8 @@ module StimulusPlumbers
24
36
  [&.sp-progress-indeterminate]:animate-spin
25
37
  ].freeze
26
38
 
39
+ RING_SIZES = { sm: "size-8", md: "size-12", lg: "size-16" }.freeze
40
+
27
41
  METER = %w[
28
42
  w-full h-2 rounded-full
29
43
  [&::-webkit-meter-bar]:rounded-full [&::-webkit-meter-bar]:bg-(--sp-color-muted)
@@ -43,8 +57,16 @@ module StimulusPlumbers
43
57
  { classes: klasses(*BAR_FILL) }
44
58
  end
45
59
 
46
- def progress_ring_classes
47
- { classes: klasses(*RING) }
60
+ def progress_segmented_classes
61
+ { classes: klasses(*SEGMENTED) }
62
+ end
63
+
64
+ def progress_segment_classes
65
+ { classes: klasses(*SEGMENT) }
66
+ end
67
+
68
+ def progress_ring_classes(size: nil)
69
+ { classes: klasses(*RING, *Array(RING_SIZES[size])) }
48
70
  end
49
71
 
50
72
  def progress_meter_classes
@@ -15,6 +15,7 @@ require_relative "tailwind/form/field"
15
15
  require_relative "tailwind/form/code"
16
16
  require_relative "tailwind/form/credit_card"
17
17
  require_relative "tailwind/form/input"
18
+ require_relative "tailwind/password_strength"
18
19
  require_relative "tailwind/icon"
19
20
  require_relative "tailwind/indicator"
20
21
  require_relative "tailwind/layout"
@@ -39,6 +40,7 @@ module StimulusPlumbers
39
40
  include Tailwind::Form::Code
40
41
  include Tailwind::Form::CreditCard
41
42
  include Tailwind::Form::Input
43
+ include Tailwind::PasswordStrength
42
44
  include Tailwind::Icon
43
45
  include Tailwind::Indicator
44
46
  include Tailwind::Layout
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stimulus_plumbers_tailwind
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.14
4
+ version: 0.4.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Chang
@@ -712,6 +712,7 @@ files:
712
712
  - lib/stimulus_plumbers/themes/tailwind/link.rb
713
713
  - lib/stimulus_plumbers/themes/tailwind/list.rb
714
714
  - lib/stimulus_plumbers/themes/tailwind/ordered_list.rb
715
+ - lib/stimulus_plumbers/themes/tailwind/password_strength.rb
715
716
  - lib/stimulus_plumbers/themes/tailwind/progress.rb
716
717
  - lib/stimulus_plumbers/themes/tailwind/timeline.rb
717
718
  - lib/stimulus_plumbers/themes/tailwind/timeline/group.rb