bootstrap 5.0.2 → 5.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/javascripts/bootstrap-sprockets.js +7 -7
  4. data/assets/javascripts/bootstrap.js +590 -580
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +73 -43
  7. data/assets/javascripts/bootstrap/base-component.js +15 -10
  8. data/assets/javascripts/bootstrap/button.js +13 -6
  9. data/assets/javascripts/bootstrap/carousel.js +26 -8
  10. data/assets/javascripts/bootstrap/collapse.js +96 -114
  11. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  12. data/assets/javascripts/bootstrap/dom/event-handler.js +9 -2
  13. data/assets/javascripts/bootstrap/dom/manipulator.js +4 -4
  14. data/assets/javascripts/bootstrap/dom/selector-engine.js +47 -5
  15. data/assets/javascripts/bootstrap/dropdown.js +66 -74
  16. data/assets/javascripts/bootstrap/modal.js +198 -52
  17. data/assets/javascripts/bootstrap/offcanvas.js +177 -31
  18. data/assets/javascripts/bootstrap/popover.js +19 -52
  19. data/assets/javascripts/bootstrap/scrollspy.js +28 -47
  20. data/assets/javascripts/bootstrap/tab.js +27 -8
  21. data/assets/javascripts/bootstrap/toast.js +108 -13
  22. data/assets/javascripts/bootstrap/tooltip.js +57 -47
  23. data/assets/stylesheets/_bootstrap-grid.scss +1 -1
  24. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  25. data/assets/stylesheets/_bootstrap.scss +2 -1
  26. data/assets/stylesheets/bootstrap/_card.scss +2 -1
  27. data/assets/stylesheets/bootstrap/_functions.scss +45 -12
  28. data/assets/stylesheets/bootstrap/_grid.scss +11 -0
  29. data/assets/stylesheets/bootstrap/_helpers.scss +2 -0
  30. data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
  31. data/assets/stylesheets/bootstrap/_modal.scss +1 -11
  32. data/assets/stylesheets/bootstrap/_navbar.scss +30 -1
  33. data/assets/stylesheets/bootstrap/_offcanvas.scss +4 -0
  34. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  35. data/assets/stylesheets/bootstrap/_reboot.scss +12 -8
  36. data/assets/stylesheets/bootstrap/_root.scss +39 -2
  37. data/assets/stylesheets/bootstrap/_toasts.scss +2 -2
  38. data/assets/stylesheets/bootstrap/_transitions.scss +6 -0
  39. data/assets/stylesheets/bootstrap/_utilities.scss +44 -8
  40. data/assets/stylesheets/bootstrap/_variables.scss +167 -6
  41. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  42. data/assets/stylesheets/bootstrap/forms/_form-control.scss +1 -1
  43. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  44. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  45. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  46. data/assets/stylesheets/bootstrap/mixins/_grid.scss +25 -7
  47. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +27 -6
  48. data/bootstrap.gemspec +3 -3
  49. data/lib/bootstrap/version.rb +2 -2
  50. data/tasks/updater/js.rb +6 -2
  51. metadata +11 -7
@@ -90,6 +90,10 @@ $theme-colors: (
90
90
  ) !default;
91
91
  // scss-docs-end theme-colors-map
92
92
 
93
+ // scss-docs-start theme-colors-rgb
94
+ $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value") !default;
95
+ // scss-docs-end theme-colors-rgb
96
+
93
97
  // The contrast ratio to reach against white, to determine if color changes from "light" to "dark". Acceptable values for WCAG 2.0 are 3, 4.5 and 7.
94
98
  // See https://www.w3.org/TR/WCAG20/#visual-audio-contrast-contrast
95
99
  $min-contrast-ratio: 4.5 !default;
@@ -198,6 +202,126 @@ $cyan-600: shade-color($cyan, 20%) !default;
198
202
  $cyan-700: shade-color($cyan, 40%) !default;
199
203
  $cyan-800: shade-color($cyan, 60%) !default;
200
204
  $cyan-900: shade-color($cyan, 80%) !default;
