bs5 0.0.18 → 0.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (28) hide show
  1. checksums.yaml +4 -4
  2. data/app/components/bs5/accordion_component.html.erb +1 -1
  3. data/app/components/bs5/accordion_component.rb +7 -3
  4. data/app/components/bs5/breadcrumb_component.html.erb +1 -1
  5. data/app/components/bs5/breadcrumb_component.rb +6 -3
  6. data/app/components/bs5/list_group_component.html.erb +2 -2
  7. data/app/components/bs5/list_group_component.rb +11 -4
  8. data/app/views/bs5/examples/accordion/default/snippet.html.erb +4 -4
  9. data/app/views/bs5/examples/accordion/flush/snippet.html.erb +4 -4
  10. data/app/views/bs5/examples/badge/default/_example.html.erb +2 -1
  11. data/app/views/bs5/examples/badge/default/button.html.erb +3 -0
  12. data/app/views/bs5/examples/breadcrumb/default/snippet.html.erb +9 -9
  13. data/app/views/bs5/examples/list_group/actionable/button.html.erb +5 -5
  14. data/app/views/bs5/examples/list_group/actionable/snippet.html.erb +5 -5
  15. data/app/views/bs5/examples/list_group/active/snippet.html.erb +5 -5
  16. data/app/views/bs5/examples/list_group/checkboxes_and_radios/default.html.erb +5 -5
  17. data/app/views/bs5/examples/list_group/checkboxes_and_radios/with_labels.html.erb +5 -5
  18. data/app/views/bs5/examples/list_group/custom_content/default.html.erb +3 -3
  19. data/app/views/bs5/examples/list_group/default/snippet.html.erb +5 -5
  20. data/app/views/bs5/examples/list_group/disabled/snippet.html.erb +5 -5
  21. data/app/views/bs5/examples/list_group/flush/snippet.html.erb +5 -5
  22. data/app/views/bs5/examples/list_group/horizontal/snippet.html.erb +18 -18
  23. data/app/views/bs5/examples/list_group/style/actionable.html.erb +9 -9
  24. data/app/views/bs5/examples/list_group/style/default.html.erb +9 -9
  25. data/app/views/bs5/examples/list_group/with_badges/default.html.erb +3 -3
  26. data/app/views/layouts/bs5/pages.html.erb +11 -11
  27. data/lib/bs5/version.rb +1 -1
  28. metadata +16 -15
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7e7ed0ecd3b82a680eae723045c2c24020920a4942b4dfa5460951042be2a5c1
4
- data.tar.gz: 4217f3cd7e572d702deb22988f772c0653da8709c39c8a2bff3796747990a4b0
3
+ metadata.gz: 2ffee97d6c26146be217198ac6cd314e3f03bcf8c883bdfee1ffc0c9cabc6aa2
4
+ data.tar.gz: 3cba5aa8ad8ff0994637535a48b7610a6cf0ba39d9c7f9e5b0551fedc02af77e
5
5
  SHA512:
6
- metadata.gz: 3e520e4f93b185a7aa46cba4bf5c43b24655c03b8d75576eca3edf2b6740e0384caff3b413e9a3b18abadfda4edf1464be4ea4fb21eb66a67617b0f5268ed49c
7
- data.tar.gz: 38fd799067d2148b0cd44f323dc41d0a4130771edc2e8de6fade8af6aaab4f2a19c22d5dba6abc77f84d1189a9e6f5529c471f903796f07dc47cc40dab769b2a
6
+ metadata.gz: 4dcef8bb95173c07b12af9a568e57d2602de1b420fe030e301ae68ca10ec8a9324c773953e02a950fc5cec1ebe2d560ba8a3b32a95aceb27a0aa0f36aa756f84
7
+ data.tar.gz: ec6e86d8e3149a3730ed4d9c9dcd8eb16226ecd422effd72ef0bd2052d42fd78997db598c2045dbba48856f2ce3ccf937bfa764bf4fb02ee74b91e5e6eb1f7e1
@@ -17,7 +17,7 @@
17
17
  data-bs-parent="#<%= id %>"
18
18
  >
19
19
  <div class="accordion-body">
20
- <%= item.content %>
20
+ <%= item %>
21
21
  </div>
22
22
  </div>
23
23
  </div>
@@ -3,9 +3,9 @@
3
3
  module Bs5
