ui_components 0.1.1 → 0.1.3

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.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ui_components/controllers/countdown_controller.js +55 -0
  3. data/app/components/documentation/body/example_preview_component.rb +1 -1
  4. data/app/components/documentation/body_component.html.erb +1 -1
  5. data/app/components/documentation/body_component.rb +4 -4
  6. data/app/components/ui_components/daisy_ui/action/button_component.rb +13 -13
  7. data/app/components/ui_components/daisy_ui/action/dropdown/anchor_component.rb +1 -11
  8. data/app/components/ui_components/daisy_ui/action/dropdown/card/item_component.rb +20 -0
  9. data/app/components/ui_components/daisy_ui/action/dropdown/card_component.rb +4 -14
  10. data/app/components/ui_components/daisy_ui/action/dropdown/menu/item_component.rb +32 -0
  11. data/app/components/ui_components/daisy_ui/action/dropdown/menu_component.rb +2 -12
  12. data/app/components/ui_components/daisy_ui/action/dropdown_component.rb +12 -12
  13. data/app/components/ui_components/daisy_ui/action/modal/anchor_component.rb +1 -11
  14. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action/item_component.rb +0 -9
  15. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action_component.rb +0 -9
  16. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/body_component.rb +0 -9
  17. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/close_component.rb +0 -9
  18. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/title_component.rb +0 -9
  19. data/app/components/ui_components/daisy_ui/action/modal/dialog/box_component.rb +0 -9
  20. data/app/components/ui_components/daisy_ui/action/modal/dialog_component.rb +2 -12
  21. data/app/components/ui_components/daisy_ui/action/swap/off_component.rb +0 -9
  22. data/app/components/ui_components/daisy_ui/action/swap/on_component.rb +0 -9
  23. data/app/components/ui_components/daisy_ui/action/swap_component.rb +6 -6
  24. data/app/components/ui_components/daisy_ui/base_component.rb +24 -3
  25. data/app/components/ui_components/daisy_ui/data_display/accordion/item/anchor_component.rb +20 -0
  26. data/app/components/ui_components/daisy_ui/data_display/accordion/item/body_component.rb +20 -0
  27. data/app/components/ui_components/daisy_ui/data_display/accordion/item_component.rb +15 -15
  28. data/app/components/ui_components/daisy_ui/data_display/avatar/item/box_component.rb +63 -0
  29. data/app/components/ui_components/daisy_ui/data_display/avatar/item_component.rb +8 -8
  30. data/app/components/ui_components/daisy_ui/data_display/badge_component.rb +7 -7
  31. data/app/components/ui_components/daisy_ui/data_display/card/body/action_component.rb +20 -0
  32. data/app/components/ui_components/daisy_ui/data_display/card/body/context_component.rb +17 -0
  33. data/app/components/ui_components/daisy_ui/data_display/card/body/title_component.rb +20 -0
  34. data/app/components/ui_components/daisy_ui/data_display/card/body_component.rb +34 -0
  35. data/app/components/ui_components/daisy_ui/data_display/card/figure_component.rb +15 -0
  36. data/app/components/ui_components/daisy_ui/data_display/card_component.rb +83 -0
  37. data/app/components/ui_components/daisy_ui/data_display/carousel/indicator_component.rb +18 -0
  38. data/app/components/ui_components/daisy_ui/data_display/carousel/item/passer_component.rb +20 -0
  39. data/app/components/ui_components/daisy_ui/data_display/carousel/item_component.rb +26 -0
  40. data/app/components/ui_components/daisy_ui/data_display/carousel_component.rb +63 -0
  41. data/app/components/ui_components/daisy_ui/data_display/chat/bubble_component.rb +42 -0
  42. data/app/components/ui_components/daisy_ui/data_display/chat/footer_component.rb +18 -0
  43. data/app/components/ui_components/daisy_ui/data_display/chat/header_component.rb +18 -0
  44. data/app/components/ui_components/daisy_ui/data_display/chat_component.rb +58 -0
  45. data/app/components/ui_components/daisy_ui/data_display/countdown/item_component.rb +49 -0
  46. data/app/components/ui_components/daisy_ui/data_display/countdown_component.rb +37 -0
  47. data/app/components/ui_components/daisy_ui/data_display/{accordion/anchor_component.rb → diff/item1_component.rb} +5 -8
  48. data/app/components/ui_components/daisy_ui/data_display/{accordion/body_component.rb → diff/item2_component.rb} +6 -8
  49. data/app/components/ui_components/daisy_ui/data_display/diff/resizer_component.rb +25 -0
  50. data/app/components/ui_components/daisy_ui/data_display/diff_component.rb +35 -0
  51. data/app/components/ui_components/daisy_ui/data_display/kbd_component.rb +40 -0
  52. data/app/components/ui_components/daisy_ui/data_display/list/item_component.rb +40 -0
  53. data/app/components/ui_components/daisy_ui/data_display/list_component.rb +22 -0
  54. data/app/components/ui_components/daisy_ui/data_display/stat/item/action_component.rb +20 -0
  55. data/app/components/ui_components/daisy_ui/data_display/stat/item/description_component.rb +20 -0
  56. data/app/components/ui_components/daisy_ui/data_display/stat/item/figure_component.rb +24 -0
  57. data/app/components/ui_components/daisy_ui/data_display/stat/item/title_component.rb +20 -0
  58. data/app/components/ui_components/daisy_ui/data_display/stat/item/value_component.rb +20 -0
  59. data/app/components/ui_components/daisy_ui/data_display/stat/item_component.rb +39 -0
  60. data/app/components/ui_components/daisy_ui/data_display/stat_component.rb +50 -0
  61. data/app/components/ui_components/daisy_ui/data_display/status_component.rb +59 -0
  62. data/app/components/ui_components/daisy_ui/data_display/table/item/body_component.rb +23 -0
  63. data/app/components/ui_components/daisy_ui/data_display/table/item/foot_component.rb +23 -0
  64. data/app/components/ui_components/daisy_ui/data_display/table/item/head_component.rb +23 -0
  65. data/app/components/ui_components/daisy_ui/data_display/table/item/row/data_component.rb +19 -0
  66. data/app/components/ui_components/daisy_ui/data_display/table/item/row/header_component.rb +19 -0
  67. data/app/components/ui_components/daisy_ui/data_display/table/item/row_component.rb +32 -0
  68. data/app/components/ui_components/daisy_ui/data_display/table/item_component.rb +29 -0
  69. data/app/components/ui_components/daisy_ui/data_display/table_component.rb +72 -0
  70. data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_end_component.rb +44 -0
  71. data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_middle_component.rb +20 -0
  72. data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_start_component.rb +44 -0
  73. data/app/components/ui_components/daisy_ui/data_display/timeline/item/line_component.rb +17 -0
  74. data/app/components/ui_components/daisy_ui/data_display/timeline/item_component.rb +40 -0
  75. data/app/components/ui_components/daisy_ui/data_display/timeline_component.rb +50 -0
  76. data/app/controllers/ui_components/daisy_ui/data_display_components_controller.rb +22 -0
  77. data/app/helpers/data_display/carousel_helper.rb +13 -0
  78. data/app/views/ui_components/daisy_ui/action_components/button.html.erb +35 -33
  79. data/app/views/ui_components/daisy_ui/action_components/dropdown.html.erb +38 -25
  80. data/app/views/ui_components/daisy_ui/action_components/modal.html.erb +31 -18
  81. data/app/views/ui_components/daisy_ui/action_components/swap.html.erb +31 -17
  82. data/app/views/ui_components/daisy_ui/data_display_components/accordion.html.erb +59 -105
  83. data/app/views/ui_components/daisy_ui/data_display_components/avatar.html.erb +40 -27
  84. data/app/views/ui_components/daisy_ui/data_display_components/badge.html.erb +45 -42
  85. data/app/views/ui_components/daisy_ui/data_display_components/card.html.erb +302 -0
  86. data/app/views/ui_components/daisy_ui/data_display_components/carousel.html.erb +303 -0
  87. data/app/views/ui_components/daisy_ui/data_display_components/chat.html.erb +190 -0
  88. data/app/views/ui_components/daisy_ui/data_display_components/countdown.html.erb +211 -0
  89. data/app/views/ui_components/daisy_ui/data_display_components/diff.html.erb +69 -0
  90. data/app/views/ui_components/daisy_ui/data_display_components/kbd.html.erb +157 -0
  91. data/app/views/ui_components/daisy_ui/data_display_components/list.html.erb +247 -0
  92. data/app/views/ui_components/daisy_ui/data_display_components/stat.html.erb +208 -0
  93. data/app/views/ui_components/daisy_ui/data_display_components/status.html.erb +93 -0
  94. data/app/views/ui_components/daisy_ui/data_display_components/table.html.erb +358 -0
  95. data/app/views/ui_components/daisy_ui/data_display_components/timeline.html.erb +431 -0
  96. data/app/views/ui_components/daisy_ui/home/index.html.erb +11 -0
  97. data/config/routes.rb +13 -2
  98. data/lib/tasks/ui_components_tasks.rake +3 -6
  99. data/lib/ui_components/config/daisy_ui_class_names.rb +3 -2
  100. data/lib/ui_components/config/tailwind_class_names.rb +27 -4
  101. data/lib/ui_components/version.rb +1 -1
  102. metadata +65 -7
  103. data/app/components/ui_components/daisy_ui/action/dropdown/card_item_component.rb +0 -29
  104. data/app/components/ui_components/daisy_ui/action/dropdown/list_item_component.rb +0 -30
  105. data/app/components/ui_components/daisy_ui/data_display/avatar/box_component.rb +0 -61
