phlexy_ui 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/phlexy_ui/avatar.rb +38 -0
- data/lib/phlexy_ui/badge.rb +3 -3
- data/lib/phlexy_ui/button.rb +3 -3
- data/lib/phlexy_ui/class_list.rb +12 -1
- data/lib/phlexy_ui/drawer.rb +9 -9
- data/lib/phlexy_ui/dropdown.rb +3 -3
- data/lib/phlexy_ui/link.rb +3 -3
- data/lib/phlexy_ui/loading.rb +3 -3
- data/lib/phlexy_ui/mask.rb +110 -0
- data/lib/phlexy_ui/menu.rb +3 -3
- data/lib/phlexy_ui/menu_item.rb +3 -3
- data/lib/phlexy_ui/tab.rb +0 -13
- data/lib/phlexy_ui/tab_with_content.rb +12 -1
- data/lib/phlexy_ui/tab_without_content.rb +3 -3
- data/lib/phlexy_ui/table.rb +65 -0
- data/lib/phlexy_ui/table_row.rb +77 -0
- data/lib/phlexy_ui/tabs.rb +3 -3
- data/lib/phlexy_ui/tooltip.rb +3 -3
- data/lib/phlexy_ui/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afd51b066ca04f9497e96ce00132d883007730221925fab4bfb3d6d5cb57aec2
|
4
|
+
data.tar.gz: fd72b9a2411ec3eef6f9f9b5ca7ad88a3cba8c639d6e79e9a4d3b1500b545788
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 93938b5e9e0365f144100e4d00ff757a33f50f7b7a264326ac0709506d5a4006fed131dda192d0546a3969ba777d27cfe59bf63a3f657f2cd456b2ae32ac7cf2
|
7
|
+
data.tar.gz: 3c9652fa3434d8deb8ddf5eb51c86a631d93057883630ea54b5b790a0ce8b8da3f414806b84c49fc31fe292dd2864b4c5a5d24c0a7e937712376768cec7c48a3
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PhlexyUI
|
4
|
+
class Avatar < Base
|
5
|
+
def initialize(*, as: :div, **)
|
6
|
+
super(*, **)
|
7
|
+
@as = as
|
8
|
+
end
|
9
|
+
|
10
|
+
def view_template(&)
|
11
|
+
generate_classes!(
|
12
|
+
component_html_class: :avatar,
|
13
|
+
modifiers_map: modifiers,
|
14
|
+
base_modifiers:,
|
15
|
+
options:
|
16
|
+
).then do |classes|
|
17
|
+
public_send(as, class: classes, **options, &)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
register_modifiers(
|
24
|
+
# "sm:online"
|
25
|
+
# "md:online"
|
26
|
+
# "lg:online"
|
27
|
+
online: "online",
|
28
|
+
# "sm:offline"
|
29
|
+
# "md:offline"
|
30
|
+
# "lg:offline"
|
31
|
+
offline: "offline",
|
32
|
+
# "sm:placeholder"
|
33
|
+
# "md:placeholder"
|
34
|
+
# "lg:placeholder"
|
35
|
+
placeholder: "placeholder"
|
36
|
+
)
|
37
|
+
end
|
38
|
+
end
|
data/lib/phlexy_ui/badge.rb
CHANGED
@@ -10,7 +10,7 @@ module PhlexyUI
|
|
10
10
|
def view_template(&)
|
11
11
|
generate_classes!(
|
12
12
|
component_html_class: :badge,
|
13
|
-
modifiers_map:
|
13
|
+
modifiers_map: modifiers,
|
14
14
|
base_modifiers:,
|
15
15
|
options:
|
16
16
|
).then do |classes|
|
@@ -20,7 +20,7 @@ module PhlexyUI
|
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
-
|
23
|
+
register_modifiers(
|
24
24
|
# "sm:badge-neutral"
|
25
25
|
# "md:badge-neutral"
|
26
26
|
# "lg:badge-neutral"
|
@@ -77,6 +77,6 @@ module PhlexyUI
|
|
77
77
|
# "md:badge-xs"
|
78
78
|
# "lg:badge-xs"
|
79
79
|
xs: "badge-xs"
|
80
|
-
|
80
|
+
)
|
81
81
|
end
|
82
82
|
end
|
data/lib/phlexy_ui/button.rb
CHANGED
@@ -10,7 +10,7 @@ module PhlexyUI
|
|
10
10
|
def view_template(&)
|
11
11
|
generate_classes!(
|
12
12
|
component_html_class: :btn,
|
13
|
-
modifiers_map:
|
13
|
+
modifiers_map: modifiers,
|
14
14
|
base_modifiers:,
|
15
15
|
options:
|
16
16
|
).then do |classes|
|
@@ -20,7 +20,7 @@ module PhlexyUI
|
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
-
|
23
|
+
register_modifiers(
|
24
24
|
# Modifiers
|
25
25
|
# "sm:no-animation"
|
26
26
|
# "md:no-animation"
|
@@ -115,6 +115,6 @@ module PhlexyUI
|
|
115
115
|
# "md:btn-error"
|
116
116
|
# "lg:btn-error"
|
117
117
|
error: "btn-error"
|
118
|
-
|
118
|
+
).freeze
|
119
119
|
end
|
120
120
|
end
|
data/lib/phlexy_ui/class_list.rb
CHANGED
@@ -19,6 +19,7 @@ module PhlexyUI
|
|
19
19
|
classes = []
|
20
20
|
add_component_class(classes)
|
21
21
|
add_selected_modifiers_classes(classes)
|
22
|
+
add_conditioned_modifiers_classes(classes)
|
22
23
|
add_responsive_modifiers_classes(classes)
|
23
24
|
add_class_option_classes(classes)
|
24
25
|
classes
|
@@ -46,6 +47,14 @@ module PhlexyUI
|
|
46
47
|
)
|
47
48
|
end
|
48
49
|
|
50
|
+
def add_conditioned_modifiers_classes(classes)
|
51
|
+
modifiers_map.each do |modifier, class_name|
|
52
|
+
next unless options.delete(modifier)
|
53
|
+
|
54
|
+
classes << with_config_prefix(class_name)
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
49
58
|
def html_classes_for_modifiers(modifiers, responsive_prefix: nil)
|
50
59
|
modifiers.map do |modifier|
|
51
60
|
with_responsive_prefix(
|
@@ -58,8 +67,10 @@ module PhlexyUI
|
|
58
67
|
end
|
59
68
|
|
60
69
|
def add_responsive_modifiers_classes(classes)
|
70
|
+
return unless (responsive_options = options.delete(:responsive))
|
71
|
+
|
61
72
|
RESPONSIVE_PREFIXES.each do |responsive_prefix|
|
62
|
-
if (values =
|
73
|
+
if (values = responsive_options[responsive_prefix])
|
63
74
|
classes.concat(
|
64
75
|
html_classes_for_modifiers(
|
65
76
|
Array(values),
|
data/lib/phlexy_ui/drawer.rb
CHANGED
@@ -11,7 +11,7 @@ module PhlexyUI
|
|
11
11
|
def view_template(&)
|
12
12
|
generate_classes!(
|
13
13
|
component_html_class: :drawer,
|
14
|
-
modifiers_map:
|
14
|
+
modifiers_map: modifiers,
|
15
15
|
base_modifiers:,
|
16
16
|
options:
|
17
17
|
).then do |classes|
|
@@ -61,15 +61,15 @@ module PhlexyUI
|
|
61
61
|
|
62
62
|
private
|
63
63
|
|
64
|
-
|
65
|
-
# "sm:drawer-end"
|
66
|
-
# "md:drawer-end"
|
67
|
-
# "lg:drawer-end"
|
64
|
+
register_modifiers(
|
65
|
+
# "sm:drawer-end"
|
66
|
+
# "md:drawer-end"
|
67
|
+
# "lg:drawer-end"
|
68
68
|
end: "drawer-end",
|
69
|
-
# "sm:drawer-open"
|
70
|
-
# "md:drawer-open"
|
71
|
-
# "lg:drawer-open"
|
69
|
+
# "sm:drawer-open"
|
70
|
+
# "md:drawer-open"
|
71
|
+
# "lg:drawer-open"
|
72
72
|
open: "drawer-open"
|
73
|
-
|
73
|
+
)
|
74
74
|
end
|
75
75
|
end
|
data/lib/phlexy_ui/dropdown.rb
CHANGED
@@ -10,7 +10,7 @@ module PhlexyUI
|
|
10
10
|
def view_template(&)
|
11
11
|
generate_classes!(
|
12
12
|
component_html_class: :dropdown,
|
13
|
-
modifiers_map:
|
13
|
+
modifiers_map: modifiers,
|
14
14
|
base_modifiers:,
|
15
15
|
options:
|
16
16
|
).then do |classes|
|
@@ -58,7 +58,7 @@ module PhlexyUI
|
|
58
58
|
|
59
59
|
private
|
60
60
|
|
61
|
-
|
61
|
+
register_modifiers(
|
62
62
|
# "sm:dropdown-end"
|
63
63
|
# "md:dropdown-end"
|
64
64
|
# "lg:dropdown-end"
|
@@ -87,6 +87,6 @@ module PhlexyUI
|
|
87
87
|
# "md:dropdown-open"
|
88
88
|
# "lg:dropdown-open"
|
89
89
|
open: "dropdown-open"
|
90
|
-
|
90
|
+
)
|
91
91
|
end
|
92
92
|
end
|
data/lib/phlexy_ui/link.rb
CHANGED
@@ -4,7 +4,7 @@ module PhlexyUI
|
|
4
4
|
class Link < Base
|
5
5
|
def view_template(&)
|
6
6
|
generate_classes!(
|
7
|
-
modifiers_map:
|
7
|
+
modifiers_map: modifiers,
|
8
8
|
base_modifiers:,
|
9
9
|
options:
|
10
10
|
).then do |classes|
|
@@ -16,7 +16,7 @@ module PhlexyUI
|
|
16
16
|
|
17
17
|
attr_reader :link_to_name
|
18
18
|
|
19
|
-
|
19
|
+
register_modifiers(
|
20
20
|
# "sm:link"
|
21
21
|
# "md:link"
|
22
22
|
# "lg:link"
|
@@ -85,6 +85,6 @@ module PhlexyUI
|
|
85
85
|
# "md:link-error"
|
86
86
|
# "lg:link-error"
|
87
87
|
error: "link-error"
|
88
|
-
|
88
|
+
).freeze
|
89
89
|
end
|
90
90
|
end
|
data/lib/phlexy_ui/loading.rb
CHANGED
@@ -10,7 +10,7 @@ module PhlexyUI
|
|
10
10
|
def view_template(&)
|
11
11
|
generate_classes!(
|
12
12
|
component_html_class: :loading,
|
13
|
-
modifiers_map:
|
13
|
+
modifiers_map: modifiers,
|
14
14
|
base_modifiers:,
|
15
15
|
options:
|
16
16
|
).then do |classes|
|
@@ -20,7 +20,7 @@ module PhlexyUI
|
|
20
20
|
|
21
21
|
private
|
22
22
|
|
23
|
-
|
23
|
+
register_modifiers(
|
24
24
|
# "sm:loading-spinner"
|
25
25
|
# "md:loading-spinner"
|
26
26
|
# "lg:loading-spinner"
|
@@ -93,6 +93,6 @@ module PhlexyUI
|
|
93
93
|
# "md:text-error"
|
94
94
|
# "lg:text-error"
|
95
95
|
error: "text-error"
|
96
|
-
|
96
|
+
).freeze
|
97
97
|
end
|
98
98
|
end
|
@@ -0,0 +1,110 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PhlexyUI
|
4
|
+
class Mask < Base
|
5
|
+
def initialize(*, as: :div, **)
|
6
|
+
super(*, **)
|
7
|
+
@as = as
|
8
|
+
end
|
9
|
+
|
10
|
+
def view_template(&)
|
11
|
+
generate_classes!(
|
12
|
+
component_html_class: :mask,
|
13
|
+
modifiers_map: modifiers,
|
14
|
+
base_modifiers:,
|
15
|
+
options:
|
16
|
+
).then do |classes|
|
17
|
+
public_send(as, class: classes, **options, &)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
register_modifiers(
|
24
|
+
# "sm:mask-squircle"
|
25
|
+
# "md:mask-squircle"
|
26
|
+
# "lg:mask-squircle"
|
27
|
+
squircle: "mask-squircle",
|
28
|
+
# "sm:mask-heart"
|
29
|
+
# "md:mask-heart"
|
30
|
+
# "lg:mask-heart"
|
31
|
+
heart: "mask-heart",
|
32
|
+
# "sm:mask-hexagon"
|
33
|
+
# "md:mask-hexagon"
|
34
|
+
# "lg:mask-hexagon"
|
35
|
+
hexagon: "mask-hexagon",
|
36
|
+
# "sm:mask-hexagon-2"
|
37
|
+
# "md:mask-hexagon-2"
|
38
|
+
# "lg:mask-hexagon-2"
|
39
|
+
hexagon_2: "mask-hexagon-2",
|
40
|
+
# "sm:mask-decagon"
|
41
|
+
# "md:mask-decagon"
|
42
|
+
# "lg:mask-decagon"
|
43
|
+
decagon: "mask-decagon",
|
44
|
+
# "sm:mask-pentagon"
|
45
|
+
# "md:mask-pentagon"
|
46
|
+
# "lg:mask-pentagon"
|
47
|
+
pentagon: "mask-pentagon",
|
48
|
+
# "sm:mask-diamond"
|
49
|
+
# "md:mask-diamond"
|
50
|
+
# "lg:mask-diamond"
|
51
|
+
diamond: "mask-diamond",
|
52
|
+
# "sm:mask-square"
|
53
|
+
# "md:mask-square"
|
54
|
+
# "lg:mask-square"
|
55
|
+
square: "mask-square",
|
56
|
+
# "sm:mask-circle"
|
57
|
+
# "md:mask-circle"
|
58
|
+
# "lg:mask-circle"
|
59
|
+
circle: "mask-circle",
|
60
|
+
# "sm:mask-parallelogram"
|
61
|
+
# "md:mask-parallelogram"
|
62
|
+
# "lg:mask-parallelogram"
|
63
|
+
parallelogram: "mask-parallelogram",
|
64
|
+
# "sm:mask-parallelogram-2"
|
65
|
+
# "md:mask-parallelogram-2"
|
66
|
+
# "lg:mask-parallelogram-2"
|
67
|
+
parallelogram_2: "mask-parallelogram-2",
|
68
|
+
# "sm:mask-parallelogram-3"
|
69
|
+
# "md:mask-parallelogram-3"
|
70
|
+
# "lg:mask-parallelogram-3"
|
71
|
+
parallelogram_3: "mask-parallelogram-3",
|
72
|
+
# "sm:mask-parallelogram-4"
|
73
|
+
# "md:mask-parallelogram-4"
|
74
|
+
# "lg:mask-parallelogram-4"
|
75
|
+
parallelogram_4: "mask-parallelogram-4",
|
76
|
+
# "sm:mask-star"
|
77
|
+
# "md:mask-star"
|
78
|
+
# "lg:mask-star"
|
79
|
+
star: "mask-star",
|
80
|
+
# "sm:mask-star-2"
|
81
|
+
# "md:mask-star-2"
|
82
|
+
# "lg:mask-star-2"
|
83
|
+
star_2: "mask-star-2",
|
84
|
+
# "sm:mask-triangle"
|
85
|
+
# "md:mask-triangle"
|
86
|
+
# "lg:mask-triangle"
|
87
|
+
triangle: "mask-triangle",
|
88
|
+
# "sm:mask-triangle-2"
|
89
|
+
# "md:mask-triangle-2"
|
90
|
+
# "lg:mask-triangle-2"
|
91
|
+
triangle_2: "mask-triangle-2",
|
92
|
+
# "sm:mask-triangle-3"
|
93
|
+
# "md:mask-triangle-3"
|
94
|
+
# "lg:mask-triangle-3"
|
95
|
+
triangle_3: "mask-triangle-3",
|
96
|
+
# "sm:mask-triangle-4"
|
97
|
+
# "md:mask-triangle-4"
|
98
|
+
# "lg:mask-triangle-4"
|
99
|
+
triangle_4: "mask-triangle-4",
|
100
|
+
# "sm:mask-half-1"
|
101
|
+
# "md:mask-half-1"
|
102
|
+
# "lg:mask-half-1"
|
103
|
+
half_1: "mask-half-1",
|
104
|
+
# "sm:mask-half-2"
|
105
|
+
# "md:mask-half-2"
|
106
|
+
# "lg:mask-half-2"
|
107
|
+
half_2: "mask-half-2"
|
108
|
+
)
|
109
|
+
end
|
110
|
+
end
|
data/lib/phlexy_ui/menu.rb
CHANGED
@@ -5,7 +5,7 @@ module PhlexyUI
|
|
5
5
|
def view_template(&)
|
6
6
|
generate_classes!(
|
7
7
|
component_html_class: :menu,
|
8
|
-
modifiers_map:
|
8
|
+
modifiers_map: modifiers,
|
9
9
|
base_modifiers:,
|
10
10
|
options:
|
11
11
|
).then do |classes|
|
@@ -40,7 +40,7 @@ module PhlexyUI
|
|
40
40
|
|
41
41
|
private
|
42
42
|
|
43
|
-
|
43
|
+
register_modifiers(
|
44
44
|
# "sm:menu-xs"
|
45
45
|
# "md:menu-xs"
|
46
46
|
# "lg:menu-xs"
|
@@ -109,6 +109,6 @@ module PhlexyUI
|
|
109
109
|
# "md:bg-error md:text-error-content"
|
110
110
|
# "lg:bg-error lg:text-error-content"
|
111
111
|
error: "bg-error text-error-content"
|
112
|
-
|
112
|
+
)
|
113
113
|
end
|
114
114
|
end
|
data/lib/phlexy_ui/menu_item.rb
CHANGED
@@ -5,7 +5,7 @@ module PhlexyUI
|
|
5
5
|
class MenuItem < Base
|
6
6
|
def view_template(&)
|
7
7
|
generate_classes!(
|
8
|
-
modifiers_map:
|
8
|
+
modifiers_map: modifiers,
|
9
9
|
base_modifiers:,
|
10
10
|
options:
|
11
11
|
).then do |classes|
|
@@ -32,7 +32,7 @@ module PhlexyUI
|
|
32
32
|
|
33
33
|
private
|
34
34
|
|
35
|
-
|
35
|
+
register_modifiers(
|
36
36
|
# "sm:disabled"
|
37
37
|
# "md:disabled"
|
38
38
|
# "lg:disabled"
|
@@ -45,6 +45,6 @@ module PhlexyUI
|
|
45
45
|
# "md:focus"
|
46
46
|
# "lg:focus"
|
47
47
|
focus: "focus"
|
48
|
-
|
48
|
+
)
|
49
49
|
end
|
50
50
|
end
|
data/lib/phlexy_ui/tab.rb
CHANGED
@@ -39,18 +39,5 @@ module PhlexyUI
|
|
39
39
|
end
|
40
40
|
end
|
41
41
|
end
|
42
|
-
|
43
|
-
private
|
44
|
-
|
45
|
-
TAB_MODIFIERS_CLASSES = {
|
46
|
-
# "sm:tab-active"
|
47
|
-
# "md:tab-active"
|
48
|
-
# "lg:tab-active"
|
49
|
-
active: "tab-active",
|
50
|
-
# "sm:tab-disabled"
|
51
|
-
# "md:tab-disabled"
|
52
|
-
# "lg:tab-disabled"
|
53
|
-
disabled: "tab-disabled"
|
54
|
-
}.freeze
|
55
42
|
end
|
56
43
|
end
|
@@ -20,7 +20,7 @@ module PhlexyUI
|
|
20
20
|
|
21
21
|
generate_classes!(
|
22
22
|
component_html_class: :tab,
|
23
|
-
modifiers_map:
|
23
|
+
modifiers_map: modifiers,
|
24
24
|
base_modifiers:,
|
25
25
|
options:
|
26
26
|
).then do |classes|
|
@@ -46,5 +46,16 @@ module PhlexyUI
|
|
46
46
|
open: {checked: true},
|
47
47
|
closed: true
|
48
48
|
}.freeze
|
49
|
+
|
50
|
+
register_modifiers(
|
51
|
+
# "sm:tab-active"
|
52
|
+
# "md:tab-active"
|
53
|
+
# "lg:tab-active"
|
54
|
+
active: "tab-active",
|
55
|
+
# "sm:tab-disabled"
|
56
|
+
# "md:tab-disabled"
|
57
|
+
# "lg:tab-disabled"
|
58
|
+
disabled: "tab-disabled"
|
59
|
+
)
|
49
60
|
end
|
50
61
|
end
|
@@ -6,7 +6,7 @@ module PhlexyUI
|
|
6
6
|
def view_template(&)
|
7
7
|
generate_classes!(
|
8
8
|
component_html_class: :tab,
|
9
|
-
modifiers_map:
|
9
|
+
modifiers_map: modifiers,
|
10
10
|
base_modifiers:,
|
11
11
|
options:
|
12
12
|
).then do |classes|
|
@@ -18,7 +18,7 @@ module PhlexyUI
|
|
18
18
|
|
19
19
|
attr_reader :title
|
20
20
|
|
21
|
-
|
21
|
+
register_modifiers(
|
22
22
|
# "sm:tab-active"
|
23
23
|
# "md:tab-active"
|
24
24
|
# "lg:tab-active"
|
@@ -27,6 +27,6 @@ module PhlexyUI
|
|
27
27
|
# "md:tab-disabled"
|
28
28
|
# "lg:tab-disabled"
|
29
29
|
disabled: "tab-disabled"
|
30
|
-
|
30
|
+
)
|
31
31
|
end
|
32
32
|
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PhlexyUI
|
4
|
+
class Table < Base
|
5
|
+
def view_template(&)
|
6
|
+
generate_classes!(
|
7
|
+
component_html_class: :table,
|
8
|
+
modifiers_map: modifiers,
|
9
|
+
base_modifiers:,
|
10
|
+
options:
|
11
|
+
).then do |classes|
|
12
|
+
table(class: classes, **options, &)
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
def header(*, **, &)
|
17
|
+
thead(*, **, &)
|
18
|
+
end
|
19
|
+
|
20
|
+
def row(*, **, &)
|
21
|
+
render TableRow.new(*, **, &)
|
22
|
+
end
|
23
|
+
|
24
|
+
def body(*, **, &)
|
25
|
+
tbody(*, **, &)
|
26
|
+
end
|
27
|
+
|
28
|
+
def footer(*, **, &)
|
29
|
+
tfoot(*, **, &)
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
34
|
+
register_modifiers(
|
35
|
+
# "sm:table-zebra"
|
36
|
+
# "md:table-zebra"
|
37
|
+
# "lg:table-zebra"
|
38
|
+
zebra: "table-zebra",
|
39
|
+
# "sm:table-pin-rows"
|
40
|
+
# "md:table-pin-rows"
|
41
|
+
# "lg:table-pin-rows"
|
42
|
+
pin_rows: "table-pin-rows",
|
43
|
+
# "sm:table-pin-cols"
|
44
|
+
# "md:table-pin-cols"
|
45
|
+
# "lg:table-pin-cols"
|
46
|
+
pin_cols: "table-pin-cols",
|
47
|
+
# "sm:table-xs"
|
48
|
+
# "md:table-xs"
|
49
|
+
# "lg:table-xs"
|
50
|
+
xs: "table-xs",
|
51
|
+
# "sm:table-sm"
|
52
|
+
# "md:table-sm"
|
53
|
+
# "lg:table-sm"
|
54
|
+
sm: "table-sm",
|
55
|
+
# "sm:table-md"
|
56
|
+
# "md:table-md"
|
57
|
+
# "lg:table-md"
|
58
|
+
md: "table-md",
|
59
|
+
# "sm:table-lg"
|
60
|
+
# "md:table-lg"
|
61
|
+
# "lg:table-lg"
|
62
|
+
lg: "table-lg"
|
63
|
+
)
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,77 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PhlexyUI
|
4
|
+
class TableRow < Base
|
5
|
+
def view_template(&)
|
6
|
+
generate_classes!(
|
7
|
+
modifiers_map: modifiers,
|
8
|
+
base_modifiers:,
|
9
|
+
options:
|
10
|
+
).then do |classes|
|
11
|
+
tr(class: classes, **options, &)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def head(*, **, &)
|
16
|
+
th(*, **, &)
|
17
|
+
end
|
18
|
+
|
19
|
+
def column(*, **, &)
|
20
|
+
td(*, **, &)
|
21
|
+
end
|
22
|
+
alias_method :cell, :column
|
23
|
+
|
24
|
+
private
|
25
|
+
|
26
|
+
register_modifiers(
|
27
|
+
# "sm:table-row-hover"
|
28
|
+
# "md:table-row-hover"
|
29
|
+
# "lg:table-row-hover"
|
30
|
+
hover: "hover",
|
31
|
+
# "sm:bg-primary sm:text-primary-content"
|
32
|
+
# "md:bg-primary md:text-primary-content"
|
33
|
+
# "lg:bg-primary lg:text-primary-content"
|
34
|
+
primary: "bg-primary text-primary-content",
|
35
|
+
# "sm:bg-secondary sm:text-secondary-content"
|
36
|
+
# "md:bg-secondary md:text-secondary-content"
|
37
|
+
# "lg:bg-secondary lg:text-secondary-content"
|
38
|
+
secondary: "bg-secondary text-secondary-content",
|
39
|
+
# "sm:bg-accent sm:text-accent-content"
|
40
|
+
# "md:bg-accent md:text-accent-content"
|
41
|
+
# "lg:bg-accent lg:text-accent-content"
|
42
|
+
accent: "bg-accent text-accent-content",
|
43
|
+
# "sm:bg-neutral sm:text-neutral-content"
|
44
|
+
# "md:bg-neutral md:text-neutral-content"
|
45
|
+
# "lg:bg-neutral lg:text-neutral-content"
|
46
|
+
neutral: "bg-neutral text-neutral-content",
|
47
|
+
# "sm:bg-base-100 sm:text-base-content"
|
48
|
+
# "md:bg-base-100 md:text-base-content"
|
49
|
+
# "lg:bg-base-100 lg:text-base-content"
|
50
|
+
base_100: "bg-base-100 text-base-content",
|
51
|
+
# "sm:bg-base-200 sm:text-base-content"
|
52
|
+
# "md:bg-base-200 md:text-base-content"
|
53
|
+
# "lg:bg-base-200 lg:text-base-content"
|
54
|
+
base_200: "bg-base-200 text-base-content",
|
55
|
+
# "sm:bg-base-300 sm:text-base-content"
|
56
|
+
# "md:bg-base-300 md:text-base-content"
|
57
|
+
# "lg:bg-base-300 lg:text-base-content"
|
58
|
+
base_300: "bg-base-300 text-base-content",
|
59
|
+
# "sm:bg-info sm:text-info-content"
|
60
|
+
# "md:bg-info sm:text-info-content"
|
61
|
+
# "lg:bg-info sm:text-info-content"
|
62
|
+
info: "bg-info text-info-content",
|
63
|
+
# "sm:bg-success sm:text-success-content"
|
64
|
+
# "md:bg-success md:text-success-content"
|
65
|
+
# "lg:bg-success lg:text-success-content"
|
66
|
+
success: "bg-success text-success-content",
|
67
|
+
# "sm:bg-warning sm:text-warning-content"
|
68
|
+
# "md:bg-warning md:text-warning-content"
|
69
|
+
# "lg:bg-warning lg:text-warning-content"
|
70
|
+
warning: "bg-warning text-warning-content",
|
71
|
+
# "sm:bg-error sm:text-error-content"
|
72
|
+
# "md:bg-error md:text-error-content"
|
73
|
+
# "lg:bg-error lg:text-error-content"
|
74
|
+
error: "bg-error text-error-content"
|
75
|
+
)
|
76
|
+
end
|
77
|
+
end
|
data/lib/phlexy_ui/tabs.rb
CHANGED
@@ -11,7 +11,7 @@ module PhlexyUI
|
|
11
11
|
def view_template(&)
|
12
12
|
generate_classes!(
|
13
13
|
component_html_class: :tabs,
|
14
|
-
modifiers_map:
|
14
|
+
modifiers_map: modifiers,
|
15
15
|
base_modifiers:,
|
16
16
|
options:
|
17
17
|
).then do |classes|
|
@@ -25,7 +25,7 @@ module PhlexyUI
|
|
25
25
|
|
26
26
|
private
|
27
27
|
|
28
|
-
|
28
|
+
register_modifiers(
|
29
29
|
# "sm:tabs-boxed"
|
30
30
|
# "md:tabs-boxed"
|
31
31
|
# "lg:tabs-boxed"
|
@@ -54,6 +54,6 @@ module PhlexyUI
|
|
54
54
|
# "md:tabs-lg"
|
55
55
|
# "lg:tabs-lg"
|
56
56
|
lg: "tabs-lg"
|
57
|
-
|
57
|
+
)
|
58
58
|
end
|
59
59
|
end
|
data/lib/phlexy_ui/tooltip.rb
CHANGED
@@ -11,7 +11,7 @@ module PhlexyUI
|
|
11
11
|
def view_template(&)
|
12
12
|
generate_classes!(
|
13
13
|
component_html_class: :tooltip,
|
14
|
-
modifiers_map:
|
14
|
+
modifiers_map: modifiers,
|
15
15
|
base_modifiers:,
|
16
16
|
options:
|
17
17
|
).then do |classes|
|
@@ -23,7 +23,7 @@ module PhlexyUI
|
|
23
23
|
|
24
24
|
attr_reader :tip
|
25
25
|
|
26
|
-
|
26
|
+
register_modifiers(
|
27
27
|
# "sm:tooltip-open"
|
28
28
|
# "md:tooltip-open"
|
29
29
|
# "lg:tooltip-open"
|
@@ -72,6 +72,6 @@ module PhlexyUI
|
|
72
72
|
# "md:tooltip-error"
|
73
73
|
# "lg:tooltip-error"
|
74
74
|
error: "tooltip-error"
|
75
|
-
|
75
|
+
)
|
76
76
|
end
|
77
77
|
end
|
data/lib/phlexy_ui/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: phlexy_ui
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Alejandro Aguilar Ramos
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-09-
|
11
|
+
date: 2024-09-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|
@@ -94,6 +94,7 @@ extra_rdoc_files: []
|
|
94
94
|
files:
|
95
95
|
- lib/phlexy_ui.rb
|
96
96
|
- lib/phlexy_ui/attribute_set.rb
|
97
|
+
- lib/phlexy_ui/avatar.rb
|
97
98
|
- lib/phlexy_ui/badge.rb
|
98
99
|
- lib/phlexy_ui/base.rb
|
99
100
|
- lib/phlexy_ui/button.rb
|
@@ -105,6 +106,7 @@ files:
|
|
105
106
|
- lib/phlexy_ui/dropdown.rb
|
106
107
|
- lib/phlexy_ui/link.rb
|
107
108
|
- lib/phlexy_ui/loading.rb
|
109
|
+
- lib/phlexy_ui/mask.rb
|
108
110
|
- lib/phlexy_ui/menu.rb
|
109
111
|
- lib/phlexy_ui/menu_item.rb
|
110
112
|
- lib/phlexy_ui/navbar.rb
|
@@ -112,6 +114,8 @@ files:
|
|
112
114
|
- lib/phlexy_ui/tab.rb
|
113
115
|
- lib/phlexy_ui/tab_with_content.rb
|
114
116
|
- lib/phlexy_ui/tab_without_content.rb
|
117
|
+
- lib/phlexy_ui/table.rb
|
118
|
+
- lib/phlexy_ui/table_row.rb
|
115
119
|
- lib/phlexy_ui/tabs.rb
|
116
120
|
- lib/phlexy_ui/tooltip.rb
|
117
121
|
- lib/phlexy_ui/version.rb
|