4
4
  class AccordionComponent < ViewComponent::Base
5
5
  include ComponentsHelper
6
- include ViewComponent::Slotable
6
+ include ViewComponent::SlotableV2
7
7
 
8
- with_slot :item, collection: true, class_name: 'Item'
8
+ renders_many :items, 'ItemComponent'
9
9
 
10
10
  def initialize(flush: false)
11
11
  @flush = flush
@@ -25,7 +25,7 @@ module Bs5
25
25
  class_names.join(' ')
26
26
  end
27
27
 
28
- class Item < ViewComponent::Slot
28
+ class ItemComponent < ViewComponent::Base
29
29
  attr_reader :title
30
30
 
31
31
  def initialize(title:, collapsed: true)
@@ -33,6 +33,10 @@ module Bs5
33
33
  @collapsed = collapsed
34
34
  end
35
35
 
36
+ def call
37
+ content
38
+ end
39
+
36
40
  def id
37
41
  object_id
38
42
  end
@@ -2,7 +2,7 @@
2
2
  <nav aria-label="breadcrumb">
3
3
  <ol class="breadcrumb">
4
4
  <% items.each do |item| %>
5
- <li class="breadcrumb-item <%= item == items.last ? 'active' : '' %>" <%= item == items.last ? 'aria-current=page' : '' %>><%= item.content %></li>
5
+ <li class="breadcrumb-item <%= item == items.last ? 'active' : '' %>" <%= item == items.last ? 'aria-current=page' : '' %>><%= item %></li>
6
6
  <% end %>
7
7
  </ol>
8
8
  </nav>
@@ -2,11 +2,14 @@
2
2
 
3
3
  module Bs5
4
4
  class BreadcrumbComponent < ViewComponent::Base
5
- include ViewComponent::Slotable
5
+ include ViewComponent::SlotableV2
6
6
 
7
- with_slot :item, collection: true, class_name: 'Item'
7
+ renders_many :items, 'ItemComponent'
8
8
 
9
- class Item < ViewComponent::Slot
9
+ class ItemComponent < ViewComponent::Base
10
+ def call
11
+ content
12
+ end
10
13
  end
11
14
  end
12
15
  end
@@ -2,14 +2,14 @@
2
2
  <% if actionables? %>
3
3
  <div class="<%= component_class %>">
4
4
  <% items.each do |item| %>
5
- <%= item.decorated_content %>
5
+ <%= item %>
6
6
  <% end %>
7
7
  </div>
8
8
  <% else %>
9
9
  <ul class="<%= component_class %>">
10
10
  <% items.each do |item| %>
11
11
  <%= tag.li(**item.options) do %>
12
- <%= item.content %>
12
+ <%= item %>
13
13
  <% end %>
14
14
  <% end %>
15
15
  </ul>
@@ -6,9 +6,9 @@ module Bs5
6
6
  CLASS_NAME_FLUSH = "#{CLASS_NAME_BASE}-flush"
7
7
  CLASS_NAME_HORIZONTAL = "#{CLASS_NAME_BASE}-horizontal"
8
8
 
9
- include ViewComponent::Slotable
9
+ include ViewComponent::SlotableV2
10
10
 
11
- with_slot :item, collection: true, class_name: 'Item'
11
+ renders_many :items, 'Item'
12
12
 
13
13
  def initialize(flush: false, horizontal: false)
14
14
  @flush = flush
@@ -22,7 +22,10 @@ module Bs5
22
22
  end
23
23
 
24
24
  def actionables?
25
- items.any?(&:actionable?)
25
+ items.any? do |item|
26
+ elements = Nokogiri::HTML::DocumentFragment.parse(item.to_s).elements
27
+ elements.one? && elements.first.name.in?(%w[a button label])
28
+ end
26
29
  end
27
30
 
28
31
  def horizontal?
@@ -48,7 +51,7 @@ module Bs5
48
51
  class_names.join('-')
49
52
  end
50
53
 
51
- class Item < ViewComponent::Slot
54
+ class Item < ViewComponent::Base
52
55
  CLASS_NAME_BASE = 'list-group-item'
53
56
  CLASS_NAME_ACTION = "#{CLASS_NAME_BASE}-action"
54
57
 
@@ -64,6 +67,10 @@ module Bs5
64
67
  set_attributes
65
68
  end
66
69
 
