sdr_view_components 0.20.0 → 0.21.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 +2 -2
- data/app/assets/sdr_view_components.css +15 -29
- data/app/components/sdr_view_components/forms/toggle_component.rb +5 -0
- data/app/components/sdr_view_components/forms/toggle_option_component.rb +2 -1
- data/lib/sdr_view_components/configuration.rb +1 -1
- data/lib/sdr_view_components/version.rb +1 -1
- 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: 9de1e10f3e04a4a00b584e85fa5b06d862916a2e403e7ab3966020e04ec3deb0
|
|
4
|
+
data.tar.gz: 2df79a660409c1bed817b6823d81c6718d052026434611757f3883604b5d9411
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 94cd03e80e3fdca7e03e83456141569c53d888ec7a3ace284a6a0a9ceca187ae76471b859d3d5d3696b6311dbaa603e70f0516d4173532565cfd2ea81c6b306b
|
|
7
|
+
data.tar.gz: 31b2838609b00ac1171421cf4481e82c6db92695309e38687cff917f2c585b983f60c2e7dda7500b496e31b38465e2c02f8f5876cb15480e983c8bdc30342e51
|
data/README.md
CHANGED
|
@@ -19,7 +19,7 @@ gem 'sdr_view_components'
|
|
|
19
19
|
This set of components relies on the component library stylesheets, add:
|
|
20
20
|
|
|
21
21
|
```
|
|
22
|
-
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sul-dlss/component-library@
|
|
22
|
+
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/sul-dlss/component-library@v2026-09-28/styles/sul.css">
|
|
23
23
|
<%= stylesheet_link_tag "sdr_view_components", "data-turbo-track": "reload" %>
|
|
24
24
|
```
|
|
25
25
|
|
|
@@ -287,7 +287,7 @@ The [component-library](https://github.com/sul-dlss/component-library/) version
|
|
|
287
287
|
```
|
|
288
288
|
def initialize
|
|
289
289
|
# Default URL for the component library assets
|
|
290
|
-
@component_library_url = 'https://cdn.jsdelivr.net/gh/sul-dlss/component-library@v2026-
|
|
290
|
+
@component_library_url = 'https://cdn.jsdelivr.net/gh/sul-dlss/component-library@v2026-09-28'
|
|
291
291
|
end
|
|
292
292
|
```
|
|
293
293
|
|
|
@@ -8,35 +8,10 @@
|
|
|
8
8
|
font-size: 2.25rem;
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
/* Toggle
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
.btn-group-toggle input:checked + label {
|
|
17
|
-
background-color: var(--bs-primary);
|
|
18
|
-
border-color: var(--bs-primary);
|
|
19
|
-
color: #fff;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.btn-group-toggle input:not(:checked) + label {
|
|
23
|
-
background-color: transparent;
|
|
24
|
-
border-color: var(--bs-primary);
|
|
25
|
-
color: var(--bs-primary);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.btn-group-toggle .btn-check:checked + .btn {
|
|
29
|
-
background-color: var(--stanford-digital-blue);
|
|
30
|
-
border-color: var(--stanford-digital-blue);
|
|
31
|
-
color: #fff;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.btn-group-toggle :not(.btn-check:checked) + .btn {
|
|
35
|
-
color: var(--stanford-digital-blue);
|
|
36
|
-
border-color: var(--stanford-digital-blue);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.btn-group-toggle input:checked + label::before {
|
|
11
|
+
/* Toggle: the component library's .toggle-radio styles, plus a checkmark on the selected option.
|
|
12
|
+
A toggle of links (e.g., for switching views) marks the selected link with .active in place of :checked. */
|
|
13
|
+
.toggle-radio .btn-check:checked + .btn::before,
|
|
14
|
+
.toggle-radio .btn.active::before {
|
|
40
15
|
display: inline-block;
|
|
41
16
|
margin-right: 3px;
|
|
42
17
|
font-family: bootstrap-icons;
|
|
@@ -44,6 +19,17 @@
|
|
|
44
19
|
content: "\F633";
|
|
45
20
|
}
|
|
46
21
|
|
|
22
|
+
/* Bootstrap styles a hovered radio label (.btn-check + .btn:hover) but not a hovered link,
|
|
23
|
+
so keep a link's colors on hover and, like a checked option, leave the selected one un-underlined. */
|
|
24
|
+
.toggle-radio .btn-group a.btn {
|
|
25
|
+
--bs-btn-hover-bg: var(--bs-btn-bg);
|
|
26
|
+
--bs-btn-hover-color: var(--bs-btn-color);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.toggle-radio .btn-group .btn.active:hover {
|
|
30
|
+
--btn-hover-decoration: none;
|
|
31
|
+
}
|
|
32
|
+
|
|
47
33
|
/* Icon buttons */
|
|
48
34
|
.icon-button.btn {
|
|
49
35
|
--bs-btn-bg: transparent;
|
|
@@ -18,8 +18,9 @@ module SdrViewComponents
|
|
|
18
18
|
|
|
19
19
|
attr_reader :form, :field_name, :label, :value, :data
|
|
20
20
|
|
|
21
|
+
# The component library's toggle-radio styles round each option, so no rounding classes are added here.
|
|
21
22
|
def label_classes
|
|
22
|
-
|
|
23
|
+
'btn'
|
|
23
24
|
end
|
|
24
25
|
end
|
|
25
26
|
end
|
|
@@ -8,7 +8,7 @@ module SdrViewComponents
|
|
|
8
8
|
|
|
9
9
|
def initialize
|
|
10
10
|
# Default URL for the component library assets
|
|
11
|
-
@component_library_url = 'https://cdn.jsdelivr.net/gh/sul-dlss/component-library@v2026-
|
|
11
|
+
@component_library_url = 'https://cdn.jsdelivr.net/gh/sul-dlss/component-library@v2026-09-28'
|
|
12
12
|
end
|
|
13
13
|
end
|
|
14
14
|
|