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

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 (43) 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/file-upload.d.ts +23 -0
  9. package/dist/floating-action-button.d.ts +1 -1
  10. package/dist/forms.css +344 -13
  11. package/dist/icon.d.ts +2 -2
  12. package/dist/image-list.d.ts +70 -0
  13. package/dist/index.css +1940 -20
  14. package/dist/index.d.ts +8 -0
  15. package/dist/index.esm.js +2736 -659
  16. package/dist/index.js +2746 -658
  17. package/dist/index.min.css +2 -2
  18. package/dist/index.umd.js +2746 -658
  19. package/dist/input-options.d.ts +18 -4
  20. package/dist/input.d.ts +0 -1
  21. package/dist/masonry.d.ts +17 -0
  22. package/dist/material-icon.d.ts +3 -0
  23. package/dist/pickers.css +45 -0
  24. package/dist/range-slider.d.ts +42 -0
  25. package/dist/theme-switcher.d.ts +23 -0
  26. package/dist/timeline.d.ts +43 -0
  27. package/dist/treeview.d.ts +39 -0
  28. package/dist/types.d.ts +226 -0
  29. package/dist/utilities.css +16 -9
  30. package/package.json +12 -9
  31. package/sass/components/_cards.scss +10 -3
  32. package/sass/components/_datatable.scss +417 -0
  33. package/sass/components/_datepicker.scss +57 -0
  34. package/sass/components/_global.scss +6 -6
  35. package/sass/components/_image-list.scss +421 -0
  36. package/sass/components/_masonry.scss +241 -0
  37. package/sass/components/_timeline.scss +452 -0
  38. package/sass/components/_treeview.scss +353 -0
  39. package/sass/components/forms/_forms.scss +1 -1
  40. package/sass/components/forms/_range-enhanced.scss +406 -0
  41. package/sass/components/forms/_range.scss +5 -5
  42. package/sass/components/forms/_select.scss +1 -1
  43. package/sass/materialize.scss +6 -0
