@ticketboothapp/booking 0.1.23 → 1.2.24

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 (158) hide show
  1. package/package.json +2 -29
  2. package/src/index.ts +0 -79
  3. package/tsconfig.json +2 -8
  4. package/src/assets/icons/minus.svg +0 -7
  5. package/src/assets/icons/partner-logos/getyourguide.svg +0 -8
  6. package/src/assets/icons/plus.svg +0 -3
  7. package/src/colours.css +0 -23
  8. package/src/components/BookingDetails.module.css +0 -1591
  9. package/src/components/BookingDetails.tsx +0 -2264
  10. package/src/components/BookingWidget.tsx +0 -302
  11. package/src/components/ManageBookingView.tsx +0 -437
  12. package/src/components/PhoneInputWithCountry.module.css +0 -131
  13. package/src/components/PhoneInputWithCountry.tsx +0 -44
  14. package/src/components/PickupLocationDialog.module.css +0 -360
  15. package/src/components/PickupLocationDialog.tsx +0 -357
  16. package/src/components/PostBookingDependentAddOnUpsell.module.css +0 -174
  17. package/src/components/PostBookingDependentAddOnUpsell.tsx +0 -407
  18. package/src/components/booking/AddOnsSection.module.css +0 -10
  19. package/src/components/booking/AddOnsSection.tsx +0 -184
  20. package/src/components/booking/AdminPaymentChoiceModal.tsx +0 -98
  21. package/src/components/booking/BookingDialog.module.css +0 -643
  22. package/src/components/booking/BookingDialog.tsx +0 -356
  23. package/src/components/booking/BookingFlow.tsx +0 -4385
  24. package/src/components/booking/BookingFlowCollage.module.css +0 -148
  25. package/src/components/booking/BookingFlowCollage.tsx +0 -184
  26. package/src/components/booking/BookingFlowPlaceholder.module.css +0 -27
  27. package/src/components/booking/BookingFlowPlaceholder.tsx +0 -25
  28. package/src/components/booking/BookingFlowPreview.tsx +0 -51
  29. package/src/components/booking/BookingProductGrid.module.css +0 -359
  30. package/src/components/booking/BookingProductGrid.tsx +0 -497
  31. package/src/components/booking/Calendar.module.css +0 -616
  32. package/src/components/booking/Calendar.tsx +0 -1123
  33. package/src/components/booking/CancellationPolicySelector.module.css +0 -124
  34. package/src/components/booking/CancellationPolicySelector.tsx +0 -142
  35. package/src/components/booking/ChangeBookingDialog.tsx +0 -562
  36. package/src/components/booking/CheckoutForm.module.css +0 -244
  37. package/src/components/booking/CheckoutForm.tsx +0 -364
  38. package/src/components/booking/CheckoutModal.tsx +0 -451
  39. package/src/components/booking/CurrencySwitcher.tsx +0 -81
  40. package/src/components/booking/DapFlowCollage.tsx +0 -88
  41. package/src/components/booking/DapTourDescription.tsx +0 -35
  42. package/src/components/booking/DependentAddOnBookingDialog.tsx +0 -1350
  43. package/src/components/booking/DependentAddOnPaymentForm.tsx +0 -124
  44. package/src/components/booking/ErrorBoundary.tsx +0 -63
  45. package/src/components/booking/InfoTooltip.tsx +0 -108
  46. package/src/components/booking/ItineraryBox.module.css +0 -258
  47. package/src/components/booking/ItineraryBox.tsx +0 -550
  48. package/src/components/booking/ItineraryBuilder.tsx +0 -82
  49. package/src/components/booking/ItineraryPlaceholder.module.css +0 -45
  50. package/src/components/booking/ItineraryPlaceholder.tsx +0 -26
  51. package/src/components/booking/MealDrinkAddOnSelector.tsx +0 -338
  52. package/src/components/booking/PickupLocationSelector.module.css +0 -124
  53. package/src/components/booking/PickupLocationSelector.tsx +0 -1566
  54. package/src/components/booking/PickupTimeSelector.module.css +0 -134
  55. package/src/components/booking/PickupTimeSelector.tsx +0 -112
  56. package/src/components/booking/PriceBreakdown.tsx +0 -154
  57. package/src/components/booking/PriceSummary.tsx +0 -234
  58. package/src/components/booking/PrivateShuttleBookingFlow.module.css +0 -357
  59. package/src/components/booking/PrivateShuttleBookingFlow.tsx +0 -2662
  60. package/src/components/booking/PromoCodeInput.module.css +0 -166
  61. package/src/components/booking/PromoCodeInput.tsx +0 -99
  62. package/src/components/booking/ReturnTimeSelector.module.css +0 -173
  63. package/src/components/booking/ReturnTimeSelector.tsx +0 -145
  64. package/src/components/booking/TermsAcceptance.tsx +0 -111
  65. package/src/components/booking/TicketSelector.module.css +0 -164
  66. package/src/components/booking/TicketSelector.tsx +0 -199
  67. package/src/components/booking/TourDescription.module.css +0 -304
  68. package/src/components/booking/TourDescription.tsx +0 -273
  69. package/src/components/booking/booking-flow-ui.ts +0 -38
  70. package/src/components/booking/booking-flow.css +0 -944
  71. package/src/components/button.css +0 -245
  72. package/src/components/button.tsx +0 -152
  73. package/src/components/colorable-svg.tsx +0 -29
  74. package/src/components/image.css +0 -29
  75. package/src/components/image.tsx +0 -113
  76. package/src/components/partner/PartnerBookingPage.module.css +0 -130
  77. package/src/components/partner/PartnerBookingPage.tsx +0 -390
  78. package/src/components/partner/PartnerBookingPageWithBrowserMetadata.tsx +0 -45
  79. package/src/components/product-tag.module.css +0 -30
  80. package/src/components/product-tag.tsx +0 -34
  81. package/src/components/product-theme-pages/image-modal.tsx +0 -248
  82. package/src/components/product-theme-pages/photo-gallery.module.css +0 -200
  83. package/src/components/terms/TermsContent.tsx +0 -178
  84. package/src/components/value-pill.module.css +0 -59
  85. package/src/components/value-pill.tsx +0 -46
  86. package/src/constants/images.ts +0 -556
  87. package/src/constants/pill-values.ts +0 -210
  88. package/src/constants/products.ts +0 -155
  89. package/src/contexts/AvailabilitiesCacheContext.tsx +0 -125
  90. package/src/contexts/BookingAppContext.tsx +0 -134
  91. package/src/contexts/CompanyContext.tsx +0 -70
  92. package/src/data/dap-descriptions/session-couples-families-friends.en.json +0 -61
  93. package/src/data/dap-descriptions/session-elopements.en.json +0 -60
  94. package/src/data/dap-descriptions/session-proposals.en.json +0 -60
  95. package/src/data/product-descriptions/afternoon-delight.en.json +0 -35
  96. package/src/data/product-descriptions/emerald-lake-escape.en.json +0 -68
  97. package/src/data/product-descriptions/lake-louise-adventure.en.json +0 -74
  98. package/src/data/product-descriptions/moraine-lake-adventure.en.json +0 -78
  99. package/src/data/product-descriptions/moraine-lake-sunrise-lake-louise-golden-hour.en.json +0 -65
  100. package/src/data/product-descriptions/moraine-lake-sunrise.en.json +0 -64
  101. package/src/data/product-descriptions/private-tour.en.json +0 -80
  102. package/src/data/product-descriptions/two-lakes-combo.en.json +0 -65
  103. package/src/data/products-config.json +0 -101
  104. package/src/hooks/useBookingSourceMetadataFromLocation.ts +0 -21
  105. package/src/hooks/useIsBookingLaunchLive.ts +0 -49
  106. package/src/lib/analytics.ts +0 -197
  107. package/src/lib/booking/booking-source.ts +0 -51
  108. package/src/lib/booking/checkout-breakdown.ts +0 -69
  109. package/src/lib/booking/correlation-id.ts +0 -46
  110. package/src/lib/booking/i18n/config.ts +0 -21
  111. package/src/lib/booking/i18n/index.tsx +0 -144
  112. package/src/lib/booking/i18n/messages/en.json +0 -236
  113. package/src/lib/booking/i18n/messages/fr.json +0 -236
  114. package/src/lib/booking/itinerary-display.ts +0 -36
  115. package/src/lib/booking/itinerary-labels.ts +0 -70
  116. package/src/lib/booking/location-calculations.ts +0 -43
  117. package/src/lib/booking/location-utils.ts +0 -165
  118. package/src/lib/booking/map-utils.ts +0 -153
  119. package/src/lib/booking/marker-icons.ts +0 -113
  120. package/src/lib/booking/normalize-booking-product-id.ts +0 -21
  121. package/src/lib/booking/pickup-location-types.ts +0 -25
  122. package/src/lib/booking/places-api.ts +0 -154
  123. package/src/lib/booking/pricing.ts +0 -466
  124. package/src/lib/booking/product-option-id.ts +0 -35
  125. package/src/lib/booking/source-metadata.ts +0 -226
  126. package/src/lib/booking/sunday-week.ts +0 -14
  127. package/src/lib/booking/theme.ts +0 -83
  128. package/src/lib/booking/trace-context.ts +0 -62
  129. package/src/lib/booking/utils.ts +0 -9
  130. package/src/lib/booking-api.ts +0 -1793
  131. package/src/lib/booking-constants.ts +0 -23
  132. package/src/lib/booking-ref.ts +0 -13
  133. package/src/lib/booking-types.ts +0 -36
  134. package/src/lib/currency.ts +0 -81
  135. package/src/lib/dap-descriptions.ts +0 -50
  136. package/src/lib/dap-itinerary-preview.ts +0 -315
  137. package/src/lib/dependent-add-on-api.ts +0 -434
  138. package/src/lib/env.ts +0 -96
  139. package/src/lib/firebase.ts +0 -20
  140. package/src/lib/job-application-api.ts +0 -83
  141. package/src/lib/manage-booking-embed-print.ts +0 -16
  142. package/src/lib/manage-booking-post-checkout.ts +0 -68
  143. package/src/lib/photo-dap-config.ts +0 -228
  144. package/src/lib/photo-packages.ts +0 -75
  145. package/src/lib/pickup/map-utils.ts +0 -56
  146. package/src/lib/pickup/marker-icons.ts +0 -19
  147. package/src/lib/product-descriptions.ts +0 -66
  148. package/src/lib/products-config.ts +0 -73
  149. package/src/providers/booking-dialog-provider.tsx +0 -282
  150. package/src/providers/dependent-add-on-dialog-provider.tsx +0 -105
  151. package/src/radius.css +0 -5
  152. package/src/spacing.css +0 -7
  153. package/src/strings/en.json +0 -1774
  154. package/src/strings/es.json +0 -1573
  155. package/src/strings/fr.json +0 -1573
  156. package/src/strings/index.js +0 -23
  157. package/src/text-style.css +0 -56
  158. package/src/utils/currency-converter.ts +0 -101
