mtrl-addons 0.2.1 → 0.2.3
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/{src/components/index.ts → dist/components/index.d.ts} +0 -2
- package/dist/components/vlist/config.d.ts +86 -0
- package/{src/components/vlist/constants.ts → dist/components/vlist/constants.d.ts} +10 -11
- package/dist/components/vlist/features/api.d.ts +7 -0
- package/{src/components/vlist/features/index.ts → dist/components/vlist/features/index.d.ts} +0 -2
- package/dist/components/vlist/features/selection.d.ts +6 -0
- package/dist/components/vlist/features/viewport.d.ts +9 -0
- package/dist/components/vlist/features.d.ts +31 -0
- package/{src/components/vlist/index.ts → dist/components/vlist/index.d.ts} +1 -9
- package/dist/components/vlist/types.d.ts +596 -0
- package/dist/components/vlist/vlist.d.ts +29 -0
- package/dist/core/compose/features/gestures/index.d.ts +86 -0
- package/dist/core/compose/features/gestures/longpress.d.ts +85 -0
- package/dist/core/compose/features/gestures/pan.d.ts +108 -0
- package/dist/core/compose/features/gestures/pinch.d.ts +111 -0
- package/dist/core/compose/features/gestures/rotate.d.ts +111 -0
- package/dist/core/compose/features/gestures/swipe.d.ts +149 -0
- package/dist/core/compose/features/gestures/tap.d.ts +79 -0
- package/{src/core/compose/features/index.ts → dist/core/compose/features/index.d.ts} +1 -2
- package/{src/core/compose/index.ts → dist/core/compose/index.d.ts} +2 -11
- package/{src/core/gestures/index.ts → dist/core/gestures/index.d.ts} +1 -20
- package/dist/core/gestures/longpress.d.ts +23 -0
- package/dist/core/gestures/manager.d.ts +14 -0
- package/dist/core/gestures/pan.d.ts +12 -0
- package/dist/core/gestures/pinch.d.ts +14 -0
- package/dist/core/gestures/rotate.d.ts +14 -0
- package/dist/core/gestures/swipe.d.ts +20 -0
- package/dist/core/gestures/tap.d.ts +12 -0
- package/dist/core/gestures/types.d.ts +320 -0
- package/dist/core/gestures/utils.d.ts +57 -0
- package/dist/core/index.d.ts +13 -0
- package/dist/core/layout/config.d.ts +33 -0
- package/dist/core/layout/index.d.ts +51 -0
- package/dist/core/layout/jsx.d.ts +65 -0
- package/dist/core/layout/schema.d.ts +112 -0
- package/dist/core/layout/types.d.ts +69 -0
- package/dist/core/viewport/constants.d.ts +105 -0
- package/dist/core/viewport/features/base.d.ts +14 -0
- package/dist/core/viewport/features/collection.d.ts +41 -0
- package/dist/core/viewport/features/events.d.ts +13 -0
- package/{src/core/viewport/features/index.ts → dist/core/viewport/features/index.d.ts} +0 -7
- package/dist/core/viewport/features/item-size.d.ts +30 -0
- package/dist/core/viewport/features/loading.d.ts +34 -0
- package/dist/core/viewport/features/momentum.d.ts +17 -0
- package/dist/core/viewport/features/performance.d.ts +53 -0
- package/dist/core/viewport/features/placeholders.d.ts +38 -0
- package/dist/core/viewport/features/rendering.d.ts +16 -0
- package/dist/core/viewport/features/scrollbar.d.ts +26 -0
- package/dist/core/viewport/features/scrolling.d.ts +16 -0
- package/dist/core/viewport/features/utils.d.ts +43 -0
- package/dist/core/viewport/features/virtual.d.ts +18 -0
- package/{src/core/viewport/index.ts → dist/core/viewport/index.d.ts} +1 -17
- package/dist/core/viewport/types.d.ts +96 -0
- package/dist/core/viewport/utils/speed-tracker.d.ts +22 -0
- package/dist/core/viewport/viewport.d.ts +11 -0
- package/{src/index.ts → dist/index.d.ts} +0 -4
- package/dist/index.js +5143 -0
- package/dist/index.mjs +5111 -0
- package/dist/styles.css +254 -0
- package/dist/styles.css.map +1 -0
- package/package.json +6 -1
- package/src/styles/components/_vlist.scss +234 -213
- package/.cursorrules +0 -117
- package/AI.md +0 -241
- package/build.js +0 -201
- package/scripts/analyze-orphaned-functions.ts +0 -387
- package/scripts/debug/vlist-selection.ts +0 -121
- package/src/components/vlist/config.ts +0 -323
- package/src/components/vlist/features/api.ts +0 -322
- package/src/components/vlist/features/selection.ts +0 -444
- package/src/components/vlist/features/viewport.ts +0 -65
- package/src/components/vlist/features.ts +0 -112
- package/src/components/vlist/types.ts +0 -591
- package/src/components/vlist/vlist.ts +0 -92
- package/src/core/compose/features/gestures/index.ts +0 -227
- package/src/core/compose/features/gestures/longpress.ts +0 -383
- package/src/core/compose/features/gestures/pan.ts +0 -424
- package/src/core/compose/features/gestures/pinch.ts +0 -475
- package/src/core/compose/features/gestures/rotate.ts +0 -485
- package/src/core/compose/features/gestures/swipe.ts +0 -492
- package/src/core/compose/features/gestures/tap.ts +0 -334
- package/src/core/gestures/longpress.ts +0 -68
- package/src/core/gestures/manager.ts +0 -418
- package/src/core/gestures/pan.ts +0 -48
- package/src/core/gestures/pinch.ts +0 -58
- package/src/core/gestures/rotate.ts +0 -58
- package/src/core/gestures/swipe.ts +0 -66
- package/src/core/gestures/tap.ts +0 -45
- package/src/core/gestures/types.ts +0 -387
- package/src/core/gestures/utils.ts +0 -128
- package/src/core/index.ts +0 -43
- package/src/core/layout/config.ts +0 -102
- package/src/core/layout/index.ts +0 -168
- package/src/core/layout/jsx.ts +0 -174
- package/src/core/layout/schema.ts +0 -1001
- package/src/core/layout/types.ts +0 -95
- package/src/core/viewport/constants.ts +0 -140
- package/src/core/viewport/features/base.ts +0 -73
- package/src/core/viewport/features/collection.ts +0 -882
- package/src/core/viewport/features/events.ts +0 -130
- package/src/core/viewport/features/item-size.ts +0 -271
- package/src/core/viewport/features/loading.ts +0 -263
- package/src/core/viewport/features/momentum.ts +0 -260
- package/src/core/viewport/features/performance.ts +0 -161
- package/src/core/viewport/features/placeholders.ts +0 -335
- package/src/core/viewport/features/rendering.ts +0 -568
- package/src/core/viewport/features/scrollbar.ts +0 -434
- package/src/core/viewport/features/scrolling.ts +0 -618
- package/src/core/viewport/features/utils.ts +0 -88
- package/src/core/viewport/features/virtual.ts +0 -384
- package/src/core/viewport/types.ts +0 -133
- package/src/core/viewport/utils/speed-tracker.ts +0 -79
- package/src/core/viewport/viewport.ts +0 -246
- package/test/benchmarks/layout/advanced.test.ts +0 -656
- package/test/benchmarks/layout/comparison.test.ts +0 -519
- package/test/benchmarks/layout/performance-comparison.test.ts +0 -274
- package/test/benchmarks/layout/real-components.test.ts +0 -733
- package/test/benchmarks/layout/simple.test.ts +0 -321
- package/test/benchmarks/layout/stress.test.ts +0 -990
- package/test/collection/basic.test.ts +0 -304
- package/test/components/vlist-selection.test.ts +0 -240
- package/test/components/vlist.test.ts +0 -63
- package/test/core/collection/adapter.test.ts +0 -161
- package/test/core/collection/collection.test.ts +0 -394
- package/test/core/layout/layout.test.ts +0 -201
- package/test/utils/dom-helpers.ts +0 -275
- package/test/utils/performance-helpers.ts +0 -392
- package/tsconfig.json +0 -20
|
@@ -29,22 +29,33 @@ $opacity-transition: opacity $transition-duration $transition-easing;
|
|
|
29
29
|
// ===========================
|
|
30
30
|
|
|
31
31
|
@keyframes placeholder-pulse {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
32
|
+
0%,
|
|
33
|
+
100% {
|
|
34
|
+
opacity: 0.6;
|
|
35
|
+
}
|
|
36
|
+
50% {
|
|
37
|
+
opacity: 0.4;
|
|
38
|
+
}
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
@keyframes fade-in {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
from {
|
|
43
|
+
opacity: 0.6;
|
|
44
|
+
}
|
|
45
|
+
to {
|
|
46
|
+
opacity: 1;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@keyframes item-updated {
|
|
51
|
+
0% {
|
|
52
|
+
background-color: t.alpha("primary", 0.25);
|
|
53
|
+
box-shadow: inset 0 0 0 2px t.alpha("primary", 0.4);
|
|
54
|
+
}
|
|
55
|
+
100% {
|
|
56
|
+
background-color: transparent;
|
|
57
|
+
box-shadow: inset 0 0 0 2px transparent;
|
|
58
|
+
}
|
|
48
59
|
}
|
|
49
60
|
|
|
50
61
|
// ===========================
|
|
@@ -52,58 +63,58 @@ $opacity-transition: opacity $transition-duration $transition-easing;
|
|
|
52
63
|
// ===========================
|
|
53
64
|
|
|
54
65
|
.#{$component} {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
66
|
+
position: relative;
|
|
67
|
+
width: 100%;
|
|
68
|
+
height: 100%;
|
|
69
|
+
min-height: 100px;
|
|
70
|
+
background-color: t.color("surface");
|
|
71
|
+
border: 2px solid var(--mtrl-sys-color-outline-variant);
|
|
72
|
+
border-radius: 3px;
|
|
73
|
+
transition: $bg-transition;
|
|
74
|
+
|
|
75
|
+
// Performance optimizations
|
|
76
|
+
contain: layout style paint;
|
|
77
|
+
transform: translateZ(0);
|
|
78
|
+
backface-visibility: hidden;
|
|
79
|
+
|
|
80
|
+
// Selection mode
|
|
81
|
+
&--selection {
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
.#{$viewport-item}:hover {
|
|
84
|
+
background-color: t.alpha("on-surface-variant", 0.1);
|
|
85
|
+
}
|
|
86
|
+
// Selected state
|
|
87
|
+
.#{$viewport-item}--selected,
|
|
88
|
+
.#{$viewport-item}--selected:hover {
|
|
89
|
+
background-color: t.color("secondary-container");
|
|
90
|
+
color: t.color("on-secondary-container");
|
|
91
|
+
transition: $bg-transition, $color-transition;
|
|
92
|
+
|
|
93
|
+
// // Update state layer color for selected state
|
|
94
|
+
// &::before {
|
|
95
|
+
// background-color: t.color("on-secondary-container");
|
|
96
|
+
// }
|
|
97
|
+
|
|
98
|
+
// Update text and icon colors for selected state
|
|
99
|
+
.#{$component}-item {
|
|
100
|
+
&-leading,
|
|
101
|
+
&-trailing,
|
|
102
|
+
&-supporting,
|
|
103
|
+
&-overline,
|
|
104
|
+
&-meta {
|
|
105
|
+
color: t.color("on-secondary-container");
|
|
106
|
+
transition: $color-transition;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
96
109
|
}
|
|
97
|
-
}
|
|
98
110
|
}
|
|
99
|
-
}
|
|
100
111
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
// Disabled state
|
|
113
|
+
&--disabled {
|
|
114
|
+
pointer-events: none;
|
|
115
|
+
opacity: 0.38;
|
|
116
|
+
transition: $opacity-transition;
|
|
117
|
+
}
|
|
107
118
|
}
|
|
108
119
|
|
|
109
120
|
// ===========================
|
|
@@ -111,86 +122,96 @@ $opacity-transition: opacity $transition-duration $transition-easing;
|
|
|
111
122
|
// ===========================
|
|
112
123
|
|
|
113
124
|
.#{$viewport} {
|
|
114
|
-
position: relative;
|
|
115
|
-
width: 100%;
|
|
116
|
-
height: 100%;
|
|
117
|
-
overflow: hidden;
|
|
118
|
-
|
|
119
|
-
// Items container
|
|
120
|
-
&-items {
|
|
121
125
|
position: relative;
|
|
122
126
|
width: 100%;
|
|
123
127
|
height: 100%;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
128
|
+
overflow: hidden;
|
|
129
|
+
|
|
130
|
+
// Items container
|
|
131
|
+
&-items {
|
|
132
|
+
position: relative;
|
|
133
|
+
width: 100%;
|
|
134
|
+
height: 100%;
|
|
135
|
+
padding: 8px 0;
|
|
136
|
+
will-change: transform;
|
|
137
|
+
}
|
|
127
138
|
}
|
|
128
139
|
|
|
129
140
|
.#{$viewport-item} {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
user-select: none;
|
|
142
|
+
opacity: 1;
|
|
143
|
+
transition: $opacity-transition;
|
|
144
|
+
will-change: transform;
|
|
145
|
+
// Apply fade-in animation to items that replace placeholders
|
|
146
|
+
&--replaced {
|
|
147
|
+
animation: fade-in 0.3s ease-out;
|
|
148
|
+
}
|
|
149
|
+
// Apply highlight animation when item is updated
|
|
150
|
+
&--updated,
|
|
151
|
+
&--updated > * {
|
|
152
|
+
animation: item-updated 0.6s ease-out;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// Inner item update animation (applied to template's root element)
|
|
156
|
+
.item--updated {
|
|
157
|
+
animation: item-updated 0.6s ease-out;
|
|
158
|
+
}
|
|
138
159
|
}
|
|
139
160
|
|
|
140
161
|
.#{$viewport-item} {
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
162
|
+
padding: 11px 12px;
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: start;
|
|
165
|
+
transition: background-color 0.2s ease;
|
|
166
|
+
// align-items: center;
|
|
167
|
+
min-height: 48px;
|
|
168
|
+
left: 0;
|
|
169
|
+
right: 0;
|
|
170
|
+
width: 100%;
|
|
171
|
+
will-change: transform;
|
|
172
|
+
contain: layout style;
|
|
173
|
+
gap: 16px;
|
|
174
|
+
color: var(--mtrl-sys-color-on-surface);
|
|
175
|
+
overflow: hidden;
|
|
155
176
|
}
|
|
156
177
|
|
|
157
178
|
.#{$viewport-item}__avatar,
|
|
158
179
|
.#{$viewport-item}__image {
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
180
|
+
width: 40px;
|
|
181
|
+
height: 40px;
|
|
182
|
+
margin-top: 4px;
|
|
183
|
+
border-radius: 50%;
|
|
184
|
+
background-color: var(--mtrl-sys-color-primary-container);
|
|
185
|
+
color: white;
|
|
186
|
+
display: flex;
|
|
187
|
+
align-items: center;
|
|
188
|
+
justify-content: center;
|
|
189
|
+
font-weight: bold;
|
|
190
|
+
flex-shrink: 0;
|
|
170
191
|
}
|
|
171
192
|
|
|
172
193
|
.#{$viewport-item}__details {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
194
|
+
flex: 1;
|
|
195
|
+
min-width: 0;
|
|
196
|
+
margin-left: 12px;
|
|
176
197
|
}
|
|
177
198
|
|
|
178
199
|
.#{$viewport-item}__headline {
|
|
179
|
-
|
|
200
|
+
font-weight: 500;
|
|
180
201
|
}
|
|
181
202
|
|
|
182
203
|
.#{$viewport-item}__text {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
204
|
+
// color: #666;
|
|
205
|
+
font-size: 14px;
|
|
206
|
+
white-space: nowrap;
|
|
207
|
+
overflow: hidden;
|
|
208
|
+
text-overflow: ellipsis;
|
|
188
209
|
}
|
|
189
210
|
|
|
190
211
|
.#{$viewport-item}__meta {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
212
|
+
color: var(--mtrl-sys-color-on-surface-variant);
|
|
213
|
+
font-size: 12px;
|
|
214
|
+
margin-top: 2px;
|
|
194
215
|
}
|
|
195
216
|
|
|
196
217
|
// ===========================
|
|
@@ -198,48 +219,48 @@ $opacity-transition: opacity $transition-duration $transition-easing;
|
|
|
198
219
|
// ===========================
|
|
199
220
|
|
|
200
221
|
.#{$viewport-item}--placeholder {
|
|
201
|
-
|
|
202
|
-
|
|
222
|
+
opacity: 0.6; // Match the animation start/end opacity
|
|
223
|
+
animation: placeholder-pulse 2s ease-in-out infinite;
|
|
224
|
+
|
|
225
|
+
// Placeholder content blocks - style any text elements within
|
|
226
|
+
.#{$viewport-item}__headline,
|
|
227
|
+
.#{$viewport-item}__text,
|
|
228
|
+
.#{$viewport-item}__meta {
|
|
229
|
+
position: relative;
|
|
230
|
+
display: inline-block;
|
|
231
|
+
font-size: 0.8em;
|
|
232
|
+
color: transparent;
|
|
233
|
+
background-color: var(--mtrl-sys-color-on-surface);
|
|
234
|
+
border-radius: 0.1em;
|
|
235
|
+
opacity: 0.4;
|
|
236
|
+
text-decoration: none;
|
|
237
|
+
line-height: 1;
|
|
238
|
+
padding: 0 0 0.05em;
|
|
239
|
+
vertical-align: middle;
|
|
240
|
+
}
|
|
203
241
|
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
.#{$viewport-item}__meta {
|
|
228
|
-
font-size: 10px;
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
// User-specific placeholder elements
|
|
232
|
-
.#{$viewport-item}__user-headline,
|
|
233
|
-
.#{$viewport-item}__user-text {
|
|
234
|
-
text-transform: capitalize;
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// Avatar placeholder
|
|
238
|
-
.#{$viewport-item}__avatar {
|
|
239
|
-
background-color: var(--mtrl-sys-color-primary-container);
|
|
240
|
-
color: var(--mtrl-sys-color-primary-container);
|
|
241
|
-
opacity: 1;
|
|
242
|
-
}
|
|
242
|
+
// Layout adjustments
|
|
243
|
+
.#{$viewport-item}__text,
|
|
244
|
+
.#{$viewport-item}__meta {
|
|
245
|
+
margin-top: 0.2em;
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
.#{$viewport-item}__meta {
|
|
249
|
+
font-size: 10px;
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
// User-specific placeholder elements
|
|
253
|
+
.#{$viewport-item}__user-headline,
|
|
254
|
+
.#{$viewport-item}__user-text {
|
|
255
|
+
text-transform: capitalize;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Avatar placeholder
|
|
259
|
+
.#{$viewport-item}__avatar {
|
|
260
|
+
background-color: var(--mtrl-sys-color-primary-container);
|
|
261
|
+
color: var(--mtrl-sys-color-primary-container);
|
|
262
|
+
opacity: 1;
|
|
263
|
+
}
|
|
243
264
|
}
|
|
244
265
|
|
|
245
266
|
// ===========================
|
|
@@ -247,51 +268,51 @@ $opacity-transition: opacity $transition-duration $transition-easing;
|
|
|
247
268
|
// ===========================
|
|
248
269
|
|
|
249
270
|
.#{$viewport}__scrollbar {
|
|
250
|
-
position: absolute;
|
|
251
|
-
top: 0;
|
|
252
|
-
right: 0;
|
|
253
|
-
width: 8px;
|
|
254
|
-
height: 100%;
|
|
255
|
-
padding: 0;
|
|
256
|
-
opacity: 0;
|
|
257
|
-
transition: opacity 0.3s ease;
|
|
258
|
-
cursor: pointer;
|
|
259
|
-
z-index: 10;
|
|
260
|
-
|
|
261
|
-
// Visibility states
|
|
262
|
-
&--visible,
|
|
263
|
-
&--dragging,
|
|
264
|
-
&:hover {
|
|
265
|
-
opacity: 1;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
&:hover {
|
|
269
|
-
background: rgba(0, 0, 0, 0.05);
|
|
270
|
-
}
|
|
271
|
-
|
|
272
|
-
// Scrollbar thumb
|
|
273
|
-
&-thumb {
|
|
274
271
|
position: absolute;
|
|
275
272
|
top: 0;
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
273
|
+
right: 0;
|
|
274
|
+
width: 8px;
|
|
275
|
+
height: 100%;
|
|
276
|
+
padding: 0;
|
|
277
|
+
opacity: 0;
|
|
278
|
+
transition: opacity 0.3s ease;
|
|
279
|
+
cursor: pointer;
|
|
280
|
+
z-index: 10;
|
|
281
|
+
|
|
282
|
+
// Visibility states
|
|
283
|
+
&--visible,
|
|
284
|
+
&--dragging,
|
|
285
|
+
&:hover {
|
|
286
|
+
opacity: 1;
|
|
287
|
+
}
|
|
283
288
|
|
|
284
289
|
&:hover {
|
|
285
|
-
|
|
290
|
+
background: rgba(0, 0, 0, 0.05);
|
|
286
291
|
}
|
|
287
292
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
+
// Scrollbar thumb
|
|
294
|
+
&-thumb {
|
|
295
|
+
position: absolute;
|
|
296
|
+
top: 0;
|
|
297
|
+
width: 6px;
|
|
298
|
+
padding: 1px;
|
|
299
|
+
background: rgba(0, 0, 0, 0.3);
|
|
300
|
+
border-radius: 4px;
|
|
301
|
+
will-change: transform;
|
|
302
|
+
cursor: grab;
|
|
303
|
+
transition: background 0.2s ease;
|
|
304
|
+
|
|
305
|
+
&:hover {
|
|
306
|
+
background: rgba(0, 0, 0, 0.5);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
&:active,
|
|
310
|
+
&--dragging {
|
|
311
|
+
cursor: grabbing;
|
|
312
|
+
background: rgba(0, 0, 0, 0.6);
|
|
313
|
+
transition: none;
|
|
314
|
+
}
|
|
293
315
|
}
|
|
294
|
-
}
|
|
295
316
|
}
|
|
296
317
|
|
|
297
318
|
// ===========================
|
|
@@ -299,22 +320,22 @@ $opacity-transition: opacity $transition-duration $transition-easing;
|
|
|
299
320
|
// ===========================
|
|
300
321
|
|
|
301
322
|
@media (prefers-color-scheme: dark) {
|
|
302
|
-
|
|
303
|
-
|
|
323
|
+
.#{$viewport}__scrollbar {
|
|
324
|
+
background: transparent;
|
|
304
325
|
|
|
305
|
-
|
|
306
|
-
|
|
326
|
+
&-thumb {
|
|
327
|
+
background: rgba(255, 255, 255, 0.4);
|
|
307
328
|
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
329
|
+
&:hover {
|
|
330
|
+
background: rgba(255, 255, 255, 0.6);
|
|
331
|
+
}
|
|
311
332
|
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
333
|
+
&:active,
|
|
334
|
+
&--dragging {
|
|
335
|
+
background: rgba(255, 255, 255, 0.4);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
316
338
|
}
|
|
317
|
-
}
|
|
318
339
|
}
|
|
319
340
|
|
|
320
341
|
// ===========================
|
|
@@ -323,9 +344,9 @@ $opacity-transition: opacity $transition-duration $transition-easing;
|
|
|
323
344
|
|
|
324
345
|
// High-density displays
|
|
325
346
|
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
347
|
+
.#{$viewport-item} {
|
|
348
|
+
text-rendering: optimizeLegibility;
|
|
349
|
+
-webkit-font-smoothing: antialiased;
|
|
350
|
+
-moz-osx-font-smoothing: grayscale;
|
|
351
|
+
}
|
|
331
352
|
}
|
package/.cursorrules
DELETED
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
# mtrl-addons Package Development Rules
|
|
2
|
-
|
|
3
|
-
## Package Overview
|
|
4
|
-
|
|
5
|
-
mtrl-addons is an extension library for the mtrl Material Design 3 component system, providing specialized elements and extended functionality for modern applications. It maintains the same "less is more" philosophy with zero external dependencies (mtrl as peer dependency only).
|
|
6
|
-
|
|
7
|
-
## Environment & Architecture
|
|
8
|
-
|
|
9
|
-
- Part of workspace alongside mtrl and mtrl-app packages
|
|
10
|
-
- mtrl-app serves as the information hub with documentation and showcases
|
|
11
|
-
- Follows mtrl core architecture patterns and conventions
|
|
12
|
-
- Primary dependency: mtrl
|
|
13
|
-
|
|
14
|
-
## Development Philosophy
|
|
15
|
-
|
|
16
|
-
- Follow "less is more" philosophy - minimalist but complete
|
|
17
|
-
- Optimize for size, memory usage, and speed
|
|
18
|
-
- Keep modules small and reusable for bundling
|
|
19
|
-
- Find root causes and fix problems elegantly with minimal code
|
|
20
|
-
- Avoid over-engineering and workarounds
|
|
21
|
-
|
|
22
|
-
## Pre-Development Checklist
|
|
23
|
-
|
|
24
|
-
1. Check if functionality already exists in mtrl (mtrl/src/core)
|
|
25
|
-
2. Check mtrl styles system (mtrl/src/styles) before creating new styles
|
|
26
|
-
3. Create tests first (mtrl-addons/test/) - test-driven development
|
|
27
|
-
4. Use mtrl-app/docs for all documentation (no .md files in this package)
|
|
28
|
-
|
|
29
|
-
## Code Standards
|
|
30
|
-
|
|
31
|
-
### TypeScript & Structure
|
|
32
|
-
|
|
33
|
-
- Use TypeScript for all components
|
|
34
|
-
- Follow mtrl component and core structure conventions
|
|
35
|
-
- Use pipe pattern for core and component composition
|
|
36
|
-
- Add comprehensive TypeDoc comments for all public APIs
|
|
37
|
-
- Maintain zero external dependencies policy
|
|
38
|
-
|
|
39
|
-
### CSS & Styling
|
|
40
|
-
|
|
41
|
-
- No inline CSS - use external SCSS files in src/styles/
|
|
42
|
-
- Follow BEM naming: mtrl-component\_\_element--modifier
|
|
43
|
-
- Use mtrl styles system as foundation
|
|
44
|
-
|
|
45
|
-
### File Management
|
|
46
|
-
|
|
47
|
-
- Prefer editing existing files over creating new ones
|
|
48
|
-
- Avoid hyphens in filenames if possible
|
|
49
|
-
- Prefer short filenames if clear enough
|
|
50
|
-
- If you need to create html or js debugging files, just ./debugging folder (will be .git ignored)
|
|
51
|
-
- No summary .md files for coding sessions
|
|
52
|
-
- Component and Core usual ts files: index, main(module name), types, constant, api(special feature), features
|
|
53
|
-
- If features become to large, create a folder and split the file by concern ans move api in it if appropriate
|
|
54
|
-
|
|
55
|
-
### Component Development
|
|
56
|
-
|
|
57
|
-
- Follow established mtrl component patterns (config, types, constants, features)
|
|
58
|
-
- Always use functional composition over class inheritance
|
|
59
|
-
- Implement proper lifecycle management
|
|
60
|
-
- Ensure accessibility compliance - this is important!
|
|
61
|
-
- Focus on the specific issue when fixing bugs - avoid enhancements during fixes
|
|
62
|
-
|
|
63
|
-
## Testing Rules
|
|
64
|
-
|
|
65
|
-
- Use Bun test runner for all tests
|
|
66
|
-
- Mock components to avoid circular dependencies
|
|
67
|
-
- Always use JSDOM for DOM testing
|
|
68
|
-
- Comprehensive but lightweight tests
|
|
69
|
-
- Follow test-first development approach
|
|
70
|
-
|
|
71
|
-
## Showcase & Documentation
|
|
72
|
-
|
|
73
|
-
- Create showcases in mtrl-app/client/content only and follow the hierarchy
|
|
74
|
-
- Always use mtrl components via layout system (mtrl-app/docs/layout/usages.md)
|
|
75
|
-
- Prefer array-based layout schema
|
|
76
|
-
- Format schema following the formatting convention (mtrl-app/docs/core/layout/array-schema.md)
|
|
77
|
-
- Avoid manual DOM element creation in showcases
|
|
78
|
-
- Never inline CSS in showcases
|
|
79
|
-
- Focus on demonstrating component capabilities
|
|
80
|
-
- Keep the showcases small, maintainable and readable
|
|
81
|
-
|
|
82
|
-
## Build & Deployment
|
|
83
|
-
|
|
84
|
-
- Build using `bun run build:app` not `bun run build`
|
|
85
|
-
- Fix TypeScript declaration errors immediately
|
|
86
|
-
- Do not start development servers (bun/node)
|
|
87
|
-
- Follow conventional commit format
|
|
88
|
-
- Use `bun run build` for package builds
|
|
89
|
-
- Ensure compatibility with both ES modules and CommonJS
|
|
90
|
-
|
|
91
|
-
## Performance & Optimization
|
|
92
|
-
|
|
93
|
-
- When enhancing/optimizing/refactoring: focus on size, memory usage, and speed
|
|
94
|
-
- Minimize bundle size impact
|
|
95
|
-
- Avoid unnecessary re-renders or DOM manipulations
|
|
96
|
-
- Use efficient algorithms and data structures
|
|
97
|
-
- Design for tree-shaking compatibility
|
|
98
|
-
|
|
99
|
-
## Extension Development
|
|
100
|
-
|
|
101
|
-
- Build upon mtrl core without duplicating functionality
|
|
102
|
-
- Create specialized components not found in base mtrl package
|
|
103
|
-
- Ensure seamless integration with mtrl component ecosystem
|
|
104
|
-
- Maintain API consistency with mtrl patterns
|
|
105
|
-
- Design for modularity - components should be importable individually
|
|
106
|
-
|
|
107
|
-
## Prohibited Actions
|
|
108
|
-
|
|
109
|
-
- Do not use React (pure TypeScript/JavaScript library)
|
|
110
|
-
- Do not create markdown documentation for enhancements
|
|
111
|
-
- Do not run server commands
|
|
112
|
-
- Do not create workarounds or hacks
|
|
113
|
-
- Do not duplicate mtrl core functionality
|
|
114
|
-
- Do not enhance during bug fixes - stay focused on the issue
|
|
115
|
-
- Do not harcode prefix
|
|
116
|
-
- Do not use global Window object to store things
|
|
117
|
-
- Do not build using bun run build (this is used for package build, use bun run build:app)
|