@esportsplus/ui 0.62.0 → 0.63.0

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,416 +0,0 @@
1
- @use '/tokens';
2
- @use 'css-utilities/absolute';
3
- @use 'css-utilities/font/geist';
4
- @use 'css-utilities/hidden';
5
- @use 'css-utilities/icon';
6
- @use 'css-utilities/text';
7
- @use 'variables';
8
-
9
- .cc {
10
- color: var(--color);
11
- display: flex;
12
- flex-direction: column;
13
- gap: var(--gap-vertical) var(--gap-horizontal);
14
- width: var(--width);
15
-
16
-
17
- &-actions {
18
- display: flex;
19
- flex-direction: column;
20
- gap: var(--gap-vertical) var(--gap-horizontal);
21
- }
22
-
23
- // A sprite <svg> has no viewBox of its own, so the cell must be definite for the marks' 100% to resolve.
24
- &-brand {
25
- display: grid;
26
- grid-template: 100% / 100%;
27
-
28
-
29
- &--large,
30
- &--small {
31
- height: var(--height);
32
- width: var(--width);
33
- }
34
-
35
-
36
- &-mark {
37
- @extend %icon-swap;
38
- grid-area: 1 / 1;
39
- height: 100%;
40
- width: 100%;
41
-
42
-
43
- @include tokens.state(active) {
44
- @extend %icon-swap-active;
45
- }
46
- }
47
- }
48
-
49
- &-caption {
50
- font-size: var(--font-size-300);
51
- opacity: var(--opacity);
52
- text-transform: uppercase;
53
- }
54
-
55
- &-card {
56
- height: 100%;
57
- position: relative;
58
- transform-style: preserve-3d;
59
- transition: transform var(--transition-duration) var(--transition-timing-function);
60
- width: 100%;
61
-
62
-
63
- &--flipped {
64
- transform: rotateY(180deg);
65
-
66
-
67
- // No half turn: the faces cross-fade in place.
68
- @media (prefers-reduced-motion: reduce) {
69
- transform: none;
70
-
71
- .cc-face--back {
72
- opacity: 1;
73
- }
74
-
75
- .cc-face--front {
76
- opacity: 0;
77
- }
78
- }
79
- }
80
- }
81
-
82
- &-control {
83
- position: relative;
84
-
85
-
86
- &-brand {
87
- @extend %absolute-vertical;
88
- color: var(--color);
89
- display: flex;
90
- pointer-events: none;
91
- right: var(--inset-horizontal);
92
- transition: color var(--transition-duration) var(--transition-timing-function);
93
- }
94
- }
95
-
96
- &-digit {
97
- display: inline-block;
98
-
99
-
100
- &--gap {
101
- margin-inline-start: var(--gap-horizontal);
102
- }
103
-
104
- &--placeholder {
105
- opacity: var(--opacity);
106
- }
107
-
108
- // Alternating between two identical keyframes replays the arrival for each new digit; reduced motion drops
109
- // the blur and slide to a plain fade.
110
- @each $roll in 1 2 {
111
- &--roll-#{$roll} {
112
- animation: cc-digit--roll-#{$roll} var(--animation-duration) var(--animation-timing-function);
113
-
114
-
115
- @media (prefers-reduced-motion: reduce) {
116
- animation-name: cc-digit-fade;
117
- }
118
-
119
- @keyframes cc-digit--roll-#{$roll} {
120
- from {
121
- filter: blur(var(--blur-300));
122
- opacity: 0;
123
- translate: 0 -4px;
124
- }
125
- }
126
- }
127
- }
128
-
129
- @keyframes cc-digit-fade {
130
- from {
131
- opacity: 0;
132
- }
133
- }
134
- }
135
-
136
- &-disclaimer {
137
- font-size: var(--font-size-300);
138
- margin: auto 0 0;
139
- opacity: var(--opacity);
140
- padding-block: 0 var(--padding-bottom);
141
- padding-inline: var(--padding-horizontal);
142
- }
143
-
144
- // Shares the label's row, so showing it never shifts the fields below.
145
- &-error {
146
- @extend %text-truncate;
147
- color: var(--color);
148
- font-size: var(--font-size-300);
149
- transition:
150
- filter var(--transition-duration) var(--transition-timing-function),
151
- opacity var(--transition-duration) var(--transition-timing-function),
152
- translate var(--transition-duration) var(--transition-timing-function);
153
-
154
-
155
- @starting-style {
156
- filter: blur(var(--blur-400));
157
- opacity: 0;
158
- translate: 0 var(--offset);
159
- }
160
-
161
- @media (prefers-reduced-motion: reduce) {
162
- @starting-style {
163
- filter: none;
164
- translate: 0;
165
- }
166
- }
167
- }
168
-
169
- &-expires {
170
- display: flex;
171
- flex-direction: column;
172
- flex-shrink: 0;
173
- gap: var(--gap-vertical) var(--gap-horizontal);
174
-
175
-
176
- &-value {
177
- @extend %font-geist-mono;
178
- font-family: var(--font-family);
179
- font-size: var(--font-size-400);
180
- font-weight: var(--font-weight-500);
181
- }
182
- }
183
-
184
- &-face {
185
- @extend %absolute-full;
186
- backface-visibility: hidden;
187
- background: var(--background);
188
- border-radius: var(--border-radius);
189
- box-shadow: var(--surface-shadow-default);
190
- color: var(--color);
191
- display: flex;
192
- flex-direction: column;
193
- overflow: hidden;
194
- transition: opacity var(--transition-duration) var(--transition-timing-function);
195
-
196
-
197
- &--back {
198
- transform: rotateY(180deg);
199
-
200
-
201
- @media (prefers-reduced-motion: reduce) {
202
- opacity: 0;
203
- transform: none;
204
- }
205
- }
206
-
207
- &--front {
208
- justify-content: space-between;
209
- padding-block: var(--padding-vertical);
210
- padding-inline: var(--padding-horizontal);
211
- }
212
-
213
-
214
- &-bottom {
215
- align-items: flex-end;
216
- display: flex;
217
- gap: var(--gap-vertical) var(--gap-horizontal);
218
- justify-content: space-between;
219
- }
220
-
221
- &-top {
222
- align-items: flex-start;
223
- display: flex;
224
- justify-content: space-between;
225
- }
226
- }
227
-
228
- // Chained through '.input' so these win over the reused input styles regardless of stylesheet order.
229
- &-field {
230
- &--cvc,
231
- &--expiry,
232
- &--number {
233
- @extend %font-geist-mono;
234
- font-family: var(--font-family);
235
- }
236
-
237
- &--number.input {
238
- padding-inline-end: var(--padding-end);
239
- }
240
-
241
-
242
- &.input {
243
- font-variant-numeric: tabular-nums;
244
- height: var(--height);
245
- min-height: 0;
246
- outline: none;
247
- padding-block: 0;
248
- transition: border-color var(--transition-duration) var(--transition-timing-function);
249
-
250
-
251
- &::placeholder {
252
- color: var(--placeholder-color);
253
- }
254
-
255
-
256
- &:focus-visible {
257
- outline: var(--focus-width) solid var(--focus-color);
258
- outline-offset: var(--focus-offset);
259
- }
260
- }
261
- }
262
-
263
- &-fields {
264
- display: flex;
265
- flex-direction: column;
266
- gap: var(--gap-vertical) var(--gap-horizontal);
267
- }
268
-
269
- &-holder {
270
- display: flex;
271
- flex: 1;
272
- flex-direction: column;
273
- gap: var(--gap-vertical) var(--gap-horizontal);
274
- min-width: 0;
275
-
276
-
277
- &-value {
278
- @extend %text-truncate;
279
- font-size: var(--font-size-400);
280
- font-weight: var(--font-weight-500);
281
- text-transform: uppercase;
282
- }
283
- }
284
-
285
- &-label {
286
- font-size: var(--font-size);
287
- font-weight: var(--font-weight);
288
- user-select: none;
289
- }
290
-
291
- &-live {
292
- @extend %hidden-visually;
293
- }
294
-
295
- &-note {
296
- align-items: center;
297
- color: var(--color);
298
- display: flex;
299
- font-size: var(--font-size-300);
300
- gap: var(--gap-vertical) var(--gap-horizontal);
301
- justify-content: center;
302
- margin: 0;
303
- }
304
-
305
- &-number {
306
- @extend %font-geist-mono;
307
- align-self: flex-start;
308
- font-family: var(--font-family);
309
- font-size: var(--font-size);
310
- white-space: nowrap;
311
- }
312
-
313
- &-preview {
314
- aspect-ratio: 1.586;
315
- perspective: var(--perspective);
316
- position: relative;
317
- user-select: none;
318
- width: 100%;
319
- }
320
-
321
- // Driven by transitions on its box, so moving between fields slides. Appearing from nowhere it has no box to slide
322
- // from, being undisplayed until then, and only fades in; it stays displayed while it fades out.
323
- &-ring {
324
- border: var(--border-width) solid var(--border-color);
325
- border-radius: var(--border-radius);
326
- display: none;
327
- left: 0;
328
- opacity: 0;
329
- pointer-events: none;
330
- position: absolute;
331
- top: 0;
332
- transition:
333
- display var(--fade-duration) allow-discrete,
334
- height var(--transition-duration) var(--transition-timing-function),
335
- left var(--transition-duration) var(--transition-timing-function),
336
- opacity var(--fade-duration) var(--fade-timing-function),
337
- top var(--transition-duration) var(--transition-timing-function),
338
- width var(--transition-duration) var(--transition-timing-function);
339
-
340
-
341
- @include tokens.state(active) {
342
- display: block;
343
- opacity: 1;
344
-
345
-
346
- @starting-style {
347
- opacity: 0;
348
- }
349
- }
350
- }
351
-
352
- &-row {
353
- display: grid;
354
- gap: var(--gap-vertical) var(--gap-horizontal);
355
- grid-template-columns: repeat(2, minmax(0, 1fr));
356
- }
357
-
358
- &-shell {
359
- display: flex;
360
- flex-direction: column;
361
- gap: var(--gap-vertical) var(--gap-horizontal);
362
- min-width: 0;
363
-
364
-
365
- &-header {
366
- align-items: baseline;
367
- display: flex;
368
- gap: var(--gap-vertical) var(--gap-horizontal);
369
- justify-content: space-between;
370
- }
371
- }
372
-
373
- &-signature {
374
- align-items: center;
375
- display: flex;
376
- gap: var(--gap-vertical) var(--gap-horizontal);
377
- padding-block: var(--padding-top) 0;
378
- padding-inline: var(--padding-horizontal);
379
-
380
-
381
- &-value {
382
- @extend %font-geist-mono;
383
- align-items: center;
384
- background: var(--background);
385
- border-radius: var(--border-radius-300);
386
- color: var(--color);
387
- display: flex;
388
- flex: 1;
389
- font-family: var(--font-family);
390
- font-size: var(--font-size-400);
391
- font-style: italic;
392
- height: var(--height);
393
- justify-content: flex-end;
394
- padding-inline: var(--padding-horizontal);
395
- }
396
- }
397
-
398
- &-stripe {
399
- background: var(--background);
400
- height: var(--height);
401
- margin-top: var(--margin-top);
402
- }
403
-
404
- // Chained through '.button' so it wins over the shared button styles regardless of stylesheet order.
405
- &-submit.button {
406
- border: 0;
407
- height: var(--height);
408
- outline: none;
409
-
410
-
411
- &:focus-visible {
412
- outline: var(--focus-width) solid var(--focus-color);
413
- outline-offset: var(--focus-offset);
414
- }
415
- }
416
- }
@@ -1,257 +0,0 @@
1
- @use '/tokens';
2
- @use 'css-utilities/surface';
3
-
4
- .cc {
5
- --color: var(--color-text-500);
6
- --gap-horizontal: 0px;
7
- --gap-vertical: var(--size-500);
8
- --spring: linear(0, 0.035, 0.118, 0.216, 0.319, 0.424, 0.515, 0.6, 0.669, 0.728, 0.781, 0.822, 0.856, 0.885, 0.908, 0.927, 0.942, 0.954, 0.964, 0.971, 0.977, 0.982, 0.986, 0.989, 0.991, 0.993, 0.995, 0.996, 0.997, 0.997, 1);
9
- --width: min(400px, 100%);
10
-
11
-
12
- &-actions {
13
- --gap-horizontal: 0px;
14
- --gap-vertical: var(--size-200);
15
- }
16
-
17
- &-brand {
18
- &--large {
19
- --height: 32px;
20
- --width: 48px;
21
- }
22
-
23
- &--small {
24
- --height: 24px;
25
- --width: 36px;
26
- }
27
-
28
-
29
- &-mark {
30
- --icon-swap-duration: 300ms;
31
- --icon-swap-timing-function: var(--spring);
32
- }
33
- }
34
-
35
- // The icons are chained through '.icon' so they win over its own size and color regardless of stylesheet order,
36
- // and take the text color around them.
37
- &-brand-icon.icon {
38
- --color: currentColor;
39
- --height: 100%;
40
- --width: 100%;
41
- }
42
-
43
- &-caption {
44
- --opacity: 0.6;
45
- }
46
-
47
- // A half turn across the card's full width reads as a rush under ~400ms, and nobody waits on it.
48
- &-card {
49
- --transition-duration: 764ms;
50
- --transition-timing-function: linear(0, 0.031, 0.108, 0.205, 0.315, 0.421, 0.524, 0.614, 0.695, 0.762, 0.82, 0.865, 0.903, 0.931, 0.954, 0.97, 0.982, 0.991, 0.997, 1.001, 1.004, 1.005, 1.006, 1.006, 1.005, 1.005, 1.004, 1.004, 1.003, 1.002, 1);
51
- }
52
-
53
- &-chip.icon {
54
- --color: currentColor;
55
- --height: 32px;
56
- --width: 44px;
57
- }
58
-
59
- &-control-brand {
60
- --color: var(--color-text-300);
61
- --inset-horizontal: 12px;
62
-
63
-
64
- &--known {
65
- --color: var(--color-text-500);
66
- }
67
- }
68
-
69
- &-digit {
70
- --animation-duration: 150ms;
71
- --animation-timing-function: ease-out;
72
-
73
-
74
- &--gap {
75
- --gap-horizontal: 0.6em;
76
- }
77
-
78
- &--placeholder {
79
- --opacity: 0.45;
80
- }
81
- }
82
-
83
- &-disclaimer {
84
- --opacity: 0.6;
85
- --padding-bottom: var(--size-500);
86
- --padding-horizontal: 24px;
87
- }
88
-
89
- &-error {
90
- --color: var(--color-red-400);
91
- --offset: 2px;
92
- --transition-duration: 200ms;
93
- --transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
94
- }
95
-
96
- &-expires {
97
- --gap-horizontal: 0px;
98
- --gap-vertical: calc(var(--size-100) / 2);
99
- }
100
-
101
- // A physical card keeps its dark face in both modes; what sits on it reads these through inheritance.
102
- &-face {
103
- @extend %surface-raise;
104
- --background: var(--color-black-300);
105
- --border-radius: var(--border-radius-700);
106
- --color: var(--color-white-300);
107
- --transition-duration: 200ms;
108
- --transition-timing-function: ease-out;
109
-
110
-
111
- &--front {
112
- --padding-horizontal: 24px;
113
- --padding-vertical: 24px;
114
- }
115
-
116
-
117
- &-bottom {
118
- --gap-horizontal: 24px;
119
- --gap-vertical: 0px;
120
- }
121
- }
122
-
123
- // Chained through '.input' so these win over the reused input styles regardless of stylesheet order.
124
- &-field--number.input {
125
- --padding-end: 64px;
126
- }
127
-
128
- &-field.input {
129
- --background-default: transparent;
130
- --border-color-active: var(--surface-border-default);
131
- --border-color-default: var(--surface-border-default);
132
- --border-color-hover: var(--surface-border-default);
133
- --border-color-pressed: var(--surface-border-default);
134
- --border-radius: var(--border-radius-600);
135
- --border-width: var(--border-width-400);
136
- --color-default: currentColor;
137
- --font-size: var(--font-size-400);
138
- --height: 44px;
139
- --padding-horizontal: 14px;
140
- --placeholder-color: oklch(from var(--color-text-300) l c h / 0.7);
141
- --transition-duration: 150ms;
142
- --transition-timing-function: ease-out;
143
-
144
-
145
- &[aria-invalid='true'] {
146
- --border-color-active: var(--color-red-400);
147
- --border-color-default: var(--color-red-400);
148
- --border-color-hover: var(--color-red-400);
149
- --border-color-pressed: var(--color-red-400);
150
- }
151
- }
152
-
153
- &-fields {
154
- --gap-horizontal: 0px;
155
- --gap-vertical: var(--size-400);
156
- }
157
-
158
- &-holder {
159
- --gap-horizontal: 0px;
160
- --gap-vertical: calc(var(--size-100) / 2);
161
- }
162
-
163
- &-label {
164
- --font-size: var(--font-size-300);
165
- --font-weight: var(--font-weight-500);
166
- }
167
-
168
- &-note {
169
- --color: var(--color-text-300);
170
- --gap-horizontal: calc(var(--size-300) / 2);
171
- --gap-vertical: 0px;
172
- }
173
-
174
- // Chained through '.icon' so it wins over the icon's own size and color regardless of stylesheet order.
175
- &-note-icon.icon {
176
- --color: currentColor;
177
- --size: 14px;
178
- }
179
-
180
- &-number {
181
- --font-size: clamp(16px, 5.2vw, 21px);
182
- }
183
-
184
- &-preview {
185
- --perspective: 1200px;
186
- }
187
-
188
- // The ring jumps between fields, still fading in and out.
189
- &-ring {
190
- --border-color: oklch(from var(--color) l c h / 0.35);
191
- --border-radius: var(--border-radius-400);
192
- --border-width: 1px;
193
- --fade-duration: 120ms;
194
- --fade-timing-function: ease-out;
195
- --transition-duration: 300ms;
196
- --transition-timing-function: var(--spring);
197
-
198
-
199
- @media (prefers-reduced-motion: reduce) {
200
- --transition-duration: 0s;
201
- }
202
-
203
-
204
- @include tokens.state(active) {
205
- --fade-duration: 200ms;
206
- }
207
- }
208
-
209
- &-row {
210
- --gap-horizontal: 12px;
211
- --gap-vertical: 12px;
212
- }
213
-
214
- &-shell {
215
- --gap-horizontal: 0px;
216
- --gap-vertical: var(--size-100);
217
-
218
-
219
- &-header {
220
- --gap-horizontal: var(--size-100);
221
- --gap-vertical: 0px;
222
- }
223
- }
224
-
225
- &-signature {
226
- --gap-horizontal: 12px;
227
- --gap-vertical: 0px;
228
- --padding-horizontal: 24px;
229
- --padding-top: var(--size-500);
230
-
231
-
232
- &-value {
233
- --background: var(--color-white-300);
234
- --color: var(--color-black-300);
235
- --height: 40px;
236
- --padding-horizontal: 12px;
237
- }
238
- }
239
-
240
- &-stripe {
241
- --background: oklch(from var(--color) l c h / 0.15);
242
- --height: 44px;
243
- --margin-top: 24px;
244
- }
245
-
246
- // Chained through '.button' so it wins over the shared button styles regardless of stylesheet order.
247
- &-submit.button {
248
- --background-default: var(--color-primary-500);
249
- --border-radius: var(--border-radius-600);
250
- --color-default: var(--color-surface);
251
- --font-size: var(--font-size-400);
252
- --font-weight: var(--font-weight-500);
253
- --height: 44px;
254
- --padding-horizontal: var(--size-500);
255
- --padding-vertical: 0px;
256
- }
257
- }