@getmicdrop/venue-calendar 4.2.19 → 4.2.21

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 (78) hide show
  1. package/README.md +809 -809
  2. package/dist/{ArrowLeftIcon-CNxF9YFb.js → ArrowLeftIcon-BqN28ha3.js} +1 -1
  3. package/dist/{BlockPlaceholder-CnvIm7eh.js → BlockPlaceholder-BbAt-Tg-.js} +1 -1
  4. package/dist/{Calendar-D7s5gLk_.js → Calendar-U5hnCpbC.js} +4 -4
  5. package/dist/{CalendarFoundryView-BrsToTIb.js → CalendarFoundryView-Dp9aWtMW.js} +21 -21
  6. package/dist/{CalendarIcon-BBTaRYp7.js → CalendarIcon-rW7mGNf-.js} +1 -1
  7. package/dist/{CartView-cHL2n0fE.js → CartView-C_Jserc3.js} +17 -17
  8. package/dist/{Checkout-Blc7IuZ2.js → Checkout--3sirpfA.js} +19 -19
  9. package/dist/{Checkout-DNVyBcrm.js → Checkout-6iLNyJL4.js} +12 -12
  10. package/dist/{CheckoutTimer-D5i2F8al.js → CheckoutTimer-DeggCjT7.js} +2 -2
  11. package/dist/{ChevronDownIcon-Ba1RZBsy.js → ChevronDownIcon-CRBoka3q.js} +1 -1
  12. package/dist/{ClockIcon-DNJWLc1C.js → ClockIcon-C2SSi7r9.js} +1 -1
  13. package/dist/{CloseIcon-BpvJsO5u.js → CloseIcon-DbyLo0wv.js} +1 -1
  14. package/dist/{CollectionView-DzoCBduF.js → CollectionView-DsY-3zrB.js} +6 -6
  15. package/dist/{Event-D5u7y0w3.js → Event-Cg55HVe2.js} +15 -15
  16. package/dist/{EventPage-Ddslq4xC.js → EventPage-B0D2Nt8W.js} +253 -221
  17. package/dist/{Input-BvutquC_.js → Input-CsEAqNoQ.js} +1 -1
  18. package/dist/{MailIcon-r5G2Lccc.js → MailIcon-AAaLCJoB.js} +1 -1
  19. package/dist/{Modal-kJYg2hMo.js → Modal-CkmAyUI8.js} +2 -2
  20. package/dist/{ModalFooter-DMxM0E8Y.js → ModalFooter-qMsABjsX.js} +1 -1
  21. package/dist/{PasswordInput-D5_BuRnw.js → PasswordInput-D8t781xL.js} +1 -1
  22. package/dist/{ScarcityBadge-R32tzjFi.js → ScarcityBadge-D8jxkAwg.js} +2 -2
  23. package/dist/{SeriesPage-BPm7CNzY.js → SeriesPage-DJd4xn3s.js} +3 -3
  24. package/dist/{Success-CXI2Xtdz.js → Success-B6-9onbn.js} +11 -11
  25. package/dist/{TagIcon-_OxEQnM3.js → TagIcon-W-WW2VlE.js} +1 -1
  26. package/dist/{WarningCircleIcon-D1Kt1Sw1.js → WarningCircleIcon-MDOyrbVe.js} +1 -1
  27. package/dist/{WarningTriIcon-DjcnvD51.js → WarningTriIcon-xGAKz2tQ.js} +1 -1
  28. package/dist/api/api.cjs +1 -1
  29. package/dist/api/api.mjs +40 -26
  30. package/dist/api/index.d.ts +2 -2
  31. package/dist/api/types.d.ts +545 -545
  32. package/dist/api/waitlist.d.ts +13 -0
  33. package/dist/{colors-5g6cmoXX.js → colors-Cda5acAs.js} +48 -34
  34. package/dist/{constants-BWfNecCz.js → constants-CJl8xBgZ.js} +8 -0
  35. package/dist/{copyToClipboard-BTVrJgtZ.js → copyToClipboard-CR4oQ-Cl.js} +1 -1
  36. package/dist/{event-transform-0VCBk_zn.js → event-transform-CiNAjNiG.js} +9 -9
  37. package/dist/{href-D7yXIGzE.js → href-DVMxZ5ld.js} +1 -1
  38. package/dist/{i18n-D7pvVga7.js → i18n-BjGCvdyp.js} +3 -3
  39. package/dist/{labels-7f_yKBtq.js → labels-B3HOg72i.js} +1 -1
  40. package/dist/{modalManager.svelte-DDWCrGed.js → modalManager.svelte-DWKDviaT.js} +1 -1
  41. package/dist/{order-totals-DptlFbmv.js → order-totals-Bb6CAQ2m.js} +1 -1
  42. package/dist/{phoneUtils-PJqYw0dJ.js → phoneUtils-BzmQamKZ.js} +1 -1
  43. package/dist/seo/types.d.ts +156 -156
  44. package/dist/{serverTotals-COgFExPF.js → serverTotals-BgBXBXhP.js} +1 -1
  45. package/dist/{shareCopyFeedback.svelte-DZMLGA3y.js → shareCopyFeedback.svelte-Ds8OOtQ2.js} +2 -2
  46. package/dist/{to-event-card-props-BaPEUAZW.js → to-event-card-props-Bxj-yK9y.js} +1 -1
  47. package/dist/types/index.d.ts +509 -509
  48. package/dist/{utils-DLfxcnPk.js → utils-DMilKJFC.js} +1 -1
  49. package/dist/venue-calendar.css +1 -1
  50. package/dist/venue-calendar.es.js +27 -27
  51. package/dist/venue-calendar.iife.js +22 -22
  52. package/dist/venue-calendar.umd.js +55 -55
  53. package/package.json +2 -2
  54. package/src/lib/theme.js +222 -222
  55. /package/dist/locales/{4.2.19 → 4.2.21}/flow/de.js +0 -0
  56. /package/dist/locales/{4.2.19 → 4.2.21}/flow/es.js +0 -0
  57. /package/dist/locales/{4.2.19 → 4.2.21}/flow/fr.js +0 -0
  58. /package/dist/locales/{4.2.19 → 4.2.21}/flow/id.js +0 -0
  59. /package/dist/locales/{4.2.19 → 4.2.21}/flow/it.js +0 -0
  60. /package/dist/locales/{4.2.19 → 4.2.21}/flow/ja.js +0 -0
  61. /package/dist/locales/{4.2.19 → 4.2.21}/flow/ko.js +0 -0
  62. /package/dist/locales/{4.2.19 → 4.2.21}/flow/nl.js +0 -0
  63. /package/dist/locales/{4.2.19 → 4.2.21}/flow/pl.js +0 -0
  64. /package/dist/locales/{4.2.19 → 4.2.21}/flow/pt-br.js +0 -0
  65. /package/dist/locales/{4.2.19 → 4.2.21}/flow/tr.js +0 -0
  66. /package/dist/locales/{4.2.19 → 4.2.21}/flow/zh.js +0 -0
  67. /package/dist/locales/{4.2.19 → 4.2.21}/main/de.js +0 -0
  68. /package/dist/locales/{4.2.19 → 4.2.21}/main/es.js +0 -0
  69. /package/dist/locales/{4.2.19 → 4.2.21}/main/fr.js +0 -0
  70. /package/dist/locales/{4.2.19 → 4.2.21}/main/id.js +0 -0
  71. /package/dist/locales/{4.2.19 → 4.2.21}/main/it.js +0 -0
  72. /package/dist/locales/{4.2.19 → 4.2.21}/main/ja.js +0 -0
  73. /package/dist/locales/{4.2.19 → 4.2.21}/main/ko.js +0 -0
  74. /package/dist/locales/{4.2.19 → 4.2.21}/main/nl.js +0 -0
  75. /package/dist/locales/{4.2.19 → 4.2.21}/main/pl.js +0 -0
  76. /package/dist/locales/{4.2.19 → 4.2.21}/main/pt-br.js +0 -0
  77. /package/dist/locales/{4.2.19 → 4.2.21}/main/tr.js +0 -0
  78. /package/dist/locales/{4.2.19 → 4.2.21}/main/zh.js +0 -0
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@getmicdrop/venue-calendar",
3
3
  "_version_comment": "4.1.55 was the last PUBLISHED version, and the tree carried 36 commits npm's 4.1.55 does not have — including the gate-password security fix and four money fixes. A filename must never reuse a version npm has taken (jsDelivr/unpkg cache the FIRST bytes they see under `@4.1.55` forever, so republishing that number ships the old widget to every venue that pinned it). Bumped to 4.2.0 here, BEFORE anything is built for publish. `npm run release:preflight` refuses to proceed when this number already exists in the registry.",
