@sekyro/react 0.1.0-rc.1 → 0.1.0-rc.3

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
@@ -101,7 +101,8 @@
101
101
  outline: 3px solid var(--sekyro-color-ring);
102
102
  outline-offset: 2px;
103
103
  }
104
- .sekyro-btn:disabled {
104
+ .sekyro-btn:disabled,
105
+ .sekyro-btn[aria-disabled="true"] {
105
106
  cursor: default;
106
107
  opacity: 0.6;
107
108
  }
@@ -118,6 +119,10 @@
118
119
  .sekyro-btn--primary:hover {
119
120
  background: color-mix(in srgb, var(--sekyro-color-brand) 92%, var(--sekyro-color-fg));
120
121
  }
122
+ /* An aria-disabled (still focusable) primary does not react to hover. */
123
+ .sekyro-btn--primary[aria-disabled="true"]:hover {
124
+ background: var(--sekyro-color-brand);
125
+ }
121
126
  .sekyro-btn--ghost {
122
127
  background: transparent;
123
128
  color: var(--sekyro-color-fg);
@@ -398,3 +403,272 @@
398
403
  transform: scale(1);
399
404
  }
400
405
  }
406
+
407
+ /* ── pre-capture screen ────────────────────────────────────────────────── */
408
+ .sekyro-tips {
409
+ display: flex;
410
+ flex-direction: column;
411
+ gap: 0.5rem;
412
+ padding: 0.875rem;
413
+ border: 1px solid color-mix(in srgb, var(--sekyro-color-fg) 14%, transparent);
414
+ border-radius: var(--sekyro-radius);
415
+ background: var(--sekyro-color-surface);
416
+ }
417
+ .sekyro-tips__title {
418
+ margin: 0;
419
+ font-size: 0.9375rem;
420
+ font-weight: 700;
421
+ color: var(--sekyro-color-fg);
422
+ }
423
+ .sekyro-tips__list {
424
+ margin: 0;
425
+ padding: 0;
426
+ list-style: none;
427
+ display: flex;
428
+ flex-direction: column;
429
+ gap: 0.5rem;
430
+ }
431
+ .sekyro-tips__item {
432
+ display: flex;
433
+ align-items: flex-start;
434
+ gap: 0.625rem;
435
+ font-size: 0.9375rem;
436
+ line-height: 1.45;
437
+ color: var(--sekyro-color-fg);
438
+ }
439
+ .sekyro-tips__icon {
440
+ display: inline-flex;
441
+ flex-shrink: 0;
442
+ color: var(--sekyro-color-brand);
443
+ margin-block-start: 0.125rem;
444
+ }
445
+ .sekyro-permission {
446
+ display: flex;
447
+ align-items: flex-start;
448
+ gap: 0.625rem;
449
+ padding: 0.75rem;
450
+ border-radius: var(--sekyro-radius);
451
+ border: 1px solid color-mix(in srgb, var(--sekyro-color-fg) 14%, transparent);
452
+ font-size: 0.9375rem;
453
+ line-height: 1.45;
454
+ color: var(--sekyro-color-fg);
455
+ }
456
+ .sekyro-permission__icon {
457
+ display: inline-flex;
458
+ flex-shrink: 0;
459
+ margin-block-start: 0.125rem;
460
+ color: var(--sekyro-color-fg-muted);
461
+ }
462
+ .sekyro-permission--granted .sekyro-permission__icon {
463
+ color: var(--sekyro-color-success);
464
+ }
465
+ .sekyro-permission--denied {
466
+ border-color: var(--sekyro-color-warning);
467
+ background: color-mix(in srgb, var(--sekyro-color-warning) 10%, var(--sekyro-color-surface));
468
+ }
469
+ .sekyro-permission--denied .sekyro-permission__icon {
470
+ color: var(--sekyro-color-warning);
471
+ }
472
+ /* Camera choice: native radios drawn as segments. The input covers its whole
473
+ * segment (hit area = the ≥ 48px face) but is transparent; the face is its
474
+ * next sibling, so checked/focus styles need no :has(). */
475
+ .sekyro-segmented {
476
+ margin: 0;
477
+ padding: 0;
478
+ border: 0;
479
+ min-width: 0;
480
+ }
481
+ .sekyro-segmented__legend {
482
+ padding: 0;
483
+ margin-block-end: 0.5rem;
484
+ font-size: 0.9375rem;
485
+ font-weight: 600;
486
+ color: var(--sekyro-color-fg);
487
+ }
488
+ .sekyro-segmented__options {
489
+ display: grid;
490
+ grid-template-columns: 1fr 1fr;
491
+ gap: 0.5rem;
492
+ }
493
+ .sekyro-segmented__option {
494
+ position: relative;
495
+ display: flex;
496
+ }
497
+ .sekyro-segmented__input {
498
+ position: absolute;
499
+ inset: 0;
500
+ width: 100%;
501
+ height: 100%;
502
+ margin: 0;
503
+ opacity: 0;
504
+ cursor: pointer;
505
+ }
506
+ .sekyro-segmented__face {
507
+ display: flex;
508
+ flex: 1;
509
+ align-items: center;
510
+ justify-content: center;
511
+ gap: 0.5rem;
512
+ min-height: 48px;
513
+ padding-block: 0.5rem;
514
+ padding-inline: 0.75rem;
515
+ border: 1px solid color-mix(in srgb, var(--sekyro-color-fg) 30%, transparent);
516
+ border-radius: var(--sekyro-radius);
517
+ background: var(--sekyro-color-surface);
518
+ font-size: 1rem;
519
+ font-weight: 600;
520
+ line-height: 1.25;
521
+ text-align: center;
522
+ color: var(--sekyro-color-fg);
523
+ pointer-events: none;
524
+ }
525
+ /* Radio dot: hollow ring → filled ring when checked (shape, not only color). */
526
+ .sekyro-segmented__dot {
527
+ flex-shrink: 0;
528
+ width: 1rem;
529
+ height: 1rem;
530
+ border-radius: 9999px;
531
+ border: 2px solid color-mix(in srgb, var(--sekyro-color-fg) 55%, transparent);
532
+ }
533
+ .sekyro-segmented__input:checked + .sekyro-segmented__face {
534
+ border-color: var(--sekyro-color-brand);
535
+ box-shadow: inset 0 0 0 1px var(--sekyro-color-brand);
536
+ background: color-mix(in srgb, var(--sekyro-color-brand) 8%, var(--sekyro-color-surface));
537
+ }
538
+ .sekyro-segmented__input:checked + .sekyro-segmented__face .sekyro-segmented__dot {
539
+ border-color: var(--sekyro-color-brand);
540
+ box-shadow: inset 0 0 0 3px var(--sekyro-color-surface);
541
+ background: var(--sekyro-color-brand);
542
+ }
543
+ .sekyro-segmented__input:focus-visible + .sekyro-segmented__face {
544
+ outline: 3px solid var(--sekyro-color-ring);
545
+ outline-offset: 2px;
546
+ }
547
+ .sekyro-segmented__option:hover .sekyro-segmented__face {
548
+ border-color: var(--sekyro-color-brand);
549
+ }
550
+ /* Voice switch: label + track/thumb; the thumb moves AND shows a check when on. */
551
+ .sekyro-switch {
552
+ display: flex;
553
+ align-items: center;
554
+ justify-content: space-between;
555
+ gap: 0.75rem;
556
+ width: 100%;
557
+ min-height: 48px;
558
+ padding-block: 0.25rem;
559
+ padding-inline: 0.25rem;
560
+ border: 0;
561
+ border-radius: var(--sekyro-radius);
562
+ background: transparent;
563
+ font: inherit;
564
+ font-size: 1rem;
565
+ line-height: 1.4;
566
+ color: var(--sekyro-color-fg);
567
+ cursor: pointer;
568
+ text-align: start;
569
+ -webkit-tap-highlight-color: transparent;
570
+ }
571
+ .sekyro-switch:focus-visible {
572
+ outline: 3px solid var(--sekyro-color-ring);
573
+ outline-offset: 2px;
574
+ }
575
+ .sekyro-switch__label {
576
+ display: inline-flex;
577
+ align-items: center;
578
+ gap: 0.5rem;
579
+ font-weight: 600;
580
+ }
581
+ .sekyro-switch__track {
582
+ position: relative;
583
+ flex-shrink: 0;
584
+ width: 2.75rem;
585
+ height: 1.5rem;
586
+ border-radius: 9999px;
587
+ background: color-mix(in srgb, var(--sekyro-color-fg) 55%, var(--sekyro-color-surface));
588
+ transition: background-color 150ms;
589
+ }
590
+ .sekyro-switch[aria-checked="true"] .sekyro-switch__track {
591
+ background: var(--sekyro-color-brand);
592
+ }
593
+ .sekyro-switch__thumb {
594
+ position: absolute;
595
+ inset-block-start: 0.1875rem;
596
+ inset-inline-start: 0.1875rem;
597
+ display: flex;
598
+ align-items: center;
599
+ justify-content: center;
600
+ width: 1.125rem;
601
+ height: 1.125rem;
602
+ border-radius: 9999px;
603
+ background: var(--sekyro-color-surface);
604
+ color: var(--sekyro-color-brand);
605
+ transition: inset-inline-start 150ms;
606
+ }
607
+ .sekyro-switch[aria-checked="true"] .sekyro-switch__thumb {
608
+ inset-inline-start: 1.4375rem;
609
+ }
610
+ .sekyro-switch__check {
611
+ width: 0.75rem;
612
+ height: 0.75rem;
613
+ }
614
+ .sekyro-spinner {
615
+ flex-shrink: 0;
616
+ width: 1.25rem;
617
+ height: 1.25rem;
618
+ animation: sekyro-spin 0.9s linear infinite;
619
+ }
620
+ .sekyro-visually-hidden {
621
+ position: absolute;
622
+ width: 1px;
623
+ height: 1px;
624
+ margin: -1px;
625
+ padding: 0;
626
+ overflow: hidden;
627
+ clip: rect(0 0 0 0);
628
+ clip-path: inset(50%);
629
+ white-space: nowrap;
630
+ border: 0;
631
+ }
632
+ @keyframes sekyro-spin {
633
+ to {
634
+ transform: rotate(360deg);
635
+ }
636
+ }
637
+ .sekyro-capture-reduce .sekyro-spinner {
638
+ animation: none;
639
+ }
640
+ .sekyro-capture-reduce .sekyro-switch__track,
641
+ .sekyro-capture-reduce .sekyro-switch__thumb {
642
+ transition: none;
643
+ }
644
+ @media (prefers-reduced-motion: reduce) {
645
+ .sekyro-spinner {
646
+ animation: none;
647
+ }
648
+ .sekyro-switch__track,
649
+ .sekyro-switch__thumb {
650
+ transition: none;
651
+ }
652
+ }
653
+ /* Windows high contrast: backgrounds are dropped → draw the switch and the
654
+ * checked segment with system colors so the state stays visible. */
655
+ @media (forced-colors: active) {
656
+ .sekyro-switch__track {
657
+ border: 1px solid CanvasText;
658
+ }
659
+ .sekyro-switch__thumb {
660
+ background: CanvasText;
661
+ }
662
+ /* Checked = a thick Highlight border (not an outline, so the focus-visible
663
+ * outline still shows on the checked option). */
664
+ .sekyro-segmented__input:checked + .sekyro-segmented__face {
665
+ border: 3px solid Highlight;
666
+ }
667
+ /* The thumb is painted CanvasText: draw the check in Canvas so it stays visible. */
668
+ .sekyro-switch__check {
669
+ color: Canvas;
670
+ }
671
+ .sekyro-segmented__input:checked + .sekyro-segmented__face .sekyro-segmented__dot {
672
+ background: Highlight;
673
+ }
674
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sekyro/react",
3
- "version": "0.1.0-rc.1",
4
- "description": "Sekyro React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (ar/fr/en, RTL-safe, WCAG AAA defaults)",
3
+ "version": "0.1.0-rc.3",
4
+ "description": "Sekyro React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (ar/fr/en, RTL-safe, WCAG AAA defaults)",
5
5
  "license": "UNLICENSED",
6
6
  "repository": {
7
7
  "type": "git",
@@ -47,10 +47,12 @@
47
47
  }
48
48
  },
49
49
  "./styles.css": "./dist/styles.css",
50
+ "./assets/*": "./assets/*",
50
51
  "./package.json": "./package.json"
51
52
  },
52
53
  "files": [
53
54
  "dist",
55
+ "assets",
54
56
  "README.md",
55
57
  "CHANGELOG.md",
56
58
  "LICENSE"
@@ -58,12 +60,14 @@
58
60
  "scripts": {
59
61
  "build": "tsup",
60
62
  "test": "node scripts/check-css.mjs && vitest run",
63
+ "size": "node scripts/check-size.mjs",
64
+ "voice:generate": "node --experimental-strip-types scripts/generate-voice-clips.mts",
61
65
  "typecheck": "tsc --noEmit",
62
66
  "api:report": "api-extractor run --local",
63
67
  "api:check": "api-extractor run"
64
68
  },
65
69
  "peerDependencies": {
66
- "@sekyro/web": "^0.1.0-rc.1",
70
+ "@sekyro/web": "^0.1.0-rc.5",
67
71
  "react": ">=18.2",
68
72
  "react-dom": ">=18.2"
69
73
  },