bs5 0.0.25 → 0.0.26

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 (49) hide show
  1. checksums.yaml +4 -4
  2. data/app/components/bs5/dropdown/item_component.html.erb +1 -0
  3. data/app/components/bs5/dropdown/item_component.rb +39 -0
  4. data/app/components/bs5/dropdown_component.html.erb +22 -0
  5. data/app/components/bs5/dropdown_component.rb +154 -0
  6. data/app/helpers/bs5/components_helper.rb +2 -2
  7. data/app/views/bs5/examples/alert/color/snippet.html.erb +8 -24
  8. data/app/views/bs5/examples/alert/default/snippet.html.erb +1 -3
  9. data/app/views/bs5/examples/dropdowns/dark/_example.html.erb +2 -0
  10. data/app/views/bs5/examples/dropdowns/dark/snippet.html.erb +7 -0
  11. data/app/views/bs5/examples/dropdowns/directions/_example.html.erb +7 -0
  12. data/app/views/bs5/examples/dropdowns/directions/snippet1.html.erb +17 -0
  13. data/app/views/bs5/examples/dropdowns/directions/snippet2.html.erb +17 -0
  14. data/app/views/bs5/examples/dropdowns/directions/snippet3.html.erb +17 -0
  15. data/app/views/bs5/examples/dropdowns/menu_alignment/_example.html.erb +5 -0
  16. data/app/views/bs5/examples/dropdowns/menu_alignment/snippet1.html.erb +5 -0
  17. data/app/views/bs5/examples/dropdowns/menu_alignment/snippet2.html.erb +7 -0
  18. data/app/views/bs5/examples/dropdowns/menu_alignment/snippet3.html.erb +7 -0
  19. data/app/views/bs5/examples/dropdowns/menu_content/_example.html.erb +9 -0
  20. data/app/views/bs5/examples/dropdowns/menu_content/snippet1.html.erb +5 -0
  21. data/app/views/bs5/examples/dropdowns/menu_content/snippet2.html.erb +7 -0
  22. data/app/views/bs5/examples/dropdowns/menu_content/snippet3.html.erb +10 -0
  23. data/app/views/bs5/examples/dropdowns/menu_content/snippet4.html.erb +24 -0
  24. data/app/views/bs5/examples/dropdowns/menu_items/_example.html.erb +7 -0
  25. data/app/views/bs5/examples/dropdowns/menu_items/snippet1.html.erb +5 -0
  26. data/app/views/bs5/examples/dropdowns/menu_items/snippet2.html.erb +6 -0
  27. data/app/views/bs5/examples/dropdowns/menu_items/snippet3.html.erb +5 -0
  28. data/app/views/bs5/examples/dropdowns/menu_items/snippet4.html.erb +5 -0
  29. data/app/views/bs5/examples/dropdowns/single/_example.html.erb +4 -0
  30. data/app/views/bs5/examples/dropdowns/single/snippet1.html.erb +5 -0
  31. data/app/views/bs5/examples/dropdowns/single/snippet2.html.erb +47 -0
  32. data/app/views/bs5/examples/dropdowns/single/snippet3.html.erb +47 -0
  33. data/app/views/bs5/examples/dropdowns/sizing/_example.html.erb +3 -0
  34. data/app/views/bs5/examples/dropdowns/sizing/snippet1.html.erb +17 -0
  35. data/app/views/bs5/examples/dropdowns/sizing/snippet2.html.erb +17 -0
  36. data/app/views/bs5/examples/dropdowns/split/_example.html.erb +3 -0
  37. data/app/views/bs5/examples/dropdowns/split/snippet1.html.erb +35 -0
  38. data/app/views/bs5/examples/dropdowns/split/snippet2.html.erb +47 -0
  39. data/app/views/bs5/examples/list_group/active/snippet.html.erb +5 -5
  40. data/app/views/bs5/examples/list_group/default/snippet.html.erb +5 -5
  41. data/app/views/bs5/examples/list_group/disabled/snippet.html.erb +5 -5
  42. data/app/views/bs5/examples/list_group/flush/snippet.html.erb +5 -5
  43. data/app/views/bs5/examples/list_group/horizontal/snippet.html.erb +18 -18
  44. data/app/views/bs5/examples/list_group/style/default.html.erb +8 -8
  45. data/app/views/bs5/examples/toasts/default/snippet.html.erb +1 -1
  46. data/app/views/bs5/pages/dropdowns.html.erb +10 -0
  47. data/app/views/layouts/bs5/pages.html.erb +1 -0
  48. data/lib/bs5/version.rb +1 -1
  49. metadata +37 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 93ea7a16c5cb16edd48cabe938083b466af2171b895c9bfb7ca3da0e7bd9cf6a
