mtrl 0.5.3 → 0.5.4

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.
@@ -1,639 +1,643 @@
1
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;
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
- $component: '#{base.$prefix}-chip';
9
- $container: '#{base.$prefix}-chips';
8
+ $component: "#{base.$prefix}-chip";
9
+ $container: "#{base.$prefix}-chips";
10
10
 
11
11
  // Chip component styling
12
12
  .#{$component} {
13
- // Base styles
14
- position: relative;
15
- display: inline-flex;
16
- align-items: center;
17
- justify-content: center;
18
- height: v.chip('height');
19
- padding: 0 v.chip('padding-horizontal');
20
- border-radius: v.chip('border-radius');
21
- background-color: transparent;
22
- max-width: 100%;
23
- user-select: none;
24
- cursor: pointer;
25
-
26
- // Typography
27
- @include m.typography('label-large');
28
-
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');
36
-
37
- // Focus styles
38
- &:focus {
39
- outline: none;
40
- }
41
-
42
- &:focus-visible {
43
- outline: 2px solid t.color('outline');
44
- outline-offset: 2px;
45
- }
46
-
47
- // Active state - applied when the chip has a menu open
48
- &--active {
49
- // Base active state styling
50
- // Will use variant-specific implementations below
51
-
52
- // ARIA attribute to indicate active state for accessibility
53
- &[aria-expanded="true"] {
54
- // For compatibility with ARIA
55
- }
56
- }
57
-
58
- // Disabled state
59
- &--disabled {
60
- opacity: 0.38;
61
- pointer-events: none;
62
- }
63
-
64
- // Content container
65
- &-content {
66
- display: flex;
67
- align-items: center;
68
- justify-content: center;
69
- width: 100%;
70
- height: 100%;
71
- gap: v.spacing('2');
72
- }
73
-
74
- // Ensure proper layout with icons - independent of scrollable state
75
- &-leading-icon,
76
- &-trailing-icon {
13
+ // Base styles
14
+ position: relative;
77
15
  display: inline-flex;
78
16
  align-items: center;
79
17
  justify-content: center;
80
- min-width: v.chip('icon-size');
81
- height: v.chip('icon-size');
82
- flex-shrink: 0;
83
- position: relative; // Add this to ensure stable positioning
84
-
85
- svg {
86
- width: v.chip('icon-size');
87
- height: v.chip('icon-size');
88
- }
89
- }
90
-
91
- &-leading-icon {
92
- margin-right: 0; // Gap is handled by the content container
93
- }
94
-
95
- &-trailing-icon {
96
- margin-left: 0; // Gap is handled by the content container
97
-
98
- &:hover {
99
- opacity: 0.8;
100
- }
101
- }
102
-
103
- &-text {
104
- // Allow text to display normally
105
- white-space: nowrap;
106
- overflow: visible;
107
- }
108
-
109
- // Selected state (base)
110
- &--selected {
111
- font-weight: 500;
112
- }
113
-
114
- // Ripple container - state layers for interaction feedback
115
- .ripple {
116
- position: absolute;
117
- border-radius: 50%;
118
- transform: scale(0);
119
- pointer-events: none;
120
- background-color: currentColor;
121
- opacity: 0.12;
122
- }
123
-
124
- // ====== CHIP VARIANTS ======
125
-
126
- // Filled chip
127
- &--filled {
128
- background-color: t.color('surface-container-highest');
129
- color: t.color('on-surface');
130
-
131
- &:hover::after {
132
- content: '';
133
- position: absolute;
134
- inset: 0;
135
- background-color: t.color('on-surface');
136
- opacity: 0.08;
137
- pointer-events: none;
138
- border-radius: v.chip('border-radius');
139
- }
140
-
141
- &:active::after,
142
- &.#{$component}--active::after {
143
- content: '';
144
- position: absolute;
145
- inset: 0;
146
- background-color: t.color('on-surface');
147
- opacity: 0.12;
148
- pointer-events: none;
149
- border-radius: inherit;
150
- }
151
-
152
- &.#{$component}--selected {
153
- background-color: t.color('secondary-container');
154
- color: t.color('on-secondary-container');
155
-
156
- &:hover::after {
157
- content: '';
158
- position: absolute;
159
- inset: 0;
160
- background-color: t.color('on-secondary-container');
161
- opacity: 0.08;
162
- pointer-events: none;
163
- border-radius: inherit;
164
- }
165
-
166
- &:active::after,
167
- &.#{$component}--active::after {
168
- content: '';
169
- position: absolute;
170
- inset: 0;
171
- background-color: t.color('on-secondary-container');
172
- opacity: 0.12;
173
- pointer-events: none;
174
- border-radius: inherit;
175
- }
176
- }
177
- }
178
-
179
- // Outlined chip
180
- &--outlined {
181
- border: 1px solid t.alpha('outline', v.chip('outlined-border-opacity'));
182
- color: t.color('on-surface');
183
-
184
- &:hover::after {
185
- content: '';
186
- position: absolute;
187
- inset: 0;
188
- background-color: t.color('on-surface');
189
- opacity: 0.08;
190
- pointer-events: none;
191
- border-radius: inherit;
18
+ height: v.chip("height");
19
+ padding: 0 v.chip("padding-horizontal");
20
+ border-radius: v.chip("border-radius");
21
+ background-color: transparent;
22
+ max-width: 100%;
23
+ user-select: none;
24
+ cursor: pointer;
25
+
26
+ // Typography
27
+ @include m.typography("label-large");
28
+ // Enhanced transition for width changes
29
+ transition:
30
+ 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");
36
+
37
+ // Focus styles
38
+ &:focus {
39
+ outline: none;
192
40
  }
193
-
41
+
194
42
  &:focus-visible {
195
- border-color: t.alpha('outline', v.chip('outlined-border-focus-opacity'));
196
- }
197
-
198
- &:active::after,
199
- &.#{$component}--active::after {
200
- content: '';
201
- position: absolute;
202
- inset: 0;
203
- background-color: t.color('on-surface');
204
- opacity: 0.12;
205
- pointer-events: none;
206
- border-radius: inherit;
207
- }
208
-
209
- &.#{$component}--selected {
210
- border-color: transparent;
211
- background-color: t.color('secondary-container');
212
- color: t.color('on-secondary-container');
213
-
214
- &:hover::after {
215
- content: '';
216
- position: absolute;
217
- inset: 0;
218
- background-color: t.color('on-secondary-container');
219
- opacity: 0.08;
220
- pointer-events: none;
221
- border-radius: inherit;
222
- }
223
-
224
- &:active::after,
225
- &.#{$component}--active::after {
226
- content: '';
227
- position: absolute;
228
- inset: 0;
229
- background-color: t.color('on-secondary-container');
230
- opacity: 0.12;
231
- pointer-events: none;
232
- border-radius: inherit;
233
- }
43
+ outline: 2px solid t.color("outline");
44
+ outline-offset: 2px;
234
45
  }
