mtrl 0.3.1 → 0.3.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.
- package/.env +15 -0
- package/CONTRIBUTING.md +8 -8
- package/DOCS.md +3 -3
- package/README.md +43 -20
- package/TESTING.md +128 -18
- package/dist/index.js +14865 -0
- package/git-user-stats.js +545 -0
- package/index.ts +9 -67
- package/package.json +8 -3
- package/src/components/badge/api.ts +15 -1
- package/src/components/badge/badge.ts +43 -4
- package/src/components/badge/config.ts +40 -8
- package/src/components/badge/index.ts +64 -3
- package/src/components/badge/types.ts +175 -33
- package/src/components/button/api.ts +63 -1
- package/src/components/button/button.ts +39 -3
- package/src/components/button/config.ts +21 -4
- package/src/components/button/index.ts +26 -1
- package/src/components/button/types.ts +7 -1
- package/src/components/card/api.ts +78 -9
- package/src/components/card/card.ts +58 -3
- package/src/components/card/config.ts +41 -11
- package/src/components/card/features.ts +39 -12
- package/src/components/card/index.ts +84 -19
- package/src/components/card/types.ts +218 -29
- package/src/components/carousel/carousel.ts +92 -28
- package/src/components/carousel/constants.ts +107 -21
- package/src/components/carousel/index.ts +31 -13
- package/src/components/checkbox/checkbox.ts +83 -16
- package/src/components/checkbox/index.ts +43 -1
- package/src/components/checkbox/types.ts +219 -32
- package/src/components/chips/api.ts +194 -0
- package/src/components/{chip → chips/chip}/api.ts +42 -2
- package/src/components/chips/chip/chip.ts +131 -0
- package/src/components/{chip → chips/chip}/config.ts +3 -3
- package/src/components/chips/chip/index.ts +3 -0
- package/src/components/chips/chips.md +481 -0
- package/src/components/chips/chips.ts +75 -0
- package/src/components/chips/config.ts +109 -0
- package/src/components/chips/constants.ts +61 -0
- package/src/components/chips/features/chip-items.ts +33 -0
- package/src/components/chips/features/container.ts +77 -0
- package/src/components/chips/features/controller.ts +448 -0
- package/src/components/chips/features/index.ts +5 -0
- package/src/components/chips/features/label.ts +108 -0
- package/src/components/chips/index.ts +11 -0
- package/src/components/chips/schema.ts +61 -0
- package/src/components/{chip → chips}/types.ts +203 -92
- package/src/components/dialog/dialog.ts +99 -16
- package/src/components/dialog/index.ts +97 -1
- package/src/components/dialog/types.ts +375 -69
- package/src/components/divider/config.ts +90 -6
- package/src/components/divider/divider.ts +32 -2
- package/src/components/divider/features.ts +26 -0
- package/src/components/divider/index.ts +30 -0
- package/src/components/divider/types.ts +86 -9
- package/src/components/extended-fab/api.ts +53 -1
- package/src/components/extended-fab/config.ts +29 -1
- package/src/components/extended-fab/extended-fab.ts +28 -0
- package/src/components/extended-fab/index.ts +36 -0
- package/src/components/extended-fab/types.ts +458 -13
- package/src/components/fab/api.ts +42 -2
- package/src/components/fab/config.ts +29 -1
- package/src/components/fab/fab.ts +16 -2
- package/src/components/fab/index.ts +35 -0
- package/src/components/fab/types.ts +374 -10
- package/src/components/list/api.ts +12 -2
- package/src/components/list/config.ts +21 -0
- package/src/components/list/features.ts +6 -0
- package/src/components/list/index.ts +56 -1
- package/src/components/list/list-item.ts +46 -2
- package/src/components/list/list.ts +73 -2
- package/src/components/list/types.ts +172 -0
- package/src/components/list/utils.ts +26 -2
- package/src/components/menu/api.ts +217 -20
- package/src/components/menu/config.ts +27 -0
- package/src/components/menu/features/visibility.ts +55 -6
- package/src/components/menu/index.ts +64 -0
- package/src/components/menu/menu-item.ts +46 -3
- package/src/components/menu/menu.ts +77 -1
- package/src/components/menu/types.ts +404 -39
- package/src/components/sheet/config.ts +1 -2
- package/src/components/sheet/features/gestures.ts +1 -1
- package/src/components/sheet/features/position.ts +1 -2
- package/src/components/sheet/features/state.ts +1 -1
- package/src/components/sheet/index.ts +10 -2
- package/src/components/sheet/sheet.ts +1 -2
- package/src/components/sheet/types.ts +29 -1
- package/src/components/slider/api.ts +1 -1
- package/src/components/slider/config.ts +1 -1
- package/src/components/slider/features/controller.ts +1 -1
- package/src/components/slider/features/handlers.ts +1 -1
- package/src/components/slider/features/states.ts +1 -1
- package/src/components/slider/index.ts +12 -5
- package/src/components/slider/schema.ts +1 -1
- package/src/components/slider/types.ts +31 -0
- package/src/components/tabs/tab-api.ts +1 -1
- package/src/components/tabs/types.ts +1 -1
- package/src/components/tooltip/api.ts +6 -2
- package/src/components/tooltip/config.ts +9 -28
- package/src/components/tooltip/index.ts +10 -1
- package/src/components/tooltip/types.ts +38 -3
- package/src/index.ts +129 -31
- package/src/styles/abstract/_mixins.scss +23 -9
- package/src/styles/abstract/_variables.scss +14 -4
- package/src/styles/components/_card.scss +1 -1
- package/src/styles/components/_chip.scss +323 -113
- package/src/styles/components/_tabs.scss +1 -1
- package/CLAUDE.md +0 -33
- package/src/components/checkbox/constants.ts +0 -37
- package/src/components/chip/chip-set.ts +0 -225
- package/src/components/chip/chip.ts +0 -118
- package/src/components/chip/constants.ts +0 -28
- package/src/components/chip/index.ts +0 -12
- package/src/components/list/constants.ts +0 -116
- package/src/components/sheet/constants.ts +0 -20
- package/src/components/slider/constants.ts +0 -32
- package/src/components/tooltip/constants.ts +0 -27
- package/test/components/badge.test.ts +0 -545
- package/test/components/bottom-app-bar.test.ts +0 -303
- package/test/components/button.test.ts +0 -233
- package/test/components/card.test.ts +0 -560
- package/test/components/carousel.test.ts +0 -951
- package/test/components/checkbox.test.ts +0 -462
- package/test/components/chip.test.ts +0 -692
- package/test/components/datepicker.test.ts +0 -1124
- package/test/components/dialog.test.ts +0 -990
- package/test/components/divider.test.ts +0 -412
- package/test/components/extended-fab.test.ts +0 -672
- package/test/components/fab.test.ts +0 -561
- package/test/components/list.test.ts +0 -365
- package/test/components/menu.test.ts +0 -718
- package/test/components/navigation.test.ts +0 -186
- package/test/components/progress.test.ts +0 -567
- package/test/components/radios.test.ts +0 -699
- package/test/components/search.test.ts +0 -1135
- package/test/components/segmented-button.test.ts +0 -732
- package/test/components/sheet.test.ts +0 -641
- package/test/components/slider.test.ts +0 -1220
- package/test/components/snackbar.test.ts +0 -461
- package/test/components/switch.test.ts +0 -452
- package/test/components/tabs.test.ts +0 -1369
- package/test/components/textfield.test.ts +0 -400
- package/test/components/timepicker.test.ts +0 -592
- package/test/components/tooltip.test.ts +0 -630
- package/test/components/top-app-bar.test.ts +0 -566
- package/test/core/dom.attributes.test.ts +0 -148
- package/test/core/dom.classes.test.ts +0 -152
- package/test/core/dom.events.test.ts +0 -243
- package/test/core/emitter.test.ts +0 -141
- package/test/core/ripple.test.ts +0 -99
- package/test/core/state.store.test.ts +0 -189
- package/test/core/utils.normalize.test.ts +0 -61
- package/test/core/utils.object.test.ts +0 -120
- package/test/setup.js +0 -371
- package/test/setup.ts +0 -451
- package/tsconfig.json +0 -22
- package/typedoc.json +0 -28
- package/typedoc.simple.json +0 -14
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
// src/components/
|
|
2
|
-
@use '
|
|
3
|
-
@use '
|
|
4
|
-
@use '
|
|
5
|
-
@use '
|
|
6
|
-
@use '
|
|
1
|
+
// src/styles/components/_chips.scss
|
|
2
|
+
@use '../abstract/base' as base;
|
|
3
|
+
@use '../abstract/variables' as v;
|
|
4
|
+
@use '../abstract/functions' as f;
|
|
5
|
+
@use '../abstract/mixins' as m;
|
|
6
|
+
@use '../abstract/theme' as t;
|
|
7
7
|
|
|
8
8
|
$component: '#{base.$prefix}-chip';
|
|
9
|
+
$container: '#{base.$prefix}-chips';
|
|
9
10
|
|
|
11
|
+
// Chip component styling
|
|
10
12
|
.#{$component} {
|
|
11
13
|
// Base styles
|
|
12
14
|
position: relative;
|
|
@@ -18,15 +20,19 @@ $component: '#{base.$prefix}-chip';
|
|
|
18
20
|
border-radius: v.chip('border-radius');
|
|
19
21
|
background-color: transparent;
|
|
20
22
|
max-width: 100%;
|
|
21
|
-
overflow: hidden;
|
|
22
23
|
user-select: none;
|
|
23
24
|
cursor: pointer;
|
|
24
25
|
|
|
25
26
|
// Typography
|
|
26
27
|
@include m.typography('label-large');
|
|
27
28
|
|
|
28
|
-
//
|
|
29
|
-
|
|
29
|
+
// Enhanced transition for width changes
|
|
30
|
+
transition: background-color v.motion('duration-short4') v.motion('easing-standard'),
|
|
31
|
+
color v.motion('duration-short4') v.motion('easing-standard'),
|
|
32
|
+
border-color v.motion('duration-short4') v.motion('easing-standard'),
|
|
33
|
+
box-shadow v.motion('duration-short4') v.motion('easing-standard'),
|
|
34
|
+
padding v.motion('duration-short4') v.motion('easing-standard'),
|
|
35
|
+
width v.motion('duration-short4') v.motion('easing-standard');
|
|
30
36
|
|
|
31
37
|
// Focus styles
|
|
32
38
|
&:focus {
|
|
@@ -51,48 +57,50 @@ $component: '#{base.$prefix}-chip';
|
|
|
51
57
|
justify-content: center;
|
|
52
58
|
width: 100%;
|
|
53
59
|
height: 100%;
|
|
60
|
+
gap: v.spacing('2');
|
|
54
61
|
}
|
|
55
62
|
|
|
56
|
-
// Ensure proper layout with icons
|
|
63
|
+
// Ensure proper layout with icons - independent of scrollable state
|
|
57
64
|
&-leading-icon,
|
|
58
65
|
&-trailing-icon {
|
|
59
66
|
display: inline-flex;
|
|
60
67
|
align-items: center;
|
|
61
68
|
justify-content: center;
|
|
62
|
-
width:
|
|
63
|
-
height:
|
|
69
|
+
min-width: v.chip('icon-size');
|
|
70
|
+
height: v.chip('icon-size');
|
|
71
|
+
flex-shrink: 0;
|
|
72
|
+
position: relative; // Add this to ensure stable positioning
|
|
64
73
|
|
|
65
74
|
svg {
|
|
66
|
-
width:
|
|
67
|
-
height:
|
|
75
|
+
width: v.chip('icon-size');
|
|
76
|
+
height: v.chip('icon-size');
|
|
68
77
|
}
|
|
69
78
|
}
|
|
70
79
|
|
|
71
80
|
&-leading-icon {
|
|
72
|
-
margin-right:
|
|
81
|
+
margin-right: 0; // Gap is handled by the content container
|
|
73
82
|
}
|
|
74
83
|
|
|
75
84
|
&-trailing-icon {
|
|
76
|
-
margin-left:
|
|
85
|
+
margin-left: 0; // Gap is handled by the content container
|
|
77
86
|
|
|
78
87
|
&:hover {
|
|
79
|
-
opacity: 0.
|
|
88
|
+
opacity: 0.8;
|
|
80
89
|
}
|
|
81
90
|
}
|
|
82
91
|
|
|
83
92
|
&-text {
|
|
84
|
-
//
|
|
85
|
-
|
|
93
|
+
// Allow text to display normally
|
|
94
|
+
white-space: nowrap;
|
|
95
|
+
overflow: visible;
|
|
86
96
|
}
|
|
87
97
|
|
|
88
|
-
// Selected state
|
|
98
|
+
// Selected state (base)
|
|
89
99
|
&--selected {
|
|
90
|
-
// Default selected state styling (can be overridden by variants)
|
|
91
|
-
background-color: t.alpha('on-surface', 0.12);
|
|
92
100
|
font-weight: 500;
|
|
93
101
|
}
|
|
94
102
|
|
|
95
|
-
// Ripple container
|
|
103
|
+
// Ripple container - state layers for interaction feedback
|
|
96
104
|
.ripple {
|
|
97
105
|
position: absolute;
|
|
98
106
|
border-radius: 50%;
|
|
@@ -102,101 +110,211 @@ $component: '#{base.$prefix}-chip';
|
|
|
102
110
|
opacity: 0.12;
|
|
103
111
|
}
|
|
104
112
|
|
|
105
|
-
//
|
|
113
|
+
// ====== CHIP VARIANTS ======
|
|
114
|
+
|
|
115
|
+
// Filled chip
|
|
106
116
|
&--filled {
|
|
107
117
|
background-color: t.color('surface-container-highest');
|
|
108
118
|
color: t.color('on-surface');
|
|
109
119
|
|
|
110
|
-
&:hover {
|
|
111
|
-
|
|
120
|
+
&:hover::after {
|
|
121
|
+
content: '';
|
|
122
|
+
position: absolute;
|
|
123
|
+
inset: 0;
|
|
124
|
+
background-color: t.color('on-surface');
|
|
125
|
+
opacity: 0.08;
|
|
126
|
+
pointer-events: none;
|
|
127
|
+
border-radius: inherit;
|
|
112
128
|
}
|
|
113
129
|
|
|
114
|
-
&:active {
|
|
115
|
-
|
|
130
|
+
&:active::after {
|
|
131
|
+
content: '';
|
|
132
|
+
position: absolute;
|
|
133
|
+
inset: 0;
|
|
134
|
+
background-color: t.color('on-surface');
|
|
135
|
+
opacity: 0.12;
|
|
136
|
+
pointer-events: none;
|
|
137
|
+
border-radius: inherit;
|
|
116
138
|
}
|
|
117
139
|
|
|
118
140
|
&.#{$component}--selected {
|
|
119
141
|
background-color: t.color('secondary-container');
|
|
120
142
|
color: t.color('on-secondary-container');
|
|
121
143
|
|
|
122
|
-
&:hover {
|
|
123
|
-
|
|
144
|
+
&:hover::after {
|
|
145
|
+
content: '';
|
|
146
|
+
position: absolute;
|
|
147
|
+
inset: 0;
|
|
148
|
+
background-color: t.color('on-secondary-container');
|
|
149
|
+
opacity: 0.08;
|
|
150
|
+
pointer-events: none;
|
|
151
|
+
border-radius: inherit;
|
|
124
152
|
}
|
|
125
153
|
|
|
126
|
-
&:active {
|
|
127
|
-
|
|
154
|
+
&:active::after {
|
|
155
|
+
content: '';
|
|
156
|
+
position: absolute;
|
|
157
|
+
inset: 0;
|
|
158
|
+
background-color: t.color('on-secondary-container');
|
|
159
|
+
opacity: 0.12;
|
|
160
|
+
pointer-events: none;
|
|
161
|
+
border-radius: inherit;
|
|
128
162
|
}
|
|
129
163
|
}
|
|
130
164
|
}
|
|
131
165
|
|
|
166
|
+
// Outlined chip
|
|
132
167
|
&--outlined {
|
|
133
|
-
border: 1px solid t.
|
|
168
|
+
border: 1px solid t.alpha('outline', v.chip('outlined-border-opacity'));
|
|
134
169
|
color: t.color('on-surface');
|
|
135
170
|
|
|
136
|
-
&:hover {
|
|
137
|
-
|
|
171
|
+
&:hover::after {
|
|
172
|
+
content: '';
|
|
173
|
+
position: absolute;
|
|
174
|
+
inset: 0;
|
|
175
|
+
background-color: t.color('on-surface');
|
|
176
|
+
opacity: 0.08;
|
|
177
|
+
pointer-events: none;
|
|
178
|
+
border-radius: inherit;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
&:focus-visible {
|
|
182
|
+
border-color: t.alpha('outline', v.chip('outlined-border-focus-opacity'));
|
|
138
183
|
}
|
|
139
184
|
|
|
140
|
-
&:active {
|
|
141
|
-
|
|
185
|
+
&:active::after {
|
|
186
|
+
content: '';
|
|
187
|
+
position: absolute;
|
|
188
|
+
inset: 0;
|
|
189
|
+
background-color: t.color('on-surface');
|
|
190
|
+
opacity: 0.12;
|
|
191
|
+
pointer-events: none;
|
|
192
|
+
border-radius: inherit;
|
|
142
193
|
}
|
|
143
194
|
|
|
144
195
|
&.#{$component}--selected {
|
|
145
|
-
border-color:
|
|
196
|
+
border-color: transparent;
|
|
146
197
|
background-color: t.color('secondary-container');
|
|
147
198
|
color: t.color('on-secondary-container');
|
|
148
199
|
|
|
149
|
-
&:hover {
|
|
150
|
-
|
|
200
|
+
&:hover::after {
|
|
201
|
+
content: '';
|
|
202
|
+
position: absolute;
|
|
203
|
+
inset: 0;
|
|
204
|
+
background-color: t.color('on-secondary-container');
|
|
205
|
+
opacity: 0.08;
|
|
206
|
+
pointer-events: none;
|
|
207
|
+
border-radius: inherit;
|
|
151
208
|
}
|
|
152
209
|
}
|
|
153
210
|
}
|
|
154
211
|
|
|
212
|
+
// Elevated chip
|
|
155
213
|
&--elevated {
|
|
156
214
|
background-color: t.color('surface-container-low');
|
|
157
215
|
color: t.color('on-surface');
|
|
158
|
-
|
|
216
|
+
box-shadow: f.get-elevation(1);
|
|
159
217
|
|
|
160
|
-
&:hover {
|
|
161
|
-
|
|
162
|
-
|
|
218
|
+
&:hover::after {
|
|
219
|
+
content: '';
|
|
220
|
+
position: absolute;
|
|
221
|
+
inset: 0;
|
|
222
|
+
background-color: t.color('on-surface');
|
|
223
|
+
opacity: 0.08;
|
|
224
|
+
pointer-events: none;
|
|
225
|
+
border-radius: inherit;
|
|
163
226
|
}
|
|
164
227
|
|
|
165
|
-
&:active {
|
|
166
|
-
|
|
167
|
-
|
|
228
|
+
&:active::after {
|
|
229
|
+
content: '';
|
|
230
|
+
position: absolute;
|
|
231
|
+
inset: 0;
|
|
232
|
+
background-color: t.color('on-surface');
|
|
233
|
+
opacity: 0.12;
|
|
234
|
+
pointer-events: none;
|
|
235
|
+
border-radius: inherit;
|
|
168
236
|
}
|
|
169
237
|
|
|
170
238
|
&.#{$component}--selected {
|
|
171
239
|
background-color: t.color('secondary-container');
|
|
172
240
|
color: t.color('on-secondary-container');
|
|
173
241
|
|
|
174
|
-
&:hover {
|
|
175
|
-
|
|
242
|
+
&:hover::after {
|
|
243
|
+
content: '';
|
|
244
|
+
position: absolute;
|
|
245
|
+
inset: 0;
|
|
246
|
+
background-color: t.color('on-secondary-container');
|
|
247
|
+
opacity: 0.08;
|
|
248
|
+
pointer-events: none;
|
|
249
|
+
border-radius: inherit;
|
|
176
250
|
}
|
|
177
251
|
}
|
|
178
252
|
}
|
|
179
253
|
|
|
180
|
-
// Filter chip
|
|
254
|
+
// Filter chip
|
|
181
255
|
&--filter {
|
|
182
|
-
|
|
256
|
+
|
|
183
257
|
color: t.color('on-surface');
|
|
258
|
+
position: relative;
|
|
259
|
+
border: 1px solid t.alpha('outline', v.chip('outlined-border-opacity'));
|
|
184
260
|
|
|
185
|
-
|
|
186
|
-
|
|
261
|
+
// Hover state for unselected chips
|
|
262
|
+
&:hover::after {
|
|
263
|
+
content: '';
|
|
264
|
+
position: absolute;
|
|
265
|
+
inset: 0;
|
|
266
|
+
background-color: t.color('on-surface');
|
|
267
|
+
opacity: 0.08;
|
|
268
|
+
pointer-events: none;
|
|
269
|
+
border-radius: inherit;
|
|
187
270
|
}
|
|
188
271
|
|
|
189
272
|
&.#{$component}--selected {
|
|
273
|
+
|
|
274
|
+
padding-left: 8px;
|
|
190
275
|
background-color: t.color('secondary-container');
|
|
191
276
|
color: t.color('on-secondary-container');
|
|
192
|
-
|
|
277
|
+
--checkmark-color: currentColor; // Will inherit from text color
|
|
278
|
+
border: none;
|
|
193
279
|
.#{$component}-leading-icon {
|
|
194
280
|
color: t.color('on-secondary-container');
|
|
195
281
|
}
|
|
282
|
+
|
|
283
|
+
// Use ::before exclusively for the checkmark icon with mask technique
|
|
284
|
+
&::before {
|
|
285
|
+
content: '';
|
|
286
|
+
display: inline-block;
|
|
287
|
+
width: 18px;
|
|
288
|
+
height: 18px;
|
|
289
|
+
background-color: var(--checkmark-color);
|
|
290
|
+
mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z'/%3E%3C/svg%3E");
|
|
291
|
+
mask-position: center;
|
|
292
|
+
mask-repeat: no-repeat;
|
|
293
|
+
mask-size: contain;
|
|
294
|
+
-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2L4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4L9 16.2z'/%3E%3C/svg%3E");
|
|
295
|
+
-webkit-mask-position: center;
|
|
296
|
+
-webkit-mask-repeat: no-repeat;
|
|
297
|
+
-webkit-mask-size: contain;
|
|
298
|
+
margin-right: 8px;
|
|
299
|
+
flex-shrink: 0;
|
|
300
|
+
position: static;
|
|
301
|
+
animation: checkmark-appear v.motion('duration-short4') v.motion('easing-emphasized') forwards;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// Hover state for selected chips
|
|
305
|
+
&:hover::after {
|
|
306
|
+
content: '';
|
|
307
|
+
position: absolute;
|
|
308
|
+
inset: 0;
|
|
309
|
+
background-color: t.color('on-secondary-container');
|
|
310
|
+
opacity: 0.08;
|
|
311
|
+
pointer-events: none;
|
|
312
|
+
border-radius: inherit;
|
|
313
|
+
}
|
|
196
314
|
}
|
|
197
315
|
}
|
|
198
316
|
|
|
199
|
-
// Assist chip
|
|
317
|
+
// Assist chip
|
|
200
318
|
&--assist {
|
|
201
319
|
background-color: t.color('surface-container-low');
|
|
202
320
|
color: t.color('on-surface');
|
|
@@ -205,6 +323,16 @@ $component: '#{base.$prefix}-chip';
|
|
|
205
323
|
color: t.color('primary');
|
|
206
324
|
}
|
|
207
325
|
|
|
326
|
+
&:hover::after {
|
|
327
|
+
content: '';
|
|
328
|
+
position: absolute;
|
|
329
|
+
inset: 0;
|
|
330
|
+
background-color: t.color('on-surface');
|
|
331
|
+
opacity: 0.08;
|
|
332
|
+
pointer-events: none;
|
|
333
|
+
border-radius: inherit;
|
|
334
|
+
}
|
|
335
|
+
|
|
208
336
|
&.#{$component}--selected {
|
|
209
337
|
background-color: t.color('secondary-container');
|
|
210
338
|
color: t.color('on-secondary-container');
|
|
@@ -212,13 +340,24 @@ $component: '#{base.$prefix}-chip';
|
|
|
212
340
|
.#{$component}-leading-icon {
|
|
213
341
|
color: t.color('on-secondary-container');
|
|
214
342
|
}
|
|
343
|
+
|
|
344
|
+
&:hover::after {
|
|
345
|
+
content: '';
|
|
346
|
+
position: absolute;
|
|
347
|
+
inset: 0;
|
|
348
|
+
background-color: t.color('on-secondary-container');
|
|
349
|
+
opacity: 0.08;
|
|
350
|
+
pointer-events: none;
|
|
351
|
+
border-radius: inherit;
|
|
352
|
+
}
|
|
215
353
|
}
|
|
216
354
|
}
|
|
217
355
|
|
|
218
|
-
// Input chip
|
|
356
|
+
// Input chip
|
|
219
357
|
&--input {
|
|
220
358
|
background-color: t.color('surface-container-highest');
|
|
221
359
|
color: t.color('on-surface');
|
|
360
|
+
border-radius: v.chip('border-radius');
|
|
222
361
|
|
|
223
362
|
.#{$component}-trailing-icon {
|
|
224
363
|
cursor: pointer;
|
|
@@ -227,89 +366,160 @@ $component: '#{base.$prefix}-chip';
|
|
|
227
366
|
color: t.color('error');
|
|
228
367
|
}
|
|
229
368
|
}
|
|
369
|
+
|
|
370
|
+
&:hover::after {
|
|
371
|
+
content: '';
|
|
372
|
+
position: absolute;
|
|
373
|
+
inset: 0;
|
|
374
|
+
background-color: t.color('on-surface');
|
|
375
|
+
opacity: 0.08;
|
|
376
|
+
pointer-events: none;
|
|
377
|
+
border-radius: inherit;
|
|
378
|
+
}
|
|
230
379
|
}
|
|
231
380
|
|
|
232
|
-
// Suggestion chip
|
|
381
|
+
// Suggestion chip
|
|
233
382
|
&--suggestion {
|
|
234
383
|
background-color: t.color('surface-container');
|
|
235
384
|
color: t.color('on-surface');
|
|
385
|
+
height: v.chip('suggestion-height');
|
|
386
|
+
|
|
387
|
+
.#{$component}-leading-icon {
|
|
388
|
+
width: v.chip('suggestion-icon-size');
|
|
389
|
+
height: v.chip('suggestion-icon-size');
|
|
390
|
+
|
|
391
|
+
svg {
|
|
392
|
+
width: v.chip('suggestion-icon-size');
|
|
393
|
+
height: v.chip('suggestion-icon-size');
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
&:hover::after {
|
|
398
|
+
content: '';
|
|
399
|
+
position: absolute;
|
|
400
|
+
inset: 0;
|
|
401
|
+
background-color: t.color('on-surface');
|
|
402
|
+
opacity: 0.08;
|
|
403
|
+
pointer-events: none;
|
|
404
|
+
border-radius: inherit;
|
|
405
|
+
}
|
|
236
406
|
|
|
237
407
|
&.#{$component}--selected {
|
|
238
408
|
background-color: t.color('secondary-container');
|
|
239
409
|
color: t.color('on-secondary-container');
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
// Size variants
|
|
244
|
-
&--small {
|
|
245
|
-
height: 24px;
|
|
246
|
-
padding: 0 8px;
|
|
247
|
-
font-size: 12px;
|
|
248
|
-
|
|
249
|
-
.#{$component}-leading-icon,
|
|
250
|
-
.#{$component}-trailing-icon {
|
|
251
|
-
width: 16px;
|
|
252
|
-
height: 16px;
|
|
253
410
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
411
|
+
&:hover::after {
|
|
412
|
+
content: '';
|
|
413
|
+
position: absolute;
|
|
414
|
+
inset: 0;
|
|
415
|
+
background-color: t.color('on-secondary-container');
|
|
416
|
+
opacity: 0.08;
|
|
417
|
+
pointer-events: none;
|
|
418
|
+
border-radius: inherit;
|
|
257
419
|
}
|
|
258
420
|
}
|
|
259
421
|
}
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// Animation for checkmark appearance
|
|
425
|
+
@keyframes checkmark-appear {
|
|
426
|
+
from {
|
|
427
|
+
transform: scale(0);
|
|
428
|
+
opacity: 0;
|
|
429
|
+
}
|
|
430
|
+
to {
|
|
431
|
+
transform: scale(1);
|
|
432
|
+
opacity: 1;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
// Chips container
|
|
437
|
+
.#{$container} {
|
|
438
|
+
display: flex;
|
|
439
|
+
flex-wrap: wrap;
|
|
440
|
+
gap: v.spacing('2');
|
|
441
|
+
width: 100%;
|
|
442
|
+
min-height: fit-content;
|
|
443
|
+
height: auto;
|
|
260
444
|
|
|
261
|
-
|
|
262
|
-
|
|
445
|
+
// Label styling
|
|
446
|
+
&-label {
|
|
447
|
+
@include m.typography('title-medium');
|
|
448
|
+
color: t.color('on-surface-variant');
|
|
449
|
+
margin-bottom: v.spacing('2');
|
|
450
|
+
display: block;
|
|
451
|
+
width: 100%;
|
|
263
452
|
}
|
|
264
453
|
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
454
|
+
// Layout with label
|
|
455
|
+
&--with-label {
|
|
456
|
+
display: flex;
|
|
457
|
+
flex-direction: column;
|
|
269
458
|
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
height: 20px;
|
|
459
|
+
// When label is at the end
|
|
460
|
+
&.#{$container}--label-end {
|
|
461
|
+
flex-direction: column-reverse;
|
|
274
462
|
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
463
|
+
.#{$container}-label {
|
|
464
|
+
margin-bottom: 0;
|
|
465
|
+
margin-top: v.spacing('2');
|
|
278
466
|
}
|
|
279
467
|
}
|
|
280
468
|
}
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
// Chip set container
|
|
284
|
-
.#{base.$prefix}-chip-set {
|
|
285
|
-
display: flex;
|
|
286
|
-
flex-wrap: wrap;
|
|
287
|
-
gap: 8px;
|
|
288
469
|
|
|
470
|
+
// Container for chips
|
|
471
|
+
&-container {
|
|
472
|
+
display: flex;
|
|
473
|
+
flex-wrap: wrap;
|
|
474
|
+
gap: v.spacing('2');
|
|
475
|
+
width: 100%;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
// Important: Scrollable state only affects the container, not the chip icons
|
|
289
479
|
&--scrollable {
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
480
|
+
.#{$container}-container {
|
|
481
|
+
flex-wrap: nowrap;
|
|
482
|
+
overflow-x: auto;
|
|
483
|
+
overflow-y: visible; // Don't clip chips vertically
|
|
484
|
+
-webkit-overflow-scrolling: touch;
|
|
485
|
+
scroll-behavior: smooth;
|
|
486
|
+
padding-bottom: v.spacing('2');
|
|
487
|
+
|
|
488
|
+
// Enhanced scrollable behavior
|
|
489
|
+
position: relative;
|
|
490
|
+
white-space: nowrap;
|
|
491
|
+
|
|
492
|
+
// Improved scrollbar styling
|
|
493
|
+
&::-webkit-scrollbar {
|
|
494
|
+
height: 4px;
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
&::-webkit-scrollbar-thumb {
|
|
498
|
+
background-color: t.alpha('on-surface', 0.2);
|
|
499
|
+
border-radius: 4px;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
&::-webkit-scrollbar-track {
|
|
503
|
+
background-color: t.alpha('on-surface', 0.05);
|
|
504
|
+
border-radius: 4px;
|
|
505
|
+
}
|
|
506
|
+
|
|
507
|
+
// Style for Firefox
|
|
508
|
+
scrollbar-width: thin;
|
|
509
|
+
scrollbar-color: t.alpha('on-surface', 0.2) t.alpha('on-surface', 0.05);
|
|
510
|
+
|
|
511
|
+
// Ensure chip visibility without affecting internal structure
|
|
512
|
+
.#{$component} {
|
|
513
|
+
flex-shrink: 0; // Prevent chips from shrinking
|
|
514
|
+
}
|
|
304
515
|
}
|
|
305
|
-
|
|
306
|
-
// Style for Firefox
|
|
307
|
-
scrollbar-width: thin;
|
|
308
|
-
scrollbar-color: t.alpha('on-surface', 0.2) transparent;
|
|
309
516
|
}
|
|
310
517
|
|
|
311
518
|
&--vertical {
|
|
312
|
-
|
|
313
|
-
|
|
519
|
+
.#{$container}-container {
|
|
520
|
+
flex-direction: column;
|
|
521
|
+
align-items: flex-start;
|
|
522
|
+
gap: v.spacing('2');
|
|
523
|
+
}
|
|
314
524
|
}
|
|
315
525
|
}
|
|
@@ -14,7 +14,7 @@ $container: '#{base.$prefix}-tabs';
|
|
|
14
14
|
display: flex;
|
|
15
15
|
flex-direction: column;
|
|
16
16
|
width: 100%;
|
|
17
|
-
background-color: t.color('surface'); // MD3: Surface color
|
|
17
|
+
// background-color: t.color('surface'); // MD3: Surface color
|
|
18
18
|
box-sizing: border-box;
|
|
19
19
|
|
|
20
20
|
// Basic container sizing
|
package/CLAUDE.md
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
# CLAUDE.md
|
|
2
|
-
|
|
3
|
-
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
|
|
4
|
-
|
|
5
|
-
## Build & Development Commands
|
|
6
|
-
- Build: `bun run build`
|
|
7
|
-
- Dev server: `bun run dev`
|
|
8
|
-
- Tests: `bun test`
|
|
9
|
-
- Single test: `bun test test/components/button.test.ts`
|
|
10
|
-
- Watch tests: `bun test --watch`
|
|
11
|
-
- Test with UI: `bun test --watch --ui`
|
|
12
|
-
- Test coverage: `bun test --coverage`
|
|
13
|
-
- Docs: `bun run docs` (uses TypeDoc)
|
|
14
|
-
|
|
15
|
-
## Code Conventions
|
|
16
|
-
- Factory pattern: Use `createComponent` naming for component creators
|
|
17
|
-
- Functional composition with pipe pattern
|
|
18
|
-
- Follow BEM-style CSS naming: `mtrl-component__element--modifier`
|
|
19
|
-
- Use TypeDoc-compatible comments for documentation
|
|
20
|
-
- Use TypeScript with strict typing where possible
|
|
21
|
-
- Error handling: Try/catch blocks for component creation
|
|
22
|
-
- Import order: core modules first, then utility functions, local imports last
|
|
23
|
-
- Components follow a standard structure in their directories (api.ts, config.ts, etc.)
|
|
24
|
-
- Use ES6+ features with full browser compatibility
|
|
25
|
-
|
|
26
|
-
## Test Conventions
|
|
27
|
-
- Tests live in `test/components/` with `.test.ts` extension
|
|
28
|
-
- Use JSDOM for DOM manipulation in tests
|
|
29
|
-
- Create mock implementations to avoid circular dependencies
|
|
30
|
-
- Test structure follows `describe/test` pattern
|
|
31
|
-
- Test component creation, options, events, and state changes
|
|
32
|
-
- Use `import type` to avoid circular dependencies in TypeScript tests
|
|
33
|
-
- Test directory structure mirrors src directory structure
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// src/components/checkbox/constants.ts
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Visual variants for checkbox
|
|
5
|
-
*/
|
|
6
|
-
export const CHECKBOX_VARIANTS = {
|
|
7
|
-
FILLED: 'filled',
|
|
8
|
-
OUTLINED: 'outlined'
|
|
9
|
-
} as const;
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Label position options
|
|
13
|
-
*/
|
|
14
|
-
export const CHECKBOX_LABEL_POSITION = {
|
|
15
|
-
START: 'start',
|
|
16
|
-
END: 'end'
|
|
17
|
-
} as const;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Checkbox state classes
|
|
21
|
-
*/
|
|
22
|
-
export const CHECKBOX_STATES = {
|
|
23
|
-
CHECKED: 'checked',
|
|
24
|
-
INDETERMINATE: 'indeterminate',
|
|
25
|
-
DISABLED: 'disabled',
|
|
26
|
-
FOCUSED: 'focused'
|
|
27
|
-
} as const;
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Checkbox element classes
|
|
31
|
-
*/
|
|
32
|
-
export const CHECKBOX_CLASSES = {
|
|
33
|
-
ROOT: 'checkbox',
|
|
34
|
-
INPUT: 'checkbox-input',
|
|
35
|
-
ICON: 'checkbox-icon',
|
|
36
|
-
LABEL: 'checkbox-label'
|
|
37
|
-
} as const;
|