ui_components 0.1.0

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 (64) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +5 -0
  3. data/CODE_OF_CONDUCT.md +132 -0
  4. data/LICENSE.txt +21 -0
  5. data/README.md +43 -0
  6. data/Rakefile +4 -0
  7. data/app/assets/javascripts/ui_components/controllers/clipboard_controller.js +22 -0
  8. data/app/components/documentation/body/example_preview_component.rb +24 -0
  9. data/app/components/documentation/body_component.html.erb +26 -0
  10. data/app/components/documentation/body_component.rb +41 -0
  11. data/app/components/documentation_component.rb +20 -0
  12. data/app/components/ui_components/daisy_ui/action/button_component.rb +83 -0
  13. data/app/components/ui_components/daisy_ui/action/dropdown/anchor_component.rb +35 -0
  14. data/app/components/ui_components/daisy_ui/action/dropdown/card_component.rb +41 -0
  15. data/app/components/ui_components/daisy_ui/action/dropdown/card_item_component.rb +29 -0
  16. data/app/components/ui_components/daisy_ui/action/dropdown/list_item_component.rb +30 -0
  17. data/app/components/ui_components/daisy_ui/action/dropdown/menu_component.rb +40 -0
  18. data/app/components/ui_components/daisy_ui/action/dropdown_component.rb +79 -0
  19. data/app/components/ui_components/daisy_ui/action/modal/anchor_component.rb +43 -0
  20. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action/item_component.rb +33 -0
  21. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action_component.rb +42 -0
  22. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/body_component.rb +31 -0
  23. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/close_component.rb +33 -0
  24. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/title_component.rb +31 -0
  25. data/app/components/ui_components/daisy_ui/action/modal/dialog/box_component.rb +54 -0
  26. data/app/components/ui_components/daisy_ui/action/modal/dialog_component.rb +58 -0
  27. data/app/components/ui_components/daisy_ui/action/modal_component.rb +33 -0
  28. data/app/components/ui_components/daisy_ui/action/swap/off_component.rb +27 -0
  29. data/app/components/ui_components/daisy_ui/action/swap/on_component.rb +27 -0
  30. data/app/components/ui_components/daisy_ui/action/swap_component.rb +59 -0
  31. data/app/components/ui_components/daisy_ui/base_component.rb +41 -0
  32. data/app/components/ui_components/daisy_ui/data_display/accordion/anchor_component.rb +27 -0
  33. data/app/components/ui_components/daisy_ui/data_display/accordion/body_component.rb +27 -0
  34. data/app/components/ui_components/daisy_ui/data_display/accordion/item_component.rb +69 -0
  35. data/app/components/ui_components/daisy_ui/data_display/accordion_component.rb +32 -0
  36. data/app/components/ui_components/daisy_ui/data_display/avatar/box_component.rb +61 -0
  37. data/app/components/ui_components/daisy_ui/data_display/avatar/item_component.rb +62 -0
  38. data/app/components/ui_components/daisy_ui/data_display/avatar_component.rb +21 -0
  39. data/app/components/ui_components/daisy_ui/data_display/badge_component.rb +58 -0
  40. data/app/controllers/ui_components/daisy_ui/action_components_controller.rb +15 -0
  41. data/app/controllers/ui_components/daisy_ui/application_controller.rb +9 -0
  42. data/app/controllers/ui_components/daisy_ui/data_display_components_controller.rb +13 -0
  43. data/app/controllers/ui_components/daisy_ui/home_controller.rb +9 -0
  44. data/app/helpers/action/button_helper.rb +18 -0
  45. data/app/helpers/action/dropdown_helper.rb +19 -0
  46. data/app/helpers/data_display/badge_helper.rb +26 -0
  47. data/app/views/ui_components/daisy_ui/action_components/button.html.erb +114 -0
  48. data/app/views/ui_components/daisy_ui/action_components/dropdown.html.erb +117 -0
  49. data/app/views/ui_components/daisy_ui/action_components/modal.html.erb +73 -0
  50. data/app/views/ui_components/daisy_ui/action_components/swap.html.erb +97 -0
  51. data/app/views/ui_components/daisy_ui/data_display_components/accordion.html.erb +205 -0
  52. data/app/views/ui_components/daisy_ui/data_display_components/avatar.html.erb +261 -0
  53. data/app/views/ui_components/daisy_ui/data_display_components/badge.html.erb +150 -0
  54. data/app/views/ui_components/daisy_ui/home/index.html.erb +20 -0
  55. data/config/routes.rb +22 -0
  56. data/lib/tasks/ui_components_tasks.rake +55 -0
  57. data/lib/ui_components/config/daisy_ui_class_names.rb +33 -0
  58. data/lib/ui_components/config/tailwind_class_names.rb +44 -0
  59. data/lib/ui_components/config.rb +52 -0
  60. data/lib/ui_components/engine.rb +12 -0
  61. data/lib/ui_components/version.rb +5 -0
  62. data/lib/ui_components.rb +9 -0
  63. data/sig/ui_components.rbs +4 -0
  64. metadata +155 -0
