bs5 0.0.19 → 0.0.24

Sign up to get free protection for your applications and to get access to all the features.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/config/bs5_manifest.js +1 -0
  3. data/app/assets/javascripts/bs5/application.js +13 -0
  4. data/app/components/bs5/alert_component.rb +5 -5
  5. data/app/components/bs5/badge_component.rb +6 -6
  6. data/app/components/bs5/button_tag_component.rb +8 -8
  7. data/app/components/bs5/button_to_component.rb +8 -8
  8. data/app/components/bs5/example_component.html.erb +2 -1
  9. data/app/components/bs5/list_group_component.rb +5 -5
  10. data/app/components/bs5/spinner_component.html.erb +5 -0
  11. data/app/components/bs5/spinner_component.rb +65 -0
  12. data/app/helpers/bs5/components_helper.rb +1 -1
  13. data/app/views/bs5/examples/alert/additional_content/snippet.html.erb +1 -1
  14. data/app/views/bs5/examples/alert/color/_example.html.erb +1 -0
  15. data/app/views/bs5/examples/alert/{style → color}/snippet.html.erb +8 -8
  16. data/app/views/bs5/examples/alert/dismissable/snippet.html.erb +1 -1
  17. data/app/views/bs5/examples/badge/color/_example.html.erb +2 -0
  18. data/app/views/bs5/examples/badge/color/snippet.html.erb +8 -0
  19. data/app/views/bs5/examples/badge/default/button.html.erb +1 -1
  20. data/app/views/bs5/examples/badge/pill/snippet.html.erb +8 -8
  21. data/app/views/bs5/examples/button_group/button_toolbar/snippet.html.erb +4 -4
  22. data/app/views/bs5/examples/button_group/button_toolbar/snippet2.html.erb +8 -8
  23. data/app/views/bs5/examples/button_group/sizing/snippet.html.erb +9 -9
  24. data/app/views/bs5/examples/button_group/vertical/snippet.html.erb +6 -6
  25. data/app/views/bs5/examples/buttons/button_tag/outline/snippet.html.erb +9 -9
  26. data/app/views/bs5/examples/buttons/button_tag/size/large.html.erb +2 -2
  27. data/app/views/bs5/examples/buttons/button_tag/size/small.html.erb +2 -2
  28. data/app/views/bs5/examples/buttons/button_tag/style/snippet.html.erb +9 -9
  29. data/app/views/bs5/examples/buttons/button_to/default/snippet.html.erb +3 -3
  30. data/app/views/bs5/examples/list_group/style/actionable.html.erb +8 -8
  31. data/app/views/bs5/examples/list_group/style/default.html.erb +8 -8
  32. data/app/views/bs5/examples/list_group/with_badges/default.html.erb +3 -3
  33. data/app/views/bs5/examples/popovers/default/snippet.html.erb +1 -1
  34. data/app/views/bs5/examples/popovers/four_directions/snippet.html.erb +4 -4
  35. data/app/views/bs5/examples/spinners/border/_example.html.erb +2 -0
  36. data/app/views/bs5/examples/spinners/border/snippet.html.erb +1 -0
  37. data/app/views/bs5/examples/spinners/buttons/_example.html.erb +2 -0
  38. data/app/views/bs5/examples/spinners/buttons/snippet.html.erb +15 -0
  39. data/app/views/bs5/examples/spinners/colors/_example.html.erb +2 -0
  40. data/app/views/bs5/examples/spinners/colors/snippet.html.erb +16 -0
  41. data/app/views/bs5/examples/spinners/growing/_example.html.erb +3 -0
  42. data/app/views/bs5/examples/spinners/growing/colors.html.erb +16 -0
  43. data/app/views/bs5/examples/spinners/growing/snippet.html.erb +1 -0
  44. data/app/views/bs5/examples/spinners/options/_example.html.erb +10 -0
  45. data/app/views/bs5/examples/spinners/options/floats.html.erb +3 -0
  46. data/app/views/bs5/examples/spinners/options/margin.html.erb +1 -0
  47. data/app/views/bs5/examples/spinners/options/placement_flex1.html.erb +3 -0
  48. data/app/views/bs5/examples/spinners/options/placement_flex2.html.erb +4 -0
  49. data/app/views/bs5/examples/spinners/options/text_align.html.erb +3 -0
  50. data/app/views/bs5/examples/spinners/size/_example.html.erb +3 -0
  51. data/app/views/bs5/examples/spinners/size/size1.html.erb +7 -0
  52. data/app/views/bs5/examples/spinners/size/size2.html.erb +3 -0
  53. data/app/views/bs5/examples/tooltips/default/buttons.html.erb +5 -5
  54. data/app/views/bs5/pages/alert.html.erb +1 -1
  55. data/app/views/bs5/pages/badge.html.erb +1 -1
  56. data/app/views/bs5/pages/spinners.html.erb +7 -0
  57. data/app/views/layouts/bs5/pages.html.erb +2 -0
  58. data/lib/bs5/engine.rb +6 -0
  59. data/lib/bs5/version.rb +1 -1
  60. data/lib/tasks/rubocop.rake +2 -0
  61. metadata +28 -20
  62. data/app/views/bs5/examples/alert/style/_example.html.erb +0 -2
  63. data/app/views/bs5/examples/badge/style/_example.html.erb +0 -2
  64. data/app/views/bs5/examples/badge/style/snippet.html.erb +0 -8
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2ffee97d6c26146be217198ac6cd314e3f03bcf8c883bdfee1ffc0c9cabc6aa2
4
- data.tar.gz: 3cba5aa8ad8ff0994637535a48b7610a6cf0ba39d9c7f9e5b0551fedc02af77e
3
+ metadata.gz: 51b17209ffd99eeedda9730125b19b56bd290f47c89196bf78787050b0061e7c
4
+ data.tar.gz: c691c88a51fc0e6aa4a02b9c31dceefb0c98824d454c755503cce7cc0b4f6a78
5
5
  SHA512:
6
- metadata.gz: 4dcef8bb95173c07b12af9a568e57d2602de1b420fe030e301ae68ca10ec8a9324c773953e02a950fc5cec1ebe2d560ba8a3b32a95aceb27a0aa0f36aa756f84
7
- data.tar.gz: ec6e86d8e3149a3730ed4d9c9dcd8eb16226ecd422effd72ef0bd2052d42fd78997db598c2045dbba48856f2ce3ccf937bfa764bf4fb02ee74b91e5e6eb1f7e1
6
+ metadata.gz: 10243bc1176cbc6e480f39515bf171ce8f67caab6b75b435d6adb703eacc0da923e515fbe8eb1b36fab9e4e3096a379f596c801b2e378f935f24ae033166bdde
7
+ data.tar.gz: bc080841996dbd305b98df94b84b1d814be5656dcf6ee6954a98653a97919b2a080dd641dc02d3c9bbeaf818acc38cd4d32013deac6c3a2d11b440d0d009f821
@@ -1 +1,2 @@
1
1
  //= link_directory ../stylesheets/bs5 .css
