material_components_web-sass 0.15.0 → 0.16.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 (38) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -0
  3. data/lib/material_components_web/sass/version.rb +1 -1
  4. data/vendor/assets/javascripts/material-components-web.js +6728 -6253
  5. data/vendor/assets/stylesheets/@material/animation/_functions.scss +7 -3
  6. data/vendor/assets/stylesheets/@material/animation/_mixins.scss +10 -6
  7. data/vendor/assets/stylesheets/@material/animation/_variables.scss +4 -3
  8. data/vendor/assets/stylesheets/@material/animation/mdc-animation.scss +10 -6
  9. data/vendor/assets/stylesheets/@material/button/mdc-button.scss +2 -0
  10. data/vendor/assets/stylesheets/@material/card/mdc-card.scss +3 -3
  11. data/vendor/assets/stylesheets/@material/checkbox/_keyframes.scss +4 -4
  12. data/vendor/assets/stylesheets/@material/checkbox/mdc-checkbox.scss +1 -1
  13. data/vendor/assets/stylesheets/@material/drawer/_mixins.scss +5 -2
  14. data/vendor/assets/stylesheets/@material/drawer/persistent/mdc-persistent-drawer.scss +1 -1
  15. data/vendor/assets/stylesheets/@material/drawer/slidable/_variables.scss +3 -3
  16. data/vendor/assets/stylesheets/@material/drawer/temporary/mdc-temporary-drawer.scss +2 -2
  17. data/vendor/assets/stylesheets/@material/elevation/_mixins.scss +3 -2
  18. data/vendor/assets/stylesheets/@material/elevation/_variables.scss +1 -1
  19. data/vendor/assets/stylesheets/@material/fab/mdc-fab.scss +3 -3
  20. data/vendor/assets/stylesheets/@material/form-field/mdc-form-field.scss +2 -2
  21. data/vendor/assets/stylesheets/@material/grid-list/mdc-grid-list.scss +4 -5
  22. data/vendor/assets/stylesheets/@material/layout-grid/_mixins.scss +36 -6
  23. data/vendor/assets/stylesheets/@material/layout-grid/mdc-layout-grid.scss +5 -2
  24. data/vendor/assets/stylesheets/@material/linear-progress/mdc-linear-progress.scss +3 -3
  25. data/vendor/assets/stylesheets/@material/list/mdc-list.scss +3 -3
  26. data/vendor/assets/stylesheets/@material/menu/simple/mdc-simple-menu.scss +3 -3
  27. data/vendor/assets/stylesheets/@material/radio/mdc-radio.scss +1 -1
  28. data/vendor/assets/stylesheets/@material/ripple/_keyframes.scss +1 -1
  29. data/vendor/assets/stylesheets/@material/ripple/_mixins.scss +24 -0
  30. data/vendor/assets/stylesheets/@material/rtl/_mixins.scss +5 -5
  31. data/vendor/assets/stylesheets/@material/select/mdc-select.scss +4 -4
  32. data/vendor/assets/stylesheets/@material/slider/mdc-slider.scss +1 -0
  33. data/vendor/assets/stylesheets/@material/snackbar/mdc-snackbar.scss +4 -4
  34. data/vendor/assets/stylesheets/@material/textfield/mdc-textfield.scss +5 -5
  35. data/vendor/assets/stylesheets/@material/theme/_mixins.scss +2 -0
  36. data/vendor/assets/stylesheets/@material/toolbar/mdc-toolbar.scss +4 -3
  37. data/vendor/assets/stylesheets/@material/typography/_mixins.scss +7 -0
  38. metadata +2 -2
@@ -17,9 +17,13 @@
17
17
  @import "./variables";
18
18
 
19
19
  @function mdc-animation-enter($name, $duration, $delay: 0ms) {
20
- @return $name $duration $delay $mdc-animation-linear-out-slow-in-timing-function;
20
+ @return $name $duration $delay $mdc-animation-deceleration-curve-timing-function;
21
21
  }
22
22
 
