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.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +18 -11
  3. data/app/assets/javascripts/ui_components/controllers/countdown_controller.js +55 -0
  4. data/app/components/documentation/body/example_preview_component.rb +1 -1
  5. data/app/components/documentation/body_component.html.erb +1 -1
  6. data/app/components/documentation/body_component.rb +4 -4
  7. data/app/components/ui_components/daisy_ui/action/button_component.rb +13 -13
  8. data/app/components/ui_components/daisy_ui/action/dropdown/anchor_component.rb +1 -11
  9. data/app/components/ui_components/daisy_ui/action/dropdown/card/item_component.rb +20 -0
  10. data/app/components/ui_components/daisy_ui/action/dropdown/card_component.rb +4 -14
  11. data/app/components/ui_components/daisy_ui/action/dropdown/menu/item_component.rb +32 -0
  12. data/app/components/ui_components/daisy_ui/action/dropdown/menu_component.rb +2 -12
  13. data/app/components/ui_components/daisy_ui/action/dropdown_component.rb +12 -12
  14. data/app/components/ui_components/daisy_ui/action/modal/anchor_component.rb +1 -11
  15. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action/item_component.rb +0 -9
  16. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/action_component.rb +0 -9
  17. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/body_component.rb +0 -9
  18. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/close_component.rb +0 -9
  19. data/app/components/ui_components/daisy_ui/action/modal/dialog/box/title_component.rb +0 -9
  20. data/app/components/ui_components/daisy_ui/action/modal/dialog/box_component.rb +0 -9
  21. data/app/components/ui_components/daisy_ui/action/modal/dialog_component.rb +2 -12
  22. data/app/components/ui_components/daisy_ui/action/swap/off_component.rb +0 -9
  23. data/app/components/ui_components/daisy_ui/action/swap/on_component.rb +0 -9
  24. data/app/components/ui_components/daisy_ui/action/swap_component.rb +6 -6
  25. data/app/components/ui_components/daisy_ui/base_component.rb +24 -3
  26. data/app/components/ui_components/daisy_ui/data_display/accordion/item/anchor_component.rb +20 -0
  27. data/app/components/ui_components/daisy_ui/data_display/accordion/item/body_component.rb +20 -0
  28. data/app/components/ui_components/daisy_ui/data_display/accordion/item_component.rb +15 -15
  29. data/app/components/ui_components/daisy_ui/data_display/avatar/item/box_component.rb +63 -0
  30. data/app/components/ui_components/daisy_ui/data_display/avatar/item_component.rb +8 -8
  31. data/app/components/ui_components/daisy_ui/data_display/badge_component.rb +7 -7
  32. data/app/components/ui_components/daisy_ui/data_display/card/body/action_component.rb +20 -0
  33. data/app/components/ui_components/daisy_ui/data_display/card/body/context_component.rb +17 -0
  34. data/app/components/ui_components/daisy_ui/data_display/card/body/title_component.rb +20 -0
  35. data/app/components/ui_components/daisy_ui/data_display/card/body_component.rb +34 -0
  36. data/app/components/ui_components/daisy_ui/data_display/card/figure_component.rb +15 -0
  37. data/app/components/ui_components/daisy_ui/data_display/card_component.rb +83 -0
  38. data/app/components/ui_components/daisy_ui/data_display/carousel/indicator_component.rb +18 -0
  39. data/app/components/ui_components/daisy_ui/data_display/carousel/item/passer_component.rb +20 -0
  40. data/app/components/ui_components/daisy_ui/data_display/carousel/item_component.rb +26 -0
  41. data/app/components/ui_components/daisy_ui/data_display/carousel_component.rb +63 -0
  42. data/app/components/ui_components/daisy_ui/data_display/chat/bubble_component.rb +42 -0
  43. data/app/components/ui_components/daisy_ui/data_display/chat/footer_component.rb +18 -0
  44. data/app/components/ui_components/daisy_ui/data_display/chat/header_component.rb +18 -0
  45. data/app/components/ui_components/daisy_ui/data_display/chat_component.rb +58 -0
  46. data/app/components/ui_components/daisy_ui/data_display/countdown/item_component.rb +49 -0
  47. data/app/components/ui_components/daisy_ui/data_display/countdown_component.rb +37 -0
  48. data/app/components/ui_components/daisy_ui/data_display/{accordion/anchor_component.rb → diff/item1_component.rb} +5 -8
  49. data/app/components/ui_components/daisy_ui/data_display/{accordion/body_component.rb → diff/item2_component.rb} +6 -8
  50. data/app/components/ui_components/daisy_ui/data_display/diff/resizer_component.rb +25 -0
  51. data/app/components/ui_components/daisy_ui/data_display/diff_component.rb +35 -0
  52. data/app/components/ui_components/daisy_ui/data_display/kbd_component.rb +40 -0
  53. data/app/components/ui_components/daisy_ui/data_display/list/item_component.rb +40 -0
  54. data/app/components/ui_components/daisy_ui/data_display/list_component.rb +22 -0
  55. data/app/components/ui_components/daisy_ui/data_display/stat/item/action_component.rb +20 -0
  56. data/app/components/ui_components/daisy_ui/data_display/stat/item/description_component.rb +20 -0
  57. data/app/components/ui_components/daisy_ui/data_display/stat/item/figure_component.rb +24 -0
  58. data/app/components/ui_components/daisy_ui/data_display/stat/item/title_component.rb +20 -0
  59. data/app/components/ui_components/daisy_ui/data_display/stat/item/value_component.rb +20 -0
  60. data/app/components/ui_components/daisy_ui/data_display/stat/item_component.rb +39 -0
  61. data/app/components/ui_components/daisy_ui/data_display/stat_component.rb +50 -0
  62. data/app/components/ui_components/daisy_ui/data_display/status_component.rb +59 -0
  63. data/app/components/ui_components/daisy_ui/data_display/table/item/body_component.rb +23 -0
  64. data/app/components/ui_components/daisy_ui/data_display/table/item/foot_component.rb +23 -0
  65. data/app/components/ui_components/daisy_ui/data_display/table/item/head_component.rb +23 -0
  66. data/app/components/ui_components/daisy_ui/data_display/table/item/row/data_component.rb +19 -0
  67. data/app/components/ui_components/daisy_ui/data_display/table/item/row/header_component.rb +19 -0
  68. data/app/components/ui_components/daisy_ui/data_display/table/item/row_component.rb +32 -0
  69. data/app/components/ui_components/daisy_ui/data_display/table/item_component.rb +29 -0
  70. data/app/components/ui_components/daisy_ui/data_display/table_component.rb +72 -0
  71. data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_end_component.rb +44 -0
  72. data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_middle_component.rb +20 -0
  73. data/app/components/ui_components/daisy_ui/data_display/timeline/item/item_start_component.rb +44 -0
  74. data/app/components/ui_components/daisy_ui/data_display/timeline/item/line_component.rb +17 -0
  75. data/app/components/ui_components/daisy_ui/data_display/timeline/item_component.rb +40 -0
  76. data/app/components/ui_components/daisy_ui/data_display/timeline_component.rb +50 -0
  77. data/app/controllers/ui_components/daisy_ui/data_display_components_controller.rb +22 -0
  78. data/app/helpers/data_display/carousel_helper.rb +13 -0
  79. data/app/views/ui_components/daisy_ui/action_components/button.html.erb +35 -33
  80. data/app/views/ui_components/daisy_ui/action_components/dropdown.html.erb +38 -25
  81. data/app/views/ui_components/daisy_ui/action_components/modal.html.erb +31 -18
  82. data/app/views/ui_components/daisy_ui/action_components/swap.html.erb +31 -17
  83. data/app/views/ui_components/daisy_ui/data_display_components/accordion.html.erb +59 -105
  84. data/app/views/ui_components/daisy_ui/data_display_components/avatar.html.erb +40 -27
  85. data/app/views/ui_components/daisy_ui/data_display_components/badge.html.erb +45 -42
  86. data/app/views/ui_components/daisy_ui/data_display_components/card.html.erb +302 -0
  87. data/app/views/ui_components/daisy_ui/data_display_components/carousel.html.erb +303 -0
  88. data/app/views/ui_components/daisy_ui/data_display_components/chat.html.erb +190 -0
  89. data/app/views/ui_components/daisy_ui/data_display_components/countdown.html.erb +211 -0
  90. data/app/views/ui_components/daisy_ui/data_display_components/diff.html.erb +69 -0
  91. data/app/views/ui_components/daisy_ui/data_display_components/kbd.html.erb +157 -0
  92. data/app/views/ui_components/daisy_ui/data_display_components/list.html.erb +247 -0
  93. data/app/views/ui_components/daisy_ui/data_display_components/stat.html.erb +208 -0
  94. data/app/views/ui_components/daisy_ui/data_display_components/status.html.erb +93 -0
  95. data/app/views/ui_components/daisy_ui/data_display_components/table.html.erb +358 -0
  96. data/app/views/ui_components/daisy_ui/data_display_components/timeline.html.erb +431 -0
  97. data/app/views/ui_components/daisy_ui/home/index.html.erb +11 -0
  98. data/config/routes.rb +13 -2
  99. data/lib/tasks/ui_components_tasks.rake +0 -3
  100. data/lib/ui_components/config/daisy_ui_class_names.rb +3 -2
  101. data/lib/ui_components/config/tailwind_class_names.rb +27 -4
  102. data/lib/ui_components/version.rb +1 -1
  103. metadata +65 -7
  104. data/app/components/ui_components/daisy_ui/action/dropdown/card_item_component.rb +0 -29
  105. data/app/components/ui_components/daisy_ui/action/dropdown/list_item_component.rb +0 -30
  106. data/app/components/ui_components/daisy_ui/data_display/avatar/box_component.rb +0 -61