2
+ //= link_directory ../javascripts/bs5 .js
@@ -0,0 +1,13 @@
1
+ window.addEventListener("load", initBs5);
2
+ window.addEventListener("turbolinks:load", initBs5);
3
+
4
+ function initBs5(event) {
5
+ document.querySelectorAll('[data-bs5="copy"]').forEach(function (item) {
6
+ item.addEventListener("click", handleBs5CopyButtonClick);
7
+ });
8
+ }
9
+
10
+ function handleBs5CopyButtonClick(event) {
11
+ var code = event.target.closest("div").querySelector("code").innerText;
12
+ navigator.clipboard.writeText(code);
13
+ }
@@ -4,13 +4,13 @@ module Bs5
4
4
  class AlertComponent < ViewComponent::Base
5
5
  STYLES = %i[primary secondary success danger warning info light dark].freeze
6
6
 
7
- attr_reader :style, :is_dismissable
7
+ attr_reader :color, :is_dismissable
8
8
 
9
9
  include ActiveModel::Validations
10
- validates :style, style: true
10
+ validates :color, style: true
11
11
 
12
- def initialize(style: :primary, is_dismissable: false)
13
- @style = style.to_sym
12
+ def initialize(color: :primary, is_dismissable: false)
13
+ @color = color.to_sym
14
14
  @is_dismissable = is_dismissable
15
15
  end
16
16
 
@@ -31,7 +31,7 @@ module Bs5
31
31
  end
32
32
 
33
33
  def contextual_class
34
- "alert-#{@style}"
34
+ "alert-#{@color}"
35
35
  end
36
36
  end
37
37
  end
@@ -4,14 +4,14 @@ module Bs5
4
4
  class BadgeComponent < ViewComponent::Base
5
5
  STYLES = %i[primary secondary success danger warning info light dark].freeze
6
6
 
7
- attr_reader :text, :style
7
+ attr_reader :text, :color
8
8
 
9
9
  include ActiveModel::Validations
10
- validates :style, style: true
10
+ validates :color, style: true
11
11
 
12
- def initialize(text:, style: :secondary, pill: false)
12
+ def initialize(text:, color: :secondary, pill: false)
13
13
  @text = text
14
- @style = style.to_sym
14
+ @color = color.to_sym
15
15
  @pill = pill
16
16
  end
17
17
 
@@ -32,8 +32,8 @@ module Bs5
32
32
  end
33
33
 
34
34
  def contextual_class
35
- class_names = ["bg-#{@style}"]
36
- class_names << %w[text-dark] if style.in?(%i[warning info light])
35
+ class_names = ["bg-#{@color}"]
36
+ class_names << %w[text-dark] if color.in?(%i[warning info light])
37
37
  class_names.join(' ')
38
38
  end
39
39
  end
@@ -3,14 +3,14 @@
3
3
  module Bs5
4
4
  class ButtonTagComponent < ViewComponent::Base
5
5
  STYLES = %i[primary secondary success danger warning info light dark link].freeze
6
- DEFAULT_STYLE = :primary
6
+ DEFAULT_COLOR = :primary
7
7
  SIZES = { small: :sm, large: :lg }.freeze
8
8
  CLASS_PREFIX = 'btn'
9
9
 
10
10
  attr_reader :content_or_options, :size
11
11
 
12
12
  include ActiveModel::Validations
13
- validates :style, style: true
13
+ validates :color, style: true
14
14
  validates :size, inclusion: { in: SIZES.keys, valid_sizes: SIZES.keys.to_sentence, allow_nil: true }
15
15
 
16
16
  def initialize(content_or_options = nil, options = nil)
@@ -44,13 +44,13 @@ module Bs5
44
44
  end
45
45
 
46
46
  def extract_custom_options
47
- extract_style
47
+ extract_color
48
48
  extract_outline
49
49
  extract_size
50
50
  end
51
51
 
52
- def extract_style
53
- @style = @options.delete(:style)
52
+ def extract_color
53
+ @color = @options.delete(:color)
54
54
  end
55
55
 
56
56
  def extract_outline
@@ -76,7 +76,7 @@ module Bs5
76
76
  end
77
77
 
78
78
  def contextual_class
79
- [CLASS_PREFIX, outline? ? 'outline' : nil, style].compact.join('-')
79
+ [CLASS_PREFIX, outline? ? 'outline' : nil, color].compact.join('-')
80
80
  end
81
81
 
82
82
  def size_class
@@ -85,8 +85,8 @@ module Bs5
85
85
  [CLASS_PREFIX, SIZES[size]].join('-')
86
86
  end
87
87
 
88
- def style
89
- (@style || DEFAULT_STYLE).to_sym
88
+ def color
89
+ (@color || DEFAULT_COLOR).to_sym
90
90
  end
91
91
 
92
92
  def outline?
@@ -3,14 +3,14 @@
3
3
  module Bs5
4
4
  class ButtonToComponent < ViewComponent::Base
5
5
  STYLES = %i[primary secondary success danger warning info light dark link].freeze
6
- DEFAULT_STYLE = :primary
6
+ DEFAULT_COLOR = :primary
7
7
  SIZES = { small: :sm, large: :lg }.freeze
8
8
  CLASS_PREFIX = 'btn'
9
9
 
10
10
  attr_reader :size
11
11
 
12
12
  include ActiveModel::Validations
13
- validates :style, style: true
13
+ validates :color, style: true
14
14
  validates :size, inclusion: { in: SIZES.keys, valid_sizes: SIZES.keys.to_sentence, allow_nil: true }
15
15
 
16
16
  def initialize(name = nil, options = nil, html_options = nil)
@@ -53,13 +53,13 @@ module Bs5
53
53
  end
54
54
 
55
55
  def extract_custom_options
56
- extract_style
56
+ extract_color
57
57
  extract_outline
58
58
  extract_size
59
59
  end
60
60
 
61
- def extract_style
62
- @style = @button_to_options.delete(:style)
61
+ def extract_color
62
+ @color = @button_to_options.delete(:color)
63
63
  end
64
64
 
65
65
  def extract_outline
@@ -85,7 +85,7 @@ module Bs5
85
85
  end
86
86
 
87
87
  def contextual_class
88
- [CLASS_PREFIX, outline? ? 'outline' : nil, style].compact.join('-')
88
+ [CLASS_PREFIX, outline? ? 'outline' : nil, color].compact.join('-')
89
89
  end
90
90
 
91
91
  def size_class
@@ -94,8 +94,8 @@ module Bs5
94
94
  [CLASS_PREFIX, SIZES[size]].join('-')
95
95
  end
96
96
 
97
- def style
98
- (@style || DEFAULT_STYLE).to_sym
97
+ def color
98
+ (@color || DEFAULT_COLOR).to_sym
99
99
  end
100
100
 
101
101
  def outline?
@@ -2,7 +2,8 @@
2
2
  <div class="border rounded-2 p-4">
3
3
  <%= render template: snippet %>
4
4
  </div>
5
- <div class="highlight p-4">
5
+ <div class="highlight p-4 position-relative">
6
+ <%= bs5_button_tag('Copy', color: :primary, outline: true, size: :small, class: 'position-absolute top-0 end-0 mt-2 me-2', data: { bs5: 'copy' }) %>
6
7
  <pre class='mb-0'><code><%= highlight %></code></pre>
