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,353 @@
1
+ /* TreeView Component Styles */
2
+
3
+ // CSS Custom Properties for theming
4
+ :root {
5
+ --tree-node-height: 36px;
6
+ --tree-indent-size: 24px;
7
+ --tree-connector-width: 1px;
8
+ --tree-expand-icon-size: 20px;
9
+
10
+ // Light theme colors
11
+ --tree-bg-color: #ffffff;
12
+ --tree-text-color: #212121;
13
+ --tree-text-color-secondary: #757575;
14
+ --tree-border-color: #e0e0e0;
15
+ --tree-connector-color: #bdbdbd;
16
+ --tree-hover-bg: #f5f5f5;
17
+ --tree-selected-bg: #e3f2fd;
18
+ --tree-selected-color: #1976d2;
19
+ --tree-focused-outline: #2196f3;
20
+ --tree-disabled-color: #9e9e9e;
21
+ --tree-disabled-bg: #fafafa;
22
+ }
23
+
24
+ // Dark theme
25
+ [data-theme="dark"],
26
+ .dark-theme,
27
+ body.dark {
28
+ --tree-bg-color: #1e1e1e;
29
+ --tree-text-color: #e0e0e0;
30
+ --tree-text-color-secondary: #a0a0a0;
31
+ --tree-border-color: #333333;
32
+ --tree-connector-color: #555555;
33
+ --tree-hover-bg: #2d2d2d;
34
+ --tree-selected-bg: #282a45;
35
+ --tree-selected-color: #90caf9;
36
+ --tree-focused-outline: #64b5f6;
37
+ --tree-disabled-color: #616161;
38
+ --tree-disabled-bg: #2d2d2d;
39
+ }
40
+
41
+ .tree-view {
42
+ background-color: var(--tree-bg-color);
43
+ color: var(--tree-text-color);
44
+ border: 1px solid var(--tree-border-color);
45
+ border-radius: 4px;
46
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
47
+ font-size: 14px;
48
+ line-height: 1.5;
49
+
50
+ .tree-root {
51
+ list-style: none;
52
+ margin: 0;
53
+ padding: 0;
54
+ }
55
+
56
+ .tree-node {
57
+ list-style: none;
58
+ position: relative;
59
+ margin: 0;
60
+ padding: 0;
61
+
62
+ &.disabled {
63
+ opacity: 0.6;
64
+ cursor: not-allowed;
65
+
66
+ .tree-node-content {
67
+ pointer-events: none;
68
+ color: var(--tree-disabled-color);
69
+ background-color: var(--tree-disabled-bg);
70
+ }
71
+ }
72
+ }
73
+
74
+ .tree-node-content {
75
+ display: flex;
76
+ align-items: center;
77
+ min-height: var(--tree-node-height);
78
+ padding: 4px 8px;
79
+ cursor: pointer;
80
+ position: relative;
81
+ transition: all 0.2s ease;
82
+ user-select: none;
83
+
84
+ &:hover:not(:disabled) {
85
+ background-color: var(--tree-hover-bg);
86
+ }
87
+ }
88
+
89
+ // Selected state
90
+ .tree-node.selected .tree-node-content {
91
+ background-color: var(--tree-selected-bg);
92
+ color: var(--tree-selected-color);
93
+ font-weight: 500;
94
+ }
95
+
96
+ // Focused state
97
+ .tree-node.focused .tree-node-content {
98
+ background-color: var(--tree-hover-bg);
99
+ border-right: 1px solid var(--tree-focused-outline);
100
+ }
101
+
102
+ .tree-node.selected.focused .tree-node-content {
103
+ background-color: var(--tree-selected-bg);
104
+ }
105
+
106
+ // VSCode-style connector lines (can be toggled via showConnectors prop)
107
+ &.show-connectors {
108
+ .tree-connectors {
109
+ position: absolute;
110
+ top: 0;
111
+ left: 0;
112
+ width: 100%;
113
+ height: 100%;
114
+ pointer-events: none;
115
+ z-index: 0;
116
+ }
117
+
118
+ .tree-connector {
119
+ position: absolute;
120
+ top: 0;
121
+ height: 100%;
122
+ width: var(--tree-connector-width);
123
+ background-color: var(--tree-connector-color);
124
+
125
+ // Horizontal connector to the node
126
+ &::after {
127
+ content: '';
128
+ position: absolute;
129
+ top: calc(var(--tree-node-height) / 2);
130
+ left: 0;
131
+ width: 12px;
132
+ height: var(--tree-connector-width);
133
+ background-color: var(--tree-connector-color);
134
+ }
135
+ }
136
+
137
+ // For the last child at the deepest level only, show half the vertical line
138
+ // But only if there are no more siblings at any parent level
139
+ .tree-node:last-child .tree-node-content .tree-connector:last-child {
140
+ height: calc(var(--tree-node-height) / 2 + 2px);
141
+ }
142
+
143
+ // Override for nodes that have siblings at parent levels - keep full height
144
+ .tree-node:not(.tree-last-in-branch) .tree-node-content .tree-connector {
145
+ height: 100% !important;
146
+ }
147
+ }
148
+
149
+ // Expand/collapse icon
150
+ .tree-expand-icon {
151
+ display: flex;
152
+ align-items: center;
153
+ justify-content: center;
154
+ width: var(--tree-expand-icon-size);
155
+ height: var(--tree-expand-icon-size);
156
+ margin-right: 8px;
157
+ margin-left: 2px;
158
+ cursor: pointer;
159
+ border-radius: 3px;
160
+ transition: all 0.2s ease;
161
+ flex-shrink: 0;
162
+
163
+ &:hover {
164
+ background-color: var(--tree-hover-bg);
165
+ }
166
+
167
+ // Plus/minus style
168
+ &.plus-minus {
169
+ .tree-plus-minus {
170
+ display: flex;
171
+ align-items: center;
172
+ justify-content: center;
173
+ width: 16px;
174
+ height: 16px;
175
+ border: 1px solid var(--tree-connector-color);
176
+ border-radius: 2px;
177
+ background-color: var(--tree-bg-color);
178
+ font-size: 12px;
179
+ font-weight: bold;
180
+ line-height: 1;
181
+ transition: all 0.2s ease;
182
+ }
183
+ }
184
+
185
+ // Triangle style
186
+ &.triangle {
187
+ .tree-triangle {
188
+ font-size: 10px;
189
+ transition: transform 0.2s ease;
190
+ color: var(--tree-text-color-secondary);
191
+
192
+ &.expanded {
193
+ transform: rotate(90deg);
194
+ }
195
+ }
196
+ }
197
+
198
+ // Caret/chevron style
199
+ .tree-caret-icon,
200
+ .tree-chevron-icon {
201
+ transition: transform 0.2s ease;
202
+ }
203
+ }
204
+
205
+ // Spacer for nodes without children to maintain alignment
206
+ .tree-expand-spacer {
207
+ width: var(--tree-expand-icon-size);
208
+ height: var(--tree-expand-icon-size);
209
+ margin-right: 8px;
210
+ margin-left: 2px;
211
+ flex-shrink: 0;
212
+ }
213
+
214
+ // Selection indicator (checkbox for multiple selection)
215
+ .tree-selection-indicator {
216
+ margin-right: 8px;
217
+ flex-shrink: 0;
218
+
219
+ input[type="checkbox"] {
220
+ width: 16px;
221
+ height: 16px;
222
+ margin: 0;
223
+ cursor: pointer;
224
+ accent-color: var(--tree-selected-color);
225
+ }
226
+ }
227
+
228
+ // Node icon
229
+ .tree-node-icon {
230
+ margin-right: 8px;
231
+ font-size: 18px;
232
+ color: var(--tree-text-color-secondary);
233
+ flex-shrink: 0;
234
+ }
235
+
236
+ // Node label
237
+ .tree-node-label {
238
+ flex: 1;
239
+ overflow: hidden;
240
+ text-overflow: ellipsis;
241
+ white-space: nowrap;
242
+ }
243
+
244
+ // Children container
245
+ .tree-children {
246
+ list-style: none;
247
+ margin: 0;
248
+ padding: 0;
249
+ overflow: hidden;
250
+ transition: all 0.3s ease;
251
+
252
+ // Animation states
253
+ &.tree-collapsing {
254
+ max-height: 0;
255
+ opacity: 0;
256
+ }
257
+
258
+ &.tree-expanding {
259
+ max-height: 1000px; // Large enough value for content
260
+ opacity: 1;
261
+ }
262
+ }
263
+ }
264
+
265
+ // Smooth expand/collapse animations
266
+ .tree-node {
267
+ .tree-children {
268
+ animation-duration: 0.3s;
269
+ animation-fill-mode: both;
270
+ animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
271
+ }
272
+ }
273
+
274
+ // Animation keyframes
275
+ @keyframes tree-expand {
276
+ from {
277
+ max-height: 0;
278
+ opacity: 0;
279
+ }
280
+ to {
281
+ max-height: 1000px;
282
+ opacity: 1;
283
+ }
284
+ }
285
+
286
+ @keyframes tree-collapse {
287
+ from {
288
+ max-height: 1000px;
289
+ opacity: 1;
290
+ }
291
+ to {
292
+ max-height: 0;
293
+ opacity: 0;
294
+ }
295
+ }
296
+
297
+ // Responsive adjustments
298
+ @media (max-width: 768px) {
299
+ .tree-view {
300
+ --tree-node-height: 40px;
301
+ --tree-indent-size: 20px;
302
+
303
+ .tree-node-content {
304
+ padding: 0 12px;
305
+ }
306
+ }
307
+ }
308
+
309
+ // High contrast mode support
310
+ @media (prefers-contrast: high) {
311
+ .tree-view {
312
+ --tree-border-color: #000000;
313
+ --tree-connector-color: #000000;
314
+ --tree-focused-outline: #0066cc;
315
+
316
+ .tree-node-content:focus {
317
+ outline-width: 3px;
318
+ }
319
+ }
320
+ }
321
+
322
+ // Reduced motion support
323
+ @media (prefers-reduced-motion: reduce) {
324
+ .tree-view {
325
+ .tree-children,
326
+ .tree-expand-icon .tree-triangle,
327
+ .tree-expand-icon .tree-caret-icon,
328
+ .tree-expand-icon .tree-plus-minus,
329
+ .tree-node-content {
330
+ transition: none;
331
+ animation: none;
332
+ }
333
+ }
334
+ }
335
+
336
+ // Print styles
337
+ @media print {
338
+ .tree-view {
339
+ --tree-bg-color: white;
340
+ --tree-text-color: black;
341
+ --tree-border-color: black;
342
+
343
+ .tree-expand-icon {
344
+ display: none;
345
+ }
346
+
347
+ .tree-children {
348
+ display: block !important;
349
+ opacity: 1 !important;
350
+ max-height: none !important;
351
+ }
352
+ }
353
+ }
@@ -5,7 +5,7 @@
5
5
  @use "switches";
6
6
  @use "select";
7
7
  @use "file-input";
8
- @use "range";
8
+ @use "range"; // Standard HTML5 range input styles
9
9
  @use "form-groups";
10
10
 
11
11
  // Remove Focus Boxes