4
- data.tar.gz: 35bb524562a071eaf46e05da49b951e1606b27524f6e242d10be7a5cb6a4eeca
3
+ metadata.gz: 14b5dca44bb60e64b8eb925c7a617c2e7f6214bf33e1d35a44454b0fc617351c
4
+ data.tar.gz: 49dc980ff0a533774090543e1f8920c3ae7d4d4037c9fd84a5aa3425bb1a8faf
5
5
  SHA512:
6
- metadata.gz: 011e84f5073b6cd7c6d9b3d2de76f077fedaeaa87f0e8c2aba6efa48457ffe271e8f3d589ec2b2d59eacccdf0a088e968921f3db682c1a846acb94e6ea7c2815
7
- data.tar.gz: 66f86657bfd99ce53af4ea76123b72eed77454ed885b8c033a16fe6e579b67d20be9aa187a982687c80a80e49921577e107b249d081a8fa538b6bdbbef7080fc
6
+ metadata.gz: 2329cc993b4ab1d5930802dfab3f71d878843ce20ebc51bd861c488179e9c4f993b81e48bf1fca791af6886e735de751bbe4ae90f04e641249409e4bade1fc0f
7
+ data.tar.gz: ae01cfa6597d19ea0cacff53947b70f3ca8e4c0da463ede006ceef58268efa021a8851684bda0f1702db6a6092b15239fc9b633d62877bed44c2bf330e85b0dd
@@ -0,0 +1 @@
1
+ <li><%= content || tag.hr(class: 'dropdown-divider') %></li>
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bs5
4
+ module Dropdown
5
+ class ItemComponent < ViewComponent::Base
6
+ private
7
+
8
+ def content
9
+ return nil if @content.blank?
10
+
11
+ if actionable_element?
12
+ set_actionable_element_class_names
13
+ actionable_element.to_html.html_safe # rubocop:disable Rails/OutputSafety
14
+ else
15
+ @content
16
+ end
17
+ end
18
+
19
+ def set_actionable_element_class_names
20
+ class_names = Array(actionable_element[:class])
21
+ class_names << 'dropdown-item'
22
+ actionable_element[:class] = class_names.join(' ')
23
+ end
24
+
25
+ def actionable_element
26
+ @actionable_element ||= begin
27
+ if (elements = Nokogiri::HTML::DocumentFragment.parse(@content).elements).one? &&
28
+ (element = elements.first).name.in?(%w[a button])
29
+ element
30
+ end
31
+ end
32
+ end
33
+
34
+ def actionable_element?
35
+ !!actionable_element
36
+ end
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,22 @@
1
+ <% if split? %>
2
+ <% if dropstart? %>
3
+ <%= bs5_button_group do %>
4
+ <div class="<%= component_class %>">
5
+ <%= split_button_toggle %>
6
+ <%= menu_content %>
7
+ </div>
8
+ <%= split_button %>
9
+ <% end %>
10
+ <% else %>
11
+ <div class="<%= component_class %>">
12
+ <%= split_button %>
13
+ <%= split_button_toggle %>
14
+ <%= menu_content %>
15
+ </div>
16
+ <% end %>
17
+ <% else %>
18
+ <div class="<%= component_class %>">
19
+ <%= single_button %>
20
+ <%= menu_content %>
21
+ </div>
22
+ <% end %>
@@ -0,0 +1,154 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bs5
4
+ class DropdownComponent < ViewComponent::Base # rubocop:disable Metrics/ClassLength
5
+ include ViewComponent::SlotableV2
6
+ include ComponentsHelper
7
+ using HashRefinement
8
+
9
+ CLASS_PREFIX = 'dropdown'
10
+ CLASS_NAMES = {
11
+ visually_hidden: 'visually-hidden',
12
+ toggle_split: "#{CLASS_PREFIX}-toggle-split",
13
+ toggle: "#{CLASS_PREFIX}-toggle",
14
+ menu: "#{CLASS_PREFIX}-menu",
15
+ menu_dark: "#{CLASS_PREFIX}-menu-dark",
16
+ menu_end: "#{CLASS_PREFIX}-menu-end"
17
+ }.freeze
18
+ DIRECTIONS = {
19
+ up: :dropup,
20
+ end: :dropend,
21
+ start: :dropstart
22
+ }.with_indifferent_access.freeze
23
+ DROPDOWN_OPTIONS = %i[offset flip boundary reference display].freeze
24
+
25
+ renders_many :items, Bs5::Dropdown::ItemComponent
26
+ attr_reader :title
27
+
28
+ def initialize(content_or_options = nil, options = {})
29
+ if content_or_options.is_a? Hash
30
+ @options = content_or_options.symbolize_keys
31
+ else
32
+ @title = content_or_options
33
+ @options = options.symbolize_keys
34
+ end
35
+
36
+ extract_options
37
+ end
38
+
39
+ private
40
+
41
+ def extract_options
42
+ @split = @options.delete(:split)
43
+ @dark = @options.delete(:dark)
44
+ @direction = @options.delete(:direction)
45
+ @align = @options.delete(:align)
46
+
47
+ extract_dropdown_options
48
+ end
49
+
50
+ def extract_dropdown_options
51
+ @dropdown_options = @options.extract!(*DROPDOWN_OPTIONS)
52
+ end
53
+
54
+ def split_button_toggle
55
+ bs5_button_tag(split_button_toggle_options) do
56
+ tag.span('Toggle Dropdown', class: CLASS_NAMES[:visually_hidden])
57
+ end
58
+ end
59
+
60
+ def split_button
61
+ bs5_button_tag title, split_button_options
62
+ end
63
+
64
+ def single_button
65
+ bs5_button_tag title, single_button_options
66
+ end
67
+
68
+ def menu_content
69
+ if items.any?
70
+ tag.ul(class: dropdown_menu_classes) { items.map(&method(:concat)) }
71
+ else
72
+ tag.div(content, class: dropdown_menu_classes)
73
+ end
74
+ end
75
+
76
+ def single_button_options
77
+ @options.merge(default_options)
78
+ end
79
+
80
+ def component_class
81
+ class_names = split? ? ['btn-group'] : [CLASS_PREFIX]
82
+ class_names << DIRECTIONS[@direction] if direction?
83
+
84
+ class_names.join(' ')
85
+ end
86
+
87
+ def split_button_options
88
+ @options.merge(default_button_options)
89
+ end
90
+
91
+ def split_button_toggle_options
92
+ single_button_options.dup.tap do |h|
93
+ h[:class] += " #{CLASS_NAMES[:toggle_split]}"
94
+ end
95
+ end
96
+
97
+ %i[split dark direction].each do |name|
98
+ define_method("#{name}?") do
99
+ !instance_variable_get("@#{name}").nil?
100
+ end
101
+ end
102
+
103
+ def dropstart?
104
+ @direction == :start
105
+ end
106
+
107
+ def default_button_options
108
+ { type: :button }
109
+ end
110
+
111
+ def default_options
112
+ default_button_options.merge({
113
+ data: default_data_options.merge(@dropdown_options).prefix_keys_with_bs,
114
+ aria: { expanded: false },
115
+ class: CLASS_NAMES[:toggle]
116
+ })
117
+ end
118
+
119
+ def default_data_options
120
+ { toggle: :dropdown }.tap do |h|
121
+ h[:display] = 'static' if responsive_align?
122
+ end
123
+ end
124
+
125
+ def dropdown_menu_classes
126
+ class_names = [CLASS_NAMES[:menu]]
127
+ class_names << CLASS_NAMES[:menu_dark] if dark?
128
+ class_names << align_classes
129
+
130
+ class_names.compact.join(' ')
131
+ end
132
+
133
+ def align_classes
134
+ case @align
135
+ when Symbol
136
+ CLASS_NAMES[:menu_end]
137
+ when Hash
138
+ responsive_align_classes
139
+ end
140
+ end
141
+
142
+ def responsive_align_classes
143
+ k, v = @align.first
144
+ class_names = ["#{CLASS_PREFIX}-menu-#{v}-#{k}"]
145
+ class_names << CLASS_NAMES[:menu_end] if @align.with_indifferent_access.key?(:start)
146
+
147
+ class_names
148
+ end
149
+
150
+ def responsive_align?
151
+ @align.is_a? Hash
152
+ end
153
+ end
154
+ end
@@ -2,8 +2,8 @@
2
2
 