4
- "version": "4.2.19",
4
+ "version": "4.2.21",
5
5
  "description": "A customizable Svelte calendar component for displaying comedy events",
6
6
  "type": "module",
7
7
  "types": "./dist/types/index.d.ts",
@@ -154,7 +154,7 @@
154
154
  "_devDependencies_pin_comment": "Three EXACT pins in here are load-bearing and must not be re-caretted by a dependency bot. (1) `@getmicdrop/svelte-components` — the ES/UMD/IIFE builds do NOT externalize SC, so it is COMPILED INTO every shipped artifact. RESTORED TO AN EXACT PIN 2026-08-23, having drifted back to a caret at some point between 6.24.311 and 6.24.316 — exactly the re-caretting this note warns about, which is worth knowing recurs. Under a caretted range like `^6.24.311` the SC version a venue's browser executes is whatever the range floats to on the publish machine at publish time, which is not recorded anywhere and is not reproducible after the fact; the `overrides` block below cannot help (it only ever covered esbuild, and consumers ignore a dependency's overrides entirely). Pinned exact so the artifact and the manifest agree, and vite.config.lib.js stamps the resolved version into the bundle as __VC_SC_VERSION__ so a venue's devtools can answer 'which SC is this?'. (2) `svelte` — the compiler whose private internal/client calls the pre-compiled dist binds to. `^5.56.9` let the compiler move under a peer range that stayed still; see _peerDependencies_comment. (3) `@stripe/stripe-js` in dependencies — see its own note there.",
155
155
  "devDependencies": {
156
156
  "@eslint/js": "^10.0.1",
157
- "@getmicdrop/svelte-components": "6.24.319",
157
+ "@getmicdrop/svelte-components": "^6.24.319",
158
158
  "@playwright/test": "^1.60.0",
159
159
  "@size-limit/file": "^13.0.3",
160
160
  "@sveltejs/adapter-auto": "^7.0.1",
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
+ };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes