phlexy_ui 0.1.1 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PhlexyUI
4
+ # @private
5
+ class TabWithoutContent < Base
6
+ def view_template(&)
7
+ generate_classes!(
8
+ component_html_class: :tab,
9
+ modifiers_map: Tab::TAB_MODIFIERS_CLASSES,
10
+ base_modifiers:,
11
+ options:
12
+ ).then do |classes|
13
+ div role: :tab, class: classes, &
14
+ end
15
+ end
16
+
17
+ private
18
+
19
+ attr_reader :title
20
+
21
+ TAB_MODIFIERS_CLASSES = {
22
+ # "sm:tab-active"
23
+ # "md:tab-active"
24
+ # "lg:tab-active"
25
+ active: "tab-active",
26
+ # "sm:tab-disabled"
27
+ # "md:tab-disabled"
28
+ # "lg:tab-disabled"
29
+ disabled: "tab-disabled"
30
+ }.freeze
31
+ end
32
+ end
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PhlexyUI
4
+ class Tabs < Base
5
+ def initialize(*, id: nil, as: :div, **)
6
+ super(*, **)
7
+ @as = as
8
+ @id = id
9
+ end
10
+
11
+ def view_template(&)
12
+ generate_classes!(
13
+ component_html_class: :tabs,
14
+ modifiers_map: TABS_MODIFIERS_CLASSES,
15
+ base_modifiers:,
16
+ options:
17
+ ).then do |classes|
18
+ public_send(as, role: :tablist, class: classes, **options, &)
19
+ end
20
+ end
21
+
22
+ def tab(*, **, &)
23
+ render Tab.new(*, id:, **, &)
24
+ end
25
+
26
+ private
27
+
28
+ TABS_MODIFIERS_CLASSES = {
29
+ # "sm:tabs-boxed"
30
+ # "md:tabs-boxed"
31
+ # "lg:tabs-boxed"
32
+ boxed: "tabs-boxed",
33
+ # "sm:tabs-bordered"
34
+ # "md:tabs-bordered"
35
+ # "lg:tabs-bordered"
36
+ bordered: "tabs-bordered",
37
+ # "sm:tabs-lifted"
38
+ # "md:tabs-lifted"
39
+ # "lg:tabs-lifted"
40
+ lifted: "tabs-lifted",
41
+ # "sm:tabs-xs"
42
+ # "md:tabs-xs"
43
+ # "lg:tabs-xs"
44
+ xs: "tabs-xs",
45
+ # "sm:tabs-sm"
46
+ # "md:tabs-sm"
47
+ # "lg:tabs-sm"
48
+ sm: "tabs-sm",
49
+ # "sm:tabs-md"
50
+ # "md:tabs-md"
51
+ # "lg:tabs-md"
52
+ md: "tabs-md",
53
+ # "sm:tabs-lg"
54
+ # "md:tabs-lg"
55
+ # "lg:tabs-lg"
56
+ lg: "tabs-lg"
57
+ }.freeze
58
+ end
59
+ end
@@ -0,0 +1,77 @@
1
+ # frozen_string_literal: true
2
+
3
+ module PhlexyUI
4
+ class Tooltip < Base
5
+ def initialize(*, tip:, as: :div, **)
6
+ super(*, **)
7
+ @tip = tip
8
+ @as = as
9
+ end
10
+
11
+ def view_template(&)
12
+ generate_classes!(
13
+ component_html_class: :tooltip,
14
+ modifiers_map: TOOLTIP_MODIFIERS_MAP,
15
+ base_modifiers:,
16
+ options:
17
+ ).then do |classes|
18
+ public_send(as, class: classes, data_tip: tip, **options, &)
19
+ end
20
+ end
21
+
22
+ private
23
+
24
+ attr_reader :tip
25
+
26
+ TOOLTIP_MODIFIERS_MAP = {
27
+ # "sm:tooltip-open"
28
+ # "md:tooltip-open"
29
+ # "lg:tooltip-open"
30
+ open: "tooltip-open",
31
+ # "sm:tooltip-top"
32
+ # "md:tooltip-top"
33
+ # "lg:tooltip-top"
34
+ top: "tooltip-top",
35
+ # "sm:tooltip-bottom"
36
+ # "md:tooltip-bottom"
37
+ # "lg:tooltip-bottom"
38
+ bottom: "tooltip-bottom",
39
+ # "sm:tooltip-left"
40
+ # "md:tooltip-left"
41
+ # "lg:tooltip-left"
42
+ left: "tooltip-left",
43
+ # "sm:tooltip-right"
44
+ # "md:tooltip-right"
45
+ # "lg:tooltip-right"
46
+ right: "tooltip-right",
47
+ # "sm:tooltip-primary"
48
+ # "md:tooltip-primary"
49
+ # "lg:tooltip-primary"
50
+ primary: "tooltip-primary",
51
+ # "sm:tooltip-secondary"
52
+ # "md:tooltip-secondary"
53
+ # "lg:tooltip-secondary"
54
+ secondary: "tooltip-secondary",
55
+ # "sm:tooltip-accent"
56
+ # "md:tooltip-accent"
57
+ # "lg:tooltip-accent"
58
+ accent: "tooltip-accent",
59
+ # "sm:tooltip-info"
60
+ # "md:tooltip-info"
61
+ # "lg:tooltip-info"
62
+ info: "tooltip-info",
63
+ # "sm:tooltip-success"
64
+ # "md:tooltip-success"
65
+ # "lg:tooltip-success"
66
+ success: "tooltip-success",
67
+ # "sm:tooltip-warning"
68
+ # "md:tooltip-warning"
69
+ # "lg:tooltip-warning"
70
+ warning: "tooltip-warning",
71
+ # "sm:tooltip-error"
72
+ # "md:tooltip-error"
73
+ # "lg:tooltip-error"
74
+ error: "tooltip-error"
75
+ }.freeze
76
+ end
77
+ end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PhlexyUI
4
- VERSION = "0.1.0"
4
+ VERSION = "0.1.5"
5
5
  end
