tramway 0.6.1.1 → 0.6.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 +4 -4
- data/app/components/tailwinds/button_component.html.haml +11 -3
- data/app/components/tailwinds/button_component.rb +8 -8
- data/app/components/tailwinds/form/submit_button_component.html.haml +7 -2
- data/lib/tramway/helpers/views_helper.rb +1 -1
- data/lib/tramway/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5a3af652c9e3a05d8524dbdd1af0e468b01d731d90684acf1cc3ba21c8b47a98
|
|
4
|
+
data.tar.gz: '08633354153733f0178487fdb9d1353d6d953b9aa0e60dd17e83d8645b074de3'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fb847e9ef0970f10000961f82d9478b0be926c91a3e56b06b1c28c63b550a7e529a0c0bb3591238ace18f0967d8e97c4a4f765bb04aa15dcba92f7e06f7f7be5
|
|
7
|
+
data.tar.gz: 4e186f09455eca7b67a88aa89dce4582711729f299afea16ffd522f83e9534db407a824b2c6f38aa628df673a39c454fbafe1d1e9302e35347782b42b687f724
|
|
@@ -2,11 +2,19 @@
|
|
|
2
2
|
- if link
|
|
3
3
|
= link_to text, path, class: classes, **options.except(:class)
|
|
4
4
|
- else
|
|
5
|
-
|
|
5
|
+
- if type&.to_sym == :submit
|
|
6
|
+
%button{ type: :submit, name: :commit, class: classes, **options.except(:class) }
|
|
7
|
+
= text
|
|
8
|
+
- else
|
|
9
|
+
= button_to text, path, method:, class: classes, **options.except(:class)
|
|
6
10
|
- else
|
|
7
11
|
- if link
|
|
8
12
|
= link_to path, class: classes, **options.except(:class) do
|
|
9
13
|
= content
|
|
10
14
|
- else
|
|
11
|
-
|
|
12
|
-
|
|
15
|
+
- if type&.to_sym == :submit
|
|
16
|
+
%button{ type: :submit, name: :commit, class: classes, **options.except(:class) }
|
|
17
|
+
= content
|
|
18
|
+
- else
|
|
19
|
+
= button_to path, method:, class: classes, **options.except(:class) do
|
|
20
|
+
= content
|
|
@@ -5,7 +5,7 @@ module Tailwinds
|
|
|
5
5
|
#
|
|
6
6
|
class ButtonComponent < BaseComponent
|
|
7
7
|
option :text, optional: true, default: -> {}
|
|
8
|
-
option :path
|
|
8
|
+
option :path, optional: true, default: -> { '#' }
|
|
9
9
|
option :color, optional: true
|
|
10
10
|
option :type, optional: true
|
|
11
11
|
option :size, default: -> { :middle }
|
|
@@ -14,12 +14,11 @@ module Tailwinds
|
|
|
14
14
|
option :options, optional: true, default: -> { {} }
|
|
15
15
|
|
|
16
16
|
def size_classes
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
'
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
end
|
|
17
|
+
{
|
|
18
|
+
small: 'text-sm py-1 px-2 rounded',
|
|
19
|
+
middle: 'py-2 px-4',
|
|
20
|
+
large: 'text-lg px-5 py-3'
|
|
21
|
+
}[size]
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
TYPE_COLOR_MAP = {
|
|
@@ -37,7 +36,8 @@ module Tailwinds
|
|
|
37
36
|
love: :violet,
|
|
38
37
|
compassion: :indigo,
|
|
39
38
|
compassio: :indigo,
|
|
40
|
-
fear: :yellow
|
|
39
|
+
fear: :yellow,
|
|
40
|
+
submit: :green
|
|
41
41
|
}.freeze
|
|
42
42
|
|
|
43
43
|
def classes
|
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
- base_classes = 'bg-red-500 hover:bg-red-700 text-white font-bold rounded focus:outline-none focus:shadow-outline cursor-pointer '
|
|
3
3
|
- base_classes += 'dark:text-white dark:bg-red-600 dark:hover:bg-red-500 dark:focus:ring-2 dark:focus:ring-red-400'
|
|
4
4
|
- classes = "#{size_class(:submit_button)} #{base_classes}"
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
|
|
6
|
+
= helpers.tramway_button text: @text,
|
|
7
|
+
type: :submit,
|
|
8
|
+
name: :commit,
|
|
9
|
+
size:,
|
|
10
|
+
**@options
|
|
11
|
+
|
|
7
12
|
= @content
|
|
@@ -36,7 +36,7 @@ module Tramway
|
|
|
36
36
|
component 'tailwinds/table/cell', &
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
def tramway_button(path
|
|
39
|
+
def tramway_button(path: nil, text: nil, method: :get, link: false, **options)
|
|
40
40
|
component 'tailwinds/button',
|
|
41
41
|
text:,
|
|
42
42
|
path:,
|
data/lib/tramway/version.rb
CHANGED
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: 0.6.1.
|
|
4
|
+
version: 0.6.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-10-
|
|
12
|
+
date: 2025-10-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: anyway_config
|