@roy-ui/ui 0.0.14 → 0.0.16

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.
@@ -8,7 +8,7 @@
8
8
  --royui-upload-muted: rgba(255, 255, 255, 0.52);
9
9
  --royui-upload-faint: rgba(255, 255, 255, 0.38);
10
10
  --royui-upload-line: rgba(255, 255, 255, 0.12);
11
- --royui-upload-dash: rgba(255, 255, 255, 0.16);
11
+ --royui-upload-dash: rgba(255, 255, 255, 0.09);
12
12
  --royui-upload-drop-bg: rgba(255, 255, 255, 0.015);
13
13
  --royui-upload-tile: #202023;
14
14
  --royui-upload-track: rgba(255, 255, 255, 0.14);
@@ -20,6 +20,9 @@
20
20
 
21
21
  --royui-upload-radius: 18px;
22
22
  --royui-upload-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
23
+ /* Captions, sizes, and percentages use a thin Inter rather than mono. */
24
+ --royui-upload-meta-font: 'Inter', -apple-system, BlinkMacSystemFont,
25
+ 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
23
26
 
24
27
  box-sizing: border-box;
25
28
  width: 100%;
@@ -46,7 +49,7 @@
46
49
  display: flex;
47
50
  align-items: center;
48
51
  justify-content: space-between;
49
- padding: 2px 4px 16px;
52
+ padding: 0 4px 10px;
50
53
  }
51
54
  .royui-upload__title {
52
55
  margin: 0;
@@ -128,8 +131,9 @@
128
131
  }
