@ticketboothapp/booking 0.1.20 → 0.1.23

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.
Files changed (53) hide show
  1. package/package.json +2 -1
  2. package/src/assets/icons/minus.svg +7 -0
  3. package/src/assets/icons/partner-logos/getyourguide.svg +8 -0
  4. package/src/assets/icons/plus.svg +3 -0
  5. package/src/colours.css +23 -0
  6. package/src/components/BookingDetails.module.css +1591 -0
  7. package/src/components/BookingDetails.tsx +2264 -0
  8. package/src/components/PhoneInputWithCountry.module.css +131 -0
  9. package/src/components/PhoneInputWithCountry.tsx +44 -0
  10. package/src/components/PickupLocationDialog.module.css +360 -0
  11. package/src/components/PickupLocationDialog.tsx +357 -0
  12. package/src/components/PostBookingDependentAddOnUpsell.module.css +174 -0
  13. package/src/components/PostBookingDependentAddOnUpsell.tsx +407 -0
  14. package/src/components/button.css +245 -0
  15. package/src/components/button.tsx +152 -0
  16. package/src/components/colorable-svg.tsx +29 -0
  17. package/src/components/image.css +29 -0
  18. package/src/components/image.tsx +113 -0
  19. package/src/components/product-tag.module.css +30 -0
  20. package/src/components/product-tag.tsx +34 -0
  21. package/src/components/product-theme-pages/image-modal.tsx +248 -0
  22. package/src/components/product-theme-pages/photo-gallery.module.css +200 -0
  23. package/src/components/terms/TermsContent.tsx +178 -0
  24. package/src/components/value-pill.module.css +59 -0
  25. package/src/components/value-pill.tsx +46 -0
  26. package/src/constants/images.ts +556 -0
  27. package/src/constants/pill-values.ts +210 -0
  28. package/src/constants/products.ts +155 -0
  29. package/src/data/dap-descriptions/session-couples-families-friends.en.json +61 -0
  30. package/src/data/dap-descriptions/session-elopements.en.json +60 -0
  31. package/src/data/dap-descriptions/session-proposals.en.json +60 -0
  32. package/src/data/product-descriptions/afternoon-delight.en.json +35 -0
  33. package/src/data/product-descriptions/emerald-lake-escape.en.json +68 -0
  34. package/src/data/product-descriptions/lake-louise-adventure.en.json +74 -0
  35. package/src/data/product-descriptions/moraine-lake-adventure.en.json +78 -0
  36. package/src/data/product-descriptions/moraine-lake-sunrise-lake-louise-golden-hour.en.json +65 -0
  37. package/src/data/product-descriptions/moraine-lake-sunrise.en.json +64 -0
  38. package/src/data/product-descriptions/private-tour.en.json +80 -0
  39. package/src/data/product-descriptions/two-lakes-combo.en.json +65 -0
  40. package/src/data/products-config.json +101 -0
  41. package/src/hooks/useBookingSourceMetadataFromLocation.ts +21 -0
  42. package/src/hooks/useIsBookingLaunchLive.ts +49 -0
  43. package/src/lib/photo-packages.ts +75 -0
  44. package/src/providers/dependent-add-on-dialog-provider.tsx +105 -0
  45. package/src/radius.css +5 -0
  46. package/src/spacing.css +7 -0
  47. package/src/strings/en.json +1774 -0
  48. package/src/strings/es.json +1573 -0
  49. package/src/strings/fr.json +1573 -0
  50. package/src/strings/index.js +23 -0
  51. package/src/text-style.css +56 -0
  52. package/src/utils/currency-converter.ts +101 -0
  53. package/tsconfig.json +1 -1