@@ -10,16 +10,18 @@
10
10
  </ul>
11
11
  </div>
12
12
 
13
- <%= render DocumentationComponent.new do |document| %>
14
- <%= document.with_header { "# Dropdown" } %>
15
- <%= document.with_body(preview_options: { css_class: "text-center" }) do |body| %>
13
+ <div class="divider"></div>
14
+
15
+ <%= render DocumentationComponent.new do |doc| %>
16
+ <%= doc.with_header { "# Dropdown" } %>
17
+ <%= doc.with_body(preview_options: { css_class: "text-center" }) do |body| %>
16
18
  <%= body.with_preview_example(
17
19
  source: <<~ERB
18
20
  <$= render #{component}.new do |dropdown| $>
19
- <$= dropdown.with_anchor { "Click" } $>
21
+ <$= dropdown.with_anchor_content("Click") $>
20
22
  <$= dropdown.with_menu do |menu| $>
21
- <$= menu.with_item { "Item 1" } $>
22
- <$= menu.with_item { "Item 2" } $>
23
+ <$= menu.with_item_content("Item 1") $>
24
+ <$= menu.with_item_content("Item 2") $>
23
25
  <$ end $>
24
26
  <$ end $>
25
27
  ERB
@@ -32,18 +34,18 @@
32
34
 
33
35
  <% axes.each do |axis_key| %>
34
36
  <% aligns.each do |align_key| %>
35
- <%= render DocumentationComponent.new do |document| %>
36
- <%= document.with_header { action_dropdown_handle_component_title(axis_key:, align_key:) } %>
37
- <%= document.with_body(preview_options: { css_class: "text-center" }) do |body| %>
37
+ <%= render DocumentationComponent.new do |doc| %>
38
+ <%= doc.with_header { action_dropdown_handle_component_title(axis_key:, align_key:) } %>
39
+ <%= doc.with_body(preview_options: { css_class: "text-center" }) do |body| %>
38
40
  <% component_params = action_dropdown_handle_component_params(axis_key:, align_key:) %>
39
41
 
40
42
  <%= body.with_preview_example(
41
43
  source: <<~ERB
42
44
  <$= render #{component}.new#{"(#{component_params})" if component_params.present?} do |dropdown| $>
43
- <$= dropdown.with_anchor { "Click" } $>
45
+ <$= dropdown.with_anchor_content("Click") $>
44
46
  <$= dropdown.with_menu do |menu| $>
45
- <$= menu.with_item { "Item 1" } $>
46
- <$= menu.with_item { "Item 2" } $>
47
+ <$= menu.with_item_content("Item 1") $>
48
+ <$= menu.with_item_content("Item 2") $>
47
49
  <$ end $>
48
50
  <$ end $>
49
51
  ERB
@@ -56,16 +58,16 @@
56
58
  <% events = %w[hover opened] %>
57
59
 
58
60
  <% events.each do |key| %>
59
- <%= render DocumentationComponent.new do |document| %>
60
- <%= document.with_header { "# Dropdown - #{key}" } %>
61
- <%= document.with_body(preview_options: { css_class: "text-center" }) do |body| %>
61
+ <%= render DocumentationComponent.new do |doc| %>
62
+ <%= doc.with_header { "# Dropdown - #{key}" } %>
63
+ <%= doc.with_body(preview_options: { css_class: "text-center" }) do |body| %>
62
64
  <%= body.with_preview_example(
63
65
  source: <<~ERB
64
66
  <$= render #{component}.new(#{key}: true) do |dropdown| $>
65
- <$= dropdown.with_anchor { "Click" } $>
67
+ <$= dropdown.with_anchor_content("Click") $>
66
68
  <$= dropdown.with_menu do |menu| $>
67
- <$= menu.with_item { "Item 1" } $>
68
- <$= menu.with_item { "Item 2" } $>
69
+ <$= menu.with_item_content("Item 1") $>
70
+ <$= menu.with_item_content("Item 2") $>
69
71
  <$ end $>
70
72
  <$ end $>
71
73
  ERB
@@ -74,13 +76,13 @@
74
76
  <% end %>
75
77
  <% end %>
76
78
 
77
- <%= render DocumentationComponent.new do |document| %>
78
- <%= document.with_header { "# Card as dropdown" } %>
79
- <%= document.with_body(preview_options: { css_class: "text-center" }) do |body| %>
79
+ <%= render DocumentationComponent.new do |doc| %>
80
+ <%= doc.with_header { "# Card as dropdown" } %>
81
+ <%= doc.with_body(preview_options: { css_class: "text-center" }) do |body| %>
80
82
  <%= body.with_preview_example(
81
83
  source: <<~ERB
82
84
  <$= render #{component}.new do |dropdown| $>
83
- <$= dropdown.with_anchor(css_class: "m-1") { "Click" } $>
85
+ <$= dropdown.with_anchor(css_class: "m-1").with_content("Click") $>
84
86
  <$= dropdown.with_card do |card| $>
85
87
  <$= card.with_item do $>
86
88
  <p>This is a card. You can use any element as a dropdown.</p>
@@ -92,9 +94,9 @@
92
94
  <% end %>
93
95
  <% end %>
94
96
 
95
- <%= render DocumentationComponent.new do |document| %>
96
- <%= document.with_header { "# Helper dropdown" } %>
97
- <%= document.with_body(preview_options: { css_class: "text-center" }) do |body| %>
97
+ <%= render DocumentationComponent.new do |doc| %>
98
+ <%= doc.with_header { "# Helper dropdown" } %>
99
+ <%= doc.with_body(preview_options: { css_class: "text-center" }) do |body| %>
98
100
  <%= body.with_preview_example(
99
101
  source: <<~ERB
100
102
  A normal text and a helper dropdown
@@ -114,4 +116,15 @@
114
116
  ) %>
115
117
  <% end %>
116
118
  <% end %>
119
+
120
+ <div class="divider"></div>
121
+
122
+ <div class="mb-2">
123
+ <h1 class="font-bold mb-2"># Actions > Dropdown</h1>
124
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
125
+ <%= link_to "< Button", daisy_ui_button_path, class: "link link-primary m-2" %>
126
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
127
+ <%= link_to "Modal >", daisy_ui_modal_path, class: "link link-primary m-2" %>
128
+ </ul>
129
+ </div>
117
130
  </div>
@@ -10,17 +10,19 @@
10
10
  </ul>
11
11
  </div>
12
12
 
13
- <%= render DocumentationComponent.new do |document| %>
14
- <%= document.with_header { "# Dialog modal" } %>
15
- <%= document.with_body do |body| %>
13
+ <div class="divider"></div>
14
+
15
+ <%= render DocumentationComponent.new do |doc| %>
16
+ <%= doc.with_header { "# Dialog modal" } %>
17
+ <%= doc.with_body do |body| %>
16
18
  <%= body.with_preview_example(
17
19
  source: <<~ERB
18
20
  <$= render #{component}.new(opener: "my_modal_1") do |modal| $>
19
- <$= modal.with_anchor { "open modal" } $>
21
+ <$= modal.with_anchor_content("open modal") $>
20
22
  <$= modal.with_dialog do |dialog| $>
21
23
  <$= 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_title_content("Hello!") $>
25
+ <$= box.with_body_content("Press ESC key or click the button below to close") $>
24
26
  <$= box.with_action do |action| $>
25
27
  <$= action.with_item { "Close" } $>
26
28
  <$ end $>
@@ -32,17 +34,17 @@
32
34
  <% end %>
33
35
  <% end %>
34
36
 
35
- <%= render DocumentationComponent.new do |document| %>
36
- <%= document.with_header { "# Dialog modal, closes when clicked outside" } %>
37
- <%= document.with_body do |body| %>
37
+ <%= render DocumentationComponent.new do |doc| %>
38
+ <%= doc.with_header { "# Dialog modal, closes when clicked outside" } %>
39
+ <%= doc.with_body do |body| %>
38
40
  <%= body.with_preview_example(
39
41
  source: <<~ERB
40
42
  <$= render #{component}.new(opener: "my_modal_2") do |modal| $>
41
- <$= modal.with_anchor { "open modal" } $>
43
+ <$= modal.with_anchor_content("open modal") $>
42
44
  <$= modal.with_dialog(backdrop: true) do |dialog| $>
43
45
  <$= dialog.with_box do |box| $>
44
- <$= box.with_title { "Hello!" } $>
45
- <$= box.with_body { "Press ESC key or click outside to close" } $>
46
+ <$= box.with_title_content("Hello!") $>
47
+ <$= box.with_body_content("Press ESC key or click outside to close") $>
46
48
  <$ end $>
47
49
  <$ end $>
48
50
  <$ end $>
@@ -51,17 +53,17 @@
51
53
  <% end %>
52
54
  <% end %>
53
55
 
54
- <%= render DocumentationComponent.new do |document| %>
55
- <%= document.with_header { "# Dialog modal with a close button at corner" } %>
56
- <%= document.with_body do |body| %>
56
+ <%= render DocumentationComponent.new do |doc| %>
57
+ <%= doc.with_header { "# Dialog modal with a close button at corner" } %>
58
+ <%= doc.with_body do |body| %>
57
59
  <%= body.with_preview_example(
58
60
  source: <<~ERB
59
61
  <$= render #{component}.new(opener: "my_modal_3") do |modal| $>
60
- <$= modal.with_anchor { "open modal" } $>
62
+ <$= modal.with_anchor_content("open modal") $>
61
63
  <$= modal.with_dialog do |dialog| $>
62
64
  <$= 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_title_content("Hello!") $>
66
+ <$= box.with_body_content("Press ESC key or click on ✕ button to close") $>
65
67
  <$= box.with_close { "X" } $>
66
68
  <$ end $>
67
69
  <$ end $>
@@ -70,4 +72,15 @@
70
72
  ) %>
71
73
  <% end %>
72
74
  <% end %>
75
+
76
+ <div class="divider"></div>
77
+
78
+ <div class="mb-2">
79
+ <h1 class="font-bold mb-2"># Actions > Modal</h1>
80
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
81
+ <%= link_to "< Dropdown", daisy_ui_dropdown_path, class: "link link-primary m-2" %>
82
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
83
+ <%= link_to "Swap >", daisy_ui_swap_path, class: "link link-primary m-2" %>
84
+ </ul>
85
+ </div>
73
86
  </div>
@@ -6,26 +6,29 @@
6
6
  <ul class="bg-base-100 rounded-box shadow-md p-2">
7
7
  <%= link_to "< Modal", daisy_ui_modal_path, class: "link link-primary m-2" %>
8
8
  <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
9
+ <%= link_to "Data display#Accordion >", daisy_ui_accordion_path, class: "link link-primary m-2" %>
9
10
  </ul>
10
11
  </div>
11
12
 
12
- <%= render DocumentationComponent.new do |document| %>
13
- <%= document.with_header { "# Swap text" } %>
14
- <%= document.with_body do |body| %>
13
+ <div class="divider"></div>
14
+
15
+ <%= render DocumentationComponent.new do |doc| %>
16
+ <%= doc.with_header { "# Swap text" } %>
17
+ <%= doc.with_body do |body| %>
15
18
  <%= body.with_preview_example(
16
19
  source: <<~ERB
17
20
  <$= render #{component}.new do |swap| $>
18
- <$= swap.with_on { "ON" } $>
19
- <$= swap.with_off { "OFF" } $>
21
+ <$= swap.with_on_content("ON") $>
22
+ <$= swap.with_off_content("OFF") $>
20
23
  <$ end $>
21
24
  ERB
22
25
  ) %>
23
26
  <% end %>
24
27
  <% end %>
25
28
 
26
- <%= render DocumentationComponent.new do |document| %>
27
- <%= document.with_header { "# Swap volume icons" } %>
28
- <%= document.with_body do |body| %>
29
+ <%= render DocumentationComponent.new do |doc| %>
30
+ <%= doc.with_header { "# Swap volume icons" } %>
31
+ <%= doc.with_body do |body| %>
29
32
  <%= body.with_preview_example(
30
33
  source: <<~ERB
31
34
  <$= render #{component}.new do |swap| $>
@@ -41,9 +44,9 @@
41
44
  <% end %>
42
45
  <% end %>
43
46
 
44
- <%= render DocumentationComponent.new do |document| %>
45
- <%= document.with_header { "# Swap icons with rotate effect" } %>
46
- <%= document.with_body do |body| %>
47
+ <%= render DocumentationComponent.new do |doc| %>
48
+ <%= doc.with_header { "# Swap icons with rotate effect" } %>
49
+ <%= doc.with_body do |body| %>
47
50
  <%= body.with_preview_example(
48
51
  source: <<~ERB
49
52
  <$= render #{component}.new(effect: "rotate") do |swap| $>
@@ -59,9 +62,9 @@
59
62
  <% end %>
60
63
  <% end %>
61
64
 
62
- <%= render DocumentationComponent.new do |document| %>
63
- <%= document.with_header { "# Swap icons with flip effect" } %>
64
- <%= document.with_body do |body| %>
65
+ <%= render DocumentationComponent.new do |doc| %>
66
+ <%= doc.with_header { "# Swap icons with flip effect" } %>
67
+ <%= doc.with_body do |body| %>
65
68
  <%= body.with_preview_example(
66
69
  source: <<~ERB
67
70
  <$= render #{component}.new(effect: "flip") do |swap| $>
@@ -77,9 +80,9 @@
77
80
  <% end %>
78
81
  <% end %>
79
82
 
80
- <%= render DocumentationComponent.new do |document| %>
81
- <%= document.with_header { "# Activate using class name instead of checkbox" } %>
82
- <%= document.with_body do |body| %>
83
+ <%= render DocumentationComponent.new do |doc| %>
84
+ <%= doc.with_header { "# Activate using class name instead of checkbox" } %>
85
+ <%= doc.with_body do |body| %>
83
86
  <%= body.with_preview_example(
84
87
  source: <<~ERB
85
88
  <$= render #{component}.new(active: true) do |swap| $>
@@ -94,4 +97,15 @@
94
97
  ) %>
95
98
  <% end %>
96
99
  <% end %>
100
+
101
+ <div class="divider"></div>
102
+
103
+ <div class="mb-2">
104
+ <h1 class="font-bold mb-2"># Actions > Swap</h1>
105
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
106
+ <%= link_to "< Modal", daisy_ui_modal_path, class: "link link-primary m-2" %>
107
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
108
+ <%= link_to "Data display#Accordion >", daisy_ui_accordion_path, class: "link link-primary m-2" %>
109
+ </ul>
110
+ </div>
97
111
  </div>
@@ -4,42 +4,33 @@
4
4
  <div class="mb-2">
5
5
  <h1 class="font-bold mb-2"># Data display > Accordion</h1>
6
6
  <ul class="bg-base-100 rounded-box shadow-md p-2">
7
+ <%= link_to "< Actions#Swap", daisy_ui_swap_path, class: "link link-primary m-2" %>
7
8
  <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
8
9
  <%= link_to "Avatar >", daisy_ui_avatar_path, class: "link link-primary m-2" %>
9
10
  </ul>
10
11
  </div>
11
12
 
12
- <%= render DocumentationComponent.new do |document| %>
13
- <%= document.with_header { "# Accordion using radio inputs" } %>
14
- <%= document.with_body do |body| %>
13
+ <div class="divider"></div>
14
+
15
+ <%= render DocumentationComponent.new do |doc| %>
16
+ <%= doc.with_header { "# Accordion using radio inputs" } %>
17
+ <%= doc.with_body do |body| %>
15
18
  <%= body.with_preview_example(
16
19
  source: <<~ERB
17
20
  <$= render #{component}.new do |accordion| $>
18
21
  <$= 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 $>
22
+ <$ item.with_anchor_content("How do I create an account?") $>
23
+ <$ item.with_body_content('Click the "Sign Up" button in the top right corner and follow the registration process.') $>
25
24
  <$ end $>
26
25
 
27
26
  <$= 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 $>
27
+ <$ item.with_anchor_content("I forgot my password. What should I do?") $>
28
+ <$ item.with_body_content('Click on "Forgot Password" on the login page and follow the instructions sent to your email.') $>
34
29
  <$ end $>
35
30
 
36
31
  <$= 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 $>
32
+ <$ item.with_anchor_content("How do I update my profile information?") $>
33
+ <$ item.with_body_content('Go to "My Account" settings and select "Edit Profile" to make changes.') $>
43
34
  <$ end $>
44
35
  <$ end $>
45
36
  ERB
@@ -50,37 +41,25 @@
50
41
  <% icons = %w[arrow plus] %>
51
42
 
52
43
  <% 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| %>
44
+ <%= render DocumentationComponent.new do |doc| %>
45
+ <%= doc.with_header { "# Accordion with #{key == "plus" ? "plus/minus" : key} icon" } %>
46
+ <%= doc.with_body do |body| %>
56
47
  <%= body.with_preview_example(
57
48
  source: <<~ERB
58
49
  <$= render #{component}.new(opener: "my_accordion_#{index+1}") do |accordion| $>
59
50
  <$= 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 $>
51
+ <$ item.with_anchor_content("How do I create an account?") $>
52
+ <$ item.with_body_content('Click the "Sign Up" button in the top right corner and follow the registration process.') $>
66
53
  <$ end $>
67
54
 
68
55
  <$= 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 $>
56
+ <$ item.with_anchor_content("I forgot my password. What should I do?") $>
57
+ <$ item.with_body_content('Click on "Forgot Password" on the login page and follow the instructions sent to your email.') $>
75
58
  <$ end $>
76
59
 
77
60
  <$= 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 $>
61
+ <$ item.with_anchor_content("How do I update my profile information?") $>
62
+ <$ item.with_body_content('Go to "My Account" settings and select "Edit Profile" to make changes.') $>
84
63
  <$ end $>
85
64
  <$ end $>
86
65
  ERB
@@ -89,37 +68,25 @@
89
68
  <% end %>
90
69
  <% end %>
91
70
 
92
- <%= render DocumentationComponent.new do |document| %>
93
- <%= document.with_header { "# Accordion using checkbox inputs" } %>
94
- <%= document.with_body do |body| %>
71
+ <%= render DocumentationComponent.new do |doc| %>
72
+ <%= doc.with_header { "# Accordion using checkbox inputs" } %>
73
+ <%= doc.with_body do |body| %>
95
74
  <%= body.with_preview_example(
96
75
  source: <<~ERB
97
76
  <$= render #{component}.new(opener: "my_accordion_3", toggle: true) do |accordion| $>
98
77
  <$= 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 $>
78
+ <$ item.with_anchor_content("How do I create an account?") $>
79
+ <$ item.with_body_content('Click the "Sign Up" button in the top right corner and follow the registration process.') $>
105
80
  <$ end $>
106
81
 
107
82
  <$= 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 $>
83
+ <$ item.with_anchor_content("I forgot my password. What should I do?") $>
84
+ <$ item.with_body_content('Click on "Forgot Password" on the login page and follow the instructions sent to your email.') $>
114
85
  <$ end $>
115
86
 
116
87
  <$= 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 $>
88
+ <$ item.with_anchor_content("How do I update my profile information?") $>
89
+ <$ item.with_body_content('Go to "My Account" settings and select "Edit Profile" to make changes.') $>
123
90
  <$ end $>
124
91
  <$ end $>
125
92
  ERB
@@ -127,37 +94,25 @@
127
94
  <% end %>
128
95
  <% end %>
129
96
 
130
- <%= render DocumentationComponent.new do |document| %>
131
- <%= document.with_header { "# Accordion opened" } %>
132
- <%= document.with_body do |body| %>
97
+ <%= render DocumentationComponent.new do |doc| %>
98
+ <%= doc.with_header { "# Accordion opened" } %>
99
+ <%= doc.with_body do |body| %>
133
100
  <%= body.with_preview_example(
134
101
  source: <<~ERB
135
102
  <$= render #{component}.new(opener: "my_accordion_4") do |accordion| $>
136
103
  <$= 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 $>
104
+ <$ item.with_anchor_content("How do I create an account?") $>
105
+ <$ item.with_body_content('Click the "Sign Up" button in the top right corner and follow the registration process.') $>
143
106
  <$ end $>
144
107
 
145
108
  <$= 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 $>
109
+ <$ item.with_anchor_content("I forgot my password. What should I do?") $>
110
+ <$ item.with_body_content('Click on "Forgot Password" on the login page and follow the instructions sent to your email.') $>
152
111
  <$ end $>
153
112
 
154
113
  <$= 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 $>
114
+ <$ item.with_anchor_content("How do I update my profile information?") $>
115
+ <$ item.with_body_content('Go to "My Account" settings and select "Edit Profile" to make changes.') $>
161
116
  <$ end $>
162
117
  <$ end $>
163
118
  ERB
@@ -165,41 +120,40 @@
165
120
  <% end %>
166
121
  <% end %>
167
122
 
168
- <%= render DocumentationComponent.new do |document| %>
169
- <%= document.with_header { "# Using Accordion and Join together" } %>
170
- <%= document.with_body do |body| %>
123
+ <%= render DocumentationComponent.new do |doc| %>
124
+ <%= doc.with_header { "# Using Accordion and Join together" } %>
125
+ <%= doc.with_body do |body| %>
171
126
  <%= body.with_preview_example(
172
127
  source: <<~ERB
173
128
  <$= render #{component}.new(opener: "my_accordion_5", css_class: "join join-vertical bg-base-100") do |accordion| $>
174
129
  <$= 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 $>
130
+ <$ item.with_anchor_content("How do I create an account?") $>
131
+ <$ item.with_body_content('Click the "Sign Up" button in the top right corner and follow the registration process.') $>
181
132
  <$ end $>
182
133
 
183
134
  <$= 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 $>
135
+ <$ item.with_anchor_content("I forgot my password. What should I do?") $>
136
+ <$ item.with_body_content('Click on "Forgot Password" on the login page and follow the instructions sent to your email.') $>
190
137
  <$ end $>
191
138
 
192
139
  <$= 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 $>
140
+ <$ item.with_anchor_content("How do I update my profile information?") $>
141
+ <$ item.with_body_content('Go to "My Account" settings and select "Edit Profile" to make changes.') $>
199
142
  <$ end $>
200
143
  <$ end $>
201
144
  ERB
202
145
  ) %>
203
146
  <% end %>
204
147
  <% end %>
148
+
149
+ <div class="divider"></div>
150
+
151
+ <div class="mb-2">
152
+ <h1 class="font-bold mb-2"># Data display > Accordion</h1>
153
+ <ul class="bg-base-100 rounded-box shadow-md p-2">
154
+ <%= link_to "< Actions#Swap", daisy_ui_swap_path, class: "link link-primary m-2" %>
155
+ <%= link_to "Home", daisy_ui_path, class: "link link-primary m-2" %>
156
+ <%= link_to "Avatar >", daisy_ui_avatar_path, class: "link link-primary m-2" %>
157
+ </ul>
158
+ </div>
205
159
  </div>