bootstrap 5.0.0 → 5.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (65) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/assets/javascripts/bootstrap/alert.js +77 -106
  4. data/assets/javascripts/bootstrap/base-component.js +126 -7
  5. data/assets/javascripts/bootstrap/button.js +24 -24
  6. data/assets/javascripts/bootstrap/carousel.js +115 -128
  7. data/assets/javascripts/bootstrap/collapse.js +119 -176
  8. data/assets/javascripts/bootstrap/dom/data.js +2 -2
  9. data/assets/javascripts/bootstrap/dom/event-handler.js +3 -4
  10. data/assets/javascripts/bootstrap/dom/manipulator.js +4 -4
  11. data/assets/javascripts/bootstrap/dom/selector-engine.js +47 -5
  12. data/assets/javascripts/bootstrap/dropdown.js +142 -130
  13. data/assets/javascripts/bootstrap/modal.js +376 -171
  14. data/assets/javascripts/bootstrap/offcanvas.js +328 -133
  15. data/assets/javascripts/bootstrap/popover.js +27 -59
  16. data/assets/javascripts/bootstrap/scrollspy.js +51 -56
  17. data/assets/javascripts/bootstrap/tab.js +39 -66
  18. data/assets/javascripts/bootstrap/toast.js +175 -86
  19. data/assets/javascripts/bootstrap/tooltip.js +141 -185
  20. data/assets/javascripts/bootstrap-sprockets.js +6 -6
  21. data/assets/javascripts/bootstrap.js +1031 -1026
  22. data/assets/javascripts/bootstrap.min.js +2 -2
  23. data/assets/stylesheets/_bootstrap-grid.scss +3 -1
  24. data/assets/stylesheets/_bootstrap-reboot.scss +2 -4
  25. data/assets/stylesheets/_bootstrap.scss +2 -1
  26. data/assets/stylesheets/bootstrap/_card.scss +7 -6
  27. data/assets/stylesheets/bootstrap/_carousel.scss +2 -2
  28. data/assets/stylesheets/bootstrap/_dropdown.scss +4 -4
  29. data/assets/stylesheets/bootstrap/_functions.scss +100 -3
  30. data/assets/stylesheets/bootstrap/_grid.scss +11 -0
  31. data/assets/stylesheets/bootstrap/_helpers.scss +2 -0
  32. data/assets/stylesheets/bootstrap/_images.scss +1 -1
  33. data/assets/stylesheets/bootstrap/_list-group.scss +5 -5
  34. data/assets/stylesheets/bootstrap/_mixins.scss +1 -0
  35. data/assets/stylesheets/bootstrap/_modal.scss +7 -26
  36. data/assets/stylesheets/bootstrap/_navbar.scss +30 -1
  37. data/assets/stylesheets/bootstrap/_offcanvas.scss +8 -2
  38. data/assets/stylesheets/bootstrap/_placeholders.scss +51 -0
  39. data/assets/stylesheets/bootstrap/_popover.scss +10 -10
  40. data/assets/stylesheets/bootstrap/_reboot.scss +12 -8
  41. data/assets/stylesheets/bootstrap/_root.scss +40 -2
  42. data/assets/stylesheets/bootstrap/_tables.scss +1 -0
  43. data/assets/stylesheets/bootstrap/_toasts.scss +3 -3
  44. data/assets/stylesheets/bootstrap/_tooltip.scss +4 -4
  45. data/assets/stylesheets/bootstrap/_transitions.scss +6 -0
  46. data/assets/stylesheets/bootstrap/_utilities.scss +44 -8
  47. data/assets/stylesheets/bootstrap/_variables.scss +200 -25
  48. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +1 -1
  49. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +3 -1
  50. data/assets/stylesheets/bootstrap/forms/_form-check.scss +1 -1
  51. data/assets/stylesheets/bootstrap/forms/_form-control.scss +6 -6
  52. data/assets/stylesheets/bootstrap/forms/_form-range.scss +1 -1
  53. data/assets/stylesheets/bootstrap/forms/_form-select.scss +3 -0
  54. data/assets/stylesheets/bootstrap/helpers/_stacks.scss +15 -0
  55. data/assets/stylesheets/bootstrap/helpers/_vr.scss +8 -0
  56. data/assets/stylesheets/bootstrap/mixins/_backdrop.scss +14 -0
  57. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +1 -1
  58. data/assets/stylesheets/bootstrap/mixins/_forms.scss +8 -1
  59. data/assets/stylesheets/bootstrap/mixins/_grid.scss +33 -8
  60. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +27 -6
  61. data/assets/stylesheets/bootstrap/vendor/_rfs.scss +55 -13
  62. data/bootstrap.gemspec +3 -3
  63. data/lib/bootstrap/version.rb +2 -2
  64. data/tasks/updater/js.rb +6 -2
  65. metadata +12 -8
