stimulus_plumbers_tailwind 0.4.10 → 0.4.12

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: 79b18f9be6a2f72a2b552a8f69cca0f96bc1d0d4092ed858c33f76e09c3b1e26
4
- data.tar.gz: ec35944909722c5a7bbf3840573db3a51549e8afa1720f5f069951d94b146771
3
+ metadata.gz: 6529c722267d8053a48f0541e86b43bbf055912046a1a1889f05822c5fa6d47a
4
+ data.tar.gz: 37924e7fabe09163da81f85bd2e6eadaf4c62841aeb798632bb8098d0de98ecb
5
5
  SHA512:
6
- metadata.gz: a35c48c1e604efc1f04581c6975f66199664c92f07e51050c492bcd4683dacd89fe16ff516ae84dca4bde164d34441923c5e42b4597f3f27fd64a4b056b07161
7
- data.tar.gz: 0b65ffab71d672cdd08f6ed69794fe932840838a55c4f76acdf197ae3a6822a2938bbc7b58d558033bf562da6d4f76669e5a81ffddff3bc125945187929bcbca
6
+ metadata.gz: 713da61a006ad7af72103be89bb88b7d1c0cfe0d1d9d6f6f108c32022a19c0d30874bda6529bde4fdf7cb4afb0acc095188ac48aa116a8deeb7b5311fdf7ff4f
7
+ data.tar.gz: cce57e62900daeeb039ea8f71cf440ead52d88e1e1f9d96d4fd6abf99acbca8b8458860783ce289b9816f01aa37329c0f8611379855ff94a0d009e8ebc17721d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,25 @@
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.11](https://github.com/ryancyq/stimulus-plumbers/compare/stimulus-plumbers-tailwind/v0.4.10..stimulus-plumbers-tailwind/v0.4.11) - 2026-07-19
7
+
8
+ ### Bug Fixes
9
+
10
+ - tailwind source being committed with machine path. migrate to generated source file which should be gitignored + import the generated file in css entry point file instead. ([#180](https://github.com/ryancyq/stimulus-plumbers/issues/180)) - ([347e6ed](https://github.com/ryancyq/stimulus-plumbers/commit/347e6edeee92571f4f2fe7e509b5eed8fd0f2893)) - Ryan Chang
11
+
12
+ ---
13
+ ## [0.4.10](https://github.com/ryancyq/stimulus-plumbers/compare/stimulus-plumbers-tailwind/v0.4.9..stimulus-plumbers-tailwind/v0.4.10) - 2026-07-19
14
+
15
+ ### Bug Fixes
16
+
17
+ - replace *_BASE with semantic parts ([#178](https://github.com/ryancyq/stimulus-plumbers/issues/178)) - ([9a29c0b](https://github.com/ryancyq/stimulus-plumbers/commit/9a29c0b5e804dea66d048d3058041c2cd6ccfe31)) - Ryan Chang
18
+ - install generator will copy css file from gem dir into app assets folder ([#179](https://github.com/ryancyq/stimulus-plumbers/issues/179)) - ([2e497f2](https://github.com/ryancyq/stimulus-plumbers/commit/2e497f2119b1c9aa22115c695d48ea4cdbeff9c2)) - Ryan Chang
19
+
20
+ ### Features
21
+
22
+ - form field, code + credit card ([#177](https://github.com/ryancyq/stimulus-plumbers/issues/177)) - ([d3adbab](https://github.com/ryancyq/stimulus-plumbers/commit/d3adbaba5ec345807162b03305d22a67ca3846dd)) - Ryan Chang
23
+
5
24
  ---
6
25
  ## [0.4.9](https://github.com/ryancyq/stimulus-plumbers/compare/stimulus-plumbers-tailwind/v0.4.8..stimulus-plumbers-tailwind/v0.4.9) - 2026-07-18
7
26
 
data/docs/guide.md CHANGED
@@ -16,12 +16,13 @@ the `STIMULUS_PLUMBERS_CSS_ENTRY` override are shared with the core gem — see
16
16
 
17
17
  ## Installed CSS files
18
18
 
19
- The Tailwind installer copies these files into the application and imports them relatively:
19
+ The Tailwind installer installs these CSS files and imports them relatively:
20
20
 
21
21
  - `app/assets/stylesheets/stimulus_plumbers/tokens.css`
22
22
  - `app/assets/stylesheets/stimulus_plumbers/tailwind/animations.css` — registers the indeterminate progress bar slide keyframe.
23
+ - `app/assets/builds/stimulus_plumbers/tailwind.css` — generated, git-ignored build artifact holding the gem `@source`, regenerated on every build.
23
24
 
24
- Both files are application-owned: later generator runs restore a missing copy but never overwrite
25
+ The first two files are application-owned: later generator runs restore a missing copy but never overwrite
25
26
  an existing one. Legacy imports that point into gem directories are migrated to these app-local
26
27
  paths.
27
28
 
@@ -66,12 +66,19 @@ module StimulusPlumbers
66
66
  end
67
67
 
68
68
  def apply_sources_directive(css_file)
69
+ dir = File.dirname(css_file)
70
+ sources = File.join(destination_root, SourcesDirective::SOURCES_CSS_PATH)
71
+
72
+ # Remove legacy @source first so the import lands at the anchor, not in its place.
73
+ remove_lines(css_file, SourcesDirective.removal_pattern(from: dir))
69
74
  apply_edit(
70
75
  css_file,
71
- SourcesDirective.directive(from: File.dirname(css_file)),
76
+ SourcesDirective.import_directive(from: dir, destination_root: destination_root),
72
77
  anchor_pattern: SourcesDirective.anchor_pattern,
73
78
  stale_pattern: SourcesDirective.stale_pattern
74
79
  )
80
+ write_generated(sources, SourcesDirective.file_contents(from: File.dirname(sources)))
81
+ append_to_gitignore(sources)
75
82
  end
76
83
  end
77
84
  end
@@ -8,20 +8,48 @@ module StimulusPlumbers
8
8
  module SourcesDirective
9
9
  GEM_NAME = "stimulus_plumbers_tailwind"
10
10
  LIB_DIR = File.expand_path("../../..", __dir__)
11
+ SOURCES_CSS_PATH = "app/assets/builds/stimulus_plumbers/tailwind.css"
11
12
 
12
13
  module_function
13
14
 
14
- def directive(from:)
15
+ def import_directive(from:, destination_root:)
16
+ path = Pathname.new(destination_root).join(SOURCES_CSS_PATH)
17
+ rel = path.relative_path_from(Pathname.new(from))
18
+ rel = "./#{rel}" unless rel.to_s.start_with?(".", "/")
19
+ %(@import "#{rel}";)
20
+ end
21
+
22
+ def source_line(from:)
15
23
  rel = Pathname.new(LIB_DIR).relative_path_from(Pathname.new(from))
16
24
  %(@source "#{rel}/**/*.rb";)
17
25
  end
18
26
 
27
+ def file_contents(from:)
28
+ <<~CSS
29
+ /*
30
+ * Auto-generated by stimulus_plumbers:tailwind:install.
31
+ * Holds a single @source pointing to the stimulus_plumbers_tailwind gem so the Tailwind CLI can scan its component class lists.
32
+ * The path is absolute to this machine, so this file is git-ignored and regenerated on assets:precompile / tailwindcss:build.
33
+ * Do not edit by hand.
34
+ */
35
+ #{source_line(from: from)}
36
+ CSS
37
+ end
38
+
19
39
  def anchor_pattern
20
40
  %r{@import "tailwindcss"[^;]*;}
21
41
  end
22
42
 
23
43
  def stale_pattern
24
- %r{@source "[^"]*#{Regexp.escape(GEM_NAME)}[^"]*";}
44
+ Regexp.union(
45
+ %r{@source "[^"]*#{Regexp.escape(GEM_NAME)}[^"]*";},
46
+ %r{@import "[^"]*#{Regexp.escape(SOURCES_CSS_PATH)}";},
47
+ %r{@import "[^"]*stimulus_plumbers/tailwind/sources\.css";}
48
+ )
49
+ end
50
+
51
+ def removal_pattern(from:)
52
+ Regexp.union(stale_pattern, Regexp.new(Regexp.escape(source_line(from: from))))
25
53
  end
26
54
  end
27
55
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module StimulusPlumbers
4
4
  module Tailwind
5
- VERSION = "0.4.10"
5
+ VERSION = "0.4.12"
6
6
  end
7
7
  end
@@ -15,6 +15,8 @@ module StimulusPlumbers
15
15
  inline-flex items-center justify-center gap-(--sp-space-2)
16
16
  [&:not(:has(>span))]:aspect-square
17
17
  [&:not(:has(>span))]:px-0
18
+ [&:has(>span[data-sp-label-hidden])]:aspect-square
19
+ [&:has(>span[data-sp-label-hidden])]:px-0
18
20
  ].freeze
19
21
 
20
22
  CARD = %w[
@@ -95,9 +95,13 @@ module StimulusPlumbers
95
95
  { classes: klasses(*DAY, *extra) }
96
96
  end
97
97
 
98
- def calendar_month_classes(**) = { classes: klasses(*MONTH) }
98
+ def calendar_month_classes(**)
99
+ { classes: klasses(*MONTH) }
100
+ end
99
101
 
100
- def calendar_year_classes(**) = { classes: klasses(*YEAR) }
102
+ def calendar_year_classes(**)
103
+ { classes: klasses(*YEAR) }
104
+ end
101
105
 
102
106
  def calendar_quarter_grid_classes
103
107
  { classes: klasses(*QUARTER_GRID) }
@@ -45,11 +45,25 @@ module StimulusPlumbers
45
45
  { classes: klasses(*VARIANTS.fetch(variant, VARIANTS[:tertiary]), *BASE) }
46
46
  end
47
47
 
48
- def card_header_classes = { classes: klasses(*HEADER) }
49
- def card_icon_classes = { classes: klasses(*ICON) }
50
- def card_title_classes = { classes: klasses(*TITLE) }
51
- def card_body_classes = { classes: klasses(*BODY) }
52
- def card_action_classes = { classes: klasses(*ACTION) }
48
+ def card_header_classes
49
+ { classes: klasses(*HEADER) }
50
+ end
51
+
52
+ def card_icon_classes
53
+ { classes: klasses(*ICON) }
54
+ end
55
+
56
+ def card_title_classes
57
+ { classes: klasses(*TITLE) }
58
+ end
59
+
60
+ def card_body_classes
61
+ { classes: klasses(*BODY) }
62
+ end
63
+
64
+ def card_action_classes
65
+ { classes: klasses(*ACTION) }
66
+ end
53
67
  end
54
68
  end
55
69
  end
@@ -5,14 +5,14 @@ module StimulusPlumbers
5
5
  module Tailwind
6
6
  module Form
7
7
  module Code
8
- FIELD = %w[
8
+ CODE_FIELD = %w[
9
9
  relative inline-flex w-fit rounded-(--sp-radius-md)
10
10
  focus-within:ring-(length:--sp-focus-ring-width) focus-within:ring-(--sp-focus-ring-color)
11
11
  focus-within:ring-offset-(length:--sp-focus-ring-offset)
12
12
  ].freeze
13
- FIELD_ERROR = %w[focus-within:ring-(--sp-color-error)].freeze
14
- CELLS = %w[flex items-center gap-(--sp-space-1)].freeze
15
- CELL = %w[
13
+ CODE_FIELD_ERROR = %w[focus-within:ring-(--sp-color-error)].freeze
14
+ CODE_CELLS = %w[flex items-center gap-(--sp-space-1)].freeze
15
+ CODE_CELL = %w[
16
16
  flex size-10 items-center justify-center rounded-(--sp-radius-md) border
17
17
  border-(--sp-color-muted-fg) bg-(--sp-color-bg)
18
18
  text-(length:--sp-text-lg) font-medium text-(--sp-color-fg)
@@ -21,15 +21,31 @@ module StimulusPlumbers
21
21
  data-[caret]:border-(--sp-color-primary) data-[caret]:ring-1 data-[caret]:ring-(--sp-color-primary)
22
22
  data-[group-end]:me-(--sp-space-2)
23
23
  ].freeze
24
- CELL_ERROR = %w[border-(--sp-color-error) data-[caret]:ring-(--sp-color-error)].freeze
25
- OVERLAY = %w[absolute inset-0 size-full cursor-text opacity-0 disabled:cursor-not-allowed].freeze
24
+ CODE_CELL_ERROR = %w[border-(--sp-color-error) data-[caret]:ring-(--sp-color-error)].freeze
25
+ CODE_SEPARATOR = %w[text-(--sp-color-muted-fg)].freeze
26
+ CODE_OVERLAY = %w[absolute inset-0 size-full cursor-text opacity-0 disabled:cursor-not-allowed].freeze
26
27
 
27
28
  private
28
29
 
29
- def form_field_input_code_classes(error: false) = { classes: klasses(*FIELD, *(error ? FIELD_ERROR : [])) }
30
- def form_field_input_code_cells_classes = { classes: klasses(*CELLS) }
31
- def form_field_input_code_cell_classes(error: false) = { classes: klasses(*CELL, *(error ? CELL_ERROR : [])) }
32
- def form_field_input_code_overlay_classes(**) = { classes: klasses(*OVERLAY) }
30
+ def form_field_input_code_classes(error: false, **)
31
+ { classes: klasses(*CODE_FIELD, *(error ? CODE_FIELD_ERROR : [])) }
32
+ end
33
+
34
+ def form_field_input_code_cells_classes(**)
35
+ { classes: klasses(*CODE_CELLS) }
36
+ end
37
+
38
+ def form_field_input_code_cell_classes(error: false, **)
39
+ { classes: klasses(*CODE_CELL, *(error ? CODE_CELL_ERROR : [])) }
40
+ end
41
+
42
+ def form_field_input_code_separator_classes(**)
43
+ { classes: klasses(*CODE_SEPARATOR) }
44
+ end
45
+
46
+ def form_field_input_code_overlay_classes(**)
47
+ { classes: klasses(*CODE_OVERLAY) }
48
+ end
33
49
  end
34
50
  end
35
51
  end
@@ -5,14 +5,14 @@ module StimulusPlumbers
5
5
  module Tailwind
6
6
  module Form
7
7
  module CreditCard
8
- FIELD = %w[
8
+ CREDIT_CARD_FIELD = %w[
9
9
  relative inline-flex w-fit rounded-(--sp-radius-md)
10
10
  focus-within:ring-(length:--sp-focus-ring-width) focus-within:ring-(--sp-focus-ring-color)
11
11
  focus-within:ring-offset-(length:--sp-focus-ring-offset)
12
12
  ].freeze
13
- FIELD_ERROR = %w[focus-within:ring-(--sp-color-error)].freeze
14
- CELLS = %w[flex items-center gap-(--sp-space-1)].freeze
15
- CELL = %w[
13
+ CREDIT_CARD_FIELD_ERROR = %w[focus-within:ring-(--sp-color-error)].freeze
14
+ CREDIT_CARD_CELLS = %w[flex items-center gap-(--sp-space-1)].freeze
15
+ CREDIT_CARD_CELL = %w[
16
16
  flex h-10 min-w-16 items-center justify-center px-(--sp-space-2)
17
17
  rounded-(--sp-radius-md) border
18
18
  border-(--sp-color-muted-fg) bg-(--sp-color-bg)
@@ -21,17 +21,31 @@ module StimulusPlumbers
21
21
  data-[filled]:border-(--sp-color-fg)
22
22
  data-[caret]:border-(--sp-color-primary) data-[caret]:ring-1 data-[caret]:ring-(--sp-color-primary)
23
23
  ].freeze
24
- CELL_ERROR = %w[border-(--sp-color-error) data-[caret]:ring-(--sp-color-error)].freeze
25
- SEPARATOR = %w[text-(--sp-color-muted-fg)].freeze
26
- OVERLAY = %w[absolute inset-0 size-full cursor-text opacity-0 disabled:cursor-not-allowed].freeze
24
+ CREDIT_CARD_CELL_ERROR = %w[border-(--sp-color-error) data-[caret]:ring-(--sp-color-error)].freeze
25
+ CREDIT_CARD_SEPARATOR = %w[text-(--sp-color-muted-fg)].freeze
26
+ CREDIT_CARD_OVERLAY = %w[absolute inset-0 size-full cursor-text opacity-0 disabled:cursor-not-allowed].freeze
27
27
 
28
28
  private
29
29
 
30
- def form_field_input_credit_card_classes(error: false) = { classes: klasses(*FIELD, *(error ? FIELD_ERROR : [])) }
31
- def form_field_input_credit_card_cells_classes = { classes: klasses(*CELLS) }
32
- def form_field_input_credit_card_cell_classes(error: false) = { classes: klasses(*CELL, *(error ? CELL_ERROR : [])) }
33
- def form_field_input_credit_card_separator_classes = { classes: klasses(*SEPARATOR) }
34
- def form_field_input_credit_card_overlay_classes(**) = { classes: klasses(*OVERLAY) }
30
+ def form_field_input_credit_card_classes(error: false, **)
31
+ { classes: klasses(*CREDIT_CARD_FIELD, *(error ? CREDIT_CARD_FIELD_ERROR : [])) }
32
+ end
33
+
34
+ def form_field_input_credit_card_cells_classes(**)
35
+ { classes: klasses(*CREDIT_CARD_CELLS) }
36
+ end
37
+
38
+ def form_field_input_credit_card_cell_classes(error: false, **)
39
+ { classes: klasses(*CREDIT_CARD_CELL, *(error ? CREDIT_CARD_CELL_ERROR : [])) }
40
+ end
41
+
42
+ def form_field_input_credit_card_separator_classes(**)
43
+ { classes: klasses(*CREDIT_CARD_SEPARATOR) }
44
+ end
45
+
46
+ def form_field_input_credit_card_overlay_classes(**)
47
+ { classes: klasses(*CREDIT_CARD_OVERLAY) }
48
+ end
35
49
  end
36
50
  end
37
51
  end
@@ -13,7 +13,13 @@ module StimulusPlumbers
13
13
  { classes: klasses(*GROUP, layout == :inline ? GROUP_INLINE : "flex-col") }
14
14
  end
15
15
 
16
- def form_submit_classes(**) = {}
16
+ def form_submit_classes(**)
17
+ {}
18
+ end
19
+
20
+ def form_submit_label_classes(hidden: false, **)
21
+ { classes: klasses(hidden ? "sr-only" : nil) }
22
+ end
17
23
  end
18
24
  end
19
25
  end
@@ -17,6 +17,7 @@ module StimulusPlumbers
17
17
  "calendar" => "calendar-days",
18
18
  "external-link" => "arrow-top-right-on-square",
19
19
  "reveal" => "eye",
20
+ "save" => "check",
20
21
  "grip-vertical" => "bars-3"
21
22
  }.freeze
22
23
 
@@ -35,10 +35,21 @@ module StimulusPlumbers
35
35
 
36
36
  private
37
37
 
38
- def progress_bar_classes = { classes: klasses(*BAR) }
39
- def progress_bar_fill_classes = { classes: klasses(*BAR_FILL) }
40
- def progress_ring_classes = { classes: klasses(*RING) }
41
- def progress_meter_classes = { classes: klasses(*METER) }
38
+ def progress_bar_classes
39
+ { classes: klasses(*BAR) }
40
+ end
41
+
42
+ def progress_bar_fill_classes
43
+ { classes: klasses(*BAR_FILL) }
44
+ end
45
+
46
+ def progress_ring_classes
47
+ { classes: klasses(*RING) }
48
+ end
49
+
50
+ def progress_meter_classes
51
+ { classes: klasses(*METER) }
52
+ end
42
53
  end
43
54
  end
44
55
  end
@@ -22,9 +22,17 @@ module StimulusPlumbers
22
22
 
23
23
  private
24
24
 
25
- def timeline_group_classes = { classes: klasses(WRAPPER) }
26
- def timeline_group_section_classes = { classes: klasses(SECTION) }
27
- def timeline_group_section_date_classes = { classes: klasses(DATE) }
25
+ def timeline_group_classes
26
+ { classes: klasses(WRAPPER) }
27
+ end
28
+
29
+ def timeline_group_section_classes
30
+ { classes: klasses(SECTION) }
31
+ end
32
+
33
+ def timeline_group_section_date_classes
34
+ { classes: klasses(DATE) }
35
+ end
28
36
 
29
37
  def timeline_group_section_list_classes(orientation: :vertical)
30
38
  list = orientation.to_sym == :horizontal ? LIST_HORIZONTAL : LIST_VERTICAL
@@ -86,16 +86,45 @@ module StimulusPlumbers
86
86
  { classes: klasses(base) }
87
87
  end
88
88
 
89
- def timeline_item_title_classes = { classes: klasses(ITEM_TITLE) }
90
- def timeline_item_heading_classes = { classes: klasses(ITEM_HEADING) }
91
- def timeline_item_trigger_classes = { classes: klasses(ITEM_TRIGGER) }
92
- def timeline_item_description_classes = { classes: klasses(ITEM_DESCRIPTION) }
93
- def timeline_item_detail_classes = { classes: klasses(ITEM_DETAIL) }
94
- def timeline_item_actions_classes = { classes: klasses(ITEM_ACTIONS) }
95
- def timeline_item_connector_classes = { classes: klasses(ITEM_CONNECTOR_HORIZONTAL) }
96
- def timeline_item_content_classes = { classes: klasses(ITEM_CONTENT_HORIZONTAL) }
97
- def timeline_track_line_classes = { classes: klasses(TRACK_LINE_VERTICAL) }
98
- def timeline_item_indicator_icon_slot_classes = { classes: klasses(ITEM_INDICATOR_ICON_SLOT) }
89
+ def timeline_item_title_classes
90
+ { classes: klasses(ITEM_TITLE) }
91
+ end
92
+
93
+ def timeline_item_heading_classes
94
+ { classes: klasses(ITEM_HEADING) }
95
+ end
96
+
97
+ def timeline_item_trigger_classes
98
+ { classes: klasses(ITEM_TRIGGER) }
99
+ end
100
+
101
+ def timeline_item_description_classes
102
+ { classes: klasses(ITEM_DESCRIPTION) }
103
+ end
104
+
105
+ def timeline_item_detail_classes
106
+ { classes: klasses(ITEM_DETAIL) }
107
+ end
108
+
109
+ def timeline_item_actions_classes
110
+ { classes: klasses(ITEM_ACTIONS) }
111
+ end
112
+
113
+ def timeline_item_connector_classes
114
+ { classes: klasses(ITEM_CONNECTOR_HORIZONTAL) }
115
+ end
116
+
117
+ def timeline_item_content_classes
118
+ { classes: klasses(ITEM_CONTENT_HORIZONTAL) }
119
+ end
120
+
121
+ def timeline_track_line_classes
122
+ { classes: klasses(TRACK_LINE_VERTICAL) }
123
+ end
124
+
125
+ def timeline_item_indicator_icon_slot_classes
126
+ { classes: klasses(ITEM_INDICATOR_ICON_SLOT) }
127
+ end
99
128
  end
100
129
  end
101
130
  end
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.10
4
+ version: 0.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Chang