@semics-tech/emdash-events 1.0.0-rc.0 → 1.0.0-rc.10

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.
@@ -8,6 +8,7 @@ import { pluginId } from "virtual:semics-events/config";
8
8
  import { pickLocale, translator } from "../i18n/index";
9
9
  import { callPublicRoute } from "./lib/call";
10
10
  import { CHECKOUT_PATH, QTY_PREFIX } from "./lib/checkout-form";
11
+ import { pickerFetchFrom, pickerHref, pickerParam, pickerView, usesPicker } from "./lib/picker";
11
12
  import { PROMO_PATH, type PromoView, promoCookieName, promoView } from "./lib/promo";
12
13
  import { QUESTIONS_MARKER, questionControls } from "./lib/questions";
13
14
  import { readWaitlistState, WAITLIST_PATH, waitlistMessage } from "./lib/waitlist";
@@ -43,11 +44,15 @@ const { t, lang, dir } = translator(locale);
43
44
  const heading = Astro.props.heading ?? t("widget.heading");
44
45
  const fieldText = (field: Parameters<typeof fieldMessage>[0]) => fieldMessage(field, locale);
45
46
  let data = Astro.props.data;
47
+ // The day-then-time picker's page (T130): the first local day it shows, from this widget's own
48
+ // `booking_from.<eventId>` (T134: another picker on the page keeps its month).
49
+ const pickerStart = Astro.url.searchParams.get(pickerParam(eventId));
46
50
  if (!data) {
51
+ const from = pickerFetchFrom(pickerStart);
47
52
  const result = await callPublicRoute<PublicEvent>(Astro, {
48
53
  path: "public/event",
49
54
  pluginId,
50
- body: { eventId },
55
+ body: { eventId, ...(from ? { from } : {}) },
51
56
  });
52
57
  if (result.ok) data = result.data;
53
58
  }
@@ -78,13 +83,23 @@ const ticketTypes = [
78
83
  ...(takesCodes ? (promo?.hiddenTypes ?? []) : []).filter((t) => !listed.has(t.id)),
79
84
  ] as PublicEvent["ticketTypes"];
80
85
  const onSale = data?.status === "on_sale" && ticketTypes.length > 0;
86
+ // Many dates a day, or a slot schedule (T130): a month calendar of days, then the day's times. Without
87
+ // JavaScript the same month's dates show as a select grouped by day.
88
+ const zone = data?.timezone ?? "UTC";
89
+ const picker = usesPicker(data, zone)
90
+ ? pickerView(occurrences, { zone, locale, start: pickerStart, now: Date.now(), more: data?.more === true })
91
+ : null;
92
+ const pickerIds = new Set(picker?.days.flatMap((d) => d.slots.map((s) => s.id)));
93
+ const monthId = `${id}-month`;
81
94
  // The waitlist (T081): offered when the core takes one and the tickets, or some dates, are sold out.
82
- const fullDates = occurrences.filter((o) => o.available === 0);
95
+ const fullDates = occurrences.filter((o) => o.available === 0 && (!picker || pickerIds.has(o.id)));
83
96
  const waitlist =
84
97
  onSale &&
85
98
  data?.waitlist === true &&
86
99
  (ticketTypes.every((t) => t.available === 0) || fullDates.length > 0);
87
- const waitlistDates = ticketTypes.every((t) => t.available === 0) ? occurrences : fullDates;
100
+ const waitlistDates = ticketTypes.every((t) => t.available === 0)
101
+ ? occurrences.filter((o) => !picker || pickerIds.has(o.id))
102
+ : fullDates;
88
103
  const waitlistOutcome = readWaitlistState(Astro.url, eventId);
89
104
  // Custom attendee questions are Events Pro's (T080): `public/event` lists them only on a Pro core.
90
105
  const questions = questionControls(data?.questions, id, state.fields, locale);
