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.
Files changed (128) hide show
  1. package/{src/components/index.ts → dist/components/index.d.ts} +0 -2
  2. package/dist/components/vlist/config.d.ts +86 -0
  3. package/{src/components/vlist/constants.ts → dist/components/vlist/constants.d.ts} +10 -11
  4. package/dist/components/vlist/features/api.d.ts +7 -0
  5. package/{src/components/vlist/features/index.ts → dist/components/vlist/features/index.d.ts} +0 -2
  6. package/dist/components/vlist/features/selection.d.ts +6 -0
  7. package/dist/components/vlist/features/viewport.d.ts +9 -0
  8. package/dist/components/vlist/features.d.ts +31 -0
  9. package/{src/components/vlist/index.ts → dist/components/vlist/index.d.ts} +1 -9
  10. package/dist/components/vlist/types.d.ts +596 -0
  11. package/dist/components/vlist/vlist.d.ts +29 -0
  12. package/dist/core/compose/features/gestures/index.d.ts +86 -0
  13. package/dist/core/compose/features/gestures/longpress.d.ts +85 -0
  14. package/dist/core/compose/features/gestures/pan.d.ts +108 -0
  15. package/dist/core/compose/features/gestures/pinch.d.ts +111 -0
  16. package/dist/core/compose/features/gestures/rotate.d.ts +111 -0
  17. package/dist/core/compose/features/gestures/swipe.d.ts +149 -0
  18. package/dist/core/compose/features/gestures/tap.d.ts +79 -0
  19. package/{src/core/compose/features/index.ts → dist/core/compose/features/index.d.ts} +1 -2
  20. package/{src/core/compose/index.ts → dist/core/compose/index.d.ts} +2 -11
  21. package/{src/core/gestures/index.ts → dist/core/gestures/index.d.ts} +1 -20
  22. package/dist/core/gestures/longpress.d.ts +23 -0
  23. package/dist/core/gestures/manager.d.ts +14 -0
  24. package/dist/core/gestures/pan.d.ts +12 -0
  25. package/dist/core/gestures/pinch.d.ts +14 -0
  26. package/dist/core/gestures/rotate.d.ts +14 -0
  27. package/dist/core/gestures/swipe.d.ts +20 -0
  28. package/dist/core/gestures/tap.d.ts +12 -0
  29. package/dist/core/gestures/types.d.ts +320 -0
  30. package/dist/core/gestures/utils.d.ts +57 -0
  31. package/dist/core/index.d.ts +13 -0
  32. package/dist/core/layout/config.d.ts +33 -0
  33. package/dist/core/layout/index.d.ts +51 -0
  34. package/dist/core/layout/jsx.d.ts +65 -0
  35. package/dist/core/layout/schema.d.ts +112 -0
  36. package/dist/core/layout/types.d.ts +69 -0
  37. package/dist/core/viewport/constants.d.ts +105 -0
  38. package/dist/core/viewport/features/base.d.ts +14 -0
  39. package/dist/core/viewport/features/collection.d.ts +41 -0
  40. package/dist/core/viewport/features/events.d.ts +13 -0
  41. package/{src/core/viewport/features/index.ts → dist/core/viewport/features/index.d.ts} +0 -7
  42. package/dist/core/viewport/features/item-size.d.ts +30 -0
  43. package/dist/core/viewport/features/loading.d.ts +34 -0
  44. package/dist/core/viewport/features/momentum.d.ts +17 -0
  45. package/dist/core/viewport/features/performance.d.ts +53 -0
  46. package/dist/core/viewport/features/placeholders.d.ts +38 -0
  47. package/dist/core/viewport/features/rendering.d.ts +16 -0
  48. package/dist/core/viewport/features/scrollbar.d.ts +26 -0
  49. package/dist/core/viewport/features/scrolling.d.ts +16 -0
  50. package/dist/core/viewport/features/utils.d.ts +43 -0
  51. package/dist/core/viewport/features/virtual.d.ts +18 -0
  52. package/{src/core/viewport/index.ts → dist/core/viewport/index.d.ts} +1 -17
  53. package/dist/core/viewport/types.d.ts +96 -0
  54. package/dist/core/viewport/utils/speed-tracker.d.ts +22 -0
  55. package/dist/core/viewport/viewport.d.ts +11 -0
  56. package/{src/index.ts → dist/index.d.ts} +0 -4
  57. package/dist/index.js +5143 -0
  58. package/dist/index.mjs +5111 -0
  59. package/dist/styles.css +254 -0
  60. package/dist/styles.css.map +1 -0
  61. package/package.json +6 -1
  62. package/src/styles/components/_vlist.scss +234 -213
  63. package/.cursorrules +0 -117
  64. package/AI.md +0 -241
  65. package/build.js +0 -201
  66. package/scripts/analyze-orphaned-functions.ts +0 -387
  67. package/scripts/debug/vlist-selection.ts +0 -121
  68. package/src/components/vlist/config.ts +0 -323
  69. package/src/components/vlist/features/api.ts +0 -322
  70. package/src/components/vlist/features/selection.ts +0 -444
  71. package/src/components/vlist/features/viewport.ts +0 -65
  72. package/src/components/vlist/features.ts +0 -112
  73. package/src/components/vlist/types.ts +0 -591
  74. package/src/components/vlist/vlist.ts +0 -92
  75. package/src/core/compose/features/gestures/index.ts +0 -227
  76. package/src/core/compose/features/gestures/longpress.ts +0 -383
  77. package/src/core/compose/features/gestures/pan.ts +0 -424
  78. package/src/core/compose/features/gestures/pinch.ts +0 -475
  79. package/src/core/compose/features/gestures/rotate.ts +0 -485
  80. package/src/core/compose/features/gestures/swipe.ts +0 -492
  81. package/src/core/compose/features/gestures/tap.ts +0 -334
  82. package/src/core/gestures/longpress.ts +0 -68
  83. package/src/core/gestures/manager.ts +0 -418
  84. package/src/core/gestures/pan.ts +0 -48
  85. package/src/core/gestures/pinch.ts +0 -58
  86. package/src/core/gestures/rotate.ts +0 -58
  87. package/src/core/gestures/swipe.ts +0 -66
  88. package/src/core/gestures/tap.ts +0 -45
  89. package/src/core/gestures/types.ts +0 -387
  90. package/src/core/gestures/utils.ts +0 -128
  91. package/src/core/index.ts +0 -43
  92. package/src/core/layout/config.ts +0 -102
  93. package/src/core/layout/index.ts +0 -168
  94. package/src/core/layout/jsx.ts +0 -174
  95. package/src/core/layout/schema.ts +0 -1001
  96. package/src/core/layout/types.ts +0 -95
  97. package/src/core/viewport/constants.ts +0 -140
  98. package/src/core/viewport/features/base.ts +0 -73
  99. package/src/core/viewport/features/collection.ts +0 -882
  100. package/src/core/viewport/features/events.ts +0 -130
  101. package/src/core/viewport/features/item-size.ts +0 -271
  102. package/src/core/viewport/features/loading.ts +0 -263
  103. package/src/core/viewport/features/momentum.ts +0 -260
  104. package/src/core/viewport/features/performance.ts +0 -161
  105. package/src/core/viewport/features/placeholders.ts +0 -335
  106. package/src/core/viewport/features/rendering.ts +0 -568
  107. package/src/core/viewport/features/scrollbar.ts +0 -434
  108. package/src/core/viewport/features/scrolling.ts +0 -618
  109. package/src/core/viewport/features/utils.ts +0 -88
  110. package/src/core/viewport/features/virtual.ts +0 -384
  111. package/src/core/viewport/types.ts +0 -133
  112. package/src/core/viewport/utils/speed-tracker.ts +0 -79
  113. package/src/core/viewport/viewport.ts +0 -246
  114. package/test/benchmarks/layout/advanced.test.ts +0 -656
  115. package/test/benchmarks/layout/comparison.test.ts +0 -519
  116. package/test/benchmarks/layout/performance-comparison.test.ts +0 -274
  117. package/test/benchmarks/layout/real-components.test.ts +0 -733
  118. package/test/benchmarks/layout/simple.test.ts +0 -321
  119. package/test/benchmarks/layout/stress.test.ts +0 -990
  120. package/test/collection/basic.test.ts +0 -304
  121. package/test/components/vlist-selection.test.ts +0 -240
  122. package/test/components/vlist.test.ts +0 -63
  123. package/test/core/collection/adapter.test.ts +0 -161
  124. package/test/core/collection/collection.test.ts +0 -394
  125. package/test/core/layout/layout.test.ts +0 -201
  126. package/test/utils/dom-helpers.ts +0 -275
  127. package/test/utils/performance-helpers.ts +0 -392
  128. 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