3
3
  module Bs5
4
4
  module ComponentsHelper
5
- COMPONENTS = %w[accordion alert badge close_button breadcrumb button_group button_tag button_to button_toolbar
6
- list_group spinner toast toast_container].freeze
5
+ COMPONENTS = %w[accordion alert badge breadcrumb button_group button_tag button_to button_toolbar close_button
6
+ dropdown list_group spinner toast toast_container].freeze
7
7
 
8
8
  COMPONENTS.each do |name|
9
9
  define_method("bs5_#{name}") do |*args, &block|
@@ -1,31 +1,15 @@
1
- <%= bs5_alert(color: :primary) do %>
2
- A simple primary alert—check it out!
3
- <%- end %>
1
+ <%= bs5_alert(color: :primary) { "A simple primary alert—check it out!" } %>
4
2
 
5
- <%= bs5_alert(color: :secondary) do %>
6
- A simple secondary alert—check it out!
7
- <%- end %>
3
+ <%= bs5_alert(color: :secondary) { "A simple secondary alert—check it out!" } %>
8
4
 
9
- <%= bs5_alert(color: :success) do %>
10
- A simple success alert—check it out!
11
- <%- end %>
5
+ <%= bs5_alert(color: :success) { "A simple success alert—check it out!" } %>
12
6
 
