bootstrap 5.0.0.alpha2 → 5.0.0.alpha3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +5 -2
  3. data/assets/javascripts/bootstrap-sprockets.js +6 -7
  4. data/assets/javascripts/bootstrap.js +220 -267
  5. data/assets/javascripts/bootstrap.min.js +2 -2
  6. data/assets/javascripts/bootstrap/alert.js +25 -15
  7. data/assets/javascripts/bootstrap/button.js +25 -15
  8. data/assets/javascripts/bootstrap/carousel.js +46 -24
  9. data/assets/javascripts/bootstrap/collapse.js +25 -15
  10. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  11. data/assets/javascripts/bootstrap/dom/event-handler.js +8 -16
  12. data/assets/javascripts/bootstrap/dom/manipulator.js +2 -13
  13. data/assets/javascripts/bootstrap/dom/selector-engine.js +9 -9
  14. data/assets/javascripts/bootstrap/dropdown.js +34 -24
  15. data/assets/javascripts/bootstrap/modal.js +25 -15
  16. data/assets/javascripts/bootstrap/popover.js +26 -15
  17. data/assets/javascripts/bootstrap/scrollspy.js +25 -14
  18. data/assets/javascripts/bootstrap/tab.js +25 -15
  19. data/assets/javascripts/bootstrap/toast.js +26 -16
  20. data/assets/javascripts/bootstrap/tooltip.js +27 -17
  21. data/assets/stylesheets/_bootstrap-grid.scss +1 -1
  22. data/assets/stylesheets/_bootstrap-reboot.scss +1 -1
  23. data/assets/stylesheets/_bootstrap.scss +2 -1
  24. data/assets/stylesheets/bootstrap/_accordion.scss +125 -0
  25. data/assets/stylesheets/bootstrap/_alert.scss +10 -3
  26. data/assets/stylesheets/bootstrap/_breadcrumb.scss +1 -3
  27. data/assets/stylesheets/bootstrap/_button-group.scss +0 -2
  28. data/assets/stylesheets/bootstrap/_buttons.scss +0 -15
  29. data/assets/stylesheets/bootstrap/_card.scss +0 -27
  30. data/assets/stylesheets/bootstrap/_close.scss +1 -2
  31. data/assets/stylesheets/bootstrap/_forms.scss +1 -1
  32. data/assets/stylesheets/bootstrap/_functions.scss +12 -12
  33. data/assets/stylesheets/bootstrap/_list-group.scss +8 -2
  34. data/assets/stylesheets/bootstrap/_popover.scss +1 -1
  35. data/assets/stylesheets/bootstrap/_progress.scss +1 -1
  36. data/assets/stylesheets/bootstrap/_reboot.scss +19 -17
  37. data/assets/stylesheets/bootstrap/_root.scss +5 -5
  38. data/assets/stylesheets/bootstrap/_spinners.scss +11 -2
  39. data/assets/stylesheets/bootstrap/_tables.scss +16 -16
  40. data/assets/stylesheets/bootstrap/_utilities.scss +27 -13
  41. data/assets/stylesheets/bootstrap/_variables.scss +183 -160
  42. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  43. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +61 -0
  44. data/assets/stylesheets/bootstrap/forms/_form-check.scss +15 -6
  45. data/assets/stylesheets/bootstrap/forms/_form-control.scss +115 -8
  46. data/assets/stylesheets/bootstrap/forms/_form-range.scss +0 -45
  47. data/assets/stylesheets/bootstrap/forms/_form-select.scss +0 -14
  48. data/assets/stylesheets/bootstrap/forms/_input-group.scss +20 -39
  49. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +2 -2
  50. data/assets/stylesheets/bootstrap/mixins/_alert.scss +1 -1
  51. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +4 -4
  52. data/assets/stylesheets/bootstrap/mixins/_forms.scss +0 -16
  53. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
  54. data/assets/stylesheets/bootstrap/mixins/_grid.scss +10 -10
  55. data/assets/stylesheets/bootstrap/mixins/_list-group.scss +1 -1
  56. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +7 -7
  57. data/lib/bootstrap/version.rb +2 -2
  58. metadata +4 -4
  59. data/assets/javascripts/bootstrap/dom/polyfill.js +0 -110
  60. data/assets/stylesheets/bootstrap/forms/_form-file.scss +0 -91
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap toast.js v5.0.0-alpha2 (https://getbootstrap.com/)
2
+ * Bootstrap toast.js v5.0.0-alpha3 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -17,7 +17,7 @@
17
17
 
18
18
  /**
19
19
  * --------------------------------------------------------------------------
20
- * Bootstrap (v5.0.0-alpha2): util/index.js
20
+ * Bootstrap (v5.0.0-alpha3): util/index.js
21
21
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
22
22
  * --------------------------------------------------------------------------
23
23
  */
@@ -108,6 +108,14 @@
108
108
  return null;
109
109
  };
