simple_form-tailwind 0.1.1 → 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: b94c8eeff0a815d1772b6a5e4ea690de2c0e289202cee7994a46222374382f62
4
- data.tar.gz: 448aa7b51f85350eaea34bdac841105286eefee469a1064d93a38f159644a957
3
+ metadata.gz: c22ded5d6274d290520ed422df31a3f876ecc55efd2ad244c5fc79331f1f2d38
4
+ data.tar.gz: b903d2af76a8070ac79a574883564da189725c5621bc7e0ea97665d52756f022
5
5
  SHA512:
6
- metadata.gz: '08de397b3da511a08b0ee36784218fb175d80a71c019a203241438a0f9bb19134055f653920b8ff895742122249523067db12f6262addf2ffaef5ccd85dfc1b4'
7
- data.tar.gz: 9f02dda21cf74dd1cabffc79eb8b75b19375e73b951d109a95ebbcd9267641d5cfe47c92912907fc501fe38c711cb28062ed7972e9a7fe98ffb44690b1e63fc5
6
+ metadata.gz: 7ca518f967a62b4c6e2692e44ab169d409b1eff70ffa2f6ec6ebb9785783c085c79ae7bb890afd45e8fdcb8dcd8e05dabeb6cb2fc7707fe703085f4d0d26ce61
7
+ data.tar.gz: 358522dbdd2ff3f2e7ac78a773fb55b477b7c6d510b42cfdce63ddcd71274959a7835c57bded9f9395531d54ef04d566820b53827d0c2976622c20bddeeb26ee
data/CHANGELOG.md CHANGED
@@ -5,7 +5,19 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.0] - 2024-04-09
9
+
10
+ * Compatibility with Rails 8 and Tailwind CSS 4
11
+ * Updated installer for the new Tailwind CSS installation method
12
+ * Removed dependency on tailwind.config.js file
13
+ * Added new wrappers for date, time, datetime fields, etc.
14
+ * Fixed color classes (grey -> gray)
15
+ * Improved documentation
16
+
17
+ ## [0.1.1] - 2020-12-30
18
+
19
+ * Adjusted required rails version (so it can be used with Rails v7)
8
20
 
9
21
  ## [0.0.1] - 2020-11-29
10
22
 
11
- * Initia Commit
23
+ * Initial Commit
data/Gemfile CHANGED
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source 'https://rubygems.org'
2
4
 
3
5
  # Specify your gem's dependencies in simple_form-tailwind.gemspec
4
6
  gemspec
5
7
 
6
- gem 'rake', '~> 12.0'
7
- gem 'minitest', '~> 5.0'
8
+ gem 'minitest', '>= 5.25'
9
+ gem 'rake'
data/Gemfile.lock CHANGED
@@ -1,80 +1,136 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- simple_form-tailwind (0.1.0)
4
+ simple_form-tailwind (0.1.2)
5
5
  railties (>= 4.0)
