@getmicdrop/venue-calendar 4.0.92 → 4.0.94

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 (109) hide show
  1. package/README.md +740 -740
  2. package/dist/CartView-hnrXbE_O.js +2385 -0
  3. package/dist/CartView-hnrXbE_O.js.map +1 -0
  4. package/dist/Checkout-Bvre3lYs.js +1745 -0
  5. package/dist/Checkout-Bvre3lYs.js.map +1 -0
  6. package/dist/Checkout-C4Kr5pVp.js +1040 -0
  7. package/dist/Checkout-C4Kr5pVp.js.map +1 -0
  8. package/dist/{CheckoutTimer-CF6emJxC.js → CheckoutTimer-D2HnWYm7.js} +37 -37
  9. package/dist/CheckoutTimer-D2HnWYm7.js.map +1 -0
  10. package/dist/ClockIcon-DA4wXK5Q.js +32 -0
  11. package/dist/ClockIcon-DA4wXK5Q.js.map +1 -0
  12. package/dist/CollectionView-DU1lTGU_.js +299 -0
  13. package/dist/CollectionView-DU1lTGU_.js.map +1 -0
  14. package/dist/{Event-BzBZmp6N.js → Event-BuOnGjPB.js} +1569 -1491
  15. package/dist/Event-BuOnGjPB.js.map +1 -0
  16. package/dist/EventPage-vBSbuSaG.js +566 -0
  17. package/dist/EventPage-vBSbuSaG.js.map +1 -0
  18. package/dist/{Heading-BswFTsr3.js → Heading-D4iOOm-C.js} +26 -26
  19. package/dist/Heading-D4iOOm-C.js.map +1 -0
  20. package/dist/ScarcityBadge-D37JY-BJ.js +167 -0
  21. package/dist/ScarcityBadge-D37JY-BJ.js.map +1 -0
  22. package/dist/{SeriesPage-CbmuRofu.js → SeriesPage-CZdi_-a4.js} +5 -5
  23. package/dist/SeriesPage-CZdi_-a4.js.map +1 -0
  24. package/dist/{Spinner-CAxL7NK0.js → Spinner-BZYln43S.js} +10 -10
  25. package/dist/Spinner-BZYln43S.js.map +1 -0
  26. package/dist/Success-CQYI5SZO.js +866 -0
  27. package/dist/Success-CQYI5SZO.js.map +1 -0
  28. package/dist/Text-C-6sDfH2.js +171 -0
  29. package/dist/Text-C-6sDfH2.js.map +1 -0
  30. package/dist/VenueCalendar-Um0PQCVy.js +15645 -0
  31. package/dist/VenueCalendar-Um0PQCVy.js.map +1 -0
  32. package/dist/{ViewTicketsEmbed-C7GPK33F.js → ViewTicketsEmbed-D2jQ8AMb.js} +386 -387
  33. package/dist/ViewTicketsEmbed-D2jQ8AMb.js.map +1 -0
  34. package/dist/api/{events.d.ts → api/events.d.ts} +9 -10
  35. package/dist/api/{index.d.ts → api/index.d.ts} +2 -1
  36. package/dist/api/api/result.d.ts +48 -0
  37. package/dist/api/{transformers → api/transformers}/event.d.ts +19 -10
  38. package/dist/api/api.cjs +1 -1
  39. package/dist/api/api.cjs.map +1 -1
  40. package/dist/api/api.mjs +690 -599
  41. package/dist/api/api.mjs.map +1 -1
  42. package/dist/api/types.d.ts +9 -0
  43. package/dist/{data-toggle-store.svelte-BUOQgWTH.js → data-toggle-store.svelte-CyXPU9Oq.js} +2 -2
  44. package/dist/data-toggle-store.svelte-CyXPU9Oq.js.map +1 -0
  45. package/dist/labels-BNiV89mT.js +636 -0
  46. package/dist/labels-BNiV89mT.js.map +1 -0
  47. package/dist/{modalManager.svelte-C8L8XPBi.js → modalManager.svelte-D_9E6W5P.js} +2 -2
  48. package/dist/modalManager.svelte-D_9E6W5P.js.map +1 -0
  49. package/dist/seo/seo.cjs +1 -1
  50. package/dist/seo/seo.cjs.map +1 -1
  51. package/dist/seo/seo.mjs +78 -74
  52. package/dist/seo/seo.mjs.map +1 -1
  53. package/dist/transform-HKz55B2D.js +360 -0
  54. package/dist/transform-HKz55B2D.js.map +1 -0
  55. package/dist/types/index.d.ts +454 -442
  56. package/dist/venue-calendar.css +1 -1
  57. package/dist/venue-calendar.es.js +12 -12
  58. package/dist/venue-calendar.iife.js +44 -30
  59. package/dist/venue-calendar.iife.js.map +1 -1
  60. package/dist/venue-calendar.umd.js +45 -31
  61. package/dist/venue-calendar.umd.js.map +1 -1
  62. package/package.json +7 -5
  63. package/src/lib/theme.js +222 -222
  64. package/dist/CartView-IiXG4UTa.js +0 -2366
  65. package/dist/CartView-IiXG4UTa.js.map +0 -1
  66. package/dist/Checkout-BscK0fmI.js +0 -1717
  67. package/dist/Checkout-BscK0fmI.js.map +0 -1
  68. package/dist/Checkout-Dx7QWFn9.js +0 -916
  69. package/dist/Checkout-Dx7QWFn9.js.map +0 -1
  70. package/dist/CheckoutTimer-CF6emJxC.js.map +0 -1
  71. package/dist/CollectionView-BAy5mYKg.js +0 -299
  72. package/dist/CollectionView-BAy5mYKg.js.map +0 -1
  73. package/dist/Event-BzBZmp6N.js.map +0 -1
  74. package/dist/EventPage-TNjZq1ls.js +0 -532
  75. package/dist/EventPage-TNjZq1ls.js.map +0 -1
  76. package/dist/Heading-BswFTsr3.js.map +0 -1
  77. package/dist/ScarcityBadge-DEzS1qXs.js +0 -90
  78. package/dist/ScarcityBadge-DEzS1qXs.js.map +0 -1
  79. package/dist/SeriesPage-CbmuRofu.js.map +0 -1
  80. package/dist/Spinner-CAxL7NK0.js.map +0 -1
  81. package/dist/Success-DdWMiFHS.js +0 -729
  82. package/dist/Success-DdWMiFHS.js.map +0 -1
  83. package/dist/Text-HvIEXENM.js +0 -167
  84. package/dist/Text-HvIEXENM.js.map +0 -1
  85. package/dist/VenueCalendar-DhxkKfli.js +0 -18400
  86. package/dist/VenueCalendar-DhxkKfli.js.map +0 -1
  87. package/dist/ViewTicketsEmbed-C7GPK33F.js.map +0 -1
  88. package/dist/data-toggle-store.svelte-BUOQgWTH.js.map +0 -1
  89. package/dist/labels-Bwet5rDx.js +0 -965
  90. package/dist/labels-Bwet5rDx.js.map +0 -1
  91. package/dist/modalManager.svelte-C8L8XPBi.js.map +0 -1
  92. package/dist/transform-5AH-sRWT.js +0 -274
  93. package/dist/transform-5AH-sRWT.js.map +0 -1
  94. /package/dist/api/{client.d.ts → api/client.d.ts} +0 -0
  95. /package/dist/api/{cta.d.ts → api/cta.d.ts} +0 -0
  96. /package/dist/api/{gift-cards.d.ts → api/gift-cards.d.ts} +0 -0
  97. /package/dist/api/{orders.d.ts → api/orders.d.ts} +0 -0
  98. /package/dist/api/{promo.d.ts → api/promo.d.ts} +0 -0
  99. /package/dist/api/{transformers → api/transformers}/address.d.ts +0 -0
  100. /package/dist/api/{transformers → api/transformers}/cart.d.ts +0 -0
  101. /package/dist/api/{transformers → api/transformers}/collection.d.ts +0 -0
  102. /package/dist/api/{transformers → api/transformers}/giftCard.d.ts +0 -0
  103. /package/dist/api/{transformers → api/transformers}/index.d.ts +0 -0
  104. /package/dist/api/{transformers → api/transformers}/order.d.ts +0 -0
  105. /package/dist/api/{transformers → api/transformers}/performer.d.ts +0 -0
  106. /package/dist/api/{transformers → api/transformers}/series.d.ts +0 -0
  107. /package/dist/api/{transformers → api/transformers}/venue.d.ts +0 -0
  108. /package/dist/api/{venues.d.ts → api/venues.d.ts} +0 -0
  109. /package/dist/api/{waitlist.d.ts → api/waitlist.d.ts} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@getmicdrop/venue-calendar",
