materialize-sass 1.0.0.alpha1 → 1.0.0.alpha2

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 (46) hide show
  1. checksums.yaml +4 -4
  2. data/assets/javascripts/materialize-sprockets.js +1 -1
  3. data/assets/javascripts/materialize.js +1162 -1218
  4. data/assets/javascripts/materialize/anime.min.js +417 -0
  5. data/assets/javascripts/materialize/buttons.js +49 -26
  6. data/assets/javascripts/materialize/cards.js +14 -8
  7. data/assets/javascripts/materialize/cash.js +3 -5
  8. data/assets/javascripts/materialize/chips.js +22 -19
  9. data/assets/javascripts/materialize/collapsible.js +53 -17
  10. data/assets/javascripts/materialize/datepicker.js +94 -78
  11. data/assets/javascripts/materialize/dropdown.js +33 -26
  12. data/assets/javascripts/materialize/extras/nouislider.js +1 -1
  13. data/assets/javascripts/materialize/extras/nouislider.min.js +1 -1
  14. data/assets/javascripts/materialize/forms.js +17 -6
  15. data/assets/javascripts/materialize/global.js +17 -15
  16. data/assets/javascripts/materialize/materialbox.js +62 -35
  17. data/assets/javascripts/materialize/modal.js +50 -19
  18. data/assets/javascripts/materialize/range.js +40 -16
  19. data/assets/javascripts/materialize/scrollspy.js +9 -3
  20. data/assets/javascripts/materialize/select.js +62 -38
  21. data/assets/javascripts/materialize/sidenav.js +52 -18
  22. data/assets/javascripts/materialize/slider.js +56 -16
  23. data/assets/javascripts/materialize/tabs.js +35 -23
  24. data/assets/javascripts/materialize/timepicker.js +581 -579
  25. data/assets/javascripts/materialize/toasts.js +11 -7
  26. data/assets/javascripts/materialize/tooltip.js +16 -18
  27. data/assets/stylesheets/materialize.scss +3 -3
  28. data/assets/stylesheets/materialize/components/_buttons.scss +2 -2
  29. data/assets/stylesheets/materialize/components/_color-classes.scss +32 -0
  30. data/assets/stylesheets/materialize/components/{_color.scss → _color-variables.scss} +0 -42
  31. data/assets/stylesheets/materialize/components/_datepicker.scss +10 -4
  32. data/assets/stylesheets/materialize/components/_dropdown.scss +5 -0
  33. data/assets/stylesheets/materialize/components/_navbar.scss +3 -3
  34. data/assets/stylesheets/materialize/components/_pulse.scss +1 -1
  35. data/assets/stylesheets/materialize/components/_timepicker.scss +1 -0
  36. data/assets/stylesheets/materialize/components/_variables.scss +0 -1
  37. data/assets/stylesheets/materialize/components/forms/_input-fields.scss +6 -4
  38. data/assets/stylesheets/materialize/components/forms/_range.scss +3 -3
  39. data/assets/stylesheets/materialize/components/forms/_select.scss +7 -7
  40. data/assets/stylesheets/materialize/extras/nouislider.css +1 -1
  41. data/lib/materialize-sass/engine.rb +2 -0
  42. data/lib/materialize-sass/helpers.rb +38 -0
  43. data/lib/materialize-sass/version.rb +1 -1
  44. metadata +6 -5
  45. data/assets/javascripts/materialize/velocity.min.js +0 -782
  46. data/assets/stylesheets/materialize/components/_mixins.scss +0 -5