235
- }
236
-
237
- // Elevated chip
238
- &--elevated {
239
- background-color: t.color('surface-container-low');
240
- color: t.color('on-surface');
241
- box-shadow: f.get-elevation(1);
242
-
243
- &:hover::after {
244
- content: '';
245
- position: absolute;
246
- inset: 0;
247
- background-color: t.color('on-surface');
248
- opacity: 0.08;
249
- pointer-events: none;
250
- border-radius: inherit;
251
- }
252
-
253
- &:active::after,
254
- &.#{$component}--active::after {
255
- content: '';
256
- position: absolute;
257
- inset: 0;
258
- background-color: t.color('on-surface');
259
- opacity: 0.12;
260
- pointer-events: none;
261
- border-radius: inherit;
46
+
47
+ // Active state - applied when the chip has a menu open
48
+ &--active {
49
+ // Base active state styling
50
+ // Will use variant-specific implementations below
51
+
52
+ // ARIA attribute to indicate active state for accessibility
53
+ &[aria-expanded="true"] {
54
+ // For compatibility with ARIA
55
+ }
262
56
  }
263
-
264
- &.#{$component}--selected {
265
- background-color: t.color('secondary-container');
266
- color: t.color('on-secondary-container');
267
-
268
- &:hover::after {
269
- content: '';
270
- position: absolute;
271
- inset: 0;
272
- background-color: t.color('on-secondary-container');
273
- opacity: 0.08;
274
- pointer-events: none;
275
- border-radius: inherit;
276
- }
277
-
278
- &:active::after,
279
- &.#{$component}--active::after {
280
- content: '';
281
- position: absolute;
282
- inset: 0;
283
- background-color: t.color('on-secondary-container');
284
- opacity: 0.12;
57
+
58
+ // Disabled state
59
+ &--disabled {
60
+ opacity: 0.38;
285
61
  pointer-events: none;
286
- border-radius: inherit;
287
- }
288
- }
289
- }
290
-
291
- // Filter chip
292
- &--filter {
293
- color: t.color('on-surface');
294
- position: relative;
295
- border: 1px solid t.alpha('outline', v.chip('outlined-border-opacity'));
296
-
297
- // Hover state for unselected chips
298
- &:hover::after {
299
- content: '';
300
- position: absolute;
301
- inset: 0;
302
- background-color: t.color('on-surface');
303
- opacity: 0.08;
304
- pointer-events: none;
305
- border-radius: calc(v.chip('border-radius') - 1px);
306
62
  }
307
-
308
- &:active::after,
309
- &.#{$component}--active::after {
310
- content: '';
311
- position: absolute;
312
- inset: 0;
313
- background-color: t.color('on-surface');
314
- opacity: 0.12;
315
- pointer-events: none;
316
- border-radius: calc(v.chip('border-radius') - 1px);
63
+
64
+ // Content container
65
+ &-content {
66
+ display: flex;
67
+ align-items: center;
68
+ justify-content: center;
69
+ width: 100%;
70
+ height: 100%;
71
+ gap: v.spacing("2");
317
72
  }
318
-
319
- &.#{$component}--selected {
320
-
321
- padding-left: 8px;
322
- background-color: t.color('secondary-container');
323
- color: t.color('on-secondary-container');
324
- --checkmark-color: currentColor; // Will inherit from text color
325
- border: none;
326
- .#{$component}-leading-icon {
327
- color: t.color('on-secondary-container');
328
- }
329
-
330
- // Use ::before exclusively for the checkmark icon with mask technique
331
- &::before {
332
- content: '';
333
- display: inline-block;
334
- width: 18px;
335
- height: 18px;
336
- background-color: var(--checkmark-color);
337
- 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");
338
- mask-position: center;
339
- mask-repeat: no-repeat;
340
- mask-size: contain;
341
- -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");
342
- -webkit-mask-position: center;
343
- -webkit-mask-repeat: no-repeat;
344
- -webkit-mask-size: contain;
345
- margin-right: 8px;
73
+
74
+ // Ensure proper layout with icons - independent of scrollable state
75
+ &-leading-icon,
76
+ &-trailing-icon {
77
+ display: inline-flex;
78
+ align-items: center;
79
+ justify-content: center;
80
+ min-width: v.chip("icon-size");
81
+ height: v.chip("icon-size");
346
82
  flex-shrink: 0;
347
- position: static;
348
- animation: checkmark-appear v.motion('duration-short4') v.motion('easing-emphasized') forwards;
349
- }
350
-
351
- // Hover state for selected chips
352
- &:hover::after {
353
- content: '';
354
- position: absolute;
355
- inset: 0;
356
- background-color: t.color('on-secondary-container');
357
- opacity: 0.08;
358
- pointer-events: none;
359
- border-radius: calc(v.chip('border-radius') - 1px);
360
- }
361
-
362
- &:active::after,
363
- &.#{$component}--active::after {
364
- content: '';
365
- position: absolute;
366
- inset: 0;
367
- background-color: t.color('on-secondary-container');
368
- opacity: 0.12;
369
- pointer-events: none;
370
- border-radius: calc(v.chip('border-radius') - 1px);
371
- }
83
+ position: relative; // Add this to ensure stable positioning
84
+
85
+ svg {
86
+ width: v.chip("icon-size");
87
+ height: v.chip("icon-size");
88
+ }
372
89
  }
373
- }
374
-
375
- // Assist chip
376
- &--assist {
377
- background-color: t.color('surface-container-low');
378
- color: t.color('on-surface');
379
-
380
- .#{$component}-leading-icon {
381
- color: t.color('primary');
90
+
91
+ &-leading-icon {
92
+ margin-right: 0; // Gap is handled by the content container
93
+ }
94
+
95
+ &-trailing-icon {
96
+ margin-left: 0; // Gap is handled by the content container
97
+
98
+ &:hover {
99
+ opacity: 0.8;
100
+ }
382
101
  }
383
-
384
- &:hover::after {
385
- content: '';
386
- position: absolute;
387
- inset: 0;
388
- background-color: t.color('on-surface');
389
- opacity: 0.08;
390
- pointer-events: none;
391
- border-radius: v.chip('border-radius');
102
+
103
+ &-text {
104
+ // Allow text to display normally
105
+ white-space: nowrap;
106
+ overflow: visible;
392
107
  }
393
-
394
- &:active::after,
395
- &.#{$component}--active::after {
396
- content: '';
397
- position: absolute;
398
- inset: 0;
399
- background-color: t.color('on-surface');
400
- opacity: 0.12;
401
- pointer-events: none;
402
- border-radius: v.chip('border-radius');
108
+
109
+ // Selected state (base)
110
+ &--selected {
111
+ font-weight: 500;
403
112
  }
404
-
405
- &.#{$component}--selected {
406
- background-color: t.color('secondary-container');
407
- color: t.color('on-secondary-container');
408
-
409
- .#{$component}-leading-icon {
410
- color: t.color('on-secondary-container');
411
- }
412
-
413
- &:hover::after {
414
- content: '';
113
+
114
+ // Ripple container - state layers for interaction feedback
115
+ .ripple {
415
116
  position: absolute;
416
- inset: 0;
417
- background-color: t.color('on-secondary-container');
418
- opacity: 0.08;
117
+ border-radius: 50%;
118
+ transform: scale(0);
419
119
  pointer-events: none;
420
- border-radius: inherit;
421
- }
422
-
423
- &:active::after,
424
- &.#{$component}--active::after {
425
- content: '';
426
- position: absolute;
427
- inset: 0;
428
- background-color: t.color('on-secondary-container');
120
+ background-color: currentColor;
429
121
  opacity: 0.12;
430
- pointer-events: none;
431
- border-radius: inherit;
432
- }
433
122
  }