205
+
206
+ $blues: (
207
+ "blue-100": $blue-100,
208
+ "blue-200": $blue-200,
209
+ "blue-300": $blue-300,
210
+ "blue-400": $blue-400,
211
+ "blue-500": $blue-500,
212
+ "blue-600": $blue-600,
213
+ "blue-700": $blue-700,
214
+ "blue-800": $blue-800,
215
+ "blue-900": $blue-900
216
+ ) !default;
217
+
218
+ $indigos: (
219
+ "indigo-100": $indigo-100,
220
+ "indigo-200": $indigo-200,
221
+ "indigo-300": $indigo-300,
222
+ "indigo-400": $indigo-400,
223
+ "indigo-500": $indigo-500,
224
+ "indigo-600": $indigo-600,
225
+ "indigo-700": $indigo-700,
226
+ "indigo-800": $indigo-800,
227
+ "indigo-900": $indigo-900
228
+ ) !default;
229
+
230
+ $purples: (
231
+ "purple-100": $purple-200,
232
+ "purple-200": $purple-100,
233
+ "purple-300": $purple-300,
234
+ "purple-400": $purple-400,
235
+ "purple-500": $purple-500,
236
+ "purple-600": $purple-600,
237
+ "purple-700": $purple-700,
238
+ "purple-800": $purple-800,
239
+ "purple-900": $purple-900
240
+ ) !default;
241
+
242
+ $pinks: (
243
+ "pink-100": $pink-100,
244
+ "pink-200": $pink-200,
245
+ "pink-300": $pink-300,
246
+ "pink-400": $pink-400,
247
+ "pink-500": $pink-500,
248
+ "pink-600": $pink-600,
249
+ "pink-700": $pink-700,
250
+ "pink-800": $pink-800,
251
+ "pink-900": $pink-900
252
+ ) !default;
253
+
254
+ $reds: (
255
+ "red-100": $red-100,
256
+ "red-200": $red-200,
257
+ "red-300": $red-300,
258
+ "red-400": $red-400,
259
+ "red-500": $red-500,
260
+ "red-600": $red-600,
261
+ "red-700": $red-700,
262
+ "red-800": $red-800,
263
+ "red-900": $red-900
264
+ ) !default;
265
+
266
+ $oranges: (
267
+ "orange-100": $orange-100,
268
+ "orange-200": $orange-200,
269
+ "orange-300": $orange-300,
270
+ "orange-400": $orange-400,
271
+ "orange-500": $orange-500,
272
+ "orange-600": $orange-600,
273
+ "orange-700": $orange-700,
274
+ "orange-800": $orange-800,
275
+ "orange-900": $orange-900
276
+ ) !default;
277
+
278
+ $yellows: (
279
+ "yellow-100": $yellow-100,
280
+ "yellow-200": $yellow-200,
281
+ "yellow-300": $yellow-300,
282
+ "yellow-400": $yellow-400,
283
+ "yellow-500": $yellow-500,
284
+ "yellow-600": $yellow-600,
285
+ "yellow-700": $yellow-700,
286
+ "yellow-800": $yellow-800,
287
+ "yellow-900": $yellow-900
288
+ ) !default;
289
+
290
+ $greens: (
291
+ "green-100": $green-100,
292
+ "green-200": $green-200,
293
+ "green-300": $green-300,
294
+ "green-400": $green-400,
295
+ "green-500": $green-500,
296
+ "green-600": $green-600,
297
+ "green-700": $green-700,
298
+ "green-800": $green-800,
299
+ "green-900": $green-900
300
+ ) !default;
301
+
302
+ $teals: (
303
+ "teal-100": $teal-100,
304
+ "teal-200": $teal-200,
305
+ "teal-300": $teal-300,
306
+ "teal-400": $teal-400,
307
+ "teal-500": $teal-500,
308
+ "teal-600": $teal-600,
309
+ "teal-700": $teal-700,
310
+ "teal-800": $teal-800,
311
+ "teal-900": $teal-900
312
+ ) !default;
313
+
314
+ $cyans: (
315
+ "cyan-100": $cyan-100,
316
+ "cyan-200": $cyan-200,
317
+ "cyan-300": $cyan-300,
318
+ "cyan-400": $cyan-400,
319
+ "cyan-500": $cyan-500,
320
+ "cyan-600": $cyan-600,
321
+ "cyan-700": $cyan-700,
322
+ "cyan-800": $cyan-800,
323
+ "cyan-900": $cyan-900
324
+ ) !default;
201
325
  // fusv-enable
202
326
 
203
327
  // Characters which are escaped by the escape-svg function
@@ -221,6 +345,7 @@ $enable-transitions: true !default;
221
345
  $enable-reduced-motion: true !default;
222
346
  $enable-smooth-scroll: true !default;
223
347
  $enable-grid-classes: true !default;
348
+ $enable-cssgrid: false !default;
224
349
  $enable-button-pointers: true !default;
225
350
  $enable-rfs: true !default;
