@paperpic/vue 0.0.0-stage → 0.1.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.
package/dist/style.css ADDED
@@ -0,0 +1,702 @@
1
+ @layer paperpic {
2
+ :root {
3
+ --paperpic-color-surface: light-dark(#fff, #151e2e);
4
+ --paperpic-color-text: light-dark(#1a263c, #f2f5f9);
5
+ --paperpic-color-accent: light-dark(#0a84ff, #5cb5ff);
6
+ --paperpic-radius: 6px;
7
+ --paperpic-transition-duration: .2s;
8
+ }
9
+
10
+ .paperpic-host {
11
+ block-size: 100%;
12
+ inline-size: 100%;
13
+ display: block;
14
+ }
15
+
16
+ .paperpic {
17
+ box-sizing: border-box;
18
+ block-size: 100%;
19
+ min-block-size: 16rem;
20
+ inline-size: 100%;
21
+ color: var(--paperpic-color-text);
22
+ flex-direction: column;
23
+ display: flex;
24
+ overflow: hidden;
25
+ container-type: inline-size;
26
+ }
27
+
28
+ .paperpic-stage {
29
+ flex: 1;
30
+ min-block-size: 0;
31
+ position: relative;
32
+ }
33
+
34
+ .paperpic-viewport {
35
+ outline-offset: -2px;
36
+ touch-action: pan-x pan-y;
37
+ position: absolute;
38
+ inset: 0;
39
+ }
40
+
41
+ .paperpic-viewport:focus-visible {
42
+ outline: 2px solid var(--paperpic-color-accent);
43
+ }
44
+
45
+ .paperpic-viewport-pannable {
46
+ cursor: grab;
47
+ touch-action: none;
48
+ }
49
+
50
+ .paperpic-viewport-pannable:active {
51
+ cursor: grabbing;
52
+ }
53
+
54
+ .paperpic-editing .paperpic-viewport {
55
+ touch-action: none;
56
+ }
57
+
58
+ .paperpic-edit-bar {
59
+ box-sizing: border-box;
60
+ border: 1px solid color-mix(in srgb, var(--paperpic-color-text) 20%, transparent);
61
+ border-radius: var(--paperpic-radius);
62
+ background: var(--paperpic-color-surface);
63
+ color: var(--paperpic-color-text);
64
+ flex: none;
65
+ margin: .5rem;
66
+ padding: .25rem;
67
+ }
68
+
69
+ .paperpic-edit-bar[hidden], .paperpic-edit-controls[hidden], .paperpic-edit-tool[hidden], .paperpic-edit-confirmation[hidden], .paperpic-edit-corners[hidden], .paperpic-edit-options[hidden], .paperpic-ruler[hidden] {
70
+ display: none;
71
+ }
72
+
73
+ .paperpic-edit-controls, .paperpic-edit-tool, .paperpic-edit-confirmation {
74
+ grid-template-columns: auto minmax(0, 1fr) auto;
75
+ grid-auto-rows: minmax(2.25rem, auto);
76
+ align-items: center;
77
+ gap: .25rem;
78
+ display: grid;
79
+ }
80
+
81
+ .paperpic-edit-controls {
82
+ grid-template-areas: "tools tools tools"
83
+ "start middle end";
84
+ }
85
+
86
+ .paperpic-edit-tool {
87
+ grid-template-areas: "panel panel panel"
88
+ "start middle end";
89
+ }
90
+
91
+ .paperpic-edit-confirmation {
92
+ grid-template-areas: "message message message"
93
+ "start . end";
94
+ }
95
+
96
+ .paperpic-edit-controls > :first-child, .paperpic-edit-tool > :first-child, .paperpic-edit-confirmation > :nth-child(2) {
97
+ grid-area: start;
98
+ }
99
+
100
+ .paperpic-edit-controls > :last-child, .paperpic-edit-tool > :last-child, .paperpic-edit-confirmation > :last-child {
101
+ grid-area: end;
102
+ }
103
+
104
+ .paperpic-edit-tools {
105
+ grid-area: tools;
106
+ justify-content: space-around;
107
+ gap: .125rem;
108
+ display: flex;
109
+ }
110
+
111
+ .paperpic-edit-history, .paperpic-edit-choice {
112
+ grid-area: middle;
113
+ justify-content: center;
114
+ align-items: center;
115
+ gap: .125rem;
116
+ min-inline-size: 0;
117
+ display: flex;
118
+ }
119
+
120
+ .paperpic-edit-panel {
121
+ grid-area: panel;
122
+ align-items: center;
123
+ min-inline-size: 0;
124
+ display: grid;
125
+ }
126
+
127
+ .paperpic-edit-message {
128
+ flex: 1;
129
+ min-inline-size: 0;
130
+ padding-inline: .5rem;
131
+ }
132
+
133
+ .paperpic-edit-confirmation > .paperpic-edit-message {
134
+ text-align: center;
135
+ grid-area: message;
136
+ }
137
+
138
+ .paperpic-edit-corners {
139
+ align-items: center;
140
+ gap: .125rem;
141
+ display: flex;
142
+ }
143
+
144
+ .paperpic-edit-corners .paperpic-edit-message {
145
+ font-size: .875em;
146
+ line-height: 1.25;
147
+ }
148
+
149
+ .paperpic-edit-title {
150
+ font-weight: 600;
151
+ }
152
+
153
+ @container (width >= 28rem) {
154
+ .paperpic-edit-bar {
155
+ align-self: center;
156
+ inline-size: min(100% - 1rem, 38rem);
157
+ }
158
+
159
+ .paperpic-edit-controls, .paperpic-edit-tool {
160
+ grid-template-columns: auto minmax(0, 1fr) auto auto;
161
+ }
162
+
163
+ .paperpic-edit-controls {
164
+ grid-template-areas: "start tools middle end";
165
+ }
166
+
167
+ .paperpic-edit-tool {
168
+ grid-template-areas: "start panel middle end";
169
+ }
170
+
171
+ .paperpic-edit-confirmation {
172
+ grid-template-columns: minmax(0, 1fr) auto auto;
173
+ grid-template-areas: "message start end";
174
+ }
175
+
176
+ .paperpic-edit-confirmation > .paperpic-edit-message {
177
+ text-align: start;
178
+ }
179
+
180
+ .paperpic-edit-tools {
181
+ justify-content: center;
182
+ }
183
+
184
+ .paperpic-edit-title {
185
+ display: none;
186
+ }
187
+ }
188
+
189
+ .paperpic-canvas {
190
+ block-size: 100%;
191
+ inline-size: 100%;
192
+ display: block;
193
+ }
194
+
195
+ .paperpic-overlay, .paperpic-handles {
196
+ pointer-events: none;
197
+ position: absolute;
198
+ inset: 0;
199
+ }
200
+
201
+ .paperpic-overlay {
202
+ block-size: 100%;
203
+ inline-size: 100%;
204
+ }
205
+
206
+ .paperpic-handles {
207
+ overflow: clip;
208
+ }
209
+
210
+ .paperpic-handle {
211
+ box-sizing: border-box;
212
+ cursor: move;
213
+ pointer-events: auto;
214
+ touch-action: none;
215
+ background: none;
216
+ border: 0;
217
+ block-size: 2rem;
218
+ inline-size: 2rem;
219
+ padding: 0;
220
+ position: absolute;
221
+ translate: -50% -50%;
222
+ }
223
+
224
+ .paperpic-handle[hidden] {
225
+ display: none;
226
+ }
227
+
228
+ .paperpic-handle:before {
229
+ content: "";
230
+ box-sizing: border-box;
231
+ border: 2px solid var(--paperpic-color-accent);
232
+ background: #fff;
233
+ border-radius: 50%;
234
+ block-size: 1rem;
235
+ inline-size: 1rem;
236
+ margin: auto;
237
+ display: block;
238
+ box-shadow: 0 0 0 1px #0009;
239
+ }
240
+
241
+ .paperpic-handle:focus-visible {
242
+ outline: 2px solid var(--paperpic-color-accent);
243
+ outline-offset: -2px;
244
+ border-radius: 50%;
245
+ }
246
+
247
+ .paperpic-handle[aria-pressed="true"]:before {
248
+ background: var(--paperpic-color-accent);
249
+ box-shadow: 0 0 0 1px #0009,
250
+ 0 0 0 4px color-mix(in srgb, var(--paperpic-color-accent) 50%, transparent);
251
+ border-color: #fff;
252
+ }
253
+
254
+ .paperpic-toolbar {
255
+ border: 1px solid color-mix(in srgb, var(--paperpic-color-text) 20%, transparent);
256
+ border-radius: var(--paperpic-radius);
257
+ background: var(--paperpic-color-surface);
258
+ max-block-size: calc(100% - 1rem);
259
+ color: var(--paperpic-color-text);
260
+ scrollbar-width: none;
261
+ flex-direction: column;
262
+ gap: .125rem;
263
+ padding: .25rem;
264
+ display: flex;
265
+ position: absolute;
266
+ inset-block-start: .5rem;
267
+ inset-inline-end: .5rem;
268
+ overflow-y: auto;
269
+ }
270
+
271
+ .paperpic-toolbar[hidden] {
272
+ display: none;
273
+ }
274
+
275
+ .paperpic-toolbar-separator {
276
+ background: color-mix(in srgb, var(--paperpic-color-text) 20%, transparent);
277
+ flex: none;
278
+ block-size: 1px;
279
+ margin: .125rem .25rem;
280
+ }
281
+
282
+ .paperpic-toolbar-separator[hidden] {
283
+ display: none;
284
+ }
285
+
286
+ .paperpic-button {
287
+ box-sizing: border-box;
288
+ border-radius: var(--paperpic-radius);
289
+ block-size: 2.25rem;
290
+ inline-size: 2.25rem;
291
+ color: inherit;
292
+ cursor: pointer;
293
+ transition: box-shadow var(--paperpic-transition-duration) ease;
294
+ background: none;
295
+ border: 0;
296
+ flex: none;
297
+ place-items: center;
298
+ padding: 0;
299
+ display: grid;
300
+ position: relative;
301
+ }
302
+
303
+ .paperpic-button[hidden] {
304
+ display: none;
305
+ }
306
+
307
+ @media (hover: hover) {
308
+ .paperpic-button:hover {
309
+ box-shadow: inset 0 0 0 3rem color-mix(in srgb, var(--paperpic-color-accent) 15%, transparent);
310
+ }
311
+ }
312
+
313
+ .paperpic-button:active {
314
+ box-shadow: inset 0 0 0 3rem color-mix(in srgb, var(--paperpic-color-accent) 15%, transparent);
315
+ }
316
+
317
+ .paperpic-button:focus-visible {
318
+ outline: 2px solid var(--paperpic-color-accent);
319
+ outline-offset: -2px;
320
+ }
321
+
322
+ .paperpic-button[aria-pressed="true"] {
323
+ box-shadow: inset 0 0 0 2px var(--paperpic-color-accent),
324
+ inset 0 0 0 3rem color-mix(in srgb, var(--paperpic-color-accent) 15%, transparent);
325
+ }
326
+
327
+ .paperpic-button[aria-disabled="true"] {
328
+ box-shadow: none;
329
+ opacity: .4;
330
+ cursor: not-allowed;
331
+ }
332
+
333
+ .paperpic-button-primary, .paperpic-button-text {
334
+ inline-size: auto;
335
+ font: inherit;
336
+ white-space: nowrap;
337
+ justify-content: center;
338
+ align-items: center;
339
+ gap: .25rem;
340
+ display: inline-flex;
341
+ }
342
+
343
+ .paperpic-button-primary:before, .paperpic-button-primary:after, .paperpic-button-text:before, .paperpic-button-text:after {
344
+ content: "";
345
+ flex: none;
346
+ inline-size: .5rem;
347
+ }
348
+
349
+ .paperpic-button-primary {
350
+ box-shadow: inset 0 0 0 2px var(--paperpic-color-accent);
351
+ font-weight: 600;
352
+ }
353
+
354
+ .paperpic-button-primary[aria-disabled="true"] {
355
+ box-shadow: inset 0 0 0 1px;
356
+ }
357
+
358
+ .paperpic-button-text {
359
+ box-shadow: inset 0 0 0 1px color-mix(in srgb, currentcolor 40%, transparent);
360
+ }
361
+
362
+ .paperpic-button-danger {
363
+ font-weight: 600;
364
+ box-shadow: inset 0 0 0 1px;
365
+ }
366
+
367
+ .paperpic-icon {
368
+ flex: none;
369
+ block-size: 1.25rem;
370
+ inline-size: 1.25rem;
371
+ }
372
+
373
+ .paperpic-edit-dot {
374
+ background: var(--paperpic-color-accent);
375
+ border-radius: 50%;
376
+ block-size: .25rem;
377
+ inline-size: .25rem;
378
+ position: absolute;
379
+ inset-block-end: .125rem;
380
+ inset-inline-start: 50%;
381
+ translate: -50%;
382
+ }
383
+
384
+ .paperpic-edit-options {
385
+ gap: .125rem;
386
+ display: flex;
387
+ }
388
+
389
+ .paperpic-edit-option, .paperpic-edit-switch {
390
+ inline-size: auto;
391
+ font: inherit;
392
+ white-space: nowrap;
393
+ align-items: center;
394
+ gap: .375rem;
395
+ display: inline-flex;
396
+ }
397
+
398
+ .paperpic-edit-option:before, .paperpic-edit-option:after, .paperpic-edit-switch:before, .paperpic-edit-switch:after {
399
+ content: "";
400
+ flex: none;
401
+ inline-size: .125rem;
402
+ }
403
+
404
+ .paperpic-edit-option .paperpic-icon {
405
+ block-size: 1rem;
406
+ inline-size: 1rem;
407
+ }
408
+
409
+ .paperpic-edit-switch {
410
+ font-weight: 600;
411
+ }
412
+
413
+ .paperpic-edit-switch-track {
414
+ background: color-mix(in srgb, var(--paperpic-color-text) 55%, transparent);
415
+ block-size: 1.125rem;
416
+ inline-size: 1.875rem;
417
+ transition: background-color var(--paperpic-transition-duration) ease;
418
+ border-radius: .5625rem;
419
+ flex: none;
420
+ position: relative;
421
+ }
422
+
423
+ .paperpic-edit-switch-thumb {
424
+ background: var(--paperpic-color-surface);
425
+ block-size: .875rem;
426
+ inline-size: .875rem;
427
+ transition: translate var(--paperpic-transition-duration) ease;
428
+ border-radius: 50%;
429
+ position: absolute;
430
+ inset-block-start: .125rem;
431
+ inset-inline-start: .125rem;
432
+ }
433
+
434
+ .paperpic-edit-switch[aria-checked="true"] .paperpic-edit-switch-track {
435
+ background: var(--paperpic-color-accent);
436
+ }
437
+
438
+ .paperpic-edit-switch[aria-checked="true"] .paperpic-edit-switch-thumb {
439
+ translate: .75rem;
440
+ }
441
+
442
+ .paperpic-ruler {
443
+ direction: ltr;
444
+ block-size: 2.25rem;
445
+ min-inline-size: 0;
446
+ margin-inline: .25rem;
447
+ position: relative;
448
+ }
449
+
450
+ .paperpic-ruler-ticks {
451
+ background-image: linear-gradient(to right, color-mix(in srgb, var(--paperpic-color-text) 60%, transparent) 0 1px, transparent 1px),
452
+ linear-gradient(to right, color-mix(in srgb, var(--paperpic-color-text) 30%, transparent) 0 1px, transparent 1px);
453
+ pointer-events: none;
454
+ background-position: calc(.75rem - .5px) 100%;
455
+ background-repeat: repeat-x;
456
+ background-size: calc(25% - .375rem) .875rem, calc(5% - .075rem) .5rem;
457
+ block-size: .875rem;
458
+ position: absolute;
459
+ inset-block-end: .125rem;
460
+ inset-inline: 0;
461
+ }
462
+
463
+ .paperpic-ruler-centered .paperpic-ruler-ticks {
464
+ background-size: calc(12.5% - .1875rem) .875rem, calc(2.5% - .0375rem) .5rem;
465
+ }
466
+
467
+ .paperpic-ruler-fill {
468
+ background-image: linear-gradient(to right, var(--paperpic-color-accent) 0 1px, transparent 1px),
469
+ linear-gradient(to right, var(--paperpic-color-accent) 0 1px, transparent 1px);
470
+ }
471
+
472
+ .paperpic-ruler-middle {
473
+ background: color-mix(in srgb, var(--paperpic-color-text) 60%, transparent);
474
+ pointer-events: none;
475
+ block-size: 1.125rem;
476
+ inline-size: 1px;
477
+ position: absolute;
478
+ inset-block-end: .125rem;
479
+ inset-inline-start: calc(50% - .5px);
480
+ }
481
+
482
+ .paperpic-ruler-value {
483
+ font-variant-numeric: tabular-nums;
484
+ pointer-events: none;
485
+ font-size: .75rem;
486
+ font-weight: 600;
487
+ line-height: 1;
488
+ position: absolute;
489
+ inset-block-start: 0;
490
+ translate: -50%;
491
+ }
492
+
493
+ .paperpic-ruler-sign {
494
+ position: absolute;
495
+ inset-inline-end: 100%;
496
+ }
497
+
498
+ .paperpic-ruler-input {
499
+ box-sizing: border-box;
500
+ appearance: none;
501
+ cursor: pointer;
502
+ background: none;
503
+ border: 0;
504
+ block-size: 1.25rem;
505
+ inline-size: 100%;
506
+ margin: 0;
507
+ padding: 0;
508
+ position: absolute;
509
+ inset-block-start: 1rem;
510
+ inset-inline-start: 0;
511
+ }
512
+
513
+ .paperpic-ruler-input:disabled {
514
+ cursor: not-allowed;
515
+ }
516
+
517
+ .paperpic-ruler:has(.paperpic-ruler-input:disabled) {
518
+ opacity: .4;
519
+ }
520
+
521
+ .paperpic-ruler-input:focus {
522
+ outline: none;
523
+ }
524
+
525
+ .paperpic-ruler:has(.paperpic-ruler-input:focus-visible) {
526
+ border-radius: var(--paperpic-radius);
527
+ outline: 2px solid var(--paperpic-color-accent);
528
+ outline-offset: 2px;
529
+ }
530
+
531
+ .paperpic-ruler-input::-webkit-slider-runnable-track {
532
+ background: none;
533
+ border: 0;
534
+ block-size: 1.25rem;
535
+ }
536
+
537
+ .paperpic-ruler-input::-webkit-slider-thumb {
538
+ appearance: none;
539
+ background: linear-gradient(to right,
540
+ transparent calc(50% - 1.5px),
541
+ var(--paperpic-color-accent) 0 calc(50% + 1.5px),
542
+ transparent 0);
543
+ border: 0;
544
+ block-size: 1.25rem;
545
+ inline-size: 1.5rem;
546
+ }
547
+
548
+ .paperpic-ruler-input::-moz-range-track {
549
+ background: none;
550
+ border: 0;
551
+ block-size: 1.25rem;
552
+ }
553
+
554
+ .paperpic-ruler-input::-moz-range-thumb {
555
+ background: linear-gradient(to right,
556
+ transparent calc(50% - 1.5px),
557
+ var(--paperpic-color-accent) 0 calc(50% + 1.5px),
558
+ transparent 0);
559
+ border: 0;
560
+ border-radius: 0;
561
+ block-size: 1.25rem;
562
+ inline-size: 1.5rem;
563
+ }
564
+
565
+ .paperpic-status {
566
+ clip-path: inset(50%);
567
+ white-space: nowrap;
568
+ block-size: 1px;
569
+ inline-size: 1px;
570
+ position: absolute;
571
+ overflow: hidden;
572
+ }
573
+
574
+ .paperpic-status-visible {
575
+ border-radius: var(--paperpic-radius);
576
+ background: var(--paperpic-color-surface);
577
+ clip-path: none;
578
+ block-size: auto;
579
+ inline-size: auto;
580
+ padding: .5rem .75rem;
581
+ inset-block-start: 50%;
582
+ inset-inline-start: 50%;
583
+ overflow: visible;
584
+ translate: -50% -50%;
585
+ }
586
+
587
+ @media (pointer: coarse) {
588
+ .paperpic-button {
589
+ block-size: 2.75rem;
590
+ min-inline-size: 2.75rem;
591
+ }
592
+
593
+ .paperpic-handle {
594
+ block-size: 2.75rem;
595
+ inline-size: 2.75rem;
596
+ }
597
+
598
+ .paperpic-edit-controls, .paperpic-edit-tool, .paperpic-edit-confirmation {
599
+ grid-auto-rows: minmax(2.75rem, auto);
600
+ }
601
+
602
+ .paperpic-ruler {
603
+ block-size: 2.75rem;
604
+ }
605
+
606
+ .paperpic-ruler-input {
607
+ block-size: 1.75rem;
608
+ }
609
+
610
+ .paperpic-ruler-input::-webkit-slider-runnable-track {
611
+ block-size: 1.75rem;
612
+ }
613
+
614
+ .paperpic-ruler-input::-webkit-slider-thumb {
615
+ block-size: 1.75rem;
616
+ }
617
+
618
+ .paperpic-ruler-input::-moz-range-track {
619
+ block-size: 1.75rem;
620
+ }
621
+
622
+ .paperpic-ruler-input::-moz-range-thumb {
623
+ block-size: 1.75rem;
624
+ }
625
+ }
626
+
627
+ @media (prefers-reduced-motion: reduce) {
628
+ .paperpic-button, .paperpic-edit-switch[aria-checked] .paperpic-edit-switch-track, .paperpic-edit-switch[aria-checked] .paperpic-edit-switch-thumb {
629
+ transition: none;
630
+ }
631
+ }
632
+
633
+ @media (forced-colors: active) {
634
+ .paperpic-button[aria-pressed="true"] {
635
+ outline-offset: -2px;
636
+ outline: 2px solid highlight;
637
+ }
638
+
639
+ .paperpic-ruler {
640
+ forced-color-adjust: none;
641
+ }
642
+
643
+ .paperpic-ruler .paperpic-ruler-ticks {
644
+ background-image: linear-gradient(to right, canvastext 0 1px, #0000 1px), linear-gradient(to right, graytext 0 1px, #0000 1px);
645
+ }
646
+
647
+ .paperpic-ruler .paperpic-ruler-fill {
648
+ background-image: linear-gradient(to right, highlight 0 1px, #0000 1px), linear-gradient(to right, highlight 0 1px, #0000 1px);
649
+ }
650
+
651
+ .paperpic-ruler .paperpic-ruler-middle {
652
+ background: canvastext;
653
+ }
654
+
655
+ .paperpic-ruler .paperpic-ruler-value {
656
+ color: canvastext;
657
+ }
658
+
659
+ .paperpic-ruler-input::-webkit-slider-thumb {
660
+ background: linear-gradient(to right, #0000 calc(50% - 1.5px), highlight 0 calc(50% + 1.5px), #0000 0);
661
+ }
662
+
663
+ .paperpic-ruler-input::-moz-range-thumb {
664
+ background: linear-gradient(to right, #0000 calc(50% - 1.5px), highlight 0 calc(50% + 1.5px), #0000 0);
665
+ }
666
+
667
+ .paperpic-button .paperpic-edit-dot {
668
+ forced-color-adjust: none;
669
+ background: highlight;
670
+ }
671
+
672
+ .paperpic-edit-switch[aria-checked] .paperpic-edit-switch-track {
673
+ forced-color-adjust: none;
674
+ background: canvas;
675
+ outline: 1px solid buttontext;
676
+ }
677
+
678
+ .paperpic-edit-switch[aria-checked] .paperpic-edit-switch-thumb {
679
+ forced-color-adjust: none;
680
+ background: buttontext;
681
+ }
682
+
683
+ .paperpic-edit-switch[aria-checked="true"] .paperpic-edit-switch-track {
684
+ background: highlight;
685
+ }
686
+
687
+ .paperpic-edit-switch[aria-checked="true"] .paperpic-edit-switch-thumb {
688
+ background: highlighttext;
689
+ }
690
+
691
+ .paperpic-button-primary, .paperpic-button-text {
692
+ outline-offset: -1px;
693
+ outline: 1px solid buttontext;
694
+ }
695
+
696
+ .paperpic-handle[aria-pressed="true"]:before {
697
+ forced-color-adjust: none;
698
+ background: highlight;
699
+ border-color: canvas;
700
+ }
701
+ }
702
+ }