@getmicdrop/venue-calendar 4.2.34 → 4.2.35

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 (104) hide show
  1. package/README.md +809 -809
  2. package/dist/{ArrowLeftIcon-D2dcPIYB.js → ArrowLeftIcon-DS-NEije.js} +1 -1
  3. package/dist/{Badge-Bk1dnG89.js → Badge-DIHnRZlw.js} +1 -1
  4. package/dist/{BlockPlaceholder-DJLtnBDw.js → BlockPlaceholder-Dy9fStDr.js} +1 -1
  5. package/dist/{Calendar-CzvJjOKf.js → Calendar-CXwhGAmC.js} +6 -6
  6. package/dist/{CalendarFoundryView-DWjYFSEw.js → CalendarFoundryView-BRurhscw.js} +29 -29
  7. package/dist/{CalendarIcon-CkJFNFxp.js → CalendarIcon-CvZ-GUH_.js} +1 -1
  8. package/dist/{CartView-DidUQzO-.js → CartView-DT8DlMqQ.js} +19 -19
  9. package/dist/{Checkout-eIj6xGgL.js → Checkout-D3VqG09o.js} +15 -15
  10. package/dist/{Checkout-1NyqTUI8.js → Checkout-UU9C7CXV.js} +18 -18
  11. package/dist/{CheckoutTimer-DFIHUIZl.js → CheckoutTimer-2WEgppW1.js} +3 -3
  12. package/dist/{ChevronDownIcon-rsVUoX0r.js → ChevronDownIcon-DXbr-7H6.js} +1 -1
  13. package/dist/{ClockIcon-CIwbKXZX.js → ClockIcon-Dyx1LMo7.js} +1 -1
  14. package/dist/{CloseIcon-B7HoEcON.js → CloseIcon-NMHzwT75.js} +1 -1
  15. package/dist/{CollectionView-Dt3NmdBh.js → CollectionView-DyMB_bPY.js} +7 -7
  16. package/dist/{Event-B0hDsxnc.js → Event-CXCOnkmi.js} +22 -22
  17. package/dist/EventPage-HlhaVqRG.js +981 -0
  18. package/dist/{Heading-CQlZrwry.js → Heading-DcZtRBSB.js} +1 -1
  19. package/dist/{Image-T6dKIfNx.js → Image-BZGbFJLw.js} +1 -1
  20. package/dist/{Input-8KhoOdg-.js → Input-Cgdxdj6y.js} +1 -1
  21. package/dist/{MailIcon-CSR5vhKU.js → MailIcon-D34sBBQX.js} +1 -1
  22. package/dist/{Modal-D3Otve45.js → Modal-BvT64ak1.js} +2 -2
  23. package/dist/{ModalFooter-fv8mC75I.js → ModalFooter-DM1dyl4S.js} +2 -2
  24. package/dist/{PasswordInput-B_6cNrlw.js → PasswordInput-BNKrzXNm.js} +1 -1
  25. package/dist/{ScarcityBadge-CtHuWSRt.js → ScarcityBadge-DmbmsFlY.js} +5 -5
  26. package/dist/{SeriesPage-BFYmtgoi.js → SeriesPage-BXKz7PJV.js} +4 -4
  27. package/dist/{Spinner-fFAXvj_B.js → Spinner-gpYLD9h6.js} +1 -1
  28. package/dist/{Success-BIVQOUqu.js → Success-DieJd6sx.js} +18 -18
  29. package/dist/{TagIcon-Do5sN8xR.js → TagIcon-Q7BC2QeQ.js} +1 -1
  30. package/dist/{ViewTicketsEmbed-CbbE-8EX.js → ViewTicketsEmbed-DqwHARj0.js} +7 -7
  31. package/dist/{WarningCircleIcon-DuqytsVW.js → WarningCircleIcon-Dxi6_NlN.js} +1 -1
  32. package/dist/{WarningTriIcon-CW-j3Vwq.js → WarningTriIcon-BVNO82pk.js} +1 -1
  33. package/dist/{__SKIP_PATHS__-Chv7DW7h.js → __SKIP_PATHS__-BZ2V4IU4.js} +1 -1
  34. package/dist/api/api.cjs +1 -1
  35. package/dist/api/api.mjs +28 -34
  36. package/dist/api/types.d.ts +554 -554
  37. package/dist/api/waitlist.d.ts +6 -1
  38. package/dist/{colors-BND7shPA.js → colors-B3NG0RHG.js} +55 -61
  39. package/dist/{constants-BYtFptYp.js → constants-DqKf8bUn.js} +1 -1
  40. package/dist/{copyToClipboard-CcwaUGGt.js → copyToClipboard-CLo_2bfp.js} +1 -1
  41. package/dist/{de-CgHrjezX.js → de-tOW1Ez0s.js} +6 -0
  42. package/dist/{defaultLabels-CGMGBy-u.js → defaultLabels-D_9CneL4.js} +6 -0
  43. package/dist/{es-D6ThNLUc.js → es-DrYewQpd.js} +6 -0
  44. package/dist/{event-CbAGNxgd.js → event-CFDG8adb.js} +1 -1
  45. package/dist/{event-transform-DnvOiDVn.js → event-transform-jJPAKgYX.js} +4 -4
  46. package/dist/{eventStatusStream-BIn6Dzkw.js → eventStatusStream-wmEyQSgV.js} +1 -1
  47. package/dist/{fr-W0OOohju.js → fr-Bs9xnPu6.js} +6 -0
  48. package/dist/{href-D2-tmkMF.js → href-BfMcUXhM.js} +2 -2
  49. package/dist/{i18n-4k6uF1EX.js → i18n-BgkKrB4o.js} +5 -5
  50. package/dist/i18n-DK3npqzN.js +28 -0
  51. package/dist/{id-xgAFN1EH.js → id-BLwvLobz.js} +6 -0
  52. package/dist/{it-BhuT9BcE.js → it-CQ_Y8YK3.js} +6 -0
  53. package/dist/{ja-yca07ASz.js → ja-CeudRJqE.js} +6 -0
  54. package/dist/{ko-Pfftd2u0.js → ko-DFwVxd-1.js} +6 -0
  55. package/dist/{labels-Cs7xp4ug.js → labels-BHqxbbw9.js} +1 -1
  56. package/dist/locales/{4.2.34 → 4.2.35}/main/de.js +1 -1
  57. package/dist/locales/{4.2.34 → 4.2.35}/main/es.js +1 -1
  58. package/dist/locales/{4.2.34 → 4.2.35}/main/fr.js +1 -1
  59. package/dist/locales/{4.2.34 → 4.2.35}/main/id.js +1 -1
  60. package/dist/locales/{4.2.34 → 4.2.35}/main/it.js +1 -1
  61. package/dist/locales/{4.2.34 → 4.2.35}/main/ja.js +1 -1
  62. package/dist/locales/{4.2.34 → 4.2.35}/main/ko.js +1 -1
  63. package/dist/locales/{4.2.34 → 4.2.35}/main/nl.js +1 -1
  64. package/dist/locales/{4.2.34 → 4.2.35}/main/pl.js +1 -1
  65. package/dist/locales/{4.2.34 → 4.2.35}/main/pt-br.js +1 -1
  66. package/dist/locales/{4.2.34 → 4.2.35}/main/tr.js +1 -1
  67. package/dist/locales/{4.2.34 → 4.2.35}/main/zh.js +1 -1
  68. package/dist/{modalManager.svelte-vILq6Thx.js → modalManager.svelte-CrrDshW7.js} +2 -2
  69. package/dist/{nl-CQEhSA2l.js → nl-CYc0p85Y.js} +6 -0
  70. package/dist/{order-totals-CSDXY65z.js → order-totals-D0JKhd70.js} +3 -3
  71. package/dist/{orders-CH2nnS3m.js → orders-CCWPQsWb.js} +1 -1
  72. package/dist/{phoneUtils-BtJ3FhMK.js → phoneUtils-aQHGh8C_.js} +1 -1
  73. package/dist/{pixels-BK7PGnme.js → pixels-M2q8HRk_.js} +2 -2
  74. package/dist/{pl-CyWqKYE8.js → pl-BSqAasUa.js} +6 -0
  75. package/dist/{promo-Cy4LPBAC.js → promo-CKvS9lia.js} +1 -1
  76. package/dist/{pt-br-BC2I7f8-.js → pt-br-CZs8_gFN.js} +6 -0
  77. package/dist/seo/types.d.ts +156 -156
  78. package/dist/{serverTotals-C3VhWitQ.js → serverTotals-DGd3p1s5.js} +1 -1
  79. package/dist/{shareCopyFeedback.svelte-DTl5jJ2n.js → shareCopyFeedback.svelte-DTOJruVM.js} +4 -4
  80. package/dist/{showcase-state-options-CeCdn8_C.js → showcase-state-options-Da3jPUQb.js} +1 -1
  81. package/dist/{to-event-card-props-BmsDr8T3.js → to-event-card-props-B5bsYKP4.js} +3 -3
  82. package/dist/{tr-CNjaJc_1.js → tr-O80C2r5C.js} +6 -0
  83. package/dist/types/index.d.ts +509 -509
  84. package/dist/{utils-pF15CnBe.js → utils-RE2aEa_D.js} +2 -2
  85. package/dist/venue-calendar.es.js +30 -30
  86. package/dist/venue-calendar.iife.js +27 -27
  87. package/dist/venue-calendar.umd.js +49 -49
  88. package/dist/{zh-DOeb3_A1.js → zh-ydknixkJ.js} +6 -0
  89. package/package.json +220 -220
  90. package/src/lib/theme.js +222 -222
  91. package/dist/EventPage-De-7chl3.js +0 -970
  92. package/dist/i18n-FnFHQ5QU.js +0 -28
  93. /package/dist/locales/{4.2.34 → 4.2.35}/flow/de.js +0 -0
  94. /package/dist/locales/{4.2.34 → 4.2.35}/flow/es.js +0 -0
  95. /package/dist/locales/{4.2.34 → 4.2.35}/flow/fr.js +0 -0
  96. /package/dist/locales/{4.2.34 → 4.2.35}/flow/id.js +0 -0
  97. /package/dist/locales/{4.2.34 → 4.2.35}/flow/it.js +0 -0
  98. /package/dist/locales/{4.2.34 → 4.2.35}/flow/ja.js +0 -0
  99. /package/dist/locales/{4.2.34 → 4.2.35}/flow/ko.js +0 -0
  100. /package/dist/locales/{4.2.34 → 4.2.35}/flow/nl.js +0 -0
  101. /package/dist/locales/{4.2.34 → 4.2.35}/flow/pl.js +0 -0
  102. /package/dist/locales/{4.2.34 → 4.2.35}/flow/pt-br.js +0 -0
  103. /package/dist/locales/{4.2.34 → 4.2.35}/flow/tr.js +0 -0
  104. /package/dist/locales/{4.2.34 → 4.2.35}/flow/zh.js +0 -0
