bootstrap 5.1.1 → 5.2.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.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/assets/javascripts/bootstrap/alert.js +18 -153
  4. data/assets/javascripts/bootstrap/base-component.js +44 -127
  5. data/assets/javascripts/bootstrap/button.js +16 -80
  6. data/assets/javascripts/bootstrap/carousel.js +225 -497
  7. data/assets/javascripts/bootstrap/collapse.js +79 -262
  8. data/assets/javascripts/bootstrap/dom/data.js +6 -8
  9. data/assets/javascripts/bootstrap/dom/event-handler.js +95 -133
  10. data/assets/javascripts/bootstrap/dom/manipulator.js +25 -29
  11. data/assets/javascripts/bootstrap/dom/selector-engine.js +17 -59
  12. data/assets/javascripts/bootstrap/dropdown.js +124 -342
  13. data/assets/javascripts/bootstrap/modal.js +122 -767
  14. data/assets/javascripts/bootstrap/offcanvas.js +102 -671
  15. data/assets/javascripts/bootstrap/popover.js +42 -124
  16. data/assets/javascripts/bootstrap/scrollspy.js +186 -269
  17. data/assets/javascripts/bootstrap/tab.js +222 -221
  18. data/assets/javascripts/bootstrap/toast.js +41 -227
  19. data/assets/javascripts/bootstrap/tooltip.js +283 -629
  20. data/assets/javascripts/bootstrap/util/backdrop.js +165 -0
  21. data/assets/javascripts/bootstrap/util/component-functions.js +46 -0
  22. data/assets/javascripts/bootstrap/util/config.js +79 -0
  23. data/assets/javascripts/bootstrap/util/focustrap.js +129 -0
  24. data/assets/javascripts/bootstrap/util/index.js +350 -0
  25. data/assets/javascripts/bootstrap/util/sanitizer.js +122 -0
  26. data/assets/javascripts/bootstrap/util/scrollbar.js +138 -0
  27. data/assets/javascripts/bootstrap/util/swipe.js +155 -0
  28. data/assets/javascripts/bootstrap/util/template-factory.js +177 -0
  29. data/assets/javascripts/bootstrap-global-this-define.js +1 -1
  30. data/assets/javascripts/bootstrap-sprockets.js +16 -7
  31. data/assets/javascripts/bootstrap.js +2094 -1891
  32. data/assets/javascripts/bootstrap.min.js +3 -3
  33. data/assets/stylesheets/_bootstrap-grid.scss +3 -6
  34. data/assets/stylesheets/_bootstrap-reboot.scss +3 -7
  35. data/assets/stylesheets/_bootstrap.scss +4 -6
  36. data/assets/stylesheets/bootstrap/_accordion.scss +52 -24
  37. data/assets/stylesheets/bootstrap/_alert.scss +18 -4
  38. data/assets/stylesheets/bootstrap/_badge.scss +14 -5
  39. data/assets/stylesheets/bootstrap/_breadcrumb.scss +22 -10
  40. data/assets/stylesheets/bootstrap/_button-group.scss +3 -0
  41. data/assets/stylesheets/bootstrap/_buttons.scss +97 -22
  42. data/assets/stylesheets/bootstrap/_card.scss +55 -37
  43. data/assets/stylesheets/bootstrap/_close.scss +1 -1
  44. data/assets/stylesheets/bootstrap/_containers.scss +1 -1
  45. data/assets/stylesheets/bootstrap/_dropdown.scss +83 -75
  46. data/assets/stylesheets/bootstrap/_functions.scss +7 -7
  47. data/assets/stylesheets/bootstrap/_grid.scss +3 -3
  48. data/assets/stylesheets/bootstrap/_helpers.scss +1 -0
  49. data/assets/stylesheets/bootstrap/_list-group.scss +44 -27
  50. data/assets/stylesheets/bootstrap/_maps.scss +54 -0
  51. data/assets/stylesheets/bootstrap/_modal.scss +71 -43
  52. data/assets/stylesheets/bootstrap/_nav.scss +53 -20
  53. data/assets/stylesheets/bootstrap/_navbar.scss +91 -150
  54. data/assets/stylesheets/bootstrap/_offcanvas.scss +119 -59
  55. data/assets/stylesheets/bootstrap/_pagination.scss +66 -21
  56. data/assets/stylesheets/bootstrap/_placeholders.scss +1 -1
  57. data/assets/stylesheets/bootstrap/_popover.scss +90 -52
  58. data/assets/stylesheets/bootstrap/_progress.scss +20 -9
  59. data/assets/stylesheets/bootstrap/_reboot.scss +25 -40
  60. data/assets/stylesheets/bootstrap/_root.scss +40 -21
  61. data/assets/stylesheets/bootstrap/_spinners.scss +38 -22
  62. data/assets/stylesheets/bootstrap/_tables.scss +38 -25
  63. data/assets/stylesheets/bootstrap/_toasts.scss +35 -16
  64. data/assets/stylesheets/bootstrap/_tooltip.scss +61 -56
  65. data/assets/stylesheets/bootstrap/_type.scss +2 -0
  66. data/assets/stylesheets/bootstrap/_utilities.scss +43 -26
  67. data/assets/stylesheets/bootstrap/_variables.scss +118 -124
  68. data/assets/stylesheets/bootstrap/bootstrap-utilities.scss +3 -6
  69. data/assets/stylesheets/bootstrap/forms/_floating-labels.scss +14 -3
  70. data/assets/stylesheets/bootstrap/forms/_form-check.scss +28 -5
  71. data/assets/stylesheets/bootstrap/forms/_form-control.scss +12 -37
  72. data/assets/stylesheets/bootstrap/forms/_form-select.scss +2 -1
  73. data/assets/stylesheets/bootstrap/forms/_input-group.scss +15 -7
  74. data/assets/stylesheets/bootstrap/helpers/_color-bg.scss +10 -0
  75. data/assets/stylesheets/bootstrap/helpers/_colored-links.scss +2 -2
  76. data/assets/stylesheets/bootstrap/helpers/_position.scss +7 -1
  77. data/assets/stylesheets/bootstrap/helpers/_ratio.scss +2 -2
  78. data/assets/stylesheets/bootstrap/helpers/_vr.scss +1 -1
  79. data/assets/stylesheets/bootstrap/mixins/_alert.scss +7 -3
  80. data/assets/stylesheets/bootstrap/mixins/_banner.scss +9 -0
  81. data/assets/stylesheets/bootstrap/mixins/_breakpoints.scss +8 -8
  82. data/assets/stylesheets/bootstrap/mixins/_buttons.scss +32 -95
  83. data/assets/stylesheets/bootstrap/mixins/_container.scss +4 -2
  84. data/assets/stylesheets/bootstrap/mixins/_forms.scss +8 -0
  85. data/assets/stylesheets/bootstrap/mixins/_gradients.scss +1 -1
  86. data/assets/stylesheets/bootstrap/mixins/_grid.scss +13 -12
  87. data/assets/stylesheets/bootstrap/mixins/_pagination.scss +4 -25
  88. data/assets/stylesheets/bootstrap/mixins/_reset-text.scss +1 -1
  89. data/assets/stylesheets/bootstrap/mixins/_table-variants.scss +12 -9
  90. data/assets/stylesheets/bootstrap/mixins/_utilities.scss +12 -4
  91. data/assets/stylesheets/bootstrap/mixins/_visually-hidden.scss +1 -1
  92. data/bootstrap.gemspec +1 -1
  93. data/lib/bootstrap/version.rb +2 -2
  94. data/tasks/updater/js.rb +9 -4
  95. metadata +16 -4