@@ -0,0 +1,452 @@
1
+ // Timeline Component Styles
2
+ // Material Design inspired timeline with vertical and horizontal orientations
3
+
4
+ @use "sass:map";
5
+ @use 'variables' as *;
6
+ @use 'theme-variables' as *;
7
+
8
+ // Timeline colors mapping
9
+ $timeline-colors: (
10
+ 'primary': var(--mm-primary-color, #{$primary-color}),
11
+ 'secondary': var(--mm-secondary-color, #{$secondary-color}),
12
+ 'success': var(--mm-success-color, #4caf50),
13
+ 'warning': var(--mm-warning-color, #ff9800),
14
+ 'error': var(--mm-error-color, #f44336),
15
+ 'info': var(--mm-info-color, #2196f3),
16
+ 'default': var(--mm-primary-color, #{$primary-color})
17
+ );
18
+
19
+ // Base timeline styles
20
+ .timeline {
21
+ position: relative;
22
+ padding: 16px;
23
+ margin: 0;
24
+ list-style: none;
25
+
26
+ // Vertical timeline (default)
27
+ &.timeline-vertical {
28
+ display: flex;
29
+ flex-direction: column;
30
+ }
31
+
32
+ // Horizontal timeline
33
+ &.timeline-horizontal {
34
+ display: flex;
35
+ flex-direction: row;
36
+ flex-wrap: nowrap;
37
+ overflow-x: auto;
38
+ }
39
+
40
+ // Compact mode
41
+ &.timeline-compact {
42
+ .timeline-item {
43
+ margin-bottom: 16px;
44
+
45
+ .timeline-content {
46
+ margin-top: -6px;
47
+ padding: 0px 16px;
48
+ }
49
+ }
50
+
51
+ &.timeline-horizontal .timeline-item {
52
+ margin-right: 16px;
53
+ }
54
+ }
55
+ }
56
+
57
+ // Timeline item base styles
58
+ .timeline-item {
59
+ position: relative;
60
+ display: flex;
61
+ margin-bottom: 16px;
62
+
63
+ &:last-child {
64
+ margin-bottom: 0;
65
+ align-items: flex-start;
66
+
67
+ .timeline-separator {
68
+ align-items: flex-start;
69
+ }
70
+ }
71
+
72
+ // Clickable items
73
+ &[role="button"] {
74
+ cursor: pointer;
75
+ transition: all 0.2s ease;
76
+
77
+ &:hover:not(.timeline-item-disabled) {
78
+ .timeline-content {
79
+ background: var(--mm-hover-color, rgba(0, 0, 0, 0.04));
80
+ transform: translateY(-1px);
81
+ box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
82
+ }
83
+
84
+ .timeline-dot {
85
+ transform: scale(1.1);
86
+ }
87
+ }
88
+
89
+ &:focus-visible {
90
+ outline: 2px solid var(--mm-primary-color, #{$primary-color});
91
+ outline-offset: 2px;
92
+ border-radius: 4px;
93
+ }
94
+ }
95
+
96
+ // Disabled state
97
+ &.timeline-item-disabled {
98
+ opacity: 0.6;
99
+ cursor: not-allowed;
100
+
101
+ .timeline-content,
102
+ .timeline-dot {
103
+ pointer-events: none;
104
+ }
105
+ }
106
+
107
+ // Vertical timeline item positioning
108
+ .timeline-vertical & {
109
+ display: flex;
110
+ align-items: flex-start;
111
+ justify-content: flex-start;
112
+
113
+ &.timeline-item-left {
114
+ // timestamp - separator - content (content on right)
115
+ .timeline-timestamp-separate {
116
+ order: 1;
117
+ margin-left: 16px;
118
+ text-align: right;
119
+ min-width: 80px;
120
+ }
121
+
122
+ .timeline-separator {
123
+ order: 2;
124
+ }
125
+
126
+ .timeline-content {
127
+ order: 3;
128
+ margin-left: 16px;
129
+ flex: 1;
130
+ text-align: left;
131
+ }
132
+ }
133
+
134
+ &.timeline-item-right {
135
+ // content - separator - timestamp (content on left)
136
+ .timeline-content {
137
+ order: 1;
138
+ margin-right: 16px;
139
+ flex: 1;
140
+ text-align: right;
141
+ }
142
+
143
+ .timeline-separator {
144
+ order: 2;
145
+ }
146
+
147
+ .timeline-timestamp-separate {
148
+ order: 3;
149
+ margin-left: 16px;
150
+ text-align: left;
151
+ min-width: 80px;
152
+ }
153
+
154
+ .timeline-timestamp-separate.timeline-dot-small {
155
+ margin-top: -6px;
156
+ }
157
+ }
158
+ }
159
+
160
+ // Special positioning for alternating mode
161
+ .timeline-alternate & {
162
+ justify-content: center;
163
+
164
+ .timeline-separator {
165
+ position: absolute;
166
+ left: 50%;
167
+ transform: translateX(-50%);
168
+ z-index: 2;
169
+ }
170
+
171
+ // Hide timestamps in alternating mode (following Material-UI pattern)
172
+ .timeline-timestamp-separate {
173
+ display: none;
174
+ }
175
+
176
+ &.timeline-item-left {
177
+ .timeline-content {
178
+ width: calc(50% - 40px);
179
+ margin-right: calc(50% + 16px);
180
+ text-align: right;
181
+ }
182
+ }
183
+
184
+ &.timeline-item-right {
185
+ .timeline-content {
186
+ width: calc(50% - 40px);
187
+ margin-left: calc(50% + 16px);
188
+ text-align: left;
189
+ }
190
+ }
191
+ }
192
+
193
+ // Horizontal timeline item positioning
194
+ .timeline-horizontal & {
195
+ flex-direction: column;
196
+ align-items: center;
197
+ flex-shrink: 0;
198
+ min-width: 120px;
199
+ margin-right: 32px;
200
+ margin-bottom: 0;
201
+
202
+ &:last-child {
203
+ margin-right: 0;
204
+ }
205
+
206
+ .timeline-content {
207
+ margin-top: 16px;
208
+ margin-left: 0;
209
+ margin-right: 0;
210
+ text-align: center;
211
+ }
212
+ }
213
+ }
214
+
215
+ // Timeline separator (contains dot and connector)
216
+ .timeline-separator {
217
+ position: relative;
218
+ display: flex;
219
+ flex-direction: column;
220
+ align-items: center;
221
+ flex-shrink: 0;
222
+ align-self: stretch;
223
+
224
+ .timeline-horizontal & {
225
+ flex-direction: row;
226
+ }
227
+ }
228
+
229
+ // Timeline dot/marker
230
+ .timeline-dot {
231
+ position: relative;
232
+ z-index: 2;
233
+ width: 24px;
234
+ height: 24px;
235
+ border-radius: 50%;
236
+ background: var(--mm-primary-color, #{$primary-color});
237
+ display: flex;
238
+ align-items: center;
239
+ justify-content: center;
240
+ flex-shrink: 0;
241
+ transition: all 0.2s ease;
242
+ // box-shadow: 0 0 0 3px var(--mm-surface-color, #ffffff);
243
+
244
+ .timeline-icon {
245
+ font-size: 16px;
246
+ color: var(--mm-background-color, #4caf50)
247
+ }
248
+
249
+ .timeline-marker {
250
+ width: 8px;
251
+ height: 8px;
252
+ border-radius: 50%;
253
+ background: var(--mm-on-primary-color, #ffffff);
254
+ }
255
+
256
+ // Smaller dot when no icon is present
257
+ &.timeline-dot-small {
258
+ width: 12px;
259
+ height: 12px;
260
+
261
+ .timeline-marker {
262
+ width: 6px;
263
+ height: 6px;
264
+ }
265
+ }
266
+ }
267
+
268
+ // Timeline connector line
269
+ .timeline-connector {
270
+ background: var(--mm-divider-color, rgba(0, 0, 0, 0.12));
271
+ flex-shrink: 0;
272
+
273
+ [data-theme="dark"] & {
274
+ background: var(--mm-divider-color, rgba(255, 255, 255, 0.12));
275
+ }
276
+
277
+ // Vertical connectors
278
+ .timeline-vertical & {
279
+ width: 4px;
280
+ flex: 1;
281
+ min-height: 24px;
282
+ margin-top: 4px;
283
+ margin-bottom: -4px;
284
+ }
285
+
286
+ // Horizontal connectors
287
+ .timeline-horizontal & {
288
+ height: 4px;
289
+ min-width: 32px;
290
+ margin-left: 8px;
291
+ }
292
+ }
293
+
294
+ // Timeline content
295
+ .timeline-content {
296
+ flex: 1;
297
+ padding: 0 8px;
298
+ transition: all 0.2s ease;
299
+ min-width: 0; // Allow text truncation
300
+
301
+ // Align first line with timeline dot (24px height, center = 12px from top)
302
+ .timeline-label:first-child {
303
+ margin-top: 2px; // Adjust to align with dot center
304
+ }
305
+
306
+ // Add background for custom content (cards, etc.)
307
+ .card {
308
+ background: var(--mm-surface-color, #ffffff);
309
+ border-radius: 8px;
310
+ padding: 12px 16px;
311
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
312
+ margin: 4px 0;
313
+
314
+ [data-theme="dark"] & {
315
+ background: var(--mm-surface-variant-color, #424242);
316
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
317
+ }
318
+ }
319
+ }
320
+
321
+ // Timeline timestamp
322
+ .timeline-timestamp {
323
+ font-size: 0.75rem;
324
+ color: var(--mm-text-secondary, rgba(0, 0, 0, 0.6));
325
+ margin-bottom: 4px;
326
+ font-weight: 500;
327
+
328
+ [data-theme="dark"] & {
329
+ color: var(--mm-text-secondary, rgba(255, 255, 255, 0.7));
330
+ }
331
+ }
332
+
333
+ // Separate timestamp for vertical layouts
334
+ .timeline-timestamp-separate {
335
+ font-size: 0.75rem;
336
+ color: var(--mm-text-secondary, rgba(0, 0, 0, 0.6));
337
+ font-weight: 500;
338
+ display: flex;
339
+ align-items: center;
340
+ height: 24px;
341
+
342
+ [data-theme="dark"] & {
343
+ color: var(--mm-text-secondary, rgba(255, 255, 255, 0.7));
344
+ }
345
+ }
346
+
347
+ // Timeline text content
348
+ .timeline-label {
349
+ font-size: 1rem;
350
+ font-weight: 500;
351
+ color: var(--mm-text-primary, rgba(0, 0, 0, 0.87));
352
+ margin-bottom: 4px;
353
+ line-height: 1.4;
354
+
355
+ [data-theme="dark"] & {
356
+ color: var(--mm-text-primary, rgba(255, 255, 255, 0.87));
357
+ }
358
+ }
359
+
360
+ .timeline-description {
361
+ font-size: 0.875rem;
362
+ color: var(--mm-text-secondary, rgba(0, 0, 0, 0.6));
363
+ line-height: 1.5;
364
+ margin: 0;
365
+
366
+ [data-theme="dark"] & {
367
+ color: var(--mm-text-secondary, rgba(255, 255, 255, 0.7));
368
+ }
369
+ }
370
+
371
+ // Color variations
372
+ @each $name, $color in $timeline-colors {
373
+ .timeline-#{$name} {
374
+ .timeline-dot {
375
+ background: #{$color};
376
+
377
+ .timeline-icon {
378
+ color: var(--mm-on-primary-color, #ffffff);
379
+ }
380
+
381
+ .timeline-marker {
382
+ background: var(--mm-on-primary-color, #ffffff);
383
+ }
384
+ }
385
+ }
386
+ }
387
+
388
+ // Responsive design
389
+ @media screen and (max-width: 600px) {
390
+ .timeline {
391
+ &.timeline-horizontal {
392
+ flex-direction: column;
393
+
394
+ &::before {
395
+ display: none;
396
+ }
397
+
398
+ .timeline-item {
399
+ margin-right: 0;
400
+ margin-bottom: 16px;
401
+ min-width: auto;
402
+
403
+ .timeline-content {
404
+ margin-top: 0;
405
+ margin-left: 16px;
406
+ text-align: left;
407
+ }
408
+ }
409
+ }
410
+
411
+ &.timeline-vertical {
412
+ &.timeline-left,
413
+ &.timeline-alternate {
414
+ .timeline-item {
415
+ flex-direction: row;
416
+ text-align: left;
417
+
418
+ .timeline-content {
419
+ margin-left: 16px;
420
+ margin-right: 0;
421
+ }
422
+ }
423
+ }
424
+ }
425
+ }
426
+ }
427
+
428
+ // Animation support
429
+ @media (prefers-reduced-motion: no-preference) {
430
+ .timeline-item {
431
+ opacity: 0;
432
+ transform: translateY(20px);
433
+ animation: timeline-fade-in 0.5s ease forwards;
434
+
435
+ @for $i from 1 through 20 {
436
+ &:nth-child(#{$i}) {
437
+ animation-delay: #{($i - 1) * 0.1s};
438
+ }
439
+ }
440
+ }
441
+
442
+ .timeline-horizontal .timeline-item {
443
+ transform: translateX(-20px);
444
+ }
445
+ }
446
+
447
+ @keyframes timeline-fade-in {
448
+ to {
449
+ opacity: 1;
450
+ transform: translate(0, 0);
451
+ }
452
+ }