@@ -0,0 +1,73 @@
1
+ <% component = UiComponents::DaisyUi::Action::ModalComponent %>
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"># Actions > Modal</h1>
6
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
7
+ <%= link_to "< Dropdown", daisy_ui_dropdown_path, class: "link link-primary m-2" %>
8
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
9
+ <%= link_to "Swap >", daisy_ui_swap_path, class: "link link-primary m-2" %>
10
+ </ul>
11
+ </div>
12
+
13
+ <%= render DocumentationComponent.new do |document| %>
14
+ <%= document.with_header { "# Dialog modal" } %>
15
+ <%= document.with_body do |body| %>
16
+ <%= body.with_preview_example(
17
+ source: <<~ERB
18
+ <$= render #{component}.new(opener: "my_modal_1") do |modal| $>
19
+ <$= modal.with_anchor { "open modal" } $>
20
+ <$= modal.with_dialog do |dialog| $>
21
+ <$= dialog.with_box do |box| $>
22
+ <$= box.with_title { "Hello!" } $>
23
+ <$= box.with_body { "Press ESC key or click the button below to close" } $>
24
+ <$= box.with_action do |action| $>
25
+ <$= action.with_item { "Close" } $>
26
+ <$ end $>
27
+ <$ end $>
28
+ <$ end $>
29
+ <$ end $>
30
+ ERB
31
+ ) %>
32
+ <% end %>
33
+ <% end %>
34
+
35
+ <%= render DocumentationComponent.new do |document| %>
36
+ <%= document.with_header { "# Dialog modal, closes when clicked outside" } %>
37
+ <%= document.with_body do |body| %>
38
+ <%= body.with_preview_example(
39
+ source: <<~ERB
40
+ <$= render #{component}.new(opener: "my_modal_2") do |modal| $>
41
+ <$= modal.with_anchor { "open modal" } $>
42
+ <$= modal.with_dialog(backdrop: true) do |dialog| $>
43
+ <$= dialog.with_box do |box| $>
44
+ <$= box.with_title { "Hello!" } $>
45
+ <$= box.with_body { "Press ESC key or click outside to close" } $>
46
+ <$ end $>
47
+ <$ end $>
48
+ <$ end $>
49
+ ERB
50
+ ) %>
51
+ <% end %>
52
+ <% end %>
53
+
54
+ <%= render DocumentationComponent.new do |document| %>
55
+ <%= document.with_header { "# Dialog modal with a close button at corner" } %>
56
+ <%= document.with_body do |body| %>
57
+ <%= body.with_preview_example(
58
+ source: <<~ERB
59
+ <$= render #{component}.new(opener: "my_modal_3") do |modal| $>
60
+ <$= modal.with_anchor { "open modal" } $>
61
+ <$= modal.with_dialog do |dialog| $>
62
+ <$= dialog.with_box do |box| $>
63
+ <$= box.with_title { "Hello!" } $>
64
+ <$= box.with_body { "Press ESC key or click on ✕ button to close" } $>
65
+ <$= box.with_close { "X" } $>
66
+ <$ end $>
67
+ <$ end $>
68
+ <$ end $>
69
+ ERB
70
+ ) %>
71
+ <% end %>
72
+ <% end %>
73
+ </div>
@@ -0,0 +1,97 @@
1
+ <% component = UiComponents::DaisyUi::Action::SwapComponent %>
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"># Actions > Swap</h1>
6
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
7
+ <%= link_to "< Modal", daisy_ui_modal_path, class: "link link-primary m-2" %>
8
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
9
+ </ul>
10
+ </div>
11
+
12
+ <%= render DocumentationComponent.new do |document| %>
13
+ <%= document.with_header { "# Swap text" } %>
14
+ <%= document.with_body do |body| %>
15
+ <%= body.with_preview_example(
16
+ source: <<~ERB
17
+ <$= render #{component}.new do |swap| $>
18
+ <$= swap.with_on { "ON" } $>
19
+ <$= swap.with_off { "OFF" } $>
20
+ <$ end $>
21
+ ERB
22
+ ) %>
23
+ <% end %>
24
+ <% end %>
25
+
26
+ <%= render DocumentationComponent.new do |document| %>
27
+ <%= document.with_header { "# Swap volume icons" } %>
28
+ <%= document.with_body do |body| %>
29
+ <%= body.with_preview_example(
30
+ source: <<~ERB
31
+ <$= render #{component}.new do |swap| $>
32
+ <$= swap.with_on do $>
33
+ <svg class="h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="M560-131v-82q90-26 145-100t55-168q0-94-55-168T560-749v-82q124 28 202 125.5T840-481q0 127-78 224.5T560-131ZM120-360v-240h160l200-200v640L280-360H120Zm440 40v-322q47 22 73.5 66t26.5 96q0 51-26.5 94.5T560-320Z"/></svg>
34
+ <$ end $>
35
+ <$= swap.with_off do $>
36
+ <svg class="h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="m616-320-56-56 104-104-104-104 56-56 104 104 104-104 56 56-104 104 104 104-56 56-104-104-104 104Zm-496-40v-240h160l200-200v640L280-360H120Z"/></svg>
37
+ <$ end $>
38
+ <$ end $>
39
+ ERB
40
+ ) %>
41
+ <% end %>
42
+ <% end %>
43
+
44
+ <%= render DocumentationComponent.new do |document| %>
45
+ <%= document.with_header { "# Swap icons with rotate effect" } %>
46
+ <%= document.with_body do |body| %>
47
+ <%= body.with_preview_example(
48
+ source: <<~ERB
49
+ <$= render #{component}.new(effect: "rotate") do |swap| $>
50
+ <$= swap.with_on do $>
51
+ <svg class="h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="M440-800v-120h80v120h-80Zm0 760v-120h80v120h-80Zm360-400v-80h120v80H800Zm-760 0v-80h120v80H40Zm708-252-56-56 70-72 58 58-72 70ZM198-140l-58-58 72-70 56 56-70 72Zm564 0-70-72 56-56 72 70-58 58ZM212-692l-72-70 58-58 70 72-56 56Zm268 452q-100 0-170-70t-70-170q0-100 70-170t170-70q100 0 170 70t70 170q0 100-70 170t-170 70Zm0-80q67 0 113.5-46.5T640-480q0-67-46.5-113.5T480-640q-67 0-113.5 46.5T320-480q0 67 46.5 113.5T480-320Zm0-160Z"/></svg>
52
+ <$ end $>
53
+ <$= swap.with_off do $>
54
+ <svg class="h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="M480-120q-150 0-255-105T120-480q0-150 105-255t255-105q14 0 27.5 1t26.5 3q-41 29-65.5 75.5T444-660q0 90 63 153t153 63q55 0 101-24.5t75-65.5q2 13 3 26.5t1 27.5q0 150-105 255T480-120Zm0-80q88 0 158-48.5T740-375q-20 5-40 8t-40 3q-123 0-209.5-86.5T364-660q0-20 3-40t8-40q-78 32-126.5 102T200-480q0 116 82 198t198 82Zm-10-270Z"/></svg>
55
+ <$ end $>
56
+ <$ end $>
57
+ ERB
58
+ ) %>
59
+ <% end %>
60
+ <% end %>
61
+
62
+ <%= render DocumentationComponent.new do |document| %>
63
+ <%= document.with_header { "# Swap icons with flip effect" } %>
64
+ <%= document.with_body do |body| %>
65
+ <%= body.with_preview_example(
66
+ source: <<~ERB
67
+ <$= render #{component}.new(effect: "flip") do |swap| $>
68
+ <$= swap.with_on do $>
69
+ <svg class="h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="M620-520q25 0 42.5-17.5T680-580q0-25-17.5-42.5T620-640q-25 0-42.5 17.5T560-580q0 25 17.5 42.5T620-520Zm-280 0q25 0 42.5-17.5T400-580q0-25-17.5-42.5T340-640q-25 0-42.5 17.5T280-580q0 25 17.5 42.5T340-520Zm140 260q68 0 123.5-38.5T684-400h-66q-22 37-58.5 58.5T480-320q-43 0-79.5-21.5T342-400h-66q25 63 80.5 101.5T480-260Zm0 180q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"/></svg>
70
+ <$ end $>
71
+ <$= swap.with_off do $>
72
+ <svg class="h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="M620-520q25 0 42.5-17.5T680-580q0-25-17.5-42.5T620-640q-25 0-42.5 17.5T560-580q0 25 17.5 42.5T620-520Zm-280 0q25 0 42.5-17.5T400-580q0-25-17.5-42.5T340-640q-25 0-42.5 17.5T280-580q0 25 17.5 42.5T340-520Zm140 100q-68 0-123.5 38.5T276-280h66q22-37 58.5-58.5T480-360q43 0 79.5 21.5T618-280h66q-25-63-80.5-101.5T480-420Zm0 340q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"/></svg>
73
+ <$ end $>
74
+ <$ end $>
75
+ ERB
76
+ ) %>
77
+ <% end %>
78
+ <% end %>
79
+
80
+ <%= render DocumentationComponent.new do |document| %>
81
+ <%= document.with_header { "# Activate using class name instead of checkbox" } %>
82
+ <%= document.with_body do |body| %>
83
+ <%= body.with_preview_example(
84
+ source: <<~ERB
85
+ <$= render #{component}.new(active: true) do |swap| $>
86
+ <$= swap.with_on do $>
87
+ <svg class="h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="M620-520q25 0 42.5-17.5T680-580q0-25-17.5-42.5T620-640q-25 0-42.5 17.5T560-580q0 25 17.5 42.5T620-520Zm-280 0q25 0 42.5-17.5T400-580q0-25-17.5-42.5T340-640q-25 0-42.5 17.5T280-580q0 25 17.5 42.5T340-520Zm140 260q68 0 123.5-38.5T684-400h-66q-22 37-58.5 58.5T480-320q-43 0-79.5-21.5T342-400h-66q25 63 80.5 101.5T480-260Zm0 180q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"/></svg>
88
+ <$ end $>
89
+ <$= swap.with_off do $>
90
+ <svg class="h-10 w-10 fill-current" xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="#e3e3e3"><path d="M620-520q25 0 42.5-17.5T680-580q0-25-17.5-42.5T620-640q-25 0-42.5 17.5T560-580q0 25 17.5 42.5T620-520Zm-280 0q25 0 42.5-17.5T400-580q0-25-17.5-42.5T340-640q-25 0-42.5 17.5T280-580q0 25 17.5 42.5T340-520Zm140 100q-68 0-123.5 38.5T276-280h66q22-37 58.5-58.5T480-360q43 0 79.5 21.5T618-280h66q-25-63-80.5-101.5T480-420Zm0 340q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"/></svg>
91
+ <$ end $>
92
+ <$ end $>
93
+ ERB
94
+ ) %>
95
+ <% end %>
96
+ <% end %>
97
+ </div>
@@ -0,0 +1,205 @@
1
+ <% component = UiComponents::DaisyUi::DataDisplay::AccordionComponent %>
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 > Accordion</h1>
6
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
7
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
8
+ <%= link_to "Avatar >", daisy_ui_avatar_path, class: "link link-primary m-2" %>
9
+ </ul>
10
+ </div>
11
+
12
+ <%= render DocumentationComponent.new do |document| %>
13
+ <%= document.with_header { "# Accordion using radio inputs" } %>
14
+ <%= document.with_body do |body| %>
15
+ <%= body.with_preview_example(
16
+ source: <<~ERB
17
+ <$= render #{component}.new do |accordion| $>
18
+ <$= accordion.with_item do |item| $>
19
+ <$ item.with_anchor do $>
20
+ How do I create an account?
21
+ <$ end $>
22
+ <$ item.with_body do $>
23
+ Click the "Sign Up" button in the top right corner and follow the registration process.
24
+ <$ end $>
25
+ <$ end $>
26
+
27
+ <$= accordion.with_item do |item| $>
28
+ <$ item.with_anchor do $>
29
+ I forgot my password. What should I do?
30
+ <$ end $>
31
+ <$ item.with_body do $>
32
+ Click on "Forgot Password" on the login page and follow the instructions sent to your email.
33
+ <$ end $>
34
+ <$ end $>
35
+
36
+ <$= accordion.with_item do |item| $>
37
+ <$ item.with_anchor do $>
38
+ How do I update my profile information?
39
+ <$ end $>
40
+ <$ item.with_body do $>
41
+ Go to "My Account" settings and select "Edit Profile" to make changes.
42
+ <$ end $>
43
+ <$ end $>
44
+ <$ end $>
45
+ ERB
46
+ ) %>
47
+ <% end %>
48
+ <% end %>
49
+
50
+ <% icons = %w[arrow plus] %>
51
+
52
+ <% icons.each_with_index do |key, index| %>
53
+ <%= render DocumentationComponent.new do |document| %>
54
+ <%= document.with_header { "# Accordion with #{key == "plus" ? "plus/minus" : key} icon" } %>
55
+ <%= document.with_body do |body| %>
56
+ <%= body.with_preview_example(
57
+ source: <<~ERB
58
+ <$= render #{component}.new(opener: "my_accordion_#{index+1}") do |accordion| $>
59
+ <$= accordion.with_item(icon: "#{key}") do |item| $>
60
+ <$ item.with_anchor do $>
61
+ How do I create an account?
62
+ <$ end $>
63
+ <$ item.with_body do $>
64
+ Click the "Sign Up" button in the top right corner and follow the registration process.
65
+ <$ end $>
66
+ <$ end $>
67
+
68
+ <$= accordion.with_item(icon: "#{key}") do |item| $>
69
+ <$ item.with_anchor do $>
70
+ I forgot my password. What should I do?
71
+ <$ end $>
72
+ <$ item.with_body do $>
73
+ Click on "Forgot Password" on the login page and follow the instructions sent to your email.
74
+ <$ end $>
75
+ <$ end $>
76
+
77
+ <$= accordion.with_item(icon: "#{key}") do |item| $>
78
+ <$ item.with_anchor do $>
79
+ How do I update my profile information?
80
+ <$ end $>
81
+ <$ item.with_body do $>
82
+ Go to "My Account" settings and select "Edit Profile" to make changes.
83
+ <$ end $>
84
+ <$ end $>
85
+ <$ end $>
86
+ ERB
87
+ ) %>
88
+ <% end %>
89
+ <% end %>
90
+ <% end %>
91
+
92
+ <%= render DocumentationComponent.new do |document| %>
93
+ <%= document.with_header { "# Accordion using checkbox inputs" } %>
94
+ <%= document.with_body do |body| %>
95
+ <%= body.with_preview_example(
96
+ source: <<~ERB
97
+ <$= render #{component}.new(opener: "my_accordion_3", toggle: true) do |accordion| $>
98
+ <$= accordion.with_item do |item| $>
99
+ <$ item.with_anchor do $>
100
+ How do I create an account?
101
+ <$ end $>
102
+ <$ item.with_body do $>
103
+ Click the "Sign Up" button in the top right corner and follow the registration process.
104
+ <$ end $>
105
+ <$ end $>
106
+
107
+ <$= accordion.with_item do |item| $>
108
+ <$ item.with_anchor do $>
109
+ I forgot my password. What should I do?
110
+ <$ end $>
111
+ <$ item.with_body do $>
112
+ Click on "Forgot Password" on the login page and follow the instructions sent to your email.
113
+ <$ end $>
114
+ <$ end $>
115
+
116
+ <$= accordion.with_item do |item| $>
117
+ <$ item.with_anchor do $>
118
+ How do I update my profile information?
119
+ <$ end $>
120
+ <$ item.with_body do $>
121
+ Go to "My Account" settings and select "Edit Profile" to make changes.
122
+ <$ end $>
123
+ <$ end $>
124
+ <$ end $>
125
+ ERB
126
+ ) %>
127
+ <% end %>
128
+ <% end %>
129
+
130
+ <%= render DocumentationComponent.new do |document| %>
131
+ <%= document.with_header { "# Accordion opened" } %>
132
+ <%= document.with_body do |body| %>
133
+ <%= body.with_preview_example(
134
+ source: <<~ERB
135
+ <$= render #{component}.new(opener: "my_accordion_4") do |accordion| $>
136
+ <$= accordion.with_item(opened: true) do |item| $>
137
+ <$ item.with_anchor do $>
138
+ How do I create an account?
139
+ <$ end $>
140
+ <$ item.with_body do $>
141
+ Click the "Sign Up" button in the top right corner and follow the registration process.
142
+ <$ end $>
143
+ <$ end $>
144
+
145
+ <$= accordion.with_item do |item| $>
146
+ <$ item.with_anchor do $>
147
+ I forgot my password. What should I do?
148
+ <$ end $>
149
+ <$ item.with_body do $>
150
+ Click on "Forgot Password" on the login page and follow the instructions sent to your email.
151
+ <$ end $>
152
+ <$ end $>
153
+
154
+ <$= accordion.with_item do |item| $>
155
+ <$ item.with_anchor do $>
156
+ How do I update my profile information?
157
+ <$ end $>
158
+ <$ item.with_body do $>
159
+ Go to "My Account" settings and select "Edit Profile" to make changes.
160
+ <$ end $>
161
+ <$ end $>
162
+ <$ end $>
163
+ ERB
164
+ ) %>
165
+ <% end %>
166
+ <% end %>
167
+
168
+ <%= render DocumentationComponent.new do |document| %>
169
+ <%= document.with_header { "# Using Accordion and Join together" } %>
170
+ <%= document.with_body do |body| %>
171
+ <%= body.with_preview_example(
172
+ source: <<~ERB
173
+ <$= render #{component}.new(opener: "my_accordion_5", css_class: "join join-vertical bg-base-100") do |accordion| $>
174
+ <$= accordion.with_item(css_class: "join-item") do |item| $>
175
+ <$ item.with_anchor do $>
176
+ How do I create an account?
177
+ <$ end $>
178
+ <$ item.with_body do $>
179
+ Click the "Sign Up" button in the top right corner and follow the registration process.
180
+ <$ end $>
181
+ <$ end $>
182
+
183
+ <$= accordion.with_item(css_class: "join-item") do |item| $>
184
+ <$ item.with_anchor do $>
185
+ I forgot my password. What should I do?
186
+ <$ end $>
187
+ <$ item.with_body do $>
188
+ Click on "Forgot Password" on the login page and follow the instructions sent to your email.
189
+ <$ end $>
190
+ <$ end $>
191
+
192
+ <$= accordion.with_item(css_class: "join-item") do |item| $>
193
+ <$ item.with_anchor do $>
194
+ How do I update my profile information?
195
+ <$ end $>
196
+ <$ item.with_body do $>
197
+ Go to "My Account" settings and select "Edit Profile" to make changes.
198
+ <$ end $>
199
+ <$ end $>
200
+ <$ end $>
201
+ ERB
202
+ ) %>
203
+ <% end %>
204
+ <% end %>
205
+ </div>
@@ -0,0 +1,261 @@
1
+ <% component = UiComponents::DaisyUi::DataDisplay::AvatarComponent %>
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 > Avatar</h1>
6
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
7
+ <%= link_to "< Accordion", daisy_ui_accordion_path, class: "link link-primary m-2" %>
8
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
9
+ <%= link_to "Badge >", daisy_ui_badge_path, class: "link link-primary m-2" %>
10
+ </ul>
11
+ </div>
12
+
13
+ <%= render DocumentationComponent.new do |document| %>
14
+ <%= document.with_header { "# Avatar" } %>
15
+ <%= document.with_body do |body| %>
16
+ <%= body.with_preview_example(
17
+ source: <<~ERB
18
+ <$= render #{component}.new do |avatar| $>
19
+ <$= avatar.with_item do |item| $>
20
+ <$= item.with_box(css_class: "rounded") do $>
21
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
22
+ <$ end $>
23
+ <$ end $>
24
+ <$ end $>
25
+ ERB
26
+ ) %>
27
+ <% end %>
28
+ <% end %>
29
+
30
+ <%= render DocumentationComponent.new do |document| %>
31
+ <%= document.with_header { "# Avatar in custom sizes" } %>
32
+ <%= document.with_body do |body| %>
33
+ <%= body.with_preview_example(
34
+ source: <<~ERB
35
+ <$= render #{component}.new do |avatar| $>
36
+ <$= avatar.with_item do |item| $>
37
+ <$= item.with_box(css_class: "rounded w-32") do $>
38
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
39
+ <$ end $>
40
+ <$ end $>
41
+
42
+ <$= avatar.with_item do |item| $>
43
+ <$= item.with_box(css_class: "rounded w-20") do $>
44
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
45
+ <$ end $>
46
+ <$ end $>
47
+
48
+ <$= avatar.with_item do |item| $>
49
+ <$= item.with_box(css_class: "rounded w-16") do $>
50
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
51
+ <$ end $>
52
+ <$ end $>
53
+
54
+ <$= avatar.with_item do |item| $>
55
+ <$= item.with_box(css_class: "rounded w-8") do $>
56
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
57
+ <$ end $>
58
+ <$ end $>
59
+ <$ end $>
60
+ ERB
61
+ ) %>
62
+ <% end %>
63
+ <% end %>
64
+
65
+ <%= render DocumentationComponent.new do |document| %>
66
+ <%= document.with_header { "# Avatar rounded" } %>
67
+ <%= document.with_body do |body| %>
68
+ <%= body.with_preview_example(
69
+ source: <<~ERB
70
+ <$= render #{component}.new do |avatar| $>
71
+ <$= avatar.with_item do |item| $>
72
+ <$= item.with_box(css_class: "rounded-xl") do $>
73
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
74
+ <$ end $>
75
+ <$ end $>
76
+
77
+ <$= avatar.with_item do |item| $>
78
+ <$= item.with_box(css_class: "rounded-full") do $>
79
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
80
+ <$ end $>
81
+ <$ end $>
82
+ <$ end $>
83
+ ERB
84
+ ) %>
85
+ <% end %>
86
+ <% end %>
87
+
88
+ <%= render DocumentationComponent.new do |document| %>
89
+ <%= document.with_header { "# Avatar with mask" } %>
90
+ <%= document.with_body do |body| %>
91
+ <%= body.with_preview_example(
92
+ source: <<~ERB
93
+ <$= render #{component}.new do |avatar| $>
94
+ <$= avatar.with_item do |item| $>
95
+ <$= item.with_box(mask: "squircle") do $>
96
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
97
+ <$ end $>
98
+ <$ end $>
99
+
100
+ <$= avatar.with_item do |item| $>
101
+ <$= item.with_box(mask: "hexagon") do $>
102
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
103
+ <$ end $>
104
+ <$ end $>
105
+
106
+ <$= avatar.with_item do |item| $>
107
+ <$= item.with_box(mask: "triangle") do $>
108
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
109
+ <$ end $>
110
+ <$ end $>
111
+ <$ end $>
112
+ ERB
113
+ ) %>
114
+ <% end %>
115
+ <% end %>
116
+
117
+ <%= render DocumentationComponent.new do |document| %>
118
+ <%= document.with_header { "# Avatar group" } %>
119
+ <%= document.with_body do |body| %>
120
+ <%= body.with_preview_example(
121
+ source: <<~ERB
122
+ <$= render #{component}.new(css_class: "avatar-group -space-x-6") do |avatar| $>
123
+ <$= avatar.with_item do |item| $>
124
+ <$= item.with_box(css_class: "w-12") do $>
125
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
126
+ <$ end $>
127
+ <$ end $>
128
+
129
+ <$= avatar.with_item do |item| $>
130
+ <$= item.with_box(css_class: "w-12") do $>
131
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
132
+ <$ end $>
133
+ <$ end $>
134
+
135
+ <$= avatar.with_item do |item| $>
136
+ <$= item.with_box(css_class: "w-12") do $>
137
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
138
+ <$ end $>
139
+ <$ end $>
140
+
141
+ <$= avatar.with_item do |item| $>
142
+ <$= item.with_box(css_class: "w-12") do $>
143
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
144
+ <$ end $>
145
+ <$ end $>
146
+ <$ end $>
147
+ ERB
148
+ ) %>
149
+ <% end %>
150
+ <% end %>
151
+
152
+ <%= render DocumentationComponent.new do |document| %>
153
+ <%= document.with_header { "# Avatar group with counter" } %>
154
+ <%= document.with_body do |body| %>
155
+ <%= body.with_preview_example(
156
+ source: <<~ERB
157
+ <$= render #{component}.new(css_class: "avatar-group -space-x-6") do |avatar| $>
158
+ <$= avatar.with_item do |item| $>
159
+ <$= item.with_box(css_class: "w-12") do $>
160
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
161
+ <$ end $>
162
+ <$ end $>
163
+
164
+ <$= avatar.with_item do |item| $>
165
+ <$= item.with_box(css_class: "w-12") do $>
166
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
167
+ <$ end $>
168
+ <$ end $>
169
+
170
+ <$= avatar.with_item do |item| $>
171
+ <$= item.with_box(css_class: "w-12") do $>
172
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
173
+ <$ end $>
174
+ <$ end $>
175
+
176
+ <$= avatar.with_item(placeholder: true) do |item| $>
177
+ <$= item.with_box(css_class: "w-12") do $>
178
+ <span>+99</span>
179
+ <$ end $>
180
+ <$ end $>
181
+ <$ end $>
182
+ ERB
183
+ ) %>
184
+ <% end %>
185
+ <% end %>
186
+
187
+ <%= render DocumentationComponent.new do |document| %>
188
+ <%= document.with_header { "# Avatar with ring" } %>
189
+ <%= document.with_body do |body| %>
190
+ <%= body.with_preview_example(
191
+ source: <<~ERB
192
+ <$= render #{component}.new do |avatar| $>
193
+ <$= avatar.with_item do |item| $>
194
+ <$= item.with_box(with_ring: true, css_class: "rounded-full") do $>
195
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
196
+ <$ end $>
197
+ <$ end $>
198
+ <$ end $>
199
+ ERB
200
+ ) %>
201
+ <% end %>
202
+ <% end %>
203
+
204
+ <%= render DocumentationComponent.new do |document| %>
205
+ <%= document.with_header { "# Avatar with presence indicator" } %>
206
+ <%= document.with_body do |body| %>
207
+ <%= body.with_preview_example(
208
+ source: <<~ERB
209
+ <$= render #{component}.new do |avatar| $>
210
+ <$= avatar.with_item(status: "online") do |item| $>
211
+ <$= item.with_box(css_class: "rounded-full") do $>
212
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
213
+ <$ end $>
214
+ <$ end $>
215
+
216
+ <$= avatar.with_item(status: "offline") do |item| $>
217
+ <$= item.with_box(css_class: "rounded-full") do $>
218
+ <img src="https://img.daisyui.com/images/stock/photo-1534528741775-53994a69daeb.webp" />
219
+ <$ end $>
220
+ <$ end $>
221
+ <$ end $>
222
+ ERB
223
+ ) %>
224
+ <% end %>
225
+ <% end %>
226
+
227
+ <%= render DocumentationComponent.new do |document| %>
228
+ <%= document.with_header { "# Avatar placeholder" } %>
229
+ <%= document.with_body do |body| %>
230
+ <%= body.with_preview_example(
231
+ source: <<~ERB
232
+ <$= render #{component}.new do |avatar| $>
233
+ <$= avatar.with_item(placeholder: true) do |item| $>
234
+ <$= item.with_box(css_class: "rounded-full") do $>
235
+ <span class="text-3xl">D</span>
236
+ <$ end $>
237
+ <$ end $>
238
+
239
+ <$= avatar.with_item(placeholder: true, status: "online") do |item| $>
240
+ <$= item.with_box(css_class: "rounded-full w-16") do $>
241
+ <span class="text-xl">AI</span>
242
+ <$ end $>
243
+ <$ end $>
244
+
245
+ <$= avatar.with_item(placeholder: true) do |item| $>
246
+ <$= item.with_box(css_class: "rounded-full w-12") do $>
247
+ <span>SY</span>
248
+ <$ end $>
249
+ <$ end $>
250
+
251
+ <$= avatar.with_item(placeholder: true) do |item| $>
252
+ <$= item.with_box(css_class: "rounded-full w-8") do $>
253
+ <span class="text-xs">UI</span>
254
+ <$ end $>
255
+ <$ end $>
256
+ <$ end $>
257
+ ERB
258
+ ) %>
259
+ <% end %>
260
+ <% end %>
261
+ </div>