434
- }
435
-
436
- // Input chip
437
- &--input {
438
- background-color: t.color('surface-container-highest');
439
- color: t.color('on-surface');
440
- border-radius: v.chip('border-radius');
441
-
442
- .#{$component}-trailing-icon {
443
- cursor: pointer;
444
-
445
- &:hover {
446
- color: t.color('error');
447
- }
123
+
124
+ // ====== CHIP VARIANTS ======
125
+
126
+ // Filled chip
127
+ &--filled {
128
+ background-color: t.color("surface-container-highest");
129
+ color: t.color("on-surface");
130
+
131
+ &:hover::after {
132
+ content: "";
133
+ position: absolute;
134
+ inset: 0;
135
+ background-color: t.color("on-surface");
136
+ opacity: 0.08;
137
+ pointer-events: none;
138
+ border-radius: v.chip("border-radius");
139
+ }
140
+
141
+ &:active::after,
142
+ &.#{$component}--active::after {
143
+ content: "";
144
+ position: absolute;
145
+ inset: 0;
146
+ background-color: t.color("on-surface");
147
+ opacity: 0.12;
148
+ pointer-events: none;
149
+ border-radius: inherit;
150
+ }
151
+
152
+ &.#{$component}--selected {
153
+ background-color: t.color("secondary-container");
154
+ color: t.color("on-secondary-container");
155
+
156
+ &:hover::after {
157
+ content: "";
158
+ position: absolute;
159
+ inset: 0;
160
+ background-color: t.color("on-secondary-container");
161
+ opacity: 0.08;
162
+ pointer-events: none;
163
+ border-radius: inherit;
164
+ }
165
+
166
+ &:active::after,
167
+ &.#{$component}--active::after {
168
+ content: "";
169
+ position: absolute;
170
+ inset: 0;
171
+ background-color: t.color("on-secondary-container");
172
+ opacity: 0.12;
173
+ pointer-events: none;
174
+ border-radius: inherit;
175
+ }
176
+ }
448
177
  }
449
-
450
- &:hover::after {
451
- content: '';
452
- position: absolute;
453
- inset: 0;
454
- background-color: t.color('on-surface');
455
- opacity: 0.08;
456
- pointer-events: none;
457
- border-radius: inherit;
178
+
179
+ // Outlined chip
180
+ &--outlined {
181
+ border: 1px solid t.alpha("outline", v.chip("outlined-border-opacity"));
182
+ color: t.color("on-surface");
183
+
184
+ &:hover::after {
185
+ content: "";
186
+ position: absolute;
187
+ inset: 0;
188
+ background-color: t.color("on-surface");
189
+ opacity: 0.08;
190
+ pointer-events: none;
191
+ border-radius: inherit;
192
+ }
193
+
194
+ &:focus-visible {
195
+ border-color: t.alpha(
196
+ "outline",
197
+ v.chip("outlined-border-focus-opacity")
198
+ );
199
+ }
200
+
201
+ &:active::after,
202
+ &.#{$component}--active::after {
203
+ content: "";
204
+ position: absolute;
205
+ inset: 0;
206
+ background-color: t.color("on-surface");
207
+ opacity: 0.12;
208
+ pointer-events: none;
209
+ border-radius: inherit;
210
+ }
211
+
212
+ &.#{$component}--selected {
213
+ border-color: transparent;
214
+ background-color: t.color("secondary-container");
215
+ color: t.color("on-secondary-container");
216
+
217
+ &:hover::after {
218
+ content: "";
219
+ position: absolute;
220
+ inset: 0;
221
+ background-color: t.color("on-secondary-container");
222
+ opacity: 0.08;
223
+ pointer-events: none;
224
+ border-radius: inherit;
225
+ }
226
+
227
+ &:active::after,
228
+ &.#{$component}--active::after {
229
+ content: "";
230
+ position: absolute;
231
+ inset: 0;
232
+ background-color: t.color("on-secondary-container");
233
+ opacity: 0.12;
234
+ pointer-events: none;
235
+ border-radius: inherit;
236
+ }
237
+ }
458
238
  }
