mithril-materialized 2.0.0-beta.9 → 2.0.0-rc.1

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 (40) hide show
  1. package/README.md +353 -10
  2. package/dist/advanced.css +6 -6
  3. package/dist/button.d.ts +56 -11
  4. package/dist/components.css +1674 -6
  5. package/dist/core.css +13 -13
  6. package/dist/datatable.d.ts +291 -0
  7. package/dist/datepicker.d.ts +12 -2
  8. package/dist/forms.css +344 -13
  9. package/dist/icon.d.ts +2 -2
  10. package/dist/image-list.d.ts +70 -0
  11. package/dist/index.css +1940 -20
  12. package/dist/index.d.ts +8 -0
  13. package/dist/index.esm.js +2688 -630
  14. package/dist/index.js +2698 -629
  15. package/dist/index.min.css +2 -2
  16. package/dist/index.umd.js +2698 -629
  17. package/dist/input-options.d.ts +18 -4
  18. package/dist/input.d.ts +0 -1
  19. package/dist/masonry.d.ts +17 -0
  20. package/dist/material-icon.d.ts +3 -0
  21. package/dist/pickers.css +45 -0
  22. package/dist/range-slider.d.ts +42 -0
  23. package/dist/timeline.d.ts +43 -0
  24. package/dist/treeview.d.ts +39 -0
  25. package/dist/types.d.ts +226 -0
  26. package/dist/utilities.css +16 -9
  27. package/package.json +12 -9
  28. package/sass/components/_cards.scss +10 -3
  29. package/sass/components/_datatable.scss +417 -0
  30. package/sass/components/_datepicker.scss +57 -0
  31. package/sass/components/_global.scss +6 -6
  32. package/sass/components/_image-list.scss +421 -0
  33. package/sass/components/_masonry.scss +241 -0
  34. package/sass/components/_timeline.scss +452 -0
  35. package/sass/components/_treeview.scss +353 -0
  36. package/sass/components/forms/_forms.scss +1 -1
  37. package/sass/components/forms/_range-enhanced.scss +406 -0
  38. package/sass/components/forms/_range.scss +5 -5
  39. package/sass/components/forms/_select.scss +1 -1
  40. package/sass/materialize.scss +6 -0
