@open-rlb/ng-bootstrap 3.3.41 → 3.3.42

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.
@@ -1,8 +1,7 @@
1
- @use "sass:color";
2
- //
1
+ @use 'sass:color';
2
+ //
3
3
  // _badge.scss
4
- //
5
-
4
+ //
6
5
 
7
6
  .badge {
8
7
  &[href] {
@@ -30,42 +29,58 @@
30
29
 
31
30
  @each $color, $value in $theme-colors {
32
31
  .badge {
33
- &.bg-#{$color} {
34
- &[href] {
35
- &:hover,
36
- &:focus {
37
- background-color: color.adjust($value, $lightness: -4%) !important;
32
+ &.bg-#{$color} {
33
+ &[href] {
34
+ &:hover,
35
+ &:focus {
36
+ background-color: color.adjust($value, $lightness: -4%) !important;
37
+ }
38
38
  }
39
39
  }
40
40
  }
41
- }
42
41
 
43
- .badge{
44
- &.bg-light{
45
- color: var(--#{$prefix}body-color);
42
+ .badge {
43
+ &.bg-light {
44
+ color: var(--#{$prefix}body-color);
46
45
 
47
- &[href] {
48
- &:hover,
49
- &:focus {
50
- color: var(--#{$prefix}body-color);
46
+ &[href] {
47
+ &:hover,
48
+ &:focus {
49
+ color: var(--#{$prefix}body-color);
50
+ }
51
51
  }
52
52
  }
53
53
  }
54
- }
55
54
 
56
- .badge-soft-#{$color} {
57
- @include badge-variant-soft($value);
55
+ .badge-soft-#{$color} {
56
+ @include badge-variant-soft($value);
58
57
  }
59
-
60
58
  }
61
59
 
62
- .rounded-pill{
63
- padding-right: .6em;
64
- padding-left: .6em;
60
+ .rounded-pill {
61
+ padding-right: 0.6em;
62
+ padding-left: 0.6em;
65
63
  }
66
64
 
67
65
  // Dark badge
68
66
 
69
- .badge.bg-dark{
67
+ .badge.bg-dark {
70
68
  color: var(--#{$prefix}light);
71
- }
69
+ }
70
+
71
+ // Bootstrap sizes the badge around the font's em box (line-height: 1 plus symmetric padding) and
72
+ // places text on the baseline, so the box always reserves descender room below the baseline. Digits
73
+ // and capitals never use it, leaving the glyphs visibly high in the pill — by 2.8px at a 10.8px font
74
+ // size. Trimming to cap-height..baseline makes the padding wrap the real glyph box instead, so every
75
+ // badge centres identically regardless of its content or its rendered size.
76
+ //
77
+ // Firefox has not shipped text-box-trim: without the @supports guard it would take the padding bump
78
+ // without the trim, which is worse than the status quo.
79
+ @supports (text-box: trim-both cap alphabetic) {
80
+ .badge {
81
+ text-box: trim-both cap alphabetic;
82
+ // Drive Bootstrap's own custom property rather than padding-top/bottom, so consumer overrides
83
+ // and py-* utilities still compose.
84
+ --#{$prefix}badge-padding-y: #{$badge-padding-y-trimmed};
85
+ }
86
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-rlb/ng-bootstrap",
3
- "version": "3.3.41",
3
+ "version": "3.3.42",
4
4
  "peerDependencies": {
5
5
  "@angular/cdk": ">=21.0.0 <22.0.0",
6
6
  "@angular/common": ">=21.0.0 <22.0.0",
@@ -205,24 +205,55 @@ type TextAlignment = 'left' | 'center' | 'right';
205
205
 
206
206
  ## Tabs
207
207
 
208
+ `rlb-tabs` holds the tab strip; `rlb-tab-content` holds the panes. Each `rlb-tab`'s `target`
209
+ must equal its `rlb-tab-pane`'s `id`. Seed the initially-open tab/pane with `active`. The tab
210
+ label is projected content, so you can put a `rlb-badge` count inside it.
211
+
208
212
  ```html
209
- <rlb-tabs
210
- view="tab"
211
- [vertical]="false"
212
- fill="fill"
213
- >
214
- <rlb-tab title="Tab 1">Content for tab 1</rlb-tab>
215
- <rlb-tab title="Tab 2">Content for tab 2</rlb-tab>
213
+ <rlb-tabs view="tab">
214
+ <rlb-tab
215
+ target="home"
216
+ active
217
+ >
218
+ Home
219
+ </rlb-tab>
220
+ <rlb-tab target="profile">
221
+ Profile
222
+ <span
223
+ rlb-badge
224
+ color="secondary"
225
+ [pill]="true"
226
+ >
227
+ 3
228
+ </span>
229
+ </rlb-tab>
216
230
  <rlb-tab
217
- title="Tab 3"
231
+ target="messages"
218
232
  [disabled]="true"
219
233
  >
220
- Disabled
234
+ Messages
221
235
  </rlb-tab>
222
236
  </rlb-tabs>
237
+
238
+ <rlb-tab-content>
239
+ <rlb-tab-pane
240
+ id="home"
241
+ active
242
+ >
243
+ Home content.
244
+ </rlb-tab-pane>
245
+ <rlb-tab-pane id="profile">Profile content.</rlb-tab-pane>
246
+ <rlb-tab-pane id="messages">Messages content.</rlb-tab-pane>
247
+ </rlb-tab-content>
223
248
  ```
224
249
 
225
- **Inputs:** `view` ('tab'|'pills'|'underline'|'none'), `vertical`, `fill` ('fill'|'justified'), `horizontal-alignment` ('center'|'end'), `id`, `class`
250
+ **`rlb-tabs` inputs:** `view` ('tab'|'pills'|'underline'|'none'), `vertical`, `fill` ('fill'|'justified'), `horizontal-alignment` ('center'|'end'), `id`, `class`
251
+ **`rlb-tab` inputs:** `target` (**required** — matches a pane `id`), `active`, `disabled`, `class`
252
+ **`rlb-tab-pane` inputs:** `id` (**required**), `active`, `fade`
253
+
254
+ > Switching is driven by Bootstrap's tab plugin — there is **no select/change output**, and
255
+ > `active` only seeds the initial tab. For router-controlled or deep-linked tabs (active state
256
+ > lives in the URL), drive the markup yourself with plain `nav-tabs` instead.
226
257
 
227
258
  ---
228
259