@@ -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
  }
@@ -4,7 +4,7 @@
4
4
  //
5
5
  // Automated responsive values for font sizes, paddings, margins and much more
6
6
  //
7
- // Licensed under MIT (https://github.com/twbs/rfs/blob/master/LICENSE)
7
+ // Licensed under MIT (https://github.com/twbs/rfs/blob/main/LICENSE)
8
8
 
9
9
  // Configuration
10
10
 
@@ -52,12 +52,54 @@ $enable-rfs: true !default;
52
52
  // Cache $rfs-base-value unit
53
53
  $rfs-base-value-unit: unit($rfs-base-value);
54
54
 
55
+ @function divide($dividend, $divisor, $precision: 10) {
56
+ $sign: if($dividend > 0 and $divisor > 0 or $dividend < 0 and $divisor < 0, 1, -1);
57
+ $dividend: abs($dividend);
58
+ $divisor: abs($divisor);
59
+ @if $dividend == 0 {
60
+ @return 0;
61
+ }
62
+ @if $divisor == 0 {
63
+ @error "Cannot divide by 0";
64
+ }
65
+ $remainder: $dividend;
66
+ $result: 0;
67
+ $factor: 10;
68
+ @while ($remainder > 0 and $precision >= 0) {
69
+ $quotient: 0;
70
+ @while ($remainder >= $divisor) {
71
+ $remainder: $remainder - $divisor;
72
+ $quotient: $quotient + 1;
73
+ }
74
+ $result: $result * 10 + $quotient;
75
+ $factor: $factor * .1;
76
+ $remainder: $remainder * 10;
77
+ $precision: $precision - 1;
78
+ @if ($precision < 0 and $remainder >= $divisor * 5) {
79
+ $result: $result + 1;
80
+ }
81
+ }
82
+ $result: $result * $factor * $sign;
83
+ $dividend-unit: unit($dividend);
84
+ $divisor-unit: unit($divisor);
85
+ $unit-map: (
86
+ "px": 1px,
87
+ "rem": 1rem,
88
+ "em": 1em,
89
+ "%": 1%
90
+ );
91
+ @if ($dividend-unit != $divisor-unit and map-has-key($unit-map, $dividend-unit)) {
92
+ $result: $result * map-get($unit-map, $dividend-unit);
93
+ }
94
+ @return $result;
95
+ }
96
+
55
97
  // Remove px-unit from $rfs-base-value for calculations
56
98
  @if $rfs-base-value-unit == px {
57
- $rfs-base-value: $rfs-base-value / ($rfs-base-value * 0 + 1);
99
+ $rfs-base-value: divide($rfs-base-value, $rfs-base-value * 0 + 1);
58
100
  }
59
101
  @else if $rfs-base-value-unit == rem {
60
- $rfs-base-value: $rfs-base-value / ($rfs-base-value * 0 + 1 / $rfs-rem-value);
102
+ $rfs-base-value: divide($rfs-base-value, divide($rfs-base-value * 0 + 1, $rfs-rem-value));
61
103
  }
62
104
 
63
105
  // Cache $rfs-breakpoint unit to prevent multiple calls
@@ -65,14 +107,14 @@ $rfs-breakpoint-unit-cache: unit($rfs-breakpoint);
65
107
 
66
108
  // Remove unit from $rfs-breakpoint for calculations
67
109
  @if $rfs-breakpoint-unit-cache == px {
68
- $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1);
110
+ $rfs-breakpoint: divide($rfs-breakpoint, $rfs-breakpoint * 0 + 1);
69
111
  }