6
6
  simple_form (>= 5.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- actionpack (6.0.3.4)
12
- actionview (= 6.0.3.4)
13
- activesupport (= 6.0.3.4)
14
- rack (~> 2.0, >= 2.0.8)
11
+ actionpack (8.0.1)
12
+ actionview (= 8.0.1)
13
+ activesupport (= 8.0.1)
14
+ nokogiri (>= 1.8.5)
15
+ rack (>= 2.2.4)
16
+ rack-session (>= 1.0.1)
15
17
  rack-test (>= 0.6.3)
16
- rails-dom-testing (~> 2.0)
17
- rails-html-sanitizer (~> 1.0, >= 1.2.0)
18
- actionview (6.0.3.4)
19
- activesupport (= 6.0.3.4)
18
+ rails-dom-testing (~> 2.2)
19
+ rails-html-sanitizer (~> 1.6)
20
+ useragent (~> 0.16)
21
+ actionview (8.0.1)
22
+ activesupport (= 8.0.1)
20
23
  builder (~> 3.1)
21
- erubi (~> 1.4)
22
- rails-dom-testing (~> 2.0)
23
- rails-html-sanitizer (~> 1.1, >= 1.2.0)
24
- activemodel (6.0.3.4)
25
- activesupport (= 6.0.3.4)
26
- activesupport (6.0.3.4)
27
- concurrent-ruby (~> 1.0, >= 1.0.2)
28
- i18n (>= 0.7, < 2)
29
- minitest (~> 5.1)
30
- tzinfo (~> 1.1)
31
- zeitwerk (~> 2.2, >= 2.2.2)
32
- builder (3.2.4)
33
- concurrent-ruby (1.1.7)
24
+ erubi (~> 1.11)
25
+ rails-dom-testing (~> 2.2)
26
+ rails-html-sanitizer (~> 1.6)
27
+ activemodel (8.0.1)
28
+ activesupport (= 8.0.1)
29
+ activesupport (8.0.1)
30
+ base64
31
+ benchmark (>= 0.3)
32
+ bigdecimal
33
+ concurrent-ruby (~> 1.0, >= 1.3.1)
34
+ connection_pool (>= 2.2.5)
35
+ drb
36
+ i18n (>= 1.6, < 2)
37
+ logger (>= 1.4.2)
38
+ minitest (>= 5.1)
39
+ securerandom (>= 0.3)
40
+ tzinfo (~> 2.0, >= 2.0.5)
41
+ uri (>= 0.13.1)
42
+ base64 (0.2.0)
43
+ benchmark (0.4.0)
44
+ bigdecimal (3.1.9)
45
+ builder (3.3.0)
46
+ concurrent-ruby (1.3.4)
47
+ connection_pool (2.4.1)
34
48
  crass (1.0.6)
35
- erubi (1.10.0)
36
- i18n (1.8.5)
49
+ date (3.4.1)
50
+ drb (2.2.1)
51
+ erubi (1.13.1)
52
+ i18n (1.14.6)
37
53
  concurrent-ruby (~> 1.0)
38
- loofah (2.8.0)
54
+ io-console (0.8.0)
55
+ irb (1.14.3)
56
+ rdoc (>= 4.0.0)
57
+ reline (>= 0.4.2)
58
+ logger (1.6.4)
59
+ loofah (2.23.1)
39
60
  crass (~> 1.0.2)
40
- nokogiri (>= 1.5.9)
41
- method_source (1.0.0)
42
- mini_portile2 (2.4.0)
43
- minitest (5.14.2)
44
- nokogiri (1.10.10)
45
- mini_portile2 (~> 2.4.0)
46
- rack (2.2.3)
47
- rack-test (1.1.0)
48
- rack (>= 1.0, < 3)
49
- rails-dom-testing (2.0.3)
50
- activesupport (>= 4.2.0)
61
+ nokogiri (>= 1.12.0)
62
+ mini_portile2 (2.8.8)
63
+ minitest (5.25.4)
64
+ nokogiri (1.18.1)
65
+ mini_portile2 (~> 2.8.2)
66
+ racc (~> 1.4)
67
+ nokogiri (1.18.1-aarch64-linux-gnu)
68
+ racc (~> 1.4)
69
+ nokogiri (1.18.1-arm-linux-gnu)
70
+ racc (~> 1.4)
71
+ nokogiri (1.18.1-arm64-darwin)
72
+ racc (~> 1.4)
73
+ nokogiri (1.18.1-x86_64-darwin)
74
+ racc (~> 1.4)
75
+ nokogiri (1.18.1-x86_64-linux-gnu)
76
+ racc (~> 1.4)
77
+ psych (5.2.2)
78
+ date
79
+ stringio
80
+ racc (1.8.1)
81
+ rack (3.1.8)
82
+ rack-session (2.0.0)
83
+ rack (>= 3.0.0)
84
+ rack-test (2.2.0)
85
+ rack (>= 1.3)
86
+ rackup (2.2.1)
87
+ rack (>= 3)
88
+ rails-dom-testing (2.2.0)
89
+ activesupport (>= 5.0.0)
90
+ minitest
51
91
  nokogiri (>= 1.6)
52
- rails-html-sanitizer (1.3.0)
53
- loofah (~> 2.3)
54
- railties (6.0.3.4)
55
- actionpack (= 6.0.3.4)
56
- activesupport (= 6.0.3.4)
57
- method_source
58
- rake (>= 0.8.7)
59
- thor (>= 0.20.3, < 2.0)
60
- rake (12.3.3)
61
- simple_form (5.0.3)
62
- actionpack (>= 5.0)
63
- activemodel (>= 5.0)
64
- thor (1.0.1)
65
- thread_safe (0.3.6)
66
- tzinfo (1.2.8)
67
- thread_safe (~> 0.1)
68
- zeitwerk (2.4.2)
92
+ rails-html-sanitizer (1.6.2)
93
+ loofah (~> 2.21)
94
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
95
+ railties (8.0.1)
96
+ actionpack (= 8.0.1)
97
+ activesupport (= 8.0.1)
98
+ irb (~> 1.13)
99
+ rackup (>= 1.0.0)
100
+ rake (>= 12.2)
101
+ thor (~> 1.0, >= 1.2.2)
102
+ zeitwerk (~> 2.6)
103
+ rake (13.2.1)
104
+ rdoc (6.10.0)
105
+ psych (>= 4.0.0)
106
+ reline (0.6.0)
107
+ io-console (~> 0.5)
108
+ securerandom (0.4.1)
109
+ simple_form (5.3.1)
110
+ actionpack (>= 5.2)
111
+ activemodel (>= 5.2)
112
+ stringio (3.1.2)
113
+ thor (1.3.2)
114
+ tzinfo (2.0.6)
115
+ concurrent-ruby (~> 1.0)
116
+ uri (1.0.2)
117
+ useragent (0.16.11)
118
+ zeitwerk (2.7.1)
69
119
 
70
120
  PLATFORMS
71
121
  ruby
122
+ aarch64-linux
123
+ arm-linux
124
+ arm64-darwin
125
+ x86-linux
126
+ x86_64-darwin
127
+ x86_64-linux
72
128
 
73
129
  DEPENDENCIES
74
130
  bundler (>= 1.17, <= 3)
75
- minitest (~> 5.0)
76
- rake (~> 12.0)
131
+ minitest (>= 5.25)
132
+ rake
77
133
  simple_form-tailwind!
78
134
 
79
135
  BUNDLED WITH
80
- 2.3.4
136
+ 2.6.2
data/README.md CHANGED
@@ -1,8 +1,18 @@
1
1
  # SimpleForm::Tailwind
2
2
 
3
- Used to add a base [simple_form](https://github.com/heartcombo/simple_form) config with basic tailwind classes added to the form attributes.
3
+ Used to add a base [simple_form](https://github.com/heartcombo/simple_form) configuration with Tailwind CSS classes for form attributes.
4
4
 
5
- **NOTE:** This simple_form config is best used with tailwindCSS `v2.0`
5
+ **NOTE:** This simple_form configuration is optimized for Rails 7> and Tailwind CSS 4.
6
+
7
+ ## Prerequisites
8
+
9
+ Before installing this gem, make sure you have installed Tailwind CSS in your Rails application:
10
+
11
+ ```bash
12
+ ./bin/bundle add tailwindcss-ruby
13
+ ./bin/bundle add tailwindcss-rails
14
+ ./bin/rails tailwindcss:install
15
+ ```
6
16
 
7
17
  ## Installation
8
18
 
@@ -12,7 +22,7 @@ Add this line to your application's Gemfile:
12
22
  gem 'simple_form-tailwind'
13
23
  ```
14
24
 
15
- And then execute:
25
+ Then execute:
16
26
 
17
27
  $ bundle install
18
28
 
@@ -22,8 +32,8 @@ Or install it yourself as:
22
32
 
23
33
  ## Usage
24
34
 
25
- To use this simple_form config you need to ensure your application is using simple_form to generate it's forms.
26
- Run the generator to add the following file to your application `config/initializers/simple_form_tailwind.rb`
35
+ To use this simple_form configuration, you need to ensure that your application uses simple_form to generate its forms.
36
+ Run the generator to add the following file to your application `config/initializers/simple_form_tailwind.rb`:
27
37
 
28
38
  $ rails g simple_form:tailwind:install
29
39
 
@@ -31,7 +41,6 @@ Run the generator to add the following file to your application `config/initiali
31
41
 
32
42
  Bug reports and pull requests are welcome on GitHub at https://github.com/tarellel/simple_form-tailwind.
33
43
 
34
-
35
44
  ## License
36
45
 
37
46
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
data/Rakefile CHANGED
@@ -1,10 +1,12 @@
1
- require "bundler/gem_tasks"
2
- require "rake/testtask"
1
+ # frozen_string_literal: true
2
+
3
+ require 'bundler/gem_tasks'
4
+ require 'rake/testtask'
3
5
 
4
6
  Rake::TestTask.new(:test) do |t|
5
- t.libs << "test"
6
- t.libs << "lib"
7
- t.test_files = FileList["test/**/*_test.rb"]
7
+ t.libs << 'test'
8
+ t.libs << 'lib'
9
+ t.test_files = FileList['test/**/*_test.rb']
8
10
  end
9
11
 
10
- task :default => :test
12
+ task default: :test
data/bin/console CHANGED
@@ -1,7 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
2
3
 
3
- require "bundler/setup"
4
- require "simple_form/tailwind"
4
+ require 'bundler/setup'
5
+ require 'simple_form/tailwind'
5
6
 
6
7
  # You can add fixtures and/or initialization code here to make experimenting
7
8
  # with your gem easier. You can also use a different console, if you like.
@@ -10,5 +11,5 @@ require "simple_form/tailwind"
10
11
  # require "pry"
11
12
  # Pry.start
12
13
 
13
- require "irb"
14
+ require 'irb'
14
15
  IRB.start(__FILE__)
@@ -8,9 +8,23 @@ module SimpleForm
8
8
  desc 'Generate a SimpleForm config for tailwind based forms'
9
9
  source_root File.expand_path('templates', __dir__)
10
10
 
11
+ def check_tailwind_installation
12
+ # Check if tailwindcss-rails is installed
13
+ unless File.exist?(Rails.root.join('app/assets/stylesheets/application.css'))
14
+ say 'Tailwind CSS is not properly installed.', :red
15
+ say 'Please install Tailwind CSS with the following commands:', :yellow
16
+ say ' ./bin/bundle add tailwindcss-ruby', :yellow
17
+ say ' ./bin/bundle add tailwindcss-rails', :yellow
18
+ say ' ./bin/rails tailwindcss:install', :yellow
19
+ exit # Cancel installation
20
+ end
21
+
22
+ say 'Tailwind CSS is properly installed.', :green
23
+ end
24
+
11
25
  def copy_initialzier
12
26
  copy_file('simple_form.rb', 'config/initializers/simple_form_tailwind.rb', force: true)
13
27
  end
14
28
  end
15
29
  end
16
- end
30
+ end
@@ -9,7 +9,7 @@ SimpleForm.setup do |config|
9
9
  config.boolean_label_class = ''
10
10
 
11
11
  # How the label text should be generated altogether with the required text.
12
- config.label_text = lambda { |label, required, explicit_label| "#{label} #{required}" }
12
+ config.label_text = ->(label, required, _explicit_label) { "#{label} #{required}" }
13
13
 
14
14
  # Define the way to render check boxes / radio buttons with labels.
15
15
  config.boolean_style = :inline
@@ -34,7 +34,6 @@ SimpleForm.setup do |config|
34
34
  config.input_field_valid_class = 'border-green-400'
35
35
  config.label_class = 'text-sm font-medium text-gray-600'
36
36
 
37
-
38
37
  # vertical forms
39
38
  #
40
39
  # vertical default_wrapper
@@ -47,9 +46,10 @@ SimpleForm.setup do |config|
47
46
  b.optional :min_max
48
47
  b.optional :readonly
49
48
  b.use :label, class: 'block', error_class: 'text-red-500'
50
- b.use :input, class: 'shadow appearance-none border border-gray-300 rounded w-full py-2 px-3 bg-white focus:outline-none focus:ring-0 focus:border-blue-500 text-gray-400 leading-6 transition-colors duration-200 ease-in-out', error_class: 'border-red-500', valid_class: 'border-green-400'
49
+ b.use :input,
50
+ class: 'shadow appearance-none border border-gray-300 rounded w-full py-2 px-3 bg-white focus:outline-none focus:ring-0 focus:border-blue-500 text-gray-400 leading-6 transition-colors duration-200 ease-in-out', error_class: 'border-red-500', valid_class: 'border-green-400'
51
51
  b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
52
- b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-grey-700 text-xs italic' }
52
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
53
53
  end
54
54
 
55
55
  # vertical input for boolean (aka checkboxes)
@@ -57,26 +57,29 @@ SimpleForm.setup do |config|
57
57
  b.use :html5
58
58
  b.optional :readonly
59
59
  b.wrapper tag: 'div', class: 'flex items-center h-5' do |ba|
60
- ba.use :input, class: 'focus:ring-2 focus:ring-indigo-500:focus ring-offset-2 h-4 w-4 text-indigo-600 border-gray-300 rounded'
60
+ ba.use :input,
61
+ class: 'focus:ring-2 focus:ring-indigo-500 ring-offset-2 h-4 w-4 text-indigo-600 border-gray-300 rounded'
61
62
  end
62
63
  b.wrapper tag: 'div', class: 'ml-3 text-sm' do |bb|
63
64
  bb.use :label, class: 'block', error_class: 'text-red-500'
64
- bb.use :hint, wrap_with: { tag: 'p', class: 'block text-grey-700 text-xs italic' }
65
+ bb.use :hint, wrap_with: { tag: 'p', class: 'block text-gray-700 text-xs italic' }
65
66
  bb.use :full_error, wrap_with: { tag: 'p', class: 'block text-red-500 text-xs italic' }
66
67
  end
67
-
68
68
  end
69
69
 
70
70
  # vertical input for radio buttons and check boxes
71
- config.wrappers :vertical_collection, item_wrapper_class: 'flex items-center', item_label_class: 'my-1 ml-3 block text-sm font-medium text-gray-400', tag: 'div', class: 'my-4' do |b|
71
+ config.wrappers :vertical_collection, item_wrapper_class: 'flex items-center',
72
+ item_label_class: 'my-1 ml-3 block text-sm font-medium text-gray-400', tag: 'div', class: 'my-4' do |b|
72
73
  b.use :html5
73
74
  b.optional :readonly
74
- b.wrapper :legend_tag, tag: 'legend', class: 'text-sm font-medium text-gray-600', error_class: 'text-red-500' do |ba|
75
+ b.wrapper :legend_tag, tag: 'legend', class: 'text-sm font-medium text-gray-600',
76
+ error_class: 'text-red-500' do |ba|
75
77
  ba.use :label_text
76
78
  end
77
- b.use :input, class: 'focus:ring-2 focus:ring-indigo-500 ring-offset-2 h-4 w-4 text-indigo-600 border-gray-300 rounded', error_class: 'text-red-500', valid_class: 'text-green-400'
79
+ b.use :input,
80
+ class: 'focus:ring-2 focus:ring-indigo-500 ring-offset-2 h-4 w-4 text-indigo-600 border-gray-300 rounded', error_class: 'text-red-500', valid_class: 'text-green-400'
78
81
  b.use :full_error, wrap_with: { tag: 'p', class: 'block mt-2 text-red-500 text-xs italic' }
79
- b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-grey-700 text-xs italic' }
82
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
80
83
  end
81
84
 
82
85
  # vertical file input
@@ -87,53 +90,101 @@ SimpleForm.setup do |config|
87
90
  b.optional :minlength
88
91
  b.optional :readonly
89
92
  b.use :label, class: 'text-sm font-medium text-gray-600 block', error_class: 'text-red-500'
90
- b.use :input, class: 'w-full text-gray-500 px-3 py-2 border rounded', error_class: 'text-red-500 border-red-500', valid_class: 'text-green-400'
93
+ b.use :input, class: 'w-full text-gray-500 px-3 py-2 border rounded', error_class: 'text-red-500 border-red-500',
94
+ valid_class: 'text-green-400'
91
95
  b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
92
- b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-grey-700 text-xs italic' }
96
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
93
97
  end
94
98
 
95
99
  # vertical multi select
96
100
  config.wrappers :vertical_multi_select, tag: 'div', class: 'my-4', error_class: 'f', valid_class: '' do |b|
97
101
  b.use :html5
98
102
  b.optional :readonly
99
- b.wrapper :legend_tag, tag: 'legend', class: 'text-sm font-medium text-gray-600', error_class: 'text-red-500' do |ba|
100
- ba.use :label_text
101
- end
103
+ b.use :label, class: 'text-sm font-medium text-gray-600 block', error_class: 'text-red-500'
102
104
  b.wrapper tag: 'div', class: 'inline-flex space-x-1' do |ba|
103
- # ba.use :input, class: 'flex w-auto w-auto text-gray-500 text-sm border-gray-300 rounded p-2', error_class: 'text-red-500', valid_class: 'text-green-400'
104
- ba.use :input, class: 'flex w-auto w-auto shadow appearance-none border border-gray-300 rounded w-full p-2 bg-white focus:outline-none focus:border-blue-500 text-gray-400 leading-4 transition-colors duration-200 ease-in-out'
105
+ ba.use :input, class: 'flex-grow', error_class: 'text-red-500', valid_class: 'text-green-400'
105
106
  end
106
107
  b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
107
- b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-grey-700 text-xs italic' }
108
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
108
109
  end
109
110
 
110
- # vertical range input
111
- config.wrappers :vertical_range, tag: 'div', class: 'my-4', error_class: 'text-red-500', valid_class: 'text-green-400' do |b|
111
+ # vertical date input
112
+ config.wrappers :vertical_date, tag: 'div', class: 'my-4', error_class: 'f', valid_class: '' do |b|
113
+ b.use :html5
114
+ b.optional :readonly
115
+ b.use :label, class: 'text-sm font-medium text-gray-600 block', error_class: 'text-red-500'
116
+ b.use :input, class: 'mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm', error_class: 'text-red-500', valid_class: 'text-green-400'
117
+ b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
118
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
119
+ end
120
+
121
+ # vertical time input
122
+ config.wrappers :vertical_time, tag: 'div', class: 'my-4', error_class: 'f', valid_class: '' do |b|
123
+ b.use :html5
124
+ b.optional :readonly
125
+ b.use :label, class: 'text-sm font-medium text-gray-600 block', error_class: 'text-red-500'
126
+ b.use :input, class: 'mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm', error_class: 'text-red-500', valid_class: 'text-green-400'
127
+ b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
128
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
129
+ end
130
+
131
+ # vertical date time
132
+ config.wrappers :vertical_datetime, tag: 'div', class: 'my-4', error_class: 'f', valid_class: '' do |b|
133
+ b.use :html5
134
+ b.optional :readonly
135
+ b.use :label, class: 'text-sm font-medium text-gray-600 block', error_class: 'text-red-500'
136
+ b.use :input, class: 'mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm', error_class: 'text-red-500', valid_class: 'text-green-400'
137
+ b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
138
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
139
+ end
140
+
141
+ # vertical date time zone
142
+ config.wrappers :vertical_datetime_local, tag: 'div', class: 'my-4', error_class: 'f', valid_class: '' do |b|
143
+ b.use :html5
144
+ b.optional :readonly
145
+ b.use :label, class: 'text-sm font-medium text-gray-600 block', error_class: 'text-red-500'
146
+ b.use :input, class: 'mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm', error_class: 'text-red-500', valid_class: 'text-green-400'
147
+ b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
148
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
149
+ end
150
+
151
+ # vertical select
152
+ config.wrappers :vertical_select, tag: 'div', class: 'my-4', error_class: 'f', valid_class: '' do |b|
153
+ b.use :html5
154
+ b.optional :readonly
155
+ b.use :label, class: 'text-sm font-medium text-gray-600 block', error_class: 'text-red-500'
156
+ b.use :input, class: 'mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm', error_class: 'text-red-500', valid_class: 'text-green-400'
157
+ b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
158
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
159
+ end
160
+
161
+ # vertical range
162
+ config.wrappers :vertical_range, tag: 'div', class: 'my-4', error_class: 'f', valid_class: '' do |b|
112
163
  b.use :html5
113
- b.use :placeholder
114
164
  b.optional :readonly
115
165
  b.optional :step
116
166
  b.use :label, class: 'text-sm font-medium text-gray-600 block', error_class: 'text-red-500'
117
- b.wrapper tag: 'div', class: 'flex items-center h-5' do |ba|
118
- ba.use :input, class: 'rounded-lg overflow-hidden appearance-none bg-gray-400 h-3 w-full text-gray-300', error_class: 'text-red-500', valid_class: 'text-green-400'
119
- end
167
+ b.use :input, class: 'mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm', error_class: 'text-red-500', valid_class: 'text-green-400'
120
168
  b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
121
- b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-grey-700 text-xs italic' }
169
+ b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-gray-700 text-xs italic' }
122
170
  end
123
171
 
124
172
  # The default wrapper to be used by the FormBuilder.
125
173
  config.default_wrapper = :vertical_form
126
174
 
127
175
  # Custom wrappers for input types. This should be a hash containing an input
128
- # type as key and the wrapper that will be used for all inputs with specified type.
176
+ # type as key and the wrapper used for the input.
129
177
  config.wrapper_mappings = {
130
- boolean: :vertical_boolean,
131
- check_boxes: :vertical_collection,
132
- date: :vertical_multi_select,
133
- datetime: :vertical_multi_select,
134
- file: :vertical_file,
178
+ boolean: :vertical_boolean,
179
+ check_boxes: :vertical_collection,
180
+ collection: :vertical_collection,
181
+ date: :vertical_date,
182
+ datetime: :vertical_datetime,
183
+ file: :vertical_file,
135
184
  radio_buttons: :vertical_collection,
136
- range: :vertical_range,
137
- time: :vertical_multi_select
185
+ range: :vertical_range,
186
+ select: :vertical_select,
187
+ time: :vertical_time,
188
+ datetime_local: :vertical_datetime_local
138
189
  }
139
190
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module SimpleForm
4
4
  module Tailwind
5
- MIN_RAILS_VERSION = '4.0'
5
+ MIN_RAILS_VERSION = '7.0'
6
6
  MIN_SIMPLEFORM_VERSION = '5.0'
7
- VERSION = '0.1.1'
7
+ VERSION = '0.2.0'
8
8
  end
9
9
  end
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  # Specify which files should be added to the gem when it is released.
24
24
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
25
- spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
25
+ spec.files = Dir.chdir(File.expand_path(__dir__)) do
26
26
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
27
27
  end
28
28
  spec.bindir = 'exe'
@@ -32,5 +32,5 @@ Gem::Specification.new do |spec|
32
32
  spec.add_runtime_dependency 'railties', ">= #{SimpleForm::Tailwind::MIN_RAILS_VERSION}"
33
33
  spec.add_dependency 'simple_form', ">= #{SimpleForm::Tailwind::MIN_SIMPLEFORM_VERSION}"
34
34
  spec.add_development_dependency 'bundler', '>= 1.17', '<= 3'
35
- spec.add_development_dependency 'rake', '>= 7.0', '<= 20.0'
35
+ spec.add_development_dependency 'rake', '>= 0'
36
36
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple_form-tailwind
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brandon Hicks
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2021-12-31 00:00:00.000000000 Z
10
+ date: 2025-05-09 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: railties
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: '4.0'
18
+ version: '7.0'
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: '4.0'
25
+ version: '7.0'
27
26
  - !ruby/object:Gem::Dependency
28
27
  name: simple_form
29
28
  requirement: !ruby/object:Gem::Requirement
@@ -64,20 +63,14 @@ dependencies:
64
63
  requirements:
65
64
  - - ">="
66
65
  - !ruby/object:Gem::Version
67
- version: '7.0'
68
- - - "<="
69
- - !ruby/object:Gem::Version
70
- version: '20.0'
66
+ version: '0'
71
67
  type: :development
72
68
  prerelease: false
73
69
  version_requirements: !ruby/object:Gem::Requirement
74
70
  requirements:
75
71
  - - ">="
76
72
  - !ruby/object:Gem::Version
77
- version: '7.0'
78
- - - "<="
79
- - !ruby/object:Gem::Version
80
- version: '20.0'
73
+ version: '0'
81
74
  description: A generator to add a simple_form config setup for tailwindCSS based forms
82
75
  email:
83
76
  - tarellel@gmail.com
@@ -108,7 +101,6 @@ metadata:
108
101
  bug_tracker_uri: https://github.com/tarellel/simple_form-tailwind/issues
109
102
  changelog_uri: https://github.com/tarellel/simple_form-tailwind/blob/master/CHANGELOG.md
110
103
  source_code_uri: https://github.com/tarellel/simple_form-tailwind
111
- post_install_message:
112
104
  rdoc_options: []
113
105
  require_paths:
114
106
  - lib
@@ -123,8 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
115
  - !ruby/object:Gem::Version
124
116
  version: '0'
125
117
  requirements: []
126
- rubygems_version: 3.2.32
127
- signing_key:
118
+ rubygems_version: 3.6.3
128
119
  specification_version: 4
129
120
  summary: A basic rails generator for adding a simpleform config setup for tailwindCSS
130
121
  based forms