@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,314 @@
1
+ // ============================================
2
+ // ANIMATIONS: CSS Keyframes & Utility Classes
3
+ // ============================================
4
+
5
+ @use '../tokens' as *;
6
+
7
+ // --- DURATION VARIABLES ---
8
+ $duration-instant: 0ms;
9
+ $duration-fast: 100ms;
10
+ $duration-normal: 200ms;
11
+ $duration-slow: 300ms;
12
+ $duration-slower: 400ms;
13
+
14
+ // --- EASING VARIABLES ---
15
+ $easing-linear: linear;
16
+ $easing-ease-in: cubic-bezier(0.4, 0, 1, 1);
17
+ $easing-ease-out: cubic-bezier(0, 0, 0.2, 1);
18
+ $easing-ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
19
+ $easing-spring: cubic-bezier(0.175, 0.885, 0.32, 1.275);
20
+
21
+ // --- KEYFRAMES ---
22
+
23
+ // Fade
24
+ @keyframes gloss-fade-in {
25
+ from {
26
+ opacity: 0;
27
+ }
28
+ to {
29
+ opacity: 1;
30
+ }
31
+ }
32
+
33
+ @keyframes gloss-fade-out {
34
+ from {
35
+ opacity: 1;
36
+ }
37
+ to {
38
+ opacity: 0;
39
+ }
40
+ }
41
+
42
+ // Fade + Scale
43
+ @keyframes gloss-fade-scale-in {
44
+ from {
45
+ opacity: 0;
46
+ transform: scale(0.95);
47
+ }
48
+ to {
49
+ opacity: 1;
50
+ transform: scale(1);
51
+ }
52
+ }
53
+
54
+ @keyframes gloss-fade-scale-out {
55
+ from {
56
+ opacity: 1;
57
+ transform: scale(1);
58
+ }
59
+ to {
60
+ opacity: 0;
61
+ transform: scale(0.95);
62
+ }
63
+ }
64
+
65
+ // Slide Up
66
+ @keyframes gloss-slide-up-in {
67
+ from {
68
+ opacity: 0;
69
+ transform: translateY(8px);
70
+ }
71
+ to {
72
+ opacity: 1;
73
+ transform: translateY(0);
74
+ }
75
+ }
76
+
77
+ @keyframes gloss-slide-up-out {
78
+ from {
79
+ opacity: 1;
80
+ transform: translateY(0);
81
+ }
82
+ to {
83
+ opacity: 0;
84
+ transform: translateY(8px);
85
+ }
86
+ }
87
+
88
+ // Slide Down
89
+ @keyframes gloss-slide-down-in {
90
+ from {
91
+ opacity: 0;
92
+ transform: translateY(-8px);
93
+ }
94
+ to {
95
+ opacity: 1;
96
+ transform: translateY(0);
97
+ }
98
+ }
99
+
100
+ @keyframes gloss-slide-down-out {
101
+ from {
102
+ opacity: 1;
103
+ transform: translateY(0);
104
+ }
105
+ to {
106
+ opacity: 0;
107
+ transform: translateY(-8px);
108
+ }
109
+ }
110
+
111
+ // Slide Left
112
+ @keyframes gloss-slide-left-in {
113
+ from {
114
+ opacity: 0;
115
+ transform: translateX(8px);
116
+ }
117
+ to {
118
+ opacity: 1;
119
+ transform: translateX(0);
120
+ }
121
+ }
122
+
123
+ @keyframes gloss-slide-left-out {
124
+ from {
125
+ opacity: 1;
126
+ transform: translateX(0);
127
+ }
128
+ to {
129
+ opacity: 0;
130
+ transform: translateX(8px);
131
+ }
132
+ }
133
+
134
+ // Slide Right
135
+ @keyframes gloss-slide-right-in {
136
+ from {
137
+ opacity: 0;
138
+ transform: translateX(-8px);
139
+ }
140
+ to {
141
+ opacity: 1;
142
+ transform: translateX(0);
143
+ }
144
+ }
145
+
146
+ @keyframes gloss-slide-right-out {
147
+ from {
148
+ opacity: 1;
149
+ transform: translateX(0);
150
+ }
151
+ to {
152
+ opacity: 0;
153
+ transform: translateX(-8px);
154
+ }
155
+ }
156
+
157
+ // Zoom
158
+ @keyframes gloss-zoom-in {
159
+ from {
160
+ opacity: 0;
161
+ transform: scale(0.8);
162
+ }
163
+ to {
164
+ opacity: 1;
165
+ transform: scale(1);
166
+ }
167
+ }
168
+
169
+ @keyframes gloss-zoom-out {
170
+ from {
171
+ opacity: 1;
172
+ transform: scale(1);
173
+ }
174
+ to {
175
+ opacity: 0;
176
+ transform: scale(0.8);
177
+ }
178
+ }
179
+
180
+ // Spin (for loaders)
181
+ @keyframes gloss-spin {
182
+ from {
183
+ transform: rotate(0deg);
184
+ }
185
+ to {
186
+ transform: rotate(360deg);
187
+ }
188
+ }
189
+
190
+ // Pulse
191
+ @keyframes gloss-pulse {
192
+ 0%, 100% {
193
+ opacity: 1;
194
+ }
195
+ 50% {
196
+ opacity: 0.5;
197
+ }
198
+ }
199
+
200
+ // Bounce
201
+ @keyframes gloss-bounce {
202
+ 0%, 100% {
203
+ transform: translateY(0);
204
+ }
205
+ 50% {
206
+ transform: translateY(-4px);
207
+ }
208
+ }
209
+
210
+ // Shake (for errors)
211
+ @keyframes gloss-shake {
212
+ 0%, 100% {
213
+ transform: translateX(0);
214
+ }
215
+ 25% {
216
+ transform: translateX(-4px);
217
+ }
218
+ 75% {
219
+ transform: translateX(4px);
220
+ }
221
+ }
222
+
223
+ // --- ANIMATION CLASSES ---
224
+
225
+ // Fade
226
+ .gloss-animate-fade-in {
227
+ animation: gloss-fade-in $duration-normal $easing-ease-out forwards;
228
+ }
229
+
230
+ .gloss-animate-fade-out {
231
+ animation: gloss-fade-out $duration-normal $easing-ease-out forwards;
232
+ }
233
+
234
+ // Fade + Scale
235
+ .gloss-animate-fade-scale-in {
236
+ animation: gloss-fade-scale-in $duration-fast $easing-ease-out forwards;
237
+ }
238
+
239
+ .gloss-animate-fade-scale-out {
240
+ animation: gloss-fade-scale-out $duration-fast $easing-ease-out forwards;
241
+ }
242
+
243
+ // Slide Up
244
+ .gloss-animate-slide-up-in {
245
+ animation: gloss-slide-up-in $duration-normal $easing-ease-out forwards;
246
+ }
247
+
248
+ .gloss-animate-slide-up-out {
249
+ animation: gloss-slide-up-out $duration-normal $easing-ease-out forwards;
250
+ }
251
+
252
+ // Slide Down
253
+ .gloss-animate-slide-down-in {
254
+ animation: gloss-slide-down-in $duration-normal $easing-ease-out forwards;
255
+ }
256
+
257
+ .gloss-animate-slide-down-out {
258
+ animation: gloss-slide-down-out $duration-normal $easing-ease-out forwards;
259
+ }
260
+
261
+ // Spin
262
+ .gloss-animate-spin {
263
+ animation: gloss-spin 1s linear infinite;
264
+ }
265
+
266
+ // Pulse
267
+ .gloss-animate-pulse {
268
+ animation: gloss-pulse 2s $easing-ease-in-out infinite;
269
+ }
270
+
271
+ // Bounce
272
+ .gloss-animate-bounce {
273
+ animation: gloss-bounce 1s $easing-ease-in-out infinite;
274
+ }
275
+
276
+ // Shake
277
+ .gloss-animate-shake {
278
+ animation: gloss-shake 0.4s $easing-ease-in-out;
279
+ }
280
+
281
+ // --- TRANSITION UTILITIES ---
282
+
283
+ .gloss-transition-none {
284
+ transition: none !important;
285
+ }
286
+
287
+ .gloss-transition-all {
288
+ transition: all $duration-normal $easing-ease-out;
289
+ }
290
+
291
+ .gloss-transition-colors {
292
+ transition: color $duration-normal $easing-ease-out,
293
+ background-color $duration-normal $easing-ease-out,
294
+ border-color $duration-normal $easing-ease-out;
295
+ }
296
+
297
+ .gloss-transition-opacity {
298
+ transition: opacity $duration-normal $easing-ease-out;
299
+ }
300
+
301
+ .gloss-transition-transform {
302
+ transition: transform $duration-normal $easing-ease-out;
303
+ }
304
+
305
+ // --- REDUCED MOTION ---
306
+ @media (prefers-reduced-motion: reduce) {
307
+ *,
308
+ *::before,
309
+ *::after {
310
+ animation-duration: 0.01ms !important;
311
+ animation-iteration-count: 1 !important;
312
+ transition-duration: 0.01ms !important;
313
+ }
314
+ }
@@ -0,0 +1,75 @@
1
+ // ============================================
2
+ // COMPONENT: ASYNC / LOADING
3
+ // ============================================
4
+
5
+ @use '../tokens' as *;
6
+ @use '../mixins' as *;
7
+
8
+ .gloss-async {
9
+ position: relative;
10
+
11
+ &.gloss-async--loading .gloss-input {
12
+ border-color: transparent;
13
+ }
14
+
15
+ &.gloss-async--loading .gloss-async__container {
16
+ opacity: 1;
17
+ }
18
+ }
19
+
20
+ .gloss-async__container {
21
+ position: absolute;
22
+ inset: 0;
23
+ width: 100%;
24
+ height: 100%;
25
+ pointer-events: none;
26
+ z-index: 10;
27
+ opacity: 0;
28
+ transition: opacity 0.3s ease;
29
+ }
30
+
31
+ .gloss-async__rect,
32
+ .gloss-async__chaser {
33
+ position: absolute;
34
+ top: 0;
35
+ left: 0;
36
+ fill: none;
37
+ stroke-width: 2px;
38
+ width: 100%;
39
+ height: 100%;
40
+ rx: 10px;
41
+ }
42
+
43
+ .gloss-async__rect {
44
+ stroke: $color-blue-100;
45
+ }
46
+
47
+ .gloss-async__chaser {
48
+ stroke: $color-blue-500;
49
+ stroke-dasharray: 100 300;
50
+ stroke-dashoffset: 0;
51
+ animation: dash-rotate 2s linear infinite;
52
+ }
53
+
54
+ // --- ASYNC COLOR VARIANTS ---
55
+ .gloss-async--green {
56
+ .gloss-async__rect {
57
+ stroke: $color-green-100;
58
+ }
59
+
60
+ .gloss-async__chaser {
61
+ stroke: $color-green-500;
62
+ }
63
+ }
64
+
65
+ // --- SPINNER (INLINE) ---
66
+ .gloss-spinner-inline {
67
+ display: inline-flex;
68
+ width: 14px;
69
+ height: 14px;
70
+ margin-right: $space-1;
71
+ border: 2px solid currentColor;
72
+ border-top-color: transparent;
73
+ border-radius: 50%;
74
+ animation: spinner 0.8s linear infinite;
75
+ }
@@ -0,0 +1,135 @@
1
+ // ============================================
2
+ // COMPONENT: BADGE
3
+ // ============================================
4
+
5
+ @use '../tokens' as *;
6
+
7
+ // --- BASE BADGE ---
8
+ .gloss-badge {
9
+ display: inline-flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ font-weight: 600;
13
+ line-height: 1;
14
+ white-space: nowrap;
15
+ border-radius: $radius-full;
16
+ vertical-align: middle;
17
+ }
18
+
19
+ // --- SIZES ---
20
+ .gloss-badge--sm {
21
+ font-size: 0.625rem;
22
+ padding: 2px 6px;
23
+ min-height: 16px;
24
+ }
25
+
26
+ .gloss-badge--md {
27
+ font-size: $text-xs;
28
+ padding: 3px 8px;
29
+ min-height: 20px;
30
+ }
31
+
32
+ .gloss-badge--lg {
33
+ font-size: $text-sm;
34
+ padding: 4px 10px;
35
+ min-height: 24px;
36
+ }
37
+
38
+ // --- DOT VARIANT ---
39
+ .gloss-badge--dot {
40
+ padding: 0;
41
+ min-width: 8px;
42
+ min-height: 8px;
43
+ width: 8px;
44
+ height: 8px;
45
+
46
+ &.gloss-badge--sm {
47
+ width: 6px;
48
+ height: 6px;
49
+ min-width: 6px;
50
+ min-height: 6px;
51
+ }
52
+
53
+ &.gloss-badge--lg {
54
+ width: 10px;
55
+ height: 10px;
56
+ min-width: 10px;
57
+ min-height: 10px;
58
+ }
59
+ }
60
+
61
+ // --- COLOR VARIANTS (solid) ---
62
+ .gloss-badge--default {
63
+ background: $color-gray-100;
64
+ color: $alias-text-secondary;
65
+ border: 1px solid $alias-border-default;
66
+ }
67
+
68
+ .gloss-badge--primary {
69
+ background: $alias-primary;
70
+ color: $color-white;
71
+ border: 1px solid $alias-primary;
72
+ }
73
+
74
+ .gloss-badge--success {
75
+ background: $color-green-600;
76
+ color: $color-white;
77
+ border: 1px solid $color-green-600;
78
+ }
79
+
80
+ .gloss-badge--warning {
81
+ background: $color-amber-500;
82
+ color: $color-white;
83
+ border: 1px solid $color-amber-500;
84
+ }
85
+
86
+ .gloss-badge--error {
87
+ background: $color-red-600;
88
+ color: $color-white;
89
+ border: 1px solid $color-red-600;
90
+ }
91
+
92
+ .gloss-badge--info {
93
+ background: $color-blue-500;
94
+ color: $color-white;
95
+ border: 1px solid $color-blue-500;
96
+ }
97
+
98
+ // --- SOFT VARIANTS ---
99
+ .gloss-badge--soft {
100
+ &.gloss-badge--default {
101
+ background: $color-gray-100;
102
+ color: $alias-text-secondary;
103
+ border-color: $color-gray-200;
104
+ }
105
+
106
+ &.gloss-badge--primary {
107
+ background: $color-blue-50;
108
+ color: $color-blue-700;
109
+ border-color: $color-blue-200;
110
+ }
111
+
112
+ &.gloss-badge--success {
113
+ background: $color-green-50;
114
+ color: $color-green-700;
115
+ border-color: $color-green-200;
116
+ }
117
+
118
+ &.gloss-badge--warning {
119
+ background: $color-amber-100;
120
+ color: $color-amber-600;
121
+ border-color: $color-amber-200;
122
+ }
123
+
124
+ &.gloss-badge--error {
125
+ background: $color-red-50;
126
+ color: $color-red-700;
127
+ border-color: $color-red-200;
128
+ }
129
+
130
+ &.gloss-badge--info {
131
+ background: $color-blue-50;
132
+ color: $color-blue-700;
133
+ border-color: $color-blue-200;
134
+ }
135
+ }