70
112
  @else if $rfs-breakpoint-unit-cache == rem or $rfs-breakpoint-unit-cache == "em" {
71
- $rfs-breakpoint: $rfs-breakpoint / ($rfs-breakpoint * 0 + 1 / $rfs-rem-value);
113
+ $rfs-breakpoint: divide($rfs-breakpoint, divide($rfs-breakpoint * 0 + 1, $rfs-rem-value));
72
114
  }
73
115
 
74
116
  // Calculate the media query value
75
- $rfs-mq-value: if($rfs-breakpoint-unit == px, #{$rfs-breakpoint}px, #{$rfs-breakpoint / $rfs-rem-value}#{$rfs-breakpoint-unit});
117
+ $rfs-mq-value: if($rfs-breakpoint-unit == px, #{$rfs-breakpoint}px, #{divide($rfs-breakpoint, $rfs-rem-value)}#{$rfs-breakpoint-unit});
76
118
  $rfs-mq-property-width: if($rfs-mode == max-media-query, max-width, min-width);
77
119
  $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height);
78
120
 
@@ -164,11 +206,11 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
164
206
 
165
207
  @if $unit == px {
166
208
  // Convert to rem if needed
167
- $val: $val + ' ' + if($rfs-unit == rem, #{$value / ($value * 0 + $rfs-rem-value)}rem, $value);
209
+ $val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $value * 0 + $rfs-rem-value)}rem, $value);
168
210
  }