3
- "version": "4.0.92",
3
+ "version": "4.0.94",
4
4
  "description": "A customizable Svelte calendar component for displaying comedy events",
5
5
  "type": "module",
6
6
  "types": "./dist/types/index.d.ts",
@@ -58,6 +58,9 @@
58
58
  "design-system:check": "node scripts/design-system-check.mjs --report-only",
59
59
  "design-system:check:strict": "node scripts/design-system-check.mjs --fail-on-new",
60
60
  "design-system:baseline": "node scripts/design-system-check.mjs --baseline",
61
+ "cleanup-check": "node scripts/cleanup-on-destroy-check.mjs --report-only",
62
+ "cleanup-check:strict": "node scripts/cleanup-on-destroy-check.mjs --fail-on-new",
63
+ "cleanup-baseline": "node scripts/cleanup-on-destroy-check.mjs --baseline",
61
64
  "check": "svelte-check --diagnostic-sources \"js,svelte\"",
62
65
  "check:all": "svelte-check",
63
66
  "test": "vitest run",
@@ -108,11 +111,11 @@
108
111
  },
109
112
  "homepage": "https://github.com/get-micdrop/venue-calendar#readme",
110
113
  "peerDependencies": {
111
- "svelte": "^5.0.0"
114
+ "svelte": ">=5.56.0"
112
115
  },