459
-
460
- &:active::after,
461
- &.#{$component}--active::after {
462
- content: '';
463
- position: absolute;
464
- inset: 0;
465
- background-color: t.color('on-surface');
466
- opacity: 0.12;
467
- pointer-events: none;
468
- border-radius: inherit;
239
+
240
+ // Elevated chip
241
+ &--elevated {
242
+ background-color: t.color("surface-container-low");
243
+ color: t.color("on-surface");
244
+ box-shadow: f.get-elevation(1);
245
+
246
+ &:hover::after {
247
+ content: "";
248
+ position: absolute;
249
+ inset: 0;
250
+ background-color: t.color("on-surface");
251
+ opacity: 0.08;
252
+ pointer-events: none;
253
+ border-radius: inherit;
254
+ }
255
+
256
+ &:active::after,
257
+ &.#{$component}--active::after {
258
+ content: "";
259
+ position: absolute;
260
+ inset: 0;
261
+ background-color: t.color("on-surface");
262
+ opacity: 0.12;
263
+ pointer-events: none;
264
+ border-radius: inherit;
265
+ }
266
+
267
+ &.#{$component}--selected {
268
+ background-color: t.color("secondary-container");
269
+ color: t.color("on-secondary-container");
270
+
271
+ &:hover::after {
272
+ content: "";
273
+ position: absolute;
274
+ inset: 0;
275
+ background-color: t.color("on-secondary-container");
276
+ opacity: 0.08;
277
+ pointer-events: none;
278
+ border-radius: inherit;
279
+ }
280
+
281
+ &:active::after,
282
+ &.#{$component}--active::after {
283
+ content: "";
284
+ position: absolute;
285
+ inset: 0;
286
+ background-color: t.color("on-secondary-container");
287
+ opacity: 0.12;
288
+ pointer-events: none;
289
+ border-radius: inherit;
290
+ }
291
+ }
469
292
  }
470
- }
471
-
472
- // Suggestion chip
473
- &--suggestion {
474
- background-color: t.color('surface-container');
475
- color: t.color('on-surface');
476
- height: v.chip('suggestion-height');
477
-
478
- .#{$component}-leading-icon {
479
- width: v.chip('suggestion-icon-size');
480
- height: v.chip('suggestion-icon-size');
481
-
482
- svg {
483
- width: v.chip('suggestion-icon-size');
484
- height: v.chip('suggestion-icon-size');
485
- }
293
+
294
+ // Filter chip
295
+ &--filter {
296
+ color: t.color("on-surface");
297
+ position: relative;
298
+ border: 1px solid t.alpha("outline", v.chip("outlined-border-opacity"));
299
+
300
+ // Hover state for unselected chips
301
+ &:hover::after {
302
+ content: "";
303
+ position: absolute;
304
+ inset: 0;
305
+ background-color: t.color("on-surface");
306
+ opacity: 0.08;
307
+ pointer-events: none;
308
+ border-radius: calc(v.chip("border-radius") - 1px);
309
+ }
310
+
311
+ &:active::after,
312
+ &.#{$component}--active::after {
313
+ content: "";
314
+ position: absolute;
315
+ inset: 0;
316
+ background-color: t.color("on-surface");
317
+ opacity: 0.12;
318
+ pointer-events: none;
319
+ border-radius: calc(v.chip("border-radius") - 1px);
320
+ }
321
+
322
+ &.#{$component}--selected {
323
+ padding-left: 8px;
324
+ background-color: t.color("secondary-container");
325
+ color: t.color("on-secondary-container");
326
+ --checkmark-color: currentColor; // Will inherit from text color
327
+ border: none;
328
+ .#{$component}-leading-icon {
329
+ color: t.color("on-secondary-container");
330
+ }
331
+
332
+ // Use ::before exclusively for the checkmark icon with mask technique
333
+ &::before {
334
+ content: "";
335
+ display: inline-block;
336
+ width: 18px;
337
+ height: 18px;
338
+ background-color: var(--checkmark-color);
339
+ 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");
340
+ mask-position: center;
341
+ mask-repeat: no-repeat;
342
+ mask-size: contain;
343
+ -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");
344
+ -webkit-mask-position: center;
345
+ -webkit-mask-repeat: no-repeat;
346
+ -webkit-mask-size: contain;
347
+ margin-right: 8px;
348
+ flex-shrink: 0;
349
+ position: static;
350
+ animation: checkmark-appear v.motion("duration-short4")
351
+ v.motion("easing-emphasized") forwards;
352
+ }
353
+
354
+ // Hover state for selected chips
355
+ &:hover::after {
356
+ content: "";
357
+ position: absolute;
358
+ inset: 0;
359
+ background-color: t.color("on-secondary-container");
360
+ opacity: 0.08;
361
+ pointer-events: none;
362
+ border-radius: calc(v.chip("border-radius") - 1px);
363
+ }
364
+
365
+ &:active::after,
366
+ &.#{$component}--active::after {
367
+ content: "";
368
+ position: absolute;
369
+ inset: 0;
370
+ background-color: t.color("on-secondary-container");
371
+ opacity: 0.12;
372
+ pointer-events: none;
373
+ border-radius: calc(v.chip("border-radius") - 1px);
374
+ }
375
+ }
486
376
  }
