phlexy_ui 0.1.14 → 0.1.18
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/class_list.rb +46 -58
- data/lib/phlexy_ui/radial_progress.rb +84 -44
- data/lib/phlexy_ui/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: e28571932626bbfb52238b529c6dfe67ba038b32c2c735377667fa0005974295
|
4
|
+
data.tar.gz: 820d96f4249069a762071132fcbe977bd78b00b54aa9e86b4f44622459c73628
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 70be19b85cf1ce3d9eb6f0837f207399830901e3dd3d8556e7881eb612c4cf6c99b022609743d51d6fa58ab08a18e919806d211490a05aa5f5a52591f474db41
|
7
|
+
data.tar.gz: d1e10d0c19ca19d07159e60a98cd3a34669cf368166231ba9ed87b3dd3b8109bba0c2f8637df5a7fdd5f02353a606738f6d873c9957327a21f346d5b28398c05
|
data/lib/phlexy_ui/class_list.rb
CHANGED
@@ -13,76 +13,70 @@ module PhlexyUI
|
|
13
13
|
@base_modifiers = base_modifiers
|
14
14
|
@options = options
|
15
15
|
@modifiers_map = modifiers_map
|
16
|
+
@responsive_options = options.delete(:responsive)
|
16
17
|
end
|
17
18
|
|
18
19
|
def to_a
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
classes
|
20
|
+
[
|
21
|
+
component_classes,
|
22
|
+
modifier_classes,
|
23
|
+
responsive_classes,
|
24
|
+
options.delete(:class)
|
25
|
+
].flatten.compact
|
26
26
|
end
|
27
27
|
|
28
28
|
private
|
29
29
|
|
30
|
-
attr_reader :component_html_class,
|
30
|
+
attr_reader :component_html_class,
|
31
|
+
:base_modifiers,
|
32
|
+
:options,
|
33
|
+
:modifiers_map,
|
34
|
+
:responsive_options
|
31
35
|
|
32
|
-
def
|
33
|
-
base_modifiers.select { |modifier| modifiers_map.key?(modifier) }
|
34
|
-
end
|
35
|
-
|
36
|
-
def add_component_class(classes)
|
36
|
+
def component_classes
|
37
37
|
return unless component_html_class
|
38
|
+
return if responsive_options&.values&.any? do |v|
|
39
|
+
v == true || (v.is_a?(Array) && v.include?(true))
|
40
|
+
end
|
38
41
|
|
39
|
-
|
42
|
+
with_config_prefix(component_html_class)
|
40
43
|
end
|
41
44
|
|
42
|
-
def
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
)
|
47
|
-
)
|
45
|
+
def modifier_classes
|
46
|
+
(selected_base_modifiers + conditioned_modifiers).map do |modifier|
|
47
|
+
with_config_prefix(modifiers_map[modifier])
|
48
|
+
end
|
48
49
|
end
|
49
50
|
|
50
|
-
def
|
51
|
-
|
52
|
-
next unless options.delete(modifier)
|
53
|
-
|
54
|
-
classes << with_config_prefix(class_name)
|
55
|
-
end
|
51
|
+
def selected_base_modifiers
|
52
|
+
base_modifiers.select { |modifier| modifiers_map.key?(modifier) }
|
56
53
|
end
|
57
54
|
|
58
|
-
def
|
59
|
-
|
60
|
-
with_responsive_prefix(
|
61
|
-
with_config_prefix(
|
62
|
-
modifiers_map.fetch(modifier)
|
63
|
-
),
|
64
|
-
responsive_prefix
|
65
|
-
)
|
66
|
-
end
|
55
|
+
def conditioned_modifiers
|
56
|
+
modifiers_map.keys.select { |modifier| options.delete(modifier) }
|
67
57
|
end
|
68
58
|
|
69
|
-
def
|
70
|
-
return unless
|
71
|
-
|
72
|
-
RESPONSIVE_PREFIXES.
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
59
|
+
def responsive_classes
|
60
|
+
return unless responsive_options
|
61
|
+
|
62
|
+
RESPONSIVE_PREFIXES.flat_map do |prefix|
|
63
|
+
next unless responsive_options[prefix]
|
64
|
+
|
65
|
+
values = Array(responsive_options[prefix])
|
66
|
+
|
67
|
+
component_responsive_class =
|
68
|
+
if values.delete(true)
|
69
|
+
[with_responsive_prefix(with_config_prefix(component_html_class), prefix)]
|
70
|
+
else
|
71
|
+
[]
|
72
|
+
end
|
73
|
+
|
74
|
+
modifier_responsive_classes = values.map do |v|
|
75
|
+
with_responsive_prefix(with_config_prefix(modifiers_map[v]), prefix)
|
80
76
|
end
|
81
|
-
end
|
82
|
-
end
|
83
77
|
|
84
|
-
|
85
|
-
|
78
|
+
component_responsive_class + modifier_responsive_classes
|
79
|
+
end
|
86
80
|
end
|
87
81
|
|
88
82
|
def with_config_prefix(string)
|
@@ -91,14 +85,8 @@ module PhlexyUI
|
|
91
85
|
end.join(" ")
|
92
86
|
end
|
93
87
|
|
94
|
-
def with_responsive_prefix(string,
|
95
|
-
string.split.map
|
96
|
-
if responsive_prefix
|
97
|
-
"#{responsive_prefix}:#{word}"
|
98
|
-
else
|
99
|
-
word
|
100
|
-
end
|
101
|
-
end.join(" ")
|
88
|
+
def with_responsive_prefix(string, prefix)
|
89
|
+
string.to_s.split.map { |word| "#{prefix}:#{word}" }.join(" ")
|
102
90
|
end
|
103
91
|
end
|
104
92
|
end
|
@@ -50,50 +50,90 @@ module PhlexyUI
|
|
50
50
|
attr_reader :value, :size, :thickness
|
51
51
|
|
52
52
|
register_modifiers(
|
53
|
-
# "sm:bg-primary sm:text-primary-content"
|
54
|
-
# "md:bg-primary md:text-primary-content"
|
55
|
-
# "lg:bg-primary lg:text-primary-content"
|
56
|
-
primary: "bg-primary text-primary-content",
|
57
|
-
# "sm:
|
58
|
-
# "md:
|
59
|
-
# "lg:
|
60
|
-
|
61
|
-
# "sm:bg-
|
62
|
-
# "md:bg-
|
63
|
-
# "lg:bg-
|
64
|
-
|
65
|
-
# "sm:
|
66
|
-
# "md:
|
67
|
-
# "lg:
|
68
|
-
|
69
|
-
# "sm:bg-
|
70
|
-
# "md:bg-
|
71
|
-
# "lg:bg-
|
72
|
-
|
73
|
-
# "sm:
|
74
|
-
# "md:
|
75
|
-
# "lg:
|
76
|
-
|
77
|
-
# "sm:bg-
|
78
|
-
# "md:bg-
|
79
|
-
# "lg:bg-
|
80
|
-
|
81
|
-
# "sm:
|
82
|
-
# "md:
|
83
|
-
# "lg:
|
84
|
-
|
85
|
-
# "sm:bg-
|
86
|
-
# "md:bg-
|
87
|
-
# "lg:bg-
|
88
|
-
|
89
|
-
# "sm:
|
90
|
-
# "md:
|
91
|
-
# "lg:
|
92
|
-
|
93
|
-
# "sm:bg-
|
94
|
-
# "md:bg-
|
95
|
-
# "lg:bg-
|
96
|
-
|
53
|
+
# "sm:bg-primary sm:text-primary-content border-primary"
|
54
|
+
# "md:bg-primary md:text-primary-content border-primary"
|
55
|
+
# "lg:bg-primary lg:text-primary-content border-primary"
|
56
|
+
primary: "bg-primary text-primary-content border-primary",
|
57
|
+
# "sm:text-primary"
|
58
|
+
# "md:text-primary"
|
59
|
+
# "lg:text-primary"
|
60
|
+
primary_outline: "text-primary",
|
61
|
+
# "sm:bg-secondary sm:text-secondary-content border-secondary"
|
62
|
+
# "md:bg-secondary md:text-secondary-content border-secondary"
|
63
|
+
# "lg:bg-secondary lg:text-secondary-content border-secondary"
|
64
|
+
secondary: "bg-secondary text-secondary-content border-secondary",
|
65
|
+
# "sm:text-secondary"
|
66
|
+
# "md:text-secondary"
|
67
|
+
# "lg:text-secondary"
|
68
|
+
secondary_outline: "text-secondary",
|
69
|
+
# "sm:bg-accent sm:text-accent-content border-accent"
|
70
|
+
# "md:bg-accent md:text-accent-content border-accent"
|
71
|
+
# "lg:bg-accent lg:text-accent-content border-accent"
|
72
|
+
accent: "bg-accent text-accent-content border-accent",
|
73
|
+
# "sm:text-accent"
|
74
|
+
# "md:text-accent"
|
75
|
+
# "lg:text-accent"
|
76
|
+
accent_outline: "text-accent",
|
77
|
+
# "sm:bg-neutral sm:text-neutral-content border-neutral"
|
78
|
+
# "md:bg-neutral md:text-neutral-content border-neutral"
|
79
|
+
# "lg:bg-neutral lg:text-neutral-content border-neutral"
|
80
|
+
neutral: "bg-neutral text-neutral-content border-neutral",
|
81
|
+
# "sm:text-neutral"
|
82
|
+
# "md:text-neutral"
|
83
|
+
# "lg:text-neutral"
|
84
|
+
neutral_outline: "text-neutral",
|
85
|
+
# "sm:bg-base-100 sm:text-base-content border-base-100"
|
86
|
+
# "md:bg-base-100 md:text-base-content border-base-100"
|
87
|
+
# "lg:bg-base-100 lg:text-base-content border-base-100"
|
88
|
+
base_100: "bg-base-100 text-base-content border-base-100",
|
89
|
+
# "sm:text-base-100"
|
90
|
+
# "md:text-base-100"
|
91
|
+
# "lg:text-base-100"
|
92
|
+
base_100_outline: "text-base-100",
|
93
|
+
# "sm:bg-base-200 sm:text-base-content border-base-200"
|
94
|
+
# "md:bg-base-200 md:text-base-content border-base-200"
|
95
|
+
# "lg:bg-base-200 lg:text-base-content border-base-200"
|
96
|
+
base_200: "bg-base-200 text-base-content border-base-200",
|
97
|
+
# "sm:text-base-200"
|
98
|
+
# "md:text-base-200"
|
99
|
+
# "lg:text-base-200"
|
100
|
+
base_200_outline: "text-base-200",
|
101
|
+
# "sm:bg-base-300 sm:text-base-content border-base-300"
|
102
|
+
# "md:bg-base-300 md:text-base-content border-base-300"
|
103
|
+
# "lg:bg-base-300 lg:text-base-content border-base-300"
|
104
|
+
base_300: "bg-base-300 text-base-content border-base-300",
|
105
|
+
# "sm:text-base-300"
|
106
|
+
# "md:text-base-300"
|
107
|
+
# "lg:text-base-300"
|
108
|
+
base_300_outline: "text-base-300",
|
109
|
+
# "sm:bg-info sm:text-info-content border-info"
|
110
|
+
# "md:bg-info md:text-info-content border-info"
|
111
|
+
# "lg:bg-info lg:text-info-content border-info"
|
112
|
+
info: "bg-info text-info-content border-info",
|
113
|
+
# "sm:text-info"
|
114
|
+
# "md:text-info"
|
115
|
+
# "lg:text-info"
|
116
|
+
info_outline: "text-info",
|
117
|
+
# "sm:bg-success sm:text-success-content border-success"
|
118
|
+
# "md:bg-success md:text-success-content border-success"
|
119
|
+
# "lg:bg-success lg:text-success-content border-success"
|
120
|
+
success: "bg-success text-success-content border-success",
|
121
|
+
# "sm:text-success"
|
122
|
+
# "md:text-success"
|
123
|
+
# "lg:text-success"
|
124
|
+
success_outline: "text-success",
|
125
|
+
# "sm:bg-warning sm:text-warning-content border-warning"
|
126
|
+
# "md:bg-warning md:text-warning-content border-warning"
|
127
|
+
# "lg:bg-warning lg:text-warning-content border-warning"
|
128
|
+
warning: "bg-warning text-warning-content border-warning",
|
129
|
+
# "sm:text-warning"
|
130
|
+
# "md:text-warning"
|
131
|
+
# "lg:text-warning"
|
132
|
+
warning_outline: "text-warning",
|
133
|
+
# "sm:bg-error sm:text-error-content border-error"
|
134
|
+
# "md:bg-error md:text-error-content border-error"
|
135
|
+
# "lg:bg-error lg:text-error-content border-error"
|
136
|
+
error: "bg-error text-error-content border-error"
|
97
137
|
)
|
98
138
|
end
|
99
139
|
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.18
|
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-10-
|
11
|
+
date: 2024-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: phlex
|