70
+ def call
71
+ actionable? ? decorated_content : content
72
+ end
73
+
67
74
  def actionable?
68
75
  !!actionable_element
69
76
  end
@@ -1,11 +1,11 @@
1
- <%= bs5_accordion do |accordion| %>
2
- <% accordion.slot(:item, title: 'Accordion Item #1', collapsed: false) do %>
1
+ <%= bs5_accordion do |a| %>
2
+ <% a.item(title: 'Accordion Item #1', collapsed: false) do %>
3
3
  <strong>This is the first item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
4
4
  <% end %>
5
- <% accordion.slot(:item, title: 'Accordion Item #2') do %>
5
+ <% a.item(title: 'Accordion Item #2') do %>
6
6
  <strong>This is the second item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
7
7
  <% end %>
8
- <% accordion.slot(:item, title: 'Accordion Item #3') do %>
8
+ <% a.item(title: 'Accordion Item #3') do %>
9
9
  <strong>This is the third item's accordion body.</strong> It is hidden by default, until the collapse plugin adds the appropriate classes that we use to style each element. These classes control the overall appearance, as well as the showing and hiding via CSS transitions. You can modify any of this with custom CSS or overriding our default variables. It's also worth noting that just about any HTML can go within the <code>.accordion-body</code>, though the transition does limit overflow.
10
10
  <% end %>
11
11
  <%- end %>
@@ -1,11 +1,11 @@
1
- <%= bs5_accordion(flush: true) do |accordion| %>
2
- <% accordion.slot(:item, title: 'Accordion Item #1') do %>
1
+ <%= bs5_accordion(flush: true) do |a| %>
2
+ <% a.item(title: 'Accordion Item #1') do %>
3
3
  Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
4
4
  <% end %>
5
- <% accordion.slot(:item, title: 'Accordion Item #2') do %>
5
+ <% a.item(title: 'Accordion Item #2') do %>
6
6
  Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
7
7
  <% end %>
8
- <% accordion.slot(:item, title: 'Accordion Item #3') do %>
8
+ <% a.item(title: 'Accordion Item #3') do %>
9
9
  Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven't heard of them accusamus labore sustainable VHS.
10
10
  <% end %>
11
11
  <%- end %>
@@ -1,2 +1,3 @@
1
1
  <h2>Example</h2>
2
- <%= bs5_example(snippet: 'badge/default/snippet') %>
2
+ <%= bs5_example(snippet: 'badge/default/snippet') %>
3
+ <%= bs5_example(snippet: 'badge/default/button') %>
@@ -0,0 +1,3 @@
1
+ <%= bs5_button_tag(type: 'button') do %>
2
+ Notifications <%= bs5_badge(text: '4', style: :secondary) %>
3
+ <% end %>
@@ -1,14 +1,14 @@
1
- <%= bs5_breadcrumb do |breadcrumb| %>
2
- <% breadcrumb.slot(:item) do %>Home<% end %>
1
+ <%= bs5_breadcrumb do |b| %>
2
+ <% b.item do %>Home<% end %>
3
3
  <%- end %>
4
4
 
5
- <%= bs5_breadcrumb do |breadcrumb| %>
6
- <% breadcrumb.slot(:item) do %><a href="#">Home</a><% end %>
7
- <% breadcrumb.slot(:item) do %>Library<% end %>
5
+ <%= bs5_breadcrumb do |b| %>
6
+ <% b.item do %><a href="#">Home</a><% end %>
7
+ <% b.item do %>Library<% end %>
8
8
  <%- end %>
9
9
 
10
- <%= bs5_breadcrumb do |breadcrumb| %>
11
- <% breadcrumb.slot(:item) do %><a href="#">Home</a><% end %>
12
- <% breadcrumb.slot(:item) do %><a href="#">Library</a><% end %>
13
- <% breadcrumb.slot(:item) do %>Data<% end %>
10
+ <%= bs5_breadcrumb do |b| %>
11
+ <% b.item do %><a href="#">Home</a><% end %>
12
+ <% b.item do %><a href="#">Library</a><% end %>
13
+ <% b.item do %>Data<% end %>
14
14
  <%- end %>
