@roy-ui/ui 0.0.12 → 0.0.14

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,480 @@
1
+ .royui-upload {
2
+ /* Dark by default — opt into light with theme="light", or theme="auto"
3
+ to follow the OS. Every surface is a variable. */
4
+ --royui-upload-bg: #1a1a1c;
5
+ --royui-upload-row: rgba(255, 255, 255, 0.03);
6
+ --royui-upload-row-line: rgba(255, 255, 255, 0.07);
7
+ --royui-upload-fg: #f5f5f7;
8
+ --royui-upload-muted: rgba(255, 255, 255, 0.52);
9
+ --royui-upload-faint: rgba(255, 255, 255, 0.38);
10
+ --royui-upload-line: rgba(255, 255, 255, 0.12);
11
+ --royui-upload-dash: rgba(255, 255, 255, 0.16);
12
+ --royui-upload-drop-bg: rgba(255, 255, 255, 0.015);
13
+ --royui-upload-tile: #202023;
14
+ --royui-upload-track: rgba(255, 255, 255, 0.14);
15
+ --royui-upload-hover: rgba(255, 255, 255, 0.06);
16
+
17
+ --royui-upload-accent: #ff7a45;
18
+ --royui-upload-success: #4ade80;
19
+ --royui-upload-danger: #f87171;
20
+
21
+ --royui-upload-radius: 18px;
22
+ --royui-upload-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
23
+
24
+ box-sizing: border-box;
25
+ width: 100%;
26
+ max-width: 520px;
27
+ display: flex;
28
+ flex-direction: column;
29
+ padding: 18px;
30
+ background: var(--royui-upload-bg);
31
+ color: var(--royui-upload-fg);
32
+ border-radius: var(--royui-upload-radius);
33
+ font-family: inherit;
34
+ box-shadow:
35
+ 0 0 0 1px var(--royui-upload-line),
36
+ 0 24px 60px -24px rgba(0, 0, 0, 0.6);
37
+ }
38
+ .royui-upload *,
39
+ .royui-upload *::before,
40
+ .royui-upload *::after {
41
+ box-sizing: border-box;
42
+ }
43
+
44
+ /* ── Header ─────────────────────────────────────────────────────────────── */
45
+ .royui-upload__header {
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: space-between;
49
+ padding: 2px 4px 16px;
50
+ }
51
+ .royui-upload__title {
52
+ margin: 0;
53
+ font-size: 16px;
54
+ font-weight: 550;
55
+ letter-spacing: -0.01em;
56
+ color: var(--royui-upload-fg);
57
+ }
58
+ .royui-upload__close {
59
+ display: inline-flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ width: 28px;
63
+ height: 28px;
64
+ padding: 0;
65
+ border: none;
66
+ border-radius: 8px;
67
+ background: transparent;
68
+ color: var(--royui-upload-muted);
69
+ cursor: pointer;
70
+ transition:
71
+ background 160ms var(--royui-upload-ease),
72
+ color 160ms var(--royui-upload-ease);
73
+ }
74
+ .royui-upload__close:hover {
75
+ background: var(--royui-upload-hover);
76
+ color: var(--royui-upload-fg);
77
+ }
78
+
79
+ /* ── Dropzone ───────────────────────────────────────────────────────────── */
80
+ .royui-upload__dropzone {
81
+ display: flex;
82
+ flex-direction: column;
83
+ align-items: center;
84
+ text-align: center;
85
+ gap: 14px;
86
+ padding: 40px 24px;
87
+ border: 1.5px dashed var(--royui-upload-dash);
88
+ border-radius: 14px;
89
+ background: var(--royui-upload-drop-bg);
90
+ transition:
91
+ border-color 180ms var(--royui-upload-ease),
92
+ background 180ms var(--royui-upload-ease);
93
+ }
94
+ .royui-upload__dropzone.is-dragging {
95
+ border-color: var(--royui-upload-accent);
96
+ background: color-mix(in srgb, var(--royui-upload-accent) 8%, transparent);
97
+ }
98
+ .royui-upload__drop-icon {
99
+ display: inline-flex;
100
+ align-items: center;
101
+ justify-content: center;
102
+ width: 48px;
103
+ height: 48px;
104
+ border-radius: 12px;
105
+ background: var(--royui-upload-tile);
106
+ box-shadow: inset 0 0 0 1px var(--royui-upload-line);
107
+ color: var(--royui-upload-accent);
108
+ }
109
+ .royui-upload__drop-text {
110
+ margin: 0;
111
+ font-size: 14.5px;
112
+ color: var(--royui-upload-fg);
113
+ }
114
+ .royui-upload__browse {
115
+ padding: 0;
116
+ border: none;
117
+ background: none;
118
+ font: inherit;
119
+ color: var(--royui-upload-accent);
120
+ cursor: pointer;
121
+ text-decoration: underline;
122
+ text-underline-offset: 2px;
123
+ text-decoration-thickness: 1px;
124
+ transition: opacity 140ms var(--royui-upload-ease);
125
+ }
126
+ .royui-upload__browse:hover {
127
+ opacity: 0.82;
128
+ }
129
+ .royui-upload__drop-hint {
130
+ margin: 0;
131
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
132
+ font-size: 11px;
133
+ letter-spacing: 0.08em;
134
+ text-transform: uppercase;
135
+ color: var(--royui-upload-faint);
136
+ }
137
+ .royui-upload__input {
138
+ display: none;
139
+ }
140
+
141
+ /* ── File list ──────────────────────────────────────────────────────────── */
142
+ .royui-upload__list {
143
+ display: flex;
144
+ flex-direction: column;
145
+ gap: 10px;
146
+ margin-top: 12px;
147
+ }
148
+ .royui-upload__row {
149
+ display: flex;
150
+ align-items: flex-start;
151
+ gap: 14px;
152
+ padding: 14px;
153
+ border-radius: 12px;
154
+ background: var(--royui-upload-row);
155
+ box-shadow: inset 0 0 0 1px var(--royui-upload-row-line);
156
+ animation: royui-upload-row-in 280ms var(--royui-upload-ease) both;
157
+ }
158
+ @keyframes royui-upload-row-in {
159
+ from {
160
+ opacity: 0;
161
+ transform: translateY(6px);
162
+ }
163
+ to {
164
+ opacity: 1;
165
+ transform: none;
166
+ }
167
+ }
168
+
169
+ .royui-upload__badge {
170
+ flex: none;
171
+ display: inline-flex;
172
+ align-items: center;
173
+ justify-content: center;
174
+ width: 40px;
175
+ height: 40px;
176
+ border-radius: 11px;
177
+ background: var(--royui-upload-badge, #8b8b94);
178
+ background-image: linear-gradient(
179
+ 150deg,
180
+ rgba(255, 255, 255, 0.28),
181
+ rgba(255, 255, 255, 0) 55%
182
+ );
183
+ box-shadow:
184
+ inset 0 1px 0 rgba(255, 255, 255, 0.22),
185
+ 0 2px 6px -2px rgba(0, 0, 0, 0.45);
186
+ }
187
+ .royui-upload__badge-label {
188
+ font-size: 9px;
189
+ font-weight: 700;
190
+ letter-spacing: 0.04em;
191
+ color: #fff;
192
+ text-shadow: 0 1px 1px rgba(0, 0, 0, 0.28);
193
+ }
194
+
195
+ .royui-upload__row-main {
196
+ flex: 1;
197
+ min-width: 0;
198
+ }
199
+ .royui-upload__row-top {
200
+ display: flex;
201
+ align-items: center;
202
+ justify-content: space-between;
203
+ gap: 12px;
204
+ }
205
+ .royui-upload__name {
206
+ font-size: 14px;
207
+ font-weight: 500;
208
+ color: var(--royui-upload-fg);
209
+ white-space: nowrap;
210
+ overflow: hidden;
211
+ text-overflow: ellipsis;
212
+ }
213
+ .royui-upload__row-action {
214
+ flex: none;
215
+ display: inline-flex;
216
+ align-items: center;
217
+ justify-content: center;
218
+ width: 26px;
219
+ height: 26px;
220
+ padding: 0;
221
+ border: none;
222
+ border-radius: 7px;
223
+ background: transparent;
224
+ color: var(--royui-upload-faint);
225
+ cursor: pointer;
226
+ transition:
227
+ background 140ms var(--royui-upload-ease),
228
+ color 140ms var(--royui-upload-ease);
229
+ }
230
+ .royui-upload__row-action:hover {
231
+ background: var(--royui-upload-hover);
232
+ color: var(--royui-upload-fg);
233
+ }
234
+
235
+ /* ── Meta line ──────────────────────────────────────────────────────────── */
236
+ .royui-upload__meta {
237
+ display: flex;
238
+ align-items: center;
239
+ gap: 7px;
240
+ margin-top: 5px;
241
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
242
+ font-size: 11px;
243
+ letter-spacing: 0.04em;
244
+ text-transform: uppercase;
245
+ color: var(--royui-upload-muted);
246
+ }
247
+ .royui-upload__meta-sep {
248
+ color: var(--royui-upload-faint);
249
+ }
250
+ .royui-upload__complete {
251
+ display: inline-flex;
252
+ align-items: center;
253
+ gap: 5px;
254
+ color: var(--royui-upload-success);
255
+ }
256
+ .royui-upload__error {
257
+ color: var(--royui-upload-danger);
258
+ }
259
+ .royui-upload__status {
260
+ color: var(--royui-upload-muted);
261
+ }
262
+
263
+ /* Claude-Code-style shimmer sweep across the status word. */
264
+ .royui-upload__shimmer {
265
+ background: linear-gradient(
266
+ 90deg,
267
+ var(--royui-upload-faint) 0%,
268
+ var(--royui-upload-fg) 18%,
269
+ var(--royui-upload-faint) 40%
270
+ );
271
+ background-size: 220% 100%;
272
+ -webkit-background-clip: text;
273
+ background-clip: text;
274
+ -webkit-text-fill-color: transparent;
275
+ color: transparent;
276
+ animation: royui-upload-shimmer 1.6s linear infinite;
277
+ }
278
+ @keyframes royui-upload-shimmer {
279
+ to {
280
+ background-position: -220% 0;
281
+ }
282
+ }
283
+
284
+ /* ── Progress bar (segmented "ticks") ───────────────────────────────────── */
285
+ .royui-upload__progress {
286
+ display: flex;
287
+ align-items: center;
288
+ gap: 12px;
289
+ margin-top: 11px;
290
+ }
291
+ .royui-upload__bar {
292
+ position: relative;
293
+ flex: 1;
294
+ height: 14px;
295
+ border-radius: 2px;
296
+ overflow: hidden;
297
+ background-image: repeating-linear-gradient(
298
+ 90deg,
299
+ var(--royui-upload-track) 0 2px,
300
+ transparent 2px 5px
301
+ );
302
+ }
303
+ .royui-upload__bar-fill {
304
+ position: absolute;
305
+ inset: 0 auto 0 0;
306
+ height: 100%;
307
+ background-image: repeating-linear-gradient(
308
+ 90deg,
309
+ var(--royui-upload-accent) 0 2px,
310
+ transparent 2px 5px
311
+ );
312
+ transition: width 260ms var(--royui-upload-ease);
313
+ }
314
+ .royui-upload__pct {
315
+ flex: none;
316
+ min-width: 34px;
317
+ text-align: right;
318
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
319
+ font-size: 12px;
320
+ font-variant-numeric: tabular-nums;
321
+ color: var(--royui-upload-muted);
322
+ }
323
+
324
+ /* ── Footer ─────────────────────────────────────────────────────────────── */
325
+ .royui-upload__footer {
326
+ display: flex;
327
+ align-items: center;
328
+ gap: 14px;
329
+ margin-top: 16px;
330
+ padding: 14px 4px 2px;
331
+ border-top: 1px solid var(--royui-upload-line);
332
+ }
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
+ .royui-upload__remove-all {
354
+ display: inline-flex;
355
+ align-items: center;
356
+ gap: 7px;
357
+ padding: 0;
358
+ border: none;
359
+ background: none;
360
+ font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
361
+ font-size: 11px;
362
+ letter-spacing: 0.07em;
363
+ text-transform: uppercase;
364
+ color: var(--royui-upload-muted);
365
+ cursor: pointer;
366
+ transition: color 140ms var(--royui-upload-ease);
367
+ }
368
+ .royui-upload__remove-all:hover {
369
+ color: var(--royui-upload-fg);
370
+ }
371
+ .royui-upload__footer-spacer {
372
+ flex: 1;
373
+ }
374
+
375
+ /* Footer action — retint the depth Button per theme so the label always
376
+ reads. Dark panel: a light pill with dark ink (matches the reference).
377
+ Light panel (below): a dark pill with light ink. Three-class specificity
378
+ beats .royui-btn--secondary. */
379
+ .royui-upload .royui-upload__action.royui-btn {
380
+ --royui-btn-top: #f4f4f6;
381
+ --royui-btn-bottom: #e4e4e9;
382
+ --royui-btn-ring: rgba(0, 0, 0, 0.12);
383
+ --royui-btn-fg: #1a1a1c;
384
+ --royui-btn-highlight: rgba(255, 255, 255, 0.6);
385
+ --royui-btn-shade: rgba(0, 0, 0, 0.18);
386
+ --royui-btn-focus: rgba(0, 0, 0, 0.45);
387
+ }
388
+
389
+ /* ── Light theme ────────────────────────────────────────────────────────── */
390
+ .royui-upload--light {
391
+ --royui-upload-bg: #ffffff;
392
+ --royui-upload-row: #ffffff;
393
+ --royui-upload-row-line: rgba(0, 0, 0, 0.08);
394
+ --royui-upload-fg: #1a1a1c;
395
+ --royui-upload-muted: rgba(0, 0, 0, 0.55);
396
+ --royui-upload-faint: rgba(0, 0, 0, 0.4);
397
+ --royui-upload-line: rgba(0, 0, 0, 0.09);
398
+ --royui-upload-dash: rgba(0, 0, 0, 0.16);
399
+ --royui-upload-drop-bg: rgba(0, 0, 0, 0.012);
400
+ --royui-upload-tile: #ffffff;
401
+ --royui-upload-track: rgba(0, 0, 0, 0.12);
402
+ --royui-upload-hover: rgba(0, 0, 0, 0.05);
403
+ box-shadow:
404
+ 0 0 0 1px rgba(0, 0, 0, 0.07),
405
+ 0 24px 60px -28px rgba(0, 0, 0, 0.3);
406
+ }
407
+ .royui-upload--light .royui-upload__row {
408
+ box-shadow:
409
+ inset 0 0 0 1px var(--royui-upload-row-line),
410
+ 0 1px 2px rgba(0, 0, 0, 0.04);
411
+ }
412
+ .royui-upload--light .royui-upload__drop-icon {
413
+ box-shadow:
414
+ inset 0 0 0 1px var(--royui-upload-line),
415
+ 0 1px 2px rgba(0, 0, 0, 0.05);
416
+ }
417
+ .royui-upload--light .royui-upload__action.royui-btn {
418
+ --royui-btn-top: #2c2c2e;
419
+ --royui-btn-bottom: #1a1a1c;
420
+ --royui-btn-ring: rgba(0, 0, 0, 0.22);
421
+ --royui-btn-fg: #ffffff;
422
+ --royui-btn-highlight: rgba(255, 255, 255, 0.16);
423
+ --royui-btn-shade: rgba(0, 0, 0, 0.5);
424
+ --royui-btn-focus: rgba(0, 0, 0, 0.45);
425
+ }
426
+
427
+ @media (prefers-color-scheme: light) {
428
+ .royui-upload--auto {
429
+ --royui-upload-bg: #ffffff;
430
+ --royui-upload-row: #ffffff;
431
+ --royui-upload-row-line: rgba(0, 0, 0, 0.08);
432
+ --royui-upload-fg: #1a1a1c;
433
+ --royui-upload-muted: rgba(0, 0, 0, 0.55);
434
+ --royui-upload-faint: rgba(0, 0, 0, 0.4);
435
+ --royui-upload-line: rgba(0, 0, 0, 0.09);
436
+ --royui-upload-dash: rgba(0, 0, 0, 0.16);
437
+ --royui-upload-drop-bg: rgba(0, 0, 0, 0.012);
438
+ --royui-upload-tile: #ffffff;
439
+ --royui-upload-track: rgba(0, 0, 0, 0.12);
440
+ --royui-upload-hover: rgba(0, 0, 0, 0.05);
441
+ box-shadow:
442
+ 0 0 0 1px rgba(0, 0, 0, 0.07),
443
+ 0 24px 60px -28px rgba(0, 0, 0, 0.3);
444
+ }
445
+ .royui-upload--auto .royui-upload__row {
446
+ box-shadow:
447
+ inset 0 0 0 1px var(--royui-upload-row-line),
448
+ 0 1px 2px rgba(0, 0, 0, 0.04);
449
+ }
450
+ .royui-upload--auto .royui-upload__drop-icon {
451
+ box-shadow:
452
+ inset 0 0 0 1px var(--royui-upload-line),
453
+ 0 1px 2px rgba(0, 0, 0, 0.05);
454
+ }
455
+ .royui-upload--auto .royui-upload__action.royui-btn {
456
+ --royui-btn-top: #2c2c2e;
457
+ --royui-btn-bottom: #1a1a1c;
458
+ --royui-btn-ring: rgba(0, 0, 0, 0.22);
459
+ --royui-btn-fg: #ffffff;
460
+ --royui-btn-highlight: rgba(255, 255, 255, 0.16);
461
+ --royui-btn-shade: rgba(0, 0, 0, 0.5);
462
+ --royui-btn-focus: rgba(0, 0, 0, 0.45);
463
+ }
464
+ }
465
+
466
+ /* ── Reduced motion ─────────────────────────────────────────────────────── */
467
+ @media (prefers-reduced-motion: reduce) {
468
+ .royui-upload__row {
469
+ animation: none;
470
+ }
471
+ .royui-upload__bar-fill {
472
+ transition: none;
473
+ }
474
+ .royui-upload__shimmer {
475
+ animation: none;
476
+ background: none;
477
+ -webkit-text-fill-color: currentColor;
478
+ color: var(--royui-upload-muted);
479
+ }
480
+ }