phlexy_ui 0.1.6 → 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_group.rb +23 -0
- data/lib/phlexy_ui/checkbox.rb +72 -0
- data/lib/phlexy_ui/form_control.rb +19 -0
- data/lib/phlexy_ui/label.rb +23 -0
- 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: 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,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
|
@@ -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
|
@@ -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/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
|
@@ -95,15 +95,19 @@ files:
|
|
95
95
|
- lib/phlexy_ui.rb
|
96
96
|
- lib/phlexy_ui/attribute_set.rb
|
97
97
|
- lib/phlexy_ui/avatar.rb
|
98
|
+
- lib/phlexy_ui/avatar_group.rb
|
98
99
|
- lib/phlexy_ui/badge.rb
|
99
100
|
- lib/phlexy_ui/base.rb
|
100
101
|
- lib/phlexy_ui/button.rb
|
101
102
|
- lib/phlexy_ui/card.rb
|
103
|
+
- lib/phlexy_ui/checkbox.rb
|
102
104
|
- lib/phlexy_ui/class_list.rb
|
103
105
|
- lib/phlexy_ui/collapsible_sub_menu.rb
|
104
106
|
- lib/phlexy_ui/configurable.rb
|
105
107
|
- lib/phlexy_ui/drawer.rb
|
106
108
|
- lib/phlexy_ui/dropdown.rb
|
109
|
+
- lib/phlexy_ui/form_control.rb
|
110
|
+
- lib/phlexy_ui/label.rb
|
107
111
|
- lib/phlexy_ui/link.rb
|
108
112
|
- lib/phlexy_ui/loading.rb
|
109
113
|
- lib/phlexy_ui/mask.rb
|