@materializecss/materialize 1.2.2 → 2.0.1-alpha

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 (90) hide show
  1. package/Gruntfile.js +68 -313
  2. package/README.md +26 -14
  3. package/dist/css/materialize.css +1009 -1822
  4. package/dist/css/materialize.min.css +2 -8
  5. package/dist/js/materialize.js +8414 -12299
  6. package/dist/js/materialize.min.js +8968 -2
  7. package/dist/js/materialize.min.js.map +1 -0
  8. package/package.json +13 -9
  9. package/sass/components/_badges.scss +12 -2
  10. package/sass/components/_buttons.scss +16 -11
  11. package/sass/components/_cards.scss +14 -9
  12. package/sass/components/_carousel.scss +5 -2
  13. package/sass/components/_chips.scss +3 -3
  14. package/sass/components/_collapsible.scss +22 -8
  15. package/sass/components/_collection.scss +14 -6
  16. package/sass/components/_datepicker.scss +30 -11
  17. package/sass/components/_dropdown.scss +6 -4
  18. package/sass/components/_global.scss +132 -111
  19. package/sass/components/_grid.scss +119 -98
  20. package/sass/components/_modal.scss +3 -3
  21. package/sass/components/_navbar.scss +31 -17
  22. package/sass/components/_normalize.scss +26 -124
  23. package/sass/components/_sidenav.scss +21 -20
  24. package/sass/components/_slider.scss +27 -7
  25. package/sass/components/_table_of_contents.scss +12 -12
  26. package/sass/components/_tabs.scss +47 -16
  27. package/sass/components/_tapTarget.scss +6 -6
  28. package/sass/components/_theme_variables.scss +98 -0
  29. package/sass/components/_timepicker.scss +54 -46
  30. package/sass/components/_toast.scss +3 -3
  31. package/sass/components/_tooltip.scss +4 -5
  32. package/sass/components/_typography.scss +1 -1
  33. package/sass/components/_variables.scss +185 -120
  34. package/sass/components/forms/_checkboxes.scss +9 -9
  35. package/sass/components/forms/_file-input.scss +9 -7
  36. package/sass/components/forms/_input-fields.scss +173 -234
  37. package/sass/components/forms/_radio-buttons.scss +1 -1
  38. package/sass/components/forms/_range.scss +11 -11
  39. package/sass/components/forms/_select.scss +29 -19
  40. package/sass/components/forms/_switches.scss +22 -18
  41. package/sass/materialize.scss +1 -1
  42. package/src/autocomplete.ts +459 -0
  43. package/src/bounding.ts +6 -0
  44. package/{js/buttons.js → src/buttons.ts} +103 -162
  45. package/src/cards.ts +54 -0
  46. package/{js/carousel.js → src/carousel.ts} +137 -262
  47. package/src/characterCounter.ts +88 -0
  48. package/src/chips.ts +350 -0
  49. package/src/collapsible.ts +184 -0
  50. package/{js/component.js → src/component.ts} +6 -19
  51. package/{js/datepicker.js → src/datepicker.ts} +213 -299
  52. package/{js/dropdown.js → src/dropdown.ts} +140 -254
  53. package/src/edges.ts +6 -0
  54. package/src/forms.ts +120 -0
  55. package/src/global.ts +385 -0
  56. package/src/materialbox.ts +348 -0
  57. package/src/modal.ts +256 -0
  58. package/{js/parallax.js → src/parallax.ts} +47 -60
  59. package/{js/pushpin.js → src/pushpin.ts} +19 -47
  60. package/{js/range.js → src/range.ts} +58 -139
  61. package/{js/scrollspy.js → src/scrollspy.ts} +81 -153
  62. package/src/select.ts +448 -0
  63. package/{js/sidenav.js → src/sidenav.ts} +96 -202
  64. package/src/slider.ts +415 -0
  65. package/src/tabs.ts +293 -0
  66. package/src/tapTarget.ts +240 -0
  67. package/{js/timepicker.js → src/timepicker.ts} +268 -272
  68. package/{js/toasts.js → src/toasts.ts} +75 -134
  69. package/{js/tooltip.js → src/tooltip.ts} +59 -96
  70. package/src/waves.ts +70 -0
  71. package/extras/noUiSlider/nouislider.css +0 -404
  72. package/extras/noUiSlider/nouislider.js +0 -2147
  73. package/extras/noUiSlider/nouislider.min.js +0 -1
  74. package/js/anime.min.js +0 -34
  75. package/js/autocomplete.js +0 -479
  76. package/js/cards.js +0 -40
  77. package/js/cash.js +0 -960
  78. package/js/characterCounter.js +0 -136
  79. package/js/chips.js +0 -486
  80. package/js/collapsible.js +0 -275
  81. package/js/forms.js +0 -285
  82. package/js/global.js +0 -428
  83. package/js/materialbox.js +0 -453
  84. package/js/modal.js +0 -382
  85. package/js/select.js +0 -391
  86. package/js/slider.js +0 -497
  87. package/js/tabs.js +0 -402
  88. package/js/tapTarget.js +0 -315
  89. package/js/waves.js +0 -615
  90. package/sass/components/_waves.scss +0 -187