@@ -1,7 +1,7 @@
1
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 %>
2
+ <% lg.item(active: true) do %><%= button_tag 'Cras justo odio' %><% end %>
3
+ <% lg.item do %><%= button_tag 'Dapibus ac facilisis in' %><% end %>
4
+ <% lg.item do %><%= button_tag 'Morbi leo risus' %><% end %>
5
+ <% lg.item do %><%= button_tag 'Porta ac consectetur ac' %><% end %>
6
+ <% lg.item(disabled: true) do %><%= button_tag 'Vestibulum at eros' %><% end %>
7
7
  <%- end %>
@@ -1,7 +1,7 @@
1
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 %>
2
+ <% lg.item(active: true) do %><%= link_to 'Cras justo odio', '#' %><% end %>
3
+ <% lg.item do %><%= link_to 'Dapibus ac facilisis in', '#' %><% end %>
4
+ <% lg.item do %><%= link_to 'Morbi leo risus', '#' %><% end %>
5
+ <% lg.item do %><%= link_to 'Porta ac consectetur ac', '#' %><% end %>
6
+ <% lg.item(disabled: true) do %><%= link_to 'Vestibulum at eros', '#' %><% end %>
7
7
  <%- end %>
@@ -1,7 +1,7 @@
1
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 %>
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 %>
7
7
  <%- end %>
@@ -1,21 +1,21 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.slot(:item) do %>
2
+ <% lg.item do %>
3
3
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
4
4
  Cras justo odio
5
5
  <% end %>
6
- <% lg.slot(:item) do %>
6
+ <% lg.item do %>
7
7
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
8
8
  Dapibus ac facilisis in
9
9
  <% end %>
10
- <% lg.slot(:item) do %>
10
+ <% lg.item do %>
11
11
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
12
12
  Morbi leo risus
13
13
  <% end %>
14
- <% lg.slot(:item) do %>
14
+ <% lg.item do %>
15
15
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
16
16
  Porta ac consectetur ac
17
17
  <% end %>
18
- <% lg.slot(:item) do %>
18
+ <% lg.item do %>
19
19
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
20
20
  Vestibulum at eros
21
21
  <% end %>
@@ -1,29 +1,29 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.slot(:item) do %>
2
+ <% lg.item do %>
3
3
  <%= label_tag do %>
4
4
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
5
5
  Cras justo odio
6
6
  <% end %>
7
7
  <% end %>
8
- <% lg.slot(:item) do %>
8
+ <% lg.item do %>
9
9
  <%= label_tag do %>
10
10
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
11
11
  Dapibus ac facilisis in
12
12
  <% end %>
13
13
  <% end %>
14
- <% lg.slot(:item) do %>
14
+ <% lg.item do %>
15
15
  <%= label_tag do %>
16
16
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
17
17
  Morbi leo risus
18
18
  <% end %>
19
19
  <% end %>
20
- <% lg.slot(:item) do %>
20
+ <% lg.item do %>
21
21
  <%= label_tag do %>
22
22
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
23
23
  Porta ac consectetur ac
24
24
  <% end %>
25
25
  <% end %>
26
- <% lg.slot(:item) do %>
26
+ <% lg.item do %>
27
27
  <%= label_tag do %>
28
28
  <%= check_box_tag nil, nil, false, class: 'form-check-input mr-1', aria: { label: '...' } %>
29
29
  Vestibulum at eros
@@ -1,5 +1,5 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.slot(:item, active: true) do %>
2
+ <% lg.item(active: true) do %>
3
3
  <%= link_to '#' do %>
4
4
  <div class="d-flex w-100 justify-content-between">
5
5
  <h5 class="mb-1">List group item heading</h5>
@@ -9,7 +9,7 @@
9
9
  <small>Donec id elit non mi porta.</small>
10
10
  <% end %>
11
11
  <% end %>
12
- <% lg.slot(:item) do %>
12
+ <% lg.item do %>
13
13
  <%= link_to '#' do %>
14
14
  <div class="d-flex w-100 justify-content-between">
15
15
  <h5 class="mb-1">List group item heading</h5>
@@ -19,7 +19,7 @@
19
19
  <small class="text-muted">Donec id elit non mi porta.</small>
20
20
  <% end %>
21
21
  <% end %>
22
- <% lg.slot(:item) do %>
22
+ <% lg.item do %>
23
23
  <%= link_to '#' do %>
24
24
  <div class="d-flex w-100 justify-content-between">
25
25
  <h5 class="mb-1">List group item heading</h5>
@@ -1,7 +1,7 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.slot(:item) 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 %>
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 %>
7
7
  <%- end %>