487
-
488
- &:hover::after {
489
- content: '';
490
- position: absolute;
491
- inset: 0;
492
- background-color: t.color('on-surface');
493
- opacity: 0.08;
494
- pointer-events: none;
495
- border-radius: inherit;
377
+
378
+ // Assist chip
379
+ &--assist {
380
+ background-color: t.color("surface-container-low");
381
+ color: t.color("on-surface");
382
+
383
+ .#{$component}-leading-icon {
384
+ color: t.color("primary");
385
+ }
386
+
387
+ &:hover::after {
388
+ content: "";
389
+ position: absolute;
390
+ inset: 0;
391
+ background-color: t.color("on-surface");
392
+ opacity: 0.08;
393
+ pointer-events: none;
394
+ border-radius: v.chip("border-radius");
395
+ }
396
+
397
+ &:active::after,
398
+ &.#{$component}--active::after {
399
+ content: "";
400
+ position: absolute;
401
+ inset: 0;
402
+ background-color: t.color("on-surface");
403
+ opacity: 0.12;
404
+ pointer-events: none;
405
+ border-radius: v.chip("border-radius");
406
+ }
407
+
408
+ &.#{$component}--selected {
409
+ background-color: t.color("secondary-container");
410
+ color: t.color("on-secondary-container");
411
+
412
+ .#{$component}-leading-icon {
413
+ color: t.color("on-secondary-container");
414
+ }
415
+
416
+ &:hover::after {
417
+ content: "";
418
+ position: absolute;
419
+ inset: 0;
420
+ background-color: t.color("on-secondary-container");
421
+ opacity: 0.08;
422
+ pointer-events: none;
423
+ border-radius: inherit;
424
+ }
425
+
426
+ &:active::after,
427
+ &.#{$component}--active::after {
428
+ content: "";
429
+ position: absolute;
430
+ inset: 0;
431
+ background-color: t.color("on-secondary-container");
432
+ opacity: 0.12;
433
+ pointer-events: none;
434
+ border-radius: inherit;
435
+ }
436
+ }
496
437
  }
497
-
498
- &:active::after,
499
- &.#{$component}--active::after {
500
- content: '';
501
- position: absolute;
502
- inset: 0;
503
- background-color: t.color('on-surface');
504
- opacity: 0.12;
505
- pointer-events: none;
506
- border-radius: inherit;
438
+
439
+ // Input chip
440
+ &--input {
441
+ background-color: t.color("surface-container-highest");
442
+ color: t.color("on-surface");
443
+ border-radius: v.chip("border-radius");
444
+
445
+ .#{$component}-trailing-icon {
446
+ cursor: pointer;
447
+
448
+ &:hover {
449
+ color: t.color("error");
450
+ }
451
+ }
452
+
453
+ &:hover::after {
454
+ content: "";
455
+ position: absolute;
456
+ inset: 0;
457
+ background-color: t.color("on-surface");
458
+ opacity: 0.08;
459
+ pointer-events: none;
460
+ border-radius: inherit;
461
+ }
462
+
463
+ &:active::after,
464
+ &.#{$component}--active::after {
465
+ content: "";
466
+ position: absolute;
467
+ inset: 0;
468
+ background-color: t.color("on-surface");
469
+ opacity: 0.12;
470
+ pointer-events: none;
471
+ border-radius: inherit;
472
+ }
507
473
  }