@@ -2,13 +2,11 @@
2
2
  ========================================================================== */
3
3
 
4
4
  /* Style Placeholders */
5
-
6
5
  ::placeholder {
7
6
  color: $placeholder-text-color;
8
7
  }
9
8
 
10
9
  /* Text inputs */
11
-
12
10
  input:not([type]):not(.browser-default),
13
11
  input[type=text]:not(.browser-default),
14
12
  input[type=password]:not(.browser-default),
@@ -22,97 +20,14 @@ input[type=month]:not(.browser-default),
22
20
  input[type=tel]:not(.browser-default),
23
21
  input[type=number]:not(.browser-default),
24
22
  input[type=search]:not(.browser-default),
25
- textarea.materialize-textarea {
26
-
27
- // General Styles
28
- background-color: transparent;
29
- border: none;
30
- border-bottom: $input-border;
31
- border-radius: 0;
23
+ textarea.materialize-textarea {
32
24
  outline: none;
33
- height: $input-height;
34
- width: 100%;
35
- font-size: $input-font-size;
36
- margin: $input-margin;
37
- padding: $input-padding;
38
- box-shadow: none;
39
- box-sizing: content-box;
40
- transition: box-shadow .3s, border .3s;
41
-
42
- // Disabled input style
43
- &:disabled,
44
- &[readonly="readonly"] {
45
- color: $input-disabled-color;
46
- border-bottom: $input-disabled-border;
47
- }
48
-
49
- // Disabled label style
50
- &:disabled+label,
51
- &[readonly="readonly"]+label {
52
- color: $input-disabled-color;
53
- }
54
-
55
- // Focused input style
56
- &:focus:not([readonly]) {
57
- border-bottom: 1px solid $input-focus-color;
58
- box-shadow: 0 1px 0 0 $input-focus-color;
59
- }
60
-
61
- // Focused label style
62
- &:focus:not([readonly])+label {
63
- color: $input-focus-color;
64
- }
65
-
66
- // Hide helper text on data message
67
- &.valid ~ .helper-text[data-success],
68
- &:focus.valid ~ .helper-text[data-success],
69
- &.invalid ~ .helper-text[data-error],
70
- &:focus.invalid ~ .helper-text[data-error] {
71
- @extend %hidden-text;
72
- }
73
-
74
- // Valid Input Style
75
- &.valid,
76
- &:focus.valid {
77
- @extend %valid-input-style;
78
- }
79
-
80
- // Custom Success Message
81
- &.valid ~ .helper-text:after,
82
- &:focus.valid ~ .helper-text:after {
83
- @extend %custom-success-message;
84
- }
85
- &:focus.valid ~ label {
86
- color: $input-success-color;
87
- }
88
-
89
- // Invalid Input Style
90
- &.invalid,
91
- &:focus.invalid {
92
- @extend %invalid-input-style;
93
- }
94
-
95
- // Custom Error message
96
- &.invalid ~ .helper-text:after,
97
- &:focus.invalid ~ .helper-text:after {
98
- @extend %custom-error-message;
99
- }
100
- &:focus.invalid ~ label {
101
- color: $input-error-color;
102
- }
103
-
104
- // Full width label when using validate for error messages
105
- &.validate + label {
106
- width: 100%;
107
- }
108
-
109
- // Form Message Shared Styles
110
- & + label:after {
111
- @extend %input-after-style;
112
- }
25
+ color: $input-color;
26
+ width: 100%;
27
+ font-size: $md_sys_typescale_body-large_size; //$input-font-size; // => 16 dp
28
+ height: 56px; // 56dp $input-height;
113
29
  }
114
30
 
115
-
116
31
  /* Validation Sass Placeholders */
117
32
  %valid-input-style {
118
33
  border-bottom: 1px solid $input-success-color;
@@ -127,6 +42,7 @@ textarea.materialize-textarea {
127
42
  user-select: none;
128
43
  pointer-events: none;
129
44
  }
45
+ /*
130
46
  %custom-success-message {
131
47
  content: attr(data-success);
132
48
  color: $input-success-color;
@@ -135,167 +51,210 @@ textarea.materialize-textarea {
135
51
  content: attr(data-error);
136
52
  color: $input-error-color;
137
53
  }
138
- %input-after-style {
139
- display: block;
140
- content: "";
141
- position: absolute;
142
- top: 100%;
143
- left: 0;
144
- opacity: 0;
145
- transition: .2s opacity ease-out, .2s color ease-out;
146
- }
147
-
54
+ */
148
55
 
149
- // Styling for input field wrapper
150
56
  .input-field {
151
- // Inline styles
152
- &.inline {
153
- display: inline-block;
154
- vertical-align: middle;
155
- margin-left: 5px;
156
-
157
- input,
158
- .select-dropdown {
159
- margin-bottom: 1rem;
57
+ position: relative;
58
+ clear: both;
59
+
60
+ // Default
61
+
62
+ input, textarea {
63
+ box-sizing: border-box; /* https://stackoverflow.com/questions/1377719/padding-within-inputs-breaks-width-100*/
64
+
65
+ padding: 0 16px;
66
+ padding-top: 20px;
67
+
68
+ background-color: $surface-color;
69
+
70
+ border: none; // reset
71
+ border-radius: 4px; // md.sys.shape.corner.extra-small.top
72
+ border-bottom: 1px solid $input-border-color;
73
+ border-bottom-left-radius: 0;
74
+ border-bottom-right-radius: 0;
75
+
76
+ &:focus:not([readonly]) {
77
+ border-bottom: 2px solid $input-focus-color;
78
+ padding-top: 20px + 1px; // add border-width
160
79
  }
161
- }
162
80
 
163
- // Gutter spacing
164
- &.col {
165
- label {
166
- left: $gutter-width * 0.5;
81
+ &:disabled, &[readonly="readonly"] {
82
+ color: $textfield_disabled_color;
83
+ border-color: $textfield_disabled_outlinecolor;
84
+ background-color: $textfield_disabled_containercolor;
85
+ }
86
+
87
+ // Label
88
+ &:focus:not([readonly]) + label {
89
+ color: $input-focus-color;
90
+ }
91
+ &:focus:not([readonly]) + label,
92
+ &:not(:placeholder-shown) + label {
93
+ //font-size: 12px; // md.sys.typescale.body-small.size
94
+ // https://stackoverflow.com/questions/34717492/css-transition-font-size-avoid-jittering-wiggling
95
+ transform: scale(calc(12 / 16));
96
+ top: 8px;
167
97
  }
168
98
 
169
- .prefix ~ label,
170
- .prefix ~ .validate ~ label,
171
- .suffix ~ label,
172
- .suffix ~ .validate ~ label {
173
- width: calc(100% - 3rem - #{$gutter-width});
99
+ &:disabled + label, &[readonly="readonly"] + label {
100
+ color: $textfield_disabled_color;
174
101
  }
175
102
  }
176
103
 
177
- position: relative;
178
- margin-top: 1rem;
179
- margin-bottom: 1rem;
104
+ input::placeholder {
105
+ user-select: none;
106
+ }
180
107
 
181
108
  & > label {
182
109
  color: $input-border-color;
110
+ user-select: none;
111
+ font-size: 16px;
183
112
  position: absolute;
184
- top: 0;
185
- left: 0;
186
- font-size: 1rem;
113
+ left: 16px;
114
+ top: 16px;
187
115
  cursor: text;
188
- transition: transform .2s ease-out, color .2s ease-out;
189
- transform-origin: 0% 100%;
190
- text-align: initial;
191
- transform: translateY(12px);
192
-
193
- &:not(.label-icon).active {
194
- transform: translateY(-14px) scale(.8);
195
- transform-origin: 0 0;
196
- }
197
-
198
- // Prevent label from floating on top of default HTML placeholders
199
- &:not(.active) + input[type=date],
200
- &:not(.active) + input[type=datetime-local],
201
- &:not(.active) + input[type=month],
202
- &:not(.active) + input[type=time] {
203
- color: transparent;
204
- }
116
+ transform-origin: top left;
117
+ transition:
118
+ left 0.2s ease-out,
119
+ top 0.2s ease-out,
120
+ transform 0.2s ease-out
121
+ ;
205
122
  }
206
123
 
207
- // Autofill + date + time inputs
208
- & > input[type]:-webkit-autofill:not(.browser-default):not([type="search"]) + label,
209
- & > input[type=date]:not(.browser-default) + label,
210
- & > input[type=time]:not(.browser-default) + label {
211
- transform: translateY(-14px) scale(.8);
212
- transform-origin: 0 0;
213
- }
124
+ // Sub-Infos
214
125
 
215
- .helper-text {
216
- &::after {
217
- opacity: 1;
218
- position: absolute;
219
- top: 0;
220
- left: 0;
221
- }
126
+ .supporting-text {
127
+ color: $input-border-color;
128
+ font-size: 12px;
129
+ padding: 0 16px;
130
+ margin-top: 4px;
131
+ }
222
132
 
223
- position: relative;
224
- min-height: 18px;
225
- display: block;
133
+ .character-counter {
134
+ color: $input-border-color;
226
135
  font-size: 12px;
227
- color: rgba(0,0,0,.54);
136
+ float: right;
137
+ padding: 0 16px;
138
+ margin-top: 4px;
228
139
  }
229
140
 
230
- // Prefix Icons
231
- .prefix, .suffix {
141
+ .prefix {
232
142
  position: absolute;
233
- width: $input-height;
234
- font-size: $input-icon-size;
235
- transition: color .2s;
236
- top: ($input-height - $input-icon-size) * 0.5;
237
-
238
- &.active { color: $input-focus-color; }
143
+ left: 12px;
144
+ top: 16px;
145
+ user-select: none;
146
+ display: flex;
147
+ align-self: center;
239
148
  }
240
149
 
241
- .prefix ~ input,
242
- .prefix ~ textarea,
243
- .prefix ~ .select-wrapper,
244
- .prefix ~ label,
245
- .prefix ~ .validate ~ label,
246
- .prefix ~ .helper-text,
247
- .prefix ~ .autocomplete-content {
248
- margin-left: 3rem;
249
- width: 92%;
250
- width: calc(100% - 3rem);
150
+ .suffix {
151
+ position: absolute;
152
+ right: 12px;
153
+ top: 16px;
154
+ user-select: none;
251
155
  }
252
156
 
253
- .prefix ~ label { margin-left: 3rem; }
157
+ .prefix ~ input, .prefix ~ textarea {
158
+ padding-left: calc(12px + 24px + 16px);
159
+ }
160
+ .suffix ~ input, .suffix ~ textarea {
161
+ padding-right: calc(12px + 24px + 16px);
162
+ }
163
+ .prefix ~ label {
164
+ left: calc(12px + 24px + 16px);
165
+ }
254
166
 
255
- @media #{$medium-and-down} {
256
- .prefix ~ input,
257
- .suffix ~ input {
258
- width: 86%;
259
- width: calc(100% - 3rem);
167
+ // Outlined
168
+
169
+ &.outlined {
170
+
171
+ input, textarea {
172
+ padding-top: 0;
173
+
174
+ background-color: var(--background-color);
175
+
176
+ border: 1px solid $input-border-color;
177
+ border-radius: 4px; // md.sys.shape.corner.extra-small
178
+
179
+ &:focus:not([readonly]) {
180
+ border: 2px solid $input-focus-color;
181
+ padding-top: 0;
182
+ margin-left: -1px; // subtract border-width
183
+
184
+ }
185
+ // Label
186
+ &:focus:not([readonly]) + label {
187
+ color: $input-focus-color;
188
+ }
189
+ &:focus:not([readonly]) + label,
190
+ &:not(:placeholder-shown) + label {
191
+ top: -8px;
192
+ left: 16px;
193
+ margin-left: -4px;
194
+ padding: 0 4px;
195
+ background-color: var(--background-color);
196
+ }
197
+
198
+ &:disabled, &[readonly="readonly"] {
199
+ color: $textfield_disabled_color;
200
+ border-color: $textfield_disabled_outlinecolor;
201
+ }
202
+
260
203
  }
261
204
  }
262
205
 
263
- @media #{$small-and-down} {
264
- .prefix ~ input,
265
- .suffix ~ input {
266
- width: 80%;
267
- width: calc(100% - 3rem);
206
+ // Error
207
+ &.error {
208
+ input, textarea {
209
+ border-color: var(--error-color);
210
+ }
211
+ input:focus:not([readonly]), textarea:focus:not([readonly]) {
212
+ border-color: var(--error-color);
213
+ }
214
+ input:focus:not([readonly]) + label, textarea:focus:not([readonly]) + label {
215
+ color: var(--error-color);
216
+ }
217
+ label {
218
+ color: var(--error-color);
219
+ }
220
+ .supporting-text {
221
+ color: var(--error-color);
222
+ }
223
+ .suffix {
224
+ color: var(--error-color);
268
225
  }
269
226
  }
227
+ }
270
228
 
271
-
272
- // Suffix Icons
273
- .suffix {
274
- right: 0;
229
+ /* Search Field */
230
+ .searchbar {
231
+ .prefix {
232
+ position: absolute;
233
+ //left: 12px;
234
+ padding-left: 1rem;
235
+ top: 0;
236
+ user-select: none;
237
+ display: flex;
238
+ align-self: center;
275
239
  }
276
240
 
277
- .suffix ~ input,
278
- .suffix ~ textarea,
279
- .suffix ~ .select-wrapper,
280
- .suffix ~ label,
281
- .suffix ~ .validate ~ label,
282
- .suffix ~ .helper-text,
283
- .suffix ~ .autocomplete-content {
284
- margin-right: 3rem;
285
- width: 92%;
286
- width: calc(100% - 3rem);
241
+ & > input {
242
+ border-width: 0;
243
+ background-color: transparent;
244
+ padding-left: 3rem;
245
+ }
246
+ }
247
+ .searchbar.has-sidebar {
248
+ margin-left: 0;
249
+ @media #{$large-and-up} {
250
+ margin-left: $sidenav-width;
287
251
  }
288
-
289
- .suffix ~ label { margin-right: 3rem; }
290
-
291
252
  }
292
253
 
293
- /* Search Field */
294
-
254
+ /*
295
255
  .input-field input[type=search] {
296
256
  display: block;
297
257
  line-height: inherit;
298
- transition: .3s background-color;
299
258
 
300
259
  .nav-wrapper & {
301
260
  height: inherit;
@@ -304,25 +263,14 @@ textarea.materialize-textarea {
304
263
  border: 0;
305
264
  box-shadow: none;
306
265
  }
307
-
308
266
  &:focus:not(.browser-default) {
309
- background-color: $input-background;
310
267
  border: 0;
311
268
  box-shadow: none;
312
- color: #444;
313
-
314
- & + label i,
315
- & ~ .mdi-navigation-close,
316
- & ~ .material-icons {
317
- color: #444;
318
- }
319
269
  }
320
-
321
270
  & + .label-icon {
322
271
  transform: none;
323
272
  left: 1rem;
324
273
  }
325
-
326
274
  & ~ .mdi-navigation-close,
327
275
  & ~ .material-icons {
328
276
  position: absolute;
@@ -331,13 +279,11 @@ textarea.materialize-textarea {
331
279
  color: transparent;
332
280
  cursor: pointer;
333
281
  font-size: $input-icon-size;
334
- transition: .3s color;
335
282
  }
336
283
  }
337
-
284
+ */
338
285
 
339
286
  /* Textarea */
340
-
341
287
  // Default textarea
342
288
  textarea {
343
289
  width: 100%;
@@ -368,21 +314,14 @@ textarea {
368
314
  z-index: -1;
369
315
  }
370
316
 
371
-
372
- /* Autocomplete */
317
+ /* Autocomplete Items */
373
318
  .autocomplete-content {
374
319
  li {
375
- .highlight { color: #444; }
376
-
320
+ .highlight { color: $font-color-main; }
377
321
  img {
378
322
  height: $dropdown-item-height - 10;
379
323
  width: $dropdown-item-height - 10;
380
324
  margin: 5px 15px;
381
325
  }
382
326
  }
383
- }
384
-
385
- /* Character Counter */
386
- .character-counter {
387
- min-height: 18px;
388
- }
327
+ }
@@ -81,7 +81,7 @@
81
81
 
82
82
  /* Focused styles */
83
83
  [type="radio"].tabbed:focus + span:before {
84
- box-shadow: 0 0 0 10px rgba(0,0,0,.1);
84
+ box-shadow: 0 0 0 10px $primary-color-focus-opaque;
85
85
  }
86
86
 
87
87
  /* Disabled Radio With gap */
@@ -52,7 +52,7 @@ input[type=range] + .thumb {
52
52
  border-radius: 50% 50% 50% 0;
53
53
 
54
54
  .value {
55
- color: $input-background;
55
+ color: $font-on-primary-color-main;
56
56
  margin-left: -1px;
57
57
  margin-top: 8px;
58
58
  font-size: 10px;
@@ -63,7 +63,7 @@ input[type=range] + .thumb {
63
63
  // Shared
64
64
  @mixin range-track {
65
65
  height: $track-height;
66
- background: #c2c0c2;
66
+ background: $range-track-color;
67
67
  border: none;
68
68
  }
69
69
 
@@ -95,13 +95,11 @@ input[type=range]::-webkit-slider-thumb {
95
95
  }
96
96
 
97
97
  .keyboard-focused input[type=range]:focus:not(.active)::-webkit-slider-thumb {
98
- box-shadow: 0 0 0 10px rgba($radio-fill-color, .26);
98
+ box-shadow: 0 0 0 10px $radio-focus-color;
99
99
  }
100
100
 
101
101
  // FireFox
102
102
  input[type=range] {
103
- /* fix for FF unable to apply focus style bug */
104
- border: 1px solid white;
105
103
 
106
104
  /*required for proper track sizing in FF*/
107
105
  }
@@ -126,7 +124,7 @@ input[type=range]:-moz-focusring {
126
124
  }
127
125
 
128
126
  .keyboard-focused input[type=range]:focus:not(.active)::-moz-range-thumb {
129
- box-shadow: 0 0 0 10px rgba($radio-fill-color, .26);
127
+ box-shadow: 0 0 0 10px $radio-focus-color;
130
128
  }
131
129
 
132
130
  // IE 10+
@@ -144,12 +142,14 @@ input[type=range]::-ms-track {
144
142
  color: transparent;
145
143
  }
146
144
 
147
- input[type=range]::-ms-fill-lower {
148
- background: #777;
145
+ input[type=range]::-ms-fill-lower,
146
+ input[type=range]::-moz-range-progress {
147
+ background: $primary-color;
149
148
  }
150
149
 
151
- input[type=range]::-ms-fill-upper {
152
- background: #ddd;
150
+ input[type=range]::-ms-fill-upper,
151
+ input[type=range]::-moz-range-track {
152
+ background: $range-track-color;
153
153
  }
154
154
 
155
155
  input[type=range]::-ms-thumb {
@@ -157,5 +157,5 @@ input[type=range]::-ms-thumb {
157
157
  }
158
158
 
159
159
  .keyboard-focused input[type=range]:focus:not(.active)::-ms-thumb {
160
- box-shadow: 0 0 0 10px rgba($radio-fill-color, .26);
160
+ box-shadow: 0 0 0 10px $radio-focus-color;
161
161
  }