@@ -0,0 +1,303 @@
1
+ <% component = UiComponents::DaisyUi::DataDisplay::CarouselComponent %>
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 > Carousel</h1>
6
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
7
+ <%= link_to "< Card", daisy_ui_card_path, class: "link link-primary m-2" %>
8
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
9
+ <%= link_to "Chat >", daisy_ui_chat_path, class: "link link-primary m-2" %>
10
+ </ul>
11
+ </div>
12
+
13
+ <div class="divider"></div>
14
+
15
+ <% aligns = %w[start center end] %>
16
+
17
+ <% aligns.each do |key| %>
18
+ <%= render DocumentationComponent.new do |doc| %>
19
+ <%= doc.with_header { "# Snap to #{key} #{"(default)" if key == "start"}" } %>
20
+ <%= doc.with_body(preview_options: { css_class: "min-h-[6rem] min-w-2xs max-w-4xl" }) do |body| %>
21
+ <% component_params = data_display_carousel_handle_component_params(key:) %>
22
+
23
+ <%= body.with_preview_example(
24
+ source: <<~ERB
25
+ <$= render #{component}.new#{"(#{component_params})" if component_params.present?} do |carousel| $>
26
+ <$= carousel.with_item do $>
27
+ <img src="https://img.daisyui.com/images/stock/photo-1559703248-dcaaec9fab78.webp" />
28
+ <$ end $>
29
+
30
+ <$= carousel.with_item do $>
31
+ <img src="https://img.daisyui.com/images/stock/photo-1565098772267-60af42b81ef2.webp" />
32
+ <$ end $>
33
+
34
+ <$= carousel.with_item do $>
35
+ <img src="https://img.daisyui.com/images/stock/photo-1572635148818-ef6fd45eb394.webp" />
36
+ <$ end $>
37
+
38
+ <$= carousel.with_item do $>
39
+ <img src="https://img.daisyui.com/images/stock/photo-1494253109108-2e30c049369b.webp" />
40
+ <$ end $>
41
+
42
+ <$= carousel.with_item do $>
43
+ <img src="https://img.daisyui.com/images/stock/photo-1550258987-190a2d41a8ba.webp" />
44
+ <$ end $>
45
+
46
+ <$= carousel.with_item do $>
47
+ <img src="https://img.daisyui.com/images/stock/photo-1559181567-c3190ca9959b.webp" />
48
+ <$ end $>
49
+
50
+ <$= carousel.with_item do $>
51
+ <img src="https://img.daisyui.com/images/stock/photo-1601004890684-d8cbf643f5f2.webp" />
52
+ <$ end $>
53
+ <$ end $>
54
+ ERB
55
+ ) %>
56
+ <% end %>
57
+ <% end %>
58
+ <% end %>
59
+
60
+ <%= render DocumentationComponent.new do |doc| %>
61
+ <%= doc.with_header { "# Carousel with full width items" } %>
62
+ <%= doc.with_body do |body| %>
63
+ <%= body.with_preview_example(
64
+ source: <<~ERB
65
+ <$= render #{component}.new(css_class: "rounded-box w-64") do |carousel| $>
66
+ <$= carousel.with_item(css_class: "w-full") do $>
67
+ <img src="https://img.daisyui.com/images/stock/photo-1559703248-dcaaec9fab78.webp" />
68
+ <$ end $>
69
+
70
+ <$= carousel.with_item(css_class: "w-full") do $>
71
+ <img src="https://img.daisyui.com/images/stock/photo-1565098772267-60af42b81ef2.webp" />
72
+ <$ end $>
73
+
74
+ <$= carousel.with_item(css_class: "w-full") do $>
75
+ <img src="https://img.daisyui.com/images/stock/photo-1572635148818-ef6fd45eb394.webp" />
76
+ <$ end $>
77
+
78
+ <$= carousel.with_item(css_class: "w-full") do $>
79
+ <img src="https://img.daisyui.com/images/stock/photo-1494253109108-2e30c049369b.webp" />
80
+ <$ end $>
81
+
82
+ <$= carousel.with_item(css_class: "w-full") do $>
83
+ <img src="https://img.daisyui.com/images/stock/photo-1550258987-190a2d41a8ba.webp" />
84
+ <$ end $>
85
+
86
+ <$= carousel.with_item(css_class: "w-full") do $>
87
+ <img src="https://img.daisyui.com/images/stock/photo-1559181567-c3190ca9959b.webp" />
88
+ <$ end $>
89
+
90
+ <$= carousel.with_item(css_class: "w-full") do $>
91
+ <img src="https://img.daisyui.com/images/stock/photo-1601004890684-d8cbf643f5f2.webp" />
92
+ <$ end $>
93
+ <$ end $>
94
+ ERB
95
+ ) %>
96
+ <% end %>
97
+ <% end %>
98
+
99
+ <%= render DocumentationComponent.new do |doc| %>
100
+ <%= doc.with_header { "# Vertical carousel" } %>
101
+ <%= doc.with_body do |body| %>
102
+ <%= body.with_preview_example(
103
+ source: <<~ERB
104
+ <$= render #{component}.new(vertical: true, css_class: "rounded-box w-64 h-96") do |carousel| $>
105
+ <$= carousel.with_item(css_class: "w-full h-full") do $>
106
+ <img src="https://img.daisyui.com/images/stock/photo-1559703248-dcaaec9fab78.webp" />
107
+ <$ end $>
108
+
109
+ <$= carousel.with_item(css_class: "w-full h-full") do $>
110
+ <img src="https://img.daisyui.com/images/stock/photo-1565098772267-60af42b81ef2.webp" />
111
+ <$ end $>
112
+
113
+ <$= carousel.with_item(css_class: "w-full h-full") do $>
114
+ <img src="https://img.daisyui.com/images/stock/photo-1572635148818-ef6fd45eb394.webp" />
115
+ <$ end $>
116
+
117
+ <$= carousel.with_item(css_class: "w-full h-full") do $>
118
+ <img src="https://img.daisyui.com/images/stock/photo-1494253109108-2e30c049369b.webp" />
119
+ <$ end $>
120
+
121
+ <$= carousel.with_item(css_class: "w-full h-full") do $>
122
+ <img src="https://img.daisyui.com/images/stock/photo-1550258987-190a2d41a8ba.webp" />
123
+ <$ end $>
124
+
125
+ <$= carousel.with_item(css_class: "w-full h-full") do $>
126
+ <img src="https://img.daisyui.com/images/stock/photo-1559181567-c3190ca9959b.webp" />
127
+ <$ end $>
128
+
129
+ <$= carousel.with_item(css_class: "w-full h-full") do $>
130
+ <img src="https://img.daisyui.com/images/stock/photo-1601004890684-d8cbf643f5f2.webp" />
131
+ <$ end $>
132
+ <$ end $>
133
+ ERB
134
+ ) %>
135
+ <% end %>
136
+ <% end %>
137
+
138
+ <%= render DocumentationComponent.new do |doc| %>
139
+ <%= doc.with_header { "# Carousel with half width items" } %>
140
+ <%= doc.with_body do |body| %>
141
+ <%= body.with_preview_example(
142
+ source: <<~ERB
143
+ <$= render #{component}.new(css_class: "rounded-box w-96") do |carousel| $>
144
+ <$= carousel.with_item(css_class: "w-1/2") do $>
145
+ <img src="https://img.daisyui.com/images/stock/photo-1559703248-dcaaec9fab78.webp" />
146
+ <$ end $>
147
+
148
+ <$= carousel.with_item(css_class: "w-1/2") do $>
149
+ <img src="https://img.daisyui.com/images/stock/photo-1565098772267-60af42b81ef2.webp" />
150
+ <$ end $>
151
+
152
+ <$= carousel.with_item(css_class: "w-1/2") do $>
153
+ <img src="https://img.daisyui.com/images/stock/photo-1572635148818-ef6fd45eb394.webp" />
154
+ <$ end $>
155
+
156
+ <$= carousel.with_item(css_class: "w-1/2") do $>
157
+ <img src="https://img.daisyui.com/images/stock/photo-1494253109108-2e30c049369b.webp" />
158
+ <$ end $>
159
+
160
+ <$= carousel.with_item(css_class: "w-1/2") do $>
161
+ <img src="https://img.daisyui.com/images/stock/photo-1550258987-190a2d41a8ba.webp" />
162
+ <$ end $>
163
+
164
+ <$= carousel.with_item(css_class: "w-1/2") do $>
165
+ <img src="https://img.daisyui.com/images/stock/photo-1559181567-c3190ca9959b.webp" />
166
+ <$ end $>
167
+
168
+ <$= carousel.with_item(css_class: "w-1/2") do $>
169
+ <img src="https://img.daisyui.com/images/stock/photo-1601004890684-d8cbf643f5f2.webp" />
170
+ <$ end $>
171
+ <$ end $>
172
+ ERB
173
+ ) %>
174
+ <% end %>
175
+ <% end %>
176
+
177
+ <%= render DocumentationComponent.new do |doc| %>
178
+ <%= doc.with_header { "# Full-bleed carousel" } %>
179
+ <%= doc.with_body do |body| %>
180
+ <%= body.with_preview_example(
181
+ source: <<~ERB
182
+ <$= render #{component}.new(align: "center", css_class: "rounded-box bg-neutral max-w-md space-x-4 p-4") do |carousel| $>
183
+ <$= carousel.with_item do $>
184
+ <img src="https://img.daisyui.com/images/stock/photo-1559703248-dcaaec9fab78.webp" />
185
+ <$ end $>
186
+
187
+ <$= carousel.with_item do $>
188
+ <img src="https://img.daisyui.com/images/stock/photo-1565098772267-60af42b81ef2.webp" />
189
+ <$ end $>
190
+
191
+ <$= carousel.with_item do $>
192
+ <img src="https://img.daisyui.com/images/stock/photo-1572635148818-ef6fd45eb394.webp" />
193
+ <$ end $>
194
+
195
+ <$= carousel.with_item do $>
196
+ <img src="https://img.daisyui.com/images/stock/photo-1494253109108-2e30c049369b.webp" />
197
+ <$ end $>
198
+
199
+ <$= carousel.with_item do $>
200
+ <img src="https://img.daisyui.com/images/stock/photo-1550258987-190a2d41a8ba.webp" />
201
+ <$ end $>
202
+
203
+ <$= carousel.with_item do $>
204
+ <img src="https://img.daisyui.com/images/stock/photo-1559181567-c3190ca9959b.webp" />
205
+ <$ end $>
206
+
207
+ <$= carousel.with_item do $>
208
+ <img src="https://img.daisyui.com/images/stock/photo-1601004890684-d8cbf643f5f2.webp" />
209
+ <$ end $>
210
+ <$ end $>
211
+ ERB
212
+ ) %>
213
+ <% end %>
214
+ <% end %>
215
+
216
+ <%= render DocumentationComponent.new do |doc| %>
217
+ <%= doc.with_header { "# Carousel with indicator buttons" } %>
218
+ <%= doc.with_body(preview_options: { css_class: "min-h-[6rem] min-w-2xs max-w-4xl" }) do |body| %>
219
+ <%= body.with_preview_example(
220
+ source: <<~ERB
221
+ <$= render #{component}.new(css_class: "w-full") do |carousel| $>
222
+ <$= carousel.with_item(css_class: "w-full", options: { id: "item1" }) do $>
223
+ <img src="https://img.daisyui.com/images/stock/photo-1625726411847-8cbb60cc71e6.webp" class="w-full" />
224
+ <$ end $>
225
+
226
+ <$= carousel.with_item(css_class: "w-full", options: { id: "item2" }) do $>
227
+ <img src="https://img.daisyui.com/images/stock/photo-1609621838510-5ad474b7d25d.webp" class="w-full" />
228
+ <$ end $>
229
+
230
+ <$= carousel.with_item(css_class: "w-full", options: { id: "item3" }) do $>
231
+ <img src="https://img.daisyui.com/images/stock/photo-1414694762283-acccc27bca85.webp" class="w-full" />
232
+ <$ end $>
233
+
234
+ <$= carousel.with_item(css_class: "w-full", options: { id: "item4" }) do $>
235
+ <img src="https://img.daisyui.com/images/stock/photo-1665553365602-b2fb8e5d1707.webp" class="w-full" />
236
+ <$ end $>
237
+
238
+ <$= carousel.with_indicator do $>
239
+ <a href="#item1" class="btn btn-xs">1</a>
240
+ <a href="#item2" class="btn btn-xs">2</a>
241
+ <a href="#item3" class="btn btn-xs">3</a>
242
+ <a href="#item4" class="btn btn-xs">4</a>
243
+ <$ end $>
244
+ <$ end $>
245
+ ERB
246
+ ) %>
247
+ <% end %>
248
+ <% end %>
249
+
250
+ <%= render DocumentationComponent.new do |doc| %>
251
+ <%= doc.with_header { "# Carousel with next/prev buttons" } %>
252
+ <%= doc.with_body(preview_options: { css_class: "min-h-[6rem] min-w-2xs max-w-4xl" }) do |body| %>
253
+ <%= body.with_preview_example(
254
+ source: <<~ERB
255
+ <$= render #{component}.new(css_class: "w-full") do |carousel| $>
256
+ <$= carousel.with_item(css_class: "relative w-full", options: { id: "slide1" }) do |item| $>
257
+ <img src="https://img.daisyui.com/images/stock/photo-1625726411847-8cbb60cc71e6.webp" class="w-full" />
258
+ <$= item.with_passer do $>
259
+ <a href="#slide4" class="btn btn-circle">❮</a>
260
+ <a href="#slide2" class="btn btn-circle">❯</a>
261
+ <$ end $>
262
+ <$ end $>
263
+
264
+ <$= carousel.with_item(css_class: "relative w-full", options: { id: "slide2" }) do |item| $>
265
+ <img src="https://img.daisyui.com/images/stock/photo-1609621838510-5ad474b7d25d.webp" class="w-full" />
266
+ <$= item.with_passer do $>
267
+ <a href="#slide1" class="btn btn-circle">❮</a>
268
+ <a href="#slide3" class="btn btn-circle">❯</a>
269
+ <$ end $>
270
+ <$ end $>
271
+
272
+ <$= carousel.with_item(css_class: "relative w-full", options: { id: "slide3" }) do |item| $>
273
+ <img src="https://img.daisyui.com/images/stock/photo-1414694762283-acccc27bca85.webp" class="w-full" />
274
+ <$= item.with_passer do $>
275
+ <a href="#slide2" class="btn btn-circle">❮</a>
276
+ <a href="#slide4" class="btn btn-circle">❯</a>
277
+ <$ end $>
278
+ <$ end $>
279
+
280
+ <$= carousel.with_item(css_class: "relative w-full", options: { id: "slide4" }) do |item| $>
281
+ <img src="https://img.daisyui.com/images/stock/photo-1665553365602-b2fb8e5d1707.webp" class="w-full" />
282
+ <$= item.with_passer do $>
283
+ <a href="#slide3" class="btn btn-circle">❮</a>
284
+ <a href="#slide1" class="btn btn-circle">❯</a>
285
+ <$ end $>
286
+ <$ end $>
287
+ <$ end $>
288
+ ERB
289
+ ) %>
290
+ <% end %>
291
+ <% end %>
292
+
293
+ <div class="divider"></div>
294
+
295
+ <div class="mb-2">
296
+ <h1 class="font-bold mb-2"># Data display > Carousel</h1>
297
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
298
+ <%= link_to "< Card", daisy_ui_card_path, class: "link link-primary m-2" %>
299
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
300
+ <%= link_to "Chat >", daisy_ui_chat_path, class: "link link-primary m-2" %>
301
+ </ul>
302
+ </div>
303
+ </div>
@@ -0,0 +1,190 @@
1
+ <% component = UiComponents::DaisyUi::DataDisplay::ChatComponent %>
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 > Chat Bubble</h1>
6
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
7
+ <%= link_to "< Carousel", daisy_ui_carousel_path, class: "link link-primary m-2" %>
8
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
9
+ <%= link_to "Countdown >", daisy_ui_countdown_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 { "# chat-start and chat-end" } %>
17
+ <%= doc.with_body(preview_options: { css_class: "p-2 bg-base-200 min-w-2xs max-w-4xl" }) do |body| %>
18
+ <%= body.with_preview_example(
19
+ source: <<~ERB
20
+ <$= render #{component}.new(align: "start") do |chat| $>
21
+ <$= chat.with_bubble do $>
22
+ It's over Anakin,
23
+ <br />
24
+ I have the high ground.
25
+ <$ end $>
26
+ <$ end $>
27
+
28
+ <$= render #{component}.new(align: "end") do |chat| $>
29
+ <$= chat.with_bubble_content("You underestimate my power!") $>
30
+ <$ end $>
31
+ ERB
32
+ ) %>
33
+ <% end %>
34
+ <% end %>
35
+
36
+ <%= render DocumentationComponent.new do |doc| %>
37
+ <%= doc.with_header { "# Chat with image" } %>
38
+ <%= doc.with_body(preview_options: { css_class: "p-2 bg-base-200 min-w-2xs max-w-4xl" }) do |body| %>
39
+ <%= body.with_preview_example(
40
+ source: <<~ERB
41
+ <$= render #{component}.new(align: "start") do |chat| $>
42
+ <$= chat.with_avatar do |item| $>
43
+ <$= item.with_box(css_class: "w-10 rounded-full") do $>
44
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
45
+ <$ end $>
46
+ <$ end $>
47
+
48
+ <$= chat.with_bubble_content("It was said that you would, destroy the Sith, not join them.") $>
49
+ <$ end $>
50
+
51
+ <$= render #{component}.new(align: "start") do |chat| $>
52
+ <$= chat.with_avatar do |item| $>
53
+ <$= item.with_box(css_class: "w-10 rounded-full") do $>
54
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
55
+ <$ end $>
56
+ <$ end $>
57
+
58
+ <$= chat.with_bubble_content("It was you who would bring balance to the Force") $>
59
+ <$ end $>
60
+
61
+ <$= render #{component}.new(align: "start") do |chat| $>
62
+ <$= chat.with_avatar do |item| $>
63
+ <$= item.with_box(css_class: "w-10 rounded-full") do $>
64
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
65
+ <$ end $>
66
+ <$ end $>
67
+
68
+ <$= chat.with_bubble_content("Not leave it in Darkness") $>
69
+ <$ end $>
70
+ ERB
71
+ ) %>
72
+ <% end %>
73
+ <% end %>
74
+
75
+ <%= render DocumentationComponent.new do |doc| %>
76
+ <%= doc.with_header { "# Chat with image, header and footer" } %>
77
+ <%= doc.with_body(preview_options: { css_class: "p-2 bg-base-200 min-w-2xs max-w-4xl" }) do |body| %>
78
+ <%= body.with_preview_example(
79
+ source: <<~ERB
80
+ <$= render #{component}.new(align: "start") do |chat| $>
81
+ <$= chat.with_avatar do |item| $>
82
+ <$= item.with_box(css_class: "w-10 rounded-full") do $>
83
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
84
+ <$ end $>
85
+ <$ end $>
86
+
87
+ <$= chat.with_header do |header| $>
88
+ Obi-Wan Kenobi
89
+ <time class="text-xs opacity-50">12:45</time>
90
+ <$ end $>
91
+
92
+ <$= chat.with_bubble_content("You were the Chosen One!") $>
93
+ <$= chat.with_footer_content("Delivered") $>
94
+ <$ end $>
95
+
96
+ <$= render #{component}.new(align: "end") do |chat| $>
97
+ <$= chat.with_avatar do |item| $>
98
+ <$= item.with_box(css_class: "w-10 rounded-full") do $>
99
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
100
+ <$ end $>
101
+ <$ end $>
102
+
103
+ <$= chat.with_header do |header| $>
104
+ Anakin
105
+ <time class="text-xs opacity-50">12:46</time>
106
+ <$ end $>
107
+
108
+ <$= chat.with_bubble_content("I hate you!") $>
109
+ <$= chat.with_footer_content("Delivered") $>
110
+ <$ end $>
111
+ ERB
112
+ ) %>
113
+ <% end %>
114
+ <% end %>
115
+
116
+ <%= render DocumentationComponent.new do |doc| %>
117
+ <%= doc.with_header { "# Chat with header and footer" } %>
118
+ <%= doc.with_body(preview_options: { css_class: "p-2 bg-base-200 min-w-2xs max-w-4xl" }) do |body| %>
119
+ <%= body.with_preview_example(
120
+ source: <<~ERB
121
+ <$= render #{component}.new(align: "start") do |chat| $>
122
+ <$= chat.with_header do |header| $>
123
+ Obi-Wan Kenobi
124
+ <time class="text-xs opacity-50">2 hours ago</time>
125
+ <$ end $>
126
+
127
+ <$= chat.with_bubble_content("You were my brother, Anakin.") $>
128
+ <$= chat.with_footer_content("Seen") $>
129
+ <$ end $>
130
+
131
+ <$= render #{component}.new(align: "start") do |chat| $>
132
+ <$= chat.with_header do |header| $>
133
+ Obi-Wan Kenobi
134
+ <time class="text-xs opacity-50">2 hours ago</time>
135
+ <$ end $>
136
+
137
+ <$= chat.with_bubble_content("I loved you.") $>
138
+ <$= chat.with_footer_content("Delivered") $>
139
+ <$ end $>
140
+ ERB
141
+ ) %>
142
+ <% end %>
143
+ <% end %>
144
+
145
+ <%= render DocumentationComponent.new do |doc| %>
146
+ <%= doc.with_header { "# Chat Bubble with colors" } %>
147
+ <%= doc.with_body(preview_options: { css_class: "p-2 bg-base-200 min-w-2xs max-w-4xl" }) do |body| %>
148
+ <%= body.with_preview_example(
149
+ source: <<~ERB
150
+ <$= render #{component}.new(align: "start") do |chat| $>
151
+ <$= chat.with_bubble(color: "primary").with_content("What kind of nonsense is this") $>
152
+ <$ end $>
153
+ <$= render #{component}.new(align: "start") do |chat| $>
154
+ <$= chat.with_bubble(color: "secondary").with_content("Put me on the Council and not make me a Master!??") $>
155
+ <$ end $>
156
+ <$= render #{component}.new(align: "start") do |chat| $>
157
+ <$= chat.with_bubble(color: "accent").with_content("That's never been done in the history of the Jedi.") $>
158
+ <$ end $>
159
+ <$= render #{component}.new(align: "start") do |chat| $>
160
+ <$= chat.with_bubble(color: "neutral").with_content("It's insulting!") $>
161
+ <$ end $>
162
+
163
+ <$= render #{component}.new(align: "end") do |chat| $>
164
+ <$= chat.with_bubble(color: "info").with_content("Calm down, Anakin.") $>
165
+ <$ end $>
166
+ <$= render #{component}.new(align: "end") do |chat| $>
167
+ <$= chat.with_bubble(color: "success").with_content("You have been given a great honor.") $>
168
+ <$ end $>
169
+ <$= render #{component}.new(align: "end") do |chat| $>
170
+ <$= chat.with_bubble(color: "warning").with_content("To be on the Council at your age.") $>
171
+ <$ end $>
172
+ <$= render #{component}.new(align: "end") do |chat| $>
173
+ <$= chat.with_bubble(color: "error").with_content("It's never happened before.") $>
174
+ <$ end $>
175
+ ERB
176
+ ) %>
177
+ <% end %>
178
+ <% end %>
179
+
180
+ <div class="divider"></div>
181
+
182
+ <div class="mb-2">
183
+ <h1 class="font-bold mb-2"># Data display > Chat Bubble</h1>
184
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
185
+ <%= link_to "< Carousel", daisy_ui_carousel_path, class: "link link-primary m-2" %>
186
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
187
+ <%= link_to "Countdown >", daisy_ui_countdown_path, class: "link link-primary m-2" %>
188
+ </ul>
189
+ </div>
190
+ </div>