mithril-materialized 2.0.0-beta.5 → 2.0.0-beta.6

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.
@@ -0,0 +1,487 @@
1
+ /* Modal */
2
+ .datepicker-modal {
3
+ max-width: 325px;
4
+ min-width: 300px;
5
+ max-height: none;
6
+ overflow: visible;
7
+ }
8
+
9
+ .datepicker-container.modal-content {
10
+ display: flex;
11
+ flex-direction: column;
12
+ padding: 0;
13
+ overflow: visible;
14
+ background-color: var(--mm-surface-color, #ffffff);
15
+ color: var(--mm-text-primary, rgba(0, 0, 0, 0.87));
16
+ }
17
+
18
+ .datepicker-controls {
19
+ display: flex;
20
+ justify-content: space-between;
21
+ width: 280px;
22
+ margin: 0 auto;
23
+ overflow: visible;
24
+ }
25
+ .datepicker-controls .selects-container {
26
+ display: flex;
27
+ overflow: visible;
28
+ }
29
+ .datepicker-controls .select-wrapper {
30
+ position: relative;
31
+ overflow: visible;
32
+ }
33
+ .datepicker-controls .select-wrapper input {
34
+ border-bottom: none;
35
+ text-align: center;
36
+ margin: 0;
37
+ cursor: pointer;
38
+ }
39
+ .datepicker-controls .select-wrapper input:focus {
40
+ border-bottom: none;
41
+ }
42
+ .datepicker-controls .select-wrapper .caret {
43
+ position: absolute;
44
+ right: 0;
45
+ top: 50%;
46
+ transform: translateY(-50%);
47
+ cursor: pointer;
48
+ width: 16px;
49
+ height: 16px;
50
+ fill: var(--mm-text-secondary, rgba(0, 0, 0, 0.54));
51
+ }
52
+ .datepicker-controls .select-wrapper .dropdown-content {
53
+ position: absolute;
54
+ top: 100%;
55
+ left: 0;
56
+ right: 0;
57
+ background-color: var(--mm-surface-color, white);
58
+ box-shadow: 0 4px 20px var(--mm-shadow-color, rgba(0, 0, 0, 0.3));
59
+ z-index: 20000;
60
+ border: 1px solid var(--mm-border-color, #ddd);
61
+ border-radius: 2px;
62
+ display: block;
63
+ opacity: 1;
64
+ }
65
+ .datepicker-controls .select-wrapper .dropdown-content .dropdown-item {
66
+ padding: 8px 16px;
67
+ cursor: pointer;
68
+ white-space: nowrap;
69
+ transition: background-color 0.2s;
70
+ }
71
+ .datepicker-controls .select-wrapper .dropdown-content .dropdown-item:hover {
72
+ background-color: var(--mm-border-color, #f5f5f5);
73
+ }
74
+ .datepicker-controls .select-wrapper .dropdown-content .dropdown-item.selected {
75
+ background-color: var(--mm-border-color, #f5f5f5);
76
+ }
77
+ .datepicker-controls .select-year input {
78
+ width: 50px;
79
+ }
80
+ .datepicker-controls .select-year .dropdown-content {
81
+ max-height: 60vh;
82
+ overflow-y: auto;
83
+ }
84
+ .datepicker-controls .select-month input {
85
+ width: 80px;
86
+ }
87
+ .datepicker-controls .select-month .dropdown-content {
88
+ width: auto;
89
+ min-width: 120px;
90
+ left: auto;
91
+ right: 0;
92
+ }
93
+
94
+ .month-prev, .month-next {
95
+ margin-top: 4px;
96
+ cursor: pointer;
97
+ background-color: transparent;
98
+ border: none;
99
+ }
100
+
101
+ /* Date Display */
102
+ .datepicker-date-display {
103
+ flex: 1 auto;
104
+ background-color: #26a69a;
105
+ color: #fff;
106
+ padding: 20px 22px;
107
+ font-weight: 500;
108
+ }
109
+ .datepicker-date-display .year-text {
110
+ display: block;
111
+ font-size: 1.5rem;
112
+ line-height: 25px;
113
+ color: rgba(255, 255, 255, 0.7);
114
+ }
115
+ .datepicker-date-display .date-text {
116
+ display: block;
117
+ font-size: 2.8rem;
118
+ line-height: 47px;
119
+ font-weight: 500;
120
+ }
121
+
122
+ /* Calendar */
123
+ .datepicker-calendar-container {
124
+ flex: 2.5 auto;
125
+ }
126
+
127
+ .datepicker-table {
128
+ width: 280px;
129
+ font-size: 1rem;
130
+ margin: 0 auto;
131
+ }
132
+ .datepicker-table.with-week-numbers {
133
+ width: 310px;
134
+ }
135
+ .datepicker-table thead {
136
+ border-bottom: none;
137
+ }
138
+ .datepicker-table th {
139
+ padding: 10px 5px;
140
+ text-align: center;
141
+ }
142
+ .datepicker-table th.datepicker-week-header {
143
+ color: var(--mm-text-hint, rgba(0, 0, 0, 0.38));
144
+ font-size: 0.8rem;
145
+ font-weight: 600;
146
+ width: 30px;
147
+ padding: 10px 2px;
148
+ }
149
+ .datepicker-table tr {
150
+ border: none;
151
+ }
152
+ .datepicker-table abbr {
153
+ text-decoration: none;
154
+ color: var(--mm-text-secondary, rgba(0, 0, 0, 0.54));
155
+ }
156
+ .datepicker-table td {
157
+ border-radius: 50%;
158
+ padding: 0;
159
+ }
160
+ .datepicker-table td.is-today {
161
+ color: var(--mm-primary-color, #26a69a);
162
+ }
163
+ .datepicker-table td.is-selected {
164
+ background-color: var(--mm-primary-color, #26a69a);
165
+ color: var(--mm-button-text, #fff);
166
+ }
167
+ .datepicker-table td.is-outside-current-month, .datepicker-table td.is-disabled {
168
+ color: var(--mm-text-disabled, rgba(0, 0, 0, 0.3));
169
+ pointer-events: none;
170
+ }
171
+ .datepicker-table td.datepicker-week-number {
172
+ color: var(--mm-text-hint, rgba(0, 0, 0, 0.38));
173
+ font-size: 0.8rem;
174
+ font-weight: 600;
175
+ text-align: center;
176
+ vertical-align: middle;
177
+ border-radius: 0;
178
+ width: 30px;
179
+ padding: 5px 2px;
180
+ background-color: var(--mm-border-color, rgba(0, 0, 0, 0.02));
181
+ border-right: 1px solid var(--mm-border-color, rgba(0, 0, 0, 0.05));
182
+ }
183
+
184
+ .datepicker-day-button {
185
+ background-color: transparent;
186
+ border: none;
187
+ line-height: 38px;
188
+ display: block;
189
+ width: 100%;
190
+ border-radius: 50%;
191
+ padding: 0 5px;
192
+ cursor: pointer;
193
+ color: inherit;
194
+ }
195
+
196
+ /* Footer */
197
+ .datepicker-footer {
198
+ width: 280px;
199
+ margin: 0 auto;
200
+ padding-bottom: 5px;
201
+ display: flex;
202
+ justify-content: space-between;
203
+ }
204
+
205
+ .datepicker-cancel,
206
+ .datepicker-clear,
207
+ .datepicker-today,
208
+ .datepicker-done {
209
+ color: #26a69a;
210
+ padding: 0 1rem;
211
+ }
212
+
213
+ .datepicker-clear {
214
+ color: #f44336;
215
+ }
216
+
217
+ /* Media Queries */
218
+ @media only screen and (min-width: 601px) {
219
+ .datepicker-modal {
220
+ max-width: 625px;
221
+ }
222
+ .datepicker-container.modal-content {
223
+ flex-direction: row;
224
+ }
225
+ .datepicker-date-display {
226
+ flex: 0 1 270px;
227
+ }
228
+ .datepicker-controls,
229
+ .datepicker-table,
230
+ .datepicker-footer {
231
+ width: 320px;
232
+ }
233
+ .datepicker-table.with-week-numbers {
234
+ width: 350px;
235
+ }
236
+ .datepicker-day-button {
237
+ line-height: 44px;
238
+ }
239
+ }
240
+ /* Enhanced TimePicker Styles */
241
+ .input-field.timepicker input[disabled] {
242
+ cursor: not-allowed;
243
+ }
244
+
245
+ .timepicker-actions {
246
+ display: flex;
247
+ gap: 8px;
248
+ margin-top: 4px;
249
+ font-size: 12px;
250
+ }
251
+ .timepicker-actions .btn-flat {
252
+ padding: 2px 8px;
253
+ min-width: auto;
254
+ height: 24px;
255
+ line-height: 20px;
256
+ font-size: 11px;
257
+ text-transform: none;
258
+ }
259
+ .timepicker-actions .btn-flat i.material-icons {
260
+ font-size: 14px;
261
+ margin-right: 4px;
262
+ }
263
+
264
+ .inline-time-controls {
265
+ display: flex;
266
+ align-items: center;
267
+ gap: 8px;
268
+ margin-top: 8px;
269
+ padding: 12px;
270
+ background-color: var(--mm-border-color, #f5f5f5);
271
+ border-radius: 4px;
272
+ font-size: 14px;
273
+ }
274
+ .inline-time-controls .time-controls-12h {
275
+ display: flex;
276
+ align-items: center;
277
+ gap: 4px;
278
+ }
279
+ .inline-time-controls .time-controls-12h input[type=number] {
280
+ width: 50px;
281
+ text-align: center;
282
+ padding: 4px;
283
+ border: 1px solid var(--mm-border-color, #ccc);
284
+ border-radius: 4px;
285
+ }
286
+ .inline-time-controls .time-controls-12h select {
287
+ padding: 4px;
288
+ border: 1px solid var(--mm-border-color, #ccc);
289
+ border-radius: 4px;
290
+ margin-left: 4px;
291
+ }
292
+ .inline-time-controls input[type=time] {
293
+ font-size: 16px;
294
+ padding: 4px 8px;
295
+ border: 1px solid var(--mm-border-color, #ccc);
296
+ border-radius: 4px;
297
+ min-width: 120px;
298
+ }
299
+ .inline-time-controls .btn-flat {
300
+ padding: 4px 8px;
301
+ font-size: 11px;
302
+ background-color: var(--mm-border-color, #e0e0e0);
303
+ border-radius: 4px;
304
+ min-width: auto;
305
+ }
306
+
307
+ /* Timepicker Containers */
308
+ .timepicker-modal {
309
+ max-width: 325px;
310
+ max-height: none;
311
+ }
312
+
313
+ .timepicker-container.modal-content {
314
+ display: flex;
315
+ flex-direction: column;
316
+ padding: 0;
317
+ }
318
+
319
+ .text-primary {
320
+ color: rgb(255, 255, 255);
321
+ }
322
+
323
+ /* Clock Digital Display */
324
+ .timepicker-digital-display {
325
+ flex: 1 auto;
326
+ background-color: #26a69a;
327
+ padding: 10px;
328
+ font-weight: 300;
329
+ }
330
+
331
+ .timepicker-text-container {
332
+ font-size: 4rem;
333
+ font-weight: bold;
334
+ text-align: center;
335
+ color: rgba(255, 255, 255, 0.6);
336
+ font-weight: 400;
337
+ position: relative;
338
+ user-select: none;
339
+ }
340
+
341
+ .timepicker-span-hours,
342
+ .timepicker-span-minutes,
343
+ .timepicker-span-am-pm div {
344
+ cursor: pointer;
345
+ }
346
+
347
+ .timepicker-span-hours {
348
+ margin-right: 3px;
349
+ }
350
+
351
+ .timepicker-span-minutes {
352
+ margin-left: 3px;
353
+ }
354
+
355
+ .timepicker-display-am-pm {
356
+ font-size: 1.3rem;
357
+ position: absolute;
358
+ right: 1rem;
359
+ bottom: 1rem;
360
+ font-weight: 400;
361
+ }
362
+
363
+ /* Analog Clock Display */
364
+ .timepicker-analog-display {
365
+ flex: 2.5 auto;
366
+ }
367
+
368
+ .timepicker-plate {
369
+ background-color: #eee;
370
+ border-radius: 50%;
371
+ width: 270px;
372
+ height: 270px;
373
+ overflow: visible;
374
+ position: relative;
375
+ margin: auto;
376
+ margin-top: 25px;
377
+ margin-bottom: 5px;
378
+ user-select: none;
379
+ }
380
+
381
+ .timepicker-canvas,
382
+ .timepicker-dial {
383
+ position: absolute;
384
+ left: 0;
385
+ right: 0;
386
+ top: 0;
387
+ bottom: 0;
388
+ }
389
+
390
+ .timepicker-minutes {
391
+ visibility: hidden;
392
+ }
393
+
394
+ .timepicker-tick {
395
+ border-radius: 50%;
396
+ color: rgba(0, 0, 0, 0.87);
397
+ line-height: 40px;
398
+ text-align: center;
399
+ width: 40px;
400
+ height: 40px;
401
+ position: absolute;
402
+ cursor: pointer;
403
+ font-size: 15px;
404
+ }
405
+
406
+ .timepicker-tick.active,
407
+ .timepicker-tick:hover {
408
+ background-color: rgba(38, 166, 154, 0.25);
409
+ }
410
+
411
+ .timepicker-dial {
412
+ transition: transform 350ms, opacity 350ms;
413
+ }
414
+
415
+ .timepicker-dial-out {
416
+ opacity: 0;
417
+ }
418
+ .timepicker-dial-out.timepicker-hours {
419
+ transform: scale(1.1, 1.1);
420
+ }
421
+ .timepicker-dial-out.timepicker-minutes {
422
+ transform: scale(0.8, 0.8);
423
+ }
424
+
425
+ .timepicker-canvas {
426
+ transition: opacity 175ms;
427
+ }
428
+ .timepicker-canvas line {
429
+ stroke: #26a69a;
430
+ stroke-width: 4;
431
+ stroke-linecap: round;
432
+ }
433
+
434
+ .timepicker-canvas-out {
435
+ opacity: 0.25;
436
+ }
437
+
438
+ .timepicker-canvas-bearing {
439
+ stroke: none;
440
+ fill: #26a69a;
441
+ }
442
+
443
+ .timepicker-canvas-bg {
444
+ stroke: none;
445
+ fill: #26a69a;
446
+ }
447
+
448
+ /* Footer */
449
+ .timepicker-footer {
450
+ margin: 0 auto;
451
+ padding: 5px 1rem;
452
+ display: flex;
453
+ justify-content: space-between;
454
+ }
455
+
456
+ .timepicker-clear {
457
+ color: #F44336;
458
+ }
459
+
460
+ .timepicker-close {
461
+ color: #26a69a;
462
+ }
463
+
464
+ .timepicker-clear,
465
+ .timepicker-close {
466
+ padding: 0 20px;
467
+ }
468
+
469
+ /* Media Queries */
470
+ @media only screen and (min-width : 601px) {
471
+ .timepicker-modal {
472
+ max-width: 600px;
473
+ }
474
+ .timepicker-container.modal-content {
475
+ flex-direction: row;
476
+ }
477
+ .timepicker-text-container {
478
+ top: 32%;
479
+ }
480
+ .timepicker-display-am-pm {
481
+ position: relative;
482
+ right: auto;
483
+ bottom: auto;
484
+ text-align: center;
485
+ margin-top: 1.2rem;
486
+ }
487
+ }
@@ -0,0 +1,76 @@
1
+ import { FactoryComponent, Attributes } from 'mithril';
2
+ export interface SidenavAttrs extends Attributes {
3
+ /** Unique ID for the sidenav */
4
+ id?: string;
5
+ /** Whether the sidenav is open */
6
+ isOpen?: boolean;
7
+ /** Callback when sidenav open state changes */
8
+ onToggle?: (isOpen: boolean) => void;
9
+ /** Position of the sidenav */
10
+ position?: 'left' | 'right';
11
+ /** Whether sidenav should overlay content or push it */
12
+ mode?: 'overlay' | 'push';
13
+ /** Width of the sidenav in pixels */
14
+ width?: number;
15
+ /** Custom class for the sidenav */
16
+ className?: string;
17
+ /** Whether to show backdrop overlay */
18
+ showBackdrop?: boolean;
19
+ /** Close sidenav when backdrop is clicked */
20
+ closeOnBackdropClick?: boolean;
21
+ /** Close sidenav when escape key is pressed */
22
+ closeOnEscape?: boolean;
23
+ /** Animation duration in milliseconds */
24
+ animationDuration?: number;
25
+ /** Fixed sidenav (always visible on larger screens) */
26
+ fixed?: boolean;
27
+ /** Breakpoint for responsive behavior (in pixels) */
28
+ breakpoint?: number;
29
+ }
30
+ export interface SidenavItemAttrs {
31
+ /** Text content of the item */
32
+ text?: string;
33
+ /** Icon name (material icons) */
34
+ icon?: string;
35
+ /** Whether this item is active */
36
+ active?: boolean;
37
+ /** Whether this item is disabled */
38
+ disabled?: boolean;
39
+ /** Click handler */
40
+ onclick?: (e: Event) => void;
41
+ /** Href for link items */
42
+ href?: string;
43
+ /** Custom class */
44
+ className?: string;
45
+ /** Whether this is a divider */
46
+ divider?: boolean;
47
+ /** Whether this is a subheader */
48
+ subheader?: boolean;
49
+ }
50
+ /**
51
+ * Sidenav Component
52
+ * A responsive navigation drawer that slides in from the side
53
+ */
54
+ export declare const Sidenav: FactoryComponent<SidenavAttrs>;
55
+ /**
56
+ * Sidenav Item Component
57
+ * Individual items for the sidenav menu
58
+ */
59
+ export declare const SidenavItem: FactoryComponent<SidenavItemAttrs>;
60
+ /**
61
+ * Sidenav utilities for programmatic control
62
+ */
63
+ export declare class SidenavManager {
64
+ /**
65
+ * Open a sidenav by ID
66
+ */
67
+ static open(id: string): void;
68
+ /**
69
+ * Close a sidenav by ID
70
+ */
71
+ static close(id: string): void;
72
+ /**
73
+ * Toggle a sidenav by ID
74
+ */
75
+ static toggle(id: string): void;
76
+ }
@@ -0,0 +1,49 @@
1
+ import { FactoryComponent } from 'mithril';
2
+ export type Theme = 'light' | 'dark' | 'auto';
3
+ export interface ThemeSwitcherAttrs {
4
+ /** Current theme selection */
5
+ theme?: Theme;
6
+ /** Callback when theme changes */
7
+ onThemeChange?: (theme: Theme) => void;
8
+ /** Show labels on the toggle buttons */
9
+ showLabels?: boolean;
10
+ /** Custom class for the container */
11
+ className?: string;
12
+ }
13
+ /**
14
+ * Theme switching utilities and component
15
+ */
16
+ export declare class ThemeManager {
17
+ private static currentTheme;
18
+ /**
19
+ * Set the theme for the entire application
20
+ */
21
+ static setTheme(theme: Theme): void;
22
+ /**
23
+ * Get the current theme
24
+ */
25
+ static getTheme(): Theme;
26
+ /**
27
+ * Get the effective theme (resolves 'auto' to actual theme)
28
+ */
29
+ static getEffectiveTheme(): 'light' | 'dark';
30
+ /**
31
+ * Initialize theme from localStorage or system preference
32
+ */
33
+ static initialize(): void;
34
+ /**
35
+ * Toggle between light and dark themes
36
+ */
37
+ static toggle(): void;
38
+ }
39
+ /**
40
+ * Theme Switcher Component
41
+ * Provides UI controls for changing themes
42
+ */
43
+ export declare const ThemeSwitcher: FactoryComponent<ThemeSwitcherAttrs>;
44
+ /**
45
+ * Simple theme toggle button (just switches between light/dark)
46
+ */
47
+ export declare const ThemeToggle: FactoryComponent<{
48
+ className?: string;
49
+ }>;