@@ -0,0 +1,75 @@
1
+ import { ImageData, IMAGES } from "@/constants/images";
2
+ import type { PhotoDapSlug } from "@/lib/photo-dap-config";
3
+
4
+ export interface VideoSources {
5
+ src: string;
6
+ webm: string;
7
+ }
8
+
9
+ export interface PhotoPackage {
10
+ name: string;
11
+ bookingLink: string;
12
+ /** When set and env IDs are configured, opens dependent add-on booking for this catalog entry */
13
+ dapSlug?: PhotoDapSlug;
14
+ images: ImageData[];
15
+ startingPrice: string;
16
+ duration: string;
17
+ quantity: string;
18
+ videoUrl?: VideoSources;
19
+ }
20
+
21
+ export interface PhotoPackageSection {
22
+ name: string;
23
+ subTitle: string;
24
+ description: string;
25
+ photoPackages: PhotoPackage[];
26
+ }
27
+
28
+ export const PHOTO_PACKAGE_SECTIONS: PhotoPackageSection[] = [
29
+ {
30
+ name: 'Photo Sessions',
31
+ subTitle: 'Make it last forever',
32
+ description: "Capture the magic of Moraine Lake with a mini photo shoot; perfect for couples, families, or friends looking to take home more than just memories. Choose from 30, 60, or 90-minute sessions, with professionally edited photos included. Longer sessions can also be arranged with our private shuttle experiences for those wanting more time and flexibility.<br><br>Planning to propose or elope in one of the most breathtaking places on earth? Let us help you make it truly unforgettable. Our experienced local photographers know how to blend into the moment while capturing it beautifully - from the quiet emotion of a surprise proposal to the joy of an intimate celebration. Reach out to our team after booking your shoot & shuttle package reach to help you plan the perfect setting, timing, and details to make your moment picture-perfect and entirely your own.",
33
+ photoPackages: [
34
+ {
35
+ name: 'Couples, Families, & Friends',
36
+ bookingLink: '#book-now',
37
+ dapSlug: 'session-couples-families-friends',
38
+ images: [IMAGES.FAMILY_MORIANE_LAKE_ROCKPILE],
39
+ startingPrice: 'Starting at $499',
40
+ duration: '30 / 60 / 90 minutes',
41
+ quantity: '25 / 50 / 75 photos',
42
+ videoUrl: {
43
+ src: '/videos/sunrise-rockpile-tourist-vibe-group-shoot.mp4',
44
+ webm: '/videos/sunrise-rockpile-tourist-vibe-group-shoot.webm'
45
+ }
46
+ },
47
+ {
48
+ name: 'Elopements',
49
+ bookingLink: '#book-now',
50
+ dapSlug: 'session-elopements',
51
+ images: [IMAGES.MORAINE_LAKE_SUNRISE_ELOPEMENT],
52
+ startingPrice: 'Starting at $799',
53
+ duration: '30 / 60 / 90 minutes',
54
+ quantity: '25 / 50 / 75 photos',
55
+ videoUrl: {
56
+ src: '/videos/dancing-couple-elopement-shoot.mp4',
57
+ webm: '/videos/dancing-couple-elopement-shoot.webm'
58
+ }
59
+ },
60
+ {
61
+ name: 'Proposals',
62
+ bookingLink: '#book-now',
63
+ dapSlug: 'session-proposals',
64
+ images: [IMAGES.LAKE_LOUISE_KISS],
65
+ startingPrice: 'Starting at $799',
66
+ duration: '30 / 60 / 90 minutes',
67
+ quantity: '25 / 50 / 75 photos',
68
+ videoUrl: {
69
+ src: '/videos/proposal-moraine-lake-shoot.mp4',
70
+ webm: '/videos/proposal-moraine-lake-shoot.webm'
71
+ }
72
+ }
73
+ ]
74
+ }
75
+ ]
@@ -0,0 +1,105 @@
1
+ 'use client';
2
+
3
+ import {
4
+ createContext,
5
+ useCallback,
6
+ useContext,
7
+ useMemo,
8
+ useRef,
9
+ useState,
10
+ type ReactNode,
11
+ } from 'react';
12
+ import type { PhotoDapSlug } from '@/lib/photo-dap-config';
13
+
14
+ export type DependentAddOnProductOptionChoice = {
15
+ dependentAddOnProductOptionId: string;
16
+ label: string;
17
+ photosLabel?: string;
18
+ startingAtLabel?: string;
19
+ };
20
+
21
+ export type DependentAddOnDialogOpenPayload = {
22
+ /** Card title shown in dialog header */
23
+ productDisplayTitle: string;
24
+ dependentAddOnProductId: string;
25
+ /** Fixed catalog option (no picker) */
26
+ dependentAddOnProductOptionId?: string;
27
+ /** When provided without a fixed option id, user picks one (e.g. 30 / 60 / 90 min) */
28
+ productOptions?: DependentAddOnProductOptionChoice[];
29
+ /**
30
+ * Default session-length id when multiple `productOptions` exist (e.g. manage-booking upsell probed 30 min).
31
+ * Unlike `dependentAddOnProductOptionId`, this does not hide the picker — the user can switch length.
32
+ */
33
+ initialSelectedProductOptionId?: string;
34
+ /** Hero + grid images (DapFlowCollage); Bunny CDN IDs */
35
+ collageImageIds?: string[];
36
+ /** Loads expandable copy from dap-descriptions */
37
+ dapDescriptionSlug?: PhotoDapSlug;
38
+ /**
39
+ * From DAP catalog / TicketBooth product — days before the photo session for full-refund cancellation.
40
+ * Availability API may override when it returns the same field.
41
+ */
42
+ cancellationDaysBeforeSession: number;
43
+ /**
44
+ * Pre-fill primary booking reference (e.g. manage-booking upsell after shuttle checkout).
45
+ * Accepts short or bookRef_ form; dialog normalizes for display.
46
+ */
47
+ initialPrimaryBookingReference?: string;
48
+ /** Optional pre-fill for booking-owner verification on DAP availability checks. */
49
+ initialPrimaryBookingLastName?: string;
50
+ };
51
+
52
+ interface DependentAddOnDialogContextValue {
53
+ isOpen: boolean;
54
+ payload: DependentAddOnDialogOpenPayload | null;
55
+ open: (p: DependentAddOnDialogOpenPayload) => void;
56
+ close: () => void;
57
+ }
58
+
59
+ const DependentAddOnDialogContext =
60
+ createContext<DependentAddOnDialogContextValue | null>(null);
61
+
62
+ export function useDependentAddOnDialog() {
63
+ const ctx = useContext(DependentAddOnDialogContext);
64
+ if (!ctx) {
65
+ throw new Error(
66
+ 'useDependentAddOnDialog must be used within DependentAddOnDialogProvider'
67
+ );
68
+ }
69
+ return ctx;
70
+ }
71
+
72
+ export function DependentAddOnDialogProvider({ children }: { children: ReactNode }) {
73
+ const [isOpen, setIsOpen] = useState(false);
74
+ const [payload, setPayload] = useState<DependentAddOnDialogOpenPayload | null>(null);
75
+ const previouslyFocusedRef = useRef<HTMLElement | null>(null);
76
+
77
+ const open = useCallback((p: DependentAddOnDialogOpenPayload) => {
78
+ previouslyFocusedRef.current =
79
+ document.activeElement instanceof HTMLElement ? document.activeElement : null;
80
+ setPayload(p);
81
+ setIsOpen(true);
82
+ }, []);
83
+
84
+ const close = useCallback(() => {
85
+ setIsOpen(false);
86
+ setPayload(null);
87
+ const prev = previouslyFocusedRef.current;
88
+ requestAnimationFrame(() => {
89
+ if (prev && typeof prev.focus === 'function') {
90
+ prev.focus();
91
+ }
92
+ });
93
+ }, []);
94
+
95
+ const value = useMemo(
96
+ () => ({ isOpen, payload, open, close }),
97
+ [isOpen, payload, open, close]
98
+ );
99
+
100
+ return (
101
+ <DependentAddOnDialogContext.Provider value={value}>
102
+ {children}
103
+ </DependentAddOnDialogContext.Provider>
104
+ );
105
+ }
package/src/radius.css ADDED
@@ -0,0 +1,5 @@
1
+ :root {
2
+ --border-radius-small: 10px;
3
+ --border-radius-medium: 24px;
4
+ --border-radius-pill: 50px;
5
+ }
@@ -0,0 +1,7 @@
1
+ :root {
2
+ --spacing-small: 8px;
3
+ --spacing-medium: 16px;
4
+ --spacing-large: 32px;
5
+ --spacing-xlarge: 64px;
6
+ --spacing-xxlarge: 92px;
7
+ }