@@ -1,282 +0,0 @@
1
- 'use client';
2
-
3
- import {
4
- createContext,
5
- useContext,
6
- useState,
7
- useCallback,
8
- useEffect,
9
- useMemo,
10
- useRef,
11
- type ReactNode,
12
- } from 'react';
13
- import { getOrCreateBookingCorrelationId } from '@/lib/booking/correlation-id';
14
- import { withBookingOutboundHeaders } from '@/lib/booking/trace-context';
15
- import {
16
- isSuspiciousBookingProductId,
17
- normalizeBookingProductId,
18
- } from '@/lib/booking/normalize-booking-product-id';
19
- import { ENV } from '@/lib/env';
20
-
21
- /** Filter IDs for the product grid. Must match BookingProductGrid FILTER_IDS. */
22
- export type ProductGridFilterId =
23
- | 'all'
24
- | 'sunrise'
25
- | 'moraine-lake'
26
- | 'lake-louise'
27
- | 'emerald-lake'
28
- | 'private';
29
-
30
- export type BookingScreen =
31
- | { type: 'product-grid'; filterId?: ProductGridFilterId }
32
- | { type: 'book-flow'; productId: string };
33
-
34
- export type ProductGridRestoreState = {
35
- expandedId: string | null;
36
- scrollTop: number;
37
- };
38
-
39
- export const OPEN_BOOKING_FOR_PRODUCT = 'openBookingForProduct';
40
- export const OPEN_BOOKING_WITH_FILTER = 'openBookingWithFilter';
41
- export const BOOKING_FLOW_ABANDON_EVENT = 'ticketbooth:booking-flow-abandon';
42
-
43
- function reportSuspiciousBookingProductId(original: string, sanitized: string): void {
44
- if (typeof window === 'undefined') return;
45
- const telemetryEndpoint = `${ENV.API_URL}/1/client-telemetry`;
46
- const correlationId = getOrCreateBookingCorrelationId();
47
- const event = {
48
- event: 'BOOKING_DIALOG_SUSPICIOUS_PRODUCT_ID',
49
- endpoint: '/booking-open',
50
- correlationId,
51
- originalProductId: original,
52
- sanitizedProductId: sanitized,
53
- pageUrl: window.location.href,
54
- referrer: document.referrer || null,
55
- userAgent: window.navigator.userAgent,
56
- occurredAt: new Date().toISOString(),
57
- stack: new Error('Suspicious booking productId input').stack ?? null,
58
- };
59
- fetch(telemetryEndpoint, {
60
- method: 'POST',
61
- headers: withBookingOutboundHeaders({ 'Content-Type': 'application/json' }),
62
- body: JSON.stringify(event),
63
- keepalive: true,
64
- }).catch(() => {
65
- // Never throw from telemetry reporting.
66
- });
67
- }
68
-
69
- interface BookingDialogContextValue {
70
- isOpen: boolean;
71
- open: (options?: { filterId?: ProductGridFilterId }) => void;
72
- openForProduct: (productId: string) => void;
73
- close: (options?: { reason?: 'user' | 'completed' }) => void;
74
- stack: BookingScreen[];
75
- push: (
76
- screen: BookingScreen,
77
- options?: { productGridState?: ProductGridRestoreState }
78
- ) => void;
79
- pop: () => void;
80
- canGoBack: boolean;
81
- productGridRestoreState: ProductGridRestoreState | null;
82
- clearProductGridRestoreState: () => void;
83
- }
84
-
85
- const BookingDialogContext = createContext<BookingDialogContextValue | null>(
86
- null
87
- );
88
-
89
- export function useBookingDialog() {
90
- const ctx = useContext(BookingDialogContext);
91
- if (!ctx) {
92
- throw new Error('useBookingDialog must be used within BookingDialogProvider');
93
- }
94
- return ctx;
95
- }
96
-
97
- interface BookingDialogProviderProps {
98
- children: ReactNode;
99
- }
100
-
101
- export function BookingDialogProvider({ children }: BookingDialogProviderProps) {
102
- const [isOpen, setIsOpen] = useState(false);
103
- const [stack, setStack] = useState<BookingScreen[]>([{ type: 'product-grid' }]);
104
- const [productGridRestoreState, setProductGridRestoreState] = useState<
105
- ProductGridRestoreState | null
106
- >(null);
107
- const previouslyFocusedRef = useRef<HTMLElement | null>(null);
108
-
109
- const open = useCallback((options?: { filterId?: ProductGridFilterId }) => {
110
- previouslyFocusedRef.current =
111
- document.activeElement instanceof HTMLElement
112
- ? document.activeElement
113
- : null;
114
- setStack([{ type: 'product-grid', filterId: options?.filterId }]);
115
- setProductGridRestoreState(null);
116
- setIsOpen(true);
117
- }, []);
118
-
119
- const openForProduct = useCallback((productId: string) => {
120
- const sanitizedProductId = normalizeBookingProductId(productId);
121
- if (!sanitizedProductId) return;
122
- if (isSuspiciousBookingProductId(productId)) {
123
- console.warn('[booking-dialog] Suspicious productId input detected', {
124
- original: productId,
125
- sanitized: sanitizedProductId,
126
- });
127
- reportSuspiciousBookingProductId(productId, sanitizedProductId);
128
- }
129
- previouslyFocusedRef.current =
130
- document.activeElement instanceof HTMLElement
131
- ? document.activeElement
132
- : null;
133
- setStack([{ type: 'book-flow', productId: sanitizedProductId }]);
134
- setProductGridRestoreState(null);
135
- setIsOpen(true);
136
- }, []);
137
-
138
- const close = useCallback((options?: { reason?: 'user' | 'completed' }) => {
139
- if (options?.reason !== 'completed' && typeof window !== 'undefined') {
140
- window.dispatchEvent(new Event(BOOKING_FLOW_ABANDON_EVENT));
141
- }
142
- const prev = previouslyFocusedRef.current;
143
- setIsOpen(false);
144
- requestAnimationFrame(() => {
145
- if (prev && typeof prev.focus === 'function') {
146
- prev.focus();
147
- }
148
- });
149
- }, []);
150
-
151
- const push = useCallback(
152
- (
153
- screen: BookingScreen,
154
- options?: { productGridState?: ProductGridRestoreState }
155
- ) => {
156
- if (options?.productGridState) {
157
- setProductGridRestoreState(options.productGridState);
158
- }
159
- setStack((prev) => [...prev, screen]);
160
- },
161
- []
162
- );
163
-
164
- const pop = useCallback(() => {
165
- setStack((prev) => (prev.length > 1 ? prev.slice(0, -1) : prev));
166
- }, []);
167
-
168
- const clearProductGridRestoreState = useCallback(() => {
169
- setProductGridRestoreState(null);
170
- }, []);
171
-
172
- useEffect(() => {
173
- const handleOpen = () => open();
174
- window.addEventListener('openSimpleModal', handleOpen);
175
- return () => window.removeEventListener('openSimpleModal', handleOpen);
176
- }, [open]);
177
-
178
- useEffect(() => {
179
- const handleOpenWithFilter = (e: Event) => {
180
- const customEvent = e as CustomEvent<{ filterId: ProductGridFilterId }>;
181
- const filterId = customEvent.detail?.filterId;
182
- if (filterId) {
183
- open({ filterId });
184
- } else {
185
- open();
186
- }
187
- };
188
- window.addEventListener(OPEN_BOOKING_WITH_FILTER, handleOpenWithFilter);
189
- return () =>
190
- window.removeEventListener(OPEN_BOOKING_WITH_FILTER, handleOpenWithFilter);
191
- }, [open]);
192
-
193
- useEffect(() => {
194
- const handleOpenForProduct = (e: Event) => {
195
- const customEvent = e as CustomEvent<{ productId: string }>;
196
- const productId = customEvent.detail?.productId;
197
- if (productId) {
198
- openForProduct(productId);
199
- }
200
- };
201
- window.addEventListener(OPEN_BOOKING_FOR_PRODUCT, handleOpenForProduct);
202
- return () =>
203
- window.removeEventListener(OPEN_BOOKING_FOR_PRODUCT, handleOpenForProduct);
204
- }, [openForProduct]);
205
-
206
- // When user clicks back after Stripe redirect to /manage-booking, the page may be
207
- // restored from bfcache with the modal still open. Close it on restore.
208
- useEffect(() => {
209
- const handlePageShow = (e: PageTransitionEvent) => {
210
- if (e.persisted && isOpen) {
211
- close();
212
- }
213
- };
214
- window.addEventListener('pageshow', handlePageShow);
215
- return () => window.removeEventListener('pageshow', handlePageShow);
216
- }, [isOpen, close]);
217
-
218
- useEffect(() => {
219
- const handleBookNowClick = (e: Event) => {
220
- const target = e.target as HTMLElement;
221
- const link = target.closest('a[href^="#book-now"]') as HTMLAnchorElement | null;
222
- if (link) {
223
- e.preventDefault();
224
- const href = link.getAttribute('href') ?? '';
225
- // #book-now/filter/moraine-lake -> open with filter
226
- const filterMatch = href.match(/^#book-now\/filter\/([a-z0-9-]+)$/i);
227
- if (filterMatch) {
228
- const filterId = filterMatch[1] as ProductGridFilterId;
229
- if (['sunrise', 'moraine-lake', 'lake-louise', 'emerald-lake', 'private'].includes(filterId)) {
230
- open({ filterId });
231
- return;
232
- }
233
- }
234
- // #book-now/product-slug -> open that product
235
- const productMatch = href.match(/^#book-now\/([a-z0-9-]+)$/i);
236
- const productSlug = productMatch?.[1];
237
- if (productSlug) {
238
- openForProduct(productSlug);
239
- } else {
240
- open();
241
- }
242
- }
243
- };
244
- document.addEventListener('click', handleBookNowClick);
245
- return () => document.removeEventListener('click', handleBookNowClick);
246
- }, [open, openForProduct]);
247
-
248
- const canGoBack = stack.length > 1;
249
-
250
- const value = useMemo(
251
- () => ({
252
- isOpen,
253
- open,
254
- openForProduct,
255
- close,
256
- stack,
257
- push,
258
- pop,
259
- canGoBack,
260
- productGridRestoreState,
261
- clearProductGridRestoreState,
262
- }),
263
- [
264
- isOpen,
265
- open,
266
- openForProduct,
267
- close,
268
- stack,
269
- push,
270
- pop,
271
- canGoBack,
272
- productGridRestoreState,
273
- clearProductGridRestoreState,
274
- ]
275
- );
276
-
277
- return (
278
- <BookingDialogContext.Provider value={value}>
279
- {children}
280
- </BookingDialogContext.Provider>
281
- );
282
- }
@@ -1,105 +0,0 @@
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 DELETED
@@ -1,5 +0,0 @@
1
- :root {
2
- --border-radius-small: 10px;
3
- --border-radius-medium: 24px;
4
- --border-radius-pill: 50px;
5
- }
package/src/spacing.css DELETED
@@ -1,7 +0,0 @@
1
- :root {
2
- --spacing-small: 8px;
3
- --spacing-medium: 16px;
4
- --spacing-large: 32px;
5
- --spacing-xlarge: 64px;
6
- --spacing-xxlarge: 92px;
7
- }