@esportsplus/ui 0.56.3 → 0.56.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.
@@ -0,0 +1,513 @@
1
+ @use '/tokens';
2
+ @use 'variables';
3
+
4
+ .plan-card {
5
+ background: var(--background);
6
+ border: var(--border-width-400) solid var(--border-color);
7
+ border-radius: var(--radius);
8
+ color: var(--color);
9
+ max-width: 100%;
10
+ padding: var(--padding);
11
+ width: var(--width);
12
+
13
+
14
+ &-action,
15
+ &-cancel {
16
+ // A label that fades in above after a beat, or at once for keyboard focus.
17
+ &::after {
18
+ background: var(--color-text-500);
19
+ border-radius: 6px;
20
+ bottom: calc(100% + 6px);
21
+ color: var(--color-white-300);
22
+ content: attr(data-tooltip);
23
+ font-size: 12px;
24
+ font-weight: var(--font-weight-500);
25
+ left: 50%;
26
+ opacity: 0;
27
+ padding: 4px 8px;
28
+ pointer-events: none;
29
+ position: absolute;
30
+ transition: opacity 0.1s ease-out, translate 0.1s ease-out;
31
+ translate: -50% 2px;
32
+ white-space: nowrap;
33
+ z-index: 1;
34
+ }
35
+
36
+ &:focus-visible::after,
37
+ &:hover::after {
38
+ opacity: 1;
39
+ transition-delay: 0.4s;
40
+ translate: -50% 0;
41
+ }
42
+
43
+ &:focus-visible::after {
44
+ transition-delay: 0s;
45
+ }
46
+ }
47
+
48
+ &-action {
49
+ align-items: center;
50
+ background: transparent;
51
+ border: 0;
52
+ border-radius: 8px;
53
+ color: var(--color);
54
+ cursor: pointer;
55
+ display: flex;
56
+ height: 28px;
57
+ justify-content: center;
58
+ outline: none;
59
+ position: relative;
60
+ transition: background-color 0.15s ease-out;
61
+ width: 28px;
62
+
63
+ &:active {
64
+ background: oklch(from var(--color-black-300) l c h / 0.12);
65
+ }
66
+
67
+ &:focus-visible {
68
+ outline: 2px solid var(--focus-color);
69
+ }
70
+
71
+ &:hover {
72
+ background: var(--action-hover);
73
+ }
74
+
75
+ svg {
76
+ height: 16px;
77
+ width: 16px;
78
+ }
79
+ }
80
+
81
+ &-actions {
82
+ align-items: center;
83
+ display: flex;
84
+ gap: 4px;
85
+ margin-left: auto;
86
+ }
87
+
88
+ &-button {
89
+ align-items: center;
90
+ border: 0;
91
+ border-radius: 8px;
92
+ cursor: pointer;
93
+ display: inline-flex;
94
+ font-size: 0.875rem;
95
+ font-weight: var(--font-weight-500);
96
+ gap: 6px;
97
+ height: 32px;
98
+ outline: none;
99
+ padding-inline: 10px;
100
+ transition: opacity 0.15s ease-out, scale 0.15s ease-out;
101
+ white-space: nowrap;
102
+
103
+ &:active {
104
+ scale: 0.97;
105
+ }
106
+
107
+ &:disabled {
108
+ cursor: default;
109
+ opacity: 0.5;
110
+ scale: 1;
111
+ }
112
+
113
+ &:focus-visible {
114
+ outline: 2px solid var(--focus-color);
115
+ outline-offset: 2px;
116
+ }
117
+
118
+ &--primary {
119
+ background: var(--primary-background);
120
+ color: var(--primary-color);
121
+ padding-right: 6px;
122
+ }
123
+
124
+ &--secondary {
125
+ background: var(--secondary-background);
126
+ color: var(--secondary-color);
127
+ }
128
+ }
129
+
130
+ &-buttons {
131
+ align-items: center;
132
+ display: flex;
133
+ gap: 8px;
134
+ margin-left: auto;
135
+ }
136
+
137
+ &-cancel {
138
+ background: transparent;
139
+ border: 0;
140
+ border-radius: 999px;
141
+ cursor: pointer;
142
+ display: grid;
143
+ flex-shrink: 0;
144
+ height: 18px;
145
+ outline: none;
146
+ padding: 0;
147
+ place-items: center;
148
+ position: relative;
149
+ transition: scale 0.15s ease-out;
150
+ width: 18px;
151
+
152
+ // Larger hit area than the ring it sits on.
153
+ &::before {
154
+ content: '';
155
+ inset: -11px;
156
+ position: absolute;
157
+ }
158
+
159
+ &:active {
160
+ scale: 0.96;
161
+ }
162
+
163
+ &:focus-visible {
164
+ outline: 2px solid var(--focus-color);
165
+ outline-offset: 2px;
166
+ }
167
+
168
+ &:focus-visible,
169
+ &:hover {
170
+ .plan-card-cancel-icon {
171
+ opacity: 1;
172
+ }
173
+ }
174
+
175
+ > * {
176
+ grid-area: 1 / 1;
177
+ }
178
+ }
179
+
180
+ &-cancel-icon {
181
+ align-items: center;
182
+ background: var(--secondary-background);
183
+ border-radius: 999px;
184
+ color: var(--muted);
185
+ display: flex;
186
+ height: 18px;
187
+ justify-content: center;
188
+ opacity: 0;
189
+ transition: opacity 0.1s ease-out;
190
+ width: 18px;
191
+
192
+ svg {
193
+ height: 10px;
194
+ width: 10px;
195
+ }
196
+ }
197
+
198
+ &-description {
199
+ color: var(--muted);
200
+ font-size: 0.9375rem;
201
+ line-height: 1.625;
202
+ margin: 12px 0 0;
203
+ text-wrap: pretty;
204
+ }
205
+
206
+ &-digit {
207
+ display: inline-block;
208
+ }
209
+
210
+ &-digits {
211
+ display: inline-flex;
212
+ font-variant-numeric: tabular-nums;
213
+ }
214
+
215
+ // Folded to a zero-height track; opening grows the track, so the row never reflows as it appears.
216
+ &-fold {
217
+ display: grid;
218
+ grid-template-rows: 0fr;
219
+ transition: grid-template-rows 0.3s var(--spring);
220
+
221
+ @include tokens.state(active) {
222
+ grid-template-rows: 1fr;
223
+ }
224
+ }
225
+
226
+ &-fold-inner {
227
+ min-height: 0;
228
+ overflow: hidden;
229
+ }
230
+
231
+ &-footer {
232
+ align-items: center;
233
+ display: flex;
234
+ flex-wrap: wrap;
235
+ gap: 12px;
236
+ margin-top: 16px;
237
+ }
238
+
239
+ &-header {
240
+ align-items: center;
241
+ display: flex;
242
+ gap: 12px;
243
+ }
244
+
245
+ &-icon {
246
+ align-items: center;
247
+ background: var(--icon-background);
248
+ border-radius: 6px;
249
+ color: var(--icon-color);
250
+ display: flex;
251
+ flex-shrink: 0;
252
+ height: 28px;
253
+ justify-content: center;
254
+ width: 28px;
255
+
256
+ svg {
257
+ height: 16px;
258
+ width: 16px;
259
+ }
260
+ }
261
+
262
+ &.--approved &-kbd {
263
+ display: none;
264
+ }
265
+
266
+ &-kbd {
267
+ display: inline-flex;
268
+ font-family: inherit;
269
+ gap: 4px;
270
+ margin-left: 2px;
271
+
272
+ kbd {
273
+ align-items: center;
274
+ background: oklch(from var(--primary-color) l c h / 0.15);
275
+ border-radius: 4px;
276
+ display: inline-flex;
277
+ font-family: inherit;
278
+ font-size: 0.625rem;
279
+ height: 20px;
280
+ justify-content: center;
281
+ min-width: 20px;
282
+ padding-inline: 4px;
283
+ }
284
+
285
+ svg {
286
+ height: 10px;
287
+ width: 10px;
288
+ }
289
+ }
290
+
291
+ &-list {
292
+ list-style: none;
293
+ margin: 10px 0 0;
294
+ padding: 0;
295
+
296
+ > li + li .plan-card-todo,
297
+ > li + li > .plan-card-toggle {
298
+ margin-top: 8px;
299
+ }
300
+ }
301
+
302
+ &-ring {
303
+ height: 18px;
304
+ rotate: -90deg;
305
+ width: 18px;
306
+
307
+ circle {
308
+ fill: none;
309
+ stroke-width: 2;
310
+ }
311
+ }
312
+
313
+ &-ring-progress {
314
+ stroke: var(--ring-color);
315
+ stroke-linecap: round;
316
+ transition: stroke-dashoffset 1s linear;
317
+ }
318
+
319
+ &-ring-track {
320
+ stroke: var(--ring-track);
321
+ }
322
+
323
+ &-status {
324
+ align-items: center;
325
+ color: var(--muted);
326
+ display: flex;
327
+ font-size: 0.875rem;
328
+ gap: 8px;
329
+ transition:
330
+ opacity 0.2s ease-out,
331
+ translate 0.2s ease-out,
332
+ visibility 0s linear;
333
+
334
+ &.--approved {
335
+ color: var(--success-color);
336
+ font-weight: var(--font-weight-500);
337
+ }
338
+
339
+ &.--cancelled {
340
+ opacity: 0;
341
+ translate: 0 4px;
342
+ transition:
343
+ opacity 0.2s ease-out,
344
+ translate 0.2s ease-out,
345
+ visibility 0s linear 0.2s;
346
+ visibility: hidden;
347
+ }
348
+ }
349
+
350
+ &-status-icon {
351
+ height: 16px;
352
+ width: 16px;
353
+ }
354
+
355
+ &-title {
356
+ font-size: 1.125rem;
357
+ font-weight: var(--font-weight-600);
358
+ letter-spacing: -0.025em;
359
+ line-height: 1.4;
360
+ margin: 0;
361
+ min-width: 0;
362
+ }
363
+
364
+ &-todo {
365
+ align-items: center;
366
+ color: var(--muted);
367
+ display: flex;
368
+ font-size: 0.9375rem;
369
+ gap: 10px;
370
+
371
+ &.--done .plan-card-todo-icon {
372
+ color: var(--success-color);
373
+ opacity: 1;
374
+ }
375
+ }
376
+
377
+ &-todo-icon {
378
+ flex-shrink: 0;
379
+ height: 16px;
380
+ opacity: 0.5;
381
+ width: 16px;
382
+ }
383
+
384
+ &-todo-label {
385
+ min-width: 0;
386
+ overflow: hidden;
387
+ text-overflow: ellipsis;
388
+ white-space: nowrap;
389
+ }
390
+
391
+ &-todos {
392
+ background: var(--todos-background);
393
+ border-radius: 12px;
394
+ margin-top: 16px;
395
+ padding: 12px;
396
+ }
397
+
398
+ &-todos-count {
399
+ color: var(--muted);
400
+ font-size: 0.875rem;
401
+ font-variant-numeric: tabular-nums;
402
+ margin-left: auto;
403
+ padding-right: 4px;
404
+ }
405
+
406
+ &-todos-header {
407
+ align-items: center;
408
+ display: flex;
409
+ gap: 8px;
410
+ }
411
+
412
+ &-todos-icon {
413
+ flex-shrink: 0;
414
+ height: 16px;
415
+ width: 16px;
416
+ }
417
+
418
+ &-todos-label {
419
+ font-size: 0.9375rem;
420
+ font-weight: var(--font-weight-500);
421
+ }
422
+
423
+ &-toggle {
424
+ align-items: center;
425
+ background: transparent;
426
+ border: 0;
427
+ border-radius: 6px;
428
+ color: var(--muted);
429
+ cursor: pointer;
430
+ display: flex;
431
+ font-size: 0.9375rem;
432
+ gap: 10px;
433
+ outline: none;
434
+ padding: 0;
435
+ text-align: left;
436
+ transition: color 0.15s ease-out;
437
+ width: 100%;
438
+
439
+ &:focus-visible {
440
+ outline: 2px solid var(--focus-color);
441
+ outline-offset: 2px;
442
+ }
443
+
444
+ &:hover {
445
+ color: var(--color);
446
+ }
447
+
448
+ @include tokens.state(active) {
449
+ .plan-card-toggle-label--less,
450
+ .plan-card-toggle-less {
451
+ filter: blur(0);
452
+ opacity: 1;
453
+ translate: 0 0;
454
+ }
455
+
456
+ .plan-card-toggle-label--more,
457
+ .plan-card-toggle-more {
458
+ filter: blur(2px);
459
+ opacity: 0;
460
+ translate: 0 -4px;
461
+ }
462
+ }
463
+ }
464
+
465
+ // Both labels share one grid cell and crossfade; the cell is as wide as the longer one, so nothing shifts.
466
+ &-toggle-icon,
467
+ &-toggle-labels {
468
+ display: grid;
469
+
470
+ > * {
471
+ grid-area: 1 / 1;
472
+ transition:
473
+ filter 0.2s var(--spring),
474
+ opacity 0.2s var(--spring),
475
+ translate 0.2s var(--spring);
476
+ }
477
+ }
478
+
479
+ &-toggle-icon {
480
+ color: var(--muted);
481
+ flex-shrink: 0;
482
+ height: 16px;
483
+ opacity: 0.5;
484
+ place-items: center;
485
+ width: 16px;
486
+
487
+ svg {
488
+ height: 16px;
489
+ width: 16px;
490
+ }
491
+ }
492
+
493
+ &-toggle-label--less,
494
+ &-toggle-less {
495
+ filter: blur(2px);
496
+ opacity: 0;
497
+ translate: 0 4px;
498
+ }
499
+
500
+
501
+ @media (prefers-reduced-motion: reduce) {
502
+ &-fold,
503
+ &-ring-progress,
504
+ &-toggle-icon > *,
505
+ &-toggle-labels > * {
506
+ transition: none;
507
+ }
508
+
509
+ &-status {
510
+ translate: none;
511
+ }
512
+ }
513
+ }
@@ -0,0 +1,33 @@
1
+ .plan-card {
2
+ --action-hover: oklch(from var(--color-black-300) l c h / 0.07);
3
+ --background: var(--color-white-300);
4
+ --border-color: var(--color-border-300);
5
+ --color: var(--color-text-500);
6
+ --focus-color: var(--color-text-500);
7
+ --icon-background: oklch(76.9% 0.188 70.08 / 0.15);
8
+ --icon-color: oklch(66.6% 0.179 58.318);
9
+ --muted: var(--color-text-300);
10
+ --padding: 20px;
11
+ --primary-background: var(--color-text-500);
12
+ --primary-color: var(--color-white-300);
13
+ --radius: 16px;
14
+ --ring-color: var(--color-text-500);
15
+ --ring-track: var(--color-border-300);
16
+ --secondary-background: var(--color-grey-500);
17
+ --secondary-color: var(--color-text-500);
18
+ --spring: cubic-bezier(0.16, 1, 0.3, 1);
19
+ --success-color: oklch(62.7% 0.194 149.214);
20
+ --todos-background: var(--color-grey-300);
21
+ --width: 512px;
22
+
23
+
24
+ &--blue {
25
+ --icon-background: oklch(from var(--color-blue-400) l c h / 0.12);
26
+ --icon-color: var(--color-blue-400);
27
+ }
28
+
29
+ &--flat {
30
+ --border-color: transparent;
31
+ --todos-background: var(--color-grey-400);
32
+ }
33
+ }