110
110
 
111
+ var onDOMContentLoaded = function onDOMContentLoaded(callback) {
112
+ if (document.readyState === 'loading') {
113
+ document.addEventListener('DOMContentLoaded', callback);
114
+ } else {
115
+ callback();
116
+ }
117
+ };
118
+
111
119
  function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
112
120
 
113
121
  function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
@@ -120,7 +128,7 @@
120
128
  */
121
129
 
122
130
  var NAME = 'toast';
123
- var VERSION = '5.0.0-alpha2';
131
+ var VERSION = '5.0.0-alpha3';
124
132
  var DATA_KEY = 'bs.toast';
125
133
  var EVENT_KEY = "." + DATA_KEY;
126
134
  var EVENT_CLICK_DISMISS = "click.dismiss" + EVENT_KEY;
@@ -315,27 +323,29 @@
315
323
 
316
324
  return Toast;
317
325
  }();
318
-
319
- var $ = getjQuery();
320
326
  /**
321
327
  * ------------------------------------------------------------------------
322
328
  * jQuery
323
329
  * ------------------------------------------------------------------------
324
- * add .toast to jQuery only if jQuery is present
330
+ * add .Toast to jQuery only if jQuery is present
325
331
  */
326
332
 
327
- /* istanbul ignore if */
328
333
 
329
- if ($) {
330
- var JQUERY_NO_CONFLICT = $.fn[NAME];
331
- $.fn[NAME] = Toast.jQueryInterface;
332
- $.fn[NAME].Constructor = Toast;
334
+ onDOMContentLoaded(function () {
335
+ var $ = getjQuery();
336
+ /* istanbul ignore if */
333
337
 
334
- $.fn[NAME].noConflict = function () {
335
- $.fn[NAME] = JQUERY_NO_CONFLICT;
336
- return Toast.jQueryInterface;
337
- };
338
- }
338
+ if ($) {
339
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
340
+ $.fn[NAME] = Toast.jQueryInterface;
341
+ $.fn[NAME].Constructor = Toast;
342
+
343
+ $.fn[NAME].noConflict = function () {
344
+ $.fn[NAME] = JQUERY_NO_CONFLICT;
345
+ return Toast.jQueryInterface;
346
+ };
347
+ }
348
+ });
339
349
 
340
350
  return Toast;
341
351
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap tooltip.js v5.0.0-alpha2 (https://getbootstrap.com/)
2
+ * Bootstrap tooltip.js v5.0.0-alpha3 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
4
4
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
5
5
  */
@@ -19,7 +19,7 @@
19
19
 
20
20
  /**
21
21
  * --------------------------------------------------------------------------
22
- * Bootstrap (v5.0.0-alpha2): util/index.js
22
+ * Bootstrap (v5.0.0-alpha3): util/index.js
23
23
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
24
24
  * --------------------------------------------------------------------------
25
25
  */
@@ -148,9 +148,17 @@
148
148
  return null;
149
149
  };
150
150
 
151
+ var onDOMContentLoaded = function onDOMContentLoaded(callback) {
152
+ if (document.readyState === 'loading') {
153
+ document.addEventListener('DOMContentLoaded', callback);
154
+ } else {
155
+ callback();
156
+ }
157
+ };
158
+
151
159
  /**
152
160
  * --------------------------------------------------------------------------
153
- * Bootstrap (v5.0.0-alpha2): util/sanitizer.js
161
+ * Bootstrap (v5.0.0-alpha3): util/sanitizer.js
154
162
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
155
163
  * --------------------------------------------------------------------------
156
164
  */
@@ -287,7 +295,7 @@
287
295
  */
288
296
 
289
297
  var NAME = 'tooltip';
290
- var VERSION = '5.0.0-alpha2';
298
+ var VERSION = '5.0.0-alpha3';
291
299
  var DATA_KEY = 'bs.tooltip';