508
-
509
- &.#{$component}--selected {
510
- background-color: t.color('secondary-container');
511
- color: t.color('on-secondary-container');
512
-
513
- &:hover::after {
514
- content: '';
515
- position: absolute;
516
- inset: 0;
517
- background-color: t.color('on-secondary-container');
518
- opacity: 0.08;
519
- pointer-events: none;
520
- border-radius: inherit;
521
- }
522
-
523
- &:active::after,
524
- &.#{$component}--active::after {
525
- content: '';
526
- position: absolute;
527
- inset: 0;
528
- background-color: t.color('on-secondary-container');
529
- opacity: 0.12;
530
- pointer-events: none;
531
- border-radius: inherit;
532
- }
474
+
475
+ // Suggestion chip
476
+ &--suggestion {
477
+ background-color: t.color("surface-container");
478
+ color: t.color("on-surface");
479
+ height: v.chip("suggestion-height");
480
+
481
+ .#{$component}-leading-icon {
482
+ width: v.chip("suggestion-icon-size");
483
+ height: v.chip("suggestion-icon-size");
484
+
485
+ svg {
486
+ width: v.chip("suggestion-icon-size");
487
+ height: v.chip("suggestion-icon-size");
488
+ }
489
+ }
490
+
491
+ &:hover::after {
492
+ content: "";
493
+ position: absolute;
494
+ inset: 0;
495
+ background-color: t.color("on-surface");
496
+ opacity: 0.08;
497
+ pointer-events: none;
498
+ border-radius: inherit;
499
+ }
500
+
501
+ &:active::after,
502
+ &.#{$component}--active::after {
503
+ content: "";
504
+ position: absolute;
505
+ inset: 0;
506
+ background-color: t.color("on-surface");
507
+ opacity: 0.12;
508
+ pointer-events: none;
509
+ border-radius: inherit;
510
+ }
511
+
512
+ &.#{$component}--selected {
513
+ background-color: t.color("secondary-container");
514
+ color: t.color("on-secondary-container");
515
+
516
+ &:hover::after {
517
+ content: "";
518
+ position: absolute;
519
+ inset: 0;
520
+ background-color: t.color("on-secondary-container");
521
+ opacity: 0.08;
522
+ pointer-events: none;
523
+ border-radius: inherit;
524
+ }
525
+
526
+ &:active::after,
527
+ &.#{$component}--active::after {
528
+ content: "";
529
+ position: absolute;
530
+ inset: 0;
531
+ background-color: t.color("on-secondary-container");
532
+ opacity: 0.12;
533
+ pointer-events: none;
534
+ border-radius: inherit;
535
+ }
536
+ }
533
537
  }
534
- }
535
538
  }
536
539
 
537
540
  // Animation for checkmark appearance
538
541
  @keyframes checkmark-appear {
539
- from {
540
- transform: scale(0);
541
- opacity: 0;
542
- }
543
- to {
544
- transform: scale(1);
545
- opacity: 1;
546
- }
542
+ from {
543
+ transform: scale(0);
544
+ opacity: 0;
545
+ }
546
+ to {
547
+ transform: scale(1);
548
+ opacity: 1;
549
+ }
547
550
  }
548
551
 
549
552
  // Chips container
550
553
  .#{$container} {