@@ -129,7 +144,105 @@ const when = (iso: string) => {
129
144
  <input type="hidden" name="returnTo" value={returnTo} />
130
145
  <input type="hidden" name="idempotencyKey" value={newIdempotencyKey()} />
131
146
 
132
- {occurrences.length > 0 && (
147
+ {picker && (
148
+ <div class="semics-field semics-picker-field">
149
+ <input type="hidden" name="needsOccurrence" value="1" />
150
+ <div class="semics-field" data-picker-fallback>
151
+ <label for={`${id}-occurrence`}>{t("widget.date")}</label>
152
+ <select
153
+ id={`${id}-occurrence`}
154
+ name="occurrenceId"
155
+ required
156
+ aria-invalid={invalid("occurrence")}
157
+ aria-describedby={[monthId, errId("occurrence")].join(" ")}
158
+ >
159
+ <option value="">{t("widget.chooseDate")}</option>
160
+ {picker.days.map((day) => (
161
+ <optgroup label={day.label}>
162
+ {day.slots.map((s) => (
163
+ <option value={s.id} disabled={s.full}>{s.label}</option>
164
+ ))}
165
+ </optgroup>
166
+ ))}
167
+ </select>
168
+ </div>
169
+ <nav class="semics-picker-nav" aria-labelledby={monthId}>
170
+ <p id={monthId} class="semics-picker-month">{picker.month.label}</p>
171
+ {picker.prev && <a href={pickerHref(Astro.url, picker.prev, eventId)} rel="nofollow">{t("widget.picker.earlier")}</a>}
172
+ {picker.next && <a href={pickerHref(Astro.url, picker.next, eventId)} rel="nofollow">{t("widget.picker.later")}</a>}
173
+ </nav>
174
+ {picker.days.length === 0 && <p data-testid="picker-none">{t("widget.picker.none")}</p>}
175
+ <fieldset
176
+ class="semics-picker"
177
+ data-picker
178
+ data-field="occurrence"
179
+ data-testid="booking-picker"
180
+ hidden
181
+ aria-invalid={invalid("occurrence")}
182
+ aria-describedby={errId("occurrence")}
183
+ >
184
+ <legend class="semics-visually-hidden">{t("widget.date")}</legend>
185
+ <table role="grid" class="semics-calendar" aria-labelledby={monthId}>
186
+ <thead>
187
+ <tr>
188
+ {picker.weekdays.map((w) => (
189
+ <th scope="col" abbr={w.long}>{w.short}</th>
190
+ ))}
191
+ </tr>
192
+ </thead>
193
+ <tbody>
194
+ {picker.weeks.map((week) => (
195
+ <tr>
196
+ {week.map((cell) => (
197
+ <td>
198
+ {cell && cell.slots.length > 0 ? (
199
+ <button
200
+ type="button"
201
+ class={cell.open ? undefined : "semics-day-full"}
202
+ data-day={cell.key}
203
+ data-n={String(cell.day)}
204
+ aria-label={cell.buttonLabel}
205
+ aria-pressed="false"
206
+ tabindex={cell.key === picker.focusDay ? "0" : "-1"}
207
+ >
208
+ {cell.day}
209
+ </button>
210
+ ) : cell ? (
211
+ <span class="semics-day-none">{cell.day}</span>
212
+ ) : null}
213
+ </td>
214
+ ))}
215
+ </tr>
216
+ ))}
217
+ </tbody>
218
+ </table>
219
+ <p class="semics-hint" data-picker-hint>{t("widget.picker.hint")}</p>
220
+ {picker.days.map((day) => (
221
+ <div class="semics-times" role="radiogroup" data-times={day.key} aria-label={t("widget.picker.times", { date: day.label })} hidden>
222
+ {day.slots.map((s, i) => (
223
+ <button
224
+ type="button"
225
+ role="radio"
226
+ aria-checked="false"
227
+ aria-disabled={s.full ? "true" : undefined}
228
+ aria-label={s.label}
229
+ data-occurrence={s.id}
230
+ tabindex={i === day.slots.findIndex((x) => !x.full) ? "0" : "-1"}
231
+ >
232
+ <span>{s.time}</span>
233
+ {s.places && <span class="semics-places">{s.places}</span>}
234
+ </button>
235
+ ))}
236
+ </div>
237
+ ))}
238
+ </fieldset>
239
+ <p class="semics-field-error" id={errId("occurrence")} data-error-for="occurrence" data-message={fieldText("occurrence")}>
240
+ {bad("occurrence") ? fieldText("occurrence") : ""}
241
+ </p>
242
+ </div>
243
+ )}
244
+
245
+ {!picker && occurrences.length > 0 && (
133
246
  <div class="semics-field">
134
247
  <input type="hidden" name="needsOccurrence" value="1" />
135
248
  <label for={`${id}-occurrence`}>{t("widget.date")}</label>
@@ -326,9 +439,9 @@ const when = (iso: string) => {
326
439
 
327
440
  {siteKey && (
328
441
  <>
329
- <div class="cf-turnstile" data-sitekey={siteKey}></div>
330
- {/* 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). */}
331
- <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>
332
445
  <noscript>
333
446
  <p class="semics-needs-js" data-testid="booking-needs-js">{t("widget.needsJs")}</p>
334
447
  </noscript>
@@ -380,8 +493,8 @@ const when = (iso: string) => {
380
493
  </div>
381
494
  {siteKey && (
382
495
  <>
383
- <div class="cf-turnstile" data-sitekey={siteKey}></div>
384
- <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>
385
498
  </>
386
499
  )}
387
500
  <button type="submit" class="semics-secondary">{t("waitlist.button")}</button>
@@ -394,25 +507,34 @@ const when = (iso: string) => {
394
507
 
395
508
  <script>
396
509
  import "../client/booking.ts";
510
+ import "../client/picker.ts";
397
511
  </script>
398
512
 
513
+
399
514
  <style>
515
+ /* One card with even, generous padding; groups read as sections with small headings, not boxes (T157). */
400
516
  .semics-booking-widget {
401
517
  --_fg: var(--events-fg, #1a1a1a);
402
518
  --_muted: var(--events-muted, #4a4a4a);
403
519
  --_bg: var(--events-bg, #ffffff);
404
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));
405
523
  --_accent: var(--events-accent, #0b57d0);
406
524
  --_accent-fg: var(--events-accent-fg, #ffffff);
407
525
  --_error: var(--events-error, #b3261e);
408
526
  --_radius: var(--events-radius, 6px);
527
+ --_pad: clamp(1.25rem, 0.75rem + 2.5vw, 2rem);
409
528
  box-sizing: border-box;
410
- max-inline-size: 36rem;
411
- padding: 1rem;
412
- border: 1px solid var(--_border);
413
- 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);
414
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);
415
536
  color: var(--_fg);
537
+ line-height: 1.5;
416
538
  overflow-wrap: anywhere;
417
539
  }
418
540
  .semics-booking-widget *,
@@ -421,37 +543,40 @@ const when = (iso: string) => {
421
543
  box-sizing: border-box;
422
544
  }
423
545
  .semics-booking-widget h2 {
424
- margin: 0 0 0.75rem;
425
- font-size: 1.25rem;
546
+ margin: 0 0 1.25rem;
547
+ font-size: 1.375rem;
548
+ line-height: 1.25;
426
549
  }
427
550
  .semics-booking-widget form {
428
551
  display: grid;
429
552
  grid-template-columns: minmax(0, 1fr);
430
- gap: 0.75rem;
553
+ gap: 1.25rem;
431
554
  }
432
555
  .semics-booking-widget .semics-waitlist {
433
- margin-block-start: 1.25rem;
434
- padding-block-start: 1rem;
435
- 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);
436
559
  }
437
560
  .semics-waitlist h3,
438
561
  .semics-waitlist p {
439
562
  margin: 0;
440
563
  }
441
- .semics-tickets {
442
- margin: 0;
443
- padding: 0.5rem 0.75rem;
444
- border: 1px solid var(--_border);
445
- border-radius: var(--_radius);
446
- 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);
447
572
  }
573
+ .semics-tickets,
448
574
  .semics-questions {
449
575
  display: grid;
450
576
  gap: 0.75rem;
451
577
  margin: 0;
452
- padding: 0.5rem 0.75rem 0.75rem;
453
- border: 1px solid var(--_border);
454
- border-radius: var(--_radius);
578
+ padding: 0;
579
+ border: 0;
455
580
  min-inline-size: 0;
456
581
  }
457
582
  .semics-check {
@@ -466,25 +591,149 @@ const when = (iso: string) => {
466
591
  min-block-size: 1.25rem;
467
592
  inline-size: 1.25rem;
468
593
  margin: 0;
594
+ accent-color: var(--_accent);
469
595
  }
470
596
  .semics-hint {
471
597
  color: var(--_muted);
472
598
  }
599
+ .semics-picker-field {
600
+ gap: 0.75rem;
601
+ }
602
+ .semics-picker-nav {
603
+ max-inline-size: var(--events-calendar-max, 26rem);
604
+ display: flex;
605
+ flex-wrap: wrap;
606
+ align-items: center;
607
+ gap: 0.5rem;
608
+ }
609
+ .semics-picker-month {
610
+ margin: 0;
611
+ margin-inline-end: auto;
612
+ font-size: 1.125rem;
613
+ font-weight: 700;
614
+ }
615
+ .semics-picker-nav a {
616
+ display: inline-flex;
617
+ align-items: center;
618
+ min-block-size: 2.25rem;
619
+ padding: 0.25rem 0.875rem;
620
+ border: 1px solid var(--_line);
621
+ border-radius: 999px;
622
+ color: var(--_accent);
623
+ font-size: 0.9375rem;
624
+ text-decoration: none;
625
+ }
626
+ .semics-picker-nav a:hover {
627
+ border-color: var(--_accent);
628
+ }
629
+ .semics-picker {
630
+ display: grid;
631
+ gap: 1rem;
632
+ margin: 0;
633
+ padding: 0;
634
+ border: 0;
635
+ min-inline-size: 0;
636
+ }
637
+ .semics-picker p {
638
+ margin: 0;
639
+ }
640
+ /* Room between the days: cells 6px apart, buttons at least 44px tall. The calendar keeps its size in a wide host column:
641
+ at most `--events-calendar-max` (26rem, days about 54px) while the rest of the widget fills the column (T159). */
642
+ .semics-calendar {
643
+ inline-size: calc(min(100%, var(--events-calendar-max, 26rem)) + 0.75rem);
644
+ margin: -0.375rem;
645
+ border-collapse: separate;
646
+ border-spacing: 0.375rem;
647
+ table-layout: fixed;
648
+ text-align: center;
649
+ }
650
+ .semics-calendar th {
651
+ padding-block: 0 0.25rem;
652
+ font-weight: 600;
653
+ font-size: 0.8125rem;
654
+ color: var(--_muted);
655
+ }
656
+ .semics-calendar td {
657
+ padding: 0;
658
+ }
659
+ .semics-booking-widget .semics-calendar button,
660
+ .semics-booking-widget .semics-times button {
661
+ inline-size: 100%;
662
+ padding: 0.25rem;
663
+ border: 1px solid var(--_accent);
664
+ background: var(--_bg);
665
+ color: var(--_accent);
666
+ font-weight: 600;
667
+ }
668
+ .semics-booking-widget .semics-calendar button {
669
+ block-size: clamp(2.75rem, 2rem + 2vw, 3.25rem);
670
+ }
671
+ /* Hover is its own, lighter state: a tint and a ring, the text stays the accent; only the chosen day or time
672
+ is filled (T158). */
673
+ .semics-booking-widget .semics-calendar button:not([aria-pressed="true"], .semics-day-full):hover,
674
+ .semics-booking-widget .semics-times button:not([aria-disabled="true"], [aria-checked="true"]):hover {
675
+ background: var(--_tint);
676
+ box-shadow: inset 0 0 0 1px var(--_accent);
677
+ color: var(--_accent);
678
+ }
679
+ .semics-booking-widget .semics-calendar button.semics-day-full,
680
+ .semics-booking-widget .semics-times button[aria-disabled="true"] {
681
+ border-color: var(--_line);
682
+ color: var(--_muted);
683
+ font-weight: 400;
684
+ text-decoration: line-through;
685
+ }
686
+ .semics-booking-widget .semics-times button[aria-disabled="true"] {
687
+ cursor: not-allowed;
688
+ }
689
+ .semics-booking-widget .semics-calendar button[aria-pressed="true"],
690
+ .semics-booking-widget .semics-times button[aria-checked="true"] {
691
+ background: var(--_accent);
692
+ color: var(--_accent-fg);
693
+ box-shadow: none;
694
+ }
695
+ .semics-day-none {
696
+ display: grid;
697
+ place-items: center;
698
+ block-size: clamp(2.75rem, 2rem + 2vw, 3.25rem);
699
+ color: var(--_muted);
700
+ }
701
+ .semics-times {
702
+ display: grid;
703
+ grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
704
+ gap: 0.5rem;
705
+ }
706
+ .semics-booking-widget .semics-times button {
707
+ display: grid;
708
+ justify-items: center;
709
+ padding: 0.5rem;
710
+ }
711
+ .semics-places {
712
+ font-size: 0.8125rem;
713
+ font-weight: 400;
714
+ }
473
715
  .semics-ticket {
474
716
  display: flex;
475
717
  flex-wrap: wrap;
476
718
  align-items: center;
477
719
  justify-content: space-between;
478
- gap: 0.5rem;
479
- padding-block: 0.25rem;
720
+ gap: 0.5rem 1rem;
721
+ padding-block: 0.5rem;
722
+ border-block-end: 1px solid var(--_line);
723
+ }
724
+ .semics-ticket:last-of-type {
725
+ border-block-end: 0;
480
726
  }
481
727
  .semics-ticket label {
482
728
  display: flex;
483
729
  flex-wrap: wrap;
484
- gap: 0 0.5rem;
730
+ gap: 0 0.75rem;
485
731
  flex: 1 1 10rem;
486
732
  min-inline-size: 0;
487
733
  }
734
+ .semics-ticket-name {
735
+ font-weight: 600;
736
+ }
488
737
  .semics-ticket-price,
489
738
  .semics-ticket-soldout {
490
739
  color: var(--_muted);
@@ -495,7 +744,10 @@ const when = (iso: string) => {
495
744
  .semics-field {
496
745
  display: grid;
497
746
  grid-template-columns: minmax(0, 1fr);
498
- gap: 0.25rem;
747
+ gap: 0.375rem;
748
+ }
749
+ .semics-field > label {
750
+ font-weight: 500;
499
751
  }
500
752
  .semics-field select {
501
753
  inline-size: 100%;
@@ -509,7 +761,7 @@ const when = (iso: string) => {
509
761
  }
510
762
  .semics-booking-widget input,
511
763
  .semics-booking-widget select {
512
- padding: 0.375rem 0.5rem;
764
+ padding: 0.5rem 0.75rem;
513
765
  border: 1px solid var(--_border);
514
766
  border-radius: var(--_radius);
515
767
  background: var(--_bg);
@@ -528,7 +780,7 @@ const when = (iso: string) => {
528
780
  display: none;
529
781
  }
530
782
  .semics-form-alert {
531
- padding: 0.5rem 0.75rem;
783
+ padding: 0.75rem 1rem;
532
784
  border: 1px solid var(--_error);
533
785
  border-radius: var(--_radius);
534
786
  }
@@ -536,16 +788,28 @@ const when = (iso: string) => {
536
788
  margin: 0;
537
789
  font-weight: 600;
538
790
  }
791
+ /* The summary above Book. */
539
792
  .semics-total {
793
+ display: flex;
794
+ flex-wrap: wrap;
795
+ justify-content: space-between;
796
+ gap: 0.25rem 1rem;
540
797
  margin: 0;
798
+ padding: 1rem 1.25rem;
799
+ border-radius: var(--_radius);
800
+ background: var(--_tint);
801
+ }
802
+ .semics-total strong {
803
+ font-size: 1.125rem;
541
804
  }
542
805
  .semics-booking-widget button {
543
806
  justify-self: start;
544
- padding: 0.5rem 1.5rem;
807
+ padding: 0.75rem 2rem;
545
808
  border: 0;
546
809
  border-radius: var(--_radius);
547
810
  background: var(--_accent);
548
811
  color: var(--_accent-fg);
812
+ font-weight: 600;
549
813
  cursor: pointer;
550
814
  }
551
815
  .semics-promo-row {
@@ -575,6 +839,14 @@ const when = (iso: string) => {
575
839
  outline: 3px solid var(--_accent);
576
840
  outline-offset: 2px;
577
841
  }
842
+ .semics-visually-hidden {
843
+ position: absolute;
844
+ inline-size: 1px;
845
+ block-size: 1px;
846
+ overflow: hidden;
847
+ clip-path: inset(50%);
848
+ white-space: nowrap;
849
+ }
578
850
  [hidden] {
579
851
  display: none !important;
580
852
  }
@@ -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,18 @@
1
+ ---
2
+ // The site's name or logo at the top of the plugins' own pages (`/booking`, `/_events/waiver`), linking
3
+ // home: those pages run outside the site's layout (`eventsIntegration({ page: { brand } })`).
4
+ import type { PageBrand } from "./lib/page";
5
+
6
+ interface Props {
7
+ brand?: PageBrand | undefined;
8
+ }
9
+
10
+ const { brand } = Astro.props;
11
+ ---
12
+ {
13
+ brand && (
14
+ <header class="semics-page-brand">
15
+ <a href={brand.href ?? "/"}>{brand.logo ? <img src={brand.logo} alt={brand.name} /> : brand.name}</a>
16
+ </header>
17
+ )
18
+ }
@@ -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
+ }