@@ -2,30 +2,9 @@
2
2
 
3
3
  // scss-docs-start pagination-mixin
4
4
  @mixin pagination-size($padding-y, $padding-x, $font-size, $border-radius) {
5
- .page-link {
6
- padding: $padding-y $padding-x;
7
- @include font-size($font-size);
8
- }
9
-
10
- .page-item {
11
- @if $pagination-margin-start == (-$pagination-border-width) {
12
- &:first-child {
13
- .page-link {
14
- @include border-start-radius($border-radius);
15
- }
16
- }
17
-
18
- &:last-child {
19
- .page-link {
20
- @include border-end-radius($border-radius);
21
- }
22
- }
23
- } @else {
24
- //Add border-radius to all pageLinks in case they have left margin
25
- .page-link {
26
- @include border-radius($border-radius);
27
- }
28
- }
29
- }
5
+ --#{$prefix}pagination-padding-x: #{$padding-x};
6
+ --#{$prefix}pagination-padding-y: #{$padding-y};
7
+ @include rfs($font-size, --#{$prefix}pagination-font-size);
8
+ --#{$prefix}pagination-border-radius: #{$border-radius};
30
9
  }
31
10
  // scss-docs-end pagination-mixin
@@ -11,7 +11,7 @@
11
11
  text-transform: none;
12
12
  letter-spacing: normal;
13
13
  word-break: normal;
14
- word-spacing: normal;
15
14
  white-space: normal;
15
+ word-spacing: normal;
16
16
  line-break: auto;
17
17
  }