data/lib/phlexy_ui.rb CHANGED
@@ -7,12 +7,9 @@ loader.inflector.inflect(
7
7
  "phlexy_ui" => "PhlexyUI"
8
8
  )
9
9
  loader.setup # ready!
10
+ loader.load_file("#{__dir__}/phlexy_ui/base.rb")
10
11
 
11
12
  module PhlexyUI
12
13
  extend Configurable
13
14
  extend Phlex::Kit
14
-
15
- autoload :Button, "phlexy_ui/button"
16
15
  end
17
-
18
- loader.eager_load
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.1
4
+ version: 0.1.5
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-08-02 00:00:00.000000000 Z
11
+ date: 2024-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: phlex
@@ -42,30 +42,50 @@ dependencies:
42
42
  name: standard
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0'
47
+ version: 1.39.2
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0'
54
+ version: 1.39.2
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rspec
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: 3.13.0
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: 3.13.0
69
+ - !ruby/object:Gem::Dependency
70
+ name: debug
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.9'
59
76
  - - ">="
60
77
  - !ruby/object:Gem::Version
61
- version: '0'
78
+ version: 1.9.2
62
79
  type: :development
63
80
  prerelease: false
64
81
  version_requirements: !ruby/object:Gem::Requirement
65
82
  requirements:
83
+ - - "~>"
84
+ - !ruby/object:Gem::Version
85
+ version: '1.9'
66
86
  - - ">="
67
87
  - !ruby/object:Gem::Version
68
- version: '0'
88
+ version: 1.9.2
69
89
  description: PhlexyUI is a Ruby UI component library for DaisyUI using Phlex
70
90
  email: boil-dosage.0p@icloud.com
71
91
  executables: []
@@ -73,10 +93,27 @@ extensions: []
73
93
  extra_rdoc_files: []
74
94
  files:
75
95
  - lib/phlexy_ui.rb
96
+ - lib/phlexy_ui/attribute_set.rb
97
+ - lib/phlexy_ui/badge.rb
76
98
  - lib/phlexy_ui/base.rb
77
99
  - lib/phlexy_ui/button.rb
78
100
  - lib/phlexy_ui/card.rb
101
+ - lib/phlexy_ui/class_list.rb
102
+ - lib/phlexy_ui/collapsible_sub_menu.rb
79
103
  - lib/phlexy_ui/configurable.rb
104
+ - lib/phlexy_ui/drawer.rb
105
+ - lib/phlexy_ui/dropdown.rb
106
+ - lib/phlexy_ui/link.rb
107
+ - lib/phlexy_ui/loading.rb
108
+ - lib/phlexy_ui/menu.rb
109
+ - lib/phlexy_ui/menu_item.rb
110
+ - lib/phlexy_ui/navbar.rb
111
+ - lib/phlexy_ui/sub_menu.rb
112
+ - lib/phlexy_ui/tab.rb
113
+ - lib/phlexy_ui/tab_with_content.rb
114
+ - lib/phlexy_ui/tab_without_content.rb
115
+ - lib/phlexy_ui/tabs.rb
116
+ - lib/phlexy_ui/tooltip.rb
80
117
  - lib/phlexy_ui/version.rb
81
118
  homepage: https://rubygems.org/gems/phlexy_ui
82
119
  licenses: