bs5 0.0.21 → 0.0.26

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/bs5_manifest.js +1 -0
  3. data/app/assets/javascripts/bs5/application.js +13 -0
  4. data/app/components/bs5/alert_component.html.erb +1 -1
  5. data/app/components/bs5/alert_component.rb +1 -0
  6. data/app/components/bs5/button_tag_component.rb +10 -1
  7. data/app/components/bs5/close_button_component.rb +14 -6
  8. data/app/components/bs5/dropdown/item_component.html.erb +1 -0
  9. data/app/components/bs5/dropdown/item_component.rb +39 -0
  10. data/app/components/bs5/dropdown_component.html.erb +22 -0
  11. data/app/components/bs5/dropdown_component.rb +154 -0
  12. data/app/components/bs5/example_component.html.erb +2 -1
  13. data/app/components/bs5/toast/body_component.html.erb +3 -0
  14. data/app/components/bs5/toast/body_component.rb +8 -0
  15. data/app/components/bs5/toast/header_component.html.erb +4 -0
  16. data/app/components/bs5/toast/header_component.rb +9 -0
  17. data/app/components/bs5/toast_component.html.erb +8 -0
  18. data/app/components/bs5/toast_component.rb +72 -0
  19. data/app/components/bs5/toast_container_component.html.erb +3 -0
  20. data/app/components/bs5/toast_container_component.rb +19 -0
  21. data/app/helpers/bs5/components_helper.rb +2 -2
  22. data/app/views/bs5/examples/alert/color/snippet.html.erb +8 -24
  23. data/app/views/bs5/examples/alert/default/snippet.html.erb +1 -3
  24. data/app/views/bs5/examples/dropdowns/dark/_example.html.erb +2 -0
  25. data/app/views/bs5/examples/dropdowns/dark/snippet.html.erb +7 -0
  26. data/app/views/bs5/examples/dropdowns/directions/_example.html.erb +7 -0
  27. data/app/views/bs5/examples/dropdowns/directions/snippet1.html.erb +17 -0
  28. data/app/views/bs5/examples/dropdowns/directions/snippet2.html.erb +17 -0
  29. data/app/views/bs5/examples/dropdowns/directions/snippet3.html.erb +17 -0
  30. data/app/views/bs5/examples/dropdowns/menu_alignment/_example.html.erb +5 -0
  31. data/app/views/bs5/examples/dropdowns/menu_alignment/snippet1.html.erb +5 -0
  32. data/app/views/bs5/examples/dropdowns/menu_alignment/snippet2.html.erb +7 -0
  33. data/app/views/bs5/examples/dropdowns/menu_alignment/snippet3.html.erb +7 -0
  34. data/app/views/bs5/examples/dropdowns/menu_content/_example.html.erb +9 -0
  35. data/app/views/bs5/examples/dropdowns/menu_content/snippet1.html.erb +5 -0
  36. data/app/views/bs5/examples/dropdowns/menu_content/snippet2.html.erb +7 -0
  37. data/app/views/bs5/examples/dropdowns/menu_content/snippet3.html.erb +10 -0
  38. data/app/views/bs5/examples/dropdowns/menu_content/snippet4.html.erb +24 -0
  39. data/app/views/bs5/examples/dropdowns/menu_items/_example.html.erb +7 -0
  40. data/app/views/bs5/examples/dropdowns/menu_items/snippet1.html.erb +5 -0
  41. data/app/views/bs5/examples/dropdowns/menu_items/snippet2.html.erb +6 -0
  42. data/app/views/bs5/examples/dropdowns/menu_items/snippet3.html.erb +5 -0
  43. data/app/views/bs5/examples/dropdowns/menu_items/snippet4.html.erb +5 -0
  44. data/app/views/bs5/examples/dropdowns/single/_example.html.erb +4 -0
  45. data/app/views/bs5/examples/dropdowns/single/snippet1.html.erb +5 -0
  46. data/app/views/bs5/examples/dropdowns/single/snippet2.html.erb +47 -0
  47. data/app/views/bs5/examples/dropdowns/single/snippet3.html.erb +47 -0
  48. data/app/views/bs5/examples/dropdowns/sizing/_example.html.erb +3 -0
  49. data/app/views/bs5/examples/dropdowns/sizing/snippet1.html.erb +17 -0
  50. data/app/views/bs5/examples/dropdowns/sizing/snippet2.html.erb +17 -0
  51. data/app/views/bs5/examples/dropdowns/split/_example.html.erb +3 -0
  52. data/app/views/bs5/examples/dropdowns/split/snippet1.html.erb +35 -0
  53. data/app/views/bs5/examples/dropdowns/split/snippet2.html.erb +47 -0
  54. data/app/views/bs5/examples/list_group/active/snippet.html.erb +5 -5
  55. data/app/views/bs5/examples/list_group/default/snippet.html.erb +5 -5
  56. data/app/views/bs5/examples/list_group/disabled/snippet.html.erb +5 -5
  57. data/app/views/bs5/examples/list_group/flush/snippet.html.erb +5 -5
  58. data/app/views/bs5/examples/list_group/horizontal/snippet.html.erb +18 -18
  59. data/app/views/bs5/examples/list_group/style/default.html.erb +8 -8
  60. data/app/views/bs5/examples/toasts/color_schemes/_example.html.erb +2 -0
  61. data/app/views/bs5/examples/toasts/color_schemes/snippet.html.erb +33 -0
  62. data/app/views/bs5/examples/toasts/custom_content/_example.html.erb +3 -0
  63. data/app/views/bs5/examples/toasts/custom_content/snippet1.html.erb +3 -0
  64. data/app/views/bs5/examples/toasts/custom_content/snippet2.html.erb +9 -0
  65. data/app/views/bs5/examples/toasts/default/_example.html.erb +2 -0
  66. data/app/views/bs5/examples/toasts/default/snippet.html.erb +17 -0
  67. data/app/views/bs5/examples/toasts/js_options/_example.html.erb +2 -0
  68. data/app/views/bs5/examples/toasts/js_options/snippet.html.erb +23 -0
  69. data/app/views/bs5/examples/toasts/placement/_example.html.erb +3 -0
  70. data/app/views/bs5/examples/toasts/placement/snippet1.html.erb +44 -0
  71. data/app/views/bs5/examples/toasts/placement/snippet2.html.erb +24 -0
  72. data/app/views/bs5/examples/toasts/stacking/_example.html.erb +2 -0
  73. data/app/views/bs5/examples/toasts/stacking/snippet.html.erb +37 -0
  74. data/app/views/bs5/pages/dropdowns.html.erb +10 -0
  75. data/app/views/bs5/pages/toasts.html.erb +7 -0
  76. data/app/views/layouts/bs5/pages.html.erb +3 -0
  77. data/lib/bs5/engine.rb +6 -0
  78. data/lib/bs5/version.rb +1 -1
  79. data/lib/generators/bs5/install/templates/bs5.js +24 -13
  80. data/lib/tasks/rubocop.rake +1 -1
  81. metadata +61 -16