@@ -5,17 +5,20 @@
5
5
  $hover-bg: mix($color, $background, percentage($table-hover-bg-factor));
6
6
  $striped-bg: mix($color, $background, percentage($table-striped-bg-factor));
7
7
  $active-bg: mix($color, $background, percentage($table-active-bg-factor));
8
+ $border-color: mix($color, $background, percentage($table-border-factor));
8
9
 
9
- --#{$variable-prefix}table-bg: #{$background};
10
- --#{$variable-prefix}table-striped-bg: #{$striped-bg};
11
- --#{$variable-prefix}table-striped-color: #{color-contrast($striped-bg)};
12
- --#{$variable-prefix}table-active-bg: #{$active-bg};
13
- --#{$variable-prefix}table-active-color: #{color-contrast($active-bg)};
14
- --#{$variable-prefix}table-hover-bg: #{$hover-bg};
15
- --#{$variable-prefix}table-hover-color: #{color-contrast($hover-bg)};
10
+ --#{$prefix}table-color: #{$color};
11
+ --#{$prefix}table-bg: #{$background};
12
+ --#{$prefix}table-border-color: #{$border-color};
13
+ --#{$prefix}table-striped-bg: #{$striped-bg};
14
+ --#{$prefix}table-striped-color: #{color-contrast($striped-bg)};
15
+ --#{$prefix}table-active-bg: #{$active-bg};
16
+ --#{$prefix}table-active-color: #{color-contrast($active-bg)};
17
+ --#{$prefix}table-hover-bg: #{$hover-bg};
18
+ --#{$prefix}table-hover-color: #{color-contrast($hover-bg)};
16
19
 
17
- color: $color;
18
- border-color: mix($color, $background, percentage($table-border-factor));
20
+ color: var(--#{$prefix}table-color);
21
+ border-color: var(--#{$prefix}table-border-color);
19
22
  }
20
23
  }
21
24
  // scss-docs-end table-variant
@@ -20,6 +20,9 @@
20
20
  $property-class: if(map-has-key($utility, class), map-get($utility, class), nth($properties, 1));
21
21
  $property-class: if($property-class == null, "", $property-class);
22
22
 
23
+ // Use custom CSS variable name if present, otherwise default to `class`
24
+ $css-variable-name: if(map-has-key($utility, css-variable-name), map-get($utility, css-variable-name), map-get($utility, class));
25
+
23
26
  // State params to generate pseudo-classes
24
27
  $state: if(map-has-key($utility, state), map-get($utility, state), ());
