tramway 1.1.1.2 → 1.1.2

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: ff6be5af7046f8107ab09309cec19ae847918386ada74006339c0130d1c2cdcc
4
- data.tar.gz: a22ac41c8bf93f817b8766f26c5f056d1fd98973d22f3eee0c7d88d2553564b3
3
+ metadata.gz: ea59bb13e40c79e864a729304ee65244445e7efa0dd7c65ef8b40486e12f2abd
4
+ data.tar.gz: 6604d77cbb0be931d3771581427fd94e7ab6291fb8d2cfc41fc1799fb7568743
5
5
  SHA512:
6
- metadata.gz: 4a315c6ad6d2af7210e6595030abf43ee149fc1f1308b193b51be7058267d262c5d74e9921cc64ba6f587e5c03c5fb627b05fbf1c5767477ea01abbab3988cb0
7
- data.tar.gz: 40703b4481eabdd0311c09dda42f430f19de1e0e7a57347b698c5e990eeddebcc1d9d582b473ac2088b4f02bc160ebe55ae4f5a53fe64ea4bdeea6fcb40493f0
6
+ metadata.gz: 54a593799cf75505bd41c90d12f5690b9acd4f594db1f50490831b061741579ae33bf9594f4421b6a8f6456292eb2a210b46b392540a86122c48dffeac724ca2
7
+ data.tar.gz: 32f655b1853dcfe7b9f2031f4170df164c51b505971a4c9154189598509af7a5ab4c70deaf2ead1a74f5f905df1cc1d59bc38965a1faf3abb4a87e9c2efb05c6
data/README.md CHANGED
@@ -857,6 +857,7 @@ Tramway provides `tramway_form_for` helper that renders Tailwind-styled forms by
857
857
  <%= f.email_field :email %>
858
858
  <%= f.password_field :password %>
859
859
  <%= f.select :role, [:admin, :user] %>
860
+ <%= f.date_field :birth_date %>
860
861
  <%= f.multiselect :permissions, [['Create User', 'create_user'], ['Update user', 'update_user']] %>
861
862
  <%= f.file_field :file %>
862
863
  <%= f.submit 'Create User' %>
@@ -871,6 +872,7 @@ Available form helpers:
871
872
  * password_field
872
873
  * file_field
873
874
  * select
875
+ * date_field
874
876
  * multiselect ([Stimulus-based](https://github.com/Purple-Magic/tramway#stimulus-based-inputs))
875
877
  * submit
876
878
 
@@ -49,6 +49,10 @@ module Tailwinds
49
49
  ), &)
50
50
  end
51
51
 
52
+ def date_field(attribute, **, &)
53
+ common_field(:date_field, :date_field, attribute, **, &)
54
+ end
55
+
52
56
  def file_field(attribute, **options, &)
53
57
  sanitized_options = sanitize_options(options)
54
58
  input = super(attribute, **sanitized_options.merge(class: :hidden))
@@ -0,0 +1,8 @@
1
+ .mb-4
2
+ - if @label
3
+ = component('tailwinds/form/label', for: @for) do
4
+ = @label
5
+ - base_classes = 'w-full bg-white border border-gray-300 rounded focus:outline-none focus:border-red-500 '
6
+ - base_classes += 'dark:bg-gray-800 dark:border-gray-600 dark:text-white dark:focus:border-red-400 dark:placeholder-white'
7
+ - classes = "#{size_class(:text_input)} #{base_classes}"
8
+ = @input.call @attribute, **@options.merge(class: classes), value: @value
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tailwinds
4
+ module Form
5
+ # Tailwind-styled date field
6
+ class DateFieldComponent < TailwindComponent
7
+ end
8
+ end
9
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '1.1.1.2'
4
+ VERSION = '1.1.2'
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: 1.1.1.2
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - kalashnikovisme
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2025-11-29 00:00:00.000000000 Z
12
+ date: 2025-12-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: anyway_config
@@ -153,6 +153,8 @@ files:
153
153
  - app/components/tailwinds/containers/narrow_component.html.haml
154
154
  - app/components/tailwinds/containers/narrow_component.rb
155
155
  - app/components/tailwinds/form/builder.rb
156
+ - app/components/tailwinds/form/date_field_component.html.haml
157
+ - app/components/tailwinds/form/date_field_component.rb
156
158
  - app/components/tailwinds/form/file_field_component.html.haml
157
159
  - app/components/tailwinds/form/file_field_component.rb
158
160
  - app/components/tailwinds/form/label_component.html.haml