113
116
  "devDependencies": {
114
117
  "@eslint/js": "^9.39.1",
115
- "@getmicdrop/svelte-components": "^6.24.117",
118
+ "@getmicdrop/svelte-components": "^6.24.125",
116
119
  "@playwright/test": "^1.60.0",
117
120
  "@size-limit/file": "^11.1.0",
118
121
  "@sveltejs/adapter-auto": "^6.1.0",
@@ -143,7 +146,7 @@
143
146
  "size-limit": "^11.1.0",
144
147
  "stylelint": "^16.16.0",
145
148
  "stylelint-config-standard": "^36.0.1",
146
- "svelte": "^5.46.1",
149
+ "svelte": "^5.56.0",
147
150
  "svelte-check": "^4.3.5",
148
151
  "tailwindcss": "^4.0.0",
149
152
  "typescript": "^5.9.3",
@@ -153,7 +156,6 @@
153
156
  },
154
157
  "dependencies": {
155
158
  "@stripe/stripe-js": "^8.0.0",
156
- "carbon-icons-svelte": "^13.7.0",
157
159
  "js-cookie": "^3.0.5",
158
160
  "libphonenumber-js": "^1.12.40",
159
161
  "qrcode": "^1.5.4",
package/src/lib/theme.js CHANGED
@@ -1,222 +1,222 @@
1
- /**
2
- * Theme Configuration for Embeddable Calendar Widget
3
- *
4
- * This module provides comprehensive theming options for the calendar widget.
5
- * All colors use HSL format for easy manipulation.
6
- *
7
- * Usage:
8
- * 1. Import and call applyTheme() with your custom theme
9
- * 2. Or set CSS custom properties directly on the widget container
10
- *
11
- * Example:
12
- * ```js
13
- * import { applyTheme, themes } from '@getmicdrop/venue-calendar/theme';
14
- * applyTheme(themes.dark);
15
- *
16
- * // Or custom theme:
17
- * applyTheme({
18
- * brandPrimary: '270 76% 60%', // Purple
19
- * textPrimary: '0 0% 100%',
20
- * bgPrimary: '0 0% 10%',
21
- * });
22
- * ```
23
- */
24
-
25
- // Default light theme
26
- export const lightTheme = {
27
- // Brand colors
28
- brandPrimary: '217 91% 60%', // #2563EB - Blue
29
-
30
- // Text colors
31
- textPrimary: '0 0% 0%', // Black
32
- textSecondary: '0 0% 40%', // Dark Gray
33
- textTertiary: '0 0% 60%', // Gray
34
-
35
- // Background colors
36
- bgPrimary: '0 0% 100%', // White
37
- bgSecondary: '0 0% 98%', // Light Gray
38
- bgQuaternary: '0 0% 96%', // Very Light Gray
39
-
40
- // Border/Stroke colors
41
- strokePrimary: '0 0% 80%', // Medium Gray
42
- strokeSecondary: '0 0% 90%', // Light Gray
43
-
44
- // Status colors
45
- statusOnSale: '217 91% 60%', // Blue
46
- statusSellingFast: '38 92% 50%', // Orange
47
- statusSoldOut: '0 84% 60%', // Red
48
-
49
- // Calendar specific
50
- todayBg: '217 91% 97%', // Light blue
51
- todayText: '217 91% 50%', // Blue
52
- eventDotOnSale: '217 91% 60%',
53
- eventDotSellingFast: '38 92% 50%',
54
- eventDotSoldOut: '0 84% 60%',
55
-
56
- // Interaction states
57
- hoverBg: '0 0% 96%',
58
- focusRing: '217 91% 60%',
59
- };
60
-
61
- // Dark theme
62
- export const darkTheme = {
63
- // Brand colors
64
- brandPrimary: '217 91% 65%', // Lighter blue for dark mode
65
-
66
- // Text colors
67
- textPrimary: '0 0% 98%', // Near white
68
- textSecondary: '0 0% 70%', // Light gray
69
- textTertiary: '0 0% 50%', // Gray
70
-
71
- // Background colors
72
- bgPrimary: '0 0% 9%', // Very dark gray
73
- bgSecondary: '0 0% 13%', // Dark gray
74
- bgQuaternary: '0 0% 17%', // Slightly lighter
75
-
76
- // Border/Stroke colors
77
- strokePrimary: '0 0% 30%',
78
- strokeSecondary: '0 0% 20%',
79
-
80
- // Status colors
81
- statusOnSale: '217 91% 65%',
82
- statusSellingFast: '38 92% 55%',
83
- statusSoldOut: '0 84% 65%',
84
-
85
- // Calendar specific
86
- todayBg: '217 50% 20%',
87
- todayText: '217 91% 70%',
88
- eventDotOnSale: '217 91% 65%',
89
- eventDotSellingFast: '38 92% 55%',
90
- eventDotSoldOut: '0 84% 65%',
91
-
92
- // Interaction states
93
- hoverBg: '0 0% 20%',
94
- focusRing: '217 91% 65%',
95
- };
96
-
97
- // High contrast theme for accessibility
98
- export const highContrastTheme = {
99
- brandPrimary: '217 100% 50%',
100
- textPrimary: '0 0% 0%',
101
- textSecondary: '0 0% 20%',
102
- textTertiary: '0 0% 30%',
103
- bgPrimary: '0 0% 100%',
104
- bgSecondary: '0 0% 95%',
105
- bgQuaternary: '0 0% 90%',
106
- strokePrimary: '0 0% 0%',
107
- strokeSecondary: '0 0% 30%',
108
- statusOnSale: '217 100% 40%',
109
- statusSellingFast: '30 100% 40%',
110
- statusSoldOut: '0 100% 40%',
111
- todayBg: '217 100% 90%',
112
- todayText: '217 100% 30%',
113
- eventDotOnSale: '217 100% 40%',
114
- eventDotSellingFast: '30 100% 40%',
115
- eventDotSoldOut: '0 100% 40%',
116
- hoverBg: '217 100% 95%',
117
- focusRing: '217 100% 40%',
118
- };
119
-
120
- // Preset themes collection
121
- export const themes = {
122
- light: lightTheme,
123
- dark: darkTheme,
124
- highContrast: highContrastTheme,
125
- };
126
-
127
- /**
128
- * Apply a theme to the calendar widget
129
- * @param {Object} theme - Theme object with HSL color values
130
- * @param {HTMLElement} container - Optional container element (defaults to :root)
131
- */
132
- export function applyTheme(theme, container = document.documentElement) {
133
- const cssVarMap = {
134
- brandPrimary: '--brand-primary',
135
- textPrimary: '--text-primary',
136
- textSecondary: '--text-secondary',
137
- textTertiary: '--text-tertiary',
138
- bgPrimary: '--bg-primary',
139
- bgSecondary: '--bg-secondary',
140
- bgQuaternary: '--bg-quaternary',
141
- strokePrimary: '--stroke-primary',
142
- strokeSecondary: '--stroke-secondary',
143
- statusOnSale: '--status-on-sale',
144
- statusSellingFast: '--status-selling-fast',
145
- statusSoldOut: '--status-sold-out',
146
- todayBg: '--today-bg',
147
- todayText: '--today-text',
148
- eventDotOnSale: '--event-dot-on-sale',
149
- eventDotSellingFast: '--event-dot-selling-fast',
150
- eventDotSoldOut: '--event-dot-sold-out',
151
- hoverBg: '--hover-bg',
152
- focusRing: '--focus-ring',
153
- };
154
-
155
- Object.entries(theme).forEach(([key, value]) => {
156
- const cssVar = cssVarMap[key];
157
- if (cssVar) {
158
- container.style.setProperty(cssVar, value);
159
- }
160
- });
161
-
162
- // Sync data-theme attribute when a known preset is applied so SC
163
- // components (Stripe theme detector, DarkModeToggle reader, etc.)
164
- // see the same intent. Partial/custom themes don't trigger this —
165
- // they edit a few CSS vars without flipping the overall light/dark
166
- // mode signal.
167
- if (container.setAttribute) {
168
- if (theme === darkTheme) {
169
- container.setAttribute('data-theme', 'dark');
170
- } else if (theme === lightTheme || theme === highContrastTheme) {
171
- container.setAttribute('data-theme', 'light');
172
- }
173
- }
174
- }
175
-
176
- /**
177
- * Generate CSS string for embedding
178
- * @param {Object} theme - Theme object
179
- * @returns {string} CSS string
180
- */
181
- export function generateThemeCSS(theme) {
182
- const cssVarMap = {
183
- brandPrimary: '--brand-primary',
184
- textPrimary: '--text-primary',
185
- textSecondary: '--text-secondary',
186
- textTertiary: '--text-tertiary',
187
- bgPrimary: '--bg-primary',
188
- bgSecondary: '--bg-secondary',
189
- bgQuaternary: '--bg-quaternary',
190
- strokePrimary: '--stroke-primary',
191
- strokeSecondary: '--stroke-secondary',
192
- statusOnSale: '--status-on-sale',
193
- statusSellingFast: '--status-selling-fast',
194
- statusSoldOut: '--status-sold-out',
195
- todayBg: '--today-bg',
196
- todayText: '--today-text',
197
- eventDotOnSale: '--event-dot-on-sale',
198
- eventDotSellingFast: '--event-dot-selling-fast',
199
- eventDotSoldOut: '--event-dot-sold-out',
200
- hoverBg: '--hover-bg',
201
- focusRing: '--focus-ring',
202
- };
203
-
204
- const lines = [];
205
- Object.entries(theme).forEach(([key, value]) => {
206
- const cssVar = cssVarMap[key];
207
- if (cssVar) {
208
- lines.push(` ${cssVar}: ${value};`);
209
- }
210
- });
211
-
212
- return `:root {\n${lines.join('\n')}\n}`;
213
- }
214
-
215
- export default {
216
- themes,
217
- lightTheme,
218
- darkTheme,
219
- highContrastTheme,
220
- applyTheme,
221
- generateThemeCSS,
222
- };
1
+ /**
2
+ * Theme Configuration for Embeddable Calendar Widget
3
+ *
4
+ * This module provides comprehensive theming options for the calendar widget.
5
+ * All colors use HSL format for easy manipulation.
6
+ *
7
+ * Usage:
8
+ * 1. Import and call applyTheme() with your custom theme
9
+ * 2. Or set CSS custom properties directly on the widget container
10
+ *
11
+ * Example:
12
+ * ```js
13
+ * import { applyTheme, themes } from '@getmicdrop/venue-calendar/theme';
14
+ * applyTheme(themes.dark);
15
+ *
16
+ * // Or custom theme:
17
+ * applyTheme({
18
+ * brandPrimary: '270 76% 60%', // Purple
19
+ * textPrimary: '0 0% 100%',
20
+ * bgPrimary: '0 0% 10%',
21
+ * });
22
+ * ```
23
+ */
24
+
25
+ // Default light theme
26
+ export const lightTheme = {
27
+ // Brand colors
28
+ brandPrimary: '217 91% 60%', // #2563EB - Blue
29
+
30
+ // Text colors
31
+ textPrimary: '0 0% 0%', // Black
32
+ textSecondary: '0 0% 40%', // Dark Gray
33
+ textTertiary: '0 0% 60%', // Gray
34
+
35
+ // Background colors
36
+ bgPrimary: '0 0% 100%', // White
37
+ bgSecondary: '0 0% 98%', // Light Gray
38
+ bgQuaternary: '0 0% 96%', // Very Light Gray
39
+
40
+ // Border/Stroke colors
41
+ strokePrimary: '0 0% 80%', // Medium Gray
42
+ strokeSecondary: '0 0% 90%', // Light Gray
43
+
44
+ // Status colors
45
+ statusOnSale: '217 91% 60%', // Blue
46
+ statusSellingFast: '38 92% 50%', // Orange
47
+ statusSoldOut: '0 84% 60%', // Red
48
+
49
+ // Calendar specific
50
+ todayBg: '217 91% 97%', // Light blue
51
+ todayText: '217 91% 50%', // Blue
52
+ eventDotOnSale: '217 91% 60%',
53
+ eventDotSellingFast: '38 92% 50%',
54
+ eventDotSoldOut: '0 84% 60%',
55
+
56
+ // Interaction states
57
+ hoverBg: '0 0% 96%',
58
+ focusRing: '217 91% 60%',
59
+ };
60
+
61
+ // Dark theme
62
+ export const darkTheme = {
63
+ // Brand colors
64
+ brandPrimary: '217 91% 65%', // Lighter blue for dark mode
65
+
66
+ // Text colors
67
+ textPrimary: '0 0% 98%', // Near white
68
+ textSecondary: '0 0% 70%', // Light gray
69
+ textTertiary: '0 0% 50%', // Gray
70
+
71
+ // Background colors
72
+ bgPrimary: '0 0% 9%', // Very dark gray
73
+ bgSecondary: '0 0% 13%', // Dark gray
74
+ bgQuaternary: '0 0% 17%', // Slightly lighter
75
+
76
+ // Border/Stroke colors
77
+ strokePrimary: '0 0% 30%',
78
+ strokeSecondary: '0 0% 20%',
79
+
80
+ // Status colors
81
+ statusOnSale: '217 91% 65%',
82
+ statusSellingFast: '38 92% 55%',
83
+ statusSoldOut: '0 84% 65%',
84
+
85
+ // Calendar specific
86
+ todayBg: '217 50% 20%',
87
+ todayText: '217 91% 70%',
88
+ eventDotOnSale: '217 91% 65%',
89
+ eventDotSellingFast: '38 92% 55%',
90
+ eventDotSoldOut: '0 84% 65%',
91
+
92
+ // Interaction states
93
+ hoverBg: '0 0% 20%',
94
+ focusRing: '217 91% 65%',
95
+ };
96
+
97
+ // High contrast theme for accessibility
98
+ export const highContrastTheme = {
99
+ brandPrimary: '217 100% 50%',
100
+ textPrimary: '0 0% 0%',
101
+ textSecondary: '0 0% 20%',
102
+ textTertiary: '0 0% 30%',
103
+ bgPrimary: '0 0% 100%',
104
+ bgSecondary: '0 0% 95%',
105
+ bgQuaternary: '0 0% 90%',
106
+ strokePrimary: '0 0% 0%',
107
+ strokeSecondary: '0 0% 30%',
108
+ statusOnSale: '217 100% 40%',
109
+ statusSellingFast: '30 100% 40%',
110
+ statusSoldOut: '0 100% 40%',
111
+ todayBg: '217 100% 90%',
112
+ todayText: '217 100% 30%',
113
+ eventDotOnSale: '217 100% 40%',
114
+ eventDotSellingFast: '30 100% 40%',
115
+ eventDotSoldOut: '0 100% 40%',
116
+ hoverBg: '217 100% 95%',
117
+ focusRing: '217 100% 40%',
118
+ };
119
+
120
+ // Preset themes collection
121
+ export const themes = {
122
+ light: lightTheme,
123
+ dark: darkTheme,
124
+ highContrast: highContrastTheme,
125
+ };
126
+
127
+ /**
128
+ * Apply a theme to the calendar widget
129
+ * @param {Object} theme - Theme object with HSL color values
130
+ * @param {HTMLElement} container - Optional container element (defaults to :root)
131
+ */
132
+ export function applyTheme(theme, container = document.documentElement) {
133
+ const cssVarMap = {
134
+ brandPrimary: '--brand-primary',
135
+ textPrimary: '--text-primary',
136
+ textSecondary: '--text-secondary',
137
+ textTertiary: '--text-tertiary',
138
+ bgPrimary: '--bg-primary',
139
+ bgSecondary: '--bg-secondary',
140
+ bgQuaternary: '--bg-quaternary',
141
+ strokePrimary: '--stroke-primary',
142
+ strokeSecondary: '--stroke-secondary',
143
+ statusOnSale: '--status-on-sale',
144
+ statusSellingFast: '--status-selling-fast',
145
+ statusSoldOut: '--status-sold-out',
146
+ todayBg: '--today-bg',
147
+ todayText: '--today-text',
148
+ eventDotOnSale: '--event-dot-on-sale',
149
+ eventDotSellingFast: '--event-dot-selling-fast',
150
+ eventDotSoldOut: '--event-dot-sold-out',
151
+ hoverBg: '--hover-bg',
152
+ focusRing: '--focus-ring',
153
+ };
154
+
155
+ Object.entries(theme).forEach(([key, value]) => {
156
+ const cssVar = cssVarMap[key];
157
+ if (cssVar) {
158
+ container.style.setProperty(cssVar, value);
159
+ }
160
+ });
161
+
162
+ // Sync data-theme attribute when a known preset is applied so SC
163
+ // components (Stripe theme detector, DarkModeToggle reader, etc.)
164
+ // see the same intent. Partial/custom themes don't trigger this —
165
+ // they edit a few CSS vars without flipping the overall light/dark
166
+ // mode signal.
167
+ if (container.setAttribute) {
168
+ if (theme === darkTheme) {
169
+ container.setAttribute('data-theme', 'dark');
170
+ } else if (theme === lightTheme || theme === highContrastTheme) {
171
+ container.setAttribute('data-theme', 'light');
172
+ }
173
+ }
174
+ }
175
+
176
+ /**
177
+ * Generate CSS string for embedding
178
+ * @param {Object} theme - Theme object
179
+ * @returns {string} CSS string
180
+ */
181
+ export function generateThemeCSS(theme) {
182
+ const cssVarMap = {
183
+ brandPrimary: '--brand-primary',
184
+ textPrimary: '--text-primary',
185
+ textSecondary: '--text-secondary',
186
+ textTertiary: '--text-tertiary',
187
+ bgPrimary: '--bg-primary',
188
+ bgSecondary: '--bg-secondary',
189
+ bgQuaternary: '--bg-quaternary',
190
+ strokePrimary: '--stroke-primary',
191
+ strokeSecondary: '--stroke-secondary',
192
+ statusOnSale: '--status-on-sale',
193
+ statusSellingFast: '--status-selling-fast',
194
+ statusSoldOut: '--status-sold-out',
195
+ todayBg: '--today-bg',
196
+ todayText: '--today-text',
197
+ eventDotOnSale: '--event-dot-on-sale',
198
+ eventDotSellingFast: '--event-dot-selling-fast',
199
+ eventDotSoldOut: '--event-dot-sold-out',
200
+ hoverBg: '--hover-bg',
201
+ focusRing: '--focus-ring',
202
+ };
203
+
204
+ const lines = [];
205
+ Object.entries(theme).forEach(([key, value]) => {
206
+ const cssVar = cssVarMap[key];
207
+ if (cssVar) {
208
+ lines.push(` ${cssVar}: ${value};`);
209
+ }
210
+ });
211
+
212
+ return `:root {\n${lines.join('\n')}\n}`;
213
+ }
214
+
215
+ export default {
216
+ themes,
217
+ lightTheme,
218
+ darkTheme,
219
+ highContrastTheme,
220
+ applyTheme,
221
+ generateThemeCSS,
222
+ };