@@ -1,509 +1,509 @@
1
- /**
2
- * TypeScript definitions for @getmicdrop/venue-calendar
3
- */
4
-
5
- // ============================================================================
6
- // Event Data Types
7
- // ============================================================================
8
-
9
- /**
10
- * Event data structure returned from the API or passed to components
11
- */
12
- export interface EventData {
13
- id: string | number;
14
- name: string;
15
- date: string;
16
- startDateTime?: string;
17
- endDateTime?: string;
18
- image?: string;
19
- description?: string;
20
- venueId?: string | number;
21
- venueID?: string | number;
22
- timeZone?: string;
23
- location?: string;
24
- slug?: string;
25
- status?: 'on_sale' | 'selling_fast' | 'sold_out';
26
- }
27
-
28
- /**
29
- * Ticket data structure
30
- */
31
- export interface TicketData {
32
- id: string | number;
33
- name: string;
34
- price: number;
35
- quantity?: number;
36
- description?: string;
37
- available?: number;
38
- }
39
-
40
- // ============================================================================
41
- // Theme Types
42
- // ============================================================================
43
-
44
- /**
45
- * Theme color configuration using HSL format
46
- * All values should be HSL strings like "217 91% 60%"
47
- */
48
- export interface ThemeColors {
49
- /** Brand primary color */
50
- brandPrimary: string;
51
- /** Primary text color */
52
- textPrimary: string;
53
- /** Secondary text color */
54
- textSecondary: string;
55
- /** Tertiary text color */
56
- textTertiary: string;
57
- /** Primary background color */
58
- bgPrimary: string;
59
- /** Secondary background color */
60
- bgSecondary: string;
61
- /** Quaternary background color */
62
- bgQuaternary: string;
63
- /** Primary stroke/border color */
64
- strokePrimary: string;
65
- /** Secondary stroke/border color */
66
- strokeSecondary: string;
67
- /** On sale status color */
68
- statusOnSale: string;
69
- /** Selling fast status color */
70
- statusSellingFast: string;
71
- /** Sold out status color */
72
- statusSoldOut: string;
73
- /** Today's date background color */
74
- todayBg: string;
75
- /** Today's date text color */
76
- todayText: string;
77
- /** Event dot color for on sale */
78
- eventDotOnSale: string;
79
- /** Event dot color for selling fast */
80
- eventDotSellingFast: string;
81
- /** Event dot color for sold out */
82
- eventDotSoldOut: string;
83
- /** Hover background color */
84
- hoverBg: string;
85
- /** Focus ring color */
86
- focusRing: string;
87
- }
88
-
89
- /**
90
- * Preset themes collection
91
- */
92
- export interface Themes {
93
- light: ThemeColors;
94
- dark: ThemeColors;
95
- highContrast: ThemeColors;
96
- }
97
-
98
- // ============================================================================
99
- // View Option Types
100
- // ============================================================================
101
-
102
- /**
103
- * View option for the calendar view switcher
104
- */
105
- export interface ViewOption {
106
- id: number;
107
- text: string;
108
- /** @deprecated Not rendered — the view switcher shows `text` only. Kept optional for backward compatibility. */
109
- icon?: string;
110
- ariaLabel?: string;
111
- }
112
-
113
- export type ViewType = 'list' | 'gallery' | 'calendar';
114
-
115
- // ============================================================================
116
- // Component Props Interfaces
117
- // ============================================================================
118
-
119
- /**
120
- * Base options for all init functions
121
- */
122
- export interface BaseInitOptions {
123
- /** CSS selector or HTMLElement to mount the component */
124
- target: string | HTMLElement;
125
- /** The venue ID (optional, default: '1') */
126
- venueId?: string;
127
- /** The organization ID (optional, default: '1') */
128
- organizationId?: string;
129
- /**
130
- * BCP-47 locale tag (e.g. 'es', 'es-MX'). Selects the bundled locale for the
131
- * label catalogue; undefined falls back to the browser locale, then English.
132
- * Threaded through every init entry point (vc#693).
133
- */
134
- locale?: string;
135
- }
136
-
137
- /**
138
- * Options for initializing the Venue Calendar component
139
- */
140
- export interface CalendarProps extends BaseInitOptions {
141
- /** Initial view: 'list', 'gallery', or 'calendar' (default: 'calendar') */
142
- view?: ViewType;
143
- /** Array of event objects to display */
144
- events?: EventData[];
145
- /** Whether to show view switcher (default: true) */
146
- showViewOptions?: boolean;
147
- /** Whether to show month navigation (default: true) */
148
- showMonthSwitcher?: boolean;
149
- /** Current month store (Svelte writable store) */
150
- currentMonth?: import('svelte/store').Writable<number>;
151
- /** Current year store (Svelte writable store) */
152
- currentYear?: import('svelte/store').Writable<number>;
153
- /** Handler for navigating to next month */
154
- handleNext?: () => void;
155
- /** Handler for navigating to previous month */
156
- handlePrev?: () => void;
157
- /** Callback function when an event is clicked */
158
- onEventClick?: (_event: EventData) => void;
159
- /**
160
- * Render the show detail / series / collection IN-PLACE on click + deep
161
- * link instead of navigating the host page (default: true for embeds).
162
- * Pass false to keep the host responsible for navigation, or supply your
163
- * own onEventClick to take over click handling entirely.
164
- */
165
- inlineEntityViews?: boolean;
166
- }
167
-
168
- /**
169
- * Options for initializing the (inline) Event Page.
170
- */
171
- export interface EventPageOptions extends BaseInitOptions {
172
- /** The event ID to display (the page self-fetches), or pass rawEvent. */
173
- eventId?: string | number;
174
- /** Pre-fetched raw event payload (skips the self-fetch). */
175
- rawEvent?: any;
176
- /** Event slug (cosmetic). */
177
- slug?: string;
178
- /** Callback when the back control is clicked. */
179
- onNavigateBack?: () => void;
180
- /** Callback when proceeding to checkout (cart already created). */
181
- onNavigateToCart?: (
182
- _id: string | number,
183
- _slug: string,
184
- _rawEvent: any
185
- ) => void;
186
- /** Callback when a series occurrence is clicked. */
187
- onBuyTickets?: (_eventId: string | number, _slug: string) => void;
188
- /** i18n label overrides. */
189
- labels?: Record<string, string>;
190
- }
191
-
192
- /**
193
- * Success callback data from checkout
194
- */
195
- export interface CheckoutSuccessData {
196
- orderId?: string;
197
- eventId?: string;
198
- event?: EventData;
199
- }
200
-
201
- /**
202
- * Options for initializing the Checkout View
203
- */
204
- export interface CheckoutOptions extends BaseInitOptions {
205
- /** The event ID to display */
206
- eventId: string;
207
- /** The event slug (optional) */
208
- slug?: string;
209
- /** Array of available tickets (optional) */
210
- availableTickets?: TicketData[];
211
- /** Callback when checkout is successful */
212
- onSuccess?: (_data: CheckoutSuccessData) => void;
213
- /** Callback when navigating to success page */
214
- onNavigateToSuccess?: (_data: CheckoutSuccessData) => void;
215
- }
216
-
217
- /**
218
- * Options for initializing the Success View
219
- */
220
- export interface SuccessViewOptions extends BaseInitOptions {
221
- /** The event ID (optional) */
222
- eventId?: string;
223
- /** The event slug (optional) */
224
- slug?: string;
225
- /** The order ID (optional) */
226
- orderId?: string;
227
- }
228
-
229
- /**
230
- * Alias for CalendarProps for backward compatibility
231
- */
232
- export type InitOptions = CalendarProps;
233
-
234
- // ============================================================================
235
- // Svelte Component Instance
236
- // ============================================================================
237
-
238
- /**
239
- * Svelte component instance returned by init functions
240
- */
241
- export interface SvelteComponentInstance {
242
- /** Destroy the component and clean up */
243
- $destroy?: () => void;
244
- /** Internal cleanup for success listener */
245
- _successCleanup?: () => void;
246
- }
247
-
248
- // ============================================================================
249
- // Exported Functions
250
- // ============================================================================
251
-
252
- /**
253
- * Initialize the Venue Calendar component
254
- * @param options - Configuration options
255
- * @returns The Svelte component instance, or null if target not found
256
- */
257
- export function initVenueCalendar(
258
- _options: CalendarProps
259
- ): SvelteComponentInstance | null;
260
-
261
- /**
262
- * Initialize the (inline) Event Page.
263
- * @param options - Configuration options
264
- * @returns The Svelte component instance, or null if target not found / no event
265
- */
266
- export function initEventPage(
267
- _options: EventPageOptions
268
- ): SvelteComponentInstance | null;
269
-
270
- /**
271
- * Initialize the Checkout View
272
- * @param options - Configuration options
273
- * @returns The Svelte component instance, or null if target not found or eventId missing
274
- */
275
- export function initCheckoutView(
276
- _options: CheckoutOptions
277
- ): SvelteComponentInstance | null;
278
-
279
- /**
280
- * Alias for initCheckoutView
281
- */
282
- export const initCheckout: typeof initCheckoutView;
283
-
284
- /**
285
- * Initialize the Success View
286
- * @param options - Configuration options
287
- * @returns The Svelte component instance, or null if target not found
288
- */
289
- export function initSuccessView(
290
- _options: SuccessViewOptions
291
- ): SvelteComponentInstance | null;
292
-
293
- /**
294
- * Alias for initSuccessView
295
- */
296
- export const initSuccess: typeof initSuccessView;
297
-
298
- /**
299
- * Auto-mount: Automatically finds and mounts calendar to elements with class 'micdrop-calendar-container'
300
- */
301
- export function autoMount(): void;
302
-
303
- // ============================================================================
304
- // Runtime Configuration
305
- // ============================================================================
306
-
307
- /**
308
- * Opt-in embed integration settings for a venue site embedding the widget.
309
- */
310
- export interface EmbedConfig {
311
- /**
312
- * Emit a MICDROP_CHECKOUT_COMPLETE postMessage when an order completes. The
313
- * payload is non-PII: `{ orderId, eventId }`. Default: false.
314
- */
315
- postMessageOnSuccess?: boolean;
316
- /**
317
- * REQUIRED concrete origin (e.g. 'https://venue.example') for the
318
- * MICDROP_CHECKOUT_COMPLETE message. The message is never posted to '*'; without a
319
- * concrete absolute origin nothing is sent and a warning is logged.
320
- */
321
- postMessageTargetOrigin?: string | null;
322
- }
323
-
324
- /**
325
- * Options for {@link configureVenueCalendar}. All fields are optional — pass
326
- * only the keys you want to change.
327
- */
328
- export interface ConfigureVenueCalendarOptions {
329
- /** Called whenever the widget surfaces a caught error (wire into Sentry/Rollbar/etc). */
330
- onError?: (_error: Error, _context: { source: string }) => void;
331
- /** Override the backend origin for multi-region setups. */
332
- apiBaseUrl?: string;
333
- /** Request timeout in ms, forwarded to the API client. */
334
- apiTimeout?: number;
335
- /** Retry count, forwarded to the API client. */
336
- apiRetries?: number;
337
- /** Opt-in embed integration settings (see {@link EmbedConfig}). */
338
- embed?: EmbedConfig;
339
- }
340
-
341
- /**
342
- * Configure the calendar widget at runtime: error reporting, API overrides,
343
- * and the opt-in embed integration (e.g. the MICDROP_CHECKOUT_COMPLETE postMessage).
344
- * @param options - Configuration options
345
- */
346
- export function configureVenueCalendar(
347
- _options?: ConfigureVenueCalendarOptions
348
- ): void;
349
-
350
- // ============================================================================
351
- // Theme Exports
352
- // ============================================================================
353
-
354
- /**
355
- * Collection of preset themes
356
- */
357
- export const themes: Themes;
358
-
359
- /**
360
- * Light theme preset
361
- */
362
- export const lightTheme: ThemeColors;
363
-
364
- /**
365
- * Dark theme preset
366
- */
367
- export const darkTheme: ThemeColors;
368
-
369
- /**
370
- * High contrast theme preset for accessibility
371
- */
372
- export const highContrastTheme: ThemeColors;
373
-
374
- /**
375
- * Apply a theme to the calendar widget
376
- * @param theme - Theme object with HSL color values
377
- * @param container - Optional container element (defaults to document.documentElement)
378
- */
379
- export function applyTheme(
380
- _theme: Partial<ThemeColors>,
381
- _container?: HTMLElement
382
- ): void;
383
-
384
- /**
385
- * Generate CSS string for embedding themes
386
- * @param theme - Theme object
387
- * @returns CSS string with custom properties
388
- */
389
- export function generateThemeCSS(_theme: Partial<ThemeColors>): string;
390
-
391
- // ============================================================================
392
- // Scarcity Canon
393
- // ============================================================================
394
- // These MUST be declared by hand. This file is not generated — it is copied
395
- // verbatim from `src/lib/types/` to `dist/types/` by vite.config.lib.js and is
396
- // what package.json's "types" points at, so a runtime `export` added to
397
- // VenueCalendar.js is invisible to TypeScript until it is also declared here.
398
- // The `exports` map has no wildcard either, so a deep import
399
- // (`@getmicdrop/venue-calendar/constants/scarcity`) is not an escape hatch.
400
- // Consumers — notably micdrop-frontend's admin mirror in
401
- // `src/lib/foundry/settings-tickets/scarcity.ts` — import these from the
402
- // package ENTRY, and that import only typechecks because of the declarations
403
- // below. Keep them in sync with `src/lib/constants/scarcity.ts`.
404
-
405
- /**
406
- * Scarcity tier for a ticket. `sold-out` at zero remaining, `urgent` carries an
407
- * exact count ("Only N left"), `low` is the vague badge, `plenty` no claim.
408
- */
409
- export type ScarcityLevel = 'sold-out' | 'urgent' | 'low' | 'plenty';
410
-
411
- /**
412
- * The sliding-scale knobs behind every scarcity claim in venue-calendar.
413
- * Percent thresholds bend toward the absolute floor/cap so the claim scales
414
- * with venue size; `MAX_EXACT_COUNT` caps when an exact count may be revealed.
415
- */
416
- export const SCARCITY_THRESHOLDS: {
417
- readonly URGENT_PCT: 10;
418
- readonly LOW_PCT: 20;
419
- readonly MAX_EXACT_COUNT: 20;
420
- readonly ABSOLUTE_FLOOR: 5;
421
- readonly ABSOLUTE_CAP: 30;
422
- };
423
-
424
- /**
425
- * Compute the scarcity level for a (remaining, total) pair.
426
- *
427
- * Returns 'plenty' when `total <= 0` (no percentage to compute — treat as
428
- * unlimited/unknown capacity, make no claim) and 'sold-out' for remaining <= 0.
429
- */
430
- export function computeScarcityLevel(
431
- _remaining: number,
432
- _total: number
433
- ): ScarcityLevel;
434
-
435
- // ============================================================================
436
- // Svelte Component Exports
437
- // ============================================================================
438
-
439
- /**
440
- * VenueCalendar Svelte component (CalendarContainer)
441
- */
442
- export const VenueCalendar: any;
443
-
444
- /**
445
- * Checkout Svelte component
446
- */
447
- export const Checkout: any;
448
-
449
- /**
450
- * CheckoutView alias for Checkout
451
- */
452
- export const CheckoutView: any;
453
-
454
- /**
455
- * Success Svelte component
456
- */
457
- export const Success: any;
458
-
459
- /**
460
- * EventPage Svelte component — full event page with EventMeta, ScarcityBadge, etc.
461
- */
462
- export const EventPage: any;
463
-
464
- /**
465
- * SeriesPage Svelte component — series landing page with hero, upcoming dates, performers, FAQ sidebar
466
- */
467
- export const SeriesPage: any;
468
-
469
- /**
470
- * SeriesHomeView alias (deprecated — use SeriesPage instead)
471
- */
472
- export const SeriesHomeView: any;
473
-
474
- /**
475
- * CollectionView Svelte component
476
- */
477
- export const CollectionView: any;
478
-
479
- // ============================================================================
480
- // Default Export
481
- // ============================================================================
482
-
483
- declare const _default: {
484
- initVenueCalendar: typeof initVenueCalendar;
485
- initEventPage: typeof initEventPage;
486
- initCheckoutView: typeof initCheckoutView;
487
- initCheckout: typeof initCheckoutView;
488
- initSuccessView: typeof initSuccessView;
489
- initSuccess: typeof initSuccessView;
490
- autoMount: typeof autoMount;
491
- VenueCalendar: any;
492
- themes: Themes;
493
- lightTheme: ThemeColors;
494
- darkTheme: ThemeColors;
495
- highContrastTheme: ThemeColors;
496
- applyTheme: typeof applyTheme;
497
- generateThemeCSS: typeof generateThemeCSS;
498
- Checkout: any;
499
- CheckoutView: any;
500
- Success: any;
501
- /** @deprecated Use Success instead */
502
- Sucess: any;
503
- EventPage: any;
504
- SeriesPage: any;
505
- SeriesHomeView: any;
506
- CollectionView: any;
507
- };
508
-
509
- export default _default;
1
+ /**
2
+ * TypeScript definitions for @getmicdrop/venue-calendar
3
+ */
4
+
5
+ // ============================================================================
6
+ // Event Data Types
7
+ // ============================================================================
8
+
9
+ /**
10
+ * Event data structure returned from the API or passed to components
11
+ */
12
+ export interface EventData {
13
+ id: string | number;
14
+ name: string;
15
+ date: string;
16
+ startDateTime?: string;
17
+ endDateTime?: string;
18
+ image?: string;
19
+ description?: string;
20
+ venueId?: string | number;
21
+ venueID?: string | number;
22
+ timeZone?: string;
23
+ location?: string;
24
+ slug?: string;
25
+ status?: 'on_sale' | 'selling_fast' | 'sold_out';
26
+ }
27
+
28
+ /**
29
+ * Ticket data structure
30
+ */
31
+ export interface TicketData {
32
+ id: string | number;
33
+ name: string;
34
+ price: number;
35
+ quantity?: number;
36
+ description?: string;
37
+ available?: number;
38
+ }
39
+
40
+ // ============================================================================
41
+ // Theme Types
42
+ // ============================================================================
43
+
44
+ /**
45
+ * Theme color configuration using HSL format
46
+ * All values should be HSL strings like "217 91% 60%"
47
+ */
48
+ export interface ThemeColors {
49
+ /** Brand primary color */
50
+ brandPrimary: string;
51
+ /** Primary text color */
52
+ textPrimary: string;
53
+ /** Secondary text color */
54
+ textSecondary: string;
55
+ /** Tertiary text color */
56
+ textTertiary: string;
57
+ /** Primary background color */
58
+ bgPrimary: string;
59
+ /** Secondary background color */
60
+ bgSecondary: string;
61
+ /** Quaternary background color */
62
+ bgQuaternary: string;
63
+ /** Primary stroke/border color */
64
+ strokePrimary: string;
65
+ /** Secondary stroke/border color */
66
+ strokeSecondary: string;
67
+ /** On sale status color */
68
+ statusOnSale: string;
69
+ /** Selling fast status color */
70
+ statusSellingFast: string;
71
+ /** Sold out status color */
72
+ statusSoldOut: string;
73
+ /** Today's date background color */
74
+ todayBg: string;
75
+ /** Today's date text color */
76
+ todayText: string;
77
+ /** Event dot color for on sale */
78
+ eventDotOnSale: string;
79
+ /** Event dot color for selling fast */
80
+ eventDotSellingFast: string;
81
+ /** Event dot color for sold out */
82
+ eventDotSoldOut: string;
83
+ /** Hover background color */
84
+ hoverBg: string;
85
+ /** Focus ring color */
86
+ focusRing: string;
87
+ }
88
+
89
+ /**
90
+ * Preset themes collection
91
+ */
92
+ export interface Themes {
93
+ light: ThemeColors;
94
+ dark: ThemeColors;
95
+ highContrast: ThemeColors;
96
+ }
97
+
98
+ // ============================================================================
99
+ // View Option Types
100
+ // ============================================================================
101
+
102
+ /**
103
+ * View option for the calendar view switcher
104
+ */
105
+ export interface ViewOption {
106
+ id: number;
107
+ text: string;
108
+ /** @deprecated Not rendered — the view switcher shows `text` only. Kept optional for backward compatibility. */
109
+ icon?: string;
110
+ ariaLabel?: string;
111
+ }
112
+
113
+ export type ViewType = 'list' | 'gallery' | 'calendar';
114
+
115
+ // ============================================================================
116
+ // Component Props Interfaces
117
+ // ============================================================================
118
+
119
+ /**
120
+ * Base options for all init functions
121
+ */
122
+ export interface BaseInitOptions {
123
+ /** CSS selector or HTMLElement to mount the component */
124
+ target: string | HTMLElement;
125
+ /** The venue ID (optional, default: '1') */
126
+ venueId?: string;
127
+ /** The organization ID (optional, default: '1') */
128
+ organizationId?: string;
129
+ /**
130
+ * BCP-47 locale tag (e.g. 'es', 'es-MX'). Selects the bundled locale for the
131
+ * label catalogue; undefined falls back to the browser locale, then English.
132
+ * Threaded through every init entry point (vc#693).
133
+ */
134
+ locale?: string;
135
+ }
136
+
137
+ /**
138
+ * Options for initializing the Venue Calendar component
139
+ */
140
+ export interface CalendarProps extends BaseInitOptions {
141
+ /** Initial view: 'list', 'gallery', or 'calendar' (default: 'calendar') */
142
+ view?: ViewType;
143
+ /** Array of event objects to display */
144
+ events?: EventData[];
145
+ /** Whether to show view switcher (default: true) */
146
+ showViewOptions?: boolean;
147
+ /** Whether to show month navigation (default: true) */
148
+ showMonthSwitcher?: boolean;
149
+ /** Current month store (Svelte writable store) */
150
+ currentMonth?: import('svelte/store').Writable<number>;
151
+ /** Current year store (Svelte writable store) */
152
+ currentYear?: import('svelte/store').Writable<number>;
153
+ /** Handler for navigating to next month */
154
+ handleNext?: () => void;
155
+ /** Handler for navigating to previous month */
156
+ handlePrev?: () => void;
157
+ /** Callback function when an event is clicked */
158
+ onEventClick?: (_event: EventData) => void;
159
+ /**
160
+ * Render the show detail / series / collection IN-PLACE on click + deep
161
+ * link instead of navigating the host page (default: true for embeds).
162
+ * Pass false to keep the host responsible for navigation, or supply your
163
+ * own onEventClick to take over click handling entirely.
164
+ */
165
+ inlineEntityViews?: boolean;
166
+ }
167
+
168
+ /**
169
+ * Options for initializing the (inline) Event Page.
170
+ */
171
+ export interface EventPageOptions extends BaseInitOptions {
172
+ /** The event ID to display (the page self-fetches), or pass rawEvent. */
173
+ eventId?: string | number;
174
+ /** Pre-fetched raw event payload (skips the self-fetch). */
175
+ rawEvent?: any;
176
+ /** Event slug (cosmetic). */
177
+ slug?: string;
178
+ /** Callback when the back control is clicked. */
179
+ onNavigateBack?: () => void;
180
+ /** Callback when proceeding to checkout (cart already created). */
181
+ onNavigateToCart?: (
182
+ _id: string | number,
183
+ _slug: string,
184
+ _rawEvent: any
185
+ ) => void;
186
+ /** Callback when a series occurrence is clicked. */
187
+ onBuyTickets?: (_eventId: string | number, _slug: string) => void;
188
+ /** i18n label overrides. */
189
+ labels?: Record<string, string>;
190
+ }
191
+
192
+ /**
193
+ * Success callback data from checkout
194
+ */
195
+ export interface CheckoutSuccessData {
196
+ orderId?: string;
197
+ eventId?: string;
198
+ event?: EventData;
199
+ }
200
+
201
+ /**
202
+ * Options for initializing the Checkout View
203
+ */
204
+ export interface CheckoutOptions extends BaseInitOptions {
205
+ /** The event ID to display */
206
+ eventId: string;
207
+ /** The event slug (optional) */
208
+ slug?: string;
209
+ /** Array of available tickets (optional) */
210
+ availableTickets?: TicketData[];
211
+ /** Callback when checkout is successful */
212
+ onSuccess?: (_data: CheckoutSuccessData) => void;
213
+ /** Callback when navigating to success page */
214
+ onNavigateToSuccess?: (_data: CheckoutSuccessData) => void;
215
+ }
216
+
217
+ /**
218
+ * Options for initializing the Success View
219
+ */
220
+ export interface SuccessViewOptions extends BaseInitOptions {
221
+ /** The event ID (optional) */
222
+ eventId?: string;
223
+ /** The event slug (optional) */
224
+ slug?: string;
225
+ /** The order ID (optional) */
226
+ orderId?: string;
227
+ }
228
+
229
+ /**
230
+ * Alias for CalendarProps for backward compatibility
231
+ */
232
+ export type InitOptions = CalendarProps;
233
+
234
+ // ============================================================================
235
+ // Svelte Component Instance
236
+ // ============================================================================
237
+
238
+ /**
239
+ * Svelte component instance returned by init functions
240
+ */
241
+ export interface SvelteComponentInstance {
242
+ /** Destroy the component and clean up */
243
+ $destroy?: () => void;
244
+ /** Internal cleanup for success listener */
245
+ _successCleanup?: () => void;
246
+ }
247
+
248
+ // ============================================================================
249
+ // Exported Functions
250
+ // ============================================================================
251
+
252
+ /**
253
+ * Initialize the Venue Calendar component
254
+ * @param options - Configuration options
255
+ * @returns The Svelte component instance, or null if target not found
256
+ */
257
+ export function initVenueCalendar(
258
+ _options: CalendarProps
259
+ ): SvelteComponentInstance | null;
260
+
261
+ /**
262
+ * Initialize the (inline) Event Page.
263
+ * @param options - Configuration options
264
+ * @returns The Svelte component instance, or null if target not found / no event
265
+ */
266
+ export function initEventPage(
267
+ _options: EventPageOptions
268
+ ): SvelteComponentInstance | null;
269
+
270
+ /**
271
+ * Initialize the Checkout View
272
+ * @param options - Configuration options
273
+ * @returns The Svelte component instance, or null if target not found or eventId missing
274
+ */
275
+ export function initCheckoutView(
276
+ _options: CheckoutOptions
277
+ ): SvelteComponentInstance | null;
278
+
279
+ /**
280
+ * Alias for initCheckoutView
281
+ */
282
+ export const initCheckout: typeof initCheckoutView;
283
+
284
+ /**
285
+ * Initialize the Success View
286
+ * @param options - Configuration options
287
+ * @returns The Svelte component instance, or null if target not found
288
+ */
289
+ export function initSuccessView(
290
+ _options: SuccessViewOptions
291
+ ): SvelteComponentInstance | null;
292
+
293
+ /**
294
+ * Alias for initSuccessView
295
+ */
296
+ export const initSuccess: typeof initSuccessView;
297
+
298
+ /**
299
+ * Auto-mount: Automatically finds and mounts calendar to elements with class 'micdrop-calendar-container'
300
+ */
301
+ export function autoMount(): void;
302
+
303
+ // ============================================================================
304
+ // Runtime Configuration
305
+ // ============================================================================
306
+
307
+ /**
308
+ * Opt-in embed integration settings for a venue site embedding the widget.
309
+ */
310
+ export interface EmbedConfig {
311
+ /**
312
+ * Emit a MICDROP_CHECKOUT_COMPLETE postMessage when an order completes. The
313
+ * payload is non-PII: `{ orderId, eventId }`. Default: false.
314
+ */
315
+ postMessageOnSuccess?: boolean;
316
+ /**
317
+ * REQUIRED concrete origin (e.g. 'https://venue.example') for the
318
+ * MICDROP_CHECKOUT_COMPLETE message. The message is never posted to '*'; without a
319
+ * concrete absolute origin nothing is sent and a warning is logged.
320
+ */
321
+ postMessageTargetOrigin?: string | null;
322
+ }
323
+
324
+ /**
325
+ * Options for {@link configureVenueCalendar}. All fields are optional — pass
326
+ * only the keys you want to change.
327
+ */
328
+ export interface ConfigureVenueCalendarOptions {
329
+ /** Called whenever the widget surfaces a caught error (wire into Sentry/Rollbar/etc). */
330
+ onError?: (_error: Error, _context: { source: string }) => void;
331
+ /** Override the backend origin for multi-region setups. */
332
+ apiBaseUrl?: string;
333
+ /** Request timeout in ms, forwarded to the API client. */
334
+ apiTimeout?: number;
335
+ /** Retry count, forwarded to the API client. */
336
+ apiRetries?: number;
337
+ /** Opt-in embed integration settings (see {@link EmbedConfig}). */
338
+ embed?: EmbedConfig;
339
+ }
340
+
341
+ /**
342
+ * Configure the calendar widget at runtime: error reporting, API overrides,
343
+ * and the opt-in embed integration (e.g. the MICDROP_CHECKOUT_COMPLETE postMessage).
344
+ * @param options - Configuration options
345
+ */
346
+ export function configureVenueCalendar(
347
+ _options?: ConfigureVenueCalendarOptions
348
+ ): void;
349
+
350
+ // ============================================================================
351
+ // Theme Exports
352
+ // ============================================================================
353
+
354
+ /**
355
+ * Collection of preset themes
356
+ */
357
+ export const themes: Themes;
358
+
359
+ /**
360
+ * Light theme preset
361
+ */
362
+ export const lightTheme: ThemeColors;
363
+
364
+ /**
365
+ * Dark theme preset
366
+ */
367
+ export const darkTheme: ThemeColors;
368
+
369
+ /**
370
+ * High contrast theme preset for accessibility
371
+ */
372
+ export const highContrastTheme: ThemeColors;
373
+
374
+ /**
375
+ * Apply a theme to the calendar widget
376
+ * @param theme - Theme object with HSL color values
377
+ * @param container - Optional container element (defaults to document.documentElement)
378
+ */
379
+ export function applyTheme(
380
+ _theme: Partial<ThemeColors>,
381
+ _container?: HTMLElement
382
+ ): void;
383
+
384
+ /**
385
+ * Generate CSS string for embedding themes
386
+ * @param theme - Theme object
387
+ * @returns CSS string with custom properties
388
+ */
389
+ export function generateThemeCSS(_theme: Partial<ThemeColors>): string;
390
+
391
+ // ============================================================================
392
+ // Scarcity Canon
393
+ // ============================================================================
394
+ // These MUST be declared by hand. This file is not generated — it is copied
395
+ // verbatim from `src/lib/types/` to `dist/types/` by vite.config.lib.js and is
396
+ // what package.json's "types" points at, so a runtime `export` added to
397
+ // VenueCalendar.js is invisible to TypeScript until it is also declared here.
398
+ // The `exports` map has no wildcard either, so a deep import
399
+ // (`@getmicdrop/venue-calendar/constants/scarcity`) is not an escape hatch.
400
+ // Consumers — notably micdrop-frontend's admin mirror in
401
+ // `src/lib/foundry/settings-tickets/scarcity.ts` — import these from the
402
+ // package ENTRY, and that import only typechecks because of the declarations
403
+ // below. Keep them in sync with `src/lib/constants/scarcity.ts`.
404
+
405
+ /**
406
+ * Scarcity tier for a ticket. `sold-out` at zero remaining, `urgent` carries an
407
+ * exact count ("Only N left"), `low` is the vague badge, `plenty` no claim.
408
+ */
409
+ export type ScarcityLevel = 'sold-out' | 'urgent' | 'low' | 'plenty';
410
+
411
+ /**
412
+ * The sliding-scale knobs behind every scarcity claim in venue-calendar.
413
+ * Percent thresholds bend toward the absolute floor/cap so the claim scales
414
+ * with venue size; `MAX_EXACT_COUNT` caps when an exact count may be revealed.
415
+ */
416
+ export const SCARCITY_THRESHOLDS: {
417
+ readonly URGENT_PCT: 10;
418
+ readonly LOW_PCT: 20;
419
+ readonly MAX_EXACT_COUNT: 20;
420
+ readonly ABSOLUTE_FLOOR: 5;
421
+ readonly ABSOLUTE_CAP: 30;
422
+ };
423
+
424
+ /**
425
+ * Compute the scarcity level for a (remaining, total) pair.
426
+ *
427
+ * Returns 'plenty' when `total <= 0` (no percentage to compute — treat as
428
+ * unlimited/unknown capacity, make no claim) and 'sold-out' for remaining <= 0.
429
+ */
430
+ export function computeScarcityLevel(
431
+ _remaining: number,
432
+ _total: number
433
+ ): ScarcityLevel;
434
+
435
+ // ============================================================================
436
+ // Svelte Component Exports
437
+ // ============================================================================
438
+
439
+ /**
440
+ * VenueCalendar Svelte component (CalendarContainer)
441
+ */
442
+ export const VenueCalendar: any;
443
+
444
+ /**
445
+ * Checkout Svelte component
446
+ */
447
+ export const Checkout: any;
448
+
449
+ /**
450
+ * CheckoutView alias for Checkout
451
+ */
452
+ export const CheckoutView: any;
453
+
454
+ /**
455
+ * Success Svelte component
456
+ */
457
+ export const Success: any;
458
+
459
+ /**
460
+ * EventPage Svelte component — full event page with EventMeta, ScarcityBadge, etc.
461
+ */
462
+ export const EventPage: any;
463
+
464
+ /**
465
+ * SeriesPage Svelte component — series landing page with hero, upcoming dates, performers, FAQ sidebar
466
+ */
467
+ export const SeriesPage: any;
468
+
469
+ /**
470
+ * SeriesHomeView alias (deprecated — use SeriesPage instead)
471
+ */
472
+ export const SeriesHomeView: any;
473
+
474
+ /**
475
+ * CollectionView Svelte component
476
+ */
477
+ export const CollectionView: any;
478
+
479
+ // ============================================================================
480
+ // Default Export
481
+ // ============================================================================
482
+
483
+ declare const _default: {
484
+ initVenueCalendar: typeof initVenueCalendar;
485
+ initEventPage: typeof initEventPage;
486
+ initCheckoutView: typeof initCheckoutView;
487
+ initCheckout: typeof initCheckoutView;
488
+ initSuccessView: typeof initSuccessView;
489
+ initSuccess: typeof initSuccessView;
490
+ autoMount: typeof autoMount;
491
+ VenueCalendar: any;
492
+ themes: Themes;
493
+ lightTheme: ThemeColors;
494
+ darkTheme: ThemeColors;
495
+ highContrastTheme: ThemeColors;
496
+ applyTheme: typeof applyTheme;
497
+ generateThemeCSS: typeof generateThemeCSS;
498
+ Checkout: any;
499
+ CheckoutView: any;
500
+ Success: any;
501
+ /** @deprecated Use Success instead */
502
+ Sucess: any;
503
+ EventPage: any;
504
+ SeriesPage: any;
505
+ SeriesHomeView: any;
506
+ CollectionView: any;
507
+ };
508
+
509
+ export default _default;