- 0%,
33
- 100% {
34
- opacity: 0.6;
35
- }
36
- 50% {
37
- opacity: 0.4;
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
- from {
43
- opacity: 0.6;
44
- }
45
- to {
46
- opacity: 1;
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
- position: relative;
56
- width: 100%;
57
- height: 100%;
58
- min-height: 100px;
59
- background-color: t.color("surface");
60
- border: 2px solid var(--mtrl-sys-color-outline-variant);
61
- border-radius: 3px;
62
- transition: $bg-transition;
63
-
64
- // Performance optimizations
65
- contain: layout style paint;
66
- transform: translateZ(0);
67
- backface-visibility: hidden;
68
-
69
- // Selection mode
70
- &--selection {
71
- cursor: pointer;
72
- .#{$viewport-item}:hover {
73
- background-color: t.alpha("on-surface-variant", 0.1);
74
- }
75
- // Selected state
76
- .#{$viewport-item}--selected,
77
- .#{$viewport-item}--selected:hover {
78
- background-color: t.color("secondary-container");
79
- color: t.color("on-secondary-container");
80
- transition: $bg-transition, $color-transition;
81
-
82
- // // Update state layer color for selected state
83
- // &::before {
84
- // background-color: t.color("on-secondary-container");
85
- // }
86
-
87
- // Update text and icon colors for selected state
88
- .#{$component}-item {
89
- &-leading,
90
- &-trailing,
91
- &-supporting,
92
- &-overline,
93
- &-meta {
94
- color: t.color("on-secondary-container");
95
- transition: $color-transition;
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
- // Disabled state
102
- &--disabled {
103
- pointer-events: none;
104
- opacity: 0.38;
105
- transition: $opacity-transition;
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
- padding: 8px 0;
125
- will-change: transform;
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
- user-select: none;
131
- opacity: 1;
132
- transition: $opacity-transition;
133
- will-change: transform;
134
- // Apply fade-in animation to items that replace placeholders
135
- &--replaced {
136
- animation: fade-in 0.3s ease-out;
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
- padding: 11px 12px;
142
- display: flex;
143
- align-items: start;
144
- transition: background-color 0.2s ease;
145
- // align-items: center;
146
- min-height: 48px;
147
- left: 0;
148
- right: 0;
149
- width: 100%;
150
- will-change: transform;
151
- contain: layout style;
152
- gap: 16px;
153
- color: var(--mtrl-sys-color-on-surface);
154
- overflow: hidden;
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
- width: 40px;
160
- height: 40px;
161
- margin-top: 4px;
162
- border-radius: 50%;
163
- background-color: var(--mtrl-sys-color-primary-container);
164
- color: white;
165
- display: flex;
166
- align-items: center;
167
- justify-content: center;
168
- font-weight: bold;
169
- flex-shrink: 0;
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
- flex: 1;
174
- min-width: 0;
175
- margin-left: 12px;
194
+ flex: 1;
195
+ min-width: 0;
196
+ margin-left: 12px;
176
197
  }
177
198
 
178
199
  .#{$viewport-item}__headline {
179
- font-weight: 500;
200
+ font-weight: 500;
180
201
  }
181
202
 
182
203
  .#{$viewport-item}__text {
183
- // color: #666;
184
- font-size: 14px;
185
- white-space: nowrap;
186
- overflow: hidden;
187
- text-overflow: ellipsis;
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
- color: var(--mtrl-sys-color-on-surface-variant);
192
- font-size: 12px;
193
- margin-top: 2px;
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
- opacity: 0.6; // Match the animation start/end opacity
202
- animation: placeholder-pulse 2s ease-in-out infinite;
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
- // Placeholder content blocks - style any text elements within
205
- .#{$viewport-item}__headline,
206
- .#{$viewport-item}__text,
207
- .#{$viewport-item}__meta {
208
- position: relative;
209
- display: inline-block;
210
- font-size: 0.8em;
211
- color: transparent;
212
- background-color: var(--mtrl-sys-color-on-surface);
213
- border-radius: 0.1em;
214
- opacity: 0.4;
215
- text-decoration: none;
216
- line-height: 1;
217
- padding: 0 0 0.05em;
218
- vertical-align: middle;
219
- }
220
-
221
- // Layout adjustments
222
- .#{$viewport-item}__text,
223
- .#{$viewport-item}__meta {
224
- margin-top: 0.2em;
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
- width: 6px;
277
- padding: 1px;
278
- background: rgba(0, 0, 0, 0.3);
279
- border-radius: 4px;
280
- will-change: transform;
281
- cursor: grab;
282
- transition: background 0.2s ease;
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
- background: rgba(0, 0, 0, 0.5);
290
+ background: rgba(0, 0, 0, 0.05);
286
291
  }
287
292
 
288
- &:active,
289
- &--dragging {
290
- cursor: grabbing;
291
- background: rgba(0, 0, 0, 0.6);
292
- transition: none;
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
- .#{$viewport}__scrollbar {
303
- background: transparent;
323
+ .#{$viewport}__scrollbar {
324
+ background: transparent;
304
325
 
305
- &-thumb {
306
- background: rgba(255, 255, 255, 0.4);
326
+ &-thumb {
327
+ background: rgba(255, 255, 255, 0.4);
307
328
 
308
- &:hover {
309
- background: rgba(255, 255, 255, 0.6);
310
- }
329
+ &:hover {
330
+ background: rgba(255, 255, 255, 0.6);
331
+ }
311
332
 
312
- &:active,
313
- &--dragging {
314
- background: rgba(255, 255, 255, 0.4);
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
- .#{$viewport-item} {
327
- text-rendering: optimizeLegibility;
328
- -webkit-font-smoothing: antialiased;
329
- -moz-osx-font-smoothing: grayscale;
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)