@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,590 @@
1
+ // ============================================
2
+ // COMPONENT: SPECIALIZED (FileUpload, ColorPicker, Rating)
3
+ // ============================================
4
+
5
+ @use '../tokens' as *;
6
+ @use '../mixins' as *;
7
+
8
+ // --- FILE UPLOAD ---
9
+ .gloss-file-upload-wrapper {
10
+ display: flex;
11
+ flex-direction: column;
12
+ gap: $space-2;
13
+
14
+ &--disabled {
15
+ opacity: 0.6;
16
+ }
17
+ }
18
+
19
+ .gloss-file-upload__label {
20
+ font-size: $text-sm;
21
+ font-weight: 500;
22
+ color: $alias-text-primary;
23
+ }
24
+
25
+ .gloss-file-upload__input {
26
+ position: absolute;
27
+ width: 1px;
28
+ height: 1px;
29
+ padding: 0;
30
+ margin: -1px;
31
+ overflow: hidden;
32
+ clip: rect(0, 0, 0, 0);
33
+ border: 0;
34
+ }
35
+
36
+ .gloss-file-upload--dropzone {
37
+ display: flex;
38
+ flex-direction: column;
39
+ align-items: center;
40
+ justify-content: center;
41
+ padding: $space-8 $space-6;
42
+ background: $color-gray-50;
43
+ border: 2px dashed $alias-border-default;
44
+ border-radius: $radius-lg;
45
+ cursor: pointer;
46
+ transition: border-color 0.2s ease, background-color 0.2s ease;
47
+
48
+ &:hover:not(.gloss-file-upload--disabled) {
49
+ border-color: $alias-primary;
50
+ background: $color-blue-50;
51
+ }
52
+
53
+ &.gloss-file-upload--drag-over {
54
+ border-color: $alias-primary;
55
+ background: $color-blue-50;
56
+ }
57
+
58
+ &.gloss-file-upload--error {
59
+ border-color: $alias-border-error;
60
+ }
61
+
62
+ .gloss-file-upload__dropzone {
63
+ display: flex;
64
+ flex-direction: column;
65
+ align-items: center;
66
+ gap: $space-3;
67
+ text-align: center;
68
+
69
+ svg {
70
+ color: $alias-text-secondary;
71
+ }
72
+ }
73
+
74
+ .gloss-file-upload__text {
75
+ font-size: $text-sm;
76
+ color: $alias-text-secondary;
77
+ }
78
+
79
+ .gloss-file-upload__accept {
80
+ font-size: $text-xs;
81
+ color: $alias-text-tertiary;
82
+ }
83
+ }
84
+
85
+ .gloss-file-upload--button {
86
+ display: inline-flex;
87
+ align-items: center;
88
+ gap: $space-2;
89
+ padding: $space-2 $space-4;
90
+ background: $alias-bg-surface;
91
+ border: 1px solid $alias-border-default;
92
+ border-radius: $radius-md;
93
+ font-family: $font-body;
94
+ font-size: $text-sm;
95
+ font-weight: 500;
96
+ color: $alias-text-primary;
97
+ cursor: pointer;
98
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
99
+ @include shadow-input-default;
100
+
101
+ &:hover:not(:disabled) {
102
+ border-color: $alias-border-hover;
103
+ @include shadow-elevation-hover;
104
+ }
105
+
106
+ &:disabled {
107
+ cursor: not-allowed;
108
+ opacity: 0.6;
109
+ }
110
+ }
111
+
112
+ .gloss-file-upload--compact {
113
+ display: inline-flex;
114
+ align-items: center;
115
+ gap: $space-2;
116
+ padding: $space-2 $space-3;
117
+ background: transparent;
118
+ border: none;
119
+ font-size: $text-sm;
120
+ color: $alias-primary;
121
+ cursor: pointer;
122
+
123
+ &:hover {
124
+ text-decoration: underline;
125
+ }
126
+
127
+ .gloss-file-upload__compact-text {
128
+ font-weight: 500;
129
+ }
130
+ }
131
+
132
+ .gloss-file-upload__files {
133
+ display: flex;
134
+ flex-direction: column;
135
+ gap: $space-2;
136
+ margin-top: $space-3;
137
+ }
138
+
139
+ .gloss-file-upload__file {
140
+ display: flex;
141
+ align-items: center;
142
+ gap: $space-3;
143
+ padding: $space-3;
144
+ background: $alias-bg-surface;
145
+ border: 1px solid $alias-border-default;
146
+ border-radius: $radius-md;
147
+
148
+ &--error {
149
+ border-color: $alias-border-error;
150
+ background: $alias-bg-error;
151
+ }
152
+ }
153
+
154
+ .gloss-file-upload__preview {
155
+ width: 48px;
156
+ height: 48px;
157
+ object-fit: cover;
158
+ border-radius: $radius-sm;
159
+ }
160
+
161
+ .gloss-file-upload__file-icon {
162
+ display: flex;
163
+ align-items: center;
164
+ justify-content: center;
165
+ width: 48px;
166
+ height: 48px;
167
+ background: $color-gray-100;
168
+ border-radius: $radius-sm;
169
+ color: $alias-text-secondary;
170
+ }
171
+
172
+ .gloss-file-upload__file-info {
173
+ flex: 1;
174
+ min-width: 0;
175
+ }
176
+
177
+ .gloss-file-upload__file-name {
178
+ display: block;
179
+ font-size: $text-sm;
180
+ font-weight: 500;
181
+ color: $alias-text-primary;
182
+ white-space: nowrap;
183
+ overflow: hidden;
184
+ text-overflow: ellipsis;
185
+ }
186
+
187
+ .gloss-file-upload__file-size {
188
+ font-size: $text-xs;
189
+ color: $alias-text-secondary;
190
+ }
191
+
192
+ .gloss-file-upload__file-error {
193
+ display: block;
194
+ font-size: $text-xs;
195
+ color: $alias-text-error;
196
+ }
197
+
198
+ .gloss-file-upload__progress {
199
+ width: 100%;
200
+ height: 4px;
201
+ background: $color-gray-200;
202
+ border-radius: $radius-full;
203
+ overflow: hidden;
204
+ margin-top: $space-2;
205
+ }
206
+
207
+ .gloss-file-upload__progress-bar {
208
+ height: 100%;
209
+ background: $alias-primary;
210
+ transition: width 0.3s ease;
211
+ }
212
+
213
+ .gloss-file-upload__remove {
214
+ display: flex;
215
+ align-items: center;
216
+ justify-content: center;
217
+ width: 28px;
218
+ height: 28px;
219
+ padding: 0;
220
+ background: transparent;
221
+ border: none;
222
+ border-radius: $radius-sm;
223
+ color: $alias-text-secondary;
224
+ cursor: pointer;
225
+ transition: background-color 0.15s ease, color 0.15s ease;
226
+
227
+ &:hover {
228
+ background: $color-gray-100;
229
+ color: $alias-text-primary;
230
+ }
231
+ }
232
+
233
+ .gloss-file-upload__helper {
234
+ display: flex;
235
+ align-items: center;
236
+ gap: $space-1;
237
+ font-size: $text-sm;
238
+ color: $alias-text-secondary;
239
+
240
+ &--error {
241
+ color: $alias-text-error;
242
+
243
+ svg {
244
+ color: $color-red-500;
245
+ }
246
+ }
247
+ }
248
+
249
+ // --- COLOR PICKER ---
250
+ .gloss-color-picker-wrapper {
251
+ display: flex;
252
+ flex-direction: column;
253
+ gap: $space-2;
254
+
255
+ &--disabled {
256
+ opacity: 0.6;
257
+ }
258
+ }
259
+
260
+ .gloss-color-picker__label {
261
+ font-size: $text-sm;
262
+ font-weight: 500;
263
+ color: $alias-text-primary;
264
+ }
265
+
266
+ .gloss-color-picker {
267
+ position: relative;
268
+ }
269
+
270
+ .gloss-color-picker__trigger {
271
+ display: flex;
272
+ align-items: center;
273
+ gap: $space-2;
274
+ width: 100%;
275
+ padding: $space-2 $space-3;
276
+ background: $color-white;
277
+ border: 1px solid $alias-border-default;
278
+ border-radius: $radius-md;
279
+ font-family: $font-body;
280
+ font-size: $text-sm;
281
+ color: $alias-text-primary;
282
+ cursor: pointer;
283
+ transition: border-color 0.2s ease, box-shadow 0.2s ease;
284
+ @include shadow-input-default;
285
+
286
+ &:hover:not(:disabled) {
287
+ border-color: $alias-border-hover;
288
+ }
289
+
290
+ &:focus-visible {
291
+ outline: none;
292
+ border-color: $alias-border-focus;
293
+ @include shadow-input-focus;
294
+ }
295
+
296
+ &:disabled {
297
+ cursor: not-allowed;
298
+ }
299
+
300
+ svg:last-child {
301
+ margin-left: auto;
302
+ color: $alias-text-secondary;
303
+ }
304
+ }
305
+
306
+ .gloss-color-picker__swatch {
307
+ width: 24px;
308
+ height: 24px;
309
+ border-radius: $radius-sm;
310
+ border: 1px solid rgba(0, 0, 0, 0.1);
311
+ flex-shrink: 0;
312
+
313
+ &--large {
314
+ width: 40px;
315
+ height: 40px;
316
+ border-radius: $radius-md;
317
+ cursor: pointer;
318
+ }
319
+ }
320
+
321
+ .gloss-color-picker__value {
322
+ font-family: $font-mono;
323
+ font-size: $text-sm;
324
+ }
325
+
326
+ .gloss-color-picker__dropdown {
327
+ position: absolute;
328
+ top: 100%;
329
+ left: 0;
330
+ margin-top: $space-1;
331
+ padding: $space-3;
332
+ background: $alias-bg-surface;
333
+ border: 1px solid $alias-border-default;
334
+ border-radius: $radius-lg;
335
+ box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
336
+ z-index: 100;
337
+ min-width: 240px;
338
+ }
339
+
340
+ .gloss-color-picker__content {
341
+ display: flex;
342
+ flex-direction: column;
343
+ gap: $space-3;
344
+ }
345
+
346
+ .gloss-color-picker__native-wrapper {
347
+ display: flex;
348
+ align-items: center;
349
+ gap: $space-3;
350
+ }
351
+
352
+ .gloss-color-picker__native {
353
+ width: 48px;
354
+ height: 48px;
355
+ padding: 0;
356
+ border: none;
357
+ background: transparent;
358
+ cursor: pointer;
359
+ border-radius: $radius-md;
360
+
361
+ &::-webkit-color-swatch-wrapper {
362
+ padding: 0;
363
+ }
364
+
365
+ &::-webkit-color-swatch {
366
+ border: 1px solid rgba(0, 0, 0, 0.1);
367
+ border-radius: $radius-md;
368
+ }
369
+
370
+ &--hidden {
371
+ position: absolute;
372
+ width: 100%;
373
+ height: 100%;
374
+ opacity: 0;
375
+ cursor: pointer;
376
+ }
377
+ }
378
+
379
+ .gloss-color-picker__native-label {
380
+ font-size: $text-sm;
381
+ color: $alias-text-secondary;
382
+ }
383
+
384
+ .gloss-color-picker__presets {
385
+ display: grid;
386
+ grid-template-columns: repeat(5, 1fr);
387
+ gap: $space-1;
388
+ }
389
+
390
+ .gloss-color-picker__preset {
391
+ width: 32px;
392
+ height: 32px;
393
+ padding: 0;
394
+ border: 2px solid transparent;
395
+ border-radius: $radius-sm;
396
+ cursor: pointer;
397
+ transition: transform 0.15s ease, border-color 0.15s ease;
398
+
399
+ &:hover {
400
+ transform: scale(1.1);
401
+ }
402
+
403
+ &--selected {
404
+ border-color: $color-gray-800;
405
+ }
406
+ }
407
+
408
+ .gloss-color-picker__input-wrapper {
409
+ display: flex;
410
+ }
411
+
412
+ .gloss-color-picker__text-input {
413
+ width: 100%;
414
+ padding: $space-2 $space-3;
415
+ background: $color-white;
416
+ border: 1px solid $alias-border-default;
417
+ border-radius: $radius-md;
418
+ font-family: $font-mono;
419
+ font-size: $text-sm;
420
+ color: $alias-text-primary;
421
+
422
+ &:focus {
423
+ outline: none;
424
+ border-color: $alias-border-focus;
425
+ }
426
+ }
427
+
428
+ .gloss-color-picker__inline {
429
+ display: inline-block;
430
+ position: relative;
431
+ cursor: pointer;
432
+ }
433
+
434
+ .gloss-color-picker__helper {
435
+ display: flex;
436
+ align-items: center;
437
+ gap: $space-1;
438
+ font-size: $text-sm;
439
+ color: $alias-text-secondary;
440
+
441
+ &--error {
442
+ color: $alias-text-error;
443
+
444
+ svg {
445
+ color: $color-red-500;
446
+ }
447
+ }
448
+ }
449
+
450
+ // --- RATING ---
451
+ .gloss-rating-wrapper {
452
+ display: flex;
453
+ flex-direction: column;
454
+ gap: $space-2;
455
+
456
+ &--disabled {
457
+ opacity: 0.6;
458
+ }
459
+ }
460
+
461
+ .gloss-rating__label {
462
+ font-size: $text-sm;
463
+ font-weight: 500;
464
+ color: $alias-text-primary;
465
+ }
466
+
467
+ .gloss-rating {
468
+ display: inline-flex;
469
+ align-items: center;
470
+ gap: $space-2;
471
+ }
472
+
473
+ .gloss-rating__stars {
474
+ display: flex;
475
+ gap: $space-1;
476
+ }
477
+
478
+ .gloss-rating__star {
479
+ position: relative;
480
+ display: inline-flex;
481
+ color: $color-gray-300;
482
+ cursor: pointer;
483
+ transition: transform 0.15s ease;
484
+
485
+ &:hover:not(.gloss-rating--readonly &) {
486
+ transform: scale(1.1);
487
+ }
488
+
489
+ &--filled,
490
+ &--half {
491
+ color: inherit;
492
+ }
493
+
494
+ svg {
495
+ fill: currentColor;
496
+ }
497
+ }
498
+
499
+ .gloss-rating__half,
500
+ .gloss-rating__full-zone {
501
+ position: absolute;
502
+ top: 0;
503
+ bottom: 0;
504
+ z-index: 1;
505
+ }
506
+
507
+ .gloss-rating__half--left {
508
+ left: 0;
509
+ width: 50%;
510
+ }
511
+
512
+ .gloss-rating__half--right {
513
+ right: 0;
514
+ width: 50%;
515
+ }
516
+
517
+ .gloss-rating__full-zone {
518
+ left: 0;
519
+ right: 0;
520
+ }
521
+
522
+ .gloss-rating__half-star {
523
+ position: relative;
524
+ }
525
+
526
+ .gloss-rating__half-filled {
527
+ position: absolute;
528
+ top: 0;
529
+ left: 0;
530
+ width: 50%;
531
+ overflow: hidden;
532
+ }
533
+
534
+ .gloss-rating__half-empty {
535
+ color: $color-gray-300;
536
+ }
537
+
538
+ .gloss-rating__value {
539
+ font-size: $text-sm;
540
+ font-weight: 500;
541
+ color: $alias-text-secondary;
542
+ font-feature-settings: 'tnum';
543
+ }
544
+
545
+ .gloss-rating--readonly {
546
+ .gloss-rating__star {
547
+ cursor: default;
548
+
549
+ &:hover {
550
+ transform: none;
551
+ }
552
+ }
553
+ }
554
+
555
+ // Size variants
556
+ .gloss-rating--sm {
557
+ .gloss-rating__stars {
558
+ gap: 2px;
559
+ }
560
+
561
+ .gloss-rating__value {
562
+ font-size: $text-xs;
563
+ }
564
+ }
565
+
566
+ .gloss-rating--lg {
567
+ .gloss-rating__stars {
568
+ gap: $space-2;
569
+ }
570
+
571
+ .gloss-rating__value {
572
+ font-size: $text-base;
573
+ }
574
+ }
575
+
576
+ .gloss-rating__helper {
577
+ display: flex;
578
+ align-items: center;
579
+ gap: $space-1;
580
+ font-size: $text-sm;
581
+ color: $alias-text-secondary;
582
+
583
+ &--error {
584
+ color: $alias-text-error;
585
+
586
+ svg {
587
+ color: $color-red-500;
588
+ }
589
+ }
590
+ }
@@ -0,0 +1,89 @@
1
+ // ============================================
2
+ // COMPONENT: TEXTAREA
3
+ // ============================================
4
+
5
+ @use '../tokens' as *;
6
+ @use '../mixins' as *;
7
+
8
+ .gloss-textarea {
9
+ width: 100%;
10
+ font-family: $font-body;
11
+ font-size: $text-base;
12
+ font-weight: 500;
13
+ color: $alias-text-primary;
14
+ background: $color-white;
15
+ border: 1px solid $alias-border-default;
16
+ border-radius: $radius-md;
17
+ padding: $space-3 $space-4;
18
+ @include shadow-input-default;
19
+ outline: none;
20
+ @include input-transition-default;
21
+ min-height: 100px;
22
+ line-height: 1.5;
23
+
24
+ &::placeholder {
25
+ color: $alias-text-tertiary;
26
+ font-weight: 400;
27
+ }
28
+
29
+ &:hover:not(:disabled):not(:focus):not(.gloss-textarea--error):not(.gloss-textarea--success) {
30
+ background: $alias-bg-hover;
31
+ border-color: $alias-border-hover;
32
+ @include input-transition-hover;
33
+ }
34
+
35
+ &:focus:not(.gloss-textarea--error):not(.gloss-textarea--success) {
36
+ background: $alias-bg-hover;
37
+ border-color: $alias-border-focus;
38
+ @include shadow-input-focus;
39
+ @include input-transition-focus;
40
+ }
41
+
42
+ &:disabled {
43
+ background: $alias-bg-disabled;
44
+ box-shadow: $shadow-input-disabled;
45
+ cursor: not-allowed;
46
+ color: $alias-text-tertiary;
47
+ border-color: transparent;
48
+ resize: none;
49
+ }
50
+ }
51
+
52
+ // --- SUCCESS STATE ---
53
+ .gloss-textarea--success {
54
+ border-color: $alias-border-success;
55
+ @include shadow-input-default;
56
+
57
+ &:hover:not(:disabled):not(:focus) {
58
+ background: $alias-bg-hover;
59
+ }
60
+
61
+ &:focus {
62
+ background: $alias-bg-hover;
63
+ box-shadow: $shadow-input-success-focus;
64
+ }
65
+ }
66
+
67
+ // --- ERROR STATE ---
68
+ .gloss-textarea--error {
69
+ border-color: $color-red-200;
70
+ background: $alias-bg-error;
71
+ color: $alias-text-error;
72
+ box-shadow: $shadow-input-error;
73
+
74
+ &:hover:not(:disabled):not(:focus) {
75
+ border-color: $color-red-400;
76
+ }
77
+
78
+ &:focus {
79
+ border-color: $color-red-400;
80
+ box-shadow: $shadow-input-error-focus;
81
+ }
82
+ }
83
+
84
+ // --- AUTO-RESIZE ---
85
+ .gloss-textarea--auto-resize {
86
+ resize: none;
87
+ overflow: hidden;
88
+ transition: height 0.1s ease;
89
+ }