@@ -2,7 +2,7 @@ var _createClass = function () { function defineProperties(target, props) { for
2
2
 
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
 
5
- (function ($, Vel) {
5
+ (function ($, anim) {
6
6
  'use strict';
7
7
 
8
8
  var _defaults = {
@@ -92,10 +92,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
92
92
  key: '_animateIn',
93
93
  value: function _animateIn() {
94
94
  // Animate toast in
95
- Vel(this.el, { top: 0, opacity: 1 }, {
95
+ anim({
96
+ targets: this.el,
97
+ top: 0,
98
+ opacity: 1,
96
99
  duration: 300,
97
- easing: 'easeOutCubic',
98
- queue: false
100
+ easing: 'easeOutCubic'
99
101
  });
100
102
  }
101
103
 
@@ -142,10 +144,12 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
142
144
  this.el.style.opacity = 0;
143
145
  }
144
146
 
145
- Vel(this.el, { opacity: 0, marginTop: '-40px' }, {
147
+ anim({
148
+ targets: this.el,
149
+ opacity: 0,
150
+ marginTop: -40,
146
151
  duration: this.options.outDuration,
147
152
  easing: 'easeOutExpo',
148
- queue: false,
149
153
  complete: function () {
150
154
  // Call the optional callback
151
155
  if (typeof _this2.options.completeCallback === 'function') {
@@ -347,4 +351,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
347
351
  M.toast = function (options) {
348
352
  return new Toast(options);
349
353
  };
350
- })(cash, M.Vel);
354
+ })(cash, M.anime);
@@ -2,7 +2,7 @@ var _createClass = function () { function defineProperties(target, props) { for
2
2
 
3
3
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4
4
 
5
- (function ($, Vel) {
5
+ (function ($, anim) {
6
6
  'use strict';
7
7
 
8
8
  var _defaults = {
@@ -10,8 +10,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
10
10
  enterDelay: 0,
11
11
  html: null,
12
12
  margin: 5,
13
- inDuration: 300,
14
- outDuration: 250,
13
+ inDuration: 250,
14
+ outDuration: 200,
15
15
  position: 'bottom',
16
16
  transitionMovement: 10
17
17
  };
@@ -170,8 +170,8 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
170
170
 
171
171
  this.xMovement = 0, this.yMovement = 0;
172
172
 
173
- targetTop = origin.offsetTop;
174
- targetLeft = origin.offsetLeft;
173
+ targetTop = origin.getBoundingClientRect().top + M.getDocumentScrollTop();
174
+ targetLeft = origin.getBoundingClientRect().left + M.getDocumentScrollLeft();
175
175
 
176
176
  if (this.options.position === 'top') {
177
177
  targetTop += -tooltipHeight - margin;
@@ -234,29 +234,27 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
234
234
  value: function _animateIn() {
235
235
  this._positionTooltip();
236
236
  this.tooltipEl.style.visibility = 'visible';
237
- Vel(this.tooltipEl, 'stop');
238
- Vel(this.tooltipEl, {
237
+ anim.remove(this.tooltipEl);
238
+ anim({
239
+ targets: this.tooltipEl,
239
240
  opacity: 1,
240
241
  translateX: this.xMovement,
241
- translateY: this.yMovement
242
- }, {
242
+ translateY: this.yMovement,
243
243
  duration: this.options.inDuration,
244
- easing: 'easeOutCubic',
245
- queue: false
244
+ easing: 'easeOutCubic'
246
245
  });
247
246
  }
248
247
  }, {
249
248
  key: '_animateOut',
250
249
  value: function _animateOut() {
251
- Vel(this.tooltipEl, 'stop');
252
- Vel(this.tooltipEl, {
250
+ anim.remove(this.tooltipEl);
251
+ anim({
252
+ targets: this.tooltipEl,
253
253
  opacity: 0,
254
254
  translateX: 0,
255
- translateY: 0
256
- }, {
255
+ translateY: 0,
257
256
  duration: this.options.outDuration,
258
- easing: 'easeOutCubic',
259
- queue: false
257
+ easing: 'easeOutCubic'
260
258
  });
261
259
  }
262
260
  }, {
@@ -322,4 +320,4 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons
322
320
  if (M.jQueryLoaded) {
323
321
  M.initializeJqueryWrapper(Tooltip, 'tooltip', 'M_Tooltip');
324
322
  }
325
- })(cash, M.Vel);
323
+ })(cash, M.anime);
@@ -1,8 +1,8 @@
1
1
  @charset "UTF-8";
2
2
 
3
- // Mixins
4
- @import "materialize/components/mixins";
5
- @import "materialize/components/color";
3
+ // Color
4
+ @import "materialize/components/color-variables";
5
+ @import "materialize/components/color-classes";
6
6
 
7
7
  // Variables;
8
8
  @import "materialize/components/variables";
@@ -68,7 +68,7 @@
68
68
  text-align: center;
69
69
  letter-spacing: .5px;
70
70
  @extend .z-depth-1;
71
- transition: .2s ease-out;
71
+ transition: background-color .2s ease-out;
72
72
  cursor: pointer;
73
73
 
74
74
  &:hover {
@@ -123,7 +123,7 @@
123
123
  background-color: $button-floating-background;
124
124
  border-radius: $button-floating-radius;
125
125
  @extend .z-depth-1;
126
- transition: .3s;
126
+ transition: background-color .3s;
127
127
  cursor: pointer;
128
128
  vertical-align: middle;
129
129
 
@@ -0,0 +1,32 @@
1
+ // Color Classes
2
+
3
+ @each $color_name, $color in $colors {
4
+ @each $color_type, $color_value in $color {
5
+ @if $color_type == "base" {
6
+ .#{$color_name} {
7
+ background-color: $color_value !important;
8
+ }
9
+ .#{$color_name}-text {
10
+ color: $color_value !important;
11
+ }
12
+ }
13
+ @else if $color_name != "shades" {
14
+ .#{$color_name}.#{$color_type} {
15
+ background-color: $color_value !important;
16
+ }
17
+ .#{$color_name}-text.text-#{$color_type} {
18
+ color: $color_value !important;
19
+ }
20
+ }
21
+ }
22
+ }
23
+
24
+ // Shade classes
25
+ @each $color, $color_value in $shades {
26
+ .#{$color} {
27
+ background-color: $color_value !important;
28
+ }
29
+ .#{$color}-text {
30
+ color: $color_value !important;
31
+ }
32
+ }
@@ -1,12 +1,5 @@
1
- // Utility Color Classes
2
-
3
- //.success {
4
- //
5
- //}
6
-
7
1
  // Google Color Palette defined: http://www.google.com/design/spec/style/color.html
8
2
 
9
-
10
3
  $materialize-red: (
11
4
  "base": #e51c23,
12
5
  "lighten-5": #fdeaeb,
@@ -362,40 +355,6 @@ $colors: (
362
355
  ) !default;
363
356
 
364
357
 
365
- // Color Classes
366
-
367
- @each $color_name, $color in $colors {
368
- @each $color_type, $color_value in $color {
369
- @if $color_type == "base" {
370
- .#{$color_name} {
371
- background-color: $color_value !important;
372
- }
373
- .#{$color_name}-text {
374
- color: $color_value !important;
375
- }
376
- }
377
- @else if $color_name != "shades" {
378
- .#{$color_name}.#{$color_type} {
379
- background-color: $color_value !important;
380
- }
381
- .#{$color_name}-text.text-#{$color_type} {
382
- color: $color_value !important;
383
- }
384
- }
385
- }
386
- }
387
-
388
- // Shade classes
389
- @each $color, $color_value in $shades {
390
- .#{$color} {
391
- background-color: $color_value !important;
392
- }
393
- .#{$color}-text {
394
- color: $color_value !important;
395
- }
396
- }
397
-
398
-
399
358
  // usage: color("name_of_color", "type_of_color")
400
359
  // to avoid to repeating map-get($colors, ...)
401
360
 
@@ -409,4 +368,3 @@ $colors: (
409
368
  @warn "Unknown `#{$color}` - `#{$type}` in $colors.";
410
369
  @return null;
411
370
  }
412
-
@@ -2,6 +2,7 @@
2
2
  .datepicker-modal {
3
3
  max-width: 325px;
4
4
  min-width: 300px;
5
+ max-height: none;
5
6
  }
6
7
 
7
8
  .datepicker-container.modal-content {
@@ -95,21 +96,25 @@
95
96
  text-align: center;
96
97
  }
97
98
 
99
+ tr {
100
+ border: none;
101
+ }
102
+
98
103
  abbr {
99
104
  text-decoration: none;
100
105
  color: $datepicker-calendar-header-color;
101
106
  }
102
107
 
103
108
  td {
109
+ &.is-today {
110
+ color: $secondary-color;
111
+ }
112
+
104
113
  &.is-selected {
105
114
  background-color: $secondary-color;
106
115
  color: #fff;
107
116
  }
108
117
 
109
- &.is-today {
110
- color: $secondary-color;
111
- }
112
-
113
118
  &.is-outside-current-month,
114
119
  &.is-disabled {
115
120
  color: $datepicker-disabled-day-color;
@@ -132,6 +137,7 @@
132
137
  display: block;
133
138
  width: 100%;
134
139
  border-radius: 50%;
140
+ padding: 0 5px;
135
141
  cursor: pointer;
136
142
  color: inherit;
137
143
  }
@@ -1,4 +1,9 @@
1
1
  .dropdown-content {
2
+ &:focus {
3
+ outline: 0;
4
+ }
5
+
6
+
2
7
  @extend .z-depth-1;
3
8
  background-color: $dropdown-bg-color;
4
9
  margin: 0;
@@ -37,12 +37,12 @@ nav {
37
37
  }
38
38
 
39
39
  @media #{$large-and-up} {
40
- a.button-collapse { display: none; }
40
+ a.sidenav-trigger { display: none; }
41
41
  }
42
42
 
43
43
 
44
44
  // Collapse button
45
- .button-collapse {
45
+ .sidenav-trigger {
46
46
  float: left;
47
47
  position: relative;
48
48
  z-index: 1;
@@ -198,7 +198,7 @@ nav {
198
198
  nav.nav-extended .nav-wrapper {
199
199
  min-height: $navbar-height;
200
200
  }
201
- nav, nav .nav-wrapper i, nav a.button-collapse, nav a.button-collapse i {
201
+ nav, nav .nav-wrapper i, nav a.sidenav-trigger, nav a.sidenav-trigger i {
202
202
  height: $navbar-height;
203
203
  line-height: $navbar-line-height;
204
204
  }
@@ -14,7 +14,7 @@
14
14
  z-index: -1;
15
15
  }
16
16
 
17
- overflow: initial;
17
+ overflow: visible;
18
18
  position: relative;
19
19
  }
20
20
 
@@ -1,6 +1,7 @@
1
1
  /* Timepicker Containers */
2
2
  .timepicker-modal {
3
3
  max-width: 325px;
4
+ max-height: none;
4
5
  }
5
6
 
6
7
  .timepicker-container.modal-content {
@@ -167,7 +167,6 @@ $input-font-size: 1rem !default;
167
167
  $input-margin-bottom: 8px;
168
168
  $input-margin: 0 0 $input-margin-bottom 0 !default;
169
169
  $input-padding: 0 !default;
170
- $input-transition: all .3s !default;
171
170
  $label-font-size: .8rem !default;
172
171
  $input-disabled-color: rgba(0,0,0, .42) !default;
173
172
  $input-disabled-solid-color: #949494 !default;
@@ -36,7 +36,7 @@ textarea.materialize-textarea {
36
36
  padding: $input-padding;
37
37
  box-shadow: none;
38
38
  box-sizing: content-box;
39
- transition: $input-transition;
39
+ transition: box-shadow .3s, border .3s;
40
40
 
41
41
  // Disabled input style
42
42
  &:disabled,
@@ -260,7 +260,7 @@ textarea.materialize-textarea {
260
260
  box-shadow: none;
261
261
  }
262
262
 
263
- &:focus {
263
+ &:focus:not(.browser-default) {
264
264
  background-color: $input-background;
265
265
  border: 0;
266
266
  box-shadow: none;
@@ -273,7 +273,8 @@ textarea.materialize-textarea {
273
273
  }
274
274
  }
275
275
 
276
- & + label {
276
+ & + .label-icon {
277
+ transform: none;
277
278
  left: 1rem;
278
279
  }
279
280
 
@@ -299,8 +300,9 @@ textarea {
299
300
  background-color: transparent;
300
301
 
301
302
  &.materialize-textarea {
303
+ line-height: normal;
302
304
  overflow-y: hidden; /* prevents scroll bar flash */
303
- padding: .8rem 0 1.6rem 0; /* prevents text jump on Enter keypress */
305
+ padding: .8rem 0 .8rem 0; /* prevents text jump on Enter keypress */
304
306
  resize: none;
305
307
  min-height: $input-height;
306
308
  box-sizing: border-box;
@@ -94,7 +94,7 @@ input[type=range]::-webkit-slider-thumb {
94
94
 
95
95
  }
96
96
 
97
- input[type=range]:focus:not(.active)::-webkit-slider-thumb {
97
+ input[type=range].focused:focus:not(.active)::-webkit-slider-thumb {
98
98
  box-shadow: 0 0 0 10px rgba($radio-fill-color, .26);
99
99
  }
100
100
 
@@ -125,7 +125,7 @@ input[type=range]:-moz-focusring {
125
125
  outline-offset: -1px;
126
126
  }
127
127
 
128
- input[type=range]:focus:not(.active)::-moz-range-thumb {
128
+ input[type=range].focused:focus:not(.active)::-moz-range-thumb {
129
129
  box-shadow: 0 0 0 10px rgba($radio-fill-color, .26);
130
130
  }
131
131
 
@@ -156,6 +156,6 @@ input[type=range]::-ms-thumb {
156
156
  @include range-thumb;
157
157
  }
158
158
 
159
- input[type=range]:focus:not(.active)::-ms-thumb {
159
+ input[type=range].focused:focus:not(.active)::-ms-thumb {
160
160
  box-shadow: 0 0 0 10px rgba($radio-fill-color, .26);
161
161
  }
@@ -87,19 +87,17 @@ select {
87
87
  padding: 0;
88
88
  display: block;
89
89
  user-select:none;
90
+ z-index: 1;
90
91
  }
91
92
 
92
93
  .caret {
93
- color: initial;
94
94
  position: absolute;
95
95
  right: 0;
96
96
  top: 0;
97
97
  bottom: 0;
98
- height: 24px;
99
98
  margin: auto 0;
100
- font-size: 24px;
101
- line-height: 24px;
102
- z-index: -1;
99
+ z-index: 0;
100
+ fill: rgba(0,0,0,.87);
103
101
  }
104
102
 
105
103
  & + label {
@@ -115,10 +113,12 @@ select:disabled {
115
113
  }
116
114
 
117
115
  .select-wrapper.disabled {
118
- span.caret,
119
- & + label {
116
+ + label {
120
117
  color: $input-disabled-color;
121
118
  }
119
+ .caret {
120
+ fill: $input-disabled-color;
121
+ }
122
122
  }
123
123
 
124
124
  .select-wrapper input.select-dropdown:disabled {