ariadne_view_components 0.0.86.3 → 0.0.86.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/app/components/ariadne/ui/list/component.html.erb +1 -6
- data/app/components/ariadne/ui/list/component.rb +8 -31
- data/app/components/ariadne/ui/list/item/component.html.erb +5 -0
- data/app/components/ariadne/ui/list/item/component.rb +45 -0
- data/lib/ariadne/view_components/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e5aa146d6a699cddca231f305726db1c7691a5211b6eb7dfb77497e0bc58ab1
|
4
|
+
data.tar.gz: f49888f145149a2a005ffb36bbb66277e08b9f38568d39a56d87b36d9b963bad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9f99e57e47432b1a95042feabb9b11c4582e52264c1f7935ee9444aba446edf5255b1f2978ccaa7da1a46217e693b07b8ff198e1b1d408f4c8444f71cbfea2b
|
7
|
+
data.tar.gz: 3986e07878164ae3307316940f2e920be8115c825b44446273b3265588fa1276cbb75df0673f078e074f86b8191418aff4a6af661b62c225308ea5b4ef331d9a
|
data/CHANGELOG.md
CHANGED
@@ -23,12 +23,7 @@
|
|
23
23
|
</div>
|
24
24
|
<% end %>
|
25
25
|
<% items.each do |item| %>
|
26
|
-
|
27
|
-
<%= 'role="menuitem"' if as_menu %>
|
28
|
-
class="<%= style(:item) %>"
|
29
|
-
data-<%= stimulus_name %>-target="searchString">
|
30
|
-
<div class="ariadne-relative ariadne-flex ariadne-w-full"><%= item %></div>
|
31
|
-
</div>
|
26
|
+
<%= item %>
|
32
27
|
<% end %>
|
33
28
|
<div class="ariadne-text-center ariadne-hidden" data-<%= stimulus_name %>-target="emptyRoot">
|
34
29
|
<span class="ariadne-py-3 ariadne-text-md ariadne-text-zinc-600 dark:ariadne-text-zinc-400"><%= @empty_placeholder %> </span>
|
@@ -5,8 +5,6 @@ module Ariadne
|
|
5
5
|
module UI
|
6
6
|
module List
|
7
7
|
class Component < Ariadne::BaseComponent
|
8
|
-
option :as_menu, default: proc { false }
|
9
|
-
|
10
8
|
option :size, default: proc { :md }
|
11
9
|
|
12
10
|
renders_one :filter_field, lambda { |**options|
|
@@ -59,7 +57,7 @@ module Ariadne
|
|
59
57
|
Ariadne::UI::Link::Component.new(**options)
|
60
58
|
}
|
61
59
|
|
62
|
-
renders_many :items,
|
60
|
+
renders_many :items, Ariadne::UI::List::Item::Component
|
63
61
|
|
64
62
|
accepts_html_attributes do |html_attrs|
|
65
63
|
html_attrs[:class] = Ariadne::ViewComponents.tailwind_merger.merge([style, html_attrs[:class]].join(" "))
|
@@ -68,6 +66,13 @@ module Ariadne
|
|
68
66
|
}
|
69
67
|
end
|
70
68
|
|
69
|
+
SHARED_BACKGROUND_COLORS = [
|
70
|
+
"hover:ariadne-bg-blue-100",
|
71
|
+
"hover:dark:ariadne-bg-blue-800",
|
72
|
+
"focus-within:ariadne-bg-blue-100",
|
73
|
+
"focus-within:dark:ariadne-bg-blue-800",
|
74
|
+
]
|
75
|
+
|
71
76
|
style do
|
72
77
|
base do
|
73
78
|
[
|
@@ -95,34 +100,6 @@ module Ariadne
|
|
95
100
|
]
|
96
101
|
end
|
97
102
|
end
|
98
|
-
|
99
|
-
SHARED_BACKGROUND_COLORS = [
|
100
|
-
"hover:ariadne-bg-blue-100",
|
101
|
-
"hover:dark:ariadne-bg-blue-800",
|
102
|
-
"focus-within:ariadne-bg-blue-100",
|
103
|
-
"focus-within:dark:ariadne-bg-blue-800",
|
104
|
-
]
|
105
|
-
style :item do
|
106
|
-
base do
|
107
|
-
[
|
108
|
-
# "ariadne-gap-0.5",
|
109
|
-
"ariadne-items-center",
|
110
|
-
"ariadne-rounded",
|
111
|
-
"!ariadne-ring-0",
|
112
|
-
"ariadne-cursor-default",
|
113
|
-
"ariadne-select-none",
|
114
|
-
"ariadne-items-center",
|
115
|
-
"ariadne-rounded-sm",
|
116
|
-
"ariadne-px-2",
|
117
|
-
# "ariadne-py-1.5",
|
118
|
-
"ariadne-text-sm",
|
119
|
-
"ariadne-outline-none",
|
120
|
-
"ariadne-transition-colors",
|
121
|
-
"disabled:ariadne-pointer-events-none",
|
122
|
-
"disabled:ariadne-opacity-50",
|
123
|
-
].concat(SHARED_BACKGROUND_COLORS)
|
124
|
-
end
|
125
|
-
end
|
126
103
|
end
|
127
104
|
end
|
128
105
|
end
|
@@ -0,0 +1,45 @@
|
|
1
|
+
# typed: false
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Ariadne
|
5
|
+
module UI
|
6
|
+
module List
|
7
|
+
module Item
|
8
|
+
class Component < Ariadne::BaseComponent
|
9
|
+
option :as_menu, default: proc { false }
|
10
|
+
|
11
|
+
accepts_html_attributes do |html_attrs|
|
12
|
+
html_attrs[:class] = Ariadne::ViewComponents.tailwind_merger.merge([style(:item), html_attrs[:class]].join(" "))
|
13
|
+
|
14
|
+
html_attrs[:data] ||= {}
|
15
|
+
html_attrs[:data] = {
|
16
|
+
"#{stimulus_name}-target": "searchString",
|
17
|
+
}.merge(html_attrs[:data])
|
18
|
+
end
|
19
|
+
|
20
|
+
style :item do
|
21
|
+
base do
|
22
|
+
[
|
23
|
+
# "ariadne-gap-0.5",
|
24
|
+
"ariadne-items-center",
|
25
|
+
"ariadne-rounded",
|
26
|
+
"!ariadne-ring-0",
|
27
|
+
"ariadne-cursor-default",
|
28
|
+
"ariadne-select-none",
|
29
|
+
"ariadne-items-center",
|
30
|
+
"ariadne-rounded-sm",
|
31
|
+
"ariadne-px-2",
|
32
|
+
# "ariadne-py-1.5",
|
33
|
+
"ariadne-text-sm",
|
34
|
+
"ariadne-outline-none",
|
35
|
+
"ariadne-transition-colors",
|
36
|
+
"disabled:ariadne-pointer-events-none",
|
37
|
+
"disabled:ariadne-opacity-50",
|
38
|
+
].concat(Ariadne::UI::List::Component::SHARED_BACKGROUND_COLORS)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ariadne_view_components
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.86.
|
4
|
+
version: 0.0.86.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Garen J. Torikian
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-08-
|
11
|
+
date: 2024-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: tailwind_merge
|
@@ -236,6 +236,8 @@ files:
|
|
236
236
|
- app/components/ariadne/ui/list/component.html.erb
|
237
237
|
- app/components/ariadne/ui/list/component.rb
|
238
238
|
- app/components/ariadne/ui/list/component.ts
|
239
|
+
- app/components/ariadne/ui/list/item/component.html.erb
|
240
|
+
- app/components/ariadne/ui/list/item/component.rb
|
239
241
|
- app/components/ariadne/ui/overlay/component.html.erb
|
240
242
|
- app/components/ariadne/ui/overlay/component.rb
|
241
243
|
- app/components/ariadne/ui/overlay/component.ts
|