bs5 0.0.9 → 0.0.14

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 (103) hide show
  1. checksums.yaml +4 -4
  2. data/app/components/bs5/accordion_component.html.erb +3 -10
  3. data/app/components/bs5/accordion_component.rb +1 -0
  4. data/app/components/bs5/button_tag_component.rb +31 -52
  5. data/app/components/bs5/button_to_component.rb +109 -0
  6. data/app/components/bs5/list_group_component.html.erb +17 -0
  7. data/app/components/bs5/list_group_component.rb +143 -0
  8. data/app/controllers/bs5/pages_controller.rb +11 -0
  9. data/app/helpers/bs5/components_helper.rb +14 -1
  10. data/app/service/bs5/collapse_service.rb +47 -0
  11. data/app/views/bs5/examples/accordion/default/_example.html.erb +1 -1
  12. data/app/views/bs5/examples/accordion/flush/_example.html.erb +1 -1
  13. data/app/views/bs5/examples/alert/additional_content/_example.html.erb +1 -1
  14. data/app/views/bs5/examples/alert/default/_example.html.erb +1 -1
  15. data/app/views/bs5/examples/alert/dismissable/_example.html.erb +1 -1
  16. data/app/views/bs5/examples/alert/style/_example.html.erb +1 -1
  17. data/app/views/bs5/examples/badge/default/_example.html.erb +1 -1
  18. data/app/views/bs5/examples/badge/pill/_example.html.erb +1 -1
  19. data/app/views/bs5/examples/badge/style/_example.html.erb +1 -1
  20. data/app/views/bs5/examples/breadcrumb/default/_example.html.erb +1 -1
  21. data/app/views/bs5/examples/buttons/button_tag/block_buttons/_example.html.erb +5 -0
  22. data/app/views/bs5/examples/buttons/{block_buttons → button_tag/block_buttons}/block_buttons.html.erb +0 -0
  23. data/app/views/bs5/examples/buttons/{block_buttons → button_tag/block_buttons}/responsive_block_buttons_1.html.erb +0 -0
  24. data/app/views/bs5/examples/buttons/{block_buttons → button_tag/block_buttons}/responsive_block_buttons_2.html.erb +0 -0
  25. data/app/views/bs5/examples/buttons/{block_buttons → button_tag/block_buttons}/responsive_block_buttons_3.html.erb +0 -0
  26. data/app/views/bs5/examples/buttons/button_tag/default/_example.html.erb +2 -0
  27. data/app/views/bs5/examples/buttons/button_tag/default/snippet.html.erb +15 -0
  28. data/app/views/bs5/examples/buttons/button_tag/outline/_example.html.erb +2 -0
  29. data/app/views/bs5/examples/buttons/button_tag/outline/snippet.html.erb +19 -0
  30. data/app/views/bs5/examples/buttons/button_tag/size/_example.html.erb +3 -0
  31. data/app/views/bs5/examples/buttons/button_tag/size/large.html.erb +3 -0
  32. data/app/views/bs5/examples/buttons/button_tag/size/small.html.erb +3 -0
  33. data/app/views/bs5/examples/buttons/button_tag/style/_example.html.erb +2 -0
  34. data/app/views/bs5/examples/buttons/button_tag/style/snippet.html.erb +19 -0
  35. data/app/views/bs5/examples/buttons/button_tag/toggle_states/_example.html.erb +2 -0
  36. data/app/views/bs5/examples/buttons/{toggle_states → button_tag/toggle_states}/snippet.html.erb +0 -0
  37. data/app/views/bs5/examples/buttons/button_to/default/_example.html.erb +2 -0
  38. data/app/views/bs5/examples/buttons/button_to/default/snippet.html.erb +11 -0
  39. data/app/views/bs5/examples/close_button/default/_example.html.erb +1 -1
  40. data/app/views/bs5/examples/close_button/disabled/_example.html.erb +1 -1
  41. data/app/views/bs5/examples/close_button/white/_example.html.erb +1 -1
  42. data/app/views/bs5/examples/collapse/default/_example.html.erb +4 -0
  43. data/app/views/bs5/examples/collapse/default/multiple_targets.html.erb +21 -0
  44. data/app/views/bs5/examples/collapse/default/snippet.html.erb +9 -0
  45. data/app/views/bs5/examples/list_group/actionable/_example.html.erb +3 -0
  46. data/app/views/bs5/examples/list_group/actionable/button.html.erb +7 -0
  47. data/app/views/bs5/examples/list_group/actionable/snippet.html.erb +7 -0
  48. data/app/views/bs5/examples/list_group/active/_example.html.erb +2 -0
  49. data/app/views/bs5/examples/list_group/active/snippet.html.erb +7 -0
  50. data/app/views/bs5/examples/list_group/checkboxes_and_radios/_example.html.erb +3 -0
  51. data/app/views/bs5/examples/list_group/checkboxes_and_radios/default.html.erb +22 -0
  52. data/app/views/bs5/examples/list_group/checkboxes_and_radios/with_labels.html.erb +32 -0
  53. data/app/views/bs5/examples/list_group/custom_content/_example.html.erb +2 -0
  54. data/app/views/bs5/examples/list_group/custom_content/default.html.erb +32 -0
  55. data/app/views/bs5/examples/list_group/default/_example.html.erb +2 -0
  56. data/app/views/bs5/examples/list_group/default/snippet.html.erb +7 -0
  57. data/app/views/bs5/examples/list_group/disabled/_example.html.erb +2 -0
  58. data/app/views/bs5/examples/list_group/disabled/snippet.html.erb +7 -0
  59. data/app/views/bs5/examples/list_group/flush/_example.html.erb +2 -0
  60. data/app/views/bs5/examples/list_group/flush/snippet.html.erb +7 -0
  61. data/app/views/bs5/examples/list_group/horizontal/_example.html.erb +2 -0
  62. data/app/views/bs5/examples/list_group/horizontal/snippet.html.erb +30 -0
  63. data/app/views/bs5/examples/list_group/style/_example.html.erb +3 -0
  64. data/app/views/bs5/examples/list_group/style/actionable.html.erb +11 -0
  65. data/app/views/bs5/examples/list_group/style/default.html.erb +11 -0
  66. data/app/views/bs5/examples/list_group/with_badges/_example.html.erb +2 -0
  67. data/app/views/bs5/examples/list_group/with_badges/default.html.erb +14 -0
  68. data/app/views/bs5/examples/tooltips/default/_example.html.erb +4 -0
  69. data/app/views/bs5/examples/tooltips/default/buttons.html.erb +9 -0
  70. data/app/views/bs5/examples/tooltips/default/disabled_elements.html.erb +3 -0
  71. data/app/views/bs5/examples/tooltips/default/snippet.html.erb +7 -0
  72. data/app/views/bs5/pages/accordion.html.erb +3 -0
  73. data/app/views/bs5/{examples/_alert.html.erb → pages/alert.html.erb} +1 -1
  74. data/app/views/bs5/{examples/_badge.html.erb → pages/badge.html.erb} +1 -1
  75. data/app/views/bs5/pages/breadcrumb.html.erb +2 -0
  76. data/app/views/bs5/pages/buttons.html.erb +11 -0
  77. data/app/views/bs5/{examples/_close_button.html.erb → pages/close_button.html.erb} +1 -1
  78. data/app/views/bs5/pages/collapse.html.erb +2 -0
  79. data/app/views/bs5/pages/list_group.html.erb +11 -0
  80. data/app/views/bs5/pages/tooltips.html.erb +2 -0
  81. data/app/views/layouts/bs5/pages.html.erb +33 -0
  82. data/config/locales/en.yml +6 -0
  83. data/config/routes.rb +2 -2
  84. data/lib/bs5/version.rb +1 -1
  85. data/lib/generators/bs5/install/install_generator.rb +12 -4
  86. data/lib/generators/bs5/install/templates/bs5.js +14 -0
  87. metadata +80 -26
  88. data/app/controllers/bs5/examples_controller.rb +0 -9
  89. data/app/views/bs5/examples/_accordion.html.erb +0 -3
  90. data/app/views/bs5/examples/_breadcrumb.html.erb +0 -2
  91. data/app/views/bs5/examples/_buttons.html.erb +0 -7
  92. data/app/views/bs5/examples/buttons/block_buttons/_example.html.erb +0 -5
  93. data/app/views/bs5/examples/buttons/default/_example.html.erb +0 -2
  94. data/app/views/bs5/examples/buttons/default/snippet.html.erb +0 -15
  95. data/app/views/bs5/examples/buttons/outline/_example.html.erb +0 -2
  96. data/app/views/bs5/examples/buttons/outline/snippet.html.erb +0 -19
  97. data/app/views/bs5/examples/buttons/size/_example.html.erb +0 -3
  98. data/app/views/bs5/examples/buttons/size/large.html.erb +0 -3
  99. data/app/views/bs5/examples/buttons/size/small.html.erb +0 -3
  100. data/app/views/bs5/examples/buttons/style/_example.html.erb +0 -2
  101. data/app/views/bs5/examples/buttons/style/snippet.html.erb +0 -19
  102. data/app/views/bs5/examples/buttons/toggle_states/_example.html.erb +0 -2
  103. data/app/views/bs5/examples/index.html.erb +0 -23
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_dependency 'bs5/application_controller'
4
+
5
+ module Bs5
6
+ class PagesController < ApplicationController
7
+ def show
8
+ render template: "bs5/pages/#{params[:page]}"
9
+ end
10
+ end
11
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Bs5
4
4
  module ComponentsHelper