@@ -0,0 +1,3 @@
1
+ <h3>Split button</h3>
2
+ <%= bs5_example(snippet: 'dropdowns/split/snippet1') %>
3
+ <%= bs5_example(snippet: 'dropdowns/split/snippet2') %>
@@ -0,0 +1,35 @@
1
+ <%= bs5_dropdown('Primary', split: true, color: :primary) do |d| %>
2
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
3
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
5
+ <% end %>
6
+
7
+ <%= bs5_dropdown('Secondary', split: true, color: :secondary) do |d| %>
8
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
9
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
10
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
11
+ <% end %>
12
+
13
+ <%= bs5_dropdown('Success', split: true, color: :success) do |d| %>
14
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
15
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
16
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
17
+ <% end %>
18
+
19
+ <%= bs5_dropdown('Info', split: true, color: :info) do |d| %>
20
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
21
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
22
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
23
+ <% end %>
24
+
25
+ <%= bs5_dropdown('Warning', split: true, color: :warning) do |d| %>
26
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
27
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
28
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
29
+ <% end %>
30
+
31
+ <%= bs5_dropdown('Danger', split: true, color: :danger) do |d| %>
32
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
33
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
34
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
35
+ <% end %>
@@ -0,0 +1,47 @@
1
+ <%= bs5_dropdown('Primary', split: true, color: :primary, outline: true) do |d| %>
2
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
3
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
5
+ <%= d.item %>
6
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
7
+ <% end %>
8
+
9
+ <%= bs5_dropdown('Secondary', split: true, color: :secondary, outline: true) do |d| %>
10
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
11
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
12
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
13
+ <%= d.item %>
14
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
15
+ <% end %>
16
+
17
+ <%= bs5_dropdown('Success', split: true, color: :success, outline: true) do |d| %>
18
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
19
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
20
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
21
+ <%= d.item %>
22
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
23
+ <% end %>
24
+
25
+ <%= bs5_dropdown('Info', split: true, color: :info, outline: true) do |d| %>
26
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
27
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
28
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
29
+ <%= d.item %>
30
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
31
+ <% end %>
32
+
33
+ <%= bs5_dropdown('Warning', split: true, color: :warning, outline: true) do |d| %>
34
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
35
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
36
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
37
+ <%= d.item %>
38
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
39
+ <% end %>
40
+
41
+ <%= bs5_dropdown('Danger', split: true, color: :danger, outline: true) do |d| %>
42
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
43
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
44
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
45
+ <%= d.item %>
46
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
47
+ <% end %>
@@ -1,7 +1,7 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.item(active: true) do %>Cras justo odio<% end %>
3
- <% lg.item do %>Dapibus ac facilisis in<% end %>
4
- <% lg.item do %>Morbi leo risus<% end %>
5
- <% lg.item do %>Porta ac consectetur ac<% end %>
6
- <% lg.item do %>Vestibulum at eros<% end %>
2
+ <% lg.item(active: true) { "Cras justo odio" } %>
3
+ <% lg.item { "Dapibus ac facilisis in" } %>
4
+ <% lg.item { "Morbi leo risus" } %>
5
+ <% lg.item { "Porta ac consectetur ac" } %>
6
+ <% lg.item { "Vestibulum at eros" } %>
7
7
  <%- end %>
