tramway 2.2.1.2 → 2.2.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/README.md +1 -1
- data/app/components/tailwinds/button_component.rb +2 -2
- data/app/components/tailwinds/navbar_component.html.haml +51 -12
- data/app/components/tailwinds/navbar_component.rb +2 -1
- data/app/components/tailwinds/title_component.rb +1 -1
- data/config/tailwind.config.js +18 -1
- data/lib/tramway/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 897fd2c8d74063ed2391181aeafcdb3f29d18e481ea46b1b84257e3f2c33ae0f
|
|
4
|
+
data.tar.gz: 79215f222735fb92152edcf3cad1c2c1bc8c054e06b01946fec0ced0db37a125
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 88a72fde1376d90b5d68ffcd607211ce16904a6aaeb5f36bf20494a5ac7333f9680a392e3a4b55fa5c08bd26f59d6fb59c6dda781db2ddf959ae3513419399ac
|
|
7
|
+
data.tar.gz: 4ce99218a5791fc49176974f1dcc6464e752e1bfe8d69f60333926b3ed3c64736b838ea28d0e277f87bb3199753ce39e2e2c4936a054da4ba3a29fe779aa96fe
|
data/README.md
CHANGED
|
@@ -985,7 +985,7 @@ Tramway provides `tramway_form_for` helper that renders Tailwind-styled forms by
|
|
|
985
985
|
|
|
986
986
|
will render [this](https://play.tailwindcss.com/xho3LfjKkK)
|
|
987
987
|
|
|
988
|
-
Use `size:` to control the form sizing (`:small`, `:
|
|
988
|
+
Use `size:` to control the form sizing (`:small`, `:medium`, or `:large`). The default is `:medium`, and all fields rendered
|
|
989
989
|
within the form will use the same size value.
|
|
990
990
|
|
|
991
991
|
```erb
|
|
@@ -8,7 +8,7 @@ module Tailwinds
|
|
|
8
8
|
option :path, optional: true, default: -> { '#' }
|
|
9
9
|
option :color, optional: true
|
|
10
10
|
option :type, optional: true
|
|
11
|
-
option :size, default: -> { :
|
|
11
|
+
option :size, default: -> { :medium }
|
|
12
12
|
option :method, optional: true, default: -> { :get }
|
|
13
13
|
option :link, optional: true, default: -> { false }
|
|
14
14
|
option :options, optional: true, default: -> { {} }
|
|
@@ -17,7 +17,7 @@ module Tailwinds
|
|
|
17
17
|
def size_classes
|
|
18
18
|
{
|
|
19
19
|
small: 'text-sm py-1 px-2 rounded',
|
|
20
|
-
|
|
20
|
+
medium: 'py-2 px-4 h-10',
|
|
21
21
|
large: 'text-xl px-5 py-3 h-12'
|
|
22
22
|
}[size]
|
|
23
23
|
end
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
%nav{ class: navbar_classes }
|
|
2
|
-
.flex.justify-between.w-full
|
|
2
|
+
.flex.md:justify-between.w-full.items-center.relative
|
|
3
|
+
.block.sm:hidden.border.border-white.px-2.rounded
|
|
4
|
+
%button#mobile-menu-button{ class: mobile_button_classes }
|
|
5
|
+
☰
|
|
6
|
+
|
|
3
7
|
- if @title[:text].present? || @left_items.present?
|
|
4
|
-
.flex.items-center
|
|
8
|
+
.flex.items-center.absolute.transform{ class: 'left-1/2 -translate-x-1/2' }
|
|
5
9
|
- if @title[:text].present?
|
|
6
10
|
= link_to @title[:link] do
|
|
7
11
|
.text-xl{ class: title_classes }
|
|
@@ -11,10 +15,6 @@
|
|
|
11
15
|
- @left_items.each do |item|
|
|
12
16
|
= item
|
|
13
17
|
|
|
14
|
-
.block.sm:hidden
|
|
15
|
-
%button#mobile-menu-button{ class: mobile_button_classes }
|
|
16
|
-
☰
|
|
17
|
-
|
|
18
18
|
- if @right_items.present?
|
|
19
19
|
%ul.items-center.space-x-4.hidden.md:flex
|
|
20
20
|
- @right_items.each do |item|
|
|
@@ -22,17 +22,56 @@
|
|
|
22
22
|
|
|
23
23
|
#mobile-menu{ class: mobile_menu_classes }
|
|
24
24
|
- if @left_items.present?
|
|
25
|
-
%ul.flex.flex-col.space-y-
|
|
25
|
+
%ul.flex.flex-col.space-y-3.text-2xl.font-bold
|
|
26
26
|
- @left_items.each do |item|
|
|
27
27
|
= item
|
|
28
28
|
|
|
29
29
|
- if @right_items.present?
|
|
30
|
-
%ul.flex.flex-col.space-y-
|
|
30
|
+
%ul.flex.flex-col.space-y-3.text-2xl.font-bold
|
|
31
31
|
- @right_items.each do |item|
|
|
32
32
|
= item
|
|
33
33
|
|
|
34
|
+
%span.absolute.top-4.right-6.text-4xl.cursor-pointer.text-white#mobile-menu-close-button
|
|
35
|
+
⨯
|
|
36
|
+
|
|
34
37
|
:javascript
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
38
|
+
(() => {
|
|
39
|
+
const button = document.getElementById('mobile-menu-button');
|
|
40
|
+
const closeButton = document.getElementById('mobile-menu-close-button');
|
|
41
|
+
const menu = document.getElementById('mobile-menu');
|
|
42
|
+
const root = document.documentElement;
|
|
43
|
+
|
|
44
|
+
if (!button || !closeButton || !menu) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (button.dataset.navbarBound === 'true') {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
button.dataset.navbarBound = 'true';
|
|
53
|
+
|
|
54
|
+
const toggleMenu = () => {
|
|
55
|
+
const isHiddenNow = menu.classList.contains('hidden');
|
|
56
|
+
|
|
57
|
+
if (isHiddenNow) {
|
|
58
|
+
menu.classList.remove('hidden');
|
|
59
|
+
requestAnimationFrame(() => {
|
|
60
|
+
menu.classList.remove('-translate-x-full');
|
|
61
|
+
root.classList.add('overflow-hidden');
|
|
62
|
+
});
|
|
63
|
+
} else {
|
|
64
|
+
menu.classList.add('-translate-x-full');
|
|
65
|
+
root.classList.remove('overflow-hidden');
|
|
66
|
+
|
|
67
|
+
menu.addEventListener(
|
|
68
|
+
'transitionend',
|
|
69
|
+
() => menu.classList.add('hidden'),
|
|
70
|
+
{ once: true }
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
button.addEventListener('click', toggleMenu);
|
|
76
|
+
closeButton.addEventListener('click', toggleMenu);
|
|
77
|
+
})();
|
|
@@ -29,7 +29,8 @@ module Tailwinds
|
|
|
29
29
|
|
|
30
30
|
def mobile_menu_classes
|
|
31
31
|
theme_classes(
|
|
32
|
-
classic:
|
|
32
|
+
classic: "hidden inset-0 flex-col bg-gray-900 shadow-inner h-screen fixed z-50 w-screen transition-transform \
|
|
33
|
+
transform -translate-x-full duration-300 ease-in-out"
|
|
33
34
|
)
|
|
34
35
|
end
|
|
35
36
|
end
|
data/config/tailwind.config.js
CHANGED
|
@@ -4,6 +4,21 @@ module.exports = {
|
|
|
4
4
|
'ml-4',
|
|
5
5
|
'text-white',
|
|
6
6
|
'md:flex',
|
|
7
|
+
'transform',
|
|
8
|
+
'left-1/2',
|
|
9
|
+
'-translate-x-1/2',
|
|
10
|
+
'border-white',
|
|
11
|
+
'h-screen',
|
|
12
|
+
'w-screen',
|
|
13
|
+
'z-50',
|
|
14
|
+
'inset-0',
|
|
15
|
+
'top-4',
|
|
16
|
+
'right-6',
|
|
17
|
+
'text-4xl',
|
|
18
|
+
'transition-transform',
|
|
19
|
+
'-translate-x-full',
|
|
20
|
+
'duration-300',
|
|
21
|
+
'space-y-3',
|
|
7
22
|
|
|
8
23
|
// === Custom table layout utilities ===
|
|
9
24
|
'div-table',
|
|
@@ -15,10 +30,12 @@ module.exports = {
|
|
|
15
30
|
'first:block',
|
|
16
31
|
'rounded-t-xl',
|
|
17
32
|
|
|
33
|
+
// === Title Component ===
|
|
34
|
+
'md:text-4xl',
|
|
35
|
+
|
|
18
36
|
// === Visibility and typography helpers ===
|
|
19
37
|
'hidden',
|
|
20
38
|
'text-xl',
|
|
21
|
-
'text-4xl',
|
|
22
39
|
'font-bold',
|
|
23
40
|
|
|
24
41
|
// === Grid templates used for configurable layouts ===
|
data/lib/tramway/version.rb
CHANGED