reqwise-core 1.0.0 → 1.1.1

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/src/styles.ts DELETED
@@ -1,730 +0,0 @@
1
- export const styles = `
2
- :root {
3
- --rq-bg: #18181b;
4
- --rq-bg-secondary: #27272a;
5
- --rq-fg: #f4f4f5;
6
- --rq-fg-secondary: #a1a1aa;
7
- --rq-border: #3f3f46;
8
- --rq-accent: #10b981;
9
- --rq-error: #ef4444;
10
- --rq-warning: #f97316;
11
- --rq-info: #3b82f6;
12
- --rq-width: 50%;
13
- --rq-min-width: 320px;
14
- --rq-z: 99999;
15
- --rq-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
16
- --rq-radius: 8px;
17
- --rq-duration: 300ms;
18
- }
19
-
20
- html[data-rq-theme="light"] {
21
- --rq-bg: #ffffff;
22
- --rq-bg-secondary: #f4f4f5;
23
- --rq-fg: #18181b;
24
- --rq-fg-secondary: #71717a;
25
- --rq-border: #e4e4e7;
26
- --rq-accent: #0b84ff;
27
- --rq-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
28
- }
29
-
30
- * {
31
- box-sizing: border-box;
32
- }
33
-
34
- #reqwise-panel {
35
- position: fixed;
36
- right: 0;
37
- top: 0;
38
- height: auto;
39
- width: var(--rq-width);
40
- min-width: var(--rq-min-width);
41
- max-width: 800px;
42
- background: var(--rq-bg);
43
- color: var(--rq-fg);
44
- box-shadow: var(--rq-shadow);
45
- z-index: var(--rq-z);
46
- display: flex;
47
- flex-direction: column;
48
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
49
- font-size: 14px;
50
- line-height: 1.5;
51
- overflow: visible;
52
- transition: transform var(--rq-duration) ease;
53
- }
54
-
55
- #reqwise-panel.hidden { display: none !important; }
56
-
57
- /* Header Section */
58
- #reqwise-panel .rq-header {
59
- padding: 16px 24px;
60
- border-bottom: 1px solid var(--rq-border);
61
- flex-shrink: 0;
62
- display: flex;
63
- align-items: center;
64
- justify-content: space-between;
65
- gap: 12px;
66
- }
67
-
68
- #reqwise-panel .rq-header-left {
69
- display: flex;
70
- align-items: center;
71
- gap: 12px;
72
- }
73
-
74
- #reqwise-panel .rq-banner {
75
- height: 28px;
76
- object-fit: contain;
77
- }
78
-
79
- #reqwise-panel .rq-header-right {
80
- display: flex;
81
- align-items: center;
82
- gap: 8px;
83
- position: relative;
84
- }
85
-
86
- #reqwise-panel .rq-lang-btn {
87
- background: transparent;
88
- border: 1px solid var(--rq-border);
89
- color: var(--rq-fg);
90
- padding: 6px 8px;
91
- border-radius: 6px;
92
- cursor: pointer;
93
- display: inline-flex;
94
- align-items: center;
95
- gap: 8px;
96
- }
97
-
98
- #reqwise-panel .rq-lang-dropdown {
99
- position: absolute;
100
- right: 0;
101
- top: 40px;
102
- background: var(--rq-bg);
103
- border: 1px solid var(--rq-border);
104
- border-radius: 8px;
105
- padding: 8px;
106
- min-width: 120px;
107
- box-shadow: var(--rq-shadow);
108
- z-index: calc(var(--rq-z) + 10);
109
- }
110
-
111
- .rq-lang-item {
112
- display: block;
113
- width: 100%;
114
- text-align: left;
115
- padding: 8px 10px;
116
- border: none;
117
- background: transparent;
118
- color: var(--rq-fg);
119
- cursor: pointer;
120
- border-radius: 6px;
121
- }
122
-
123
- .rq-lang-item:hover { background: rgba(255,255,255,0.03); }
124
- .rq-lang-item.selected { background: rgba(255,255,255,0.06); font-weight: 700; }
125
-
126
- /* Header layout: left banner, right controls */
127
- #reqwise-panel .rq-header {
128
- display: flex;
129
- align-items: center;
130
- justify-content: space-between;
131
- gap: 12px;
132
- }
133
-
134
- #reqwise-panel .rq-header-left { display: flex; align-items: center; gap: 12px }
135
- .rq-banner { height: 36px; display: block }
136
-
137
- .rq-header-right { position: relative }
138
- .rq-lang-btn { display:flex; align-items:center; gap:8px; background:transparent; border:none; color:var(--rq-fg); cursor:pointer; font-weight:600 }
139
- .rq-world { font-size:18px }
140
- .rq-lang-dropdown { position: absolute; right:0; top:calc(100% + 8px); background: var(--rq-bg); border: 1px solid var(--rq-border); box-shadow: 0 8px 20px rgba(0,0,0,0.3); border-radius:6px; padding:8px; min-width:140px; z-index: calc(var(--rq-z) + 10) }
141
- .rq-lang-item { display:block; width:100%; padding:8px 10px; text-align:left; background:transparent; border:none; color:var(--rq-fg); cursor:pointer; border-radius:4px }
142
- .rq-lang-item:hover { background: rgba(255,255,255,0.02) }
143
- .rq-lang-item.selected { background: rgba(255,255,255,0.04); font-weight:700 }
144
-
145
- /* Tabs Section */
146
- #reqwise-panel .rq-tabs {
147
- display: flex;
148
- gap: 32px;
149
- padding: 0 24px;
150
- border-bottom: 1px solid var(--rq-border);
151
- flex-shrink: 0;
152
- background: var(--rq-bg);
153
- }
154
-
155
- #reqwise-panel .rq-tab {
156
- padding: 12px 0;
157
- cursor: pointer;
158
- background: none;
159
- border: none;
160
- color: var(--rq-fg-secondary);
161
- font-size: 14px;
162
- font-weight: 600;
163
- border-bottom: 2px solid transparent;
164
- transition: all var(--rq-duration) ease-out;
165
- white-space: nowrap;
166
- }
167
-
168
- #reqwise-panel .rq-tab:hover {
169
- color: var(--rq-fg);
170
- }
171
-
172
- #reqwise-panel .rq-tab.active {
173
- color: var(--rq-fg);
174
- border-bottom-color: var(--rq-fg);
175
- }
176
-
177
- /* Body/Content */
178
- #reqwise-panel .rq-body {
179
- overflow-y: auto;
180
- overflow-x: hidden;
181
- padding: 24px;
182
- flex: 1 1 auto;
183
- scroll-behavior: smooth;
184
- }
185
-
186
- #reqwise-panel .rq-body::-webkit-scrollbar {
187
- width: 8px;
188
- }
189
-
190
- #reqwise-panel .rq-body::-webkit-scrollbar-track {
191
- background: transparent;
192
- }
193
-
194
- #reqwise-panel .rq-body::-webkit-scrollbar-thumb {
195
- background: var(--rq-border);
196
- border-radius: 4px;
197
- }
198
-
199
- #reqwise-panel .rq-body::-webkit-scrollbar-thumb:hover {
200
- background: var(--rq-fg-secondary);
201
- }
202
-
203
- /* Empty State */
204
- .rq-empty {
205
- display: flex;
206
- flex-direction: column;
207
- align-items: center;
208
- justify-content: center;
209
- height: 100%;
210
- min-height: 300px;
211
- color: var(--rq-fg-secondary);
212
- text-align: center;
213
- }
214
-
215
- .rq-empty svg {
216
- width: 64px;
217
- height: 64px;
218
- margin-bottom: 16px;
219
- opacity: 0.5;
220
- }
221
-
222
- .rq-empty p {
223
- margin: 0;
224
- font-size: 16px;
225
- font-weight: 500;
226
- }
227
-
228
- /* Cards & Entries */
229
- .rq-card {
230
- margin-bottom: 24px;
231
- display: flex;
232
- flex-direction: column;
233
- gap: 12px;
234
- }
235
-
236
- .rq-card-header {
237
- display: flex;
238
- align-items: center;
239
- gap: 12px;
240
- flex-wrap: wrap;
241
- }
242
-
243
- .rq-card-title {
244
- font-size: 15px;
245
- font-weight: 600;
246
- color: var(--rq-fg);
247
- margin: 0;
248
- flex: 1;
249
- min-width: 150px;
250
- }
251
-
252
- /* Status Badges */
253
- .rq-badge {
254
- display: inline-flex;
255
- align-items: center;
256
- padding: 4px 10px;
257
- border-radius: 4px;
258
- font-size: 12px;
259
- font-weight: 600;
260
- white-space: nowrap;
261
- }
262
-
263
- .rq-badge.loading {
264
- background: rgba(59, 130, 246, 0.1);
265
- color: #3b82f6;
266
- }
267
-
268
- .rq-badge.error {
269
- background: rgba(239, 68, 68, 0.1);
270
- color: #ef4444;
271
- }
272
-
273
- .rq-badge.success {
274
- background: rgba(16, 185, 129, 0.1);
275
- color: #10b981;
276
- }
277
-
278
- /* Metadata */
279
- .rq-meta {
280
- display: flex;
281
- flex-wrap: wrap;
282
- gap: 16px;
283
- font-size: 13px;
284
- color: var(--rq-fg-secondary);
285
- }
286
-
287
- .rq-meta-item {
288
- display: flex;
289
- align-items: center;
290
- gap: 6px;
291
- }
292
-
293
- .rq-meta-label {
294
- font-weight: 500;
295
- color: var(--rq-fg-secondary);
296
- }
297
-
298
- .rq-meta-code {
299
- background: var(--rq-bg-secondary);
300
- color: var(--rq-fg);
301
- padding: 3px 8px;
302
- border-radius: 3px;
303
- font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
304
- font-size: 12px;
305
- }
306
-
307
- .rq-meta-status {
308
- padding: 3px 8px;
309
- border-radius: 3px;
310
- font-weight: 600;
311
- font-size: 12px;
312
- font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
313
- }
314
-
315
- .rq-meta-status.status-2xx {
316
- background: rgba(16, 185, 129, 0.1);
317
- color: #10b981;
318
- }
319
-
320
- .rq-meta-status.status-4xx,
321
- .rq-meta-status.status-5xx {
322
- background: rgba(239, 68, 68, 0.1);
323
- color: #ef4444;
324
- }
325
-
326
- /* Section */
327
- .rq-section {
328
- margin-bottom: 20px;
329
- }
330
-
331
- .rq-section-label {
332
- font-size: 12px;
333
- font-weight: 700;
334
- text-transform: uppercase;
335
- letter-spacing: 0.05em;
336
- color: var(--rq-fg-secondary);
337
- margin-bottom: 8px;
338
- display: flex;
339
- align-items: center;
340
- gap: 8px;
341
- }
342
-
343
- .rq-section-content {
344
- display: flex;
345
- flex-direction: column;
346
- gap: 8px;
347
- }
348
-
349
- /* JSON Highlighting */
350
- .rq-json {
351
- background: var(--rq-bg-secondary);
352
- border: 1px solid var(--rq-border);
353
- border-radius: var(--rq-radius);
354
- padding: 12px;
355
- overflow-x: auto;
356
- font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
357
- font-size: 12px;
358
- line-height: 1.6;
359
- color: var(--rq-fg);
360
- }
361
-
362
- .rq-json-key {
363
- color: #0ea5e9;
364
- }
365
-
366
- .rq-json-string {
367
- color: #10b981;
368
- }
369
-
370
- .rq-json-number {
371
- color: #fbbf24;
372
- }
373
-
374
- .rq-json-boolean {
375
- color: #c084fc;
376
- }
377
-
378
- .rq-json-null {
379
- color: #f87171;
380
- }
381
-
382
- .rq-json-bracket {
383
- color: var(--rq-fg-secondary);
384
- }
385
-
386
- /* Code Block (for Request/Response body) */
387
- .rq-code-block {
388
- background: var(--rq-bg-secondary);
389
- border: 1px solid var(--rq-border);
390
- border-radius: var(--rq-radius);
391
- padding: 12px;
392
- overflow-x: auto;
393
- font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
394
- font-size: 12px;
395
- line-height: 1.6;
396
- white-space: pre-wrap;
397
- word-break: break-word;
398
- }
399
-
400
- /* Tables */
401
- .rq-table {
402
- width: 100%;
403
- border-collapse: collapse;
404
- border: 1px solid var(--rq-border);
405
- border-radius: var(--rq-radius);
406
- overflow: hidden;
407
- }
408
-
409
- .rq-table thead {
410
- background: var(--rq-bg-secondary);
411
- }
412
-
413
- .rq-table th {
414
- padding: 12px;
415
- text-align: left;
416
- font-size: 12px;
417
- font-weight: 600;
418
- text-transform: uppercase;
419
- letter-spacing: 0.05em;
420
- color: var(--rq-fg-secondary);
421
- border-bottom: 1px solid var(--rq-border);
422
- }
423
-
424
- .rq-table td {
425
- padding: 12px;
426
- border-bottom: 1px solid var(--rq-border);
427
- color: var(--rq-fg);
428
- font-size: 13px;
429
- }
430
-
431
- .rq-table tbody tr {
432
- transition: background-color var(--rq-duration) ease-out;
433
- }
434
-
435
- .rq-table tbody tr:hover {
436
- background: rgba(255, 255, 255, 0.02);
437
- }
438
-
439
- .rq-table tbody tr:last-child td {
440
- border-bottom: none;
441
- }
442
-
443
- /* Forms */
444
- .rq-form {
445
- display: flex;
446
- flex-direction: column;
447
- gap: 16px;
448
- }
449
-
450
- .rq-form-group {
451
- display: flex;
452
- flex-direction: column;
453
- gap: 6px;
454
- }
455
-
456
- .rq-form-label {
457
- font-size: 13px;
458
- font-weight: 600;
459
- color: var(--rq-fg);
460
- }
461
-
462
- .rq-form-input,
463
- .rq-form-textarea,
464
- .rq-form-select {
465
- padding: 10px 12px;
466
- border: 1px solid var(--rq-border);
467
- border-radius: 6px;
468
- background: var(--rq-bg-secondary);
469
- color: var(--rq-fg);
470
- font-size: 13px;
471
- font-family: inherit;
472
- transition: border-color var(--rq-duration) ease-out, background-color var(--rq-duration) ease-out;
473
- }
474
-
475
- .rq-form-input:hover,
476
- .rq-form-textarea:hover,
477
- .rq-form-select:hover {
478
- border-color: var(--rq-fg-secondary);
479
- }
480
-
481
- .rq-form-input:focus,
482
- .rq-form-textarea:focus,
483
- .rq-form-select:focus {
484
- outline: none;
485
- border-color: var(--rq-accent);
486
- background: var(--rq-bg);
487
- }
488
-
489
- .rq-form-textarea {
490
- resize: vertical;
491
- min-height: 100px;
492
- font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
493
- }
494
-
495
- /* Buttons */
496
- .rq-btn {
497
- padding: 10px 16px;
498
- border: 1px solid var(--rq-border);
499
- border-radius: 6px;
500
- background: transparent;
501
- color: var(--rq-fg);
502
- font-size: 13px;
503
- font-weight: 600;
504
- cursor: pointer;
505
- transition: all var(--rq-duration) ease-out;
506
- white-space: nowrap;
507
- }
508
-
509
- .rq-btn:hover {
510
- border-color: var(--rq-fg-secondary);
511
- background: rgba(255, 255, 255, 0.04);
512
- }
513
-
514
- .rq-btn.primary {
515
- background: var(--rq-accent);
516
- border-color: var(--rq-accent);
517
- color: #000;
518
- }
519
-
520
- .rq-btn.primary:hover {
521
- opacity: 0.9;
522
- }
523
-
524
- /* Placements */
525
- #reqwise-panel.placement-left {
526
- left: 0;
527
- right: auto;
528
- height: 100vh;
529
- }
530
-
531
- /* Ensure right placement also fills viewport height */
532
- #reqwise-panel.placement-right {
533
- height: 100vh;
534
- }
535
-
536
-
537
- #reqwise-panel.placement-top {
538
- top: 0;
539
- left: 0;
540
- right: 0;
541
- width: 100vw;
542
- box-sizing: border-box;
543
- min-width: unset;
544
- max-width: unset;
545
- height: 50%;
546
- min-height: 320px;
547
- max-height: unset;
548
- margin: 0;
549
- box-shadow: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06);
550
- }
551
-
552
-
553
- #reqwise-panel.placement-bottom {
554
- bottom: 0;
555
- top: auto;
556
- left: 0;
557
- right: 0;
558
- width: 100vw;
559
- box-sizing: border-box;
560
- min-width: unset;
561
- max-width: unset;
562
- height: 50%;
563
- min-height: 320px;
564
- max-height: unset;
565
- margin: 0;
566
- box-shadow: 0 -4px 6px -1px rgba(0,0,0,0.1), 0 -2px 4px -1px rgba(0,0,0,0.06);
567
- }
568
-
569
- /* Toggle Button: positioned relative to the panel and oriented perpendicular */
570
- .rq-toggle {
571
- position: absolute;
572
- width: auto;
573
- height: auto;
574
- padding: 8px 12px;
575
- border: none;
576
- background: var(--rq-bg);
577
- color: var(--rq-fg);
578
- z-index: calc(var(--rq-z) + 2);
579
- cursor: pointer;
580
- display: inline-flex;
581
- align-items: center;
582
- justify-content: center;
583
- gap: 8px;
584
- font-size: 13px;
585
- font-weight: 600;
586
- box-shadow: var(--rq-shadow);
587
- transition: transform var(--rq-duration) ease-out, background var(--rq-duration) ease-out;
588
- border-radius: 4px;
589
- overflow: visible;
590
- writing-mode: horizontal-tb; /* default: horizontal for top/bottom placements */
591
- text-orientation: mixed;
592
- visibility: visible !important;
593
- display: inline-flex !important;
594
- }
595
-
596
- .rq-toggle:hover { transform: scale(1.03); }
597
-
598
- .rq-toggle img { width: 20px; height: 20px; object-fit: contain; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08)); }
599
-
600
- /* Placement-specific toggle positioning (relative to panel so it moves with it) */
601
- #reqwise-panel.placement-right .rq-toggle {
602
- position: absolute;
603
- left: -40px; /* adjacent to panel, to the left */
604
- top: 50%;
605
- transform: translateY(-50%);
606
- border-radius: 6px 0 0 6px;
607
- writing-mode: vertical-rl; /* vertical text, reading from right side */
608
- width: 40px;
609
- }
610
-
611
- #reqwise-panel.placement-left .rq-toggle {
612
- position: absolute;
613
- right: -40px; /* adjacent to panel, to the right (panel on left) */
614
- top: 50%;
615
- transform: translateY(-50%);
616
- border-radius: 0 6px 6px 0;
617
- writing-mode: vertical-rl; /* match right placement so text faces inward */
618
- width: 40px;
619
- }
620
-
621
- /* Rotate logo when toggle is vertical so it faces toward the page (opposite of panel) */
622
- #reqwise-panel.placement-right .rq-toggle img { transform: rotate(90deg); }
623
- #reqwise-panel.placement-left .rq-toggle img { transform: rotate(-90deg); }
624
-
625
- #reqwise-panel.placement-top .rq-toggle {
626
- position: absolute;
627
- bottom: -40px; /* place toggle below the top panel (under it) */
628
- left: 50%;
629
- transform: translateX(-50%);
630
- writing-mode: horizontal-tb;
631
- border-radius: 0 0 6px 6px;
632
- width: auto;
633
- min-width: 140px;
634
- padding: 8px 16px;
635
- }
636
-
637
- #reqwise-panel.placement-bottom .rq-toggle {
638
- position: absolute;
639
- top: -40px; /* place toggle above the bottom panel (on top of it) */
640
- left: 50%;
641
- transform: translateX(-50%);
642
- writing-mode: horizontal-tb;
643
- border-radius: 6px 6px 0 0;
644
- width: auto;
645
- min-width: 140px;
646
- padding: 8px 16px;
647
- }
648
-
649
- .rq-toggle span { white-space: nowrap; }
650
-
651
- /* Scale wrapper: transforms content inside aside without affecting panel slide transform */
652
- .rq-scale-wrapper {
653
- transform-origin: center center;
654
- transition: transform var(--rq-duration) ease;
655
- }
656
-
657
- /* Zoom controls in header */
658
- .rq-zoom-controls { display: inline-flex; gap: 6px; align-items: center; margin-right: 8px }
659
- .rq-zoom-btn { background: transparent; border: 1px solid var(--rq-border); color: var(--rq-fg); padding: 6px 8px; border-radius: 6px; cursor: pointer; font-weight: 700 }
660
- .rq-zoom-btn:hover { background: rgba(255,255,255,0.02) }
661
-
662
- /* Panel closed states: slide fully off-screen toward its placement */
663
- #reqwise-panel.placement-right.rq-closed { transform: translateX(100%); }
664
- #reqwise-panel.placement-left.rq-closed { transform: translateX(-100%); }
665
- #reqwise-panel.placement-top.rq-closed { transform: translateY(-100%); }
666
- #reqwise-panel.placement-bottom.rq-closed { transform: translateY(100%); }
667
-
668
- /* Corner handles for resize cursor (invisible) */
669
- .rq-corner-handle {
670
- position: absolute;
671
- width: 18px;
672
- height: 18px;
673
- background: transparent;
674
- z-index: calc(var(--rq-z) + 5);
675
- }
676
- .rq-corner-top-left { left: -8px; top: -8px; cursor: nwse-resize; }
677
- .rq-corner-top-right { right: -8px; top: -8px; cursor: nesw-resize; }
678
- .rq-corner-bottom-left { left: -8px; bottom: -8px; cursor: nesw-resize; }
679
- .rq-corner-bottom-right { right: -8px; bottom: -8px; cursor: nwse-resize; }
680
-
681
- /* Responsive */
682
- @media (max-width: 768px) {
683
- :root {
684
- --rq-width: 100%;
685
- --rq-min-width: 100%;
686
- }
687
-
688
- #reqwise-panel {
689
- width: 100%;
690
- min-width: unset;
691
- max-width: unset;
692
- position: fixed;
693
- left: 0;
694
- right: 0;
695
- top: 0;
696
- height: 100%;
697
- }
698
-
699
- #reqwise-panel.placement-left,
700
- #reqwise-panel.placement-right {
701
- width: 100%;
702
- }
703
-
704
- .rq-toggle {
705
- width: 100%;
706
- height: auto;
707
- border-radius: 0;
708
- border-left: none;
709
- }
710
-
711
- .rq-toggle:hover {
712
- padding-left: 12px;
713
- }
714
-
715
- .rq-toggle svg {
716
- display: none;
717
- }
718
- }
719
-
720
- @media (prefers-reduced-motion: reduce) {
721
- * {
722
- animation-duration: 0.01ms !important;
723
- animation-iteration-count: 1 !important;
724
- transition-duration: 0.01ms !important;
725
- scroll-behavior: auto !important;
726
- }
727
- }
728
- `;
729
-
730
- export default styles;