226
351
  $enable-validation-icons: true !default;
@@ -280,6 +405,28 @@ $body-bg: $white !default;
280
405
  $body-color: $gray-900 !default;
281
406
  $body-text-align: null !default;
282
407
 
408
+ // Utilities maps
409
+ //
410
+ // Extends the default `$theme-colors` maps to help create our utilities.
411
+
412
+ // scss-docs-start utilities-colors
413
+ $utilities-colors: map-merge(
414
+ $theme-colors-rgb,
415
+ (
416
+ "black": to-rgb($black),
417
+ "white": to-rgb($white),
418
+ "body": to-rgb($body-color)
419
+ )
420
+ ) !default;
421
+ // scss-docs-end utilities-colors
422
+
423
+ // scss-docs-start utilities-text-colors
424
+ $utilities-text-colors: map-loop($utilities-colors, rgba-css-var, "$key", "text") !default;
425
+ // scss-docs-end utilities-text-colors
426
+
427
+ // scss-docs-start utilities-bg-colors
428
+ $utilities-bg-colors: map-loop($utilities-colors, rgba-css-var, "$key", "bg") !default;
429
+ // scss-docs-end utilities-bg-colors
283
430
 
284
431
  // Links
285
432
  //
@@ -397,6 +544,7 @@ $transition-base: all .2s ease-in-out !default;
397
544
  $transition-fade: opacity .15s linear !default;
398
545
  // scss-docs-start collapse-transition
399
546
  $transition-collapse: height .35s ease !default;
547
+ $transition-collapse-width: width .35s ease !default;
400
548
  // scss-docs-end collapse-transition
401
549
 
402
550
  // stylelint-disable function-disallowed-list
@@ -692,7 +840,7 @@ $input-padding-y-lg: $input-btn-padding-y-lg !default;
692
840
  $input-padding-x-lg: $input-btn-padding-x-lg !default;
693
841
  $input-font-size-lg: $input-btn-font-size-lg !default;
694
842
 
695
- $input-bg: $white !default;
843
+ $input-bg: $body-bg !default;
696
844
  $input-disabled-bg: $gray-200 !default;
697
845
  $input-disabled-border-color: null !default;
698
846
 