7
8
  </div>
8
9
  </div>
@@ -62,7 +62,7 @@ module Bs5
62
62
 
63
63
  @active = @options.delete(:active) || false
64
64
  @disabled = @options.delete(:disabled) || false
65
- @style = @options.delete(:style)
65
+ @color = @options.delete(:color)
66
66
 
67
67
  set_attributes
68
68
  end
@@ -125,7 +125,7 @@ module Bs5
125
125
  class_names = [CLASS_NAME_BASE]
126
126
  class_names << 'active' if active?
127
127
  class_names << 'disabled' if disabled?
128
- class_names << contextual_class if style?
128
+ class_names << contextual_class if color?
129
129
 
130
130
  class_names
131
131
  end
@@ -138,12 +138,12 @@ module Bs5
138
138
  !!@disabled
139
139
  end
140
140
 
141
- def style?
142
- !!@style
141
+ def color?
142
+ !!@color
143
143
  end
144
144
 
145
145
  def contextual_class
146
- [CLASS_NAME_BASE, @style].join('-')
146
+ [CLASS_NAME_BASE, @color].join('-')
147
147
  end
148
148
  end
149
149
  end
@@ -0,0 +1,5 @@
1
+ <%= tag.div(**component_attributes) do %>
2
+ <%- if text %>
3
+ <span class="visually-hidden"><%= text %></span>
4
+ <% end %>
5
+ <% end %>
@@ -0,0 +1,65 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bs5
4
+ class SpinnerComponent < ViewComponent::Base
5
+ STYLES = %i[primary secondary success danger warning info light dark].freeze
6
+ SIZES = { small: :sm, large: :lg }.freeze
7
+
8
+ attr_reader :text, :color, :size, :options
9
+
10
+ include ActiveModel::Validations
11
+ validates :color, style: true, if: -> { color }
12
+
13
+ def initialize(options = {})
14
+ @options = options.symbolize_keys
15
+
16
+ @text = @options.delete(:text)
17
+ @color = @options.delete(:color)&.to_sym
18
+ @grow = @options.delete(:grow)
19
+ @size = @options.delete(:size)&.to_sym
20
+ end
21
+
22
+ def before_render
23
+ raise errors.full_messages.to_sentence if invalid?
24
+ end
25
+
26
+ def component_attributes
27
+ options[:class] = component_class
28
+ options[:role] = 'status'
29
+ options
30
+ end
31
+
32
+ def component_class
33
+ class_names = Array(options[:class])
34
+ class_names << shape_class
35
+ class_names << contextual_class
36
+ class_names << size_class
37
+
38
+ class_names.compact.join(' ')
39
+ end
40
+
41
+ private
42
+
43
+ def shape_class
44
+ grow? ? 'spinner-grow' : 'spinner-border'
45
+ end
46
+
47
+ def contextual_class
48
+ "text-#{@color}" if color
49
+ end
50
+
51
+ def size_class
52
+ return unless size?
53
+
54
+ [shape_class, SIZES[size]].join('-')
55
+ end
56
+
57
+ def grow?
58
+ !!@grow
59
+ end
60
+
61
+ def size?
62
+ !!size
63
+ end
64
+ end
65
+ end
@@ -3,7 +3,7 @@
3
3
  module Bs5
4
4
  module ComponentsHelper
5
5
  COMPONENTS = %w[accordion alert badge close_button breadcrumb button_group button_tag button_to button_toolbar
6
- list_group].freeze
6
+ list_group spinner].freeze
7
7
 
8
8
  COMPONENTS.each do |name|
9
9
  define_method("bs5_#{name}") do |*args, &block|
@@ -1,4 +1,4 @@
1
- <%= bs5_alert(style: :success) do %>
1
+ <%= bs5_alert(color: :success) do %>
2
2
  <h4 class="alert-heading">Well done!</h4>
3
3
  <p>Aww yeah, you successfully read this important alert message. This example text is going to run a bit longer so that you can see how spacing within an alert works with this kind of content.</p>
4
4
  <hr>
@@ -0,0 +1 @@
1
+ <%= bs5_example(snippet: 'alert/color/snippet') %>
@@ -1,31 +1,31 @@
1
- <%= bs5_alert(style: :primary) do %>
1
+ <%= bs5_alert(color: :primary) do %>
2
2
  A simple primary alert—check it out!
3
3
  <%- end %>
4
4
 
5
- <%= bs5_alert(style: :secondary) do %>
5
+ <%= bs5_alert(color: :secondary) do %>
6
6
  A simple secondary alert—check it out!
7
7
  <%- end %>
8
8
 
9
- <%= bs5_alert(style: :success) do %>
9
+ <%= bs5_alert(color: :success) do %>
10
10
  A simple success alert—check it out!
11
11
  <%- end %>
12
12
 
13
- <%= bs5_alert(style: :danger) do %>
13
+ <%= bs5_alert(color: :danger) do %>
14
14
  A simple danger alert—check it out!
15
15
  <%- end %>
16
16
 
17
- <%= bs5_alert(style: :warning) do %>
17
+ <%= bs5_alert(color: :warning) do %>
18
18
  A simple warning alert—check it out!
19
19
  <%- end %>
20
20
 
21
- <%= bs5_alert(style: :info) do %>
21
+ <%= bs5_alert(color: :info) do %>
22
22
  A simple info alert—check it out!
23
23
  <%- end %>
24
24
 
25
- <%= bs5_alert(style: :light) do %>
25
+ <%= bs5_alert(color: :light) do %>
26
26
  A simple light alert—check it out!
27
27
  <%- end %>
28
28
 
29
- <%= bs5_alert(style: :dark) do %>
29
+ <%= bs5_alert(color: :dark) do %>
30
30
  A simple dark alert—check it out!
31
31
  <%- end %>
@@ -1,3 +1,3 @@
1
- <%= bs5_alert(style: :warning, is_dismissable: true) do %>
1
+ <%= bs5_alert(color: :warning, is_dismissable: true) do %>
2
2
  <strong>Holy guacamole!</strong> You should check in on some of those fields below.
3
3
  <%- end %>
@@ -0,0 +1,2 @@
1
+ <h2>Background colors</h2>
2
+ <%= bs5_example(snippet: 'badge/color/snippet') %>
@@ -0,0 +1,8 @@
1
+ <%= bs5_badge(text: 'Primary', color: :primary) %>
2
+ <%= bs5_badge(text: 'Secondary', color: :secondary) %>
3
+ <%= bs5_badge(text: 'Success', color: :success) %>
4
+ <%= bs5_badge(text: 'Danger', color: :danger) %>
5
+ <%= bs5_badge(text: 'Warning', color: :warning) %>
6
+ <%= bs5_badge(text: 'Info', color: :info) %>
7
+ <%= bs5_badge(text: 'Light', color: :light) %>
8
+ <%= bs5_badge(text: 'Dark', color: :dark) %>
@@ -1,3 +1,3 @@
1
1
  <%= bs5_button_tag(type: 'button') do %>
2
- Notifications <%= bs5_badge(text: '4', style: :secondary) %>
2
+ Notifications <%= bs5_badge(text: '4', color: :secondary) %>
3
3
  <% end %>
