@getmicdrop/venue-calendar 3.6.0 → 3.7.1

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 (43) hide show
  1. package/README.md +661 -661
  2. package/dist/api/api.cjs +1 -1
  3. package/dist/api/api.cjs.map +1 -1
  4. package/dist/api/api.mjs +84 -81
  5. package/dist/api/api.mjs.map +1 -1
  6. package/dist/api/client.d.ts +0 -1
  7. package/dist/api/orders.d.ts +1 -2
  8. package/dist/api/types.d.ts +349 -349
  9. package/dist/seo/seo.cjs +1 -1
  10. package/dist/seo/seo.cjs.map +1 -1
  11. package/dist/seo/seo.mjs +40 -52
  12. package/dist/seo/seo.mjs.map +1 -1
  13. package/dist/seo/types.d.ts +135 -136
  14. package/dist/types/index.d.ts +387 -387
  15. package/dist/venue-calendar.css +1 -1
  16. package/dist/venue-calendar.es.js +33632 -37
  17. package/dist/venue-calendar.es.js.map +1 -1
  18. package/dist/venue-calendar.iife.js +29 -45
  19. package/dist/venue-calendar.iife.js.map +1 -1
  20. package/dist/venue-calendar.umd.js +29 -45
  21. package/dist/venue-calendar.umd.js.map +1 -1
  22. package/package.json +118 -121
  23. package/src/lib/theme.js +217 -213
  24. package/dist/CarouselView.legacy-DeWfW7JT.js +0 -64
  25. package/dist/CarouselView.legacy-DeWfW7JT.js.map +0 -1
  26. package/dist/Checkout.legacy-CJPThT4I.js +0 -1218
  27. package/dist/Checkout.legacy-CJPThT4I.js.map +0 -1
  28. package/dist/CollectionView.legacy-BG3g7XbI.js +0 -375
  29. package/dist/CollectionView.legacy-BG3g7XbI.js.map +0 -1
  30. package/dist/FeaturedView.legacy-CALzP8EW.js +0 -128
  31. package/dist/FeaturedView.legacy-CALzP8EW.js.map +0 -1
  32. package/dist/GalleryView.legacy-DIhYvOQU.js +0 -51
  33. package/dist/GalleryView.legacy-DIhYvOQU.js.map +0 -1
  34. package/dist/GroupedListView.legacy-C9dQ_v_d.js +0 -144
  35. package/dist/GroupedListView.legacy-C9dQ_v_d.js.map +0 -1
  36. package/dist/SeriesPage.legacy-hSI5Sm8W.js +0 -187
  37. package/dist/SeriesPage.legacy-hSI5Sm8W.js.map +0 -1
  38. package/dist/Success.legacy-DEjngxhO.js +0 -191
  39. package/dist/Success.legacy-DEjngxhO.js.map +0 -1
  40. package/dist/VenueCalendar-DvT1UOq-.js +0 -37371
  41. package/dist/VenueCalendar-DvT1UOq-.js.map +0 -1
  42. package/dist/colors-BZoMuXdh.js +0 -62
  43. package/dist/colors-BZoMuXdh.js.map +0 -1
