tramway 2.2.5 → 2.2.5.1

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: cd9400e71d346fc1c334cf2f7d2a8a52847c0000957b675cc5bc6c38132a1bb9
4
- data.tar.gz: 8a36f11fc6dec4e76241f150f8fe0d2d3f8bd187a5ff46f71b6e50cddb660479
3
+ metadata.gz: edc7135e1000add90876e8d8a8c528c075295cb7e17d107cc01f975cd09b71b2
4
+ data.tar.gz: b4e893c3d6f8ea6c772f390988f845098c822e7e358a95c389d569c8f50db0c4
5
5
  SHA512:
6
- metadata.gz: f6e6ae7bc9326a651b59fce3c82d88c826f1cff4712248e0c7a0b1e7abd3033b47f91151d3f6d6007a1ba33ae5097455a48aeaf835e328a45edeb329ae8160d6
7
- data.tar.gz: b546d9583c1c97b7d75797a145de2a522b4e5edd25d09add7cf3b106ac9c6bf89ae541d43667320a4f3adaafef9e7d961bc19f542595258ec5eaed8c698da12d
6
+ metadata.gz: d82d49d6660dac61c77aa545f918f7ef28631b79dcff239994c9cf6f7aba6b4b9c8ab106326627332772b65ffe3daf50a2b6fc8b9dffbdfb395a0ee8400010b8
7
+ data.tar.gz: 940347103f243095eac60fa9ae0bf16030a3b6ebc92fd661e8407e80ce383cc3945f8a68e33d7f7500f421054469e06b2954ac70168675fc7d15cf0c774e0349
@@ -1,4 +1,4 @@
1
- %h1{ class: title_classes }
1
+ %h1{ class: title_classes, **options.except(:class) }
2
2
  - if text.present?
3
3
  = text
4
4
  - else
@@ -4,10 +4,11 @@ module Tailwinds
4
4
  # Title component
5
5
  class TitleComponent < Tramway::BaseComponent
6
6
  option :text
7
+ option :options, optional: true, default: -> { {} }
7
8
 
8
9
  def title_classes
9
10
  theme_classes(
10
- classic: 'font-semibold text-2xl md:text-4xl text-gray-100'
11
+ classic: "font-semibold text-2xl md:text-4xl text-gray-100 #{options[:class]}"
11
12
  )
12
13
  end
13
14
  end
@@ -7,6 +7,7 @@ require 'net/http'
7
7
  module Tramway
8
8
  module Generators
9
9
  # nodoc
10
+ # rubocop:disable Metrics/ModuleLength
10
11
  module InstallGeneratorHelpers
11
12
  private
12
13
 
@@ -46,6 +47,14 @@ module Tramway
46
47
  '@import "tailwindcss";'
47
48
  end
48
49
 
50
+ def importmap_path
51
+ @importmap_path ||= File.join(destination_root, 'config/importmap.rb')
52
+ end
53
+
54
+ def importmap_multiselect_pin
55
+ 'pin "@tramway/multiselect", to: "tramway/multiselect_controller.js"'
56
+ end
57
+
49
58
  def agents_file_path
50
59
  @agents_file_path ||= File.join(destination_root, 'AGENTS.md')
51
60
  end
@@ -138,6 +147,7 @@ module Tramway
138
147
  )
139
148
  end
140
149
  end
150
+ # rubocop:enable Metrics/ModuleLength
141
151
 
142
152
  # Running `rails generate tramway:install` will invoke this generator
143
153
  #
@@ -214,6 +224,18 @@ module Tramway
214
224
  file.write("#{tailwind_css_import_line}\n")
215
225
  end
216
226
  end
227
+
228
+ def ensure_importmap_pin
229
+ return unless File.exist?(importmap_path)
230
+
231
+ content = File.read(importmap_path)
232
+ return if content.include?(importmap_multiselect_pin)
233
+
234
+ File.open(importmap_path, 'a') do |file|
235
+ file.write("\n") unless content.empty? || content.end_with?("\n")
236
+ file.write("#{importmap_multiselect_pin}\n")
237
+ end
238
+ end
217
239
  end
218
240
  end
219
241
  end
@@ -69,8 +69,8 @@ module Tramway
69
69
  color:
70
70
  end
71
71
 
72
- def tramway_title(text: nil, &)
73
- component 'tailwinds/title', text:, &
72
+ def tramway_title(text: nil, **options, &)
73
+ component 'tailwinds/title', text:, options:, &
74
74
  end
75
75
 
76
76
  def tramway_flash(text:, type:, **options)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '2.2.5'
4
+ VERSION = '2.2.5.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.5
4
+ version: 2.2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kalashnikovisme