@@ -1,8 +1,8 @@
1
- <%= bs5_badge(text: 'Primary', style: :primary, pill: true) %>
2
- <%= bs5_badge(text: 'Secondary', style: :secondary, pill: true) %>
3
- <%= bs5_badge(text: 'Sucess', style: :success, pill: true) %>
4
- <%= bs5_badge(text: 'Danger', style: :danger, pill: true) %>
5
- <%= bs5_badge(text: 'Warning', style: :warning, pill: true) %>
6
- <%= bs5_badge(text: 'Info', style: :info, pill: true) %>
7
- <%= bs5_badge(text: 'Light', style: :light, pill: true) %>
8
- <%= bs5_badge(text: 'Dark', style: :dark, pill: true) %>
1
+ <%= bs5_badge(text: 'Primary', color: :primary, pill: true) %>
2
+ <%= bs5_badge(text: 'Secondary', color: :secondary, pill: true) %>
3
+ <%= bs5_badge(text: 'Sucess', color: :success, pill: true) %>
4
+ <%= bs5_badge(text: 'Danger', color: :danger, pill: true) %>
5
+ <%= bs5_badge(text: 'Warning', color: :warning, pill: true) %>
6
+ <%= bs5_badge(text: 'Info', color: :info, pill: true) %>
7
+ <%= bs5_badge(text: 'Light', color: :light, pill: true) %>
8
+ <%= bs5_badge(text: 'Dark', color: :dark, pill: true) %>
@@ -7,12 +7,12 @@
7
7
  <% end %>
8
8
 
9
9
  <%= bs5_button_group(class: 'me-2', aria: { label: 'Second group' }) do %>
10
- <%= bs5_button_tag('5', type: 'button', style: :secondary) %>
11
- <%= bs5_button_tag('6', type: 'button', style: :secondary) %>
12
- <%= bs5_button_tag('7', type: 'button', style: :secondary) %>
10
+ <%= bs5_button_tag('5', type: 'button', color: :secondary) %>
11
+ <%= bs5_button_tag('6', type: 'button', color: :secondary) %>
12
+ <%= bs5_button_tag('7', type: 'button', color: :secondary) %>
13
13
  <% end %>
14
14
 
15
15
  <%= bs5_button_group(aria: { label: 'Third group' }) do %>
16
- <%= bs5_button_tag('8', type: 'button', style: :info) %>
16
+ <%= bs5_button_tag('8', type: 'button', color: :info) %>
17
17
  <% end %>
18
18
  <% end %>
@@ -1,9 +1,9 @@
1
1
  <%= bs5_button_toolbar(class: 'mb-3', aria: { label: 'Toolbar with button groups' }) do %>
2
2
  <%= bs5_button_group(class: 'me-2', aria: { label: 'First group' }) do %>
3
- <%= bs5_button_tag('1', type: 'button', outline: true, style: :secondary) %>
4
- <%= bs5_button_tag('2', type: 'button', outline: true, style: :secondary) %>
5
- <%= bs5_button_tag('3', type: 'button', outline: true, style: :secondary) %>
6
- <%= bs5_button_tag('4', type: 'button', outline: true, style: :secondary) %>
3
+ <%= bs5_button_tag('1', type: 'button', outline: true, color: :secondary) %>
4
+ <%= bs5_button_tag('2', type: 'button', outline: true, color: :secondary) %>
5
+ <%= bs5_button_tag('3', type: 'button', outline: true, color: :secondary) %>
6
+ <%= bs5_button_tag('4', type: 'button', outline: true, color: :secondary) %>
7
7
  <% end %>
8
8
 
9
9
  <div class="input-group">
@@ -14,10 +14,10 @@
14
14
 
15
15
  <%= bs5_button_toolbar(class: 'justify-content-between', aria: { label: 'Toolbar with button groups' }) do %>
16
16
  <%= bs5_button_group(aria: { label: 'First group' }) do %>
17
- <%= bs5_button_tag('1', type: 'button', outline: true, style: :secondary) %>
18
- <%= bs5_button_tag('2', type: 'button', outline: true, style: :secondary) %>
19
- <%= bs5_button_tag('3', type: 'button', outline: true, style: :secondary) %>
20
- <%= bs5_button_tag('4', type: 'button', outline: true, style: :secondary) %>
17
+ <%= bs5_button_tag('1', type: 'button', outline: true, color: :secondary) %>
18
+ <%= bs5_button_tag('2', type: 'button', outline: true, color: :secondary) %>
19
+ <%= bs5_button_tag('3', type: 'button', outline: true, color: :secondary) %>
20
+ <%= bs5_button_tag('4', type: 'button', outline: true, color: :secondary) %>
21
21
  <% end %>
22
22
 
23
23
  <div class="input-group">
@@ -1,17 +1,17 @@
1
1
  <%= bs5_button_group(size: 'large', class: 'mb-2', aria: { label: 'Large button group' }) do %>
2
- <%= bs5_button_tag('Left', type: 'button', style: :dark, outline: true) %>
3
- <%= bs5_button_tag('Middle', type: 'button', style: :dark, outline: true) %>
4
- <%= bs5_button_tag('Right', type: 'button', style: :dark, outline: true) %>
2
+ <%= bs5_button_tag('Left', type: 'button', color: :dark, outline: true) %>
3
+ <%= bs5_button_tag('Middle', type: 'button', color: :dark, outline: true) %>
4
+ <%= bs5_button_tag('Right', type: 'button', color: :dark, outline: true) %>
5
5
  <% end %>
6
6
  <br/>
7
7
  <%= bs5_button_group(class: 'mb-2', aria: { label: 'Default button group' }) do %>
8
- <%= bs5_button_tag('Left', type: 'button', style: :dark, outline: true) %>
9
- <%= bs5_button_tag('Middle', type: 'button', style: :dark, outline: true) %>
10
- <%= bs5_button_tag('Right', type: 'button', style: :dark, outline: true) %>
8
+ <%= bs5_button_tag('Left', type: 'button', color: :dark, outline: true) %>
9
+ <%= bs5_button_tag('Middle', type: 'button', color: :dark, outline: true) %>
10
+ <%= bs5_button_tag('Right', type: 'button', color: :dark, outline: true) %>
11
11
  <% end %>
12
12
  <br/>
13
13
  <%= bs5_button_group(size: :small, aria: { label: 'Small button group' }) do %>
14
- <%= bs5_button_tag('Left', type: 'button', style: :dark, outline: true) %>
15
- <%= bs5_button_tag('Middle', type: 'button', style: :dark, outline: true) %>
16
- <%= bs5_button_tag('Right', type: 'button', style: :dark, outline: true) %>
14
+ <%= bs5_button_tag('Left', type: 'button', color: :dark, outline: true) %>
15
+ <%= bs5_button_tag('Middle', type: 'button', color: :dark, outline: true) %>
16
+ <%= bs5_button_tag('Right', type: 'button', color: :dark, outline: true) %>
17
17
  <% end %>
@@ -1,8 +1,8 @@
1
1
  <%= bs5_button_group(vertical: :true, aria: { label: 'Vertical button group' }) do %>
