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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: afd51b066ca04f9497e96ce00132d883007730221925fab4bfb3d6d5cb57aec2
4
- data.tar.gz: fd72b9a2411ec3eef6f9f9b5ca7ad88a3cba8c639d6e79e9a4d3b1500b545788
3
+ metadata.gz: e9af209a8c35542f7bce170fc57d12aad6094383f5b2d02e99356e65a2303094
4
+ data.tar.gz: 66de1dc598260d76985c4167f4b6be257079b58412c0c292f0297cf9f7e6220f
5
5
  SHA512:
6
- metadata.gz: 93938b5e9e0365f144100e4d00ff757a33f50f7b7a264326ac0709506d5a4006fed131dda192d0546a3969ba777d27cfe59bf63a3f657f2cd456b2ae32ac7cf2
7
- data.tar.gz: 3c9652fa3434d8deb8ddf5eb51c86a631d93057883630ea54b5b790a0ce8b8da3f414806b84c49fc31fe292dd2864b4c5a5d24c0a7e937712376768cec7c48a3
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PhlexyUI
4
- VERSION = "0.1.6"
4
+ VERSION = "0.1.7"
5
5
  end
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.6
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-24 00:00:00.000000000 Z
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