@seclai/react 0.0.7 → 0.0.9

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/styles.css CHANGED
@@ -397,6 +397,282 @@
397
397
  text-underline-offset: 0.16em;
398
398
  }
399
399
 
400
+ /*
401
+ * Image cards, galleries, skeletons and the viewer. Also themable with:
402
+ * --seclai-media-aspect-ratio a frame's ratio before its image loads (1 / 1)
403
+ * --seclai-media-fit object-fit for the image in its frame (scale-down)
404
+ * --seclai-media-min-width a gallery column's minimum width (220px)
405
+ * --seclai-media-max-width a card's width outside a gallery (480px)
406
+ */
407
+ .seclai-gallery,
408
+ .seclai-gallery *,
409
+ .seclai-media-image,
410
+ .seclai-media-image *,
411
+ .seclai-viewer,
412
+ .seclai-viewer * {
413
+ box-sizing: border-box;
414
+ }
415
+
416
+ .seclai-gallery :focus-visible,
417
+ .seclai-media-image :focus-visible,
418
+ .seclai-viewer :focus-visible {
419
+ outline: 2px solid var(--seclai-focus);
420
+ outline-offset: 2px;
421
+ }
422
+
423
+ /* A button that stays focusable while it does nothing. */
424
+ .seclai-button[aria-disabled="true"] {
425
+ cursor: not-allowed;
426
+ opacity: 0.55;
427
+ }
428
+
429
+ .seclai-button[aria-disabled="true"]:active {
430
+ transform: none;
431
+ }
432
+
433
+ @media (hover: hover) {
434
+ .seclai-button[aria-disabled="true"]:hover {
435
+ background: transparent;
436
+ }
437
+ }
438
+
439
+ .seclai-media-image {
440
+ width: 100%;
441
+ max-width: var(--seclai-media-max-width, 480px);
442
+ gap: 0;
443
+ overflow: hidden;
444
+ background: var(--seclai-surface);
445
+ border: 1px solid var(--seclai-border);
446
+ border-radius: var(--seclai-radius);
447
+ }
448
+
449
+ .seclai-media-frame {
450
+ position: relative;
451
+ display: block;
452
+ width: 100%;
453
+ aspect-ratio: var(--seclai-media-aspect-ratio, 1 / 1);
454
+ margin: 0;
455
+ padding: 0;
456
+ overflow: hidden;
457
+ font: inherit;
458
+ color: inherit;
459
+ background: var(--seclai-surface-hover);
460
+ border: 0;
461
+ border-radius: 0;
462
+ }
463
+
464
+ button.seclai-media-frame {
465
+ cursor: zoom-in;
466
+ }
467
+
468
+ /* Inset, so the card's own overflow doesn't clip the ring. */
469
+ button.seclai-media-frame:focus-visible {
470
+ outline-offset: -2px;
471
+ }
472
+
473
+ .seclai-media-frame > img {
474
+ align-self: auto;
475
+ width: 100%;
476
+ max-width: none;
477
+ height: 100%;
478
+ object-fit: var(--seclai-media-fit, scale-down);
479
+ border-radius: 0;
480
+ transition: transform 200ms ease-out;
481
+ }
482
+
483
+ @media (hover: hover) {
484
+ button.seclai-media-frame:hover > img {
485
+ transform: scale(1.02);
486
+ }
487
+ }
488
+
489
+ /* Fixed colours: the badge sits on the image, not on the page. */
490
+ .seclai-media-badge {
491
+ position: absolute;
492
+ top: 8px;
493
+ inset-inline-start: 8px;
494
+ display: inline-flex;
495
+ align-items: center;
496
+ justify-content: center;
497
+ min-width: 24px;
498
+ height: 24px;
499
+ padding: 0 6px;
500
+ font-size: 0.75rem;
501
+ font-weight: 600;
502
+ font-variant-numeric: tabular-nums;
503
+ line-height: 1;
504
+ color: #ffffff;
505
+ background: rgb(0 0 0 / 0.72);
506
+ border-radius: 999px;
507
+ }
508
+
509
+ .seclai-media-error {
510
+ position: absolute;
511
+ inset: 0;
512
+ display: flex;
513
+ align-items: center;
514
+ justify-content: center;
515
+ padding: 12px;
516
+ color: var(--seclai-muted);
517
+ text-align: center;
518
+ }
519
+
520
+ .seclai-media-bar {
521
+ display: flex;
522
+ flex-wrap: wrap;
523
+ align-items: center;
524
+ gap: 8px;
525
+ min-height: var(--seclai-control-height);
526
+ padding: 8px 12px;
527
+ }
528
+
529
+ .seclai-media-actions {
530
+ display: inline-flex;
531
+ flex-wrap: wrap;
532
+ align-items: center;
533
+ gap: 8px;
534
+ margin-inline-start: 8px;
535
+ vertical-align: middle;
536
+ }
537
+
538
+ .seclai-media-bar .seclai-media-actions {
539
+ margin-inline-start: auto;
540
+ }
541
+
542
+ /* Skeleton cards */
543
+ .seclai-media-skeleton .seclai-media-frame,
544
+ .seclai-media-skeleton-line {
545
+ animation: seclai-pulse 1.6s ease-in-out infinite;
546
+ }
547
+
548
+ .seclai-media-skeleton .seclai-media-badge {
549
+ background: rgb(0 0 0 / 0.4);
550
+ }
551
+
552
+ .seclai-media-skeleton-line {
553
+ display: block;
554
+ width: 72px;
555
+ height: 0.75em;
556
+ background: var(--seclai-surface-hover);
557
+ border-radius: 4px;
558
+ }
559
+
560
+ /* Galleries */
561
+ .seclai-gallery {
562
+ display: flex;
563
+ flex-direction: column;
564
+ gap: calc(var(--seclai-gap) / 2);
565
+ }
566
+
567
+ .seclai-gallery-grid {
568
+ display: grid;
569
+ grid-template-columns: repeat(
570
+ auto-fill,
571
+ minmax(min(100%, var(--seclai-media-min-width, 220px)), 1fr)
572
+ );
573
+ gap: calc(var(--seclai-gap) * 0.75);
574
+ margin: 0;
575
+ padding: 0;
576
+ list-style: none;
577
+ }
578
+
579
+ .seclai-gallery-grid > li {
580
+ min-width: 0;
581
+ }
582
+
583
+ .seclai-gallery-grid .seclai-media-image {
584
+ max-width: none;
585
+ height: 100%;
586
+ }
587
+
588
+ .seclai-gallery-actions {
589
+ display: flex;
590
+ flex-wrap: wrap;
591
+ gap: calc(var(--seclai-gap) / 2);
592
+ }
593
+
594
+ /*
595
+ * The viewer is dark in both colour schemes, like most photo viewers, so it
596
+ * sets its own text and border colours and keeps only the accent.
597
+ */
598
+ .seclai-viewer {
599
+ --seclai-text: #ffffff;
600
+ --seclai-muted: rgb(255 255 255 / 0.7);
601
+ --seclai-border: rgb(255 255 255 / 0.2);
602
+ --seclai-field-border: rgb(255 255 255 / 0.45);
603
+ --seclai-surface-hover: rgb(255 255 255 / 0.14);
604
+ --seclai-focus: #ffffff;
605
+ color-scheme: dark;
606
+ width: min(100vw - 32px, 1400px);
607
+ max-width: none;
608
+ max-height: none;
609
+ margin: auto;
610
+ padding: 0;
611
+ overflow: visible;
612
+ font-family: var(--seclai-font);
613
+ line-height: 1.5;
614
+ color: var(--seclai-text);
615
+ background: transparent;
616
+ border: 0;
617
+ }
618
+
619
+ .seclai-viewer::backdrop {
620
+ background: rgb(0 0 0 / 0.85);
621
+ }
622
+
623
+ .seclai-viewer-body {
624
+ display: flex;
625
+ flex-direction: column;
626
+ gap: 12px;
627
+ }
628
+
629
+ .seclai-viewer-image {
630
+ display: block;
631
+ width: 100%;
632
+ max-height: calc(100dvh - 120px);
633
+ object-fit: contain;
634
+ border-radius: var(--seclai-radius);
635
+ }
636
+
637
+ .seclai-viewer-bar {
638
+ display: flex;
639
+ flex-wrap: wrap;
640
+ align-items: center;
641
+ gap: 8px;
642
+ }
643
+
644
+ .seclai-viewer-title {
645
+ margin: 0;
646
+ margin-inline-end: auto;
647
+ font-size: 0.875em;
648
+ overflow-wrap: anywhere;
649
+ }
650
+
651
+ .seclai-viewer-count {
652
+ margin-inline-start: 8px;
653
+ font-variant-numeric: tabular-nums;
654
+ color: var(--seclai-muted);
655
+ }
656
+
657
+ .seclai-viewer a.seclai-button {
658
+ text-decoration: none;
659
+ }
660
+
661
+ @media (prefers-reduced-motion: reduce) {
662
+ .seclai-media-skeleton .seclai-media-frame,
663
+ .seclai-media-skeleton-line {
664
+ animation: none;
665
+ }
666
+
667
+ .seclai-media-frame > img {
668
+ transition: none;
669
+ }
670
+
671
+ button.seclai-media-frame:hover > img {
672
+ transform: none;
673
+ }
674
+ }
675
+
400
676
  /* Messages */
401
677
  .seclai-notice {
402
678
  margin: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seclai/react",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "React components and hooks for running Seclai agents: run form, chat, and streaming output.",
5
5
  "license": "MIT",
6
6
  "type": "module",