@@ -725,6 +873,8 @@ $input-height-sm: add($input-line-height * 1em, add($input
725
873
  $input-height-lg: add($input-line-height * 1em, add($input-padding-y-lg * 2, $input-height-border, false)) !default;
726
874
 
727
875
  $input-transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out !default;
876
+
877
+ $form-color-width: 3rem !default;
728
878
  // scss-docs-end form-input-variables
729
879
 
730
880
  // scss-docs-start form-check-variables
@@ -906,9 +1056,10 @@ $form-validation-states: (
906
1056
  $zindex-dropdown: 1000 !default;
907
1057
  $zindex-sticky: 1020 !default;
908
1058
  $zindex-fixed: 1030 !default;
909
- $zindex-modal-backdrop: 1040 !default;
910
- $zindex-offcanvas: 1050 !default;
911
- $zindex-modal: 1060 !default;
1059
+ $zindex-offcanvas-backdrop: 1040 !default;
1060
+ $zindex-offcanvas: 1045 !default;
1061
+ $zindex-modal-backdrop: 1050 !default;
1062
+ $zindex-modal: 1055 !default;
912
1063
  $zindex-popover: 1070 !default;
913
1064
  $zindex-tooltip: 1080 !default;
914
1065
  // scss-docs-end zindex-stack
@@ -1078,6 +1229,13 @@ $pagination-border-radius-lg: $border-radius-lg !default;
1078
1229
  // scss-docs-end pagination-variables
1079
1230
 
1080
1231
 
1232
+ // Placeholders
1233
+
1234
+ // scss-docs-start placeholders
1235
+ $placeholder-opacity-max: .5 !default;
1236
+ $placeholder-opacity-min: .2 !default;
1237
+ // scss-docs-end placeholders
1238
+
1081
1239
  // Cards
1082
1240
 
1083
1241
  // scss-docs-start card-variables
@@ -1085,8 +1243,9 @@ $card-spacer-y: $spacer !default;
1085
1243
  $card-spacer-x: $spacer !default;
1086
1244
  $card-title-spacer-y: $spacer * .5 !default;
1087
1245
  $card-border-width: $border-width !default;
1088
- $card-border-radius: $border-radius !default;
1089
1246
  $card-border-color: rgba($black, .125) !default;
1247
+ $card-border-radius: $border-radius !default;
1248
+ $card-box-shadow: null !default;
1090
1249
  $card-inner-border-radius: subtract($card-border-radius, $card-border-width) !default;
1091
1250
  $card-cap-padding-y: $card-spacer-y * .5 !default;
1092
1251
  $card-cap-padding-x: $card-spacer-x !default;
@@ -1126,7 +1285,7 @@ $accordion-button-focus-border-color: $input-focus-border-color !default;
1126
1285
  $accordion-button-focus-box-shadow: $btn-focus-box-shadow !default;
1127
1286
 
1128
1287
  $accordion-icon-width: 1.25rem !default;
1129
- $accordion-icon-color: $accordion-color !default;
1288
+ $accordion-icon-color: $accordion-button-color !default;
1130
1289
  $accordion-icon-active-color: $accordion-button-active-color !default;
1131
1290
  $accordion-icon-transition: transform .2s ease-in-out !default;
1132
1291
  $accordion-icon-transform: rotate(-180deg) !default;
@@ -1452,6 +1611,8 @@ $offcanvas-title-line-height: $modal-title-line-height !default;
1452
1611
  $offcanvas-bg-color: $modal-content-bg !default;
1453
1612
  $offcanvas-color: $modal-content-color !default;
1454
1613
  $offcanvas-box-shadow: $modal-content-box-shadow-xs !default;
1614
+ $offcanvas-backdrop-bg: $modal-backdrop-bg !default;
1615
+ $offcanvas-backdrop-opacity: $modal-backdrop-opacity !default;
1455
1616
  // scss-docs-end offcanvas-variables
1456
1617
 
1457
1618
  // Code
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap Utilities v5.0.2 (https://getbootstrap.com/)
2
+ * Bootstrap Utilities v5.1.0 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2021 The Bootstrap Authors
4
4
  * Copyright 2011-2021 Twitter, Inc.
5
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
@@ -199,7 +199,7 @@ textarea {
199
199
  // stylelint-enable selector-no-qualifying-type
200
200
 
201
201
  .form-control-color {
202
- max-width: 3rem;
202
+ width: $form-color-width;
203
203
  height: auto; // Override fixed browser height
204
204
  padding: $input-padding-y;
205
205
 
@@ -0,0 +1,15 @@
1
+ // scss-docs-start stacks
2
+ .hstack {
3
+ display: flex;
4
+ flex-direction: row;
5
+ align-items: center;
6
+ align-self: stretch;
7
+ }
8
+
9
+ .vstack {
10
+ display: flex;
11
+ flex: 1 1 auto;
12
+ flex-direction: column;
13
+ align-self: stretch;
14
+ }
15
+ // scss-docs-end stacks
@@ -0,0 +1,8 @@
1
+ .vr {
2
+ display: inline-block;
3
+ align-self: stretch;
4
+ width: 1px;
5
+ min-height: 1em;
6
+ background-color: currentColor;
7
+ opacity: $hr-opacity;
8
+ }
@@ -0,0 +1,14 @@
1
+ // Shared between modals and offcanvases
2
+ @mixin overlay-backdrop($zindex, $backdrop-bg, $backdrop-opacity) {
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ z-index: $zindex;
7
+ width: 100vw;
8
+ height: 100vh;
9
+ background-color: $backdrop-bg;
10
+
11
+ // Fade for backdrop
12
+ &.fade { opacity: 0; }
13
+ &.show { opacity: $backdrop-opacity; }
14
+ }
@@ -66,8 +66,8 @@
66
66
 
67
67
  @mixin make-grid-columns($columns: $grid-columns, $gutter: $grid-gutter-width, $breakpoints: $grid-breakpoints) {
68
68
  @each $breakpoint in map-keys($breakpoints) {
69
- // .row-cols defaults must all appear before .col overrides so they can be overridden.
70
69
  $infix: breakpoint-infix($breakpoint, $breakpoints);
70
+
71
71
  @include media-breakpoint-up($breakpoint, $breakpoints) {
72
72
  // Provide basic `.col-{bp}` classes for equal-width flexbox columns
73
73
  .col#{$infix} {
@@ -85,13 +85,7 @@
85
85
  }
86
86
  }
87
87
  }
88
- }
89
- }
90
-
91
- @each $breakpoint in map-keys($breakpoints) {
92
- $infix: breakpoint-infix($breakpoint, $breakpoints);
93
88
 
94
- @include media-breakpoint-up($breakpoint, $breakpoints) {
95
89
  .col#{$infix}-auto {
96
90
  @include make-col-auto();
97
91
  }
@@ -130,3 +124,27 @@
130
124
  }
131
125
  }
132
126
  }
127
+
128
+ @mixin make-cssgrid($columns: $grid-columns, $breakpoints: $grid-breakpoints) {
129
+ @each $breakpoint in map-keys($breakpoints) {
130
+ $infix: breakpoint-infix($breakpoint, $breakpoints);
131
+
132
+ @include media-breakpoint-up($breakpoint, $breakpoints) {
133
+ @if $columns > 0 {
134
+ @for $i from 1 through $columns {
135
+ .g-col#{$infix}-#{$i} {
136
+ grid-column: auto / span $i;
137
+ }
138
+ }
139
+
140
+ // Start with `1` because `0` is and invalid value.
141
+ // Ends with `$columns - 1` because offsetting by the width of an entire row isn't possible.
142
+ @for $i from 1 through ($columns - 1) {
143
+ .g-start#{$infix}-#{$i} {
144
+ grid-column-start: $i;
145
+ }
146
+ }
147
+ }
148
+ }
149
+ }
150
+ }
@@ -41,25 +41,46 @@
41
41
  }