@@ -1,7 +1,7 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.item do %>Cras justo odio<% end %>
3
- <% lg.item do %>Dapibus ac facilisis in<% end %>
4
- <% lg.item do %>Morbi leo risus<% end %>
5
- <% lg.item do %>Porta ac consectetur ac<% end %>
6
- <% lg.item do %>Vestibulum at eros<% end %>
2
+ <% lg.item { "Cras justo odio" } %>
3
+ <% lg.item { "Dapibus ac facilisis in" } %>
4
+ <% lg.item { "Morbi leo risus" } %>
5
+ <% lg.item { "Porta ac consectetur ac" } %>
6
+ <% lg.item { "Vestibulum at eros" } %>
7
7
  <%- end %>
@@ -1,7 +1,7 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.item(disabled: true) do %>Cras justo odio<% end %>
3
- <% lg.item do %>Dapibus ac facilisis in<% end %>
4
- <% lg.item do %>Morbi leo risus<% end %>
5
- <% lg.item do %>Porta ac consectetur ac<% end %>
6
- <% lg.item do %>Vestibulum at eros<% end %>
2
+ <% lg.item(disabled: true) { "Cras justo odio" } %>
3
+ <% lg.item { "Dapibus ac facilisis in" } %>
4
+ <% lg.item { "Morbi leo risus" } %>
5
+ <% lg.item { "Porta ac consectetur ac" } %>
6
+ <% lg.item { "Vestibulum at eros" } %>
7
7
  <%- end %>
@@ -1,7 +1,7 @@
1
1
  <%= bs5_list_group(flush: true) do |lg| %>
2
- <% lg.item do %>Cras justo odio<% end %>
3
- <% lg.item do %>Dapibus ac facilisis in<% end %>
4
- <% lg.item do %>Morbi leo risus<% end %>
5
- <% lg.item do %>Porta ac consectetur ac<% end %>
6
- <% lg.item do %>Vestibulum at eros<% end %>
2
+ <% lg.item { "Cras justo odio" } %>
3
+ <% lg.item { "Dapibus ac facilisis in" } %>
4
+ <% lg.item { "Morbi leo risus" } %>
5
+ <% lg.item { "Porta ac consectetur ac" } %>
6
+ <% lg.item { "Vestibulum at eros" } %>
7
7
  <%- end %>
@@ -1,30 +1,30 @@
1
1
  <%= bs5_list_group(horizontal: true) do |lg| %>
2
- <% lg.item do %>Cras justo odio<% end %>
3
- <% lg.item do %>Dapibus ac facilisis in<% end %>
4
- <% lg.item do %>Morbi leo risus<% end %>
2
+ <% lg.item { "Cras justo odio" } %>
3
+ <% lg.item { "Dapibus ac facilisis in" } %>
4
+ <% lg.item { "Morbi leo risus" } %>
5
5
  <%- end %>
6
6
  <%= bs5_list_group(horizontal: :sm) do |lg| %>
