@mt-gloss/styles 0.0.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.
@@ -0,0 +1,482 @@
1
+ // ============================================
2
+ // COMPONENT: SELECT
3
+ // Rich content select with multi-line support
4
+ // ============================================
5
+
6
+ @use '../tokens' as *;
7
+ @use '../mixins' as *;
8
+
9
+ .gloss-select {
10
+ position: relative;
11
+ width: 100%;
12
+ max-width: 400px;
13
+ }
14
+
15
+ // --- TRIGGER ---
16
+ .gloss-select__trigger {
17
+ cursor: pointer;
18
+ display: flex;
19
+ align-items: center;
20
+ gap: $space-3;
21
+ width: 100%;
22
+ background: $color-white;
23
+ border: 1px solid $alias-border-default;
24
+ border-radius: $radius-md;
25
+ padding: $space-3 $space-4;
26
+ @include shadow-input-default;
27
+ font-size: $text-base;
28
+ font-weight: 500;
29
+ color: $alias-text-primary;
30
+ transition: all 0.2s;
31
+ min-height: 48px;
32
+
33
+ &:hover:not(.gloss-select--disabled &) {
34
+ background: $alias-bg-hover;
35
+ border-color: $alias-border-hover;
36
+ }
37
+
38
+ &--active {
39
+ border-color: $alias-border-focus;
40
+ @include shadow-input-focus;
41
+ background: $alias-bg-hover;
42
+ }
43
+
44
+ &:focus {
45
+ outline: none;
46
+ border-color: $alias-border-focus;
47
+ @include shadow-input-focus;
48
+ }
49
+ }
50
+
51
+ .gloss-select__trigger-content {
52
+ flex: 1;
53
+ min-width: 0;
54
+ text-align: left;
55
+
56
+ // Handle text overflow for single-line content
57
+ &:has(> :only-child:not([class])) {
58
+ overflow: hidden;
59
+ text-overflow: ellipsis;
60
+ white-space: nowrap;
61
+ }
62
+ }
63
+
64
+ // --- ICON SLOTS ---
65
+ .gloss-select__icon {
66
+ flex-shrink: 0;
67
+ display: flex;
68
+ color: $alias-text-tertiary;
69
+
70
+ &--left {
71
+ // Default positioning
72
+ }
73
+
74
+ &--right {
75
+ // Default positioning
76
+ }
77
+
78
+ &--top {
79
+ align-self: flex-start;
80
+ margin-top: 2px;
81
+ }
82
+
83
+ &--center {
84
+ align-self: center;
85
+ }
86
+ }
87
+
88
+ // --- MENU ---
89
+ .gloss-select__menu {
90
+ position: absolute;
91
+ top: 100%;
92
+ left: 0;
93
+ right: 0;
94
+ margin-top: $space-2;
95
+ background: $alias-bg-surface;
96
+ border: 1px solid $alias-border-default;
97
+ border-radius: $radius-md;
98
+ @include shadow-card;
99
+ z-index: 1000;
100
+ overflow: hidden;
101
+ padding: $space-1;
102
+ animation: slideDownFade 0.15s ease-out;
103
+ }
104
+
105
+ // --- OPTION ---
106
+ .gloss-select__option {
107
+ display: flex;
108
+ align-items: flex-start;
109
+ gap: $space-3;
110
+ padding: $space-3 $space-4;
111
+ font-size: $text-sm;
112
+ color: $alias-text-primary;
113
+ cursor: pointer;
114
+ border-radius: $radius-sm;
115
+ transition: background 0.1s;
116
+
117
+ &:hover:not(.gloss-select__option--disabled) {
118
+ background: $color-gray-100;
119
+ }
120
+
121
+ &--selected {
122
+ background: $color-blue-50;
123
+ font-weight: 600;
124
+
125
+ .gloss-select__option-label {
126
+ color: $alias-primary;
127
+ }
128
+ }
129
+
130
+ &--disabled {
131
+ opacity: 0.5;
132
+ cursor: not-allowed;
133
+ }
134
+ }
135
+
136
+ .gloss-select__option-icon {
137
+ flex-shrink: 0;
138
+ display: flex;
139
+ color: $alias-text-secondary;
140
+
141
+ &--top {
142
+ align-self: flex-start;
143
+ margin-top: 2px;
144
+ }
145
+
146
+ &--center {
147
+ align-self: center;
148
+ }
149
+
150
+ .gloss-select__option--selected & {
151
+ color: $alias-primary;
152
+ }
153
+ }
154
+
155
+ .gloss-select__option-content {
156
+ flex: 1;
157
+ min-width: 0;
158
+ display: flex;
159
+ flex-direction: column;
160
+ gap: $space-1;
161
+ }
162
+
163
+ .gloss-select__option-label {
164
+ // Inherits font from parent
165
+ line-height: 1.4;
166
+ }
167
+
168
+ .gloss-select__option-description {
169
+ font-size: $text-xs;
170
+ font-weight: 400;
171
+ color: $alias-text-tertiary;
172
+ line-height: 1.4;
173
+
174
+ .gloss-select__option--selected & {
175
+ color: $alias-text-secondary;
176
+ }
177
+ }
178
+
179
+ .gloss-select__option-indicator {
180
+ flex-shrink: 0;
181
+ display: flex;
182
+ opacity: 0;
183
+ color: $alias-primary;
184
+ transition: opacity 0.1s;
185
+
186
+ &--visible {
187
+ opacity: 1;
188
+ }
189
+ }
190
+
191
+ // --- SIZE VARIANTS ---
192
+ .gloss-select--sm {
193
+ .gloss-select__trigger {
194
+ padding: $space-2 $space-3;
195
+ min-height: 36px;
196
+ font-size: $text-sm;
197
+ gap: $space-2;
198
+ }
199
+
200
+ .gloss-select__option {
201
+ padding: $space-2 $space-3;
202
+ gap: $space-2;
203
+ }
204
+ }
205
+
206
+ .gloss-select--lg {
207
+ .gloss-select__trigger {
208
+ padding: $space-4 $space-5;
209
+ min-height: 56px;
210
+ font-size: $text-lg;
211
+ gap: $space-4;
212
+ }
213
+
214
+ .gloss-select__option {
215
+ padding: $space-4 $space-5;
216
+ font-size: $text-base;
217
+ gap: $space-4;
218
+ }
219
+ }
220
+
221
+ // --- DISABLED STATE ---
222
+ .gloss-select--disabled {
223
+ .gloss-select__trigger {
224
+ background: $alias-bg-disabled;
225
+ box-shadow: $shadow-input-disabled;
226
+ cursor: not-allowed;
227
+ color: $alias-text-tertiary;
228
+ border-color: transparent;
229
+ }
230
+ }
231
+
232
+ // --- SUCCESS STATE ---
233
+ .gloss-select--success {
234
+ .gloss-select__trigger {
235
+ border-color: $alias-border-success;
236
+ @include shadow-input-default;
237
+
238
+ &:hover:not(.gloss-select--disabled &) {
239
+ background: $alias-bg-hover;
240
+ }
241
+
242
+ &--active,
243
+ &:focus {
244
+ background: $alias-bg-hover;
245
+ box-shadow: $shadow-input-success-focus;
246
+ }
247
+ }
248
+ }
249
+
250
+ // --- ERROR STATE ---
251
+ .gloss-select--error {
252
+ .gloss-select__trigger {
253
+ border-color: $color-red-200;
254
+ background: $alias-bg-error;
255
+ box-shadow: $shadow-input-error;
256
+
257
+ &:hover:not(.gloss-select--disabled &) {
258
+ border-color: $color-red-400;
259
+ }
260
+
261
+ &--active,
262
+ &:focus {
263
+ border-color: $color-red-400;
264
+ box-shadow: $shadow-input-error-focus;
265
+ }
266
+ }
267
+ }
268
+
269
+ // --- FORCED STATES (for documentation/preview) ---
270
+ .gloss-select--force-hover {
271
+ .gloss-select__trigger {
272
+ background: $alias-bg-hover;
273
+ border-color: $alias-border-hover;
274
+ }
275
+ }
276
+
277
+ .gloss-select--force-focus {
278
+ .gloss-select__trigger {
279
+ border-color: $alias-border-focus;
280
+ @include shadow-input-focus;
281
+ background: $alias-bg-hover;
282
+ }
283
+ }
284
+
285
+ // --- TRIGGER ACTIONS (clear button + chevron) ---
286
+ .gloss-select__trigger-actions {
287
+ display: flex;
288
+ align-items: center;
289
+ gap: $space-1;
290
+ flex-shrink: 0;
291
+ }
292
+
293
+ // --- CLEAR BUTTON ---
294
+ .gloss-select__clear {
295
+ display: flex;
296
+ align-items: center;
297
+ justify-content: center;
298
+ padding: $space-1;
299
+ border: none;
300
+ background: transparent;
301
+ color: $alias-text-tertiary;
302
+ cursor: pointer;
303
+ border-radius: $radius-sm;
304
+ transition: color 0.15s ease, background-color 0.15s ease;
305
+
306
+ &:hover {
307
+ color: $alias-text-primary;
308
+ background: $alias-bg-hover;
309
+ }
310
+ }
311
+
312
+ // --- PLACEHOLDER ---
313
+ .gloss-select__placeholder {
314
+ color: $alias-text-tertiary;
315
+ font-weight: 400;
316
+ }
317
+
318
+ // --- MULTI-SELECT CHIPS ---
319
+ .gloss-select--multiple {
320
+ .gloss-select__trigger {
321
+ flex-wrap: wrap;
322
+ min-height: auto;
323
+ padding: $space-2;
324
+ }
325
+
326
+ .gloss-select__trigger-content {
327
+ flex: 1;
328
+ min-width: 100px;
329
+ }
330
+ }
331
+
332
+ .gloss-select__trigger-chips {
333
+ display: flex;
334
+ flex-wrap: wrap;
335
+ gap: $space-1;
336
+ }
337
+
338
+ .gloss-select__chip {
339
+ display: inline-flex;
340
+ align-items: center;
341
+ gap: $space-1;
342
+ padding: $space-1 $space-2;
343
+ background: $alias-bg-secondary;
344
+ border-radius: $radius-full;
345
+ font-size: $text-xs;
346
+ font-weight: 500;
347
+ color: $alias-text-primary;
348
+
349
+ &--more {
350
+ background: $color-gray-200;
351
+ color: $alias-text-secondary;
352
+ }
353
+ }
354
+
355
+ .gloss-select__chip-label {
356
+ max-width: 120px;
357
+ overflow: hidden;
358
+ text-overflow: ellipsis;
359
+ white-space: nowrap;
360
+ }
361
+
362
+ .gloss-select__chip-remove {
363
+ display: flex;
364
+ padding: 0;
365
+ border: none;
366
+ background: transparent;
367
+ color: $alias-text-tertiary;
368
+ cursor: pointer;
369
+ transition: color 0.15s ease;
370
+
371
+ &:hover {
372
+ color: $alias-text-primary;
373
+ }
374
+ }
375
+
376
+ // --- SEARCH INPUT ---
377
+ .gloss-select__search {
378
+ display: flex;
379
+ align-items: center;
380
+ gap: $space-2;
381
+ padding: $space-2 $space-3;
382
+ border-bottom: 1px solid $alias-border-default;
383
+ }
384
+
385
+ .gloss-select__search-icon {
386
+ color: $alias-text-tertiary;
387
+ flex-shrink: 0;
388
+ }
389
+
390
+ .gloss-select__search-input {
391
+ flex: 1;
392
+ border: none;
393
+ background: transparent;
394
+ font-size: $text-sm;
395
+ color: $alias-text-primary;
396
+ outline: none;
397
+
398
+ &::placeholder {
399
+ color: $alias-text-tertiary;
400
+ }
401
+ }
402
+
403
+ // --- OPTIONS CONTAINER ---
404
+ .gloss-select__options {
405
+ max-height: 320px;
406
+ overflow-y: auto;
407
+ overscroll-behavior: contain;
408
+ }
409
+
410
+ // --- OPTION GROUPS ---
411
+ .gloss-select__group {
412
+ &:not(:first-child) {
413
+ margin-top: $space-2;
414
+ padding-top: $space-2;
415
+ border-top: 1px solid $alias-border-default;
416
+ }
417
+ }
418
+
419
+ .gloss-select__group-header {
420
+ padding: $space-2 $space-4;
421
+ font-size: $text-xs;
422
+ font-weight: 600;
423
+ text-transform: uppercase;
424
+ letter-spacing: 0.5px;
425
+ color: $alias-text-tertiary;
426
+ }
427
+
428
+ // --- OPTION CHECKBOX (for multi-select) ---
429
+ .gloss-select__option-checkbox {
430
+ display: flex;
431
+ align-items: center;
432
+ justify-content: center;
433
+ width: 16px;
434
+ height: 16px;
435
+ border: 1px solid $alias-border-default;
436
+ border-radius: $radius-sm;
437
+ flex-shrink: 0;
438
+ transition: all 0.15s ease;
439
+
440
+ &--checked {
441
+ background: $alias-primary;
442
+ border-color: $alias-primary;
443
+ color: white;
444
+ }
445
+ }
446
+
447
+ // --- FOCUSED OPTION (keyboard navigation) ---
448
+ .gloss-select__option--focused {
449
+ background: $color-gray-100;
450
+ }
451
+
452
+ // --- LOADING STATE ---
453
+ .gloss-select__loading {
454
+ display: flex;
455
+ align-items: center;
456
+ justify-content: center;
457
+ padding: $space-6;
458
+ color: $alias-text-tertiary;
459
+ font-size: $text-sm;
460
+ }
461
+
462
+ // --- NO RESULTS ---
463
+ .gloss-select__no-results {
464
+ padding: $space-6;
465
+ text-align: center;
466
+ color: $alias-text-tertiary;
467
+ font-size: $text-sm;
468
+ }
469
+
470
+ // --- CREATE OPTION ---
471
+ .gloss-select__option--create {
472
+ color: $alias-primary;
473
+ font-weight: 500;
474
+
475
+ .gloss-select__option-icon {
476
+ color: $alias-primary;
477
+ }
478
+
479
+ &:hover {
480
+ background: $color-blue-50;
481
+ }
482
+ }