13
- <%= bs5_alert(color: :danger) do %>
14
- A simple danger alert—check it out!
15
- <%- end %>
7
+ <%= bs5_alert(color: :danger) { "A simple danger alert—check it out!" } %>
16
8
 
17
- <%= bs5_alert(color: :warning) do %>
18
- A simple warning alert—check it out!
19
- <%- end %>
9
+ <%= bs5_alert(color: :warning) { "A simple warning alert—check it out!" } %>
20
10
 
21
- <%= bs5_alert(color: :info) do %>
22
- A simple info alert—check it out!
23
- <%- end %>
11
+ <%= bs5_alert(color: :info) { "A simple info alert—check it out!" } %>
24
12
 
25
- <%= bs5_alert(color: :light) do %>
26
- A simple light alert—check it out!
27
- <%- end %>
13
+ <%= bs5_alert(color: :light) { "A simple light alert—check it out!" } %>
28
14
 
29
- <%= bs5_alert(color: :dark) do %>
30
- A simple dark alert—check it out!
31
- <%- end %>
15
+ <%= bs5_alert(color: :dark) { "A simple dark alert—check it out!" } %>
@@ -1,3 +1 @@
1
- <%= bs5_alert do %>
2
- A simple primary alert—check it out!
3
- <%- end %>
1
+ <%= bs5_alert { "A simple primary alert—check it out!" } %>
@@ -0,0 +1,2 @@
1
+ <h2>Dark dropdown</h2>
2
+ <%= bs5_example(snippet: 'dropdowns/dark/snippet') %>
@@ -0,0 +1,7 @@
1
+ <%= bs5_dropdown('Dropdown button', dark: true) do |d| %>
2
+ <%= d.item do %><%= link_to 'Action', '#', class: 'active' %><% 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 %>
@@ -0,0 +1,7 @@
1
+ <h2>Directions</h2>
2
+ <h3>Dropup</h3>
3
+ <%= bs5_example(snippet: 'dropdowns/directions/snippet1') %>
4
+ <h3>Dropright</h3>
5
+ <%= bs5_example(snippet: 'dropdowns/directions/snippet2') %>
6
+ <h3>Dropleft</h3>
7
+ <%= bs5_example(snippet: 'dropdowns/directions/snippet3') %>
@@ -0,0 +1,17 @@
1
+ <%= bs5_button_group do %>
2
+ <%= bs5_dropdown('Drop up', direction: :up) do |d| %>
3
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
5
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
6
+ <%= d.item %>
7
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= bs5_dropdown('Split dropup', split: true, direction: :up) do |d| %>
12
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
13
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
14
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
15
+ <%= d.item %>
16
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
17
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <%= bs5_button_group do %>
2
+ <%= bs5_dropdown('Drop end', direction: :end) do |d| %>
3
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
5
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
6
+ <%= d.item %>
7
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= bs5_dropdown('Split dropend', split: true, direction: :end) do |d| %>
12
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
13
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
14
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
15
+ <%= d.item %>
16
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
17
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <%= bs5_button_group do %>
2
+ <%= bs5_dropdown('Drop start', direction: :start) do |d| %>
3
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
5
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
6
+ <%= d.item %>
7
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= bs5_dropdown('Split dropstart', split: true, direction: :start) do |d| %>
12
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
13
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
14
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
15
+ <%= d.item %>
16
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
17
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <h2>Menu alignment</h2>
2
+ <%= bs5_example(snippet: 'dropdowns/menu_alignment/snippet1') %>
3
+ <h3>Responsive alignment</h3>
4
+ <%= bs5_example(snippet: 'dropdowns/menu_alignment/snippet2') %>
5
+ <%= bs5_example(snippet: 'dropdowns/menu_alignment/snippet3') %>
@@ -0,0 +1,5 @@
1
+ <%= bs5_dropdown('Right-aligned menu example', align: :end) do |d| %>
2
+ <%= d.item do %><%= button_tag 'Action' %><% end %>
3
+ <%= d.item do %><%= button_tag 'Another action' %><% end %>
4
+ <%= d.item do %><%= button_tag 'Something else here' %><% end %>
5
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= bs5_button_group do %>
2
+ <%= bs5_dropdown('Left-aligned but right aligned when large screen', align: { end: :lg }) do |d| %>
3
+ <%= d.item do %><%= button_tag 'Action' %><% end %>
4
+ <%= d.item do %><%= button_tag 'Another action' %><% end %>
5
+ <%= d.item do %><%= button_tag 'Something else here' %><% end %>
6
+ <% end %>
7
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= bs5_button_group do %>
2
+ <%= bs5_dropdown('Right-aligned but left aligned when large screen', align: { start: :lg }) do |d| %>
3
+ <%= d.item do %><%= button_tag 'Action' %><% end %>
4
+ <%= d.item do %><%= button_tag 'Another action' %><% end %>
5
+ <%= d.item do %><%= button_tag 'Something else here' %><% end %>
6
+ <% end %>
7
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <h2>Menu content</h2>
2
+ <h3>Headers</h3>
3
+ <%= bs5_example(snippet: 'dropdowns/menu_content/snippet1') %>
4
+ <h3>Dividers</h3>
5
+ <%= bs5_example(snippet: 'dropdowns/menu_content/snippet2') %>
6
+ <h3>Text</h3>
7
+ <%= bs5_example(snippet: 'dropdowns/menu_content/snippet3') %>
8
+ <h3>Forms</h3>
9
+ <%= bs5_example(snippet: 'dropdowns/menu_content/snippet4') %>
@@ -0,0 +1,5 @@
1
+ <%= bs5_dropdown('Dropdown') do |d| %>
2
+ <%= d.item do %><h6 class="dropdown-header">Dropdown header</h6><% end %>
3
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
5
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <%= bs5_dropdown('Dropdown') 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 %>
@@ -0,0 +1,10 @@
1
+ <%= bs5_dropdown('Dropdown') do %>
2
+ <div class="p-4 text-muted" style="max-width: 200px;">
3
+ <p>
4
+ Some example text that's free-flowing within the dropdown menu.
5
+ </p>
6
+ <p class="mb-0">
7
+ And this is more example text.
8
+ </p>
9
+ </div>
10
+ <% end %>
@@ -0,0 +1,24 @@
1
+ <%= bs5_dropdown('Dropdown') do %>
2
+ <form class="px-4 py-3">
3
+ <div class="mb-3">
4
+ <label for="exampleDropdownFormEmail1" class="form-label">Email address</label>
5
+ <input type="email" class="form-control" id="exampleDropdownFormEmail1" placeholder="email@example.com">
6
+ </div>
7
+ <div class="mb-3">
8
+ <label for="exampleDropdownFormPassword1" class="form-label">Password</label>
9
+ <input type="password" class="form-control" id="exampleDropdownFormPassword1" placeholder="Password">
10
+ </div>
11
+ <div class="mb-3">
12
+ <div class="form-check">
13
+ <input type="checkbox" class="form-check-input" id="dropdownCheck">
14
+ <label class="form-check-label" for="dropdownCheck">
15
+ Remember me
16
+ </label>
17
+ </div>
18
+ </div>
19
+ <button type="submit" class="btn btn-primary">Sign in</button>
20
+ </form>
21
+ <div class="dropdown-divider"></div>
22
+ <a class="dropdown-item" href="#">New around here? Sign up</a>
23
+ <a class="dropdown-item" href="#">Forgot password?</a>
24
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <h2>Menu items</h2>
2
+ <%= bs5_example(snippet: 'dropdowns/menu_items/snippet1') %>
3
+ <%= bs5_example(snippet: 'dropdowns/menu_items/snippet2') %>
4
+ <h3>Active</h3>
5
+ <%= bs5_example(snippet: 'dropdowns/menu_items/snippet3') %>
6
+ <h3>Disabled</h3>
7
+ <%= bs5_example(snippet: 'dropdowns/menu_items/snippet4') %>
@@ -0,0 +1,5 @@
1
+ <%= bs5_dropdown('Dropdown') do |d| %>
2
+ <%= d.item do %><%= button_tag 'Action' %><% end %>
3
+ <%= d.item do %><%= button_tag 'Another action' %><% end %>
4
+ <%= d.item do %><%= button_tag 'Something else here' %><% end %>
5
+ <% end %>
@@ -0,0 +1,6 @@
1
+ <%= bs5_dropdown('Dropdown') do |d| %>
2
+ <%= d.item do %><span class="dropdown-item-text">Dropdown item text</span><% end %>
3
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
5
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
6
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= bs5_dropdown('Dropdown') do |d| %>
2
+ <%= d.item do %><%= link_to 'Regular link', '#' %><% end %>
3
+ <%= d.item do %><%= link_to 'Active link', '#', class: 'active' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another link', '#' %><% end %>
5
+ <% end %>
@@ -0,0 +1,5 @@
1
+ <%= bs5_dropdown('Dropdown') do |d| %>
2
+ <%= d.item do %><%= link_to 'Regular link', '#' %><% end %>
3
+ <%= d.item do %><%= link_to 'Disabled link', '#', class: 'disabled' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another link', '#' %><% end %>
5
+ <% end %>
@@ -0,0 +1,4 @@
1
+ <h3>Single button</h3>
2
+ <%= bs5_example(snippet: 'dropdowns/single/snippet1') %>
3
+ <%= bs5_example(snippet: 'dropdowns/single/snippet2') %>
4
+ <%= bs5_example(snippet: 'dropdowns/single/snippet3') %>
@@ -0,0 +1,5 @@
1
+ <%= bs5_dropdown('Dropdown button') 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 %>
@@ -0,0 +1,47 @@
1
+ <%= bs5_button_group do %>
2
+ <%= bs5_dropdown('Primary', color: :primary) do |d| %>
3
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
5
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
6
+ <% end %>
7
+ <% end %>
8
+
9
+ <%= bs5_button_group do %>
10
+ <%= bs5_dropdown('Secondary', color: :secondary) do |d| %>
11
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
12
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
13
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
14
+ <% end %>
15
+ <% end %>
16
+
17
+ <%= bs5_button_group do %>
18
+ <%= bs5_dropdown('Success', color: :success) do |d| %>
19
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
20
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
21
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
22
+ <% end %>
23
+ <% end %>
24
+
25
+ <%= bs5_button_group do %>
26
+ <%= bs5_dropdown('Info', color: :info) do |d| %>
27
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
28
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
29
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
30
+ <% end %>
31
+ <% end %>
32
+
33
+ <%= bs5_button_group do %>
34
+ <%= bs5_dropdown('Warning', color: :warning) do |d| %>
35
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
36
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
37
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
38
+ <% end %>
39
+ <% end %>
40
+
41
+ <%= bs5_button_group do %>
42
+ <%= bs5_dropdown('Danger', color: :danger) do |d| %>
43
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
44
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
45
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
46
+ <% end %>
47
+ <% end %>
@@ -0,0 +1,47 @@
1
+ <%= bs5_button_group do %>
2
+ <%= bs5_dropdown('Primary', color: :primary, outline: true) do |d| %>
3
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
5
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
6
+ <% end %>
7
+ <% end %>
8
+
9
+ <%= bs5_button_group do %>
10
+ <%= bs5_dropdown('Secondary', color: :secondary, outline: true) do |d| %>
11
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
12
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
13
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
14
+ <% end %>
15
+ <% end %>
16
+
17
+ <%= bs5_button_group do %>
18
+ <%= bs5_dropdown('Success', color: :success, outline: true) do |d| %>
19
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
20
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
21
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
22
+ <% end %>
23
+ <% end %>
24
+
25
+ <%= bs5_button_group do %>
26
+ <%= bs5_dropdown('Info', color: :info, outline: true) do |d| %>
27
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
28
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
29
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
30
+ <% end %>
31
+ <% end %>
32
+
33
+ <%= bs5_button_group do %>
34
+ <%= bs5_dropdown('Warning', color: :warning, outline: true) do |d| %>
35
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
36
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
37
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
38
+ <% end %>
39
+ <% end %>
40
+
41
+ <%= bs5_button_group do %>
42
+ <%= bs5_dropdown('Danger', color: :danger, outline: true) do |d| %>
43
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
44
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
45
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
46
+ <% end %>
47
+ <% end %>
@@ -0,0 +1,3 @@
1
+ <h2>Sizing</h2>
2
+ <%= bs5_example(snippet: 'dropdowns/sizing/snippet1') %>
3
+ <%= bs5_example(snippet: 'dropdowns/sizing/snippet2') %>
@@ -0,0 +1,17 @@
1
+ <%= bs5_button_group do %>
2
+ <%= bs5_dropdown('Large button', size: :large) do |d| %>
3
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
5
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
6
+ <%= d.item %>
7
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= bs5_dropdown('Large button', split: true, size: :large) do |d| %>
12
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
13
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
14
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
15
+ <%= d.item %>
16
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
17
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <%= bs5_button_group do %>
2
+ <%= bs5_dropdown('Small button', size: :small) do |d| %>
3
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
4
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
5
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
6
+ <%= d.item %>
7
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
8
+ <% end %>
9
+ <% end %>
10
+
11
+ <%= bs5_dropdown('Small button', split: true, size: :small) do |d| %>
12
+ <%= d.item do %><%= link_to 'Action', '#' %><% end %>
13
+ <%= d.item do %><%= link_to 'Another action', '#' %><% end %>
14
+ <%= d.item do %><%= link_to 'Something else here', '#' %><% end %>
15
+ <%= d.item %>
16
+ <%= d.item do %><%= link_to 'Separated link', '#' %><% end %>
17
+ <% end %>
@@ -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 %>
@@ -13,5 +13,5 @@
13
13
  <strong class="me-auto">Bootstrap</strong>
