tramway 1.1.2.1 → 1.1.3

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: 54b7825cee0825f4606d32284f8da613c86b75137c0ecf6ef1a44639e146695e
4
- data.tar.gz: 4ee9fb80702ecd50fa9f286b17df6133ccc01cd1f3cb659dea4290836e2dd867
3
+ metadata.gz: 6dc301f6bca8cfbc81e6c68d976cfe3dfe23cce47fcbfe000731d531f09bb742
4
+ data.tar.gz: 2bb6aded7c7ffaa0dfcd2c6903db30af490cd57795675f1af6d96afe9613a3a5
5
5
  SHA512:
6
- metadata.gz: 01e8ec294dd08401272a7ab946384ae14e4f504aff01a41d7ea3b27d9c1ac399c0de607051e420f528d1c0739cda65bd4e798debf1b2d254c24405c798bbcd7e
7
- data.tar.gz: cd57654aa23eb7c7551d4b4cce625fc4d9739f4d54526e51b527030129c4e7d5f4547d60026f4259ceb469c9213afb394e98d6ab40ff4bdc8a848c4dd0451286
6
+ metadata.gz: b984b2ef4232e4b138ec76309d750e4cb570a95aebaaf0f0c21ff8f97c019ae0c8b5a53cc9184ba831ba41b3d466861d4a94db8a5a161b3205d89c5b67a376f1
7
+ data.tar.gz: d7b086421ecf3b0ccb511542f916d4fd713c66652b5bc71b2be0c3ef264a503fdaaa7f6819f4ffc25f40ebb8863a5d66896f8ae7eb06b12763e5cc18b5022b7d
data/README.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Tramway
2
2
  Unite Ruby on Rails brilliance. Streamline development with Tramway.
3
3
 
4
+ [![RubyGems Version](https://img.shields.io/gem/v/tramway.svg)](https://rubygems.org/gems/tramway)
5
+ [![Tests](https://github.com/Purple-Magic/tramway/actions/workflows/test.yml/badge.svg?branch=main)](https://github.com/Purple-Magic/tramway/actions/workflows/test.yml)
6
+ [![Lint](https://github.com/Purple-Magic/tramway/actions/workflows/lint.yml/badge.svg?branch=main)](https://github.com/Purple-Magic/tramway/actions/workflows/lint.yml)
7
+ [![RubyGems Downloads (total)](https://img.shields.io/gem/dt/tramway.svg)](https://rubygems.org/gems/tramway)
8
+
4
9
  * [Installation](https://github.com/Purple-Magic/tramway#installation)
5
10
  * [Getting Started](https://github.com/Purple-Magic/tramway?tab=readme-ov-file#getting-started)
6
11
  * [Usage](https://github.com/Purple-Magic/tramway#usage)
@@ -781,6 +786,15 @@ Tramway ships with helpers for common UI patterns built on top of Tailwind compo
781
786
 
782
787
  All additional keyword arguments are forwarded to the underlying component as HTML attributes.
783
788
 
789
+ You can also pass HTML attributes for the generated `<form>` separately via `form_options:` while keeping button-specific
790
+ attributes in `options:`:
791
+
792
+ ```erb
793
+ <%= tramway_button path: user_path(user), text: 'Create',
794
+ form_options: { data: { turbo: false } },
795
+ options: { data: { controller: 'submit-once' } } %>
796
+ ```
797
+
784
798
  The `type` option maps semantic intent to Tailwind color families. The full set of supported values is:
785
799
 
786
800
  | Type | Color |
@@ -6,7 +6,7 @@
6
6
  %button{ type: :submit, name: :commit, class: classes, **options.except(:class) }
7
7
  = text
8
8
  - else
9
- = button_to text, path, method:, class: classes, **options.except(:class)
9
+ = button_to text, path, method:, form: form_options, class: classes, **options.except(:class)
10
10
  - else
11
11
  - if link
12
12
  = link_to path, class: classes, **options.except(:class) do
@@ -16,5 +16,5 @@
16
16
  %button{ type: :submit, name: :commit, class: classes, **options.except(:class) }
17
17
  = content
18
18
  - else
19
- = button_to path, method:, class: classes, **options.except(:class) do
19
+ = button_to path, method:, class: classes, form: form_options, **options.except(:class) do
20
20
  = content
@@ -12,6 +12,7 @@ module Tailwinds
12
12
  option :method, optional: true, default: -> { :get }
13
13
  option :link, optional: true, default: -> { false }
14
14
  option :options, optional: true, default: -> { {} }
15
+ option :form_options, optional: true, default: -> { {} }
15
16
 
16
17
  def size_classes
17
18
  {
@@ -34,6 +34,16 @@ module.exports = {
34
34
  'grid-cols-8',
35
35
  'grid-cols-9',
36
36
  'grid-cols-10',
37
+ 'md:grid-cols-1',
38
+ 'md:grid-cols-2',
39
+ 'md:grid-cols-3',
40
+ 'md:grid-cols-4',
41
+ 'md:grid-cols-5',
42
+ 'md:grid-cols-6',
43
+ 'md:grid-cols-7',
44
+ 'md:grid-cols-8',
45
+ 'md:grid-cols-9',
46
+ 'md:grid-cols-10',
37
47
 
38
48
  // === Page container and alignment helpers ===
39
49
  'container',
@@ -38,18 +38,12 @@ module Tramway
38
38
  component 'tailwinds/table/cell', &
39
39
  end
40
40
 
41
- def tramway_button(path: nil, text: nil, method: :get, link: false, **options, &)
42
- component 'tailwinds/button',
43
- text:,
44
- path:,
45
- method:,
46
- link:,
47
- color: options.delete(:color),
48
- type: options.delete(:type),
49
- size: options.delete(:size),
50
- options:,
51
- &
41
+ # rubocop:disable Metrics/ParameterLists
42
+ def tramway_button(path: nil, text: nil, method: :get, link: false, form_options: {}, **options, &)
43
+ component 'tailwinds/button', text:, path:, method:, link:, form_options:, color: options.delete(:color),
44
+ type: options.delete(:type), size: options.delete(:size), options:, &
52
45
  end
46
+ # rubocop:enable Metrics/ParameterLists
53
47
 
54
48
  def tramway_back_button
55
49
  component 'tailwinds/back_button'
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tramway
4
- VERSION = '1.1.2.1'
4
+ VERSION = '1.1.3'
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.2.1
4
+ version: 1.1.3
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-12-04 00:00:00.000000000 Z
12
+ date: 2025-12-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: anyway_config