129
132
  .royui-upload__drop-hint {
130
133
  margin: 0;
131
- font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
134
+ font-family: var(--royui-upload-meta-font);
132
135
  font-size: 11px;
136
+ font-weight: 350;
133
137
  letter-spacing: 0.08em;
134
138
  text-transform: uppercase;
135
139
  color: var(--royui-upload-faint);
@@ -142,18 +146,21 @@
142
146
  .royui-upload__list {
143
147
  display: flex;
144
148
  flex-direction: column;
145
- gap: 10px;
146
- margin-top: 12px;
149
+ gap: 8px;
150
+ margin-top: 10px;
147
151
  }
148
152
  .royui-upload__row {
149
153
  display: flex;
150
- align-items: flex-start;
151
- gap: 14px;
152
- padding: 14px;
153
- border-radius: 12px;
154
+ align-items: center;
155
+ gap: 11px;
156
+ padding: 10px 11px;
157
+ border-radius: 10px;
154
158
  background: var(--royui-upload-row);
155
159
  box-shadow: inset 0 0 0 1px var(--royui-upload-row-line);
156
160
  animation: royui-upload-row-in 280ms var(--royui-upload-ease) both;
161
+ transition:
162
+ background 220ms var(--royui-upload-ease),
163
+ box-shadow 220ms var(--royui-upload-ease);
157
164
  }
158
165
  @keyframes royui-upload-row-in {
159
166
  from {
@@ -171,9 +178,9 @@
171
178
  display: inline-flex;
172
179
  align-items: center;
173
180
  justify-content: center;
174
- width: 40px;
175
- height: 40px;
176
- border-radius: 11px;
181
+ width: 32px;
182
+ height: 32px;
183
+ border-radius: 9px;
177
184
  background: var(--royui-upload-badge, #8b8b94);
178
185
  background-image: linear-gradient(
179
186
  150deg,
@@ -185,9 +192,9 @@
185
192
  0 2px 6px -2px rgba(0, 0, 0, 0.45);
186
193
  }
187
194
  .royui-upload__badge-label {
188
- font-size: 9px;
195
+ font-size: 8px;
189
196
  font-weight: 700;
190
- letter-spacing: 0.04em;
197
+ letter-spacing: 0.03em;
191
198
  color: #fff;
192
199
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
193
200
  }
@@ -195,16 +202,15 @@
195
202
  .royui-upload__row-main {
196
203
  flex: 1;
197
204
  min-width: 0;
198
- }
199
- .royui-upload__row-top {
200
205
  display: flex;
201
- align-items: center;
202
- justify-content: space-between;
203
- gap: 12px;
206
+ flex-direction: column;
207
+ justify-content: center;
204
208
  }
205
209
  .royui-upload__name {
206
- font-size: 14px;
207
- font-weight: 500;
210
+ display: block;
211
+ font-size: 13px;
212
+ font-weight: 450;
213
+ letter-spacing: -0.005em;
208
214
  color: var(--royui-upload-fg);
209
215
  white-space: nowrap;
210
216
  overflow: hidden;
@@ -212,14 +218,15 @@
212
218
  }
213
219
  .royui-upload__row-action {
214
220
  flex: none;
221
+ align-self: center;
215
222
  display: inline-flex;
216
223
  align-items: center;
217
224
  justify-content: center;
218
- width: 26px;
219
- height: 26px;
225
+ width: 30px;
226
+ height: 30px;
220
227
  padding: 0;
221
228
  border: none;
222
- border-radius: 7px;
229
+ border-radius: 8px;
223
230
  background: transparent;
224
231
  color: var(--royui-upload-faint);
225
232
  cursor: pointer;
@@ -237,9 +244,10 @@
237
244
  display: flex;
238
245
  align-items: center;
239
246
  gap: 7px;
240
- margin-top: 5px;
241
- font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
242
- font-size: 11px;
247
+ margin-top: 4px;
248
+ font-family: var(--royui-upload-meta-font);
249
+ font-size: 10.5px;
250
+ font-weight: 350;
243
251
  letter-spacing: 0.04em;
244
252
  text-transform: uppercase;
245
253
  color: var(--royui-upload-muted);
@@ -285,13 +293,13 @@
285
293
  .royui-upload__progress {
286
294
  display: flex;
287
295
  align-items: center;
288
- gap: 12px;
289
- margin-top: 11px;
296
+ gap: 11px;
297
+ margin-top: 8px;
290
298
  }
291
299
  .royui-upload__bar {
292
300
  position: relative;
293
301
  flex: 1;
294
- height: 14px;
302
+ height: 12px;
295
303
  border-radius: 2px;
296
304
  overflow: hidden;
297
305
  background-image: repeating-linear-gradient(
@@ -313,10 +321,11 @@
313
321
  }
314
322
  .royui-upload__pct {
315
323
  flex: none;
316
- min-width: 34px;
324
+ min-width: 32px;
317
325
  text-align: right;
318
- font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
319
- font-size: 12px;
326
+ font-family: var(--royui-upload-meta-font);
327
+ font-size: 11px;
328
+ font-weight: 400;
320
329
  font-variant-numeric: tabular-nums;
321
330
  color: var(--royui-upload-muted);
322
331
  }
@@ -330,26 +339,6 @@
330
339
  padding: 14px 4px 2px;
331
340
  border-top: 1px solid var(--royui-upload-line);
332
341
  }
333
- .royui-upload__icon-btn {
334
- display: inline-flex;
335
- align-items: center;
336
- justify-content: center;
337
- width: 26px;
338
- height: 26px;
339
- padding: 0;
340
- border: none;
341
- border-radius: 7px;
342
- background: transparent;
343
- color: var(--royui-upload-faint);
344
- cursor: pointer;
345
- transition:
346
- background 140ms var(--royui-upload-ease),
347
- color 140ms var(--royui-upload-ease);
348
- }
349
- .royui-upload__icon-btn:hover {
350
- background: var(--royui-upload-hover);
351
- color: var(--royui-upload-fg);
352
- }
353
342
  .royui-upload__remove-all {
354
343
  display: inline-flex;
355
344
  align-items: center;
@@ -357,20 +346,255 @@
357
346
  padding: 0;
358
347
  border: none;
359
348
  background: none;
360
- font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
349
+ font-family: var(--royui-upload-meta-font);
361
350
  font-size: 11px;
351
+ font-weight: 400;
362
352
  letter-spacing: 0.07em;
363
353
  text-transform: uppercase;
364
354
  color: var(--royui-upload-muted);
365
355
  cursor: pointer;
366
356
  transition: color 140ms var(--royui-upload-ease);
367
357
  }
358
+ .royui-upload__remove-all svg {
359
+ width: 16px;
360
+ height: 16px;
361
+ }
368
362
  .royui-upload__remove-all:hover {
369
363
  color: var(--royui-upload-fg);
370
364
  }
365
+ .royui-upload__footer-inner {
366
+ flex: 1;
367
+ display: flex;
368
+ align-items: center;
369
+ gap: 14px;
370
+ animation: royui-upload-swap 240ms var(--royui-upload-ease);
371
+ }
372
+ @keyframes royui-upload-swap {
373
+ from {
374
+ opacity: 0;
375
+ transform: translateY(5px);
376
+ }
377
+ to {
378
+ opacity: 1;
379
+ transform: none;
380
+ }
381
+ }
371
382
  .royui-upload__footer-spacer {
372
383
  flex: 1;
373
384
  }
385
+ .royui-upload__textbtn {
386
+ padding: 0;
387
+ border: none;
388
+ background: none;
389
+ font-family: var(--royui-upload-meta-font);
390
+ font-size: 12px;
391
+ font-weight: 400;
392
+ color: var(--royui-upload-muted);
393
+ cursor: pointer;
394
+ transition: color 140ms var(--royui-upload-ease);
395
+ }
396
+ .royui-upload__textbtn:hover {
397
+ color: var(--royui-upload-fg);
398
+ }
399
+
400
+ /* ── Clickable filename (preview trigger) ───────────────────────────────── */
401
+ .royui-upload__name--button {
402
+ display: block;
403
+ width: 100%;
404
+ padding: 0;
405
+ border: none;
406
+ background: none;
407
+ font: inherit;
408
+ text-align: left;
409
+ cursor: pointer;
410
+ transition: color 140ms var(--royui-upload-ease);
411
+ }
412
+ .royui-upload__name--button:hover {
413
+ color: var(--royui-upload-accent);
414
+ }
415
+
416
+ /* ── Selection mode ─────────────────────────────────────────────────────── */
417
+ .royui-upload--selecting .royui-upload__row {
418
+ cursor: pointer;
419
+ user-select: none;
420
+ -webkit-user-select: none;
421
+ -webkit-touch-callout: none;
422
+ }
423
+ .royui-upload__row.is-selected {
424
+ background: color-mix(in srgb, var(--royui-upload-accent) 12%, var(--royui-upload-row));
425
+ box-shadow: inset 0 0 0 1px var(--royui-upload-accent);
426
+ }
427
+ .royui-upload__check {
428
+ flex: none;
429
+ align-self: center;
430
+ display: inline-flex;
431
+ align-items: center;
432
+ justify-content: center;
433
+ width: 20px;
434
+ height: 20px;
435
+ border-radius: 50%;
436
+ color: #fff;
437
+ background: transparent;
438
+ box-shadow: inset 0 0 0 1.5px var(--royui-upload-line);
439
+ animation: royui-upload-pop-in 200ms var(--royui-upload-ease);
440
+ transition:
441
+ background 160ms var(--royui-upload-ease),
442
+ box-shadow 160ms var(--royui-upload-ease);
443
+ }
444
+ @keyframes royui-upload-pop-in {
445
+ from {
446
+ opacity: 0;
447
+ transform: scale(0.5);
448
+ }
449
+ to {
450
+ opacity: 1;
451
+ transform: none;
452
+ }
453
+ }
454
+ .royui-upload__check.is-checked svg {
455
+ animation: royui-upload-pop-in 160ms var(--royui-upload-ease);
456
+ }
457
+ .royui-upload__check.is-checked {
458
+ background: var(--royui-upload-accent);
459
+ box-shadow: inset 0 0 0 1.5px var(--royui-upload-accent);
460
+ }
461
+
462
+ /* ── Preview modal ──────────────────────────────────────────────────────── */
463
+ .royui-upload__modal {
464
+ position: fixed;
465
+ inset: 0;
466
+ z-index: 1000;
467
+ display: flex;
468
+ align-items: center;
469
+ justify-content: center;
470
+ padding: 24px;
471
+ background: rgba(0, 0, 0, 0.6);
472
+ -webkit-backdrop-filter: blur(4px);
473
+ backdrop-filter: blur(4px);
474
+ animation: royui-upload-fade 160ms var(--royui-upload-ease);
475
+ }
476
+ @keyframes royui-upload-fade {
477
+ from {
478
+ opacity: 0;
479
+ }
480
+ to {
481
+ opacity: 1;
482
+ }
483
+ }
484
+ .royui-upload__modal-panel {
485
+ display: flex;
486
+ flex-direction: column;
487
+ width: min(640px, 100%);
488
+ max-height: min(80vh, 720px);
489
+ background: var(--royui-upload-bg);
490
+ color: var(--royui-upload-fg);
491
+ border-radius: 14px;
492
+ box-shadow:
493
+ 0 0 0 1px var(--royui-upload-line),
494
+ 0 30px 80px -28px rgba(0, 0, 0, 0.7);
495
+ animation: royui-upload-pop 180ms var(--royui-upload-ease);
496
+ }
497
+ @keyframes royui-upload-pop {
498
+ from {
499
+ opacity: 0;
500
+ transform: translateY(8px) scale(0.98);
501
+ }
502
+ to {
503
+ opacity: 1;
504
+ transform: none;
505
+ }
506
+ }
507
+ .royui-upload__modal-head {
508
+ display: flex;
509
+ align-items: center;
510
+ justify-content: space-between;
511
+ gap: 12px;
512
+ padding: 14px 14px 14px 18px;
513
+ border-bottom: 1px solid var(--royui-upload-line);
514
+ }
515
+ .royui-upload__modal-title {
516
+ font-size: 14px;
517
+ font-weight: 500;
518
+ white-space: nowrap;
519
+ overflow: hidden;
520
+ text-overflow: ellipsis;
521
+ }
522
+ .royui-upload__modal-body {
523
+ flex: 1;
524
+ min-height: 0;
525
+ display: flex;
526
+ align-items: center;
527
+ justify-content: center;
528
+ padding: 18px;
529
+ overflow: auto;
530
+ }
531
+ .royui-upload__preview-img {
532
+ max-width: 100%;
533
+ max-height: 60vh;
534
+ border-radius: 8px;
535
+ object-fit: contain;
536
+ }
537
+ .royui-upload__preview-frame {
538
+ width: 100%;
539
+ height: 60vh;
540
+ border: none;
541
+ border-radius: 8px;
542
+ background: #fff;
543
+ }
544
+ .royui-upload__preview-video {
545
+ max-width: 100%;
546
+ max-height: 60vh;
547
+ border-radius: 8px;
548
+ }
549
+ .royui-upload__preview-card {
550
+ display: flex;
551
+ flex-direction: column;
552
+ align-items: center;
553
+ gap: 10px;
554
+ padding: 24px 12px;
555
+ text-align: center;
556
+ }
557
+ .royui-upload__preview-badge {
558
+ display: inline-flex;
559
+ align-items: center;
560
+ justify-content: center;
561
+ width: 56px;
562
+ height: 56px;
563
+ border-radius: 14px;
564
+ background: var(--royui-upload-badge, #8b8b94);
565
+ background-image: linear-gradient(150deg, rgba(255, 255, 255, 0.28), transparent 55%);
566
+ box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
567
+ margin-bottom: 4px;
568
+ }
569
+ .royui-upload__preview-badge .royui-upload__badge-label {
570
+ font-size: 13px;
571
+ }
572
+ .royui-upload__preview-name {
573
+ margin: 0;
574
+ font-size: 15px;
575
+ font-weight: 500;
576
+ }
577
+ .royui-upload__preview-sub {
578
+ margin: 0;
579
+ font-family: var(--royui-upload-meta-font);
580
+ font-size: 11px;
581
+ font-weight: 350;
582
+ letter-spacing: 0.04em;
583
+ text-transform: uppercase;
584
+ color: var(--royui-upload-muted);
585
+ }
586
+ .royui-upload__preview-empty {
587
+ margin: 6px 0 0;
588
+ font-size: 13px;
589
+ color: var(--royui-upload-faint);
590
+ }
591
+ .royui-upload__preview-download {
592
+ margin-top: 8px;
593
+ color: var(--royui-upload-accent);
594
+ font-size: 13px;
595
+ text-decoration: underline;
596
+ text-underline-offset: 2px;
597
+ }
374
598
 
375
599
  /* Footer action — retint the depth Button per theme so the label always
376
600
  reads. Dark panel: a light pill with dark ink (matches the reference).
@@ -395,7 +619,7 @@
395
619
  --royui-upload-muted: rgba(0, 0, 0, 0.55);
396
620
  --royui-upload-faint: rgba(0, 0, 0, 0.4);
397
621
  --royui-upload-line: rgba(0, 0, 0, 0.09);
398
- --royui-upload-dash: rgba(0, 0, 0, 0.16);
622
+ --royui-upload-dash: rgba(0, 0, 0, 0.1);
399
623
  --royui-upload-drop-bg: rgba(0, 0, 0, 0.012);
400
624
  --royui-upload-tile: #ffffff;
401
625
  --royui-upload-track: rgba(0, 0, 0, 0.12);
@@ -433,7 +657,7 @@
433
657
  --royui-upload-muted: rgba(0, 0, 0, 0.55);
434
658
  --royui-upload-faint: rgba(0, 0, 0, 0.4);
435
659
  --royui-upload-line: rgba(0, 0, 0, 0.09);
436
- --royui-upload-dash: rgba(0, 0, 0, 0.16);
660
+ --royui-upload-dash: rgba(0, 0, 0, 0.1);
437
661
  --royui-upload-drop-bg: rgba(0, 0, 0, 0.012);
438
662
  --royui-upload-tile: #ffffff;
439
663
  --royui-upload-track: rgba(0, 0, 0, 0.12);
@@ -467,6 +691,14 @@
467
691
  @media (prefers-reduced-motion: reduce) {
468
692
  .royui-upload__row {
469
693
  animation: none;
694
+ transition: none;
695
+ }
696
+ .royui-upload__footer-inner,
697
+ .royui-upload__check,
698
+ .royui-upload__check.is-checked svg,
699
+ .royui-upload__modal,
700
+ .royui-upload__modal-panel {
701
+ animation: none;
470
702
  }
471
703
  .royui-upload__bar-fill {
472
704
  transition: none;