bulma-phlex 0.6.0 → 0.7.0
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.
- checksums.yaml +4 -4
- data/README.md +9 -1
- data/lib/bulma_phlex/version.rb +1 -1
- data/lib/components/bulma/navigation_bar.rb +16 -3
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 5caa2176372f45d0002153e7a4272e79bd3ae01eb530e58c16a29864a3e90c09
|
|
4
|
+
data.tar.gz: 4ed606f6cb03296a7c0c52eccbe2e31bb2c7eb1c0e2fbbaef1510f8ad8f7d48f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2d3173c063bb8fc27fa653b34a2f4a57d6b653c313361d1bd1661d13feb760a31e5f8a102407a4024c5e48671031ae5d1b11b6d3414d38b17a3d43d38b2c3918
|
|
7
|
+
data.tar.gz: 9ec45c90c5060eb1d812d939ae03687c1027ed49c3959bf3f8855216c4e331c7ebb221f4a46903022a0a0d753cebab4a9ff0465528b5dfa424ce37e9b6b7340e
|
data/README.md
CHANGED
|
@@ -155,7 +155,7 @@ end
|
|
|
155
155
|
The [NavigationBar](https://bulma.io/documentation/components/navbar/) component provides a responsive navigation header with support for branding, navigation links, and dropdown menus.
|
|
156
156
|
|
|
157
157
|
```ruby
|
|
158
|
-
Bulma::NavigationBar() do |navbar|
|
|
158
|
+
Bulma::NavigationBar(classes: "is-primary") do |navbar|
|
|
159
159
|
navbar.brand_item "My App", "/"
|
|
160
160
|
|
|
161
161
|
navbar.left do |menu|
|
|
@@ -176,6 +176,14 @@ Bulma::NavigationBar() do |navbar|
|
|
|
176
176
|
end
|
|
177
177
|
```
|
|
178
178
|
|
|
179
|
+
**Constructor Keyword Arguments:**
|
|
180
|
+
|
|
181
|
+
- `classes`: Additional classes to be added to the `nav` element, such as "is-primary" or "has-shadow".
|
|
182
|
+
- `container`: When true, wraps the content in a Bulma container. To set a constraint, such as "is-max-desktop", pass that string instead of true. (defaults to false)
|
|
183
|
+
|
|
184
|
+
> [!NOTE]
|
|
185
|
+
> Adding a container will limit the width of the Navigation Bar content according to Bulma's container rules. The background color of the navbar will still span the full width of the viewport.
|
|
186
|
+
|
|
179
187
|
### Pagination
|
|
180
188
|
|
|
181
189
|
The [Pagination](https://bulma.io/documentation/components/pagination/) component provides navigation controls for paginated content, including previous/next links, page number links, and a summary of items being displayed.
|
data/lib/bulma_phlex/version.rb
CHANGED
|
@@ -36,7 +36,9 @@ module Components
|
|
|
36
36
|
# ```
|
|
37
37
|
#
|
|
38
38
|
class NavigationBar < Components::Bulma::Base
|
|
39
|
-
def initialize
|
|
39
|
+
def initialize(container: false, classes: "")
|
|
40
|
+
@container = container
|
|
41
|
+
@classes = classes
|
|
40
42
|
@brand = []
|
|
41
43
|
@left = []
|
|
42
44
|
@right = []
|
|
@@ -45,11 +47,11 @@ module Components
|
|
|
45
47
|
def view_template(&)
|
|
46
48
|
vanish(&)
|
|
47
49
|
|
|
48
|
-
nav(class: "navbar
|
|
50
|
+
nav(class: "navbar #{@classes}".rstrip,
|
|
49
51
|
role: "navigation",
|
|
50
52
|
aria_label: "main navigation",
|
|
51
53
|
data: { controller: "bulma--navigation-bar" }) do
|
|
52
|
-
|
|
54
|
+
optional_container do
|
|
53
55
|
div(class: "navbar-brand") do
|
|
54
56
|
@brand.each(&:call)
|
|
55
57
|
|
|
@@ -90,6 +92,17 @@ module Components
|
|
|
90
92
|
def right(&block)
|
|
91
93
|
@right << block
|
|
92
94
|
end
|
|
95
|
+
|
|
96
|
+
private
|
|
97
|
+
|
|
98
|
+
def optional_container(&)
|
|
99
|
+
if @container
|
|
100
|
+
constraint = @container if @container.is_a?(String) || @container.is_a?(Symbol)
|
|
101
|
+
div(class: "container #{constraint}".rstrip, &)
|
|
102
|
+
else
|
|
103
|
+
yield
|
|
104
|
+
end
|
|
105
|
+
end
|
|
93
106
|
end
|
|
94
107
|
end
|
|
95
108
|
end
|