551
- display: flex;
552
- flex-wrap: wrap;
553
- gap: v.spacing('2');
554
- width: 100%;
555
- min-height: fit-content;
556
- height: auto;
557
-
558
- // Label styling
559
- &-label {
560
- @include m.typography('label-medium');
561
- font-size: 18px;
562
- color: t.color('on-surface-variant');
563
- margin-bottom: v.spacing('2');
564
- display: block;
565
- width: 100%;
566
- }
567
-
568
- // Layout with label
569
- &--with-label {
570
- display: flex;
571
- flex-direction: column;
572
-
573
- // When label is at the end
574
- &.#{$container}--label-end {
575
- flex-direction: column-reverse;
576
-
577
- .#{$container}-label {
578
- margin-bottom: 0;
579
- margin-top: v.spacing('2');
580
- }
581
- }
582
- }
583
-
584
- // Container for chips
585
- &-container {
586
554
  display: flex;
587
555
  flex-wrap: wrap;
588
- gap: v.spacing('2');
556
+ gap: v.spacing("2");
589
557
  width: 100%;
590
- }
591
-
592
- // Important: Scrollable state only affects the container, not the chip icons
593
- &--scrollable {
594
- .#{$container}-container {
595
- flex-wrap: nowrap;
596
- overflow-x: auto;
597
- overflow-y: visible; // Don't clip chips vertically
598
- -webkit-overflow-scrolling: touch;
599
- scroll-behavior: smooth;
600
- padding-bottom: v.spacing('2');
601
-
602
- // Enhanced scrollable behavior
603
- position: relative;
604
- white-space: nowrap;
605
-
606
- // Improved scrollbar styling
607
- &::-webkit-scrollbar {
608
- height: 4px;
609
- }
610
-
611
- &::-webkit-scrollbar-thumb {
612
- background-color: t.alpha('on-surface', 0.2);
613
- border-radius: 4px;
614
- }
615
-
616
- &::-webkit-scrollbar-track {
617
- background-color: t.alpha('on-surface', 0.05);
618
- border-radius: 4px;
619
- }
620
-
621
- // Style for Firefox
622
- scrollbar-width: thin;
623
- scrollbar-color: t.alpha('on-surface', 0.2) t.alpha('on-surface', 0.05);
624
-
625
- // Ensure chip visibility without affecting internal structure
626
- .#{$component} {
627
- flex-shrink: 0; // Prevent chips from shrinking
628
- }
558
+ min-height: fit-content;
559
+ height: auto;
560
+
561
+ // Label styling
562
+ &-label {
563
+ @include m.typography("label-medium");
564
+ font-size: 16px;
565
+ color: t.color("on-surface-variant");
566
+ // margin-bottom: v.spacing("2");
567
+ display: block;
568
+ width: 100%;
629
569
  }
630
- }
631
-
632
- &--vertical {
633
- .#{$container}-container {
634
- flex-direction: column;
635
- align-items: flex-start;
636
- gap: v.spacing('2');
570
+
571
+ // Layout with label
572
+ &--with-label {
573
+ display: flex;
574
+ flex-direction: column;
575
+
576
+ // When label is at the end
577
+ &.#{$container}--label-end {
578
+ flex-direction: column-reverse;
579
+
580
+ .#{$container}-label {
581
+ margin-bottom: 0;
582
+ margin-top: v.spacing("2");
583
+ }
584
+ }
585
+ }
586
+
587
+ // Container for chips
588
+ &-container {
589
+ display: flex;
590
+ flex-wrap: wrap;
591
+ gap: v.spacing("2");
592
+ width: 100%;
593
+ }
594
+
595
+ // Important: Scrollable state only affects the container, not the chip icons
596
+ &--scrollable {
597
+ .#{$container}-container {
598
+ flex-wrap: nowrap;
599
+ overflow-x: auto;
600
+ overflow-y: visible; // Don't clip chips vertically
601
+ -webkit-overflow-scrolling: touch;
602
+ scroll-behavior: smooth;
603
+ padding-bottom: v.spacing("2");
604
+
605
+ // Enhanced scrollable behavior
606
+ position: relative;
607
+ white-space: nowrap;
608
+
609
+ // Improved scrollbar styling
610
+ &::-webkit-scrollbar {
611
+ height: 4px;
612
+ }
613
+
614
+ &::-webkit-scrollbar-thumb {
615
+ background-color: t.alpha("on-surface", 0.2);
616
+ border-radius: 4px;
617
+ }
618
+
619
+ &::-webkit-scrollbar-track {
620
+ background-color: t.alpha("on-surface", 0.05);
621
+ border-radius: 4px;
622
+ }
623
+
624
+ // Style for Firefox
625
+ scrollbar-width: thin;
626
+ scrollbar-color: t.alpha("on-surface", 0.2)
627
+ t.alpha("on-surface", 0.05);
628
+
629
+ // Ensure chip visibility without affecting internal structure
630
+ .#{$component} {
631
+ flex-shrink: 0; // Prevent chips from shrinking
632
+ }
633
+ }
634
+ }
635
+
636
+ &--vertical {
637
+ .#{$container}-container {
638
+ flex-direction: column;
639
+ align-items: flex-start;
640
+ gap: v.spacing("2");
641
+ }
637
642
  }
638
- }
639
- }
643
+ }