169
211
  @else if $unit == rem {
170
212
  // Convert to px if needed
171
- $val: $val + ' ' + if($rfs-unit == px, #{$value / ($value * 0 + 1) * $rfs-rem-value}px, $value);
213
+ $val: $val + ' ' + if($rfs-unit == px, #{divide($value, $value * 0 + 1) * $rfs-rem-value}px, $value);
172
214
  }
173
215
  @else {
174
216
  // If $value isn't a number (like inherit) or $value has a unit (not px or rem, like 1.5em) or $ is 0, just print the value
@@ -205,21 +247,21 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
205
247
 
206
248
  @else {
207
249
  // Remove unit from $value for calculations
208
- $value: $value / ($value * 0 + if($unit == px, 1, 1 / $rfs-rem-value));
250
+ $value: divide($value, $value * 0 + if($unit == px, 1, divide(1, $rfs-rem-value)));
209
251
 
210
252
  // Only add the media query if the value is greater than the minimum value
211
253
  @if abs($value) <= $rfs-base-value or not $enable-rfs {
212
- $val: $val + ' ' + if($rfs-unit == rem, #{$value / $rfs-rem-value}rem, #{$value}px);
254
+ $val: $val + ' ' + if($rfs-unit == rem, #{divide($value, $rfs-rem-value)}rem, #{$value}px);
213
255
  }
214
256
  @else {
215
257
  // Calculate the minimum value
216
- $value-min: $rfs-base-value + (abs($value) - $rfs-base-value) / $rfs-factor;
258
+ $value-min: $rfs-base-value + divide(abs($value) - $rfs-base-value, $rfs-factor);
217
259
 
218
260
  // Calculate difference between $value and the minimum value
219
261
  $value-diff: abs($value) - $value-min;
220
262
 
221
263
  // Base value formatting
222
- $min-width: if($rfs-unit == rem, #{$value-min / $rfs-rem-value}rem, #{$value-min}px);
264
+ $min-width: if($rfs-unit == rem, #{divide($value-min, $rfs-rem-value)}rem, #{$value-min}px);
223
265
 
224
266
  // Use negative value if needed
225
267
  $min-width: if($value < 0, -$min-width, $min-width);
@@ -228,7 +270,7 @@ $rfs-mq-property-height: if($rfs-mode == max-media-query, max-height, min-height
228
270
  $variable-unit: if($rfs-two-dimensional, vmin, vw);
229
271
 
230
272
  // Calculate the variable width between 0 and $rfs-breakpoint
231
- $variable-width: #{$value-diff * 100 / $rfs-breakpoint}#{$variable-unit};
273
+ $variable-width: #{divide($value-diff * 100, $rfs-breakpoint)}#{$variable-unit};
232
274
 
233
275
  // Return the calculated value
234
276
  $val: $val + ' calc(' + $min-width + if($value < 0, ' - ', ' + ') + $variable-width + ')';
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.0'
5
- BOOTSTRAP_SHA = 'bf0936748602c8109fd916c64b4560799fa1c3f8'
4
+ VERSION = '5.1.1'
5
+ BOOTSTRAP_SHA = '0d81d3cbc14dfcdca8a868e3f25189a4f1ab273c'
6
6
  end
data/tasks/updater/js.rb CHANGED
@@ -2,7 +2,7 @@ require 'tsort'
2
2
 
3
3
  class Updater
4
4
  module Js
5
- INLINED_SRCS = %w[util/index.js util/backdrop.js util/sanitizer.js util/scrollbar.js].freeze
5
+ INLINED_SRCS = %w[util/backdrop.js util/component-functions.js util/focustrap.js util/index.js util/sanitizer.js util/scrollbar.js].freeze
6
6
 
7
7
  def update_javascript_assets
8
8
  log_status 'Updating javascripts...'
@@ -72,7 +72,11 @@ class Updater
72
72
  end
73
73
 
74
74
  def tsort_each_child(node, &block)
75
- @imports[node].each(&block)
75
+ node_imports = @imports[node]
76
+ if node_imports.nil?
77
+ raise "No imports found for #{node.inspect}"
78
+ end
79
+ node_imports.each(&block)
76
80
  end
77
81
 
78
82
  def tsort_each_node(&block)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0
4
+ version: 5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Twitter, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-06 00:00:00.000000000 Z
11
+ date: 2021-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: popper_js
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 2.9.2
19
+ version: 2.9.3
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '3'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: 2.9.2
29
+ version: 2.9.3
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3'
@@ -64,28 +64,28 @@ dependencies:
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: 5.8.0
67
+ version: 5.14.4
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - "~>"
73
73
  - !ruby/object:Gem::Version
74
- version: 5.8.0
74
+ version: 5.14.4
75
75
  - !ruby/object:Gem::Dependency
76
76
  name: minitest-reporters
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
79
  - - "~>"
80
80
  - !ruby/object:Gem::Version
81
- version: 1.0.5
81
+ version: 1.4.3
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
86
  - - "~>"
87
87
  - !ruby/object:Gem::Version
88
- version: 1.0.5
88
+ version: 1.4.3
89
89
  - !ruby/object:Gem::Dependency
90
90
  name: term-ansicolor
91
91
  requirement: !ruby/object:Gem::Requirement
@@ -260,6 +260,7 @@ files:
260
260
  - assets/stylesheets/bootstrap/_navbar.scss
261
261
  - assets/stylesheets/bootstrap/_offcanvas.scss
262
262
  - assets/stylesheets/bootstrap/_pagination.scss
263
+ - assets/stylesheets/bootstrap/_placeholders.scss
263
264
  - assets/stylesheets/bootstrap/_popover.scss
264
265
  - assets/stylesheets/bootstrap/_progress.scss
265
266
  - assets/stylesheets/bootstrap/_reboot.scss
@@ -286,10 +287,13 @@ files:
286
287
  - assets/stylesheets/bootstrap/helpers/_colored-links.scss
287
288
  - assets/stylesheets/bootstrap/helpers/_position.scss
288
289
  - assets/stylesheets/bootstrap/helpers/_ratio.scss
290
+ - assets/stylesheets/bootstrap/helpers/_stacks.scss
289
291
  - assets/stylesheets/bootstrap/helpers/_stretched-link.scss
290
292
  - assets/stylesheets/bootstrap/helpers/_text-truncation.scss
291
293
  - assets/stylesheets/bootstrap/helpers/_visually-hidden.scss
294
+ - assets/stylesheets/bootstrap/helpers/_vr.scss
292
295
  - assets/stylesheets/bootstrap/mixins/_alert.scss
296
+ - assets/stylesheets/bootstrap/mixins/_backdrop.scss
293
297
  - assets/stylesheets/bootstrap/mixins/_border-radius.scss
294
298
  - assets/stylesheets/bootstrap/mixins/_box-shadow.scss
295
299
  - assets/stylesheets/bootstrap/mixins/_breakpoints.scss