@@ -1,7 +1,7 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.slot(:item, disabled: 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 %>
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 %>
7
7
  <%- end %>
@@ -1,7 +1,7 @@
1
1
  <%= bs5_list_group(flush: true) do |lg| %>
2
- <% lg.slot(:item) 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 %>
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 %>
7
7
  <%- end %>
@@ -1,30 +1,30 @@
1
1
  <%= bs5_list_group(horizontal: true) do |lg| %>
2
- <% lg.slot(:item) do %>Cras justo odio<% end %>
3
- <% lg.slot(:item) do %>Dapibus ac facilisis in<% end %>
4
- <% lg.slot(:item) do %>Morbi leo risus<% end %>
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
5
  <%- end %>
6
6
  <%= bs5_list_group(horizontal: :sm) do |lg| %>
7
- <% lg.slot(:item) do %>Cras justo odio<% end %>
8
- <% lg.slot(:item) do %>Dapibus ac facilisis in<% end %>
9
- <% lg.slot(:item) do %>Morbi leo risus<% end %>
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 %>
10
10
  <%- end %>
11
11
  <%= bs5_list_group(horizontal: :md) do |lg| %>
12
- <% lg.slot(:item) do %>Cras justo odio<% end %>
13
- <% lg.slot(:item) do %>Dapibus ac facilisis in<% end %>
14
- <% lg.slot(:item) do %>Morbi leo risus<% end %>
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 %>
15
15
  <%- end %>
16
16
  <%= bs5_list_group(horizontal: :lg) do |lg| %>
17
- <% lg.slot(:item) do %>Cras justo odio<% end %>
18
- <% lg.slot(:item) do %>Dapibus ac facilisis in<% end %>
19
- <% lg.slot(:item) do %>Morbi leo risus<% end %>
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 %>
20
20
  <%- end %>
21
21
  <%= bs5_list_group(horizontal: :xl) do |lg| %>
22
- <% lg.slot(:item) do %>Cras justo odio<% end %>
23
- <% lg.slot(:item) do %>Dapibus ac facilisis in<% end %>
24
- <% lg.slot(:item) do %>Morbi leo risus<% end %>
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 %>
25
25
  <%- end %>
26
26
  <%= bs5_list_group(horizontal: :xxl) do |lg| %>
27
- <% lg.slot(:item) do %>Cras justo odio<% end %>
28
- <% lg.slot(:item) do %>Dapibus ac facilisis in<% end %>
29
- <% lg.slot(:item) do %>Morbi leo risus<% end %>
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 %>
30
30
  <%- end %>
@@ -1,11 +1,11 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.slot(:item) do %><%= link_to 'Dapibus ac facilisis in', '#' %><% end %>
3
- <% lg.slot(:item, style: :primary) do %><%= link_to 'A simple primary list group item', '#' %><% end %>
4
- <% lg.slot(:item, style: :secondary) do %><%= link_to 'A simple secondary list group item', '#' %><% end %>
5
- <% lg.slot(:item, style: :success) do %><%= link_to 'A simple success list group item', '#' %><% end %>
6
- <% lg.slot(:item, style: :danger) do %><%= link_to 'A simple danger list group item', '#' %><% end %>
7
- <% lg.slot(:item, style: :warning) do %><%= link_to 'A simple warning list group item', '#' %><% end %>
8
- <% lg.slot(:item, style: :info) do %><%= link_to 'A simple info list group item', '#' %><% end %>
9
- <% lg.slot(:item, style: :light) do %><%= link_to 'A simple light list group item', '#' %><% end %>
10
- <% lg.slot(:item, style: :dark) do %><%= link_to 'A simple dark list group item', '#' %><% end %>
2
+ <% lg.item do %><%= link_to 'Dapibus ac facilisis in', '#' %><% end %>
3
+ <% lg.item(style: :primary) do %><%= link_to 'A simple primary list group item', '#' %><% end %>
4
+ <% lg.item(style: :secondary) do %><%= link_to 'A simple secondary list group item', '#' %><% end %>
5
+ <% lg.item(style: :success) do %><%= link_to 'A simple success list group item', '#' %><% end %>
6
+ <% lg.item(style: :danger) do %><%= link_to 'A simple danger list group item', '#' %><% end %>
7
+ <% lg.item(style: :warning) do %><%= link_to 'A simple warning list group item', '#' %><% end %>
8
+ <% lg.item(style: :info) do %><%= link_to 'A simple info list group item', '#' %><% end %>
9
+ <% lg.item(style: :light) do %><%= link_to 'A simple light list group item', '#' %><% end %>
10
+ <% lg.item(style: :dark) do %><%= link_to 'A simple dark list group item', '#' %><% end %>
11
11
  <%- end %>
@@ -1,11 +1,11 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.slot(:item) do %>Dapibus ac facilisis in<% end %>
3
- <% lg.slot(:item, style: :primary) do %>A simple primary list group item<% end %>
4
- <% lg.slot(:item, style: :secondary) do %>A simple secondary list group item<% end %>
5
- <% lg.slot(:item, style: :success) do %>A simple success list group item<% end %>
6
- <% lg.slot(:item, style: :danger) do %>A simple danger list group item<% end %>
7
- <% lg.slot(:item, style: :warning) do %>A simple warning list group item<% end %>
8
- <% lg.slot(:item, style: :info) do %>A simple info list group item<% end %>
9
- <% lg.slot(:item, style: :light) do %>A simple light list group item<% end %>
10
- <% lg.slot(:item, style: :dark) do %>A simple dark list group item<% end %>
2
+ <% lg.item do %>Dapibus ac facilisis in<% end %>
3
+ <% lg.item(style: :primary) do %>A simple primary list group item<% end %>
4
+ <% lg.item(style: :secondary) do %>A simple secondary list group item<% end %>
5
+ <% lg.item(style: :success) do %>A simple success list group item<% end %>
6
+ <% lg.item(style: :danger) do %>A simple danger list group item<% end %>
7
+ <% lg.item(style: :warning) do %>A simple warning list group item<% end %>
8
+ <% lg.item(style: :info) do %>A simple info list group item<% end %>
9
+ <% lg.item(style: :light) do %>A simple light list group item<% end %>
10
+ <% lg.item(style: :dark) do %>A simple dark list group item<% end %>
11
11
  <%- end %>
@@ -1,13 +1,13 @@
1
1
  <%= bs5_list_group do |lg| %>
2
- <% lg.slot(:item, class: 'd-flex justify-content-between align-items-center') do %>
2
+ <% lg.item(class: 'd-flex justify-content-between align-items-center') do %>
3
3
  Cras justo odio
4
4
  <%= bs5_badge(text: 14, style: :primary, pill: true) %>
5
5
  <% end %>
6
- <% lg.slot(:item, class: 'd-flex justify-content-between align-items-center') do %>
6
+ <% lg.item(class: 'd-flex justify-content-between align-items-center') do %>
7
7
  Dapibus ac facilisis in
8
8
  <%= bs5_badge(text: 2, style: :primary, pill: true) %>
9
9
  <% end %>
10
- <% lg.slot(:item, class: 'd-flex justify-content-between align-items-center') do %>
10
+ <% lg.item(class: 'd-flex justify-content-between align-items-center') do %>
11
11
  Morbi leo risus
12
12
  <%= bs5_badge(text: 1, style: :primary, pill: true) %>
13
13
  <% end %>
@@ -13,17 +13,17 @@
13
13
  <div class="col">
14
14
  <div class="sticky-top">
15
15
  <%= bs5_list_group(flush: true) do |lg| %>
16
- <% lg.slot(:item, active: current_page?(pages_path('accordion'))) do %><%= link_to 'Accordion', pages_path('accordion') %><% end %>
17
- <% lg.slot(:item, active: current_page?(pages_path('alert'))) do %><%= link_to 'Alert', pages_path('alert') %><% end %>
18
- <% lg.slot(:item, active: current_page?(pages_path('badge'))) do %><%= link_to 'Badge', pages_path('badge') %><% end %>
19
- <% lg.slot(:item, active: current_page?(pages_path('breadcrumb'))) do %><%= link_to 'Breadcrumb', pages_path('breadcrumb') %><% end %>
20
- <% lg.slot(:item, active: current_page?(pages_path('buttons'))) do %><%= link_to 'Buttons', pages_path('buttons') %><% end %>
21
- <% lg.slot(:item, active: current_page?(pages_path('button_group'))) do %><%= link_to 'Button group', pages_path('button_group') %><% end %>
22
- <% lg.slot(:item, active: current_page?(pages_path('close_button'))) do %><%= link_to 'Close button', pages_path('close_button') %><% end %>
23
- <% lg.slot(:item, active: current_page?(pages_path('collapse'))) do %><%= link_to 'Collapse', pages_path('collapse') %><% end %>
24
- <% lg.slot(:item, active: current_page?(pages_path('list_group'))) do %><%= link_to 'List group', pages_path('list_group') %><% end %>
25
- <% lg.slot(:item, active: current_page?(pages_path('popovers'))) do %><%= link_to 'Popovers', pages_path('popovers') %><% end %>
26
- <% lg.slot(:item, active: current_page?(pages_path('tooltips'))) do %><%= link_to 'Tooltips', pages_path('tooltips') %><% end %>
16
+ <% lg.item(active: current_page?(pages_path('accordion'))) do %><%= link_to 'Accordion', pages_path('accordion') %><% end %>
17
+ <% lg.item(active: current_page?(pages_path('alert'))) do %><%= link_to 'Alert', pages_path('alert') %><% end %>
18
+ <% lg.item(active: current_page?(pages_path('badge'))) do %><%= link_to 'Badge', pages_path('badge') %><% end %>
19
+ <% lg.item(active: current_page?(pages_path('breadcrumb'))) do %><%= link_to 'Breadcrumb', pages_path('breadcrumb') %><% end %>
20
+ <% lg.item(active: current_page?(pages_path('buttons'))) do %><%= link_to 'Buttons', pages_path('buttons') %><% end %>
21
+ <% lg.item(active: current_page?(pages_path('button_group'))) do %><%= link_to 'Button group', pages_path('button_group') %><% end %>
22
+ <% lg.item(active: current_page?(pages_path('close_button'))) do %><%= link_to 'Close button', pages_path('close_button') %><% end %>
23
+ <% lg.item(active: current_page?(pages_path('collapse'))) do %><%= link_to 'Collapse', pages_path('collapse') %><% end %>
24
+ <% lg.item(active: current_page?(pages_path('list_group'))) do %><%= link_to 'List group', pages_path('list_group') %><% end %>
25
+ <% lg.item(active: current_page?(pages_path('popovers'))) do %><%= link_to 'Popovers', pages_path('popovers') %><% end %>
26
+ <% lg.item(active: current_page?(pages_path('tooltips'))) do %><%= link_to 'Tooltips', pages_path('tooltips') %><% end %>
27
27
  <%- end %>
28
28
  </div>
29
29
  </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bs5
4
- VERSION = '0.0.18'
4
+ VERSION = '0.0.19'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bs5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Patrick Baselier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-11 00:00:00.000000000 Z
11
+ date: 2020-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -59,61 +59,61 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: 3.25.0
61
61
  - !ruby/object:Gem::Dependency
62
- name: rubocop-rails
62
+ name: view_component
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '2.8'
67
+ version: 2.23.0
68
68
  type: :runtime
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: '2.8'
74
+ version: 2.23.0
75
75
  - !ruby/object:Gem::Dependency
76
- name: view_component
76
+ name: capybara
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 2.22.0
82
- type: :runtime
81
+ version: '3.33'
82
+ type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 2.22.0
88
+ version: '3.33'
89
89
  - !ruby/object:Gem::Dependency
90
- name: capybara
90
+ name: rspec-rails
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: '3.33'
95
+ version: 4.0.1
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: '3.33'
102
+ version: 4.0.1
103
103
  - !ruby/object:Gem::Dependency
104
- name: rspec-rails
104
+ name: rubocop-rails
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: 4.0.1
109
+ version: '2.8'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: 4.0.1
116
+ version: '2.8'
117
117
  - !ruby/object:Gem::Dependency
118
118
  name: sqlite3
119
119
  requirement: !ruby/object:Gem::Requirement
@@ -183,6 +183,7 @@ files:
183
183
  - app/views/bs5/examples/alert/style/_example.html.erb
184
184
  - app/views/bs5/examples/alert/style/snippet.html.erb
185
185
  - app/views/bs5/examples/badge/default/_example.html.erb
186
+ - app/views/bs5/examples/badge/default/button.html.erb
186
187
  - app/views/bs5/examples/badge/default/snippet.html.erb
187
188
  - app/views/bs5/examples/badge/pill/_example.html.erb
188
189
  - app/views/bs5/examples/badge/pill/snippet.html.erb