5
- COMPONENTS = %w[accordion alert badge close_button breadcrumb button_tag].freeze
5
+ COMPONENTS = %w[accordion alert badge close_button breadcrumb button_tag button_to list_group].freeze
6
6
 
7
7
  COMPONENTS.each do |name|
8
8
  define_method("bs5_#{name}") do |*args, &block|
@@ -11,6 +11,19 @@ module Bs5
11
11
  end
12
12
  end
13
13
 
14
+ def bs5_tooltip(title, options = nil)
15
+ default_options = { toggle: :tooltip }
16
+ options = Hash(options).symbolize_keys.merge(default_options)
17
+ {
18
+ title: title,
19
+ data: options
20
+ }
21
+ end
22
+
23
+ def bs5_collapse(*args)
24
+ CollapseService.new(*args).to_hash
25
+ end
26
+
14
27
  private
15
28
 
16
29
  def render_component(component_clazz, *args)
@@ -0,0 +1,47 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bs5
4
+ class CollapseService
5
+ CONTROLS_ERR_MSG = 'Please provide either a `controls` option' \
6
+ ' containing the id of the collapsible element' \
7
+ ' or an ID selector as `target` options.'
8
+
9
+ attr_reader :expanded, :target, :controls
10
+
11
+ def initialize(expanded: false, target: nil, controls: nil)
12
+ @expanded = expanded
13
+ @target = target
14
+ @controls = controls
15
+ end
16
+
17
+ def to_hash
18
+ {
19
+ data: data_options,
20
+ aria: aria_options
21
+ }
22
+ end
23
+
24
+ private
25
+
26
+ def data_options
27
+ options = { toggle: :collapse }
28
+ options[:target] = target if target
29
+
30
+ options
31
+ end
32
+
33
+ def aria_options
34
+ options = { expanded: expanded }
35
+
36
+ if controls
37
+ options[:controls] = controls
38
+ elsif target&.start_with?('#')
39
+ options[:controls] = target.delete_prefix('#')
40
+ else
41
+ raise CONTROLS_ERR_MSG
42
+ end
43
+
44
+ options
45
+ end
46
+ end
47
+ end
@@ -1,2 +1,2 @@
1
- <h3>Default</h3>
1
+ <h2>Example</h2>
2
2
  <%= bs5_example(snippet: 'accordion/default/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Flush</h3>
1
+ <h2>Flush</h2>
2
2
  <%= bs5_example(snippet: 'accordion/flush/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Additional content</h3>
1
+ <h2>Additional content</h2>
2
2
  <%= bs5_example(snippet: 'alert/additional_content/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Default</h3>
1
+ <h2>Examples</h2>
2
2
  <%= bs5_example(snippet: 'alert/default/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Dismissing</h3>
1
+ <h2>Dismissing</h2>
2
2
  <%= bs5_example(snippet: 'alert/dismissable/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Style</h3>
1
+ <h2>Style</h2>
2
2
  <%= bs5_example(snippet: 'alert/style/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Example</h3>
1
+ <h2>Example</h2>
2
2
  <%= bs5_example(snippet: 'badge/default/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Pill badges</h3>
1
+ <h2>Pill badges</h2>
2
2
  <%= bs5_example(snippet: 'badge/pill/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Background colors</h3>
1
+ <h2>Background colors</h2>
2
2
  <%= bs5_example(snippet: 'badge/style/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Example</h3>
1
+ <h2>Example</h2>
2
2
  <%= bs5_example(snippet: 'breadcrumb/default/snippet') %>
@@ -0,0 +1,5 @@
1
+ <h3>Block buttons</h3>
2
+ <%= bs5_example(snippet: 'buttons/button_tag/block_buttons/block_buttons') %>
3
+ <%= bs5_example(snippet: 'buttons/button_tag/block_buttons/responsive_block_buttons_1') %>
4
+ <%= bs5_example(snippet: 'buttons/button_tag/block_buttons/responsive_block_buttons_2') %>
5
+ <%= bs5_example(snippet: 'buttons/button_tag/block_buttons/responsive_block_buttons_3') %>
@@ -0,0 +1,2 @@
1
+ <h3>Example</h3>
2
+ <%= bs5_example(snippet: 'buttons/button_tag/default/snippet') %>
@@ -0,0 +1,15 @@
1
+ <%= bs5_button_tag %>
2
+
3
+ <%= bs5_button_tag('Reset', type: 'reset') %>
4
+
5
+ <%= bs5_button_tag('Button', type: 'button') %>
6
+
7
+ <%= bs5_button_tag('Reset', type: 'reset', disabled: true) %>
8
+
9
+ <%= bs5_button_tag(type: 'button') do %>
10
+ <%= tag.strong('Ask me!') %>
11
+ <% end %>
12
+
13
+ <%= bs5_button_tag('Save', data: { confirm: 'Are you sure?' }) %>
14
+
15
+ <%= bs5_button_tag('Checkout', data: { disable_with: 'Please wait...' }) %>
@@ -0,0 +1,2 @@
1
+ <h3>Outline</h3>
2
+ <%= bs5_example(snippet: 'buttons/button_tag/outline/snippet') %>
@@ -0,0 +1,19 @@
1
+ <%= bs5_button_tag('Primary', style: :primary, outline: true) %>
2
+
3
+ <%= bs5_button_tag('Secondary', style: :secondary, outline: true) %>
4
+
5
+ <%= bs5_button_tag('Success', style: :success, outline: true) %>
6
+
7
+ <%= bs5_button_tag('Danger', style: :danger, outline: true) %>
8
+
9
+ <%= bs5_button_tag(style: :warning, outline: true, type: 'button') do %>
10
+ <%= tag.strong('Warning') %>
11
+ <% end %>
12
+
13
+ <%= bs5_button_tag('Info', style: :info, outline: true) %>
14
+
15
+ <%= bs5_button_tag('Light', style: :light, outline: true) %>
16
+
17
+ <%= bs5_button_tag('Dark', style: :dark, outline: true) %>
18
+
19
+ <%= bs5_button_tag('Link', style: :link, outline: true) %>
@@ -0,0 +1,3 @@
1
+ <h3>Sizes</h3>
2
+ <%= bs5_example(snippet: 'buttons/button_tag/size/large') %>
3
+ <%= bs5_example(snippet: 'buttons/button_tag/size/small') %>
@@ -0,0 +1,3 @@
1
+ <%= bs5_button_tag('Large button', style: :primary, size: :large) %>
2
+
3
+ <%= bs5_button_tag('Large button', style: :secondary, size: :large) %>
@@ -0,0 +1,3 @@
1
+ <%= bs5_button_tag('Small button', style: :primary, size: :small) %>
2
+
3
+ <%= bs5_button_tag('Small button', style: :secondary, size: :small) %>
@@ -0,0 +1,2 @@
1
+ <h3>Style</h3>
2
+ <%= bs5_example(snippet: 'buttons/button_tag/style/snippet') %>
@@ -0,0 +1,19 @@
1
+ <%= bs5_button_tag('Primary', style: :primary) %>
2
+
3
+ <%= bs5_button_tag('Secondary', style: :secondary) %>
4
+
5
+ <%= bs5_button_tag('Success', style: :success) %>
6
+
7
+ <%= bs5_button_tag('Danger', style: :danger) %>
8
+
9
+ <%= bs5_button_tag(style: :warning, type: 'button') do %>
10
+ <%= tag.strong('Warning') %>
11
+ <% end %>
12
+
13
+ <%= bs5_button_tag('Info', style: :info) %>
14
+
15
+ <%= bs5_button_tag('Light', style: :light) %>
16
+
17
+ <%= bs5_button_tag('Dark', style: :dark) %>
18
+
19
+ <%= bs5_button_tag('Link', style: :link) %>
@@ -0,0 +1,2 @@
1
+ <h3>Toggle states</h3>
2
+ <%= bs5_example(snippet: 'buttons/button_tag/toggle_states/snippet') %>
@@ -0,0 +1,2 @@
1
+ <h3>Example</h3>
2
+ <%= bs5_example(snippet: 'buttons/button_to/default/snippet') %>
@@ -0,0 +1,11 @@
1
+ <div class="d-grid gap-2 d-md-flex">
2
+ <%= bs5_button_to('New', 'http://www.example.com') %>
3
+
4
+ <%= bs5_button_to('http://www.example.com', style: :success) do %>
5
+ Make happy <strong>John Doe</strong>
6
+ <%- end %>
7
+
8
+ <%= bs5_button_to('New', 'http://www.example.com', style: :dark, outline: true, size: :large, form_class: 'new-thing') %>
9
+
10
+ <%= bs5_button_to('Destroy', 'http://www.example.com', style: :danger, method: "delete", remote: true, data: { confirm: 'Are you sure?', disable_with: 'loading...' }) %>
11
+ </div>
@@ -1,2 +1,2 @@
1
- <h3>Default</h3>
1
+ <h2>Default</h2>
2
2
  <%= bs5_example(snippet: 'close_button/default/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>Disabled</h3>
1
+ <h2>Disabled</h2>
2
2
  <%= bs5_example(snippet: 'close_button/disabled/snippet') %>
@@ -1,2 +1,2 @@
1
- <h3>White</h3>
1
+ <h2>White</h2>
2
2
  <%= bs5_example(snippet: 'close_button/white/snippet') %>
@@ -0,0 +1,4 @@
1
+ <h2>Example</h2>
2
+ <%= bs5_example(snippet: 'collapse/default/snippet') %>
3
+ <h2>Multiple targets</h2>
4
+ <%= bs5_example(snippet: 'collapse/default/multiple_targets') %>
@@ -0,0 +1,21 @@
1
+ <p>
2
+ <%= link_to 'Toggle first element', '#multiCollapseExample1', bs5_collapse(controls: 'multiCollapseExample1 multiCollapseExample2').merge(class: 'btn btn-primary', role: :button) %>
3
+ <%= bs5_button_tag 'Toggle second element', bs5_collapse(target: '#multiCollapseExample2', controls: 'multiCollapseExample1 multiCollapseExample2') %>
4
+ <%= bs5_button_tag 'Toggle both elements', bs5_collapse(target: '.multi-collapse', controls: 'multiCollapseExample1 multiCollapseExample2') %>
5
+ </p>
6
+ <div class="row">
7
+ <div class="col">
8
+ <div class="collapse multi-collapse" id="multiCollapseExample1">
9
+ <div class="card card-body">
10
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
11
+ </div>
12
+ </div>
13
+ </div>
14
+ <div class="col">
15
+ <div class="collapse multi-collapse" id="multiCollapseExample2">
16
+ <div class="card card-body">
17
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
18
+ </div>
19
+ </div>
20
+ </div>
21
+ </div>
@@ -0,0 +1,9 @@
1
+ <p>
2
+ <%= link_to 'Link with href', '#collapseExample', bs5_collapse(controls: 'collapseExample').merge(class: 'btn btn-primary', role: :button) %>
3
+ <%= bs5_button_tag 'Button with data-target', bs5_collapse(target: '#collapseExample').merge(type: :button) %>
4
+ </p>
5
+ <div class="collapse" id="collapseExample">
6
+ <div class="card card-body">
7
+ Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
8
+ </div>
9
+ </div>
@@ -0,0 +1,3 @@
1
+ <h2>Links and buttons</h2>
2
+ <%= bs5_example(snippet: 'list_group/actionable/snippet') %>
3
+ <%= bs5_example(snippet: 'list_group/actionable/button') %>
@@ -0,0 +1,7 @@
1
+ <%= bs5_list_group do |lg| %>
2
+ <% lg.slot(:item, active: true) do %><%= button_tag 'Cras justo odio' %><% end %>
3
+ <% lg.slot(:item) do %><%= button_tag 'Dapibus ac facilisis in' %><% end %>
4
+ <% lg.slot(:item) do %><%= button_tag 'Morbi leo risus' %><% end %>
5
+ <% lg.slot(:item) do %><%= button_tag 'Porta ac consectetur ac' %><% end %>
6
+ <% lg.slot(:item, disabled: true) do %><%= button_tag 'Vestibulum at eros' %><% end %>
7
+ <%- end %>
@@ -0,0 +1,7 @@
1
+ <%= bs5_list_group do |lg| %>
2
+ <% lg.slot(:item, active: true) do %><%= link_to 'Cras justo odio', '#' %><% end %>
3
+ <% lg.slot(:item) do %><%= link_to 'Dapibus ac facilisis in', '#' %><% end %>
4
+ <% lg.slot(:item) do %><%= link_to 'Morbi leo risus', '#' %><% end %>
5
+ <% lg.slot(:item) do %><%= link_to 'Porta ac consectetur ac', '#' %><% end %>
6
+ <% lg.slot(:item, disabled: true) do %><%= link_to 'Vestibulum at eros', '#' %><% end %>
7
+ <%- end %>
@@ -0,0 +1,2 @@
1
+ <h2>Active items</h2>
2
+ <%= bs5_example(snippet: 'list_group/active/snippet') %>
@@ -0,0 +1,7 @@
1
+ <%= bs5_list_group do |lg| %>
2
+ <% lg.slot(:item, active: true) do %>Cras justo odio<% end %>
3
+ <% lg.slot(:item) do %>Dapibus ac facilisis in<% end %>
4
+ <% lg.slot(:item) do %>Morbi leo risus<% end %>
5
+ <% lg.slot(:item) do %>Porta ac consectetur ac<% end %>
6
+ <% lg.slot(:item) do %>Vestibulum at eros<% end %>
7
+ <%- end %>
@@ -0,0 +1,3 @@
1
+ <h2>Checkboxes and radios</h2>
2
+ <%= bs5_example(snippet: 'list_group/checkboxes_and_radios/default') %>
3
+ <%= bs5_example(snippet: 'list_group/checkboxes_and_radios/with_labels') %>
@@ -0,0 +1,22 @@
1
+ <%= bs5_list_group do |lg| %>
2
+ <% lg.slot(:item) do %>
3
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
4
+ Cras justo odio
5
+ <% end %>
6
+ <% lg.slot(:item) do %>
7
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
8
+ Dapibus ac facilisis in
9
+ <% end %>
10
+ <% lg.slot(:item) do %>
11
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
12
+ Morbi leo risus
13
+ <% end %>
14
+ <% lg.slot(:item) do %>
15
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
16
+ Porta ac consectetur ac
17
+ <% end %>
18
+ <% lg.slot(:item) do %>
19
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
20
+ Vestibulum at eros
21
+ <% end %>
22
+ <%- end %>
@@ -0,0 +1,32 @@
1
+ <%= bs5_list_group do |lg| %>
2
+ <% lg.slot(:item) do %>
3
+ <%= label_tag do %>
4
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
5
+ Cras justo odio
6
+ <% end %>
7
+ <% end %>
8
+ <% lg.slot(:item) do %>
9
+ <%= label_tag do %>
10
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
11
+ Dapibus ac facilisis in
12
+ <% end %>
13
+ <% end %>
14
+ <% lg.slot(:item) do %>
15
+ <%= label_tag do %>
16
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
17
+ Morbi leo risus
18
+ <% end %>
19
+ <% end %>
20
+ <% lg.slot(:item) do %>
21
+ <%= label_tag do %>
22
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
23
+ Porta ac consectetur ac
24
+ <% end %>
25
+ <% end %>
26
+ <% lg.slot(:item) do %>
27
+ <%= label_tag do %>
28
+ <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
29
+ Vestibulum at eros
30
+ <% end %>
31
+ <% end %>
32
+ <%- end %>
@@ -0,0 +1,2 @@
1
+ <h2>Custom content</h2>
2
+ <%= bs5_example(snippet: 'list_group/custom_content/default') %>
@@ -0,0 +1,32 @@
1
+ <%= bs5_list_group do |lg| %>
2
+ <% lg.slot(:item, active: true) do %>
3
+ <%= link_to '#' do %>
4
+ <div class="d-flex w-100 justify-content-between">
5
+ <h5 class="mb-1">List group item heading</h5>
6
+ <small>3 days ago</small>
7
+ </div>
8
+ <p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
9
+ <small>Donec id elit non mi porta.</small>
10
+ <% end %>
11
+ <% end %>
12
+ <% lg.slot(:item) do %>
13
+ <%= link_to '#' do %>
14
+ <div class="d-flex w-100 justify-content-between">
15
+ <h5 class="mb-1">List group item heading</h5>
16
+ <small class="text-muted">3 days ago</small>
17
+ </div>
18
+ <p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
19
+ <small class="text-muted">Donec id elit non mi porta.</small>
20
+ <% end %>
21
+ <% end %>
22
+ <% lg.slot(:item) do %>
23
+ <%= link_to '#' do %>
24
+ <div class="d-flex w-100 justify-content-between">
25
+ <h5 class="mb-1">List group item heading</h5>
26
+ <small class="text-muted">3 days ago</small>
27
+ </div>
28
+ <p class="mb-1">Donec id elit non mi porta gravida at eget metus. Maecenas sed diam eget risus varius blandit.</p>
29
+ <small class="text-muted">Donec id elit non mi porta.</small>
30
+ <% end %>
31
+ <% end %>
32
+ <%- end %>