7
- <% lg.item do %>Cras justo odio<% end %>
8
- <% lg.item do %>Dapibus ac facilisis in<% end %>
9
- <% lg.item do %>Morbi leo risus<% end %>
7
+ <% lg.item { "Cras justo odio" } %>
8
+ <% lg.item { "Dapibus ac facilisis in" } %>
9
+ <% lg.item { "Morbi leo risus" } %>
10
10
  <%- end %>
11
11
  <%= bs5_list_group(horizontal: :md) do |lg| %>
12
- <% lg.item do %>Cras justo odio<% end %>
13
- <% lg.item do %>Dapibus ac facilisis in<% end %>
14
- <% lg.item do %>Morbi leo risus<% end %>
12
+ <% lg.item { "Cras justo odio" } %>
13
+ <% lg.item { "Dapibus ac facilisis in" } %>
14
+ <% lg.item { "Morbi leo risus" } %>
15
15
  <%- end %>
16
16
  <%= bs5_list_group(horizontal: :lg) do |lg| %>
17
- <% lg.item do %>Cras justo odio<% end %>
18
- <% lg.item do %>Dapibus ac facilisis in<% end %>
19
- <% lg.item do %>Morbi leo risus<% end %>
17
+ <% lg.item { "Cras justo odio" } %>
18
+ <% lg.item { "Dapibus ac facilisis in" } %>
19
+ <% lg.item { "Morbi leo risus" } %>
20
20
  <%- end %>
21
21
  <%= bs5_list_group(horizontal: :xl) do |lg| %>
22
- <% lg.item do %>Cras justo odio<% end %>
23
- <% lg.item do %>Dapibus ac facilisis in<% end %>
24
- <% lg.item do %>Morbi leo risus<% end %>
22
+ <% lg.item { "Cras justo odio" } %>
23
+ <% lg.item { "Dapibus ac facilisis in" } %>
24
+ <% lg.item { "Morbi leo risus" } %>
25
25
  <%- end %>
26
26
  <%= bs5_list_group(horizontal: :xxl) do |lg| %>
27
- <% lg.item do %>Cras justo odio<% end %>
28
- <% lg.item do %>Dapibus ac facilisis in<% end %>
29
- <% lg.item do %>Morbi leo risus<% end %>
27
+ <% lg.item { "Cras justo odio" } %>
28
+ <% lg.item { "Dapibus ac facilisis in" } %>
29
+ <% lg.item { "Morbi leo risus" } %>
30
30
  <%- end %>
@@ -1,11 +1,11 @@
1
1
  <%= bs5_list_group do |lg| %>
2
2
  <% lg.item do %>Dapibus ac facilisis in<% end %>
3
- <% lg.item(color: :primary) do %>A simple primary list group item<% end %>
4
- <% lg.item(color: :secondary) do %>A simple secondary list group item<% end %>
5
- <% lg.item(color: :success) do %>A simple success list group item<% end %>
6
- <% lg.item(color: :danger) do %>A simple danger list group item<% end %>
7
- <% lg.item(color: :warning) do %>A simple warning list group item<% end %>
8
- <% lg.item(color: :info) do %>A simple info list group item<% end %>
9
- <% lg.item(color: :light) do %>A simple light list group item<% end %>
10
- <% lg.item(color: :dark) do %>A simple dark list group item<% end %>
3
+ <% lg.item(color: :primary) { "A simple primary list group item" } %>
4
+ <% lg.item(color: :secondary) { "A simple secondary list group item" } %>
5
+ <% lg.item(color: :success) { "A simple success list group item" } %>
6
+ <% lg.item(color: :danger) { "A simple danger list group item" } %>
7
+ <% lg.item(color: :warning) { "A simple warning list group item" } %>
8
+ <% lg.item(color: :info) { "A simple info list group item" } %>
9
+ <% lg.item(color: :light) { "A simple light list group item" } %>
10
+ <% lg.item(color: :dark) { "A simple dark list group item" } %>
11
11
  <%- end %>
