@react-spectrum/s2 3.0.0-nightly-73414999f-240916 → 3.0.0-nightly-9e79420c1-240918

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,300 +1,14 @@
1
- @keyframes -_5slx9u {
2
- 0% {
3
- transform: rotate(90deg);
4
- }
5
-
6
- 1.69% {
7
- transform: rotate(72.3deg);
8
- }
9
-
10
- 3.39% {
11
- transform: rotate(55.5deg);
12
- }
13
-
14
- 5.08% {
15
- transform: rotate(40.3deg);
16
- }
17
-
18
- 6.78% {
19
- transform: rotate(25deg);
20
- }
21
-
22
- 8.47% {
23
- transform: rotate(10.6deg);
24
- }
25
-
26
- 10.17%, 40.68% {
27
- transform: rotate(0);
28
- }
29
-
30
- 42.37% {
31
- transform: rotate(5.3deg);
32
- }
33
-
34
- 44.07% {
35
- transform: rotate(13.4deg);
36
- }
37
-
38
- 45.76% {
39
- transform: rotate(20.6deg);
40
- }
41
-
42
- 47.46% {
43
- transform: rotate(29deg);
44
- }
45
-
46
- 49.15% {
47
- transform: rotate(36.5deg);
48
- }
49
-
50
- 50.85% {
51
- transform: rotate(42.6deg);
52
- }
53
-
54
- 52.54% {
55
- transform: rotate(48.8deg);
56
- }
57
-
58
- 54.24% {
59
- transform: rotate(54.2deg);
60
- }
61
-
62
- 55.93% {
63
- transform: rotate(59.4deg);
64
- }
65
-
66
- 57.63% {
67
- transform: rotate(63.2deg);
68
- }
69
-
70
- 59.32% {
71
- transform: rotate(67.2deg);
72
- }
73
-
74
- 61.02% {
75
- transform: rotate(70.8deg);
76
- }
77
-
78
- 62.71% {
79
- transform: rotate(73.8deg);
80
- }
81
-
82
- 64.41% {
83
- transform: rotate(76.2deg);
84
- }
85
-
86
- 66.1% {
87
- transform: rotate(78.7deg);
88
- }
89
-
90
- 67.8% {
91
- transform: rotate(80.6deg);
92
- }
93
-
94
- 69.49% {
95
- transform: rotate(82.6deg);
96
- }
97
-
98
- 71.19% {
99
- transform: rotate(83.7deg);
100
- }
101
-
102
- 72.88% {
103
- transform: rotate(85deg);
104
- }
105
-
106
- 74.58% {
107
- transform: rotate(86.3deg);
108
- }
109
-
110
- 76.27% {
111
- transform: rotate(87deg);
112
- }
113
-
114
- 77.97% {
115
- transform: rotate(87.7deg);
116
- }
117
-
118
- 79.66% {
119
- transform: rotate(88.3deg);
120
- }
121
-
122
- 81.36% {
123
- transform: rotate(88.6deg);
124
- }
125
-
126
- 83.05% {
127
- transform: rotate(89.2deg);
128
- }
129
-
130
- 84.75% {
131
- transform: rotate(89.2deg);
132
- }
133
-
134
- 86.44% {
135
- transform: rotate(89.5deg);
136
- }
137
-
138
- 88.14% {
139
- transform: rotate(89.9deg);
140
- }
141
-
142
- 89.83% {
143
- transform: rotate(89.7deg);
144
- }
145
-
146
- 91.53% {
147
- transform: rotate(90.1deg);
148
- }
149
-
150
- 93.22% {
151
- transform: rotate(90.2deg);
152
- }
153
-
154
- 94.92% {
155
- transform: rotate(90.1deg);
156
- }
157
-
158
- 96.61% {
159
- transform: rotate(90deg);
160
- }
161
-
162
- 98.31% {
163
- transform: rotate(89.8deg);
164
- }
165
-
166
- 100% {
167
- transform: rotate(90deg);
168
- }
169
- }
170
-
171
- @keyframes -_36n5pc {
172
- 0%, 8.47% {
173
- transform: rotate(180deg);
174
- }
175
-
176
- 10.17% {
177
- transform: rotate(179.2deg);
178
- }
179
-
180
- 11.86% {
181
- transform: rotate(164deg);
182
- }
183
-
184
- 13.56% {
185
- transform: rotate(151.8deg);
186
- }
187
-
188
- 15.25% {
189
- transform: rotate(140.8deg);
190
- }
191
-
192
- 16.95% {
193
- transform: rotate(130.3deg);
194
- }
195
-
196
- 18.64% {
197
- transform: rotate(120.4deg);
198
- }
199
-
200
- 20.34% {
201
- transform: rotate(110.8deg);
202
- }
203
-
204
- 22.03% {
205
- transform: rotate(101.6deg);
206
- }
207
-
208
- 23.73% {
209
- transform: rotate(93.5deg);
210
- }
211
-
212
- 25.42% {
213
- transform: rotate(85.4deg);
214
- }
215
-
216
- 27.12% {
217
- transform: rotate(78.1deg);
218
- }
219
-
220
- 28.81% {
221
- transform: rotate(71.2deg);
222
- }
223
-
224
- 30.51% {
225
- transform: rotate(89.1deg);
226
- }
227
-
228
- 32.2% {
229
- transform: rotate(105.5deg);
230
- }
231
-
232
- 33.9% {
233
- transform: rotate(121.3deg);
234
- }
235
-
236
- 35.59% {
237
- transform: rotate(135.5deg);
238
- }
239
-
240
- 37.29% {
241
- transform: rotate(148.4deg);
242
- }
243
-
244
- 38.98% {
245
- transform: rotate(161deg);
246
- }
247
-
248
- 40.68% {
249
- transform: rotate(173.5deg);
250
- }
251
-
252
- 42.37%, 100% {
253
- transform: rotate(180deg);
254
- }
255
- }
256
-
257
- @keyframes -nqh121 {
258
- 0% {
259
- transform: rotate(-90deg);
260
- }
261
-
262
- 100% {
263
- transform: rotate(270deg);
264
- }
265
- }
266
-
267
1
  @layer _.a {
268
- ._Zb {
269
- display: inline-block;
270
- }
271
-
272
- .Uc {
273
- position: relative;
274
- }
275
-
276
- .ci {
277
- border-color: var(--lightningcss-light, #dadada) var(--lightningcss-dark, #393939);
278
- }
279
-
280
- .cj {
281
- border-color: var(--lightningcss-light, #c6c6c6) var(--lightningcss-dark, #444);
282
- }
283
-
284
- .c____9 {
285
- border-color: #ffffff2b;
286
- }
287
-
288
- .c_____a {
289
- border-color: #ffffff36;
2
+ .lq {
3
+ width: 2rem;
290
4
  }
291
5
 
292
- .c_____m {
293
- border-color: #00000026;
6
+ .lj {
7
+ width: 1rem;
294
8
  }
295
9
 
296
- .c_____n {
297
- border-color: #00000038;
10
+ .lB {
11
+ width: 4rem;
298
12
  }
299
13
 
300
14
  .kq {
@@ -309,223 +23,51 @@
309
23
  height: 4rem;
310
24
  }
311
25
 
312
- .lq {
313
- width: 2rem;
314
- }
315
-
316
- .lj {
317
- width: 1rem;
318
- }
319
-
320
- .lB {
321
- width: 4rem;
322
- }
323
-
324
26
  ._bb {
325
27
  aspect-ratio: 1;
326
28
  }
327
29
 
328
- .__na {
329
- box-sizing: border-box;
330
- }
331
-
332
- .wa {
333
- border-style: solid;
334
- }
335
-
336
- .u-3760g0 {
337
- border-top-width: 3px;
338
- }
339
-
340
- .uc {
341
- border-top-width: 2px;
342
- }
343
-
344
- .ud {
345
- border-top-width: 4px;
346
- }
347
-
348
- .v-3760g0 {
349
- border-bottom-width: 3px;
350
- }
351
-
352
- .vc {
353
- border-bottom-width: 2px;
354
- }
355
-
356
- .vd {
357
- border-bottom-width: 4px;
358
- }
359
-
360
- .s-3760g0 {
361
- border-inline-start-width: 3px;
362
- }
363
-
364
- .sc {
365
- border-inline-start-width: 2px;
366
- }
367
-
368
- .sd {
369
- border-inline-start-width: 4px;
370
- }
371
-
372
- .t-3760g0 {
373
- border-inline-end-width: 3px;
374
- }
375
-
376
- .tc {
377
- border-inline-end-width: 2px;
378
- }
379
-
380
- .td {
381
- border-inline-end-width: 4px;
382
- }
383
-
384
- ._vf {
385
- border-start-start-radius: 9999px;
386
- }
387
-
388
- ._wf {
389
- border-start-end-radius: 9999px;
390
- }
391
-
392
- ._xf {
393
- border-end-start-radius: 9999px;
394
- }
395
-
396
- ._yf {
397
- border-end-end-radius: 9999px;
398
- }
399
-
400
- .cy {
401
- border-color: var(--lightningcss-light, #3b63fb) var(--lightningcss-dark, #5681ff);
402
- }
403
-
404
- .cz {
405
- border-color: var(--lightningcss-light, #274dea) var(--lightningcss-dark, #6995fe);
406
- }
407
-
408
- .c_____f {
409
- border-color: #fffffff0;
30
+ ._Zb {
31
+ display: inline-block;
410
32
  }
411
33
 
412
- .c_____g {
413
- border-color: #fff;
34
+ .fk {
35
+ stroke: var(--lightningcss-light, #dadada) var(--lightningcss-dark, #393939);
414
36
  }
415
37
 
416
- .c_____s {
417
- border-color: #000000ed;
38
+ .f_____b {
39
+ stroke: #ffffff2b;
418
40
  }
419
41
 
420
- .c_____t {
421
- border-color: #000;
42
+ .f_____o {
43
+ stroke: #00000026;
422
44
  }
423
45
 
424
- .Xa {
425
- top: 0;
46
+ .fA {
47
+ stroke: var(--lightningcss-light, #3b63fb) var(--lightningcss-dark, #5681ff);
426
48
  }
427
49
 
428
- .Ya {
429
- left: 0;
50
+ .f_____h {
51
+ stroke: #fffffff0;
430
52
  }
431
53
 
432
- ._S-157qd4d {
433
- animation-name: -nqh121;
54
+ .f_____u {
55
+ stroke: #000000ed;
434
56
  }
435
57
 
436
- ._Y-1fqa2yh {
437
- animation-timing-function: cubic-bezier(.25, .78, .48, .89);
58
+ .R-375ty3 {
59
+ rotate: -90deg;
438
60
  }
439
61
 
440
62
  .__Ga {
441
63
  transform-origin: center;
442
64
  }
443
-
444
- .T-115o53i {
445
- transform: rotate(180deg);
446
- }
447
-
448
- .Ua {
449
- position: absolute;
450
- }
451
-
452
- .l-3760fj {
453
- width: 50%;
454
- }
455
-
456
- .T-1gm38v9 {
457
- transform: rotate(0);
458
- }
459
-
460
- .T-11akxcr {
461
- transform: rotate(-180deg);
462
- }
463
-
464
- ._S-6p1wh7 {
465
- animation-name: -_5slx9u;
466
- }
467
-
468
- .l4 {
469
- width: 100%;
470
- }
471
-
472
- .k4 {
473
- height: 100%;
474
- }
475
-
476
- .__G-1gvo10c {
477
- transform-origin: 100%;
478
- }
479
-
480
- .T-1ecy9hq {
481
- transform: translateZ(0);
482
- }
483
-
484
- .__vb {
485
- overflow-x: hidden;
486
- }
487
-
488
- .__wb {
489
- overflow-y: hidden;
490
- }
491
-
492
- ._S-47ds34 {
493
- animation-name: -_36n5pc;
494
- }
495
-
496
- ._T-yjb9nq {
497
- animation-duration: 1s;
498
- }
499
-
500
- ._Yb {
501
- animation-timing-function: linear;
502
- }
503
-
504
- .__Pd {
505
- will-change: transform;
506
- }
507
-
508
- ._X-twzmrf {
509
- animation-iteration-count: infinite;
510
- }
511
65
  }
512
66
 
513
67
  @layer _.b, UNSAFE_overrides;
514
68
 
515
69
  @layer _.b.b {
516
70
  @media not ((hover: hover) and (pointer: fine)) {
517
- .kbr {
518
- height: 2.5rem;
519
- }
520
-
521
- .kbk {
522
- height: 1.25rem;
523
- }
524
-
525
- .kbC {
526
- height: 5rem;
527
- }
528
-
529
71
  .lbr {
530
72
  width: 2.5rem;
531
73
  }
@@ -537,17 +79,29 @@
537
79
  .lbC {
538
80
  width: 5rem;
539
81
  }
82
+
83
+ .kbr {
84
+ height: 2.5rem;
85
+ }
86
+
87
+ .kbk {
88
+ height: 1.25rem;
89
+ }
90
+
91
+ .kbC {
92
+ height: 5rem;
93
+ }
540
94
  }
541
95
  }
542
96
 
543
97
  @layer _.b.a {
544
98
  @media (forced-colors: active) {
545
- .ca_____u {
546
- border-color: background;
99
+ .fa_____w {
100
+ stroke: background;
547
101
  }
548
102
 
549
- .ca_____z {
550
- border-color: highlight;
103
+ .fa_____B {
104
+ stroke: highlight;
551
105
  }
552
106
  }
553
107
  }
@@ -555,4 +109,24 @@
555
109
  .\.:not(#a#b) {
556
110
  all: revert-layer;
557
111
  }
112
+
113
+ @keyframes -u41dq3 {
114
+ 0% {
115
+ transform: rotate(0);
116
+ }
117
+
118
+ 100% {
119
+ transform: rotate(360deg);
120
+ }
121
+ }
122
+
123
+ @keyframes -_1i5ccgk {
124
+ 0%, 100% {
125
+ stroke-dashoffset: 75px;
126
+ }
127
+
128
+ 30% {
129
+ stroke-dashoffset: 20px;
130
+ }
131
+ }
558
132
  /*# sourceMappingURL=ProgressCircle.css.map */
@@ -1 +1 @@
1
- {"mappings":"ACuCwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0KA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsFJ;;;;;;;;;;AAwBJ;EAAA;;;;EAAA;;;;EAoBF;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAmBD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EA8BqB;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAmBhB;;;;EAKA;;;;EAAA;;;;EAAA;;;;EAqBE;;;;EAIc;;;;EAMA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AA5HlB;;AAAA;EAAA;IAuCH;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAnBC;EAAA;IAAA;;;;IAmBD;;;;;;AAAA","sources":["899fc8f7586d17bf","packages/@react-spectrum/s2/src/ProgressCircle.tsx"],"sourcesContent":["@import \"766ebfa3e9b99037\";\n@import \"cdcaa7bc1c97d336\";\n@import \"788ab0411a865673\";\n@import \"73f154e47fb53c5b\";\n@import \"6c6d672d6676880a\";\n@import \"99c6c5c836ac9ba8\";\n@import \"7d1c62f8f7082322\";\n@import \"63167f67c27b04a9\";\n@import \"e160fe2ae244c819\";\n@import \"2615a8fcc020d27d\";\n@import \"f9d9993d358c0acb\";\n@import \"7f466678796941f2\";\n@import \"4514b1364d299438\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {baseColor, style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {clamp} from '@react-aria/utils';\nimport {ContextValue, ProgressBar as RACProgressBar, ProgressBarProps as RACProgressBarProps} from 'react-aria-components';\nimport {createContext, CSSProperties, forwardRef} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ProgressCircleStyleProps {\n /**\n * The size of the ProgressCircle.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** The static color style to apply. Useful when the button appears over a color background. */\n staticColor?: 'black' | 'white',\n /**\n * Whether presentation is indeterminate when progress isn't known.\n */\n isIndeterminate?: boolean\n}\n\nexport const ProgressCircleContext = createContext<ContextValue<ProgressCircleProps, DOMRefValue<HTMLDivElement>>>(null);\n\nconst fillMask1Frames = keyframes(`\n0% {\n transform: rotate(90deg);\n}\n\n1.69% {\n transform: rotate(72.3deg);\n}\n\n3.39% {\n transform: rotate(55.5deg);\n}\n\n5.08% {\n transform: rotate(40.3deg);\n}\n\n6.78% {\n transform: rotate(25deg);\n}\n\n8.47% {\n transform: rotate(10.6deg);\n}\n\n10.17%, 40.68% {\n transform: rotate(0deg);\n}\n\n42.37% {\n transform: rotate(5.3deg);\n}\n\n44.07% {\n transform: rotate(13.4deg);\n}\n\n45.76% {\n transform: rotate(20.6deg);\n}\n\n47.46% {\n transform: rotate(29deg);\n}\n\n49.15% {\n transform: rotate(36.5deg);\n}\n\n50.85% {\n transform: rotate(42.6deg);\n}\n\n52.54% {\n transform: rotate(48.8deg);\n}\n\n54.24% {\n transform: rotate(54.2deg);\n}\n\n55.93% {\n transform: rotate(59.4deg);\n}\n\n57.63% {\n transform: rotate(63.2deg);\n}\n\n59.32% {\n transform: rotate(67.2deg);\n}\n\n61.02% {\n transform: rotate(70.8deg);\n}\n\n62.71% {\n transform: rotate(73.8deg);\n}\n\n64.41% {\n transform: rotate(76.2deg);\n}\n\n66.1% {\n transform: rotate(78.7deg);\n}\n\n67.8% {\n transform: rotate(80.6deg);\n}\n\n69.49% {\n transform: rotate(82.6deg);\n}\n\n71.19% {\n transform: rotate(83.7deg);\n}\n\n72.88% {\n transform: rotate(85deg);\n}\n\n74.58% {\n transform: rotate(86.3deg);\n}\n\n76.27% {\n transform: rotate(87deg);\n}\n\n77.97% {\n transform: rotate(87.7deg);\n}\n\n79.66% {\n transform: rotate(88.3deg);\n}\n\n81.36% {\n transform: rotate(88.6deg);\n}\n\n83.05% {\n transform: rotate(89.2deg);\n}\n\n84.75% {\n transform: rotate(89.2deg);\n}\n\n86.44% {\n transform: rotate(89.5deg);\n}\n\n88.14% {\n transform: rotate(89.9deg);\n}\n\n89.83% {\n transform: rotate(89.7deg);\n}\n\n91.53% {\n transform: rotate(90.1deg);\n}\n\n93.22% {\n transform: rotate(90.2deg);\n}\n\n94.92% {\n transform: rotate(90.1deg);\n}\n\n96.61% {\n transform: rotate(90deg);\n}\n\n98.31% {\n transform: rotate(89.8deg);\n}\n\n100% {\n transform: rotate(90deg);\n}\n`);\n\nconst fillMask2Frames = keyframes(`\n0%, 8.47% {\n transform: rotate(180deg);\n}\n\n10.17% {\n transform: rotate(179.2deg);\n}\n\n11.86% {\n transform: rotate(164deg);\n}\n\n13.56% {\n transform: rotate(151.8deg);\n}\n\n15.25% {\n transform: rotate(140.8deg);\n}\n\n16.95% {\n transform: rotate(130.3deg);\n}\n\n18.64% {\n transform: rotate(120.4deg);\n}\n\n20.34% {\n transform: rotate(110.8deg);\n}\n\n22.03% {\n transform: rotate(101.6deg);\n}\n\n23.73% {\n transform: rotate(93.5deg);\n}\n\n25.42% {\n transform: rotate(85.4deg);\n}\n\n27.12% {\n transform: rotate(78.1deg);\n}\n\n28.81% {\n transform: rotate(71.2deg);\n}\n\n30.51% {\n transform: rotate(89.1deg);\n}\n\n32.2% {\n transform: rotate(105.5deg);\n}\n\n33.9% {\n transform: rotate(121.3deg);\n}\n\n35.59% {\n transform: rotate(135.5deg);\n}\n\n37.29% {\n transform: rotate(148.4deg);\n}\n\n38.98% {\n transform: rotate(161deg);\n}\n\n40.68% {\n transform: rotate(173.5deg);\n}\n\n42.37%, 100% {\n transform: rotate(180deg);\n}\n`);\n\nconst fillsRotate = keyframes(`\n0% {transform: rotate(-90deg)}\n100% {transform: rotate(270deg)}\n`);\n\nconst circleDims = {\n height: {\n default: 32,\n size: {\n S: 16,\n L: 64\n }\n },\n width: {\n default: 32,\n size: {\n S: 16,\n L: 64\n }\n },\n aspectRatio: 'square'\n} as const;\n\n// Double check the types passed to each style, may not need all for each\nconst wrapper = style<ProgressCircleStyleProps>({\n ...circleDims,\n display: 'inline-block',\n position: 'relative'\n}, getAllowedOverrides());\n\nconst trackStyles = {\n ...circleDims,\n boxSizing: 'border-box',\n borderStyle: 'solid',\n borderWidth: {\n default: '[3px]',\n size: {\n S: 2,\n L: 4\n }\n },\n borderRadius: 'full'\n} as const;\n\nconst track = style<ProgressCircleStyleProps>({\n ...trackStyles,\n borderColor: {\n default: baseColor('gray-300'),\n staticColor: {\n white: {\n default: baseColor('transparent-white-300'),\n forcedColors: 'Background'\n },\n // TODO: no designs for this one\n black: {\n default: baseColor('transparent-black-300'),\n forcedColors: 'Background'\n }\n },\n forcedColors: 'Background'\n }\n});\n\nconst fill = style<ProgressCircleStyleProps>({\n ...trackStyles,\n borderColor: {\n default: baseColor('blue-900'),\n staticColor: {\n white: {\n default: baseColor('transparent-white-900'),\n forcedColors: 'Highlight'\n },\n // TODO: no designs for this one\n black: {\n default: baseColor('transparent-black-900'),\n forcedColors: 'Highlight'\n }\n },\n forcedColors: 'Highlight'\n }\n});\n\nconst fillsWrapperStyles = {\n position: 'absolute',\n top: 0,\n left: 0,\n size: 'full'\n} as const;\n\nconst fillsWrapper = style({\n ...fillsWrapperStyles\n});\n\nconst fillsWrapperIndeterminate = style({\n ...fillsWrapperStyles,\n willChange: 'transform',\n transform: 'translateZ(0)',\n animation: fillsRotate,\n animationDuration: 1000,\n animationTimingFunction: '[cubic-bezier(.25,.78,.48,.89)]',\n animationIterationCount: 'infinite',\n transformOrigin: 'center'\n});\n\nconst commonFillMask = {\n position: 'absolute',\n width: '[50%]',\n height: 'full',\n transformOrigin: '[100% center]',\n overflow: 'hidden'\n} as const;\n\nconst fillMask1 = style({\n ...commonFillMask,\n transform: 'rotate(180deg)'\n});\n\nconst fillMask2 = style({\n ...commonFillMask,\n transform: 'rotate(0deg)'\n});\n\nconst commonFillSubMask = {\n width: 'full',\n height: 'full',\n transformOrigin: '[100% center]',\n transform: 'rotate(-180deg)',\n overflow: 'hidden'\n} as const;\n\nconst commonFillSubMaskIndeterminate = {\n transform: 'translateZ(0)',\n willChange: 'transform',\n animationDuration: 1000,\n animationTimingFunction: 'linear',\n animationIterationCount: 'infinite'\n} as const;\n\nconst fillSubMask = style({\n ...commonFillSubMask\n});\n\nconst fillSubMask1Indeterminate = style({\n ...commonFillSubMask,\n animation: fillMask1Frames,\n ...commonFillSubMaskIndeterminate\n});\n\nconst fillSubMask2Indeterminate = style({\n ...commonFillSubMask,\n animation: fillMask2Frames,\n ...commonFillSubMaskIndeterminate\n});\n\nexport interface ProgressCircleProps extends Omit<RACProgressBarProps, 'children' | 'style' | 'valueLabel' | 'formatOptions' | 'label' | 'className'>, ProgressCircleStyleProps, StyleProps {}\n\nfunction ProgressCircle(props: ProgressCircleProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ProgressCircleContext);\n let {\n value = 0,\n minValue = 0,\n maxValue = 100,\n size = 'M',\n staticColor,\n isIndeterminate = false,\n 'aria-label': ariaLabel,\n 'aria-labelledby': ariaLabelledby,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n value = clamp(value, minValue, maxValue);\n\n let subMask1Style: CSSProperties = {};\n let subMask2Style: CSSProperties = {};\n if (!isIndeterminate) {\n let percentage = (value - minValue) / (maxValue - minValue) * 100;\n let angle;\n if (percentage > 0 && percentage <= 50) {\n angle = -180 + (percentage / 50 * 180);\n subMask1Style.transform = `rotate(${angle}deg)`;\n subMask2Style.transform = 'rotate(-180deg)';\n } else if (percentage > 50) {\n angle = -180 + (percentage - 50) / 50 * 180;\n subMask1Style.transform = 'rotate(0deg)';\n subMask2Style.transform = `rotate(${angle}deg)`;\n }\n }\n\n if (!ariaLabel && !ariaLabelledby) {\n console.warn('ProgressCircle requires an aria-label or aria-labelledby attribute for accessibility');\n }\n\n return (\n <RACProgressBar\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + wrapper({\n ...renderProps,\n size\n }, props.styles)}>\n <div dir=\"ltr\">\n <div className={track({size, staticColor})} />\n <div className={isIndeterminate ? fillsWrapperIndeterminate : fillsWrapper}>\n <div className={fillMask1}>\n <div\n className={isIndeterminate ? fillSubMask1Indeterminate : fillSubMask}\n style={subMask1Style}>\n <div className={fill({size, staticColor})} />\n </div>\n </div>\n <div className={fillMask2}>\n <div\n className={isIndeterminate ? fillSubMask2Indeterminate : fillSubMask}\n style={subMask2Style}>\n <div className={fill({size, staticColor})} />\n </div>\n </div>\n </div>\n </div>\n </RACProgressBar>\n );\n}\n\n/**\n * ProgressCircles show the progression of a system operation such as downloading, uploading, or processing, in a visual way.\n * They can represent determinate or indeterminate progress.\n */\nlet _ProgressCircle = /*#__PURE__*/ forwardRef(ProgressCircle);\nexport {_ProgressCircle as ProgressCircle};\n"],"names":[],"version":3,"file":"ProgressCircle.css.map"}
1
+ {"mappings":"ACuCgB;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAYF;;;;EAAA;;;;EAAA;;;;EAWD;;;;EAAA;;;;EAAA;;;;EAAA;;;;EAAA;;;;;AAvBG;;AAAA;EAAA;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;IAAA;;;;;;AAYF;EAAA;IAAA;;;;IAWD;;;;;;AAAA;;;;AAea;;;;;;;;;;AAWE","sources":["899fc8f7586d17bf","packages/@react-spectrum/s2/src/ProgressCircle.tsx"],"sourcesContent":["@import \"766ebfa3e9b99037\";\n@import \"cdcaa7bc1c97d336\";\n@import \"788ab0411a865673\";\n@import \"73f154e47fb53c5b\";\n@import \"6c6d672d6676880a\";\n","/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {ContextValue, ProgressBar as RACProgressBar, ProgressBarProps as RACProgressBarProps} from 'react-aria-components';\nimport {createContext, forwardRef} from 'react';\nimport {DOMRef, DOMRefValue} from '@react-types/shared';\nimport {getAllowedOverrides, StyleProps} from './style-utils' with {type: 'macro'};\nimport {keyframes} from '../style/style-macro' with {type: 'macro'};\nimport {style} from '../style/spectrum-theme' with {type: 'macro'};\nimport {useDOMRef} from '@react-spectrum/utils';\nimport {useSpectrumContextProps} from './useSpectrumContextProps';\n\nexport interface ProgressCircleStyleProps {\n /**\n * The size of the ProgressCircle.\n *\n * @default 'M'\n */\n size?: 'S' | 'M' | 'L',\n /** The static color style to apply. Useful when the button appears over a color background. */\n staticColor?: 'black' | 'white',\n /**\n * Whether presentation is indeterminate when progress isn't known.\n */\n isIndeterminate?: boolean\n}\n\nexport const ProgressCircleContext = createContext<ContextValue<ProgressCircleProps, DOMRefValue<HTMLDivElement>>>(null);\n\n// Double check the types passed to each style, may not need all for each\nconst wrapper = style<ProgressCircleStyleProps>({\n size: {\n default: 32,\n size: {\n S: 16,\n L: 64\n }\n },\n aspectRatio: 'square',\n display: 'inline-block'\n}, getAllowedOverrides({height: true}));\n\nconst track = style<ProgressCircleStyleProps>({\n stroke: {\n default: 'gray-300',\n staticColor: {\n white: 'transparent-white-300',\n black: 'transparent-black-300'\n },\n forcedColors: 'Background'\n }\n});\n\nconst fill = style<ProgressCircleStyleProps>({\n stroke: {\n default: 'blue-900',\n staticColor: {\n white: 'transparent-white-900',\n black: 'transparent-black-900'\n },\n forcedColors: 'Highlight'\n },\n rotate: -90,\n transformOrigin: 'center'\n});\n\nexport interface ProgressCircleProps extends Omit<RACProgressBarProps, 'children' | 'style' | 'valueLabel' | 'formatOptions' | 'label' | 'className'>, ProgressCircleStyleProps, StyleProps {}\n\nconst rotationAnimation = keyframes(`\n 0% {\n transform: rotate(0deg);\n }\n\n 100% {\n transform: rotate(360deg);\n }\n`);\n\n// stroke-dashoffset represents `100 - percentage`. See below for how this works.\nconst dashoffsetAnimation = keyframes(`\n 0%, 100% {\n stroke-dashoffset: 75;\n }\n\n 30% {\n stroke-dashoffset: 20;\n }\n`);\n\nfunction ProgressCircle(props: ProgressCircleProps, ref: DOMRef<HTMLDivElement>) {\n [props, ref] = useSpectrumContextProps(props, ref, ProgressCircleContext);\n let {\n size = 'M',\n staticColor,\n UNSAFE_style,\n UNSAFE_className = ''\n } = props;\n let domRef = useDOMRef(ref);\n\n let strokeWidth = 3;\n if (size === 'S') {\n strokeWidth = 2;\n } else if (size === 'L') {\n strokeWidth = 4;\n }\n\n // SVG strokes are centered, so subtract half the stroke width from the radius to create an inner stroke.\n let radius = `calc(50% - ${strokeWidth / 2}px)`;\n\n return (\n <RACProgressBar\n {...props}\n ref={domRef}\n style={UNSAFE_style}\n className={renderProps => UNSAFE_className + wrapper({\n ...renderProps,\n size\n }, props.styles)}>\n {({percentage, isIndeterminate}) => (\n <svg\n fill=\"none\"\n width=\"100%\"\n height=\"100%\">\n <circle\n cx=\"50%\"\n cy=\"50%\"\n r={radius}\n strokeWidth={strokeWidth}\n className={track({staticColor})} />\n <circle\n cx=\"50%\"\n cy=\"50%\"\n r={radius}\n strokeWidth={strokeWidth}\n className={fill({staticColor})}\n style={{\n // These cubic-bezier timing functions were derived from the previous animation keyframes\n // using a best fit algorithm, and then manually adjusted to approximate the original animation.\n animation: isIndeterminate ? `${rotationAnimation} 1s cubic-bezier(.6, .1, .3, .9) infinite, ${dashoffsetAnimation} 1s cubic-bezier(.25, .1, .25, 1.3) infinite` : undefined\n }}\n // Normalize the path length to 100 so we can easily set stroke-dashoffset to a percentage.\n pathLength=\"100\"\n // Add extra gap between dashes so 0% works in Chrome.\n strokeDasharray=\"100 200\"\n strokeDashoffset={isIndeterminate || percentage == null ? undefined : 100 - percentage}\n strokeLinecap=\"round\" />\n </svg>\n )}\n </RACProgressBar>\n );\n}\n\n/**\n * ProgressCircles show the progression of a system operation such as downloading, uploading, or processing, in a visual way.\n * They can represent determinate or indeterminate progress.\n */\nlet _ProgressCircle = /*#__PURE__*/ forwardRef(ProgressCircle);\nexport {_ProgressCircle as ProgressCircle};\n"],"names":[],"version":3,"file":"ProgressCircle.css.map"}