bs5 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +45 -3
- data/app/components/bs5/alert_component.html.erb +1 -1
- data/app/components/bs5/close_button_component.html.erb +7 -0
- data/app/components/bs5/close_button_component.rb +29 -0
- data/app/helpers/bs5/components_helper.rb +4 -0
- data/lib/bs5/version.rb +1 -1
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f4eeed7da6108bdb379e711c57a906f8cd5bc66730e0a79485f941b5a1a29651
|
4
|
+
data.tar.gz: 6b2819922250d5b3449def44bcde45703115fdd234697dbfd8476827d485fe0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e034c5d510d1d5518bf505f7c40566db8898e2daedfd051e85312c3ab21b772604f9142cce65bf571564631b0832d6c7510f681bbdc5e1bce31fbe14c533588
|
7
|
+
data.tar.gz: 4c54522c6bb42cf7485a174ec6675e122211beb3b6e329507576237f15be6bfef0acd795cd76eebc969c9883a9cbd4f69b45067873d8d05b6703093473ad1ce0
|
data/README.md
CHANGED
@@ -36,7 +36,31 @@ Run the following command to setup your project to use Bootstrap 5.
|
|
36
36
|
|
37
37
|
## Components
|
38
38
|
|
39
|
-
|
39
|
+
- [Accordion](#accordion) ✅
|
40
|
+
- [Alert](#alert) ✅
|
41
|
+
- [Badge](#badge) ✅
|
42
|
+
- Breadcrumb
|
43
|
+
- Buttons
|
44
|
+
- Button group
|
45
|
+
- Card
|
46
|
+
- Carousel
|
47
|
+
- [Close button](#close-button) ✅
|
48
|
+
- Collapse
|
49
|
+
- Dropdowns
|
50
|
+
- List group
|
51
|
+
- Modal
|
52
|
+
- Nav & tabs
|
53
|
+
- Navbar
|
54
|
+
- Pagination
|
55
|
+
- Popovers
|
56
|
+
- Progress
|
57
|
+
- Scrollspy
|
58
|
+
- Spinners
|
59
|
+
- Toasts
|
60
|
+
- Tooltips
|
61
|
+
|
62
|
+
|
63
|
+
### [Accordion](https://v5.getbootstrap.com/docs/5.0/components/accordion/)
|
40
64
|
|
41
65
|
```
|
42
66
|
<%= bs5_accordion do |accordion| %>
|
@@ -66,7 +90,7 @@ Run the following command to setup your project to use Bootstrap 5.
|
|
66
90
|
<%- end %>
|
67
91
|
```
|
68
92
|
|
69
|
-
### [Alert](https://v5.getbootstrap.com/docs/5.0/components/alerts/)
|
93
|
+
### [Alert](https://v5.getbootstrap.com/docs/5.0/components/alerts/)
|
70
94
|
|
71
95
|
```
|
72
96
|
<%= bs5_alert do %>
|
@@ -80,7 +104,7 @@ Run the following command to setup your project to use Bootstrap 5.
|
|
80
104
|
<%- end %>
|
81
105
|
```
|
82
106
|
|
83
|
-
### [Badge](https://v5.getbootstrap.com/docs/5.0/components/badge/)
|
107
|
+
### [Badge](https://v5.getbootstrap.com/docs/5.0/components/badge/)
|
84
108
|
|
85
109
|
```
|
86
110
|
<%= bs5_badge(text: 'New') %>
|
@@ -99,6 +123,24 @@ Run the following command to setup your project to use Bootstrap 5.
|
|
99
123
|
|
100
124
|
### [Button](https://v5.getbootstrap.com/docs/5.0/components/buttons/)
|
101
125
|
|
126
|
+
### [Close button](https://v5.getbootstrap.com/docs/5.0/components/close-button/)
|
127
|
+
|
128
|
+
```
|
129
|
+
<%= bs5_close_button %>
|
130
|
+
```
|
131
|
+
|
132
|
+
```
|
133
|
+
<%= bs5_close_button(disabled: true) %>
|
134
|
+
```
|
135
|
+
|
136
|
+
```
|
137
|
+
<%= bs5_close_button(white: true) %>
|
138
|
+
```
|
139
|
+
|
140
|
+
```
|
141
|
+
<%= bs5_close_button(data: { controller: 'hello', action: "click->hello#greet }) %>
|
142
|
+
```
|
143
|
+
|
102
144
|
## Previewing components
|
103
145
|
|
104
146
|
- http://localhost:3000/rails/view_components
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div class="<%= component_class %>" role="alert">
|
2
2
|
<%= content %>
|
3
3
|
<%- if is_dismissable %>
|
4
|
-
|
4
|
+
<%= render Bs5::CloseButtonComponent.new(data: { dismiss: :alert }) %>
|
5
5
|
<%- end %>
|
6
6
|
</div>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Bs5
|
4
|
+
class CloseButtonComponent < ViewComponent::Base
|
5
|
+
attr_reader :data
|
6
|
+
|
7
|
+
def initialize(disabled: false, white: false, data: nil)
|
8
|
+
@disabled = disabled
|
9
|
+
@white = white
|
10
|
+
@data = data
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def white?
|
16
|
+
@white
|
17
|
+
end
|
18
|
+
|
19
|
+
def disabled?
|
20
|
+
@disabled
|
21
|
+
end
|
22
|
+
|
23
|
+
def component_class
|
24
|
+
class_names = ['btn-close']
|
25
|
+
class_names << %w[btn-close-white] if white?
|
26
|
+
class_names.join(' ')
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
data/lib/bs5/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bs5
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Patrick Baselier
|
@@ -104,6 +104,8 @@ files:
|
|
104
104
|
- app/components/bs5/alert_component.rb
|
105
105
|
- app/components/bs5/badge_component.html.erb
|
106
106
|
- app/components/bs5/badge_component.rb
|
107
|
+
- app/components/bs5/close_button_component.html.erb
|
108
|
+
- app/components/bs5/close_button_component.rb
|
107
109
|
- app/controllers/bs5/application_controller.rb
|
108
110
|
- app/helpers/bs5/application_helper.rb
|
109
111
|
- app/helpers/bs5/components_helper.rb
|