292
300
  var EVENT_KEY = "." + DATA_KEY;
293
301
  var CLASS_PREFIX = 'bs-tooltip';
@@ -1011,27 +1019,29 @@
1011
1019
 
1012
1020
  return Tooltip;
1013
1021
  }();
1014
-
1015
- var $ = getjQuery();
1016
1022
  /**
1017
1023
  * ------------------------------------------------------------------------
1018
1024
  * jQuery
1019
1025
  * ------------------------------------------------------------------------
1020
- * add .tooltip to jQuery only if jQuery is present
1026
+ * add .Tooltip to jQuery only if jQuery is present
1021
1027
  */
1022
1028
 
1023
- /* istanbul ignore if */
1024
1029
 
1025
- if ($) {
1026
- var JQUERY_NO_CONFLICT = $.fn[NAME];
1027
- $.fn[NAME] = Tooltip.jQueryInterface;
1028
- $.fn[NAME].Constructor = Tooltip;
1030
+ onDOMContentLoaded(function () {
1031
+ var $ = getjQuery();
1032
+ /* istanbul ignore if */
1029
1033
 
1030
- $.fn[NAME].noConflict = function () {
1031
- $.fn[NAME] = JQUERY_NO_CONFLICT;
1032
- return Tooltip.jQueryInterface;
1033
- };
1034
- }
1034
+ if ($) {
1035
+ var JQUERY_NO_CONFLICT = $.fn[NAME];
1036
+ $.fn[NAME] = Tooltip.jQueryInterface;
1037
+ $.fn[NAME].Constructor = Tooltip;
1038
+
1039
+ $.fn[NAME].noConflict = function () {
1040
+ $.fn[NAME] = JQUERY_NO_CONFLICT;
1041
+ return Tooltip.jQueryInterface;
1042
+ };
1043
+ }
1044
+ });
1035
1045
 
1036
1046
  return Tooltip;