package/src/lib/theme.js CHANGED
@@ -1,213 +1,217 @@
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
- // Backwards compat: also set the typo'd variable name
160
- if (key === 'textTertiary') {
161
- container.style.setProperty('--Text-Tartiary', value);
162
- }
163
- }
164
- });
165
- }
166
-
167
- /**
168
- * Generate CSS string for embedding
169
- * @param {Object} theme - Theme object
170
- * @returns {string} CSS string
171
- */
172
- export function generateThemeCSS(theme) {
173
- const cssVarMap = {
174
- brandPrimary: '--brand-primary',
175
- textPrimary: '--text-primary',
176
- textSecondary: '--text-secondary',
177
- textTertiary: '--text-tertiary',
178
- bgPrimary: '--bg-primary',
179
- bgSecondary: '--bg-secondary',
180
- bgQuaternary: '--bg-quaternary',
181
- strokePrimary: '--stroke-primary',
182
- strokeSecondary: '--stroke-secondary',
183
- statusOnSale: '--status-on-sale',
184
- statusSellingFast: '--status-selling-fast',
185
- statusSoldOut: '--status-sold-out',
186
- todayBg: '--today-bg',
187
- todayText: '--today-text',
188
- eventDotOnSale: '--event-dot-on-sale',
189
- eventDotSellingFast: '--event-dot-selling-fast',
190
- eventDotSoldOut: '--event-dot-sold-out',
191
- hoverBg: '--hover-bg',
192
- focusRing: '--focus-ring',
193
- };
194
-
195
- const lines = [];
196
- Object.entries(theme).forEach(([key, value]) => {
197
- const cssVar = cssVarMap[key];
198
- if (cssVar) {
199
- lines.push(` ${cssVar}: ${value};`);
200
- }
201
- });
202
-
203
- return `:root {\n${lines.join('\n')}\n}`;
204
- }
205
-
206
- export default {
207
- themes,
208
- lightTheme,
209
- darkTheme,
210
- highContrastTheme,
211
- applyTheme,
212
- generateThemeCSS,
213
- };
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-OnSale',
144
+ statusSellingFast: '--Status-SellingFast',
145
+ statusSoldOut: '--Status-SoldOut',
146
+ todayBg: '--Today-BG',
147
+ todayText: '--Today-Text',
148
+ eventDotOnSale: '--EventDot-OnSale',
149
+ eventDotSellingFast: '--EventDot-SellingFast',
150
+ eventDotSoldOut: '--EventDot-SoldOut',
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
+ // Backwards compat: also set the typo'd variable name
160
+ if (key === 'textTertiary') {
161
+ container.style.setProperty('--Text-Tartiary', value);
162
+ }
163
+ }
164
+ });
165
+ }
166
+
167
+ /**
168
+ * Generate CSS string for embedding
169
+ * @param {Object} theme - Theme object
170
+ * @returns {string} CSS string
171
+ */
172
+ export function generateThemeCSS(theme) {
173
+ const cssVarMap = {
174
+ brandPrimary: '--Brand-Primary',
175
+ textPrimary: '--Text-Primary',
176
+ textSecondary: '--Text-Secondary',
177
+ textTertiary: '--Text-Tertiary',
178
+ bgPrimary: '--BG-Primary',
179
+ bgSecondary: '--BG-Secondary',
180
+ bgQuaternary: '--BG-Quaternary',
181
+ strokePrimary: '--Stroke-Primary',
182
+ strokeSecondary: '--Stroke-Secondary',
183
+ statusOnSale: '--Status-OnSale',
184
+ statusSellingFast: '--Status-SellingFast',
185
+ statusSoldOut: '--Status-SoldOut',
186
+ todayBg: '--Today-BG',
187
+ todayText: '--Today-Text',
188
+ eventDotOnSale: '--EventDot-OnSale',
189
+ eventDotSellingFast: '--EventDot-SellingFast',
190
+ eventDotSoldOut: '--EventDot-SoldOut',
191
+ hoverBg: '--Hover-BG',
192
+ focusRing: '--Focus-Ring',
193
+ };
194
+
195
+ const lines = [];
196
+ Object.entries(theme).forEach(([key, value]) => {
197
+ const cssVar = cssVarMap[key];
198
+ if (cssVar) {
199
+ lines.push(` ${cssVar}: ${value};`);
200
+ // Backwards compat: also emit the typo'd variable name
201
+ if (key === 'textTertiary') {
202
+ lines.push(` --Text-Tartiary: ${value};`);
203
+ }
204
+ }
205
+ });
206
+
207
+ return `:root {\n${lines.join('\n')}\n}`;
208
+ }
209
+
210
+ export default {
211
+ themes,
212
+ lightTheme,
213
+ darkTheme,
214
+ highContrastTheme,
215
+ applyTheme,
216
+ generateThemeCSS,
217
+ };
@@ -1,64 +0,0 @@
1
- import "svelte/internal/disclose-version";
2
- import * as e from "svelte/internal/client";
3
- import { onMount as _ } from "svelte";
4
- import { f as k, G as C } from "./VenueCalendar-DvT1UOq-.js";
5
- var S = e.from_html('<button class="carousel-arrow absolute top-1/2 -translate-y-1/2 z-10 w-10 h-10 rounded-full flex items-center justify-center bg-card/90 border border-border shadow-lg cursor-pointer transition-opacity duration-200 hover:bg-card hover: focus-visible:outline-2 focus-visible:outline-brand-primary:outline-brand-primary focus-visible:outline-offset-2 svelte-1lcnwer" style="left: 8px" aria-label="Scroll left"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5 text-text-secondary"><polyline points="15 18 9 12 15 6"></polyline></svg></button>'), j = e.from_html('<div class="carousel-item svelte-1lcnwer" role="listitem"><!></div>'), B = e.from_html('<button class="carousel-arrow absolute top-1/2 -translate-y-1/2 z-10 w-10 h-10 rounded-full flex items-center justify-center bg-card/90 border border-border shadow-lg cursor-pointer transition-opacity duration-200 hover:bg-card hover: focus-visible:outline-2 focus-visible:outline-brand-primary:outline-brand-primary focus-visible:outline-offset-2 svelte-1lcnwer" style="right: 8px" aria-label="Scroll right"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-5 h-5 text-text-secondary"><polyline points="9 18 15 12 9 6"></polyline></svg></button>'), W = e.from_html('<section class="w-full" aria-label="Events carousel"><h2 class="sr-only svelte-1lcnwer">Upcoming events</h2> <div class="relative"><!> <div class="carousel-scroll flex gap-4 overflow-x-auto p-2 sm:p-3 lg:p-4 svelte-1lcnwer" role="list"></div> <!></div></section>');
6
- function G(b, i) {
7
- e.push(i, !0);
8
- let h = e.prop(i, "events", 19, () => []), o, d = e.state(!1), u = e.state(!1), n = e.state(!1), g = e.derived(() => k(h()));
9
- function a() {
10
- if (!o) return;
11
- const { scrollLeft: t, scrollWidth: r, clientWidth: l } = o;
12
- e.set(d, t > 1), e.set(u, t + l < r - 1), e.set(n, r > l + 1);
13
- }
14
- function v(t) {
15
- if (!o) return;
16
- const r = o.querySelector(".carousel-item");
17
- if (!r) return;
18
- const l = r.offsetWidth + 16;
19
- o.scrollBy({ left: t * l, behavior: "smooth" });
20
- }
21
- _(() => {
22
- a();
23
- const t = new ResizeObserver(() => a());
24
- return o && t.observe(o), () => t.disconnect();
25
- });
26
- var c = W(), f = e.sibling(e.child(c), 2), p = e.child(f);
27
- {
28
- var w = (t) => {
29
- var r = S();
30
- e.delegated("click", r, () => v(-1)), e.append(t, r);
31
- };
32
- e.if(p, (t) => {
33
- e.get(n) && e.get(d) && t(w);
34
- });
35
- }
36
- var s = e.sibling(p, 2);
37
- e.each(s, 21, () => e.get(g), e.index, (t, r) => {
38
- var l = j(), x = e.child(l);
39
- C(x, {
40
- get event() {
41
- return e.get(r);
42
- },
43
- get oneventClick() {
44
- return i.oneventClick;
45
- }
46
- }), e.reset(l), e.append(t, l);
47
- }), e.reset(s), e.bind_this(s, (t) => o = t, () => o);
48
- var m = e.sibling(s, 2);
49
- {
50
- var y = (t) => {
51
- var r = B();
52
- e.delegated("click", r, () => v(1)), e.append(t, r);
53
- };
54
- e.if(m, (t) => {
55
- e.get(n) && e.get(u) && t(y);
56
- });
57
- }
58
- e.reset(f), e.reset(c), e.event("scroll", s, a), e.append(b, c), e.pop();
59
- }
60
- e.delegate(["click"]);
61
- export {
62
- G as default
63
- };
64
- //# sourceMappingURL=CarouselView.legacy-DeWfW7JT.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CarouselView.legacy-DeWfW7JT.js","sources":["../src/components/Calendar/CarouselView.legacy.svelte"],"sourcesContent":["<script>\n import { onMount } from \"svelte\";\n import GalleryCard from \"./GalleryCard.svelte\";\n import { filterTodayAndFuture } from \"$lib/utils/browse-status.js\";\n\n let { events = [], oneventClick } = $props();\n\n let scrollContainer;\n let canScrollLeft = $state(false);\n let canScrollRight = $state(false);\n let showArrows = $state(false);\n\n // Filter to today and future, sorted chronologically\n let futureEvents = $derived(filterTodayAndFuture(events));\n\n function updateScrollState() {\n if (!scrollContainer) return;\n const { scrollLeft, scrollWidth, clientWidth } = scrollContainer;\n canScrollLeft = scrollLeft > 1;\n canScrollRight = scrollLeft + clientWidth < scrollWidth - 1;\n showArrows = scrollWidth > clientWidth + 1;\n }\n\n function scrollByCard(direction) {\n if (!scrollContainer) return;\n // Get the width of the first card item\n const firstCard = scrollContainer.querySelector('.carousel-item');\n if (!firstCard) return;\n const cardWidth = firstCard.offsetWidth + 16; // card width + gap\n scrollContainer.scrollBy({ left: direction * cardWidth, behavior: 'smooth' });\n }\n\n onMount(() => {\n updateScrollState();\n // Use ResizeObserver to update on container resize\n const observer = new ResizeObserver(() => updateScrollState());\n if (scrollContainer) {\n observer.observe(scrollContainer);\n }\n return () => observer.disconnect();\n });\n</script>\n\n<section class=\"w-full\" aria-label=\"Events carousel\">\n <h2 class=\"sr-only\">Upcoming events</h2>\n\n <div class=\"relative\">\n <!-- Left arrow -->\n {#if showArrows && canScrollLeft}\n <button\n class=\"carousel-arrow absolute top-1/2 -translate-y-1/2 z-10 w-10 h-10 rounded-full flex items-center justify-center bg-card/90 border border-border shadow-lg cursor-pointer transition-opacity duration-200 hover:bg-card hover: focus-visible:outline-2 focus-visible:outline-brand-primary:outline-brand-primary focus-visible:outline-offset-2\"\n style=\"left: 8px\"\n onclick={() => scrollByCard(-1)}\n aria-label=\"Scroll left\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"w-5 h-5 text-text-secondary\"><polyline points=\"15 18 9 12 15 6\"></polyline></svg>\n </button>\n {/if}\n\n <!-- Scroll container -->\n <div\n class=\"carousel-scroll flex gap-4 overflow-x-auto p-2 sm:p-3 lg:p-4\"\n bind:this={scrollContainer}\n onscroll={updateScrollState}\n role=\"list\"\n >\n {#each futureEvents as event}\n <div class=\"carousel-item\" role=\"listitem\">\n <GalleryCard {event} {oneventClick} />\n </div>\n {/each}\n </div>\n\n <!-- Right arrow -->\n {#if showArrows && canScrollRight}\n <button\n class=\"carousel-arrow absolute top-1/2 -translate-y-1/2 z-10 w-10 h-10 rounded-full flex items-center justify-center bg-card/90 border border-border shadow-lg cursor-pointer transition-opacity duration-200 hover:bg-card hover: focus-visible:outline-2 focus-visible:outline-brand-primary:outline-brand-primary focus-visible:outline-offset-2\"\n style=\"right: 8px\"\n onclick={() => scrollByCard(1)}\n aria-label=\"Scroll right\"\n >\n <svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"w-5 h-5 text-text-secondary\"><polyline points=\"9 18 15 12 9 6\"></polyline></svg>\n </button>\n {/if}\n </div>\n</section>\n\n<style>\n .carousel-scroll {\n scroll-snap-type: x mandatory;\n -webkit-overflow-scrolling: touch;\n scrollbar-width: none;\n }\n\n .carousel-scroll::-webkit-scrollbar {\n display: none;\n }\n\n .carousel-item {\n scroll-snap-align: start;\n flex: 0 0 85%;\n }\n\n /* Tablet: 2 visible cards with peek */\n @media (min-width: 640px) {\n .carousel-item {\n flex: 0 0 calc(50% - 8px);\n }\n }\n\n /* Desktop: 3 visible cards with peek */\n @media (min-width: 1024px) {\n .carousel-item {\n flex: 0 0 calc(33.333% - 11px);\n }\n }\n\n /* Hide arrows on mobile -- touch scrolling is natural */\n @media (max-width: 639px) {\n .carousel-arrow {\n display: none;\n }\n }\n\n /* Reduced motion */\n @media (prefers-reduced-motion: reduce) {\n .carousel-scroll {\n scroll-behavior: auto;\n }\n }\n\n /* Screen reader only text */\n .sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip: rect(0, 0, 0, 0);\n white-space: nowrap;\n border-width: 0;\n }\n</style>\n"],"names":["events","$","$$props","scrollContainer","canScrollLeft","canScrollRight","showArrows","futureEvents","filterTodayAndFuture","updateScrollState","scrollLeft","scrollWidth","clientWidth","scrollByCard","direction","firstCard","cardWidth","onMount","observer","section","root","div","button","root_1","$$render","consequent","div_1","node","$$anchor","event","div_2","root_2","GalleryCard","node_1","$$value","button_1","root_3","consequent_1"],"mappings":";;;;;iBAAA;;MAKQA,IAAMC,EAAA,KAAAC,GAAA,UAAA,IAAA,MAAA,EAAA,GAERC,GACAC,IAAgBH,EAAA,MAAO,EAAK,GAC5BI,IAAiBJ,EAAA,MAAO,EAAK,GAC7BK,IAAaL,EAAA,MAAO,EAAK,GAGzBM,IAAYN,EAAA,QAAA,MAAYO,EAAqBR,EAAM,CAAA,CAAA;AAE9C,WAAAS,IAAoB;SACtBN,EAAe;AACZ,UAAA,EAAA,YAAAO,GAAY,aAAAC,GAAa,aAAAC,EAAW,IAAKT;UACjDC,GAAgBM,IAAa,CAAC,GAC9BT,EAAA,IAAAI,GAAiBK,IAAaE,IAAcD,IAAc,CAAC,GAC3DV,EAAA,IAAAK,GAAaK,IAAcC,IAAc,CAAC;AAAA,EAC5C;WAESC,EAAaC,GAAW;SAC1BX,EAAe;AAEd,UAAAY,IAAYZ,EAAgB,cAAc,gBAAgB;SAC3DY,EAAS;AACR,UAAAC,IAAYD,EAAU,cAAc;AAC1C,IAAAZ,EAAgB,SAAQ,EAAG,MAAMW,IAAYE,GAAW,UAAU,UAAQ;AAAA,EAC5E;AAEA,EAAAC,EAAO,MAAO;AACZ,IAAAR,EAAiB;UAEXS,IAAQ,IAAO,eAAc,MAAOT,EAAiB,CAAA;AACvD,WAAAN,KACFe,EAAS,QAAQf,CAAe,GAErB,MAAAe,EAAS,WAAU;AAAA,EAClC,CAAC;MAGFC,IAAOC,EAAA,GAGLC,sBAHFF,CAAO,GAAA,CAAA,eAGLE,CAAG;;;UAGCC,IAAKC,EAAA;2BAALD,GAAK,MAGWT,EAAY,EAAG,CAAA,eAH/BS,CAAK;AAAA;;AADH,MAAArB,EAAA,IAAAK,CAAU,WAAIF,CAAa,KAAAoB,EAAAC,CAAA;AAAA;;MAY/BC,IAAEzB,EAAA,QAAA0B,GAAA,CAAA;SAAFD,GAAE,IAAA,MAAAzB,EAAA,IAMMM,CAAY,GAAAN,EAAA,OAAA,CAAA2B,GAAIC,MAAK;QACzBC,IAAGC,EAAA,eAAHD,CAAG;AACD,IAAAE,EAAWC,GAAA;AAAA;qBAAEJ,CAAK;AAAA;;;;gBADpBC,CAAG,eAAHA,CAAG;AAAA,cAPPJ,CAAE,eAAFA,GAAE,CAAAQ,MAEU/B,IAAe+B,GAAA,MAAf/B,CAAe;oBAF3BuB,GAAE,CAAA;;;UAeAS,IAAKC,EAAA;2BAALD,GAAK,MAGWtB,EAAa,CAAC,CAAA,eAH9BsB,CAAK;AAAA;;AADH,MAAAlC,EAAA,IAAAK,CAAU,WAAID,CAAc,KAAAmB,EAAAa,CAAA;AAAA;;UA5BlChB,CAAG,WAHLF,CAAO,GAiBHlB,EAAA,MAAA,UAAAyB,GAGWjB,CAAiB,eApBhCU,CAAO;AAFA;;"}