42
42
  }
43
43
 
44
+ $is-css-var: map-get($utility, css-var);
45
+ $is-local-vars: map-get($utility, local-vars);
44
46
  $is-rtl: map-get($utility, rtl);
45
47
 
46
48
  @if $value != null {
47
49
  @if $is-rtl == false {
48
50
  /* rtl:begin:remove */
49
51
  }
50
- .#{$property-class + $infix + $property-class-modifier} {
51
- @each $property in $properties {
52
- #{$property}: $value if($enable-important-utilities, !important, null);
52
+
53
+ @if $is-css-var {
54
+ .#{$property-class + $infix + $property-class-modifier} {
55
+ --#{$variable-prefix}#{$property-class}: #{$value};
53
56
  }
54
- }
55
57
 
56
- @each $pseudo in $state {
57
- .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
58
+ @each $pseudo in $state {
59
+ .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
60
+ --#{$variable-prefix}#{$property-class}: #{$value};
61
+ }
62
+ }
63
+ } @else {
64
+ .#{$property-class + $infix + $property-class-modifier} {
58
65
  @each $property in $properties {
66
+ @if $is-local-vars {
67
+ @each $local-var, $value in $is-local-vars {
68
+ --#{$variable-prefix}#{$local-var}: #{$value};
69
+ }
70
+ }
59
71
  #{$property}: $value if($enable-important-utilities, !important, null);
60
72
  }
61
73
  }
74
+
75
+ @each $pseudo in $state {
76
+ .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
77
+ @each $property in $properties {
78
+ #{$property}: $value if($enable-important-utilities, !important, null);
79
+ }
80
+ }
81
+ }
62
82
  }
83
+
63
84
  @if $is-rtl == false {
64
85
  /* rtl:end:remove */
65
86
  }
data/bootstrap.gemspec CHANGED
@@ -14,14 +14,14 @@ Gem::Specification.new do |s|
14
14
  # SassC requires Ruby 2.3.3. Also specify here to make it obvious.
15
15
  s.required_ruby_version = '>= 2.3.3'
16
16
 
17
- s.add_runtime_dependency 'popper_js', '>= 2.9.2', '< 3'
17
+ s.add_runtime_dependency 'popper_js', '>= 2.9.3', '< 3'
18
18
 
19
19
  s.add_runtime_dependency 'sassc-rails', '>= 2.0.0'
20
20
  s.add_runtime_dependency 'autoprefixer-rails', '>= 9.1.0'
21
21
 
22
22
  # Testing dependencies
23
- s.add_development_dependency 'minitest', '~> 5.8.0'
24
- s.add_development_dependency 'minitest-reporters', '~> 1.0.5'
23
+ s.add_development_dependency 'minitest', '~> 5.14.4'
24
+ s.add_development_dependency 'minitest-reporters', '~> 1.4.3'
25
25
  s.add_development_dependency 'term-ansicolor'
26
26
  # Integration testing
27
27
  s.add_development_dependency 'capybara', '>= 2.6.0'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bootstrap
4
- VERSION = '5.0.2'
5
- BOOTSTRAP_SHA = '688bce4fa695cc360a0d084e34f029b0c192b223'
4
+ VERSION = '5.1.0'
5
+ BOOTSTRAP_SHA = 'f20fece3a8cdd0e76a42c2737524b7652bf54d26'
6
6
  end