1037
1047
 
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap Grid v5.0.0-alpha2 (https://getbootstrap.com/)
2
+ * Bootstrap Grid v5.0.0-alpha3 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 The Bootstrap Authors
4
4
  * Copyright 2011-2020 Twitter, Inc.
5
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap Reboot v5.0.0-alpha2 (https://getbootstrap.com/)
2
+ * Bootstrap Reboot v5.0.0-alpha3 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 The Bootstrap Authors
4
4
  * Copyright 2011-2020 Twitter, Inc.
5
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Bootstrap v5.0.0-alpha2 (https://getbootstrap.com/)
2
+ * Bootstrap v5.0.0-alpha3 (https://getbootstrap.com/)
3
3
  * Copyright 2011-2020 The Bootstrap Authors
4
4
  * Copyright 2011-2020 Twitter, Inc.
5
5
  * Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
@@ -28,6 +28,7 @@
28
28
  @import "bootstrap/nav";
29
29
  @import "bootstrap/navbar";
30
30
  @import "bootstrap/card";
31
+ @import "bootstrap/accordion";
31
32
  @import "bootstrap/breadcrumb";
32
33
  @import "bootstrap/pagination";
33
34
  @import "bootstrap/badge";
@@ -0,0 +1,125 @@
1
+ //
2
+ // Base styles
3
+ //
4
+
5
+ .accordion-button {
6
+ position: relative;
7
+ display: flex;
8
+ align-items: center;
9
+ width: 100%;
10
+ padding: $accordion-button-padding-y $accordion-button-padding-x;
11
+ @include font-size($font-size-base);
12
+ color: $accordion-button-color;
13
+ background-color: $accordion-button-bg;
14
+ border: $accordion-border-width solid $accordion-border-color;
15
+ @include border-radius(0);
16
+ overflow-anchor: none;
17
+ @include transition($accordion-transition);
18
+
19
+ &.collapsed {
20
+ border-bottom-width: 0;
21
+ }
22
+
23
+ &:not(.collapsed) {
24
+ color: $accordion-button-active-color;
25
+ background-color: $accordion-button-active-bg;
26
+
27
+ &::after {
28
+ background-image: escape-svg($accordion-button-active-icon);
29
+ transform: $accordion-icon-transform;
30
+ }
31
+ }
32
+
33
+ // Accordion icon
34
+ &::after {
35
+ flex-shrink: 0;
36
+ width: $accordion-icon-width;
37
+ height: $accordion-icon-width;
38
+ margin-left: auto;
39
+ content: "";
40
+ background-image: escape-svg($accordion-button-icon);
41
+ background-repeat: no-repeat;
42
+ background-size: $accordion-icon-width;
43
+ @include transition($accordion-icon-transition);
44
+ }
45
+
46
+ &:hover {
47
+ z-index: 2;
48
+ }
49
+
50
+ &:focus {
51
+ z-index: 3;
52
+ border-color: $accordion-button-focus-border-color;
53
+ outline: 0;
54
+ box-shadow: $accordion-button-focus-box-shadow;
55
+ }
56
+ }
57
+
58
+ .accordion-header {
59
+ margin-bottom: 0;
60
+ }
61
+
62
+ .accordion-item {
63
+ &:first-of-type {
64
+ .accordion-button {
65
+ @include border-top-radius($accordion-border-radius);
66
+ }
67
+ }
68
+
69
+ &:last-of-type {
70
+ .accordion-button {
71
+ // Only set a border-radius on the last item if the accordion is collapsed
72
+ &.collapsed {
73
+ border-bottom-width: $accordion-border-width;
74
+ @include border-bottom-radius($accordion-border-radius);
75
+ }
76
+ }
77
+
78
+ .accordion-collapse {
79
+ border-bottom-width: $accordion-border-width;
80
+ @include border-bottom-radius($accordion-border-radius);
81
+ }
82
+ }
83
+ }
84
+
85
+ .accordion-collapse {
86
+ border: solid $accordion-border-color;
87
+ border-width: 0 $accordion-border-width;
88
+ }
89
+
90
+ .accordion-body {
91
+ padding: $accordion-body-padding-y $accordion-body-padding-x;
92
+ }
93
+
94
+
95
+ // Flush accordion items
96
+ //
97
+ // Remove borders and border-radius to keep accordion items edge-to-edge.
98
+
99
+ .accordion-flush {
100
+ .accordion-button {
101
+ border-right: 0;
102
+ border-left: 0;
103
+ @include border-radius(0);
104
+ }
105
+
106
+ .accordion-collapse {
107
+ border-width: 0;
108
+ }
109
+
110
+ .accordion-item {
111
+ &:first-of-type {
112
+ .accordion-button {
113
+ border-top-width: 0;
114
+ @include border-top-radius(0);
115
+ }
116
+ }
117
+
118
+ &:last-of-type {
119
+ .accordion-button.collapsed {
120
+ border-bottom-width: 0;
121
+ @include border-bottom-radius(0);
122
+ }
123
+ }
124
+ }
125
+ }
@@ -34,6 +34,7 @@
34
34
  position: absolute;
35
35
  top: 0;
36
36
  right: 0;
37
+ z-index: $stretched-link-z-index + 1;
37
38
  padding: $alert-padding-y * 1.25 $alert-padding-x;
38
39
  }
39
40
  }
@@ -42,9 +43,15 @@
42
43
  // scss-docs-start alert-modifiers
43
44
  // Generate contextual modifier classes for colorizing the alert.
44
45
 
45
- @each $color, $value in $theme-colors {
46
- .alert-#{$color} {
47
- @include alert-variant(color-level($value, $alert-bg-level), color-level($value, $alert-border-level), color-level($value, $alert-color-level));
46
+ @each $state, $value in $theme-colors {
47
+ $background: scale-color($value, $alert-bg-scale);
48
+ $border: scale-color($value, $alert-border-scale);
49
+ $color: scale-color($value, $alert-color-scale);
50
+ @if (contrast-ratio($background, $color) < $min-contrast-ratio) {
51
+ $color: mix($value, color-contrast($background), abs($alert-color-scale));
52
+ }
53
+ .alert-#{$state} {
54
+ @include alert-variant($background, $border, $color);
48
55
  }
49
56
  }
50
57
  // scss-docs-end alert-modifiers
@@ -10,14 +10,12 @@
10
10
  }
11
11
 
12
12
  .breadcrumb-item {
13
- display: flex;
14
-
15
13
  // The separator between breadcrumbs (by default, a forward-slash: "/")
16
14
  + .breadcrumb-item {
17
15
  padding-left: $breadcrumb-item-padding-x;
18
16
 
19
17
  &::before {
20
- display: inline-block; // Suppress underlining of the separator
18
+ float: left; // Suppress inline spacings and underlining of the separator
21
19
  padding-right: $breadcrumb-item-padding-x;
22
20
  color: $breadcrumb-divider-color;
23
21
  content: escape-svg($breadcrumb-divider);
@@ -1,5 +1,3 @@
1
- // stylelint-disable selector-no-qualifying-type
2
-
3
1
  // Make the div behave like a button
4
2
  .btn-group,
5
3
  .btn-group-vertical {
@@ -107,18 +107,3 @@
107
107
  .btn-sm {
108
108
  @include button-size($btn-padding-y-sm, $btn-padding-x-sm, $btn-font-size-sm, $btn-border-radius-sm);
109
109
  }
110
-
111
-
112
- //
113
- // Block button
114
- //
115
-
116
- .btn-block {
117
- display: block;
118
- width: 100%;
119
-
120
- // Vertically space out multiple block buttons
121
- + .btn-block {
122
- margin-top: $btn-block-spacing-y;
123
- }
124
- }
@@ -213,30 +213,3 @@
213
213
  }
214
214
  }
215
215
  }
216
-
217
-
218
- //
219
- // Accordion
220
- //
221
-
222
- .accordion {
223
- overflow-anchor: none;
224
-
225
- > .card {
226
- overflow: hidden;
227
-
228
- &:not(:last-of-type) {
229
- border-bottom: 0;
230
- @include border-bottom-radius(0);
231
- }
232
-
233
- &:not(:first-of-type) {
234
- @include border-top-radius(0);
235
- }
236
-
237
- > .card-header {
238
- @include border-radius(0);
239
- margin-bottom: -$card-border-width;
240
- }
241
- }
242
- }
@@ -9,8 +9,7 @@
9
9
  height: $btn-close-height;
10
10
  padding: $btn-close-padding-y $btn-close-padding-x;
11
11
  color: $btn-close-color;
12
- background: transparent escape-svg($btn-close-bg) no-repeat center center / $btn-close-width auto; // include transparent for button elements
13
- background-clip: content-box;
12
+ background: transparent escape-svg($btn-close-bg) center / $btn-close-width auto no-repeat; // include transparent for button elements
14
13
  border: 0; // for button elements
15
14
  @include border-radius();
16
15
  opacity: $btn-close-opacity;
@@ -3,7 +3,7 @@
3
3
  @import "forms/form-control";
4
4
  @import "forms/form-select";
5
5
  @import "forms/form-check";
6
- @import "forms/form-file";
7
6
  @import "forms/form-range";
7
+ @import "forms/floating-labels";
8
8
  @import "forms/input-group";
9
9
  @import "forms/validation";
@@ -150,23 +150,23 @@ $_luminance-list: .0008 .001 .0011 .0013 .0015 .0017 .002 .0022 .0025 .0027 .003
150
150
  @return mix(rgba($foreground, 1), $background, opacity($foreground) * 100);
151
151
  }
152
152
 
153
- // Request a color level
154
- // scss-docs-start color-level
155
- @function color-level($color: $primary, $level: 0) {
156
- $color-base: if($level > 0, $black, $white);
157
- $level: abs($level);
158
-
159
- @return mix($color-base, $color, $level * $theme-color-interval);
153
+ // scss-docs-start color-functions
154
+ // Tint a color: mix a color with white
155
+ @function tint-color($color, $weight) {
156
+ @return mix(white, $color, $weight);
160
157
  }
161
- // scss-docs-end color-level
162
158
 
163
- @function tint-color($color, $level) {
164
- @return mix(white, $color, $level * $theme-color-interval);
159
+ // Shade a color: mix a color with black
160
+ @function shade-color($color, $weight) {
161
+ @return mix(black, $color, $weight);
165
162
  }
166
163
 
167
- @function shade-color($color, $level) {
168
- @return mix(black, $color, $level * $theme-color-interval);
164
+ // Scale a color:
165
+ // Shade the color if the weight is positive, else tint it
166
+ @function scale-color($color, $weight) {
167
+ @return if($weight > 0, shade-color($color, $weight), tint-color($color, -$weight));
169
168
  }
169
+ // scss-docs-end color-functions
170
170
 
171
171
  // Return valid calc
172
172
  @function add($value1, $value2, $return-calc: true) {