@@ -0,0 +1,2 @@
1
+ <h2>Color schemes</h2>
2
+ <%= bs5_example(snippet: 'toasts/color_schemes/snippet') %>
@@ -0,0 +1,33 @@
1
+ <%= bs5_toast_container do %>
2
+ <%= bs5_toast(color: :primary, class: 'd-flex align-items-center') do |t| %>
3
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
4
+ <% end %>
5
+
6
+ <%= bs5_toast(color: :secondary, class: 'd-flex align-items-center') do |t| %>
7
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
8
+ <% end %>
9
+
10
+ <%= bs5_toast(color: :success, class: 'd-flex align-items-center') do |t| %>
11
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
12
+ <% end %>
13
+
14
+ <%= bs5_toast(color: :danger, class: 'd-flex align-items-center') do |t| %>
15
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
16
+ <% end %>
17
+
18
+ <%= bs5_toast(color: :warning, class: 'd-flex align-items-center') do |t| %>
19
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
20
+ <% end %>
21
+
22
+ <%= bs5_toast(color: :info, class: 'd-flex align-items-center') do |t| %>
23
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
24
+ <% end %>
25
+
26
+ <%= bs5_toast(color: :light, class: 'd-flex align-items-center') do |t| %>
27
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
28
+ <% end %>
29
+
30
+ <%= bs5_toast(color: :dark, class: 'd-flex align-items-center') do |t| %>
31
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
32
+ <% end %>
33
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <h2>Custom content</h2>
2
+ <%= bs5_example(snippet: 'toasts/custom_content/snippet1') %>
3
+ <%= bs5_example(snippet: 'toasts/custom_content/snippet2') %>
@@ -0,0 +1,3 @@
1
+ <%= bs5_toast(class: 'd-flex align-items-center') do |t| %>
2
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
3
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <%= bs5_toast(close_button: false) do |t| %>
2
+ <%= t.body do %>
3
+ Hello, world! This is a toast message.
4
+ <div class="mt-2 pt-2 border-top">
5
+ <%= bs5_button_tag('Take action', color: :primary, size: :small) %>
6
+ <%= bs5_button_tag('Close', color: :secondary, size: :small, dismiss: :toast) %>
7
+ </div>
8
+ <% end %>
9
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <h2>Default</h2>
2
+ <%= bs5_example(snippet: 'toasts/default/snippet') %>
@@ -0,0 +1,17 @@
1
+ <%= bs5_toast do |t| %>
2
+ <%= t.header do %>
3
+ <svg
4
+ class="bd-placeholder-img rounded me-2"
5
+ width="20"
6
+ height="20"
7
+ xmlns="http://www.w3.org/2000/svg"
8
+ aria-hidden="true"
9
+ focusable="false"
10
+ >
11
+ <rect width="100%" height="100%" fill="#007aff"></rect>
12
+ </svg>
13
+ <strong class="me-auto">Bootstrap</strong>
14
+ <small>11 mins ago</small>
15
+ <% end %>
16
+ <%= t.body { "Hello, world! This is a toast message." } %>
17
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <h2>Options</h2>
2
+ <%= bs5_example(snippet: 'toasts/js_options/snippet') %>
@@ -0,0 +1,23 @@
1
+ <%= bs5_toast_container do %>
2
+ <%= bs5_toast(autohide: true, delay: 10_000, animation: false) do |t| %>
3
+ <%= t.header do %>
4
+ <svg
5
+ class="bd-placeholder-img rounded me-2"
6
+ width="20"
7
+ height="20"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ aria-hidden="true"
10
+ focusable="false"
11
+ >
12
+ <rect width="100%" height="100%" fill="#007aff"></rect>
13
+ </svg>
14
+ <strong class="me-auto">Bootstrap</strong>
15
+ <small>11 mins ago</small>
16
+ <% end %>
17
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
18
+ <% end %>
19
+
20
+ <%= bs5_toast(close_button: false, autohide: true, delay: 11_000) do |t| %>
21
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
22
+ <% end %>
23
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <h2>Placement</h2>
2
+ <%= bs5_example(snippet: 'toasts/placement/snippet1') %>
3
+ <%= bs5_example(snippet: 'toasts/placement/snippet2') %>
@@ -0,0 +1,44 @@
1
+ <div
2
+ aria-live="polite"
3
+ aria-atomic="true"
4
+ class="position-relative"
5
+ style="min-height: 240px"
6
+ >
7
+ <%= bs5_toast_container(class: 'position-absolute top-0 end-0') do %>
8
+ <%= bs5_toast do |t| %>
9
+ <%= t.header do %>
10
+ <svg
11
+ class="bd-placeholder-img rounded me-2"
12
+ width="20"
13
+ height="20"
14
+ xmlns="http://www.w3.org/2000/svg"
15
+ aria-hidden="true"
16
+ focusable="false"
17
+ >
18
+ <rect width="100%" height="100%" fill="#007aff"></rect>
19
+ </svg>
20
+ <strong class="me-auto">Bootstrap</strong>
21
+ <small>just now</small>
22
+ <% end %>
23
+ <%= t.body do %>See? Just like this.<% end %>
24
+ <% end %>
25
+
26
+ <%= bs5_toast do |t| %>
27
+ <%= t.header do %>
28
+ <svg
29
+ class="bd-placeholder-img rounded me-2"
30
+ width="20"
31
+ height="20"
32
+ xmlns="http://www.w3.org/2000/svg"
33
+ aria-hidden="true"
34
+ focusable="false"
35
+ >
36
+ <rect width="100%" height="100%" fill="#007aff"></rect>
37
+ </svg>
38
+ <strong class="me-auto">Bootstrap</strong>
39
+ <small>2 seconds ago</small>
40
+ <% end %>
41
+ <%= t.body do %>Heads up, toasts will stack automatically<% end %>
42
+ <% end %>
43
+ <% end %>
44
+ </div>
@@ -0,0 +1,24 @@
1
+ <div
2
+ aria-live="polite"
3
+ aria-atomic="true"
4
+ class="d-flex justify-content-center align-items-center w-100"
5
+ style="min-height: 240px"
6
+ >
7
+ <%= bs5_toast do |t| %>
8
+ <%= t.header do %>
9
+ <svg
10
+ class="bd-placeholder-img rounded me-2"
11
+ width="20"
12
+ height="20"
13
+ xmlns="http://www.w3.org/2000/svg"
14
+ aria-hidden="true"
15
+ focusable="false"
16
+ >
17
+ <rect width="100%" height="100%" fill="#007aff"></rect>
18
+ </svg>
19
+ <strong class="me-auto">Bootstrap</strong>
20
+ <small>11 mins ago</small>
21
+ <% end %>
22
+ <%= t.body do %>Hello, world! This is a toast message.<% end %>
23
+ <% end %>
24
+ </div>
@@ -0,0 +1,2 @@
1
+ <h2>Stacking</h2>
2
+ <%= bs5_example(snippet: 'toasts/stacking/snippet') %>
@@ -0,0 +1,37 @@
1
+ <%= bs5_toast_container do %>
2
+ <%= bs5_toast do |t| %>
3
+ <%= t.header do %>
4
+ <svg
5
+ class="bd-placeholder-img rounded me-2"
6
+ width="20"
7
+ height="20"
8
+ xmlns="http://www.w3.org/2000/svg"
9
+ aria-hidden="true"
10
+ focusable="false"
11
+ >
12
+ <rect width="100%" height="100%" fill="#007aff"></rect>
13
+ </svg>
14
+ <strong class="me-auto">Bootstrap</strong>
15
+ <small>just now</small>
16
+ <% end %>
17
+ <%= t.body do %>See? Just like this.<% end %>
18
+ <% end %>
19
+
20
+ <%= bs5_toast do |t| %>
21
+ <%= t.header do %>
22
+ <svg
23
+ class="bd-placeholder-img rounded me-2"
24
+ width="20"
25
+ height="20"
26
+ xmlns="http://www.w3.org/2000/svg"
27
+ aria-hidden="true"
28
+ focusable="false"
29
+ >
30
+ <rect width="100%" height="100%" fill="#007aff"></rect>
31
+ </svg>
32
+ <strong class="me-auto">Bootstrap</strong>
33
+ <small>2 seconds ago</small>
34
+ <% end %>
35
+ <%= t.body do %>Heads up, toasts will stack automatically<% end %>
36
+ <% end %>
37
+ <% end %>
@@ -0,0 +1,10 @@
1
+ <h1>Dropdowns</h1>
2
+ <h2>Examples</h2>
3
+ <%= render 'bs5/examples/dropdowns/single/example' %>
4
+ <%= render 'bs5/examples/dropdowns/split/example' %>
5
+ <%= render 'bs5/examples/dropdowns/sizing/example' %>
6
+ <%= render 'bs5/examples/dropdowns/dark/example' %>
7
+ <%= render 'bs5/examples/dropdowns/directions/example' %>
8
+ <%= render 'bs5/examples/dropdowns/menu_items/example' %>
9
+ <%= render 'bs5/examples/dropdowns/menu_alignment/example' %>
10
+ <%= render 'bs5/examples/dropdowns/menu_content/example' %>