phlexy_ui 0.1.5 → 0.1.7
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/avatar_group.rb +23 -0
- data/lib/phlexy_ui/badge.rb +3 -3
- data/lib/phlexy_ui/button.rb +3 -3
- data/lib/phlexy_ui/checkbox.rb +72 -0
- 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/form_control.rb +19 -0
- data/lib/phlexy_ui/label.rb +23 -0
- 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 +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e9af209a8c35542f7bce170fc57d12aad6094383f5b2d02e99356e65a2303094
|
4
|
+
data.tar.gz: 66de1dc598260d76985c4167f4b6be257079b58412c0c292f0297cf9f7e6220f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 43b1563b99263306f57a817a06717351eb50531a5bda3de368021937ad2f80afa0d7393b26639ad5f9c64e84b642404341ac4f89de502c333ad23a12cb450715
|
7
|
+
data.tar.gz: 87cc196de8b27500fd6b087a0a8b75bfc7b0f27b5f9dc7a4041a817c2db0aff23abd2df33f1d231fc09cb8af226b5df87d6a5a055d2ad8fb1a2653d8ca656e1d
|
@@ -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
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PhlexyUI
|
4
|
+
class AvatarGroup < 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-group",
|
13
|
+
options:
|
14
|
+
).then do |classes|
|
15
|
+
public_send(as, class: classes, **options, &)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def avatar(*, **, &)
|
20
|
+
render PhlexyUI::Avatar.new(*, **, &)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
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
|
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PhlexyUI
|
4
|
+
class Checkbox < Base
|
5
|
+
def view_template(&)
|
6
|
+
attributes = generate_attributes(base_modifiers, ATTRIBUTES_MAP)
|
7
|
+
|
8
|
+
generate_classes!(
|
9
|
+
component_html_class: :checkbox,
|
10
|
+
modifiers_map: modifiers,
|
11
|
+
base_modifiers:,
|
12
|
+
options:
|
13
|
+
).then do |classes|
|
14
|
+
input(type: :checkbox, class: classes, **options, **attributes, &)
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
ATTRIBUTES_MAP = {
|
21
|
+
checked: true,
|
22
|
+
disabled: true
|
23
|
+
}.freeze
|
24
|
+
|
25
|
+
register_modifiers(
|
26
|
+
# "sm:checkbox-primary"
|
27
|
+
# "md:checkbox-primary"
|
28
|
+
# "lg:checkbox-primary"
|
29
|
+
primary: "checkbox-primary",
|
30
|
+
# "sm:checkbox-secondary"
|
31
|
+
# "md:checkbox-secondary"
|
32
|
+
# "lg:checkbox-secondary"
|
33
|
+
secondary: "checkbox-secondary",
|
34
|
+
# "sm:checkbox-accent"
|
35
|
+
# "md:checkbox-accent"
|
36
|
+
# "lg:checkbox-accent"
|
37
|
+
accent: "checkbox-accent",
|
38
|
+
# "sm:checkbox-success"
|
39
|
+
# "md:checkbox-success"
|
40
|
+
# "lg:checkbox-success"
|
41
|
+
success: "checkbox-success",
|
42
|
+
# "sm:checkbox-warning"
|
43
|
+
# "md:checkbox-warning"
|
44
|
+
# "lg:checkbox-warning"
|
45
|
+
warning: "checkbox-warning",
|
46
|
+
# "sm:checkbox-info"
|
47
|
+
# "md:checkbox-info"
|
48
|
+
# "lg:checkbox-info"
|
49
|
+
info: "checkbox-info",
|
50
|
+
# "sm:checkbox-error"
|
51
|
+
# "md:checkbox-error"
|
52
|
+
# "lg:checkbox-error"
|
53
|
+
error: "checkbox-error",
|
54
|
+
# "sm:checkbox-lg"
|
55
|
+
# "md:checkbox-lg"
|
56
|
+
# "lg:checkbox-lg"
|
57
|
+
lg: "checkbox-lg",
|
58
|
+
# "sm:checkbox-md"
|
59
|
+
# "md:checkbox-md"
|
60
|
+
# "lg:checkbox-md"
|
61
|
+
md: "checkbox-md",
|
62
|
+
# "sm:checkbox-sm"
|
63
|
+
# "md:checkbox-sm"
|
64
|
+
# "lg:checkbox-sm"
|
65
|
+
sm: "checkbox-sm",
|
66
|
+
# "sm:checkbox-xs"
|
67
|
+
# "md:checkbox-xs"
|
68
|
+
# "lg:checkbox-xs"
|
69
|
+
xs: "checkbox-xs"
|
70
|
+
)
|
71
|
+
end
|
72
|
+
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
|
@@ -0,0 +1,19 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PhlexyUI
|
4
|
+
class FormControl < 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: "form-control",
|
13
|
+
options:
|
14
|
+
).then do |classes|
|
15
|
+
public_send(as, class: classes, **options, &)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module PhlexyUI
|
4
|
+
class Label < Base
|
5
|
+
def view_template(&)
|
6
|
+
generate_classes!(
|
7
|
+
component_html_class: :label,
|
8
|
+
options:
|
9
|
+
).then do |classes|
|
10
|
+
label(class: classes, **options, &)
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
def text(as: :span, **options, &)
|
15
|
+
generate_classes!(
|
16
|
+
component_html_class: :"label-text",
|
17
|
+
options:
|
18
|
+
).then do |classes|
|
19
|
+
public_send(as, class: classes, **options, &)
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
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.7
|
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-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|
@@ -94,17 +94,23 @@ 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
|
98
|
+
- lib/phlexy_ui/avatar_group.rb
|
97
99
|
- lib/phlexy_ui/badge.rb
|
98
100
|
- lib/phlexy_ui/base.rb
|
99
101
|
- lib/phlexy_ui/button.rb
|
100
102
|
- lib/phlexy_ui/card.rb
|
103
|
+
- lib/phlexy_ui/checkbox.rb
|
101
104
|
- lib/phlexy_ui/class_list.rb
|
102
105
|
- lib/phlexy_ui/collapsible_sub_menu.rb
|
103
106
|
- lib/phlexy_ui/configurable.rb
|
104
107
|
- lib/phlexy_ui/drawer.rb
|
105
108
|
- lib/phlexy_ui/dropdown.rb
|
109
|
+
- lib/phlexy_ui/form_control.rb
|
110
|
+
- lib/phlexy_ui/label.rb
|
106
111
|
- lib/phlexy_ui/link.rb
|
107
112
|
- lib/phlexy_ui/loading.rb
|
113
|
+
- lib/phlexy_ui/mask.rb
|
108
114
|
- lib/phlexy_ui/menu.rb
|
109
115
|
- lib/phlexy_ui/menu_item.rb
|
110
116
|
- lib/phlexy_ui/navbar.rb
|
@@ -112,6 +118,8 @@ files:
|
|
112
118
|
- lib/phlexy_ui/tab.rb
|
113
119
|
- lib/phlexy_ui/tab_with_content.rb
|
114
120
|
- lib/phlexy_ui/tab_without_content.rb
|
121
|
+
- lib/phlexy_ui/table.rb
|
122
|
+
- lib/phlexy_ui/table_row.rb
|
115
123
|
- lib/phlexy_ui/tabs.rb
|
116
124
|
- lib/phlexy_ui/tooltip.rb
|
117
125
|
- lib/phlexy_ui/version.rb
|