2
- <%= bs5_button_tag('Button', type: 'button', style: :dark) %>
3
- <%= bs5_button_tag('Button', type: 'button', style: :dark) %>
4
- <%= bs5_button_tag('Button', type: 'button', style: :dark) %>
5
- <%= bs5_button_tag('Button', type: 'button', style: :dark) %>
6
- <%= bs5_button_tag('Button', type: 'button', style: :dark) %>
7
- <%= bs5_button_tag('Button', type: 'button', style: :dark) %>
2
+ <%= bs5_button_tag('Button', type: 'button', color: :dark) %>
3
+ <%= bs5_button_tag('Button', type: 'button', color: :dark) %>
4
+ <%= bs5_button_tag('Button', type: 'button', color: :dark) %>
5
+ <%= bs5_button_tag('Button', type: 'button', color: :dark) %>
6
+ <%= bs5_button_tag('Button', type: 'button', color: :dark) %>
7
+ <%= bs5_button_tag('Button', type: 'button', color: :dark) %>
8
8
  <% end %>
@@ -1,19 +1,19 @@
1
- <%= bs5_button_tag('Primary', style: :primary, outline: true) %>
1
+ <%= bs5_button_tag('Primary', color: :primary, outline: true) %>
2
2
 
3
- <%= bs5_button_tag('Secondary', style: :secondary, outline: true) %>
3
+ <%= bs5_button_tag('Secondary', color: :secondary, outline: true) %>
4
4
 
5
- <%= bs5_button_tag('Success', style: :success, outline: true) %>
5
+ <%= bs5_button_tag('Success', color: :success, outline: true) %>
6
6
 
7
- <%= bs5_button_tag('Danger', style: :danger, outline: true) %>
7
+ <%= bs5_button_tag('Danger', color: :danger, outline: true) %>
8
8
 
9
- <%= bs5_button_tag(style: :warning, outline: true, type: 'button') do %>
9
+ <%= bs5_button_tag(color: :warning, outline: true, type: 'button') do %>
10
10
  <%= tag.strong('Warning') %>
11
11
  <% end %>
12
12
 
13
- <%= bs5_button_tag('Info', style: :info, outline: true) %>
13
+ <%= bs5_button_tag('Info', color: :info, outline: true) %>
14
14
 
15
- <%= bs5_button_tag('Light', style: :light, outline: true) %>
15
+ <%= bs5_button_tag('Light', color: :light, outline: true) %>
16
16
 
17
- <%= bs5_button_tag('Dark', style: :dark, outline: true) %>
17
+ <%= bs5_button_tag('Dark', color: :dark, outline: true) %>
18
18
 
19
- <%= bs5_button_tag('Link', style: :link, outline: true) %>
19
+ <%= bs5_button_tag('Link', color: :link, outline: true) %>
@@ -1,3 +1,3 @@
1
- <%= bs5_button_tag('Large button', style: :primary, size: :large) %>
1
+ <%= bs5_button_tag('Large button', color: :primary, size: :large) %>
2
2
 
3
- <%= bs5_button_tag('Large button', style: :secondary, size: :large) %>
3
+ <%= bs5_button_tag('Large button', color: :secondary, size: :large) %>
@@ -1,3 +1,3 @@
1
- <%= bs5_button_tag('Small button', style: :primary, size: :small) %>
1
+ <%= bs5_button_tag('Small button', color: :primary, size: :small) %>
2
2
 
3
- <%= bs5_button_tag('Small button', style: :secondary, size: :small) %>
3
+ <%= bs5_button_tag('Small button', color: :secondary, size: :small) %>
@@ -1,19 +1,19 @@
1
- <%= bs5_button_tag('Primary', style: :primary) %>
1
+ <%= bs5_button_tag('Primary', color: :primary) %>
2
2
 
3
- <%= bs5_button_tag('Secondary', style: :secondary) %>
3
+ <%= bs5_button_tag('Secondary', color: :secondary) %>
4
4
 
5
- <%= bs5_button_tag('Success', style: :success) %>
5
+ <%= bs5_button_tag('Success', color: :success) %>
6
6
 
7
- <%= bs5_button_tag('Danger', style: :danger) %>
7
+ <%= bs5_button_tag('Danger', color: :danger) %>
8
8
 
9
- <%= bs5_button_tag(style: :warning, type: 'button') do %>
9
+ <%= bs5_button_tag(color: :warning, type: 'button') do %>
10
10
  <%= tag.strong('Warning') %>
11
11
  <% end %>
12
12
 
13
- <%= bs5_button_tag('Info', style: :info) %>
13
+ <%= bs5_button_tag('Info', color: :info) %>
14
14
 
15
- <%= bs5_button_tag('Light', style: :light) %>
15
+ <%= bs5_button_tag('Light', color: :light) %>
16
16
 
17
- <%= bs5_button_tag('Dark', style: :dark) %>
17
+ <%= bs5_button_tag('Dark', color: :dark) %>
18
18
 
19
- <%= bs5_button_tag('Link', style: :link) %>
19
+ <%= bs5_button_tag('Link', color: :link) %>
@@ -1,11 +1,11 @@
1
1
  <div class="d-grid gap-2 d-md-flex">
2
2
  <%= bs5_button_to('New', 'http://www.example.com') %>
3
3
 
4
- <%= bs5_button_to('http://www.example.com', style: :success) do %>
4
+ <%= bs5_button_to('http://www.example.com', color: :success) do %>
5
5
  Make happy <strong>John Doe</strong>
6
6
  <%- end %>
7
7
 
8
- <%= bs5_button_to('New', 'http://www.example.com', style: :dark, outline: true, size: :large, form_class: 'new-thing') %>
8
+ <%= bs5_button_to('New', 'http://www.example.com', color: :dark, outline: true, size: :large, form_class: 'new-thing') %>
9
9
 
10
- <%= bs5_button_to('Destroy', 'http://www.example.com', style: :danger, method: "delete", remote: true, data: { confirm: 'Are you sure?', disable_with: 'loading...' }) %>
10
+ <%= bs5_button_to('Destroy', 'http://www.example.com', color: :danger, method: "delete", remote: true, data: { confirm: 'Are you sure?', disable_with: 'loading...' }) %>
11
11
  </div>
@@ -1,11 +1,11 @@
1
1
  <%= bs5_list_group do |lg| %>