14
14
  <small>11 mins ago</small>
15
15
  <% end %>
16
- <%= t.body do %>Hello, world! This is a toast message.<% end %>
16
+ <%= t.body { "Hello, world! This is a toast message." } %>
17
17
  <% 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' %>
@@ -22,6 +22,7 @@
22
22
  <% lg.item(active: current_page?(pages_path('button_group'))) do %><%= link_to 'Button group', pages_path('button_group') %><% end %>
23
23
  <% lg.item(active: current_page?(pages_path('close_button'))) do %><%= link_to 'Close button', pages_path('close_button') %><% end %>
24
24
  <% lg.item(active: current_page?(pages_path('collapse'))) do %><%= link_to 'Collapse', pages_path('collapse') %><% end %>
25
+ <% lg.item(active: current_page?(pages_path('dropdowns'))) do %><%= link_to 'Dropdowns', pages_path('dropdowns') %><% end %>
25
26
  <% lg.item(active: current_page?(pages_path('list_group'))) do %><%= link_to 'List group', pages_path('list_group') %><% end %>
26
27
  <% lg.item(active: current_page?(pages_path('popovers'))) do %><%= link_to 'Popovers', pages_path('popovers') %><% end %>
27
28
  <% lg.item(active: current_page?(pages_path('spinners'))) do %><%= link_to 'Spinners', pages_path('spinners') %><% end %>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bs5
