@materializecss/materialize 2.1.1 → 2.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.
package/README.md CHANGED
@@ -29,7 +29,7 @@
29
29
  </a>
30
30
  </p>
31
31
 
32
- ## Quickstart
32
+ ## Getting started
33
33
  Read the [getting started guide](https://materializeweb.com/getting-started.html) for more information on how to use materialize.
34
34
 
35
35
  - [Download the latest release](https://github.com/materializecss/materialize/releases/latest) of materialize directly from GitHub. ([Beta](https://github.com/materializecss/materialize/releases/))
@@ -37,28 +37,21 @@ Read the [getting started guide](https://materializeweb.com/getting-started.html
37
37
  - Include the files via [jsDelivr](https://www.jsdelivr.com/package/npm/@materializecss/materialize).
38
38
  - Install with [npm](https://www.npmjs.com): `npm install @materializecss/materialize` (Beta: `npm install @materializecss/materialize@next`)
39
39
 
40
+ ## Testing
41
+ To run tests locally you first have to build the files and then run the tests. This can be done with the command `npm test`;
42
+ To get more info and debug information you can do the following:
43
+ run `npx jasmine-browser-runner` then go to the url via browser `http://localhost:8888`. The tests will then run and show detailed feedback.
44
+
40
45
  ## Development
41
46
  The documentation can be found at <https://materializeweb.com>. To run the documentation locally on your machine, you need [Node.js](https://nodejs.org) installed on your computer.
42
-
43
47
  This is the core project with all the components. To see how they are used we recommend using an example project or go to the documentation.
44
- Otherwise, if you want to develop the components itself, the dev process of this core-repo works like this:
45
- ```sh
46
- npm install
47
- npm run dev
48
- ```
49
48
 
50
49
  ### Running documentation locally
51
50
  See [Materialize Docs Repo](https://github.com/materializecss/materialize-docs) to see Materialize in Action.
52
51
 
53
- ### Documentation for previous releases
52
+ ### Releases
54
53
  Previous releases are available [here](https://github.com/materializecss/materialize/releases).
55
54
 
56
- ## Release
57
- If you want to release `materialize.css` or `materialize.js` from the latest commit, you can build the files with the following command after `npm install`. See `package.json` to check the current version like `1.0.0`.
58
- ```sh
59
- npm run release -- --oldver=<current_version> --newver=<new_version>
60
- ```
61
-
62
55
  ## Supported Browsers:
63
56
  Materialize is compatible with:
64
57
 
Binary file
Binary file
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "The responsive front-end library based on Material Design from Google.",
4
4
  "author": "The Materialize Team",
5
5
  "homepage": "https://materializeweb.com",
6
- "version": "2.1.1",
6
+ "version": "2.2.0",
7
7
  "style": "dist/css/materialize.css",
8
8
  "sass": "sass/materialize.scss",
9
9
  "typings": "dist/js/materialize.d.ts",
@@ -32,10 +32,11 @@
32
32
  }
33
33
  ],
34
34
  "scripts": {
35
- "test": "npx jasmine-browser-runner runSpecs",
35
+ "lint": "eslint .",
36
+ "test": "npm run build && jasmine-browser-runner runSpecs",
36
37
  "build": "rollup --config rollup.config.ts --configPlugin @rollup/plugin-typescript",
37
- "release": " npm run build && node ci/compress.js",
38
- "preversion": "npm test",
38
+ "release": "npm run lint && npm run build && node ci/compress.js",
39
+ "preversion": "npm run lint && npm test",
39
40
  "version": "npm run build && node ci/compress.js && git add -A dist src/index.ts"
40
41
  },
41
42
  "lint-staged": {
@@ -56,6 +57,7 @@
56
57
  "@rollup/plugin-typescript": "^11.1.6",
57
58
  "@types/node": "^20.5.2",
58
59
  "archiver": "^7.0.1",
60
+ "eslint": "^9.10.0",
59
61
  "jasmine": "^5.1.0",
60
62
  "jasmine-browser-runner": "^2.5.0",
61
63
  "jasmine-core": "^5.2.0",
@@ -63,10 +65,10 @@
63
65
  "rollup-plugin-copy": "^3.5.0",
64
66
  "rollup-plugin-dts": "^6.1.1",
65
67
  "rollup-plugin-scss": "^4.0.0",
66
- "rollup-plugin-zip": "^1.0.3",
67
68
  "sass": "^1.77.8",
68
69
  "tslib": "^2.6.3",
69
- "typescript": "^5.4.3"
70
+ "typescript": "^5.4.3",
71
+ "typescript-eslint": "^8.6.0"
70
72
  },
71
73
  "files": [
72
74
  "dist",
@@ -53,6 +53,11 @@ nav ul a span.badge {
53
53
 
54
54
  .collapsible span.badge {
55
55
  margin-left: auto;
56
+
57
+ &.leading {
58
+ margin-right: 7px;
59
+ order: -1;
60
+ }
56
61
  }
57
62
 
58
63
  .collapsible .active span.badge:not(.new) {
@@ -12,7 +12,7 @@
12
12
  border-radius: var(--btn-border-radius);
13
13
  padding-left: var(--btn-padding);
14
14
  padding-right: var(--btn-padding);
15
- font-size: ver(--btn-font-size);
15
+ font-size: var(--btn-font-size);
16
16
  font-weight: 500;
17
17
  text-decoration: none;
18
18
  display: inline-flex;
@@ -29,19 +29,24 @@
29
29
  .btn.icon-left, .btn.icon-right {
30
30
  position: relative;
31
31
  }
32
+
32
33
  .btn.icon-left {
33
34
  padding-left: calc(var(--btn-padding-icon) + var(--btn-font-size-icon) + var(--btn-gap-icon));
34
35
  }
36
+
35
37
  .btn.icon-right {
36
- padding-right: calc(var(--btn-padding-icon) + var(--btn-font-size-icon) + var(--btn-gap-icon));
38
+ padding-right: calc(var(--btn-padding-icon) + var(--btn-font-size-icon) + var(--btn-gap-icon));
37
39
  }
40
+
38
41
  .btn.icon-left i, .btn.icon-right i {
39
42
  position: absolute;
40
43
  font-size: var(--btn-font-size-icon);
41
44
  }
45
+
42
46
  .btn.icon-left i {
43
47
  left: var(--btn-padding-icon);
44
48
  }
49
+
45
50
  .btn.icon-right i {
46
51
  right: var(--btn-padding-icon);
47
52
  }
@@ -80,12 +85,10 @@
80
85
 
81
86
  .btn.disabled, .btn-floating.disabled, .btn-large.disabled, .btn-small.disabled, .btn-flat.disabled,
82
87
  .btn:disabled, .btn-floating:disabled, .btn-large:disabled, .btn-small:disabled, .btn-flat:disabled,
83
- .btn[disabled], .btn-floating[disabled], .btn-large[disabled], .btn-small[disabled], .btn-flat[disabled]
84
- {
88
+ .btn[disabled], .btn-floating[disabled], .btn-large[disabled], .btn-small[disabled], .btn-flat[disabled] {
85
89
  @extend .z-depth-0;
86
90
  color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 76%);
87
91
  background-color: color-mix(in srgb, transparent, var(--md-sys-color-on-surface) 24%);
88
-
89
92
  pointer-events: none;
90
93
  box-shadow: none;
91
94
  cursor: default;
@@ -158,8 +161,7 @@
158
161
  &.elevated,
159
162
  &.tonal,
160
163
  &.outlined,
161
- &.text
162
- {
164
+ &.text {
163
165
  outline: 3px solid var(--md-sys-color-secondary);
164
166
  outline-offset: 2px;
165
167
  }
@@ -190,10 +192,12 @@
190
192
  @extend .z-depth-1-half;
191
193
  background-color: color-mix(in srgb, var(--md-sys-color-primary-container), var(--md-sys-color-on-primary-container) 16%);
192
194
  }
195
+
193
196
  &:focus {
194
197
  background-color: $button-floating-background-focus;
195
198
  @extend .z-depth-1-half;
196
199
  }
200
+
197
201
  &:before {
198
202
  border-radius: 0;
199
203
  }
@@ -202,10 +206,11 @@
202
206
  &.halfway-fab {
203
207
  bottom: -56px * 0.5;
204
208
  }
209
+
205
210
  width: 56px;
206
211
  height: 56px;
207
212
  padding: 0;
208
- // font-size:
213
+ // font-size:
209
214
  // i {
210
215
  // // line-height: 56px;
211
216
  // }
@@ -213,10 +218,12 @@
213
218
 
214
219
  &.btn-small {
215
220
  --btn-small-height: calc(0.75 * var(--btn-height));
221
+
216
222
  &.halfway-fab {
217
223
  bottom: calc(var(--btn-small-height) * -0.5);
218
224
  }
219
- width: var(--btn-small-height)e;
225
+
226
+ width: var(--btn-small-height);
220
227
  height: var(--btn-small-height);
221
228
  // i {
222
229
  // line-height: $button-floating-small-size;
@@ -228,10 +235,12 @@
228
235
  right: auto;
229
236
  left: 24px;
230
237
  }
238
+
231
239
  position: absolute;
232
240
  right: 24px;
233
241
  bottom: -$button-floating-size * 0.5;
234
242
  }
243
+
235
244
  // FIXES
236
245
  // width: unset;
237
246
  // padding: 16px !important;
@@ -262,17 +271,19 @@
262
271
  text-align: center;
263
272
  }
264
273
  }
274
+
265
275
  // button fix
266
276
  button.btn-floating {
267
277
  border: none;
268
278
  }
279
+
269
280
  // Fixed Action Button
270
281
  .fixed-action-btn {
271
282
  &.active {
272
283
  ul {
273
284
  visibility: visible;
274
285
  padding-left: 0;
275
- list-style-type: none;
286
+ list-style-type: none;
276
287
  }
277
288
  }
278
289
 
@@ -280,6 +291,7 @@ button.btn-floating {
280
291
  &.direction-left,
281
292
  &.direction-right {
282
293
  padding: 0 0 0 15px;
294
+
283
295
  ul {
284
296
  text-align: right;
285
297
  right: 64px;
@@ -289,55 +301,67 @@ button.btn-floating {
289
301
  left: auto;
290
302
  /*width 100% only goes to width of button container */
291
303
  width: 500px;
304
+
292
305
  li {
293
306
  display: inline-block;
294
307
  margin: 7.5px 15px 0 0;
295
308
  }
296
309
  }
297
310
  }
311
+
298
312
  &.direction-right {
299
313
  padding: 0 15px 0 0;
314
+
300
315
  ul {
301
316
  text-align: left;
302
317
  direction: rtl;
303
318
  left: 64px;
304
319
  right: auto;
320
+
305
321
  li {
306
322
  margin: 7.5px 0 0 15px;
307
323
  }
308
324
  }
309
325
  }
326
+
310
327
  &.direction-bottom {
311
328
  padding: 0 0 15px 0;
329
+
312
330
  ul {
313
331
  top: 64px;
314
332
  bottom: auto;
315
333
  display: flex;
316
334
  flex-direction: column-reverse;
335
+
317
336
  li {
318
337
  margin: 15px 0 0 0;
319
338
  }
320
339
  }
321
340
  }
341
+
322
342
  &.toolbar {
323
343
  &.active {
324
- &>a i {
344
+ & > a i {
325
345
  opacity: 0;
326
346
  }
327
347
  }
348
+
328
349
  padding: 0;
329
350
  height: 56px;
351
+
330
352
  ul {
331
353
  display: flex;
332
354
  top: 0;
333
355
  bottom: 0;
334
356
  z-index: 1;
357
+
335
358
  li {
336
359
  flex: 1;
337
360
  display: inline-block;
338
361
  margin: 0;
339
362
  height: 100%;
340
363
  transition: none;
364
+
341
365
  a {
342
366
  display: block;
343
367
  overflow: hidden;
@@ -349,6 +373,7 @@ button.btn-floating {
349
373
  color: $button-floating-color;
350
374
  line-height: 56px;
351
375
  z-index: 1;
376
+
352
377
  i {
353
378
  line-height: inherit;
354
379
  }
@@ -356,12 +381,14 @@ button.btn-floating {
356
381
  }
357
382
  }
358
383
  }
384
+
359
385
  position: fixed;
360
386
  right: 23px;
361
387
  bottom: 23px;
362
388
  padding-top: 15px;
363
389
  margin-bottom: 0;
364
390
  z-index: 997;
391
+
365
392
  ul {
366
393
  left: 0;
367
394
  right: 0;
@@ -370,13 +397,16 @@ button.btn-floating {
370
397
  bottom: 64px;
371
398
  margin: 0;
372
399
  visibility: hidden;
400
+
373
401
  li {
374
402
  margin-bottom: 15px;
375
403
  }
404
+
376
405
  a.btn-floating {
377
406
  opacity: 0;
378
407
  }
379
408
  }
409
+
380
410
  .fab-backdrop {
381
411
  position: absolute;
382
412
  top: 0;
@@ -398,6 +428,7 @@ button.btn-floating {
398
428
  height: calc(1.5 * var(--btn-height));
399
429
  font-size: 18px;
400
430
  padding: 0 28px;
431
+
401
432
  i {
402
433
  font-size: 1.6rem;
403
434
  }
@@ -408,6 +439,7 @@ button.btn-floating {
408
439
  @extend .btn;
409
440
  height: calc(0.75 * var(--btn-height));
410
441
  font-size: 13px;
442
+
411
443
  i {
412
444
  font-size: 1.2rem;
413
445
  }
@@ -420,4 +452,4 @@ button.btn-floating {
420
452
 
421
453
  .btn.rounded {
422
454
  border-radius: 99999px;
423
- }
455
+ }
@@ -19,9 +19,6 @@
19
19
  .card-title {
20
20
  font-size: 24px;
21
21
  font-weight: 300;
22
- &.activator {
23
- cursor: pointer;
24
- }
25
22
  }
26
23
 
27
24
  // Card Sizes
@@ -32,13 +29,16 @@
32
29
  max-height: 60%;
33
30
  overflow: hidden;
34
31
  }
32
+
35
33
  .card-image + .card-content {
36
34
  max-height: 40%;
37
35
  }
36
+
38
37
  .card-content {
39
38
  max-height: 100%;
40
39
  overflow: hidden;
41
40
  }
41
+
42
42
  .card-action {
43
43
  position: absolute;
44
44
  bottom: 0;
@@ -77,6 +77,7 @@
77
77
 
78
78
  .card-image {
79
79
  max-width: 50%;
80
+
80
81
  img {
81
82
  border-radius: 2px 0 0 2px;
82
83
  max-width: 100%;
@@ -108,9 +109,6 @@
108
109
  }
109
110
  }
110
111
 
111
-
112
-
113
-
114
112
  .card-image {
115
113
  position: relative;
116
114
 
@@ -134,6 +132,15 @@
134
132
  max-width: 100%;
135
133
  padding: 24px;
136
134
  }
135
+
136
+ .activator {
137
+ position: absolute;
138
+ left: 0;
139
+ right: 0;
140
+ top:0;
141
+ bottom: 0;
142
+ cursor: pointer;
143
+ }
137
144
  }
138
145
 
139
146
  .card-content {
@@ -143,6 +150,7 @@
143
150
  p {
144
151
  margin: 0;
145
152
  }
153
+
146
154
  .card-title {
147
155
  display: block;
148
156
  line-height: 32px;
@@ -151,6 +159,10 @@
151
159
  i {
152
160
  line-height: 32px;
153
161
  }
162
+
163
+ &.activator {
164
+ cursor: pointer;
165
+ }
154
166
  }
155
167
  }
156
168
 
@@ -75,7 +75,6 @@
75
75
  flex-wrap: wrap;
76
76
 
77
77
  border: none;
78
- border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
79
78
  box-shadow: none;
80
79
  margin: 0 0 8px 0;
81
80
 
@@ -90,8 +89,12 @@
90
89
  box-shadow: 0 1px 0 0 var(--md-sys-color-primary);
91
90
  }
92
91
 
93
- &:hover {
94
- cursor: text;
92
+ &.input-field {
93
+ border-bottom: 1px solid var(--md-sys-color-on-surface-variant);
94
+
95
+ &:hover {
96
+ cursor: text;
97
+ }
95
98
  }
96
99
 
97
100
  input:not([type]):not(.browser-default).input {
@@ -109,6 +112,9 @@
109
112
  margin: 0;
110
113
  padding: 0;
111
114
  width: 120px;
115
+ width: fit-content;
116
+ min-width: 100px;
117
+ max-width: 200px;
112
118
 
113
119
 
114
120
  &:focus {
@@ -31,20 +31,26 @@
31
31
  }
32
32
 
33
33
  .collapsible-header::after {
34
- content: '';
35
- text-align: right;
36
- margin-right: 0.25rem;
37
- width: 100%;
34
+ content: '\e5cf';
35
+ margin-left: .5rem;
36
+ font-family: 'Material Symbols Outlined', 'Material Symbols Rounded', 'Material Symbols Sharp', 'Material Icons';
37
+ font-size: 25px;
38
+ line-height: .9;
39
+ -webkit-font-smoothing: antialiased;
38
40
  }
41
+
39
42
  .active .collapsible-header::after {
40
- content: "▴";
43
+ content: '\e5ce';
41
44
  }
42
45
 
43
-
44
46
  .keyboard-focused .collapsible-header:focus {
45
47
  background-color: rgba(0, 0, 0, 0.12);
46
48
  }
47
49
 
50
+ .collapsible-header-content {
51
+ flex-grow: 1;
52
+ }
53
+
48
54
  .collapsible-body {
49
55
  max-height: 0;
50
56
  border-bottom: 1px solid var(--md-sys-color-outline-variant);
@@ -38,6 +38,11 @@
38
38
  }
39
39
  }
40
40
 
41
+ .select-dropdown {
42
+ padding: 0;
43
+ vertical-align: middle;
44
+ }
45
+
41
46
  .select-year input {
42
47
  width: 50px;
43
48
  }
@@ -59,6 +64,7 @@
59
64
  }
60
65
 
61
66
  .month-prev, .month-next {
67
+ height: 49px;
62
68
  margin-top: 4px;
63
69
  cursor: pointer;
64
70
  background-color: transparent;
@@ -1,101 +1,68 @@
1
+ // use with dialog html element
1
2
  .modal {
2
- --modal-footer-height: 56px;
3
3
  --modal-footer-divider-height: 1px;
4
4
  --modal-border-radius: 28px;
5
5
  --modal-padding: 24px;
6
-
7
- &:focus {
8
- outline: none;
9
- }
6
+ --modal-padding-bottom: 16px;
10
7
 
11
8
  @extend .z-depth-5;
12
-
13
- display: none;
14
- position: fixed;
15
- left: 0;
16
- right: 0;
17
- background-color: var(--md-sys-color-surface);
9
+ border: none;
10
+ outline: none;
18
11
  padding: 0;
19
12
  max-height: 70%;
20
13
  width: 55%;
21
- margin: auto;
22
- overflow-y: auto;
23
-
24
14
  border-radius: var(--modal-border-radius);
25
15
  will-change: top, opacity;
26
16
 
17
+ // Dialog open
18
+ &[open] {
19
+ display: flex;
20
+ flex-direction: column;
21
+ }
22
+
23
+ // Background
24
+ background-color: color-mix(in srgb, var(--md-sys-color-surface), var(--md-sys-color-surface-tint) 17%);
25
+
27
26
  @media #{$medium-and-down} {
28
27
  width: 80%;
29
28
  }
30
29
 
31
- h1,h2,h3,h4 {
32
- margin-top: 0;
30
+ // custom backdrop blur
31
+ &::backdrop {
32
+ backdrop-filter: blur(1px);
33
33
  }
34
34
 
35
- .modal-content {
35
+ .modal-header {
36
36
  padding: var(--modal-padding);
37
- overflow-y: hidden;
37
+ padding-bottom: var(--modal-padding-bottom);
38
+ flex-shrink: 0;
38
39
  }
39
-
40
- .modal-close {
41
- cursor: pointer;
40
+ .modal-content {
41
+ padding: 0 var(--modal-padding);
42
+ overflow-y: auto;
42
43
  }
43
-
44
44
  .modal-footer {
45
45
  border-radius: 0 0 var(--modal-border-radius) var(--modal-border-radius);
46
- background-color: var(--md-sys-color-surface);
47
- padding: 4px 6px;
48
- height: var(--modal-footer-height);
49
- width: 100%;
46
+ padding: var(--modal-padding);
50
47
  text-align: right;
51
-
52
- .btn, .btn-flat {
53
- margin: 6px 0;
54
- }
48
+ flex-shrink: 0;
55
49
  }
56
- }
57
50
 
58
- .modal-overlay {
59
- position: fixed;
60
- z-index: 999;
61
- top: -25%;
62
- left: 0;
63
- bottom: 0;
64
- right: 0;
65
- height: 125%;
66
- width: 100%;
67
- background: #000;
68
- display: none;
69
- will-change: opacity;
70
- }
71
-
72
- // Modal with fixed action footer
73
- .modal.modal-fixed-footer {
74
- padding: 0;
75
- height: 70%;
76
-
77
- .modal-content {
78
- position: absolute;
79
- height: calc(100% - var(--modal-footer-height));
80
- max-height: 100%;
81
- width: 100%;
82
- overflow-y: auto;
51
+ .modal-close {
52
+ cursor: pointer;
83
53
  }
84
54
 
85
- .modal-footer {
86
- border-top: var(--modal-footer-divider-height) solid var(--md-sys-color-outline-variant);
87
- position: absolute;
88
- bottom: var(--modal-footer-divider-height);
55
+ // todo: remove maybe
56
+ h1,h2,h3,h4,h5,h6 {
57
+ margin: 0;
89
58
  }
90
59
  }
91
60
 
92
61
  // Modal Bottom Sheet Style
93
62
  .modal.bottom-sheet {
94
- top: auto;
95
- bottom: -100%;
96
- margin: 0;
97
- width: 100%;
63
+ margin-bottom: 0;
98
64
  max-height: 45%;
99
- border-radius: 0;
65
+ border-bottom-left-radius: 0;
66
+ border-bottom-right-radius: 0;
100
67
  will-change: bottom, opacity;
101
68
  }