2
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 %>
3
+ <% lg.item(color: :primary) do %><%= link_to 'A simple primary list group item', '#' %><% end %>
4
+ <% lg.item(color: :secondary) do %><%= link_to 'A simple secondary list group item', '#' %><% end %>
5
+ <% lg.item(color: :success) do %><%= link_to 'A simple success list group item', '#' %><% end %>
6
+ <% lg.item(color: :danger) do %><%= link_to 'A simple danger list group item', '#' %><% end %>
7
+ <% lg.item(color: :warning) do %><%= link_to 'A simple warning list group item', '#' %><% end %>
8
+ <% lg.item(color: :info) do %><%= link_to 'A simple info list group item', '#' %><% end %>
9
+ <% lg.item(color: :light) do %><%= link_to 'A simple light list group item', '#' %><% end %>
10
+ <% lg.item(color: :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
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 %>
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 %>
11
11
  <%- end %>
@@ -1,14 +1,14 @@
1
1
  <%= bs5_list_group do |lg| %>
2
2
  <% lg.item(class: 'd-flex justify-content-between align-items-center') do %>
3
3
  Cras justo odio
4
- <%= bs5_badge(text: 14, style: :primary, pill: true) %>
4
+ <%= bs5_badge(text: 14, color: :primary, pill: true) %>
5
5
  <% end %>
6
6
  <% lg.item(class: 'd-flex justify-content-between align-items-center') do %>
7
7
  Dapibus ac facilisis in
8
- <%= bs5_badge(text: 2, style: :primary, pill: true) %>
8
+ <%= bs5_badge(text: 2, color: :primary, pill: true) %>
9
9
  <% end %>
10
10
  <% lg.item(class: 'd-flex justify-content-between align-items-center') do %>
11
11
  Morbi leo risus
12
- <%= bs5_badge(text: 1, style: :primary, pill: true) %>
12
+ <%= bs5_badge(text: 1, color: :primary, pill: true) %>
13
13
  <% end %>
14
14
  <%- end %>
@@ -1 +1 @@
1
- <%= bs5_button_tag('Click to toggle popover', bs5_popover(title: 'Popover title', content: "And here's some amazing content. It's very engaging. Right?").merge(type: 'button', style: :danger, size: :large)) %>
1
+ <%= bs5_button_tag('Click to toggle popover', bs5_popover(title: 'Popover title', content: "And here's some amazing content. It's very engaging. Right?").merge(type: 'button', color: :danger, size: :large)) %>
@@ -1,7 +1,7 @@
1
- <%= bs5_button_tag('Popover on top', bs5_popover(content: "Vivamus sagittis lacus vel augue laoreet rutrum faucibus.", container: :body, placement: :top).merge(type: 'button', style: :secondary)) %>
1
+ <%= bs5_button_tag('Popover on top', bs5_popover(content: "Vivamus sagittis lacus vel augue laoreet rutrum faucibus.", container: :body, placement: :top).merge(type: 'button', color: :secondary)) %>
2
2
 
3
- <%= bs5_button_tag('Popover on right', bs5_popover(content: "Vivamus sagittis lacus vel augue laoreet rutrum faucibus.", container: :body, placement: :right).merge(type: 'button', style: :secondary)) %>
3
+ <%= bs5_button_tag('Popover on right', bs5_popover(content: "Vivamus sagittis lacus vel augue laoreet rutrum faucibus.", container: :body, placement: :right).merge(type: 'button', color: :secondary)) %>
4
4
 
5
- <%= bs5_button_tag('Popover on bottom', bs5_popover(content: "Vivamus sagittis lacus vel augue laoreet rutrum faucibus.", container: :body, placement: :bottom).merge(type: 'button', style: :secondary)) %>
5
+ <%= bs5_button_tag('Popover on bottom', bs5_popover(content: "Vivamus sagittis lacus vel augue laoreet rutrum faucibus.", container: :body, placement: :bottom).merge(type: 'button', color: :secondary)) %>
6
6
 
7
- <%= bs5_button_tag('Popover on left', bs5_popover(content: "Vivamus sagittis lacus vel augue laoreet rutrum faucibus.", container: :body, placement: :left).merge(type: 'button', style: :secondary)) %>
7
+ <%= bs5_button_tag('Popover on left', bs5_popover(content: "Vivamus sagittis lacus vel augue laoreet rutrum faucibus.", container: :body, placement: :left).merge(type: 'button', color: :secondary)) %>
@@ -0,0 +1,2 @@
1
+ <h2>Border spinner</h2>
2
+ <%= bs5_example(snippet: 'spinners/border/snippet') %>
@@ -0,0 +1 @@
1
+ <%= bs5_spinner(text: 'Loading...') %>
@@ -0,0 +1,2 @@
1
+ <h2>Buttons</h2>
2
+ <%= bs5_example(snippet: 'spinners/buttons/snippet') %>
@@ -0,0 +1,15 @@
1
+ <%= bs5_button_tag(disabled: true) do %>
2
+ <%= bs5_spinner(text: 'Loading...', size: :small) %>
3
+ <% end %>
4
+
5
+ <%= bs5_button_tag(disabled: true) do %>
6
+ <%= bs5_spinner(size: :small) %> Loading...
7
+ <% end %>
8
+
9
+ <%= bs5_button_tag(disabled: true) do %>
10
+ <%= bs5_spinner(text: 'Loading...', grow: true, size: :small) %>
11
+ <% end %>
12
+
13
+ <%= bs5_button_tag(disabled: true) do %>
14
+ <%= bs5_spinner(grow: true, size: :small) %> Loading...
15
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <h2>Colors</h2>
2
+ <%= bs5_example(snippet: 'spinners/colors/snippet') %>
@@ -0,0 +1,16 @@
1
+ <%= bs5_spinner(text: 'Loading...', color: :primary) %>
2
+
3
+ <%= bs5_spinner(text: 'Loading...', color: :secondary) %>
4
+
5
+ <%= bs5_spinner(text: 'Loading...', color: :success) %>
6
+
7
+ <%= bs5_spinner(text: 'Loading...', color: :danger) %>
8
+
9
+ <%= bs5_spinner(text: 'Loading...', color: :warning) %>
10
+
11
+ <%= bs5_spinner(text: 'Loading...', color: :info) %>
12
+
13
+ <%= bs5_spinner(text: 'Loading...', color: :light) %>
14
+
15
+ <%= bs5_spinner(text: 'Loading...', color: :dark) %>
16
+
@@ -0,0 +1,3 @@
1
+ <h2>Growing spinner</h2>
2
+ <%= bs5_example(snippet: 'spinners/growing/snippet') %>
3
+ <%= bs5_example(snippet: 'spinners/growing/colors') %>
@@ -0,0 +1,16 @@
1
+ <%= bs5_spinner(text: 'Loading...', color: :primary, grow: true) %>
2
+
3
+ <%= bs5_spinner(text: 'Loading...', color: :secondary, grow: true) %>
4
+
5
+ <%= bs5_spinner(text: 'Loading...', color: :success, grow: true) %>
6
+
7
+ <%= bs5_spinner(text: 'Loading...', color: :danger, grow: true) %>
8
+
9
+ <%= bs5_spinner(text: 'Loading...', color: :warning, grow: true) %>
10
+
11
+ <%= bs5_spinner(text: 'Loading...', color: :info, grow: true) %>
12
+
13
+ <%= bs5_spinner(text: 'Loading...', color: :light, grow: true) %>
14
+
15
+ <%= bs5_spinner(text: 'Loading...', color: :dark, grow: true) %>
16
+
@@ -0,0 +1 @@
1
+ <%= bs5_spinner(text: 'Loading...', grow: true) %>
@@ -0,0 +1,10 @@
1
+ <h2>Alignment</h2>
2
+ <h3>Margin</h3>
3
+ <%= bs5_example(snippet: 'spinners/options/margin') %>
4
+ <h3>Placement</h3>
5
+ <h4>Flex</h4>
6
+ <%= bs5_example(snippet: 'spinners/options/placement_flex1') %>
7
+ <%= bs5_example(snippet: 'spinners/options/placement_flex2') %>
8
+ <h4>Floats</h4>
9
+ <%= bs5_example(snippet: 'spinners/options/floats') %>
10
+ <%= bs5_example(snippet: 'spinners/options/text_align') %>
@@ -0,0 +1,3 @@
1
+ <div class="clearfix">
2
+ <%= bs5_spinner(class: 'float-end', text: 'Loading...') %>
3
+ </div>
@@ -0,0 +1 @@
1
+ <%= bs5_spinner(text: 'Loading...', class: 'm-5') %>
@@ -0,0 +1,3 @@
1
+ <div class="d-flex justify-content-center">
2
+ <%= bs5_spinner(text: 'Loading...') %>
3
+ </div>
@@ -0,0 +1,4 @@
1
+ <div class="d-flex align-items-center">
2
+ <strong>Loading...</strong>
3
+ <%= bs5_spinner(class: 'ms-auto', aria: { hidden: true }) %>
4
+ </div>
@@ -0,0 +1,3 @@
1
+ <div class="text-center">
2
+ <%= bs5_spinner(text: 'Loading...') %>
3
+ </div>
@@ -0,0 +1,3 @@
1
+ <h2>Size</h2>
2
+ <%= bs5_example(snippet: 'spinners/size/size1') %>
3
+ <%= bs5_example(snippet: 'spinners/size/size2') %>
@@ -0,0 +1,7 @@
1
+ <%= bs5_spinner(text: 'Loading...', size: :small) %>
2
+
3
+ <%= bs5_spinner(text: 'Loading...', size: :large) %>
4
+
5
+ <%= bs5_spinner(text: 'Loading...', size: :small, grow: true) %>
6
+
7
+ <%= bs5_spinner(text: 'Loading...', size: :large, grow: true) %>
@@ -0,0 +1,3 @@
1
+ <%= bs5_spinner(text: 'Loading...', style: 'width: 3rem; height: 3rem;') %>
2
+
3
+ <%= bs5_spinner(text: 'Loading...', grow: true, style: 'width: 3rem; height: 3rem;') %>
@@ -1,9 +1,9 @@
1
- <%= bs5_button_tag('Tooltip on top', bs5_tooltip('Tooltip on top', placement: :top).merge(style: :secondary)) %>
1
+ <%= bs5_button_tag('Tooltip on top', bs5_tooltip('Tooltip on top', placement: :top).merge(color: :secondary)) %>
2
2
 
3
- <%= bs5_button_tag('Tooltip on right', bs5_tooltip('Tooltip on right', placement: :right).merge(style: :secondary)) %>
3
+ <%= bs5_button_tag('Tooltip on right', bs5_tooltip('Tooltip on right', placement: :right).merge(color: :secondary)) %>
4
4
 
5
- <%= bs5_button_tag('Tooltip on bottom', bs5_tooltip('Tooltip on bottom', placement: :bottom).merge(style: :secondary)) %>
5
+ <%= bs5_button_tag('Tooltip on bottom', bs5_tooltip('Tooltip on bottom', placement: :bottom).merge(color: :secondary)) %>
6
6
 
7
- <%= bs5_button_tag('Tooltip on left', bs5_tooltip('Tooltip on left', placement: :left).merge(style: :secondary)) %>
7
+ <%= bs5_button_tag('Tooltip on left', bs5_tooltip('Tooltip on left', placement: :left).merge(color: :secondary)) %>
8
8
 
9
- <%= bs5_button_tag('Tooltip with HTML', bs5_tooltip('<em>Tooltip</em> <u>with</u> <b>HTML</b>', html: :true).merge(style: :secondary)) %>
9
+ <%= bs5_button_tag('Tooltip with HTML', bs5_tooltip('<em>Tooltip</em> <u>with</u> <b>HTML</b>', html: :true).merge(color: :secondary)) %>
@@ -1,5 +1,5 @@
1
1
  <h1 id='alert'>Alert</h1>
2
2
  <%= render 'bs5/examples/alert/default/example' %>
3
- <%= render 'bs5/examples/alert/style/example' %>
3
+ <%= render 'bs5/examples/alert/color/example' %>
4
4
  <%= render 'bs5/examples/alert/additional_content/example' %>
5
5
  <%= render 'bs5/examples/alert/dismissable/example' %>
@@ -1,4 +1,4 @@
1
1
  <h1 id='badge'>Badge</h1>
2
2
  <%= render 'bs5/examples/badge/default/example' %>
3
- <%= render 'bs5/examples/badge/style/example' %>
3
+ <%= render 'bs5/examples/badge/color/example' %>
4
4
  <%= render 'bs5/examples/badge/pill/example' %>
@@ -0,0 +1,7 @@
1
+ <h1>Spinners</h1>
2
+ <%= render 'bs5/examples/spinners/border/example' %>
3
+ <%= render 'bs5/examples/spinners/colors/example' %>
4
+ <%= render 'bs5/examples/spinners/growing/example' %>
5
+ <%= render 'bs5/examples/spinners/options/example' %>
6
+ <%= render 'bs5/examples/spinners/size/example' %>
7
+ <%= render 'bs5/examples/spinners/buttons/example' %>
@@ -4,6 +4,7 @@
4
4
  <title>Bs5</title>
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
7
+ <%= javascript_include_tag 'bs5/application', 'data-turbolinks-track': 'reload' %>
7
8
  <%= stylesheet_pack_tag 'styles', media: 'all', 'data-turbolinks-track': 'reload' %>
8
9
  <style><%= Rouge::Themes::Github.render(scope: '.highlight') %></style>
9
10
  </head>
@@ -23,6 +24,7 @@
23
24
  <% lg.item(active: current_page?(pages_path('collapse'))) do %><%= link_to 'Collapse', pages_path('collapse') %><% end %>
24
25
  <% lg.item(active: current_page?(pages_path('list_group'))) do %><%= link_to 'List group', pages_path('list_group') %><% end %>
25
26
  <% lg.item(active: current_page?(pages_path('popovers'))) do %><%= link_to 'Popovers', pages_path('popovers') %><% end %>
27
+ <% lg.item(active: current_page?(pages_path('spinners'))) do %><%= link_to 'Spinners', pages_path('spinners') %><% end %>
26
28
  <% lg.item(active: current_page?(pages_path('tooltips'))) do %><%= link_to 'Tooltips', pages_path('tooltips') %><% end %>
27
29
  <%- end %>
28
30
  </div>
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'view_component/engine'
4
+ require 'sprockets/railtie'
4
5
  module Bs5
5
6
  class Engine < ::Rails::Engine
6
7
  isolate_namespace Bs5
@@ -9,5 +10,10 @@ module Bs5
9
10
  config.before_configuration do |app|
10
11
  app.config.view_component.preview_paths << "#{Bs5::Engine.root}/spec/components/previews"
11
12
  end
13
+
14
+ initializer 'bs5.assets.precompile' do |app|
15
+ app.config.assets.paths << Rails.root.join('app/assets/javascripts')
16
+ app.config.assets.precompile << 'bs5/application.js'
17
+ end
12
18
  end
13
19
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bs5
4
- VERSION = '0.0.19'
4
+ VERSION = '0.0.24'
5
5
  end
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ return unless defined?(RuboCop)
4
+
3
5
  require 'rubocop/rake_task'
4
6
 
5
7
  RuboCop::RakeTask.new(:rubocop)
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.19
4
+ version: 0.0.24
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-12 00:00:00.000000000 Z
11
+ date: 2020-12-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -100,20 +100,6 @@ dependencies:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
102
  version: 4.0.1
103
- - !ruby/object:Gem::Dependency
104
- name: rubocop-rails
105
- requirement: !ruby/object:Gem::Requirement
106
- requirements:
107
- - - "~>"
108
- - !ruby/object:Gem::Version
109
- version: '2.8'
110
- type: :development
111
- prerelease: false
112
- version_requirements: !ruby/object:Gem::Requirement
113
- requirements:
114
- - - "~>"
115
- - !ruby/object:Gem::Version
116
- version: '2.8'
117
103
  - !ruby/object:Gem::Dependency
118
104
  name: sqlite3
119
105
  requirement: !ruby/object:Gem::Requirement
@@ -139,6 +125,7 @@ files:
139
125
  - README.md
140
126
  - Rakefile
141
127
  - app/assets/config/bs5_manifest.js
128
+ - app/assets/javascripts/bs5/application.js
142
129
  - app/assets/stylesheets/bs5/application.css
143
130
  - app/components/bs5/accordion_component.html.erb
144
131
  - app/components/bs5/accordion_component.rb
@@ -160,6 +147,8 @@ files:
160
147
  - app/components/bs5/example_component.rb
161
148
  - app/components/bs5/list_group_component.html.erb
162
149
  - app/components/bs5/list_group_component.rb
150
+ - app/components/bs5/spinner_component.html.erb
151
+ - app/components/bs5/spinner_component.rb
163
152
  - app/controllers/bs5/application_controller.rb
164
153
  - app/controllers/bs5/pages_controller.rb
165
154
  - app/helpers/bs5/application_helper.rb
@@ -176,19 +165,19 @@ files:
176
165
  - app/views/bs5/examples/accordion/flush/snippet.html.erb
177
166
  - app/views/bs5/examples/alert/additional_content/_example.html.erb
178
167
  - app/views/bs5/examples/alert/additional_content/snippet.html.erb
168
+ - app/views/bs5/examples/alert/color/_example.html.erb
169
+ - app/views/bs5/examples/alert/color/snippet.html.erb
179
170
  - app/views/bs5/examples/alert/default/_example.html.erb
180
171
  - app/views/bs5/examples/alert/default/snippet.html.erb
181
172
  - app/views/bs5/examples/alert/dismissable/_example.html.erb
182
173
  - app/views/bs5/examples/alert/dismissable/snippet.html.erb
183
- - app/views/bs5/examples/alert/style/_example.html.erb
184
- - app/views/bs5/examples/alert/style/snippet.html.erb
174
+ - app/views/bs5/examples/badge/color/_example.html.erb
175
+ - app/views/bs5/examples/badge/color/snippet.html.erb
185
176
  - app/views/bs5/examples/badge/default/_example.html.erb
186
177
  - app/views/bs5/examples/badge/default/button.html.erb
187
178
  - app/views/bs5/examples/badge/default/snippet.html.erb
188
179
  - app/views/bs5/examples/badge/pill/_example.html.erb
189
180
  - app/views/bs5/examples/badge/pill/snippet.html.erb
190
- - app/views/bs5/examples/badge/style/_example.html.erb
191
- - app/views/bs5/examples/badge/style/snippet.html.erb
192
181
  - app/views/bs5/examples/breadcrumb/default/_example.html.erb
193
182
  - app/views/bs5/examples/breadcrumb/default/snippet.html.erb
194
183
  - app/views/bs5/examples/button_group/button_toolbar/_example.html.erb
@@ -258,6 +247,24 @@ files:
258
247
  - app/views/bs5/examples/popovers/dismissable_on_next_click/snippet.html.erb
259
248
  - app/views/bs5/examples/popovers/four_directions/_example.html.erb
260
249
  - app/views/bs5/examples/popovers/four_directions/snippet.html.erb
250
+ - app/views/bs5/examples/spinners/border/_example.html.erb
251
+ - app/views/bs5/examples/spinners/border/snippet.html.erb
252
+ - app/views/bs5/examples/spinners/buttons/_example.html.erb
253
+ - app/views/bs5/examples/spinners/buttons/snippet.html.erb
254
+ - app/views/bs5/examples/spinners/colors/_example.html.erb
255
+ - app/views/bs5/examples/spinners/colors/snippet.html.erb
256
+ - app/views/bs5/examples/spinners/growing/_example.html.erb
257
+ - app/views/bs5/examples/spinners/growing/colors.html.erb
258
+ - app/views/bs5/examples/spinners/growing/snippet.html.erb
259
+ - app/views/bs5/examples/spinners/options/_example.html.erb
260
+ - app/views/bs5/examples/spinners/options/floats.html.erb
261
+ - app/views/bs5/examples/spinners/options/margin.html.erb
262
+ - app/views/bs5/examples/spinners/options/placement_flex1.html.erb
263
+ - app/views/bs5/examples/spinners/options/placement_flex2.html.erb
264
+ - app/views/bs5/examples/spinners/options/text_align.html.erb
265
+ - app/views/bs5/examples/spinners/size/_example.html.erb
266
+ - app/views/bs5/examples/spinners/size/size1.html.erb
267
+ - app/views/bs5/examples/spinners/size/size2.html.erb
261
268
  - app/views/bs5/examples/tooltips/default/_example.html.erb
262
269
  - app/views/bs5/examples/tooltips/default/buttons.html.erb
263
270
  - app/views/bs5/examples/tooltips/default/disabled_elements.html.erb
@@ -272,6 +279,7 @@ files:
272
279
  - app/views/bs5/pages/collapse.html.erb
273
280
  - app/views/bs5/pages/list_group.html.erb
274
281
  - app/views/bs5/pages/popovers.html.erb
282
+ - app/views/bs5/pages/spinners.html.erb
275
283
  - app/views/bs5/pages/tooltips.html.erb
276
284
  - app/views/layouts/bs5/application.html.erb
277
285
  - app/views/layouts/bs5/pages.html.erb
@@ -1,2 +0,0 @@
1
- <h2>Style</h2>
2
- <%= bs5_example(snippet: 'alert/style/snippet') %>
@@ -1,2 +0,0 @@
1
- <h2>Background colors</h2>
2
- <%= bs5_example(snippet: 'badge/style/snippet') %>
@@ -1,8 +0,0 @@
1
- <%= bs5_badge(text: 'Primary', style: :primary) %>
2
- <%= bs5_badge(text: 'Secondary', style: :secondary) %>
3
- <%= bs5_badge(text: 'Success', style: :success) %>
4
- <%= bs5_badge(text: 'Danger', style: :danger) %>
5
- <%= bs5_badge(text: 'Warning', style: :warning) %>
6
- <%= bs5_badge(text: 'Info', style: :info) %>
7
- <%= bs5_badge(text: 'Light', style: :light) %>
8
- <%= bs5_badge(text: 'Dark', style: :dark) %>