@semics-tech/emdash-events 1.0.0-rc.6 → 1.0.0-rc.8

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.
@@ -181,7 +181,7 @@ const when = (iso: string) => {
181
181
  aria-invalid={invalid("occurrence")}
182
182
  aria-describedby={errId("occurrence")}
183
183
  >
184
- <legend>{t("widget.date")}</legend>
184
+ <legend class="semics-visually-hidden">{t("widget.date")}</legend>
185
185
  <table role="grid" class="semics-calendar" aria-labelledby={monthId}>
186
186
  <thead>
187
187
  <tr>
@@ -439,9 +439,9 @@ const when = (iso: string) => {
439
439
 
440
440
  {siteKey && (
441
441
  <>
442
- <div class="cf-turnstile" data-sitekey={siteKey}></div>
443
- {/* Turnstile is 300 px wide; in a narrower widget use its compact size so a 320 px screen never scrolls sideways (WCAG 1.4.10). */}
444
- <script is:inline>(function (s) { var t = s && s.previousElementSibling; if (t && t.clientWidth < 300) t.setAttribute("data-size", "compact"); })(document.currentScript);</script>
442
+ <div class="cf-turnstile" data-sitekey={siteKey} data-theme="light"></div>
443
+ {/* Turnstile is 300 px wide: compact when the form has less room, so a 320 px screen never scrolls sideways (WCAG 1.4.10). The form is measured, not the empty box; a form not laid out yet (0 px) falls back to the screen less the card's padding (T158). Light, like the card. */}
444
+ <script is:inline>(function (s) { var t = s && s.previousElementSibling, f = t && t.closest("form"), w = f ? f.clientWidth : 0; if (!w) w = document.documentElement.clientWidth - 48; if (t && w < 300) t.setAttribute("data-size", "compact"); })(document.currentScript);</script>
445
445
  <noscript>
446
446
  <p class="semics-needs-js" data-testid="booking-needs-js">{t("widget.needsJs")}</p>
447
447
  </noscript>
@@ -493,8 +493,8 @@ const when = (iso: string) => {
493
493
  </div>
494
494
  {siteKey && (
495
495
  <>
496
- <div class="cf-turnstile" data-sitekey={siteKey}></div>
497
- <script is:inline>(function (s) { var t = s && s.previousElementSibling; if (t && t.clientWidth < 300) t.setAttribute("data-size", "compact"); })(document.currentScript);</script>
496
+ <div class="cf-turnstile" data-sitekey={siteKey} data-theme="light"></div>
497
+ <script is:inline>(function (s) { var t = s && s.previousElementSibling, f = t && t.closest("form"), w = f ? f.clientWidth : 0; if (!w) w = document.documentElement.clientWidth - 48; if (t && w < 300) t.setAttribute("data-size", "compact"); })(document.currentScript);</script>
498
498
  </>
499
499
  )}
500
500
  <button type="submit" class="semics-secondary">{t("waitlist.button")}</button>
@@ -510,23 +510,31 @@ const when = (iso: string) => {
510
510
  import "../client/picker.ts";
511
511
  </script>
512
512
 
513
+
513
514
  <style>
515
+ /* One card with even, generous padding; groups read as sections with small headings, not boxes (T157). */
514
516
  .semics-booking-widget {
515
517
  --_fg: var(--events-fg, #1a1a1a);
516
518
  --_muted: var(--events-muted, #4a4a4a);
517
519
  --_bg: var(--events-bg, #ffffff);
518
520
  --_border: var(--events-border, #6b6b6b);
521
+ --_line: color-mix(in srgb, var(--_border) 30%, transparent);
522
+ --_tint: color-mix(in srgb, var(--_accent) 7%, var(--_bg));
519
523
  --_accent: var(--events-accent, #0b57d0);
520
524
  --_accent-fg: var(--events-accent-fg, #ffffff);
521
525
  --_error: var(--events-error, #b3261e);
522
526
  --_radius: var(--events-radius, 6px);
527
+ --_pad: clamp(1.25rem, 0.75rem + 2.5vw, 2rem);
523
528
  box-sizing: border-box;
524
- max-inline-size: 36rem;
525
- padding: 1rem;
526
- border: 1px solid var(--_border);
527
- border-radius: var(--_radius);
529
+ /* The host sets the width: the widget fills its column, up to `--events-widget-max` when set (T158). */
530
+ max-inline-size: var(--events-widget-max, none);
531
+ padding: var(--_pad);
532
+ border: 1px solid var(--_line);
533
+ border-radius: calc(var(--_radius) + 6px);
528
534
  background: var(--_bg);
535
+ box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 6px 24px rgb(0 0 0 / 0.06);
529
536
  color: var(--_fg);
537
+ line-height: 1.5;
530
538
  overflow-wrap: anywhere;
531
539
  }
532
540
  .semics-booking-widget *,
@@ -535,37 +543,40 @@ const when = (iso: string) => {
535
543
  box-sizing: border-box;
536
544
  }
537
545
  .semics-booking-widget h2 {
538
- margin: 0 0 0.75rem;
539
- font-size: 1.25rem;
546
+ margin: 0 0 1.25rem;
547
+ font-size: 1.375rem;
548
+ line-height: 1.25;
540
549
  }
541
550
  .semics-booking-widget form {
542
551
  display: grid;
543
552
  grid-template-columns: minmax(0, 1fr);
544
- gap: 0.75rem;
553
+ gap: 1.25rem;
545
554
  }
546
555
  .semics-booking-widget .semics-waitlist {
547
- margin-block-start: 1.25rem;
548
- padding-block-start: 1rem;
549
- border-block-start: 1px solid var(--_border);
556
+ margin-block-start: 1.5rem;
557
+ padding-block-start: 1.5rem;
558
+ border-block-start: 1px solid var(--_line);
550
559
  }
551
560
  .semics-waitlist h3,
552
561
  .semics-waitlist p {
553
562
  margin: 0;
554
563
  }
555
- .semics-tickets {
556
- margin: 0;
557
- padding: 0.5rem 0.75rem;
558
- border: 1px solid var(--_border);
559
- border-radius: var(--_radius);
560
- min-inline-size: 0;
564
+ .semics-booking-widget legend {
565
+ margin: 0 0 0.5rem;
566
+ padding: 0;
567
+ font-size: 0.8125rem;
568
+ font-weight: 700;
569
+ letter-spacing: 0.06em;
570
+ text-transform: uppercase;
571
+ color: var(--_muted);
561
572
  }
573
+ .semics-tickets,
562
574
  .semics-questions {
563
575
  display: grid;
564
576
  gap: 0.75rem;
565
577
  margin: 0;
566
- padding: 0.5rem 0.75rem 0.75rem;
567
- border: 1px solid var(--_border);
568
- border-radius: var(--_radius);
578
+ padding: 0;
579
+ border: 0;
569
580
  min-inline-size: 0;
570
581
  }
571
582
  .semics-check {
@@ -580,51 +591,68 @@ const when = (iso: string) => {
580
591
  min-block-size: 1.25rem;
581
592
  inline-size: 1.25rem;
582
593
  margin: 0;
594
+ accent-color: var(--_accent);
583
595
  }
584
596
  .semics-hint {
585
597
  color: var(--_muted);
586
598
  }
599
+ .semics-picker-field {
600
+ gap: 0.75rem;
601
+ }
587
602
  .semics-picker-nav {
588
603
  display: flex;
589
604
  flex-wrap: wrap;
590
- align-items: baseline;
591
- gap: 0.25rem 1rem;
605
+ align-items: center;
606
+ gap: 0.5rem;
592
607
  }
593
608
  .semics-picker-month {
594
609
  margin: 0;
595
610
  margin-inline-end: auto;
596
- font-weight: 600;
611
+ font-size: 1.125rem;
612
+ font-weight: 700;
597
613
  }
598
614
  .semics-picker-nav a {
615
+ display: inline-flex;
616
+ align-items: center;
617
+ min-block-size: 2.25rem;
618
+ padding: 0.25rem 0.875rem;
619
+ border: 1px solid var(--_line);
620
+ border-radius: 999px;
599
621
  color: var(--_accent);
600
- min-block-size: 1.5rem;
622
+ font-size: 0.9375rem;
623
+ text-decoration: none;
624
+ }
625
+ .semics-picker-nav a:hover {
626
+ border-color: var(--_accent);
601
627
  }
602
628
  .semics-picker {
603
629
  display: grid;
604
- gap: 0.5rem;
630
+ gap: 1rem;
605
631
  margin: 0;
606
- padding: 0.5rem 0.75rem 0.75rem;
607
- border: 1px solid var(--_border);
608
- border-radius: var(--_radius);
632
+ padding: 0;
633
+ border: 0;
609
634
  min-inline-size: 0;
610
635
  }
611
636
  .semics-picker p {
612
637
  margin: 0;
613
638
  }
639
+ /* Room between the days: cells 6px apart, buttons at least 44px tall. */
614
640
  .semics-calendar {
615
- inline-size: 100%;
616
- border-collapse: collapse;
641
+ inline-size: calc(100% + 0.75rem);
642
+ margin: -0.375rem;
643
+ border-collapse: separate;
644
+ border-spacing: 0.375rem;
617
645
  table-layout: fixed;
618
646
  text-align: center;
619
647
  }
620
648
  .semics-calendar th {
621
- padding-block: 0.25rem;
622
- font-weight: 400;
623
- font-size: 0.875rem;
649
+ padding-block: 0 0.25rem;
650
+ font-weight: 600;
651
+ font-size: 0.8125rem;
624
652
  color: var(--_muted);
625
653
  }
626
654
  .semics-calendar td {
627
- padding: 1px;
655
+ padding: 0;
628
656
  }
629
657
  .semics-booking-widget .semics-calendar button,
630
658
  .semics-booking-widget .semics-times button {
@@ -633,11 +661,24 @@ const when = (iso: string) => {
633
661
  border: 1px solid var(--_accent);
634
662
  background: var(--_bg);
635
663
  color: var(--_accent);
664
+ font-weight: 600;
665
+ }
666
+ .semics-booking-widget .semics-calendar button {
667
+ block-size: clamp(2.75rem, 2rem + 2vw, 3.25rem);
668
+ }
669
+ /* Hover is its own, lighter state: a tint and a ring, the text stays the accent; only the chosen day or time
670
+ is filled (T158). */
671
+ .semics-booking-widget .semics-calendar button:not([aria-pressed="true"], .semics-day-full):hover,
672
+ .semics-booking-widget .semics-times button:not([aria-disabled="true"], [aria-checked="true"]):hover {
673
+ background: var(--_tint);
674
+ box-shadow: inset 0 0 0 1px var(--_accent);
675
+ color: var(--_accent);
636
676
  }
637
677
  .semics-booking-widget .semics-calendar button.semics-day-full,
638
678
  .semics-booking-widget .semics-times button[aria-disabled="true"] {
639
- border-color: var(--_border);
679
+ border-color: var(--_line);
640
680
  color: var(--_muted);
681
+ font-weight: 400;
641
682
  text-decoration: line-through;
642
683
  }
643
684
  .semics-booking-widget .semics-times button[aria-disabled="true"] {
@@ -647,39 +688,50 @@ const when = (iso: string) => {
647
688
  .semics-booking-widget .semics-times button[aria-checked="true"] {
648
689
  background: var(--_accent);
649
690
  color: var(--_accent-fg);
691
+ box-shadow: none;
650
692
  }
651
693
  .semics-day-none {
652
- display: block;
653
- padding-block: 0.75rem;
694
+ display: grid;
695
+ place-items: center;
696
+ block-size: clamp(2.75rem, 2rem + 2vw, 3.25rem);
654
697
  color: var(--_muted);
655
698
  }
656
699
  .semics-times {
657
700
  display: grid;
658
- grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr));
701
+ grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
659
702
  gap: 0.5rem;
660
703
  }
661
704
  .semics-booking-widget .semics-times button {
662
705
  display: grid;
663
706
  justify-items: center;
707
+ padding: 0.5rem;
664
708
  }
665
709
  .semics-places {
666
- font-size: 0.875rem;
710
+ font-size: 0.8125rem;
711
+ font-weight: 400;
667
712
  }
668
713
  .semics-ticket {
669
714
  display: flex;
670
715
  flex-wrap: wrap;
671
716
  align-items: center;
672
717
  justify-content: space-between;
673
- gap: 0.5rem;
674
- padding-block: 0.25rem;
718
+ gap: 0.5rem 1rem;
719
+ padding-block: 0.5rem;
720
+ border-block-end: 1px solid var(--_line);
721
+ }
722
+ .semics-ticket:last-of-type {
723
+ border-block-end: 0;
675
724
  }
676
725
  .semics-ticket label {
677
726
  display: flex;
678
727
  flex-wrap: wrap;
679
- gap: 0 0.5rem;
728
+ gap: 0 0.75rem;
680
729
  flex: 1 1 10rem;
681
730
  min-inline-size: 0;
682
731
  }
732
+ .semics-ticket-name {
733
+ font-weight: 600;
734
+ }
683
735
  .semics-ticket-price,
684
736
  .semics-ticket-soldout {
685
737
  color: var(--_muted);
@@ -690,7 +742,10 @@ const when = (iso: string) => {
690
742
  .semics-field {
691
743
  display: grid;
692
744
  grid-template-columns: minmax(0, 1fr);
693
- gap: 0.25rem;
745
+ gap: 0.375rem;
746
+ }
747
+ .semics-field > label {
748
+ font-weight: 500;
694
749
  }
695
750
  .semics-field select {
696
751
  inline-size: 100%;
@@ -704,7 +759,7 @@ const when = (iso: string) => {
704
759
  }
705
760
  .semics-booking-widget input,
706
761
  .semics-booking-widget select {
707
- padding: 0.375rem 0.5rem;
762
+ padding: 0.5rem 0.75rem;
708
763
  border: 1px solid var(--_border);
709
764
  border-radius: var(--_radius);
710
765
  background: var(--_bg);
@@ -723,7 +778,7 @@ const when = (iso: string) => {
723
778
  display: none;
724
779
  }
725
780
  .semics-form-alert {
726
- padding: 0.5rem 0.75rem;
781
+ padding: 0.75rem 1rem;
727
782
  border: 1px solid var(--_error);
728
783
  border-radius: var(--_radius);
729
784
  }
@@ -731,16 +786,28 @@ const when = (iso: string) => {
731
786
  margin: 0;
732
787
  font-weight: 600;
733
788
  }
789
+ /* The summary above Book. */
734
790
  .semics-total {
791
+ display: flex;
792
+ flex-wrap: wrap;
793
+ justify-content: space-between;
794
+ gap: 0.25rem 1rem;
735
795
  margin: 0;
796
+ padding: 1rem 1.25rem;
797
+ border-radius: var(--_radius);
798
+ background: var(--_tint);
799
+ }
800
+ .semics-total strong {
801
+ font-size: 1.125rem;
736
802
  }
737
803
  .semics-booking-widget button {
738
804
  justify-self: start;
739
- padding: 0.5rem 1.5rem;
805
+ padding: 0.75rem 2rem;
740
806
  border: 0;
741
807
  border-radius: var(--_radius);
742
808
  background: var(--_accent);
743
809
  color: var(--_accent-fg);
810
+ font-weight: 600;
744
811
  cursor: pointer;
745
812
  }
746
813
  .semics-promo-row {
@@ -770,6 +837,14 @@ const when = (iso: string) => {
770
837
  outline: 3px solid var(--_accent);
771
838
  outline-offset: 2px;
772
839
  }
840
+ .semics-visually-hidden {
841
+ position: absolute;
842
+ inline-size: 1px;
843
+ block-size: 1px;
844
+ overflow: hidden;
845
+ clip-path: inset(50%);
846
+ white-space: nowrap;
847
+ }
773
848
  [hidden] {
774
849
  display: none !important;
775
850
  }
@@ -0,0 +1,80 @@
1
+ ---
2
+ // <CancelBooking>: the quiet "Cancel booking" action at the foot of the booking page (T157). The button only
3
+ // opens a confirmation (a `<details>`, no JavaScript needed); the form posts `intent=cancel` back to the page.
4
+ import { around, pickLocale, translator } from "../i18n/index";
5
+ import { zonedAt } from "./lib/list";
6
+
7
+ interface Props {
8
+ /** Where the cancel form posts. */
9
+ action: string;
10
+ /** The last moment to cancel, when there is one. */
11
+ cancelBy?: string | undefined;
12
+ /** The event's zone, for `cancelBy`. */
13
+ zone?: string | null | undefined;
14
+ locale?: string;
15
+ }
16
+
17
+ const { action, cancelBy, zone } = Astro.props;
18
+ const locale = pickLocale(Astro.props.locale, Astro.currentLocale);
19
+ const { t, lang, dir } = translator(locale);
20
+ const [cancelBefore, cancelAfter] = around(t("booking.cancelUntil"), "time");
21
+ ---
22
+ <details class="semics-events semics-cancel" lang={lang} dir={dir} data-testid="booking-cancel">
23
+ <summary>{t("booking.cancel")}</summary>
24
+ <form method="post" action={action}>
25
+ <input type="hidden" name="intent" value="cancel" />
26
+ {cancelBy && (
27
+ <p>
28
+ {cancelBefore}<time datetime={cancelBy}>{zonedAt(cancelBy, zone, locale)}</time>{cancelAfter}
29
+ </p>
30
+ )}
31
+ <p>{t("booking.cancelConfirm")}</p>
32
+ <button type="submit">{t("booking.cancelYes")}</button>
33
+ </form>
34
+ </details>
35
+
36
+ <style>
37
+ .semics-cancel {
38
+ margin-block: 1.5rem 0;
39
+ color: var(--events-fg, #1a1a1a);
40
+ }
41
+ .semics-cancel summary {
42
+ display: inline-flex;
43
+ align-items: center;
44
+ min-block-size: 2.75rem;
45
+ color: var(--events-muted, #4a4a4a);
46
+ text-decoration: underline;
47
+ text-underline-offset: 0.2em;
48
+ cursor: pointer;
49
+ }
50
+ .semics-cancel form {
51
+ margin-block-start: 0.5rem;
52
+ padding: 1rem 1.25rem;
53
+ border: 1px solid var(--events-error, #b3261e);
54
+ border-radius: var(--events-radius, 6px);
55
+ background: var(--events-bg, #ffffff);
56
+ }
57
+ .semics-cancel p {
58
+ margin: 0 0 0.75rem;
59
+ }
60
+ .semics-cancel button {
61
+ font: inherit;
62
+ min-block-size: 2.75rem;
63
+ padding: 0.5rem 1.25rem;
64
+ border: 1px solid var(--events-error, #b3261e);
65
+ border-radius: var(--events-radius, 6px);
66
+ background: var(--events-bg, #ffffff);
67
+ color: var(--events-error, #b3261e);
68
+ font-weight: 600;
69
+ cursor: pointer;
70
+ }
71
+ .semics-cancel :focus-visible {
72
+ outline: 3px solid var(--events-accent, #0b57d0);
73
+ outline-offset: 2px;
74
+ }
75
+ @media print {
76
+ .semics-cancel {
77
+ display: none;
78
+ }
79
+ }
80
+ </style>
@@ -0,0 +1,22 @@
1
+ ---
2
+ // The organiser at the foot of the plugins' own pages (T157): the site's name and, when the site gives one,
3
+ // its address (`page.brand.address`). It stays on a printed booking, where the brand bar is hidden.
4
+ import { pickLocale, translator } from "../i18n/index";
5
+ import type { PageBrand } from "./lib/page";
6
+
7
+ interface Props {
8
+ brand?: PageBrand | undefined;
9
+ locale?: string;
10
+ }
11
+
12
+ const { brand } = Astro.props;
13
+ const { t } = translator(pickLocale(Astro.props.locale, Astro.currentLocale));
14
+ ---
15
+ {
16
+ brand && (
17
+ <footer class="semics-page-organiser" data-testid="page-organiser">
18
+ <p>{t("booking.organiser", { name: brand.name })}</p>
19
+ {brand.address && <address>{brand.address}</address>}
20
+ </footer>
21
+ )
22
+ }
@@ -1,10 +1,12 @@
1
1
  ---
2
- // <TicketPass>: one attendee's ticket with the check-in code as text (EU-FR-07). With Events Pro the
3
- // core also sends the code's QR matrix (`qr`, T082), drawn here as an SVG for the door's camera; the
4
- // text code stays for typing it in. The code is grouped in fours for reading aloud; screen readers
5
- // get it character by character.
2
+ // <TicketPass>: one attendee's ticket with the check-in code (EU-FR-07). With Events Pro the core also sends the
3
+ // code's QR matrix (`qr`, T082), drawn here as an SVG for the door's camera. The code is the core's 43-character
4
+ // value, which door check-in matches exactly, so it is never shortened, only shown smaller (T158): with a QR the face
5
+ // of the pass shows none (the QR carries it) and "Show the code to type in" reveals it on screen, and a printed pass
6
+ // carries it on one small line under the QR; without a QR (Free) it is the way in and shows in full. The code is
7
+ // grouped in fours by spacing (the text stays the exact value); screen readers get it character by character.
6
8
  import { pickLocale, translator } from "../i18n/index";
7
- import { qrPath } from "./lib/pass";
9
+ import { codeGroups, qrPath } from "./lib/pass";
8
10
 
9
11
  interface Props {
10
12
  name: string;
@@ -22,38 +24,63 @@ const { t, lang, dir } = translator(pickLocale(Astro.props.locale, Astro.current
22
24
  const statusText =
23
25
  status === "pending" ? t("pass.status.pending") : status === "cancelled" ? t("pass.status.cancelled") : status;
24
26
  const spoken = code.replace(/[^A-Za-z0-9]/g, "").split("").join(" ");
27
+ const groups = codeGroups(code);
25
28
  const matrix = qrPath(qr);
26
29
  const box = matrix ? matrix.size + 8 : 0;
27
30
  ---
28
- <article class="semics-events semics-ticket-pass" lang={lang} dir={dir} data-testid="ticket-pass" data-status={status}>
29
- {event && <p class="semics-pass-event">{event}</p>}
30
- <h3 class="semics-pass-name">{name}</h3>
31
- {ticket && <p class="semics-pass-ticket">{ticket}</p>}
31
+ <article class="semics-events semics-ticket-pass" lang={lang} dir={dir} data-testid="ticket-pass" data-status={status} data-qr={matrix ? "" : undefined}>
32
32
  {matrix && (
33
- <svg
34
- class="semics-pass-qr"
35
- data-testid="ticket-qr"
36
- role="img"
37
- aria-label={t("pass.qr")}
38
- viewBox={`-4 -4 ${box} ${box}`}
39
- shape-rendering="crispEdges"
40
- >
41
- <rect x="-4" y="-4" width={box} height={box} fill="#ffffff" />
42
- <path d={matrix.d} fill="#000000" />
43
- </svg>
33
+ <div class="semics-pass-qr-box">
34
+ <svg
35
+ class="semics-pass-qr"
36
+ data-testid="ticket-qr"
37
+ role="img"
38
+ aria-label={t("pass.qr")}
39
+ viewBox={`-4 -4 ${box} ${box}`}
40
+ shape-rendering="crispEdges"
41
+ >
42
+ <rect x="-4" y="-4" width={box} height={box} fill="#ffffff" />
43
+ <path d={matrix.d} fill="#000000" />
44
+ </svg>
45
+ <p class="semics-pass-code-print" aria-hidden="true" data-testid="ticket-code-print">{groups.map((g) => <span>{g}</span>)}</p>
46
+ </div>
47
+ )}
48
+ <div class="semics-pass-text">
49
+ {event && <p class="semics-pass-event">{event}</p>}
50
+ <h3 class="semics-pass-name">{name}</h3>
51
+ {ticket && <p class="semics-pass-ticket">{ticket}</p>}
52
+ {!matrix && (
53
+ <>
54
+ <p class="semics-pass-code-label">{t("pass.code")}</p>
55
+ <p class="semics-pass-code">
56
+ <span aria-hidden="true" data-testid="ticket-code">{groups.map((g) => <span>{g}</span>)}</span>
57
+ <span class="semics-visually-hidden">{spoken}</span>
58
+ </p>
59
+ </>
60
+ )}
61
+ {status && status !== "valid" && <p class="semics-pass-status">{statusText}</p>}
62
+ </div>
63
+ {matrix && (
64
+ <details class="semics-pass-more">
65
+ <summary>{t("pass.codeShow")}</summary>
66
+ <p class="semics-pass-code">
67
+ <span aria-hidden="true" data-testid="ticket-code">{groups.map((g) => <span>{g}</span>)}</span>
68
+ <span class="semics-visually-hidden">{spoken}</span>
69
+ </p>
70
+ </details>
44
71
  )}
45
- <p class="semics-pass-code-label">{t("pass.code")}</p>
46
- <p class="semics-pass-code">
47
- <span aria-hidden="true" data-testid="ticket-code">{code}</span>
48
- <span class="semics-visually-hidden">{spoken}</span>
49
- </p>
50
- {status && status !== "valid" && <p class="semics-pass-status">{statusText}</p>}
51
72
  </article>
52
73
 
53
74
  <style>
75
+ /* The QR beside the attendee and the code (T157); stacked on a narrow screen. */
54
76
  .semics-ticket-pass {
55
77
  box-sizing: border-box;
56
- max-inline-size: 24rem;
78
+ display: flex;
79
+ flex-wrap: wrap;
80
+ align-items: center;
81
+ gap: 0.75rem 1.25rem;
82
+ max-inline-size: 32rem;
83
+ margin-block: 0 0.75rem;
57
84
  padding: 1rem;
58
85
  border: 2px dashed var(--events-border, #6b6b6b);
59
86
  border-radius: var(--events-radius, 6px);
@@ -61,6 +88,10 @@ const box = matrix ? matrix.size + 8 : 0;
61
88
  color: var(--events-fg, #1a1a1a);
62
89
  overflow-wrap: anywhere;
63
90
  }
91
+ .semics-pass-text {
92
+ flex: 1 1 12rem;
93
+ min-inline-size: 0;
94
+ }
64
95
  .semics-ticket-pass p,
65
96
  .semics-ticket-pass h3 {
66
97
  margin: 0 0 0.25rem;
@@ -70,19 +101,58 @@ const box = matrix ? matrix.size + 8 : 0;
70
101
  .semics-pass-code-label {
71
102
  color: var(--events-muted, #4a4a4a);
72
103
  }
104
+ .semics-pass-code-label {
105
+ font-size: 0.875rem;
106
+ }
107
+ .semics-pass-qr-box {
108
+ flex: none;
109
+ inline-size: min(100%, 10rem);
110
+ }
73
111
  /* Black on white in every theme: phone cameras read dark modules on a light ground. */
74
112
  .semics-pass-qr {
75
113
  display: block;
76
- inline-size: min(100%, 14rem);
114
+ inline-size: 100%;
77
115
  block-size: auto;
78
116
  aspect-ratio: 1;
79
- margin: 0.5rem 0;
80
117
  }
81
- .semics-pass-code {
118
+ /* Groups of four, spaced rather than separated, so the text is the exact code; a line breaks only between groups. */
119
+ .semics-pass-code,
120
+ .semics-pass-code-print {
82
121
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
83
- font-size: 1.75rem;
84
- letter-spacing: 0.1em;
85
- font-weight: 700;
122
+ overflow-wrap: normal;
123
+ }
124
+ .semics-pass-code {
125
+ font-size: 0.875rem;
126
+ line-height: 1.5;
127
+ letter-spacing: 0.02em;
128
+ font-weight: 600;
129
+ }
130
+ .semics-pass-code > [data-testid] {
131
+ display: block;
132
+ }
133
+ .semics-pass-code > [data-testid] > span,
134
+ .semics-pass-code-print > span {
135
+ display: inline-block;
136
+ margin-inline-end: 0.35em;
137
+ }
138
+ /* Without a QR the code is what the door types in: a little larger. */
139
+ .semics-ticket-pass:not([data-qr]) .semics-pass-code {
140
+ font-size: 0.9375rem;
141
+ }
142
+ /* The pass's full width, under the QR and the name, so the code fits one line on a desktop. */
143
+ .semics-pass-more {
144
+ flex: 1 1 100%;
145
+ }
146
+ .semics-pass-more summary {
147
+ color: var(--events-accent, #0b57d0);
148
+ font-size: 0.875rem;
149
+ cursor: pointer;
150
+ }
151
+ .semics-pass-more .semics-pass-code {
152
+ margin-block: 0.375rem 0;
153
+ }
154
+ .semics-pass-code-print {
155
+ display: none;
86
156
  }
87
157
  .semics-visually-hidden {
88
158
  position: absolute;
@@ -92,4 +162,32 @@ const box = matrix ? matrix.size + 8 : 0;
92
162
  clip-path: inset(50%);
93
163
  white-space: nowrap;
94
164
  }
165
+ @media print {
166
+ .semics-ticket-pass {
167
+ break-inside: avoid;
168
+ border-color: #000000;
169
+ color: #000000;
170
+ }
171
+ .semics-pass-qr-box {
172
+ inline-size: auto;
173
+ }
174
+ .semics-pass-qr {
175
+ inline-size: 35mm;
176
+ }
177
+ /* The QR's fallback for the door: the full code, one small line under it. */
178
+ .semics-pass-code-print {
179
+ display: block;
180
+ margin: 1.5mm 0 0;
181
+ font-size: 6.5pt;
182
+ line-height: 1.3;
183
+ white-space: nowrap;
184
+ }
185
+ .semics-pass-code-print > span {
186
+ margin-inline-end: 0.25em;
187
+ }
188
+ .semics-ticket-pass:not([data-qr]) .semics-pass-code {
189
+ font-size: 9pt;
190
+ white-space: nowrap;
191
+ }
192
+ }
95
193
  </style>