23
- @function mdc-animation-exit($name, $duration, $delay: 0ms) {
24
- @return $name $duration $delay $mdc-animation-fast-out-linear-in-timing-function;
23
+ @function mdc-animation-exit-permanent($name, $duration, $delay: 0ms) {
24
+ @return $name $duration $delay $mdc-animation-acceleration-curve-timing-function;
25
+ }
26
+
27
+ @function mdc-animation-exit-temporary($name, $duration, $delay: 0ms) {
28
+ @return $name $duration $delay $mdc-animation-sharp-curve-timing-function;
25
29
  }
@@ -16,14 +16,18 @@
16
16
 
17
17
  @import "./variables";
18
18
 
19
- @mixin mdc-animation-linear-out-slow-in {
20
- animation-timing-function: $mdc-animation-linear-out-slow-in-timing-function;
19
+ @mixin mdc-animation-deceleration-curve {
20
+ animation-timing-function: $mdc-animation-deceleration-curve-timing-function;
21
21
  }
22
22
 
23
- @mixin mdc-animation-fast-out-slow-in {
24
- animation-timing-function: $mdc-animation-fast-out-slow-in-timing-function;
23
+ @mixin mdc-animation-standard-curve {
24
+ animation-timing-function: $mdc-animation-standard-curve-timing-function;
25
25
  }
26
26
 
27
- @mixin mdc-animation-fast-out-linear-in {
28
- animation-timing-function: $mdc-animation-fast-out-linear-in-timing-function;
27
+ @mixin mdc-animation-acceleration-curve {
28
+ animation-timing-function: $mdc-animation-acceleration-curve-timing-function;
29
+ }
30
+
31
+ @mixin mdc-animation-sharp-curve {
32
+ animation-timing-function: $mdc-animation-sharp-curve-timing-function;
29
33
  }
@@ -14,6 +14,7 @@
14
14
  // limitations under the License.
15
15
  //
16
16
 
17
- $mdc-animation-linear-out-slow-in-timing-function: cubic-bezier(0, 0, .2, 1) !default;
18
- $mdc-animation-fast-out-slow-in-timing-function: cubic-bezier(.4, 0, .2, 1) !default;
19
- $mdc-animation-fast-out-linear-in-timing-function: cubic-bezier(.4, 0, 1, 1) !default;
17
+ $mdc-animation-deceleration-curve-timing-function: cubic-bezier(0, 0, .2, 1) !default;
18
+ $mdc-animation-standard-curve-timing-function: cubic-bezier(.4, 0, .2, 1) !default;
19
+ $mdc-animation-acceleration-curve-timing-function: cubic-bezier(.4, 0, 1, 1) !default;
20
+ $mdc-animation-sharp-curve-timing-function: cubic-bezier(.4, 0, .6, 1) !default;
@@ -17,15 +17,19 @@
17
17
  @import "./mixins";
18
18
 
19
19
  .mdc-animation {
20
- &-linear-out-slow-in {
21
- @include mdc-animation-linear-out-slow-in;
20
+ &-deceleration-curve {
21
+ @include mdc-animation-deceleration-curve;
22
22
  }
23
23
 
24
- &-fast-out-slow-in {
25
- @include mdc-animation-fast-out-slow-in;
24
+ &-standard-curve {
25
+ @include mdc-animation-standard-curve;
26
26
  }
27
27
 
28
- &-fast-out-linear-in {
29
- @include mdc-animation-fast-out-linear-in;
28
+ &-acceleration-curve {
29
+ @include mdc-animation-acceleration-curve;
30
+ }
31
+
32
+ &-sharp-curve {
33
+ @include mdc-animation-sharp-curve;
30
34
  }
31
35
  }
@@ -19,6 +19,7 @@
19
19
  @import "@material/elevation/mixins";
20
20
  @import "@material/ripple/mixins";
21
21
  @import "@material/theme/mixins";
22
+ @import "@material/typography/mixins";
22
23
 
23
24
  // postcss-bem-linter: define button
24
25
 
@@ -27,6 +28,7 @@
27
28
  @include mdc-ripple-bg((pseudo: "::before"));
28
29
  @include mdc-ripple-fg((pseudo: "::after"));
29
30
  @include mdc-theme-prop(color, text-primary-on-light);
31
+ @include mdc-typography-base;
30
32
 
31
33
  display: inline-block;
32
34
  position: relative;
@@ -50,7 +50,7 @@
50
50
  box-sizing: border-box;
51
51
 
52
52
  @include mdc-typography(body1);
53
- @include mdc-theme-prop(color, text-primary-on-background);
53
+ @include mdc-theme-prop(color, text-primary-on-light);
54
54
 
55
55
  @include mdc-theme-dark(".mdc-card") {
56
56
  @include mdc-theme-prop(color, text-primary-on-dark);
@@ -132,7 +132,7 @@
132
132
 
133
133
  &__title {
134
134
  @include mdc-typography(body2);
135
- @include mdc-theme-prop(color, text-primary-on-background);
135
+ @include mdc-theme-prop(color, text-primary-on-light);
136
136
 
137
137
  // Adjust text color for dark theme.
138
138
  @include mdc-theme-dark(".mdc-card") {
@@ -150,7 +150,7 @@
150
150
 
151
151
  &__subtitle {
152
152
  @include mdc-typography(body1);
153
- @include mdc-theme-prop(color, text-primary-on-background);
153
+ @include mdc-theme-prop(color, text-primary-on-light);
154
154
 
155
155
  // Adjust text color for dark theme.
156
156
  @include mdc-theme-dark(".mdc-card") {
@@ -74,7 +74,7 @@
74
74
  }
75
75
 
76
76
  50% {
77
- @include mdc-animation-linear-out-slow-in;
77
+ @include mdc-animation-deceleration-curve;
78
78
  }
79
79
 
80
80
  100% {
@@ -99,7 +99,7 @@
99
99
 
100
100
  @keyframes mdc-checkbox-checked-unchecked-checkmark-path {
101
101
  from {
102
- @include mdc-animation-fast-out-linear-in;
102
+ @include mdc-animation-acceleration-curve;
103
103
 
104
104
  opacity: 1;
105
105
  stroke-dashoffset: 0;
@@ -116,7 +116,7 @@
116
116
  transform: rotate(0deg);
117
117
  opacity: 1;
118
118
 
119
- @include mdc-animation-linear-out-slow-in;
119
+ @include mdc-animation-deceleration-curve;
120
120
  }
121
121
 
122
122
  to {
@@ -143,7 +143,7 @@
143
143
  transform: rotate(-45deg);
144
144
  opacity: 0;
145
145
 
146
- @include mdc-animation-linear-out-slow-in;
146
+ @include mdc-animation-deceleration-curve;
147
147
  }
148
148
 
149
149
  to {
@@ -30,7 +30,7 @@
30
30
  }
31
31
 
32
32
  @function mdc-checkbox-transition-exit($property, $delay: 0ms, $duration: $mdc-checkbox-transition-duration) {
33
- @return mdc-animation-exit($property, $duration, $delay);
33
+ @return mdc-animation-exit-temporary($property, $duration, $delay);
34
34
  }
35
35
 
36
36
  @mixin mdc-checkbox-cover-element {
@@ -44,6 +44,8 @@
44
44
 
45
45
  @mixin mdc-drawer-header_() {
46
46
  /* Use aspect ratio trick to maintain 16:9 aspect ratio on the header */
47
+ // styline things header is a type
48
+ // stylelint-disable selector-max-type
47
49
  &__header {
48
50
  position: relative;
49
51
  }
@@ -65,6 +67,7 @@
65
67
  padding: 16px;
66
68
  box-sizing: border-box;
67
69
  }
70
+ // stylelint-enable selector-max-type
68
71
  }
69
72
 
70
73
  @mixin mdc-drawer-list_() {
@@ -112,7 +115,7 @@
112
115
  left: 0;
113
116
  width: 100%;
114
117
  height: 100%;
115
- transition: mdc-animation-exit(opacity, 120ms);
118
+ transition: mdc-animation-exit-temporary(opacity, 120ms);
116
119
  border-radius: inherit;
117
120
  background: currentColor;
118
121
  content: "";
@@ -135,7 +138,7 @@
135
138
  }
136
139
 
137
140
  .mdc-list-item:active:focus::before {
138
- transition-timing-function: $mdc-animation-fast-out-slow-in-timing-function;
141
+ transition-timing-function: $mdc-animation-standard-curve-timing-function;
139
142
  }
140
143
  }
141
144
 
@@ -61,7 +61,7 @@ $mdc-persistent-drawer-dark-theme-bg-color: #212121 !default;
61
61
 
62
62
  &--animating {
63
63
  .mdc-persistent-drawer__drawer {
64
- transition: $mdc-slidable-drawer-transition;
64
+ transition: $mdc-slidable-drawer-transition-close;
65
65
  }
66
66
 
67
67
  &.mdc-persistent-drawer--open .mdc-persistent-drawer__drawer {
@@ -14,7 +14,7 @@
14
14
  * limitations under the License.
15
15
  */
16
16
 
17
- $mdc-slidable-drawer-transition-time: .13s;
18
- $mdc-slidable-drawer-transition-open-time: .33s;
19
- $mdc-slidable-drawer-transition: mdc-animation-enter(transform, $mdc-slidable-drawer-transition-time);
17
+ $mdc-slidable-drawer-transition-close-time: .195s;
18
+ $mdc-slidable-drawer-transition-open-time: .225s;
19
+ $mdc-slidable-drawer-transition-close: mdc-animation-exit-temporary(transform, $mdc-slidable-drawer-transition-close-time);
20
20
  $mdc-slidable-drawer-transition-open: mdc-animation-enter(transform, $mdc-slidable-drawer-transition-open-time);
@@ -34,7 +34,7 @@
34
34
  pointer-events: none;
35
35
  box-sizing: border-box;
36
36
  contain: strict;
37
- z-index: 3;
37
+ z-index: 5;
38
38
 
39
39
  /* Shaded background */
40
40
  &::before {
@@ -111,7 +111,7 @@
111
111
  }
112
112
 
113
113
  .mdc-temporary-drawer__drawer {
114
- transition: $mdc-slidable-drawer-transition;
114
+ transition: $mdc-slidable-drawer-transition-close;
115
115
  }
116
116
  }
117
117
 
@@ -30,8 +30,9 @@
30
30
  }
31
31
 
32
32
  #{$mdc-elevation-property}:
33
- #{map-get($mdc-elevation-umbra-map, $z-value)} $mdc-elevation-umbra-color,
34
- #{map-get($mdc-elevation-penumbra-map, $z-value)} $mdc-elevation-penumbra-color;
33
+ #{"#{map-get($mdc-elevation-umbra-map, $z-value)} #{$mdc-elevation-umbra-color}"},
34
+ #{"#{map-get($mdc-elevation-penumbra-map, $z-value)} #{$mdc-elevation-penumbra-color}"},
35
+ #{map-get($mdc-elevation-ambient-map, $z-value)} $mdc-elevation-ambient-color;
35
36
  }
36
37
 
37
38
  /**
@@ -119,4 +119,4 @@ $mdc-elevation-transition-duration: 280ms !default;
119
119
  /**
120
120
  * The default easing value for elevation transitions.
121
121
  */
122
- $mdc-elevation-transition-timing-function: $mdc-animation-fast-out-slow-in-timing-function !default;
122
+ $mdc-elevation-transition-timing-function: $mdc-animation-standard-curve-timing-function !default;
@@ -30,7 +30,7 @@
30
30
  width: 56px;
31
31
  height: 56px;
32
32
  padding: 0;
33
- transition: box-shadow 280ms $mdc-animation-fast-out-slow-in-timing-function;
33
+ transition: box-shadow 280ms $mdc-animation-standard-curve-timing-function;
34
34
  border: none;
35
35
  border-radius: 50%;
36
36
  cursor: pointer;
@@ -83,12 +83,12 @@
83
83
  // This allows for using SVGs within them to align properly in all browsers.
84
84
  // Can remove once: https://bugzilla.mozilla.org/show_bug.cgi?id=1294515 is resolved.
85
85
 
86
- // stylelint-disable selector-no-type
86
+ // stylelint-disable selector-max-type
87
87
  // postcss-bem-linter: ignore
88
88
  > svg {
89
89
  width: 100%;
90
90
  }
91
- // stylelint-enable selector-no-type
91
+ // stylelint-enable selector-max-type
92
92
 
93
93
  fieldset:disabled &,
94
94
  &:disabled {
@@ -20,7 +20,7 @@
20
20
 
21
21
  $mdc-form-field-item-spacing: 4px;
22
22
 
23
- /* stylelint-disable selector-no-type */
23
+ /* stylelint-disable selector-max-type */
24
24
  .mdc-form-field {
25
25
  @include mdc-typography(body1);
26
26
  @include mdc-theme-prop(color, text-primary-on-light);
@@ -61,4 +61,4 @@ $mdc-form-field-item-spacing: 4px;
61
61
  }
62
62
  }
63
63
  }
64
- /* stylelint-enable selector-no-type */
64
+ /* stylelint-enable selector-max-type */
@@ -54,8 +54,7 @@ $mdc-grid-list-tile-secondary-icon-size: 24px;
54
54
 
55
55
  &__tiles {
56
56
  display: flex;
57
- flex-direction: row;
58
- flex-wrap: wrap;
57
+ flex-flow: row wrap;
59
58
  margin: 0;
60
59
  padding: 0;
61
60
  }
@@ -171,13 +170,13 @@ $mdc-grid-list-tile-secondary-icon-size: 24px;
171
170
  font-size: 1rem;
172
171
  font-weight: #{map-get($mdc-typography-font-weight-values, medium)};
173
172
  line-height: 1rem;
174
- text-overflow: ellipsis;
175
- white-space: nowrap;
176
- overflow: hidden;
173
+
174
+ @include mdc-typography-overflow-ellipsis;
177
175
  }
178
176
 
179
177
  &__support-text {
180
178
  @include mdc-typography(body1);
179
+ @include mdc-typography-overflow-ellipsis;
181
180
 
182
181
  display: block;
183
182
  margin: 0;
@@ -12,32 +12,62 @@
12
12
  // See the License for the specific language governing permissions and
13
13
  // limitations under the License.
14
14
 
15
+ // returns the lower grid boundary or null if the smallest grid is selected
16
+ @function mdc-layout-grid-breakpoint-min($size) {
17
+ @if not map-has-key($mdc-layout-grid-columns, $size) {
18
+ @error "Invalid style specified! Choose one of #{map-keys($mdc-layout-grid-columns)}";
19
+ }
20
+ $min: map-get($mdc-layout-grid-breakpoints, $size);
21
+
22
+ @return if($min != 0, $min, null);
23
+ }
24
+
25
+ // returns the upper grid boundary or null if the largest grid is selected
26
+ @function mdc-layout-grid-breakpoint-max($size) {
27
+ @if not map-has-key($mdc-layout-grid-columns, $size) {
28
+ @error "Invalid style specified! Choose one of #{map-keys($mdc-layout-grid-columns)}";
29
+ }
30
+ $names: map-keys($mdc-layout-grid-columns);
31
+ $n: index($names, $size);
32
+ $prev: if($n > 1, nth($names, $n - 1), null);
33
+
34
+ @return if($prev, (mdc-layout-grid-breakpoint-min($prev) - 1px), null);
35
+ }
36
+
15
37
  // Private mixins, meant for internal use.
16
38
  @mixin mdc-layout-grid-media-query_($size) {
17
39
  @if not map-has-key($mdc-layout-grid-columns, $size) {
18
40
  @error "Invalid style specified! Choose one of #{map-keys($mdc-layout-grid-columns)}";
19
41
  }
20
42
 
21
- @if $size == phone {
43
+ $min: mdc-layout-grid-breakpoint-min($size);
44
+ $max: mdc-layout-grid-breakpoint-max($size);
45
+
46
+ @if $min == null and $max != null {
22
47
  // Phone
23
- @media (max-width: map-get($mdc-layout-grid-breakpoints, tablet) - 1px) {
48
+ @media (max-width: $max) {
24
49
  @content;
25
50
  }
26
51
  }
27
52
 
28
- @if $size == tablet {
53
+ @else if $min != null and $max != null {
29
54
  // Tablet
30
- @media (min-width: map-get($mdc-layout-grid-breakpoints, tablet)) and (max-width: map-get($mdc-layout-grid-breakpoints, desktop) - 1px) {
55
+ @media (min-width: $min) and (max-width: $max) {
31
56
  @content;
32
57
  }
33
58
  }
34
59
 
35
- @if $size == desktop {
60
+ @else if $min != null and $max == null {
36
61
  // Desktop
37
- @media (min-width: map-get($mdc-layout-grid-breakpoints, desktop)) {
62
+ @media (min-width: $min) {
38
63
  @content;
39
64
  }
40
65
  }
66
+
67
+ @else {
68
+ // Fallback - no breakpoints defined
69
+ @content;
70
+ }
41
71
  }
42
72
 
43
73
  @mixin mdc-layout-grid-cell-span_($size, $span, $gutter) {
@@ -46,13 +46,16 @@
46
46
  }
47
47
 
48
48
  .mdc-layout-grid__cell {
49
+ // select the upper breakpoint
50
+ $upper-breakpoint: nth(map-keys($mdc-layout-grid-columns), 1);
51
+
49
52
  @each $size in map-keys($mdc-layout-grid-columns) {
50
53
  @include mdc-layout-grid-media-query_($size) {
51
54
  $gutter: map-get($mdc-layout-grid-default-gutter, $size);
52
55
 
53
56
  @include mdc-layout-grid-cell($size, $mdc-layout-grid-default-column-span, $gutter);
54
57
 
55
- @for $span from 1 through map-get($mdc-layout-grid-columns, desktop) {
58
+ @for $span from 1 through map-get($mdc-layout-grid-columns, $upper-breakpoint) {
56
59
  // Span classes.
57
60
  // stylelint-disable max-nesting-depth
58
61
  @at-root .mdc-layout-grid__cell--span-#{$span},
@@ -65,7 +68,7 @@
65
68
  }
66
69
 
67
70
  // Order override classes.
68
- @for $i from 1 through map-get($mdc-layout-grid-columns, desktop) {
71
+ @for $i from 1 through map-get($mdc-layout-grid-columns, $upper-breakpoint) {
69
72
  &--order-#{$i} {
70
73
  @include mdc-layout-grid-cell-order($i);
71
74
  }
@@ -21,7 +21,7 @@
21
21
  width: 100%;
22
22
  height: 4px;
23
23
  transform: translateZ(0);
24
- transition: mdc-animation-exit(opacity, 250ms);
24
+ transition: mdc-animation-exit-temporary(opacity, 250ms);
25
25
  overflow: hidden;
26
26
 
27
27
  &__bar {
@@ -30,7 +30,7 @@
30
30
  width: 100%;
31
31
  height: 100%;
32
32
  transform-origin: top left;
33
- transition: mdc-animation-exit(transform, 250ms);
33
+ transition: mdc-animation-exit-temporary(transform, 250ms);
34
34
  }
35
35
 
36
36
  &__bar-inner {
@@ -64,7 +64,7 @@
64
64
  width: 100%;
65
65
  height: 100%;
66
66
  transform-origin: top left;
67
- transition: mdc-animation-exit(transform, 250ms);
67
+ transition: mdc-animation-exit-temporary(transform, 250ms);
68
68
  background-color: #e6e6e6;
69
69
  }
70
70