ui_components 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +18 -11
- data/app/assets/javascripts/ui_components/controllers/countdown_controller.js +55 -0
- data/app/components/documentation/body/example_preview_component.rb +1 -1
- data/app/components/documentation/body_component.html.erb +1 -1
- data/app/components/documentation/body_component.rb +4 -4
- data/app/components/ui_components/daisy_ui/action/button_component.rb +13 -13
- data/app/components/ui_components/daisy_ui/action/dropdown/anchor_component.rb +1 -11
- data/app/components/ui_components/daisy_ui/action/dropdown/card/item_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/action/dropdown/card_component.rb +4 -14
- data/app/components/ui_components/daisy_ui/action/dropdown/menu/item_component.rb +32 -0
- data/app/components/ui_components/daisy_ui/action/dropdown/menu_component.rb +2 -12
- data/app/components/ui_components/daisy_ui/action/dropdown_component.rb +12 -12
- data/app/components/ui_components/daisy_ui/action/modal/anchor_component.rb +1 -11
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action/item_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/body_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/close_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box/title_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog/box_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/modal/dialog_component.rb +2 -12
- data/app/components/ui_components/daisy_ui/action/swap/off_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/swap/on_component.rb +0 -9
- data/app/components/ui_components/daisy_ui/action/swap_component.rb +6 -6
- data/app/components/ui_components/daisy_ui/base_component.rb +24 -3
- data/app/components/ui_components/daisy_ui/data_display/accordion/item/anchor_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/accordion/item/body_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/accordion/item_component.rb +15 -15
- data/app/components/ui_components/daisy_ui/data_display/avatar/item/box_component.rb +63 -0
- data/app/components/ui_components/daisy_ui/data_display/avatar/item_component.rb +8 -8
- data/app/components/ui_components/daisy_ui/data_display/badge_component.rb +7 -7
- data/app/components/ui_components/daisy_ui/data_display/card/body/action_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/card/body/context_component.rb +17 -0
- data/app/components/ui_components/daisy_ui/data_display/card/body/title_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/card/body_component.rb +34 -0
- data/app/components/ui_components/daisy_ui/data_display/card/figure_component.rb +15 -0
- data/app/components/ui_components/daisy_ui/data_display/card_component.rb +83 -0
- data/app/components/ui_components/daisy_ui/data_display/carousel/indicator_component.rb +18 -0
- data/app/components/ui_components/daisy_ui/data_display/carousel/item/passer_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/carousel/item_component.rb +26 -0
- data/app/components/ui_components/daisy_ui/data_display/carousel_component.rb +63 -0
- data/app/components/ui_components/daisy_ui/data_display/chat/bubble_component.rb +42 -0
- data/app/components/ui_components/daisy_ui/data_display/chat/footer_component.rb +18 -0
- data/app/components/ui_components/daisy_ui/data_display/chat/header_component.rb +18 -0
- data/app/components/ui_components/daisy_ui/data_display/chat_component.rb +58 -0
- data/app/components/ui_components/daisy_ui/data_display/countdown/item_component.rb +49 -0
- data/app/components/ui_components/daisy_ui/data_display/countdown_component.rb +37 -0
- data/app/components/ui_components/daisy_ui/data_display/{accordion/anchor_component.rb → diff/item1_component.rb} +5 -8
- data/app/components/ui_components/daisy_ui/data_display/{accordion/body_component.rb → diff/item2_component.rb} +6 -8
- data/app/components/ui_components/daisy_ui/data_display/diff/resizer_component.rb +25 -0
- data/app/components/ui_components/daisy_ui/data_display/diff_component.rb +35 -0
- data/app/components/ui_components/daisy_ui/data_display/kbd_component.rb +40 -0
- data/app/components/ui_components/daisy_ui/data_display/list/item_component.rb +40 -0
- data/app/components/ui_components/daisy_ui/data_display/list_component.rb +22 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/action_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/description_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/figure_component.rb +24 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/title_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item/value_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/stat/item_component.rb +39 -0
- data/app/components/ui_components/daisy_ui/data_display/stat_component.rb +50 -0
- data/app/components/ui_components/daisy_ui/data_display/status_component.rb +59 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/body_component.rb +23 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/foot_component.rb +23 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/head_component.rb +23 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/row/data_component.rb +19 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/row/header_component.rb +19 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item/row_component.rb +32 -0
- data/app/components/ui_components/daisy_ui/data_display/table/item_component.rb +29 -0
- data/app/components/ui_components/daisy_ui/data_display/table_component.rb +72 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_end_component.rb +44 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_middle_component.rb +20 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_start_component.rb +44 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item/line_component.rb +17 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline/item_component.rb +40 -0
- data/app/components/ui_components/daisy_ui/data_display/timeline_component.rb +50 -0
- data/app/controllers/ui_components/daisy_ui/data_display_components_controller.rb +22 -0
- data/app/helpers/data_display/carousel_helper.rb +13 -0
- data/app/views/ui_components/daisy_ui/action_components/button.html.erb +35 -33
- data/app/views/ui_components/daisy_ui/action_components/dropdown.html.erb +38 -25
- data/app/views/ui_components/daisy_ui/action_components/modal.html.erb +31 -18
- data/app/views/ui_components/daisy_ui/action_components/swap.html.erb +31 -17
- data/app/views/ui_components/daisy_ui/data_display_components/accordion.html.erb +59 -105
- data/app/views/ui_components/daisy_ui/data_display_components/avatar.html.erb +40 -27
- data/app/views/ui_components/daisy_ui/data_display_components/badge.html.erb +45 -42
- data/app/views/ui_components/daisy_ui/data_display_components/card.html.erb +302 -0
- data/app/views/ui_components/daisy_ui/data_display_components/carousel.html.erb +303 -0
- data/app/views/ui_components/daisy_ui/data_display_components/chat.html.erb +190 -0
- data/app/views/ui_components/daisy_ui/data_display_components/countdown.html.erb +211 -0
- data/app/views/ui_components/daisy_ui/data_display_components/diff.html.erb +69 -0
- data/app/views/ui_components/daisy_ui/data_display_components/kbd.html.erb +157 -0
- data/app/views/ui_components/daisy_ui/data_display_components/list.html.erb +247 -0
- data/app/views/ui_components/daisy_ui/data_display_components/stat.html.erb +208 -0
- data/app/views/ui_components/daisy_ui/data_display_components/status.html.erb +93 -0
- data/app/views/ui_components/daisy_ui/data_display_components/table.html.erb +358 -0
- data/app/views/ui_components/daisy_ui/data_display_components/timeline.html.erb +431 -0
- data/app/views/ui_components/daisy_ui/home/index.html.erb +11 -0
- data/config/routes.rb +13 -2
- data/lib/tasks/ui_components_tasks.rake +0 -3
- data/lib/ui_components/config/daisy_ui_class_names.rb +3 -2
- data/lib/ui_components/config/tailwind_class_names.rb +27 -4
- data/lib/ui_components/version.rb +1 -1
- metadata +65 -7
- data/app/components/ui_components/daisy_ui/action/dropdown/card_item_component.rb +0 -29
- data/app/components/ui_components/daisy_ui/action/dropdown/list_item_component.rb +0 -30
- data/app/components/ui_components/daisy_ui/data_display/avatar/box_component.rb +0 -61
@@ -10,9 +10,11 @@
|
|
10
10
|
</ul>
|
11
11
|
</div>
|
12
12
|
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
<div class="divider"></div>
|
14
|
+
|
15
|
+
<%= render DocumentationComponent.new do |doc| %>
|
16
|
+
<%= doc.with_header { "# Avatar" } %>
|
17
|
+
<%= doc.with_body do |body| %>
|
16
18
|
<%= body.with_preview_example(
|
17
19
|
source: <<~ERB
|
18
20
|
<$= render #{component}.new do |avatar| $>
|
@@ -27,9 +29,9 @@
|
|
27
29
|
<% end %>
|
28
30
|
<% end %>
|
29
31
|
|
30
|
-
<%= render DocumentationComponent.new do |
|
31
|
-
<%=
|
32
|
-
<%=
|
32
|
+
<%= render DocumentationComponent.new do |doc| %>
|
33
|
+
<%= doc.with_header { "# Avatar in custom sizes" } %>
|
34
|
+
<%= doc.with_body do |body| %>
|
33
35
|
<%= body.with_preview_example(
|
34
36
|
source: <<~ERB
|
35
37
|
<$= render #{component}.new do |avatar| $>
|
@@ -62,9 +64,9 @@
|
|
62
64
|
<% end %>
|
63
65
|
<% end %>
|
64
66
|
|
65
|
-
<%= render DocumentationComponent.new do |
|
66
|
-
<%=
|
67
|
-
<%=
|
67
|
+
<%= render DocumentationComponent.new do |doc| %>
|
68
|
+
<%= doc.with_header { "# Avatar rounded" } %>
|
69
|
+
<%= doc.with_body do |body| %>
|
68
70
|
<%= body.with_preview_example(
|
69
71
|
source: <<~ERB
|
70
72
|
<$= render #{component}.new do |avatar| $>
|
@@ -85,9 +87,9 @@
|
|
85
87
|
<% end %>
|
86
88
|
<% end %>
|
87
89
|
|
88
|
-
<%= render DocumentationComponent.new do |
|
89
|
-
<%=
|
90
|
-
<%=
|
90
|
+
<%= render DocumentationComponent.new do |doc| %>
|
91
|
+
<%= doc.with_header { "# Avatar with mask" } %>
|
92
|
+
<%= doc.with_body do |body| %>
|
91
93
|
<%= body.with_preview_example(
|
92
94
|
source: <<~ERB
|
93
95
|
<$= render #{component}.new do |avatar| $>
|
@@ -114,9 +116,9 @@
|
|
114
116
|
<% end %>
|
115
117
|
<% end %>
|
116
118
|
|
117
|
-
<%= render DocumentationComponent.new do |
|
118
|
-
<%=
|
119
|
-
<%=
|
119
|
+
<%= render DocumentationComponent.new do |doc| %>
|
120
|
+
<%= doc.with_header { "# Avatar group" } %>
|
121
|
+
<%= doc.with_body do |body| %>
|
120
122
|
<%= body.with_preview_example(
|
121
123
|
source: <<~ERB
|
122
124
|
<$= render #{component}.new(css_class: "avatar-group -space-x-6") do |avatar| $>
|
@@ -149,9 +151,9 @@
|
|
149
151
|
<% end %>
|
150
152
|
<% end %>
|
151
153
|
|
152
|
-
<%= render DocumentationComponent.new do |
|
153
|
-
<%=
|
154
|
-
<%=
|
154
|
+
<%= render DocumentationComponent.new do |doc| %>
|
155
|
+
<%= doc.with_header { "# Avatar group with counter" } %>
|
156
|
+
<%= doc.with_body do |body| %>
|
155
157
|
<%= body.with_preview_example(
|
156
158
|
source: <<~ERB
|
157
159
|
<$= render #{component}.new(css_class: "avatar-group -space-x-6") do |avatar| $>
|
@@ -184,9 +186,9 @@
|
|
184
186
|
<% end %>
|
185
187
|
<% end %>
|
186
188
|
|
187
|
-
<%= render DocumentationComponent.new do |
|
188
|
-
<%=
|
189
|
-
<%=
|
189
|
+
<%= render DocumentationComponent.new do |doc| %>
|
190
|
+
<%= doc.with_header { "# Avatar with ring" } %>
|
191
|
+
<%= doc.with_body do |body| %>
|
190
192
|
<%= body.with_preview_example(
|
191
193
|
source: <<~ERB
|
192
194
|
<$= render #{component}.new do |avatar| $>
|
@@ -201,9 +203,9 @@
|
|
201
203
|
<% end %>
|
202
204
|
<% end %>
|
203
205
|
|
204
|
-
<%= render DocumentationComponent.new do |
|
205
|
-
<%=
|
206
|
-
<%=
|
206
|
+
<%= render DocumentationComponent.new do |doc| %>
|
207
|
+
<%= doc.with_header { "# Avatar with presence indicator" } %>
|
208
|
+
<%= doc.with_body do |body| %>
|
207
209
|
<%= body.with_preview_example(
|
208
210
|
source: <<~ERB
|
209
211
|
<$= render #{component}.new do |avatar| $>
|
@@ -224,9 +226,9 @@
|
|
224
226
|
<% end %>
|
225
227
|
<% end %>
|
226
228
|
|
227
|
-
<%= render DocumentationComponent.new do |
|
228
|
-
<%=
|
229
|
-
<%=
|
229
|
+
<%= render DocumentationComponent.new do |doc| %>
|
230
|
+
<%= doc.with_header { "# Avatar placeholder" } %>
|
231
|
+
<%= doc.with_body do |body| %>
|
230
232
|
<%= body.with_preview_example(
|
231
233
|
source: <<~ERB
|
232
234
|
<$= render #{component}.new do |avatar| $>
|
@@ -258,4 +260,15 @@
|
|
258
260
|
) %>
|
259
261
|
<% end %>
|
260
262
|
<% end %>
|
263
|
+
|
264
|
+
<div class="divider"></div>
|
265
|
+
|
266
|
+
<div class="mb-2">
|
267
|
+
<h1 class="font-bold mb-2"># Data display > Avatar</h1>
|
268
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
269
|
+
<%= link_to "< Accordion", daisy_ui_accordion_path, class: "link link-primary m-2" %>
|
270
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
271
|
+
<%= link_to "Badge >", daisy_ui_badge_path, class: "link link-primary m-2" %>
|
272
|
+
</ul>
|
273
|
+
</div>
|
261
274
|
</div>
|
@@ -6,17 +6,18 @@
|
|
6
6
|
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
7
7
|
<%= link_to "< Avatar", daisy_ui_avatar_path, class: "link link-primary m-2" %>
|
8
8
|
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
9
|
+
<%= link_to "Card >", daisy_ui_card_path, class: "link link-primary m-2" %>
|
9
10
|
</ul>
|
10
11
|
</div>
|
11
12
|
|
12
|
-
|
13
|
-
|
14
|
-
|
13
|
+
<div class="divider"></div>
|
14
|
+
|
15
|
+
<%= render DocumentationComponent.new do |doc| %>
|
16
|
+
<%= doc.with_header { "# Badge" } %>
|
17
|
+
<%= doc.with_body do |body| %>
|
15
18
|
<%= body.with_preview_example(
|
16
19
|
source: <<~ERB
|
17
|
-
<$= render #{component}.new
|
18
|
-
Default
|
19
|
-
<$ end $>
|
20
|
+
<$= render #{component}.new.with_content("Default") $>
|
20
21
|
ERB
|
21
22
|
) %>
|
22
23
|
<% end %>
|
@@ -24,15 +25,13 @@
|
|
24
25
|
|
25
26
|
<% sizes = { 'xs' => 'Xsmall', 'sm' => 'Small', 'md' => 'Medium', 'lg' => 'Large', 'xl' => 'Xlarge' } %>
|
26
27
|
|
27
|
-
<%= render DocumentationComponent.new do |
|
28
|
-
<%=
|
29
|
-
<%=
|
28
|
+
<%= render DocumentationComponent.new do |doc| %>
|
29
|
+
<%= doc.with_header { "# Badge sizes" } %>
|
30
|
+
<%= doc.with_body do |body| %>
|
30
31
|
<% sizes.each do |key, value| %>
|
31
32
|
<%= body.with_preview_example(
|
32
33
|
source: <<~ERB
|
33
|
-
<$= render #{component}.new(size: "#{key}")
|
34
|
-
#{value}
|
35
|
-
<$ end $>
|
34
|
+
<$= render #{component}.new(size: "#{key}").with_content("#{value}") $>
|
36
35
|
ERB
|
37
36
|
) %>
|
38
37
|
<% end %>
|
@@ -41,15 +40,13 @@
|
|
41
40
|
|
42
41
|
<% colors = { 'primary' => 'Primary', 'secondary' => 'Secondary', 'accent' => 'Accent', 'info' => 'Info', 'success' => 'Success', 'warning' => 'Warning', 'error' => 'Error' } %>
|
43
42
|
|
44
|
-
<%= render DocumentationComponent.new do |
|
45
|
-
<%=
|
46
|
-
<%=
|
43
|
+
<%= render DocumentationComponent.new do |doc| %>
|
44
|
+
<%= doc.with_header { "# Badge with colors" } %>
|
45
|
+
<%= doc.with_body do |body| %>
|
47
46
|
<% colors.each do |key, value| %>
|
48
47
|
<%= body.with_preview_example(
|
49
48
|
source: <<~ERB
|
50
|
-
<$= render #{component}.new(color: "#{key}")
|
51
|
-
#{value}
|
52
|
-
<$ end $>
|
49
|
+
<$= render #{component}.new(color: "#{key}").with_content("#{value}") $>
|
53
50
|
ERB
|
54
51
|
) %>
|
55
52
|
<% end %>
|
@@ -59,18 +56,17 @@
|
|
59
56
|
<% kinds = { 'soft' => 'Soft', 'outline' => 'Outline', 'dash' => 'Dash', 'ghost' => 'Ghost' } %>
|
60
57
|
|
61
58
|
<% kinds.each do |kind_key, kind_value| %>
|
62
|
-
<%= render DocumentationComponent.new do |
|
63
|
-
<%=
|
64
|
-
<%=
|
59
|
+
<%= render DocumentationComponent.new do |doc| %>
|
60
|
+
<%= doc.with_header { "# #{kind_value} #{kind_key == "ghost" ? 'badge' : 'badges'}" } %>
|
61
|
+
<%= doc.with_body do |body| %>
|
65
62
|
<% colors.each do |color_key, value| %>
|
66
63
|
|
67
64
|
<% next if data_display_badge_skip_kind(kind_key:, color_key:) %>
|
65
|
+
<% string_value = kind_key == 'ghost' ? kind_value : value %>
|
68
66
|
|
69
67
|
<%= body.with_preview_example(
|
70
68
|
source: <<~ERB
|
71
|
-
<$= render #{component}.new(#{data_display_badge_handle_component_params(kind_key:, color_key:)})
|
72
|
-
#{kind_key == "ghost" ? kind_value : value}
|
73
|
-
<$ end $>
|
69
|
+
<$= render #{component}.new(#{data_display_badge_handle_component_params(kind_key:, color_key:)}).with_content("#{string_value}") $>
|
74
70
|
ERB
|
75
71
|
) %>
|
76
72
|
<% end %>
|
@@ -78,9 +74,9 @@
|
|
78
74
|
<% end %>
|
79
75
|
<% end %>
|
80
76
|
|
81
|
-
<%= render DocumentationComponent.new do |
|
82
|
-
<%=
|
83
|
-
<%=
|
77
|
+
<%= render DocumentationComponent.new do |doc| %>
|
78
|
+
<%= doc.with_header { "# Empty badge" } %>
|
79
|
+
<%= doc.with_body do |body| %>
|
84
80
|
<% sizes.keys.reverse.each do |key| %>
|
85
81
|
<%= body.with_preview_example(
|
86
82
|
source: <<~ERB
|
@@ -93,9 +89,9 @@
|
|
93
89
|
|
94
90
|
<% badge_with_icon_colors = { 'info' => 'Info', 'success' => 'Success', 'warning' => 'Warning', 'error' => 'Error' } %>
|
95
91
|
|
96
|
-
<%= render DocumentationComponent.new do |
|
97
|
-
<%=
|
98
|
-
<%=
|
92
|
+
<%= render DocumentationComponent.new do |doc| %>
|
93
|
+
<%= doc.with_header { "# Badge with icon" } %>
|
94
|
+
<%= doc.with_body do |body| %>
|
99
95
|
<% badge_with_icon_colors.each do |key, value| %>
|
100
96
|
<%= body.with_preview_example(
|
101
97
|
source: <<~ERB
|
@@ -110,17 +106,15 @@
|
|
110
106
|
<% end %>
|
111
107
|
|
112
108
|
|
113
|
-
<%= render DocumentationComponent.new do |
|
114
|
-
<%=
|
115
|
-
<%=
|
109
|
+
<%= render DocumentationComponent.new do |doc| %>
|
110
|
+
<%= doc.with_header { "# Badge in a text" } %>
|
111
|
+
<%= doc.with_body do |body| %>
|
116
112
|
<% sizes.keys.reverse.each_with_index do |key, index| %>
|
117
113
|
<%= body.with_preview_example(
|
118
114
|
source: <<~ERB
|
119
115
|
<h1 class="text-#{key == "md" ? "base" : key} font-semibold">
|
120
116
|
Heading #{index+1}
|
121
|
-
<$= render #{component}.new(size: "#{key}")
|
122
|
-
Badge
|
123
|
-
<$ end $>
|
117
|
+
<$= render #{component}.new(size: "#{key}").with_content("Badge") $>
|
124
118
|
</h1>
|
125
119
|
ERB
|
126
120
|
) %>
|
@@ -130,21 +124,30 @@
|
|
130
124
|
|
131
125
|
<% badge_with_button_colors = ["", "secondary"] %>
|
132
126
|
|
133
|
-
<%= render DocumentationComponent.new do |
|
134
|
-
<%=
|
135
|
-
<%=
|
127
|
+
<%= render DocumentationComponent.new do |doc| %>
|
128
|
+
<%= doc.with_header { "# Badge in a button" } %>
|
129
|
+
<%= doc.with_body do |body| %>
|
136
130
|
<% badge_with_button_colors.each do |key| %>
|
137
131
|
<%= body.with_preview_example(
|
138
132
|
source: <<~ERB
|
139
133
|
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new do $>
|
140
134
|
Inbox
|
141
|
-
<$= render #{component}.new(size: "sm"#{", color: \"#{key}\"" if key.present?})
|
142
|
-
+99
|
143
|
-
<$ end $>
|
135
|
+
<$= render #{component}.new(size: "sm"#{", color: \"#{key}\"" if key.present?}).with_content("+99") $>
|
144
136
|
<$ end $>
|
145
137
|
ERB
|
146
138
|
) %>
|
147
139
|
<% end %>
|
148
140
|
<% end %>
|
149
141
|
<% end %>
|
142
|
+
|
143
|
+
<div class="divider"></div>
|
144
|
+
|
145
|
+
<div class="mb-2">
|
146
|
+
<h1 class="font-bold mb-2"># Data display > Badge</h1>
|
147
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
148
|
+
<%= link_to "< Avatar", daisy_ui_avatar_path, class: "link link-primary m-2" %>
|
149
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
150
|
+
<%= link_to "Card >", daisy_ui_card_path, class: "link link-primary m-2" %>
|
151
|
+
</ul>
|
152
|
+
</div>
|
150
153
|
</div>
|
@@ -0,0 +1,302 @@
|
|
1
|
+
<% component = UiComponents::DaisyUi::DataDisplay::CardComponent %>
|
2
|
+
|
3
|
+
<div class="grid grid-cols gap-16 p-2 mt-6 mb-36">
|
4
|
+
<div class="mb-2">
|
5
|
+
<h1 class="font-bold mb-2"># Data display > Card</h1>
|
6
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
7
|
+
<%= link_to "< Badge", daisy_ui_badge_path, class: "link link-primary m-2" %>
|
8
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
9
|
+
<%= link_to "Carousel >", daisy_ui_carousel_path, class: "link link-primary m-2" %>
|
10
|
+
</ul>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="divider"></div>
|
14
|
+
|
15
|
+
<%= render DocumentationComponent.new do |doc| %>
|
16
|
+
<%= doc.with_header { "# Card" } %>
|
17
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2 bg-base-200" }) do |body| %>
|
18
|
+
<%= body.with_preview_example(
|
19
|
+
source: <<~ERB
|
20
|
+
<$= render #{component}.new do |card| $>
|
21
|
+
<$= card.with_figure do $>
|
22
|
+
<img src="https://img.daisyui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.webp" alt="Shoes" />
|
23
|
+
<$ end $>
|
24
|
+
|
25
|
+
<$= card.with_body do |body| $>
|
26
|
+
<$= body.with_title_content("Card Title") $>
|
27
|
+
<$= body.with_context do $>
|
28
|
+
<p>A card component has a figure, a body part, and inside body there are title and actions parts</p>
|
29
|
+
<$ end $>
|
30
|
+
|
31
|
+
<$= body.with_action do $>
|
32
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new(color: "primary").with_content("Buy Now") $>
|
33
|
+
<$ end $>
|
34
|
+
<$ end $>
|
35
|
+
<$ end $>
|
36
|
+
ERB
|
37
|
+
) %>
|
38
|
+
<% end %>
|
39
|
+
<% end %>
|
40
|
+
|
41
|
+
<% sizes = { 'xs' => 'Xsmall', 'sm' => 'Small', 'md' => 'Medium', 'lg' => 'Large', 'xl' => 'Xlarge' } %>
|
42
|
+
|
43
|
+
<%= render DocumentationComponent.new do |doc| %>
|
44
|
+
<%= doc.with_header { "# Card sizes" } %>
|
45
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2 bg-base-200" }) do |body| %>
|
46
|
+
<% sizes.each do |key, value| %>
|
47
|
+
<%= body.with_preview_example(
|
48
|
+
|
49
|
+
source: <<~ERB
|
50
|
+
<$= render #{component}.new(size: "#{key}") do |card| $>
|
51
|
+
<$= card.with_body do |body| $>
|
52
|
+
<$= body.with_title_content("#{value} Card") $>
|
53
|
+
<$= body.with_context do $>
|
54
|
+
<p>A card component has a figure, a body part, and inside body there are title and actions parts</p>
|
55
|
+
<$ end $>
|
56
|
+
|
57
|
+
<$= body.with_action do $>
|
58
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new(color: "primary").with_content("Buy Now") $>
|
59
|
+
<$ end $>
|
60
|
+
<$ end $>
|
61
|
+
<$ end $>
|
62
|
+
ERB
|
63
|
+
) %>
|
64
|
+
<% end %>
|
65
|
+
<% end %>
|
66
|
+
<% end %>
|
67
|
+
|
68
|
+
<% border_kinds = { 'border' => 'card-border', 'dash' => 'dash border' } %>
|
69
|
+
|
70
|
+
<% border_kinds.each do |key, value| %>
|
71
|
+
<%= render DocumentationComponent.new do |doc| %>
|
72
|
+
<%= doc.with_header { "# Card with a #{value}" } %>
|
73
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2 bg-base-100" }) do |body| %>
|
74
|
+
<%= body.with_preview_example(
|
75
|
+
source: <<~ERB
|
76
|
+
<$= render #{component}.new(border_kind: "#{key}") do |card| $>
|
77
|
+
<$= card.with_body do |body| $>
|
78
|
+
<$= body.with_title_content("Card Title") $>
|
79
|
+
<$= body.with_context do $>
|
80
|
+
<p>A card component has a figure, a body part, and inside body there are title and actions parts</p>
|
81
|
+
<$ end $>
|
82
|
+
|
83
|
+
<$= body.with_action do $>
|
84
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new(color: "primary").with_content("Buy Now") $>
|
85
|
+
<$ end $>
|
86
|
+
<$ end $>
|
87
|
+
<$ end $>
|
88
|
+
ERB
|
89
|
+
) %>
|
90
|
+
<% end %>
|
91
|
+
<% end %>
|
92
|
+
<% end %>
|
93
|
+
|
94
|
+
<%= render DocumentationComponent.new do |doc| %>
|
95
|
+
<%= doc.with_header { "# Card with badge" } %>
|
96
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2 bg-base-200" }) do |body| %>
|
97
|
+
<%= body.with_preview_example(
|
98
|
+
source: <<~ERB
|
99
|
+
<$= render #{component}.new do |card| $>
|
100
|
+
<$= card.with_figure do $>
|
101
|
+
<img src="https://img.daisyui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.webp" alt="Shoes" />
|
102
|
+
<$ end $>
|
103
|
+
|
104
|
+
<$= card.with_body do |body| $>
|
105
|
+
<$= body.with_title do $>
|
106
|
+
Card Title
|
107
|
+
<$= render UiComponents::DaisyUi::DataDisplay::BadgeComponent.new(color: "secondary").with_content("NEW") $>
|
108
|
+
<$ end $>
|
109
|
+
|
110
|
+
<$= body.with_context do $>
|
111
|
+
<p>A card component has a figure, a body part, and inside body there are title and actions parts</p>
|
112
|
+
<$ end $>
|
113
|
+
|
114
|
+
<$= body.with_action do $>
|
115
|
+
<$= render UiComponents::DaisyUi::DataDisplay::BadgeComponent.new(kind: "outline").with_content("Fashion") $>
|
116
|
+
<$= render UiComponents::DaisyUi::DataDisplay::BadgeComponent.new(kind: "outline").with_content("Products") $>
|
117
|
+
<$ end $>
|
118
|
+
<$ end $>
|
119
|
+
<$ end $>
|
120
|
+
ERB
|
121
|
+
) %>
|
122
|
+
<% end %>
|
123
|
+
<% end %>
|
124
|
+
|
125
|
+
<%= render DocumentationComponent.new do |doc| %>
|
126
|
+
<%= doc.with_header { "# Card with bottom image" } %>
|
127
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2 bg-base-200" }) do |body| %>
|
128
|
+
<%= body.with_preview_example(
|
129
|
+
source: <<~ERB
|
130
|
+
<$= render #{component}.new do |card| $>
|
131
|
+
<$= card.with_body do |body| $>
|
132
|
+
<$= body.with_title_content("Card Title") $>
|
133
|
+
<$= body.with_context do $>
|
134
|
+
<p>A card component has a figure, a body part, and inside body there are title and actions parts</p>
|
135
|
+
<$ end $>
|
136
|
+
<$ end $>
|
137
|
+
|
138
|
+
<$= card.with_figure do $>
|
139
|
+
<img src="https://img.daisyui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.webp" alt="Shoes" />
|
140
|
+
<$ end $>
|
141
|
+
<$ end $>
|
142
|
+
ERB
|
143
|
+
) %>
|
144
|
+
<% end %>
|
145
|
+
<% end %>
|
146
|
+
|
147
|
+
<%= render DocumentationComponent.new do |doc| %>
|
148
|
+
<%= doc.with_header { "# Card with centered content and paddings" } %>
|
149
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2 bg-base-200" }) do |body| %>
|
150
|
+
<%= body.with_preview_example(
|
151
|
+
source: <<~ERB
|
152
|
+
<$= render #{component}.new do |card| $>
|
153
|
+
<$= card.with_figure(css_class: "px-10 pt-10") do $>
|
154
|
+
<img class="rounded-xl" src="https://img.daisyui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.webp" alt="Shoes" />
|
155
|
+
<$ end $>
|
156
|
+
|
157
|
+
<$= card.with_body(css_class: "items-center text-center") do |body| $>
|
158
|
+
<$= body.with_title_content("Card Title") $>
|
159
|
+
<$= body.with_context do $>
|
160
|
+
<p>A card component has a figure, a body part, and inside body there are title and actions parts</p>
|
161
|
+
<$ end $>
|
162
|
+
|
163
|
+
<$= body.with_action do $>
|
164
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new(color: "primary").with_content("Buy Now") $>
|
165
|
+
<$ end $>
|
166
|
+
<$ end $>
|
167
|
+
<$ end $>
|
168
|
+
ERB
|
169
|
+
) %>
|
170
|
+
<% end %>
|
171
|
+
<% end %>
|
172
|
+
|
173
|
+
<%= render DocumentationComponent.new do |doc| %>
|
174
|
+
<%= doc.with_header { "# Card with image overlay" } %>
|
175
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2 bg-base-200" }) do |body| %>
|
176
|
+
<%= body.with_preview_example(
|
177
|
+
source: <<~ERB
|
178
|
+
<$= render #{component}.new(image_full: true) do |card| $>
|
179
|
+
<$= card.with_figure do $>
|
180
|
+
<img src="https://img.daisyui.com/images/stock/photo-1606107557195-0e29a4b5b4aa.webp" alt="Shoes" />
|
181
|
+
<$ end $>
|
182
|
+
|
183
|
+
<$= card.with_body do |body| $>
|
184
|
+
<$= body.with_title_content("Card Title") $>
|
185
|
+
<$= body.with_context do $>
|
186
|
+
<p>A card component has a figure, a body part, and inside body there are title and actions parts</p>
|
187
|
+
<$ end $>
|
188
|
+
<$= body.with_action do $>
|
189
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new(color: "primary").with_content("Buy Now") $>
|
190
|
+
<$ end $>
|
191
|
+
<$ end $>
|
192
|
+
<$ end $>
|
193
|
+
ERB
|
194
|
+
) %>
|
195
|
+
<% end %>
|
196
|
+
<% end %>
|
197
|
+
|
198
|
+
<%= render DocumentationComponent.new do |doc| %>
|
199
|
+
<%= doc.with_header { "# Card with custom color" } %>
|
200
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2" }) do |body| %>
|
201
|
+
<%= body.with_preview_example(
|
202
|
+
source: <<~ERB
|
203
|
+
<$= render #{component}.new(css_class: "bg-primary") do |card| $>
|
204
|
+
<$= card.with_body do |body| $>
|
205
|
+
<$= body.with_title_content("Card Title") $>
|
206
|
+
<$= body.with_context do $>
|
207
|
+
<p>A card component has a figure, a body part, and inside body there are title and actions parts</p>
|
208
|
+
<$ end $>
|
209
|
+
|
210
|
+
<$= body.with_action do $>
|
211
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new.with_content("Buy Now") $>
|
212
|
+
<$ end $>
|
213
|
+
<$ end $>
|
214
|
+
<$ end $>
|
215
|
+
ERB
|
216
|
+
) %>
|
217
|
+
<% end %>
|
218
|
+
<% end %>
|
219
|
+
|
220
|
+
<%= render DocumentationComponent.new do |doc| %>
|
221
|
+
<%= doc.with_header { "# Centered card with neutral color" } %>
|
222
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2" }) do |body| %>
|
223
|
+
<%= body.with_preview_example(
|
224
|
+
source: <<~ERB
|
225
|
+
<$= render #{component}.new(css_class: "bg-neutral") do |card| $>
|
226
|
+
<$= card.with_body(css_class: "items-center text-center") do |body| $>
|
227
|
+
<$= body.with_title_content("Cookies!") $>
|
228
|
+
<$= body.with_context do $>
|
229
|
+
<p>We are using cookies for no reason.</p>
|
230
|
+
<$ end $>
|
231
|
+
|
232
|
+
<$= body.with_action do $>
|
233
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new(color: "primary").with_content("Accept") $>
|
234
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new(color: "ghost").with_content("Deny") $>
|
235
|
+
<$ end $>
|
236
|
+
<$ end $>
|
237
|
+
<$ end $>
|
238
|
+
ERB
|
239
|
+
) %>
|
240
|
+
<% end %>
|
241
|
+
<% end %>
|
242
|
+
|
243
|
+
<%= render DocumentationComponent.new do |doc| %>
|
244
|
+
<%= doc.with_header { "# Card with action on top" } %>
|
245
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2 bg-base-200" }) do |body| %>
|
246
|
+
<%= body.with_preview_example(
|
247
|
+
source: <<~ERB
|
248
|
+
<$= render #{component}.new do |card| $>
|
249
|
+
<$= card.with_body do |body| $>
|
250
|
+
<$= body.with_action do $>
|
251
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new(shape: "square", size: "sm") do $>
|
252
|
+
<svg class="h-6 w-6" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"/></svg>
|
253
|
+
<$ end $>
|
254
|
+
<$ end $>
|
255
|
+
|
256
|
+
<$= body.with_context do $>
|
257
|
+
<p>We are using cookies for no reason.</p>
|
258
|
+
<$ end $>
|
259
|
+
<$ end $>
|
260
|
+
<$ end $>
|
261
|
+
ERB
|
262
|
+
) %>
|
263
|
+
<% end %>
|
264
|
+
<% end %>
|
265
|
+
|
266
|
+
<%= render DocumentationComponent.new do |doc| %>
|
267
|
+
<%= doc.with_header { "# Card with image on side" } %>
|
268
|
+
<%= doc.with_body(preview_options: { css_class: "grid grid-cols gap-y-4 p-2 bg-base-200" }) do |body| %>
|
269
|
+
<%= body.with_preview_example(
|
270
|
+
source: <<~ERB
|
271
|
+
<$= render #{component}.new(side: true, css_class: "w-lg") do |card| $>
|
272
|
+
<$= card.with_figure do $>
|
273
|
+
<img src="https://img.daisyui.com/images/stock/photo-1635805737707-575885ab0820.webp" alt="Movie" />
|
274
|
+
<$ end $>
|
275
|
+
|
276
|
+
<$= card.with_body do |body| $>
|
277
|
+
<$= body.with_title_content("New movie is released!") $>
|
278
|
+
<$= body.with_context do $>
|
279
|
+
<p>Click the button to watch on Jetflix app.</p>
|
280
|
+
<$ end $>
|
281
|
+
|
282
|
+
<$= body.with_action do $>
|
283
|
+
<$= render UiComponents::DaisyUi::Action::ButtonComponent.new(color: "primary").with_content("Watch") $>
|
284
|
+
<$ end $>
|
285
|
+
<$ end $>
|
286
|
+
<$ end $>
|
287
|
+
ERB
|
288
|
+
) %>
|
289
|
+
<% end %>
|
290
|
+
<% end %>
|
291
|
+
|
292
|
+
<div class="divider"></div>
|
293
|
+
|
294
|
+
<div class="mb-2">
|
295
|
+
<h1 class="font-bold mb-2"># Data display > Card</h1>
|
296
|
+
<ul class="bg-base-100 rounded-box shadow-md p-2">
|
297
|
+
<%= link_to "< Badge", daisy_ui_badge_path, class: "link link-primary m-2" %>
|
298
|
+
<%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
|
299
|
+
<%= link_to "Carousel >", daisy_ui_carousel_path, class: "link link-primary m-2" %>
|
300
|
+
</ul>
|
301
|
+
</div>
|
302
|
+
</div>
|