@@ -0,0 +1,421 @@
1
+ // ImageList Component Styles
2
+ // Material Design inspired image grid layouts
3
+
4
+ @use 'variables' as *;
5
+ @use 'theme-variables' as *;
6
+
7
+ // Base image list styles
8
+ .image-list {
9
+ width: 100%;
10
+ overflow: hidden;
11
+
12
+ // Standard grid layout
13
+ &.image-list-standard {
14
+ display: grid;
15
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
16
+ }
17
+
18
+ // Quilted layout (varied item sizes)
19
+ &.image-list-quilted {
20
+ display: grid;
21
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
22
+ grid-auto-rows: 200px;
23
+ }
24
+
25
+ // Masonry layout (Pinterest-style) - using CSS columns
26
+ &.image-list-masonry {
27
+ display: block !important;
28
+ column-fill: auto;
29
+ // CSS columns properties are set dynamically via JS (column-count, column-gap)
30
+ }
31
+
32
+ // Woven layout (alternating patterns)
33
+ &.image-list-woven {
34
+ display: grid;
35
+ grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
36
+ grid-auto-rows: minmax(100px, auto);
37
+ }
38
+ }
39
+
40
+ // Image list item
41
+ .image-list-item {
42
+ position: relative;
43
+ display: block;
44
+ overflow: hidden;
45
+ background: var(--mm-surface-color, #f5f5f5);
46
+ border-radius: 4px;
47
+ transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
48
+
49
+ // Masonry layout specific
50
+ .image-list-masonry & {
51
+ display: inline-block !important;
52
+ width: 100% !important;
53
+ margin-bottom: 8px;
54
+ break-inside: avoid;
55
+ page-break-inside: avoid;
56
+ vertical-align: top;
57
+ }
58
+
59
+ // Clickable items
60
+ &.image-list-item-clickable {
61
+ cursor: pointer;
62
+
63
+ &:hover {
64
+ transform: translateY(-2px);
65
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
66
+ z-index: 2;
67
+
68
+ [data-theme="dark"] & {
69
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
70
+ }
71
+
72
+ .image-list-item-img img {
73
+ transform: scale(1.05);
74
+ }
75
+
76
+ .image-list-item-bar {
77
+ opacity: 1;
78
+ }
79
+ }
80
+
81
+ &:focus-visible {
82
+ outline: 2px solid var(--mm-primary-color, #{$primary-color});
83
+ outline-offset: 2px;
84
+ }
85
+
86
+ &:active {
87
+ transform: translateY(0);
88
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
89
+ }
90
+ }
91
+
92
+ // Featured items (larger/highlighted)
93
+ &.image-list-item-featured {
94
+ grid-column-end: span 2;
95
+ grid-row-end: span 2;
96
+
97
+ .image-list-item-title {
98
+ font-size: 1.25rem;
99
+ font-weight: 500;
100
+ }
101
+ }
102
+ }
103
+
104
+ // Image container
105
+ .image-list-item-img {
106
+ position: relative;
107
+ width: 100%;
108
+ height: 100%;
109
+ overflow: hidden;
110
+ background: var(--mm-surface-variant-color, #e0e0e0);
111
+
112
+ [data-theme="dark"] & {
113
+ background: var(--mm-surface-variant-color, #424242);
114
+ }
115
+
116
+ img {
117
+ width: 100%;
118
+ height: 100%;
119
+ object-fit: cover;
120
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
121
+ opacity: 0;
122
+
123
+ // Loaded state
124
+ &.loaded {
125
+ opacity: 1;
126
+ }
127
+
128
+ // Error state
129
+ &.error {
130
+ opacity: 0.5;
131
+ filter: grayscale(1);
132
+ }
133
+ }
134
+ }
135
+
136
+ // Loading placeholder
137
+ .image-list-item-placeholder {
138
+ position: absolute;
139
+ top: 0;
140
+ left: 0;
141
+ right: 0;
142
+ bottom: 0;
143
+ background: linear-gradient(
144
+ 90deg,
145
+ var(--mm-surface-variant-color, #e0e0e0) 25%,
146
+ var(--mm-surface-color, #f5f5f5) 50%,
147
+ var(--mm-surface-variant-color, #e0e0e0) 75%
148
+ );
149
+ background-size: 200% 100%;
150
+ animation: image-list-loading 1.5s infinite;
151
+ opacity: 1;
152
+ transition: opacity 0.3s ease;
153
+
154
+ [data-theme="dark"] & {
155
+ background: linear-gradient(
156
+ 90deg,
157
+ var(--mm-surface-variant-color, #424242) 25%,
158
+ var(--mm-surface-color, #303030) 50%,
159
+ var(--mm-surface-variant-color, #424242) 75%
160
+ );
161
+ }
162
+
163
+ // Hide when image loads
164
+ .loaded + & {
165
+ opacity: 0;
166
+ }
167
+ }
168
+
169
+ // Title/subtitle bar overlay
170
+ .image-list-item-bar {
171
+ position: absolute;
172
+ bottom: 0;
173
+ left: 0;
174
+ right: 0;
175
+ padding: 12px 16px;
176
+ background: linear-gradient(
177
+ to top,
178
+ rgba(0, 0, 0, 0.7) 0%,
179
+ rgba(0, 0, 0, 0.3) 70%,
180
+ transparent 100%
181
+ );
182
+ color: white;
183
+ transform: translateY(0);
184
+ transition: all 0.2s ease;
185
+ opacity: 0.9;
186
+
187
+ .image-list-with-titles & {
188
+ opacity: 1;
189
+ transform: translateY(0);
190
+ }
191
+
192
+ // Always visible on touch devices
193
+ @media (hover: none) {
194
+ opacity: 1;
195
+ }
196
+ }
197
+
198
+ .image-list-item-title-wrap {
199
+ display: flex;
200
+ flex-direction: column;
201
+ }
202
+
203
+ .image-list-item-title {
204
+ font-size: 1rem;
205
+ font-weight: 500;
206
+ line-height: 1.2;
207
+ margin: 0 0 4px 0;
208
+ color: white;
209
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
210
+ }
211
+
212
+ .image-list-item-subtitle {
213
+ font-size: 0.875rem;
214
+ line-height: 1.2;
215
+ margin: 0;
216
+ color: rgba(255, 255, 255, 0.9);
217
+ text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
218
+ }
219
+
220
+ // Action buttons
221
+ .image-list-item-action {
222
+ position: absolute;
223
+ width: 40px;
224
+ height: 40px;
225
+ border: none;
226
+ border-radius: 50%;
227
+ background: rgba(255, 255, 255, 0.9);
228
+ color: var(--mm-text-primary, rgba(0, 0, 0, 0.87));
229
+ cursor: pointer;
230
+ transition: all 0.2s ease;
231
+ display: flex;
232
+ align-items: center;
233
+ justify-content: center;
234
+ z-index: 3;
235
+
236
+ [data-theme="dark"] & {
237
+ background: rgba(0, 0, 0, 0.7);
238
+ color: var(--mm-text-primary, rgba(255, 255, 255, 0.87));
239
+ }
240
+
241
+ &:hover {
242
+ background: white;
243
+ transform: scale(1.1);
244
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
245
+
246
+ [data-theme="dark"] & {
247
+ background: rgba(0, 0, 0, 0.9);
248
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
249
+ }
250
+ }
251
+
252
+ &:focus-visible {
253
+ outline: 2px solid var(--mm-primary-color, #{$primary-color});
254
+ outline-offset: 2px;
255
+ }
256
+
257
+ .material-icons {
258
+ font-size: 20px;
259
+ }
260
+
261
+ // Positioning variants
262
+ &.image-list-action-top-left {
263
+ top: 8px;
264
+ left: 8px;
265
+ }
266
+
267
+ &.image-list-action-top-right {
268
+ top: 8px;
269
+ right: 8px;
270
+ }
271
+
272
+ &.image-list-action-bottom-left {
273
+ bottom: 8px;
274
+ left: 8px;
275
+ }
276
+
277
+ &.image-list-action-bottom-right {
278
+ bottom: 8px;
279
+ right: 8px;
280
+ }
281
+
282
+ // Hidden by default, shown on hover or when always visible
283
+ opacity: 0;
284
+ transform: scale(0.8);
285
+
286
+ .image-list-with-actions & {
287
+ opacity: 1;
288
+ transform: scale(1);
289
+ }
290
+
291
+ .image-list-item:hover & {
292
+ opacity: 1;
293
+ transform: scale(1);
294
+ }
295
+
296
+ // Always visible on touch devices
297
+ @media (hover: none) {
298
+ opacity: 1;
299
+ transform: scale(1);
300
+ }
301
+ }
302
+
303
+ // Responsive behavior
304
+ @media screen and (max-width: 768px) {
305
+ .image-list {
306
+ &.image-list-standard,
307
+ &.image-list-quilted,
308
+ &.image-list-woven {
309
+ grid-template-columns: repeat(2, 1fr);
310
+ }
311
+ }
312
+
313
+ .image-list-item-featured {
314
+ grid-column-end: span 1;
315
+ grid-row-end: span 1;
316
+ }
317
+ }
318
+
319
+ @media screen and (max-width: 480px) {
320
+ .image-list {
321
+ &.image-list-standard,
322
+ &.image-list-quilted,
323
+ &.image-list-woven {
324
+ grid-template-columns: 1fr;
325
+ }
326
+ }
327
+
328
+ .image-list-item-bar {
329
+ padding: 8px 12px;
330
+ }
331
+
332
+ .image-list-item-title {
333
+ font-size: 0.875rem;
334
+ }
335
+
336
+ .image-list-item-subtitle {
337
+ font-size: 0.75rem;
338
+ }
339
+ }
340
+
341
+ // Loading animation
342
+ @keyframes image-list-loading {
343
+ 0% {
344
+ background-position: 200% 0;
345
+ }
346
+ 100% {
347
+ background-position: -200% 0;
348
+ }
349
+ }
350
+
351
+ // Reduced motion support
352
+ @media (prefers-reduced-motion: reduce) {
353
+ .image-list-item {
354
+ transition: none;
355
+
356
+ &:hover {
357
+ transform: none;
358
+ }
359
+
360
+ .image-list-item-img img {
361
+ transition: none;
362
+
363
+ &:hover {
364
+ transform: none;
365
+ }
366
+ }
367
+ }
368
+
369
+ .image-list-item-placeholder {
370
+ animation: none;
371
+ }
372
+
373
+ .image-list-item-action {
374
+ transition: none;
375
+
376
+ &:hover {
377
+ transform: none;
378
+ }
379
+ }
380
+ }
381
+
382
+ // High contrast mode
383
+ @media (prefers-contrast: high) {
384
+ .image-list-item {
385
+ border: 1px solid;
386
+ }
387
+
388
+ .image-list-item-action {
389
+ border: 2px solid;
390
+ }
391
+
392
+ .image-list-item-bar {
393
+ background: black;
394
+ }
395
+ }
396
+
397
+ // Print styles
398
+ @media print {
399
+ .image-list {
400
+ display: block;
401
+
402
+ .image-list-item {
403
+ display: inline-block;
404
+ width: 48%;
405
+ margin: 1%;
406
+ vertical-align: top;
407
+ break-inside: avoid;
408
+ page-break-inside: avoid;
409
+
410
+ .image-list-item-action {
411
+ display: none;
412
+ }
413
+
414
+ .image-list-item-bar {
415
+ position: relative;
416
+ background: #f5f5f5;
417
+ color: black;
418
+ }
419
+ }
420
+ }
421
+ }
@@ -0,0 +1,241 @@
1
+ // Masonry Component Styles
2
+ // Pinterest-style layout with optimal item positioning
3
+
4
+ @use 'variables' as *;
5
+ @use 'theme-variables' as *;
6
+
7
+ // Base masonry container
8
+ .masonry {
9
+ width: 100%;
10
+
11
+ // CSS-only fallback masonry
12
+ &.masonry-css {
13
+ display: grid;
14
+ grid-auto-rows: max-content;
15
+
16
+ // Fallback for browsers without masonry support
17
+ @supports not (grid-template-rows: masonry) {
18
+ display: flex;
19
+ flex-wrap: wrap;
20
+ align-items: flex-start;
21
+
22
+ .masonry-item {
23
+ flex: 0 0 auto;
24
+ }
25
+ }
26
+
27
+ // Future CSS Masonry support
28
+ @supports (grid-template-rows: masonry) {
29
+ grid-template-rows: masonry;
30
+ }
31
+ }
32
+
33
+ // JavaScript-driven masonry
34
+ &.masonry-js {
35
+ position: relative;
36
+
37
+ .masonry-item {
38
+ position: absolute;
39
+ transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
40
+ }
41
+ }
42
+
43
+ // Animated masonry
44
+ &.masonry-animated {
45
+ .masonry-item {
46
+ opacity: 0;
47
+ transform: translateY(20px) scale(0.95);
48
+ animation: masonry-item-enter 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
49
+ }
50
+ }
51
+ }
52
+
53
+ // Masonry items
54
+ .masonry-item {
55
+ box-sizing: border-box;
56
+ break-inside: avoid;
57
+ overflow: hidden;
58
+
59
+ // Ensure items don't exceed container width
60
+ max-width: 100%;
61
+
62
+ // Base styling for interactive items
63
+ &[onclick] {
64
+ cursor: pointer;
65
+ transition: all 0.2s ease;
66
+
67
+ &:hover {
68
+ transform: translateY(-2px);
69
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
70
+ z-index: 2;
71
+
72
+ [data-theme="dark"] & {
73
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
74
+ }
75
+ }
76
+
77
+ &:active {
78
+ transform: translateY(0);
79
+ box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
80
+ }
81
+
82
+ &:focus-visible {
83
+ outline: 2px solid var(--mm-primary-color, #{$primary-color});
84
+ outline-offset: 2px;
85
+ }
86
+ }
87
+
88
+ // Animation class
89
+ &.masonry-item-animated {
90
+ opacity: 0;
91
+ transform: translateY(20px) scale(0.95);
92
+ }
93
+
94
+ // Common content styling
95
+ img, video {
96
+ width: 100%;
97
+ height: auto;
98
+ display: block;
99
+ border-radius: 4px;
100
+ }
101
+
102
+ // Card-like content
103
+ .card {
104
+ width: 100%;
105
+ margin: 0;
106
+
107
+ .card-content {
108
+ padding: 12px;
109
+ }
110
+ }
111
+ }
112
+
113
+ // Responsive column layouts (CSS-only mode)
114
+ .masonry-css {
115
+ // Mobile first
116
+ grid-template-columns: 1fr;
117
+
118
+ // Small screens and up (576px+)
119
+ @media screen and (min-width: 576px) {
120
+ grid-template-columns: repeat(2, 1fr);
121
+ }
122
+
123
+ // Medium screens and up (768px+)
124
+ @media screen and (min-width: 768px) {
125
+ grid-template-columns: repeat(3, 1fr);
126
+ }
127
+
128
+ // Large screens and up (992px+)
129
+ @media screen and (min-width: 992px) {
130
+ grid-template-columns: repeat(4, 1fr);
131
+ }
132
+
133
+ // Extra large screens and up (1200px+)
134
+ @media screen and (min-width: 1200px) {
135
+ grid-template-columns: repeat(5, 1fr);
136
+ }
137
+ }
138
+
139
+ // Loading states
140
+ .masonry-loading {
141
+ .masonry-item {
142
+ opacity: 0.6;
143
+
144
+ &::after {
145
+ content: '';
146
+ position: absolute;
147
+ top: 0;
148
+ left: 0;
149
+ right: 0;
150
+ bottom: 0;
151
+ background: linear-gradient(
152
+ 90deg,
153
+ transparent,
154
+ rgba(255, 255, 255, 0.4),
155
+ transparent
156
+ );
157
+ animation: masonry-shimmer 1.5s infinite;
158
+ }
159
+
160
+ [data-theme="dark"] &::after {
161
+ background: linear-gradient(
162
+ 90deg,
163
+ transparent,
164
+ rgba(255, 255, 255, 0.1),
165
+ transparent
166
+ );
167
+ }
168
+ }
169
+ }
170
+
171
+ // Animations
172
+ @keyframes masonry-item-enter {
173
+ to {
174
+ opacity: 1;
175
+ transform: translateY(0) scale(1);
176
+ }
177
+ }
178
+
179
+ @keyframes masonry-shimmer {
180
+ 0% {
181
+ transform: translateX(-100%);
182
+ }
183
+ 100% {
184
+ transform: translateX(100%);
185
+ }
186
+ }
187
+
188
+ // Reduced motion support
189
+ @media (prefers-reduced-motion: reduce) {
190
+ .masonry {
191
+ &.masonry-animated .masonry-item {
192
+ animation: none;
193
+ opacity: 1;
194
+ transform: none;
195
+ }
196
+
197
+ .masonry-item {
198
+ transition: none;
199
+
200
+ &:hover {
201
+ transform: none;
202
+ }
203
+ }
204
+ }
205
+ }
206
+
207
+ // Print styles
208
+ @media print {
209
+ .masonry {
210
+ display: block;
211
+
212
+ .masonry-item {
213
+ position: relative !important;
214
+ left: auto !important;
215
+ top: auto !important;
216
+ transform: none !important;
217
+ width: auto !important;
218
+ margin-bottom: 16px;
219
+ break-inside: avoid;
220
+ page-break-inside: avoid;
221
+ }
222
+ }
223
+ }
224
+
225
+ // Accessibility improvements
226
+ @media (prefers-reduced-motion: reduce) {
227
+ .masonry-item {
228
+ transition: none;
229
+ }
230
+ }
231
+
232
+ // High contrast mode support
233
+ @media (prefers-contrast: high) {
234
+ .masonry-item {
235
+ border: 1px solid;
236
+
237
+ &[onclick]:hover {
238
+ box-shadow: 0 0 0 2px;
239
+ }
240
+ }
241
+ }