25
28
 
@@ -52,20 +55,20 @@
52
55
 
53
56
  @if $is-css-var {
54
57
  .#{$property-class + $infix + $property-class-modifier} {
55
- --#{$variable-prefix}#{$property-class}: #{$value};
58
+ --#{$prefix}#{$css-variable-name}: #{$value};
56
59
  }
57
60
 
58
61
  @each $pseudo in $state {
59
62
  .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
60
- --#{$variable-prefix}#{$property-class}: #{$value};
63
+ --#{$prefix}#{$css-variable-name}: #{$value};
61
64
  }
62
65
  }
63
66
  } @else {
64
67
  .#{$property-class + $infix + $property-class-modifier} {
65
68
  @each $property in $properties {
66
69
  @if $is-local-vars {
67
- @each $local-var, $value in $is-local-vars {
68
- --#{$variable-prefix}#{$local-var}: #{$value};
70
+ @each $local-var, $variable in $is-local-vars {
71
+ --#{$prefix}#{$local-var}: #{$variable};
69
72
  }
70
73
  }
71
74
  #{$property}: $value if($enable-important-utilities, !important, null);
@@ -75,6 +78,11 @@
75
78
  @each $pseudo in $state {
76
79
  .#{$property-class + $infix + $property-class-modifier}-#{$pseudo}:#{$pseudo} {
77
80
  @each $property in $properties {
81
+ @if $is-local-vars {
82
+ @each $local-var, $variable in $is-local-vars {
83
+ --#{$prefix}#{$local-var}: #{$variable};
84
+ }
85
+ }
78
86
  #{$property}: $value if($enable-important-utilities, !important, null);
79
87
  }
80
88
  }
@@ -3,7 +3,7 @@
3
3
  // Hide content visually while keeping it accessible to assistive technologies
4
4
  //
5
5
  // See: https://www.a11yproject.com/posts/2013-01-11-how-to-hide-content/
6
- // See: https://hugogiraudel.com/2016/10/13/css-hide-and-seek/
6
+ // See: https://kittygiraudel.com/2016/10/13/css-hide-and-seek/
7
7
 
8
8
  @mixin visually-hidden() {
9
9
  position: absolute !important;
data/bootstrap.gemspec CHANGED
@@ -14,7 +14,7 @@ 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.3', '< 3'
17
+ s.add_runtime_dependency 'popper_js', '>= 2.11.5', '< 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'
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bootstrap
4
- VERSION = '5.1.1'
5
- BOOTSTRAP_SHA = '0d81d3cbc14dfcdca8a868e3f25189a4f1ab273c'
4
+ VERSION = '5.2.0'
5
+ BOOTSTRAP_SHA = 'edf9c40956d19e6ab3f9151bfe0dfac6be06fa21'
6
6
  end
data/tasks/updater/js.rb CHANGED
@@ -1,8 +1,9 @@
1
+ require 'pathname'
1
2
  require 'tsort'
2
3
 
3
4
  class Updater
4
5
  module Js
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
+ INLINED_SRCS = %w[].freeze
6
7
 
7
8
  def update_javascript_assets
8
9
  log_status 'Updating javascripts...'
@@ -49,7 +50,9 @@ class Updater
49
50
  imports = Deps.new
50
51
  # Get the imports from the ES6 files to order requires correctly.
51
52
  read_files('js/src', src_files).each do |name, content|
52
- file_imports = content.scan(%r{import *(?:[a-zA-Z]*|\{[a-zA-Z ,]*\}) *from '\./([\w/-]+)}).flatten(1).map { |f| "#{f}.js" }.uniq
53
+ file_imports = content.scan(%r{import *(?:[a-zA-Z]*|\{[a-zA-Z ,]*\}) *from '([\w/.-]+)}).flatten(1).map do |f|
54
+ Pathname.new(name).dirname.join("#{f}.js").cleanpath.to_s
55
+ end.uniq
53
56
  imports.add name, *(file_imports - INLINED_SRCS)
54
57
  end
55
58
  imports.tsort
@@ -68,13 +71,15 @@ class Updater
68
71
  end
69
72
 
70
73
  def add(from, *tos)
71
- (@imports[from] ||= []).push(*tos.sort)
74
+ imports = (@imports[from] ||= [])
75
+ imports.push(*tos)
76
+ imports.sort!
72
77
  end
73
78
 
74
79
  def tsort_each_child(node, &block)
75
80
  node_imports = @imports[node]
76
81
  if node_imports.nil?
77
- raise "No imports found for #{node.inspect}"
82
+ raise "No imports found for #{node.inspect}\nImports:\n#{@imports.inspect}"
78
83
  end
79
84
  node_imports.each(&block)
80
85
  end
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.1.1
4
+ version: 5.2.0
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-11-05 00:00:00.000000000 Z
11
+ date: 2022-07-20 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.3
19
+ version: 2.11.5
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.3
29
+ version: 2.11.5
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '3'
@@ -234,6 +234,15 @@ files:
234
234
  - assets/javascripts/bootstrap/tab.js
235
235
  - assets/javascripts/bootstrap/toast.js
236
236
  - assets/javascripts/bootstrap/tooltip.js
237
+ - assets/javascripts/bootstrap/util/backdrop.js
238
+ - assets/javascripts/bootstrap/util/component-functions.js
239
+ - assets/javascripts/bootstrap/util/config.js
240
+ - assets/javascripts/bootstrap/util/focustrap.js
241
+ - assets/javascripts/bootstrap/util/index.js
242
+ - assets/javascripts/bootstrap/util/sanitizer.js
243
+ - assets/javascripts/bootstrap/util/scrollbar.js
244
+ - assets/javascripts/bootstrap/util/swipe.js
245
+ - assets/javascripts/bootstrap/util/template-factory.js
237
246
  - assets/stylesheets/_bootstrap-grid.scss
238
247
  - assets/stylesheets/_bootstrap-reboot.scss
239
248
  - assets/stylesheets/_bootstrap.scss
@@ -254,6 +263,7 @@ files:
254
263
  - assets/stylesheets/bootstrap/_helpers.scss
255
264
  - assets/stylesheets/bootstrap/_images.scss
256
265
  - assets/stylesheets/bootstrap/_list-group.scss
266
+ - assets/stylesheets/bootstrap/_maps.scss
257
267
  - assets/stylesheets/bootstrap/_mixins.scss
258
268
  - assets/stylesheets/bootstrap/_modal.scss
259
269
  - assets/stylesheets/bootstrap/_nav.scss
@@ -284,6 +294,7 @@ files:
284
294
  - assets/stylesheets/bootstrap/forms/_labels.scss
285
295
  - assets/stylesheets/bootstrap/forms/_validation.scss
286
296
  - assets/stylesheets/bootstrap/helpers/_clearfix.scss
297
+ - assets/stylesheets/bootstrap/helpers/_color-bg.scss
287
298
  - assets/stylesheets/bootstrap/helpers/_colored-links.scss
288
299
  - assets/stylesheets/bootstrap/helpers/_position.scss
289
300
  - assets/stylesheets/bootstrap/helpers/_ratio.scss
@@ -294,6 +305,7 @@ files:
294
305
  - assets/stylesheets/bootstrap/helpers/_vr.scss
295
306
  - assets/stylesheets/bootstrap/mixins/_alert.scss
296
307
  - assets/stylesheets/bootstrap/mixins/_backdrop.scss
308
+ - assets/stylesheets/bootstrap/mixins/_banner.scss
297
309
  - assets/stylesheets/bootstrap/mixins/_border-radius.scss
298
310
  - assets/stylesheets/bootstrap/mixins/_box-shadow.scss
299
311
  - assets/stylesheets/bootstrap/mixins/_breakpoints.scss