4
- VERSION = '0.0.25'
4
+ VERSION = '0.0.26'
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.25
4
+ version: 0.0.26
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-20 00:00:00.000000000 Z
11
+ date: 2020-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -143,6 +143,10 @@ files:
143
143
  - app/components/bs5/button_toolbar_component.rb
144
144
  - app/components/bs5/close_button_component.html.erb
145
145
  - app/components/bs5/close_button_component.rb
146
+ - app/components/bs5/dropdown/item_component.html.erb
147
+ - app/components/bs5/dropdown/item_component.rb
148
+ - app/components/bs5/dropdown_component.html.erb
149
+ - app/components/bs5/dropdown_component.rb
146
150
  - app/components/bs5/example_component.html.erb
147
151
  - app/components/bs5/example_component.rb
148
152
  - app/components/bs5/list_group_component.html.erb
@@ -224,6 +228,36 @@ files:
224
228
  - app/views/bs5/examples/collapse/default/_example.html.erb
225
229
  - app/views/bs5/examples/collapse/default/multiple_targets.html.erb
226
230
  - app/views/bs5/examples/collapse/default/snippet.html.erb
231
+ - app/views/bs5/examples/dropdowns/dark/_example.html.erb
232
+ - app/views/bs5/examples/dropdowns/dark/snippet.html.erb
233
+ - app/views/bs5/examples/dropdowns/directions/_example.html.erb
234
+ - app/views/bs5/examples/dropdowns/directions/snippet1.html.erb
235
+ - app/views/bs5/examples/dropdowns/directions/snippet2.html.erb
236
+ - app/views/bs5/examples/dropdowns/directions/snippet3.html.erb
237
+ - app/views/bs5/examples/dropdowns/menu_alignment/_example.html.erb
238
+ - app/views/bs5/examples/dropdowns/menu_alignment/snippet1.html.erb
239
+ - app/views/bs5/examples/dropdowns/menu_alignment/snippet2.html.erb
240
+ - app/views/bs5/examples/dropdowns/menu_alignment/snippet3.html.erb
241
+ - app/views/bs5/examples/dropdowns/menu_content/_example.html.erb
242
+ - app/views/bs5/examples/dropdowns/menu_content/snippet1.html.erb
243
+ - app/views/bs5/examples/dropdowns/menu_content/snippet2.html.erb
244
+ - app/views/bs5/examples/dropdowns/menu_content/snippet3.html.erb
245
+ - app/views/bs5/examples/dropdowns/menu_content/snippet4.html.erb
246
+ - app/views/bs5/examples/dropdowns/menu_items/_example.html.erb
247
+ - app/views/bs5/examples/dropdowns/menu_items/snippet1.html.erb
248
+ - app/views/bs5/examples/dropdowns/menu_items/snippet2.html.erb
249
+ - app/views/bs5/examples/dropdowns/menu_items/snippet3.html.erb
250
+ - app/views/bs5/examples/dropdowns/menu_items/snippet4.html.erb
251
+ - app/views/bs5/examples/dropdowns/single/_example.html.erb
252
+ - app/views/bs5/examples/dropdowns/single/snippet1.html.erb
253
+ - app/views/bs5/examples/dropdowns/single/snippet2.html.erb
254
+ - app/views/bs5/examples/dropdowns/single/snippet3.html.erb
255
+ - app/views/bs5/examples/dropdowns/sizing/_example.html.erb
256
+ - app/views/bs5/examples/dropdowns/sizing/snippet1.html.erb
257
+ - app/views/bs5/examples/dropdowns/sizing/snippet2.html.erb
258
+ - app/views/bs5/examples/dropdowns/split/_example.html.erb
259
+ - app/views/bs5/examples/dropdowns/split/snippet1.html.erb
260
+ - app/views/bs5/examples/dropdowns/split/snippet2.html.erb
227
261
  - app/views/bs5/examples/list_group/actionable/_example.html.erb
228
262
  - app/views/bs5/examples/list_group/actionable/button.html.erb
229
263
  - app/views/bs5/examples/list_group/actionable/snippet.html.erb
@@ -299,6 +333,7 @@ files:
299
333
  - app/views/bs5/pages/buttons.html.erb
300
334
  - app/views/bs5/pages/close_button.html.erb
301
335
  - app/views/bs5/pages/collapse.html.erb
336
+ - app/views/bs5/pages/dropdowns.html.erb
302
337
  - app/views/bs5/pages/list_group.html.erb
303
338
  - app/views/bs5/pages/popovers.html.erb
304
339
  - app/views/bs5/pages/spinners.html.erb