@opensite/ui 2.8.8 → 2.9.0

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 (147) hide show
  1. package/dist/about-culture-tabs.cjs +174 -174
  2. package/dist/about-culture-tabs.js +174 -174
  3. package/dist/about-developer-profile.cjs +200 -200
  4. package/dist/about-developer-profile.js +198 -198
  5. package/dist/about-developer-story.cjs +142 -142
  6. package/dist/about-developer-story.js +142 -142
  7. package/dist/about-mission-dual-image.cjs +142 -142
  8. package/dist/about-mission-dual-image.js +142 -142
  9. package/dist/about-mission-features.cjs +142 -142
  10. package/dist/about-mission-features.js +142 -142
  11. package/dist/about-network-spotlight.cjs +142 -142
  12. package/dist/about-network-spotlight.js +142 -142
  13. package/dist/about-story-expertise.cjs +142 -142
  14. package/dist/about-story-expertise.js +142 -142
  15. package/dist/about-streamline-team.cjs +142 -142
  16. package/dist/about-streamline-team.js +142 -142
  17. package/dist/carousel-feature-badge.cjs +162 -42
  18. package/dist/carousel-feature-badge.d.cts +14 -1
  19. package/dist/carousel-feature-badge.d.ts +14 -1
  20. package/dist/carousel-feature-badge.js +163 -43
  21. package/dist/community-initiatives.cjs +142 -142
  22. package/dist/community-initiatives.js +142 -142
  23. package/dist/components.cjs +723 -1378
  24. package/dist/components.d.cts +0 -2
  25. package/dist/components.d.ts +0 -2
  26. package/dist/components.js +633 -1287
  27. package/dist/contact-map.cjs +14 -1083
  28. package/dist/contact-map.d.cts +13 -3
  29. package/dist/contact-map.d.ts +13 -3
  30. package/dist/contact-map.js +14 -1083
  31. package/dist/cta-feature-checklist.cjs +142 -142
  32. package/dist/cta-feature-checklist.js +142 -142
  33. package/dist/faq-numbered-grid.cjs +142 -142
  34. package/dist/faq-numbered-grid.js +142 -142
  35. package/dist/feature-animated-carousel.cjs +142 -142
  36. package/dist/feature-animated-carousel.js +142 -142
  37. package/dist/feature-bento-utilities.cjs +142 -142
  38. package/dist/feature-bento-utilities.js +142 -142
  39. package/dist/feature-capabilities-grid.cjs +142 -142
  40. package/dist/feature-capabilities-grid.js +142 -142
  41. package/dist/feature-category-image-cards.cjs +142 -142
  42. package/dist/feature-category-image-cards.js +142 -142
  43. package/dist/feature-icon-grid-bordered.cjs +142 -142
  44. package/dist/feature-icon-grid-bordered.js +142 -142
  45. package/dist/feature-icon-grid-muted.cjs +142 -142
  46. package/dist/feature-icon-grid-muted.js +142 -142
  47. package/dist/feature-numbered-cards.cjs +142 -142
  48. package/dist/feature-numbered-cards.js +142 -142
  49. package/dist/feature-three-column-values.cjs +142 -142
  50. package/dist/feature-three-column-values.js +142 -142
  51. package/dist/hero-ad-campaign-expert.cjs +142 -142
  52. package/dist/hero-ad-campaign-expert.js +142 -142
  53. package/dist/hero-adaptable-product-grid.cjs +142 -142
  54. package/dist/hero-adaptable-product-grid.js +142 -142
  55. package/dist/hero-agency-animated-images.cjs +142 -142
  56. package/dist/hero-agency-animated-images.js +142 -142
  57. package/dist/hero-announcement-badge.cjs +142 -142
  58. package/dist/hero-announcement-badge.js +142 -142
  59. package/dist/hero-badge-image-split.cjs +142 -142
  60. package/dist/hero-badge-image-split.js +142 -142
  61. package/dist/hero-business-carousel-dots.cjs +142 -142
  62. package/dist/hero-business-carousel-dots.js +142 -142
  63. package/dist/hero-business-operations-mosaic.cjs +142 -142
  64. package/dist/hero-business-operations-mosaic.js +142 -142
  65. package/dist/hero-conversation-intelligence.cjs +142 -142
  66. package/dist/hero-conversation-intelligence.js +142 -142
  67. package/dist/hero-creative-studio-stacked.cjs +142 -142
  68. package/dist/hero-creative-studio-stacked.js +142 -142
  69. package/dist/hero-crm-streamlined.cjs +142 -142
  70. package/dist/hero-crm-streamlined.js +142 -142
  71. package/dist/hero-customer-support-layered.cjs +142 -142
  72. package/dist/hero-customer-support-layered.js +142 -142
  73. package/dist/hero-design-showcase-logos.cjs +142 -142
  74. package/dist/hero-design-showcase-logos.js +142 -142
  75. package/dist/hero-design-system-3d.cjs +142 -142
  76. package/dist/hero-design-system-3d.js +142 -142
  77. package/dist/hero-developer-tools-code.cjs +142 -142
  78. package/dist/hero-developer-tools-code.js +142 -142
  79. package/dist/hero-digital-agency-fullscreen.cjs +142 -142
  80. package/dist/hero-digital-agency-fullscreen.js +142 -142
  81. package/dist/hero-ecommerce-product-showcase.cjs +174 -174
  82. package/dist/hero-ecommerce-product-showcase.js +174 -174
  83. package/dist/hero-event-registration.cjs +142 -142
  84. package/dist/hero-event-registration.js +142 -142
  85. package/dist/hero-fullscreen-background-image.cjs +142 -142
  86. package/dist/hero-fullscreen-background-image.js +142 -142
  87. package/dist/hero-gradient-avatars-rating.cjs +142 -142
  88. package/dist/hero-gradient-avatars-rating.js +142 -142
  89. package/dist/hero-gradient-client-focused.cjs +142 -142
  90. package/dist/hero-gradient-client-focused.js +142 -142
  91. package/dist/hero-hiring-animated-text.cjs +142 -142
  92. package/dist/hero-hiring-animated-text.js +142 -142
  93. package/dist/hero-image-left-content.cjs +142 -142
  94. package/dist/hero-image-left-content.js +142 -142
  95. package/dist/hero-innovation-image-grid.cjs +142 -142
  96. package/dist/hero-innovation-image-grid.js +142 -142
  97. package/dist/hero-mental-health-team.cjs +142 -142
  98. package/dist/hero-mental-health-team.js +142 -142
  99. package/dist/hero-minimal-centered-dark.cjs +174 -174
  100. package/dist/hero-minimal-centered-dark.js +174 -174
  101. package/dist/hero-presentation-platform-video.cjs +142 -142
  102. package/dist/hero-presentation-platform-video.js +142 -142
  103. package/dist/hero-product-showcase-floating.cjs +174 -174
  104. package/dist/hero-product-showcase-floating.js +174 -174
  105. package/dist/hero-shared-inbox-layered.cjs +142 -142
  106. package/dist/hero-shared-inbox-layered.js +142 -142
  107. package/dist/hero-software-growth-video-dialog.cjs +142 -142
  108. package/dist/hero-software-growth-video-dialog.js +142 -142
  109. package/dist/hero-spiral-pattern-cards.cjs +174 -174
  110. package/dist/hero-spiral-pattern-cards.js +174 -174
  111. package/dist/hero-split-geometric-shapes.cjs +142 -142
  112. package/dist/hero-split-geometric-shapes.js +142 -142
  113. package/dist/hero-startup-launch-cta.cjs +174 -174
  114. package/dist/hero-startup-launch-cta.js +174 -174
  115. package/dist/hero-stats-social-proof.cjs +174 -174
  116. package/dist/hero-stats-social-proof.js +174 -174
  117. package/dist/hero-task-timer-animated.cjs +142 -142
  118. package/dist/hero-task-timer-animated.js +142 -142
  119. package/dist/hero-testimonial-image-grid.cjs +142 -142
  120. package/dist/hero-testimonial-image-grid.js +142 -142
  121. package/dist/hero-therapy-testimonial-grid.cjs +142 -142
  122. package/dist/hero-therapy-testimonial-grid.js +142 -142
  123. package/dist/hero-ui-library-showcase.cjs +142 -142
  124. package/dist/hero-ui-library-showcase.js +142 -142
  125. package/dist/hero-video-background-dark.cjs +174 -174
  126. package/dist/hero-video-background-dark.js +174 -174
  127. package/dist/hero-video-dialog-gradient.cjs +142 -142
  128. package/dist/hero-video-dialog-gradient.js +142 -142
  129. package/dist/hero-video-overlay-stars.cjs +142 -142
  130. package/dist/hero-video-overlay-stars.js +142 -142
  131. package/dist/hero-welcome-asymmetric-images.cjs +142 -142
  132. package/dist/hero-welcome-asymmetric-images.js +142 -142
  133. package/dist/index.cjs +725 -1380
  134. package/dist/index.d.cts +0 -2
  135. package/dist/index.d.ts +0 -2
  136. package/dist/index.js +634 -1288
  137. package/dist/registry.cjs +2201 -2827
  138. package/dist/registry.js +948 -1574
  139. package/dist/testimonials-masonry-grid.cjs +142 -142
  140. package/dist/testimonials-masonry-grid.js +142 -142
  141. package/dist/testimonials-stats-header.cjs +159 -159
  142. package/dist/testimonials-stats-header.js +159 -159
  143. package/package.json +4 -7
  144. package/dist/geo-map.cjs +0 -1117
  145. package/dist/geo-map.d.cts +0 -92
  146. package/dist/geo-map.d.ts +0 -92
  147. package/dist/geo-map.js +0 -1095
@@ -3,11 +3,10 @@
3
3
 
4
4
  var React4 = require('react');
5
5
  var integration = require('@page-speed/forms/integration');
6
+ var maps = require('@page-speed/maps');
6
7
  var clsx = require('clsx');
7
8
  var tailwindMerge = require('tailwind-merge');
8
9
  var jsxRuntime = require('react/jsx-runtime');
9
- var maps = require('@page-speed/maps');
10
- var classVarianceAuthority = require('class-variance-authority');
11
10
  var icon = require('@page-speed/icon');
12
11
  var img = require('@page-speed/img');
13
12
 
@@ -58,1085 +57,6 @@ function CardContent({ className, ...props }) {
58
57
  }
59
58
  );
60
59
  }
61
- function normalizePhoneNumber(input) {
62
- const trimmed = input.trim();
63
- if (trimmed.toLowerCase().startsWith("tel:")) {
64
- return trimmed;
65
- }
66
- const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
67
- if (match) {
68
- const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
69
- const extension = match[3];
70
- const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
71
- const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
72
- return `tel:${withExtension}`;
73
- }
74
- const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
75
- return `tel:${cleaned}`;
76
- }
77
- function normalizeEmail(input) {
78
- const trimmed = input.trim();
79
- if (trimmed.toLowerCase().startsWith("mailto:")) {
80
- return trimmed;
81
- }
82
- return `mailto:${trimmed}`;
83
- }
84
- function isEmail(input) {
85
- const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
86
- return emailRegex.test(input.trim());
87
- }
88
- function isPhoneNumber(input) {
89
- const trimmed = input.trim();
90
- if (trimmed.toLowerCase().startsWith("tel:")) {
91
- return true;
92
- }
93
- const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
94
- return phoneRegex.test(trimmed);
95
- }
96
- function isInternalUrl(href) {
97
- if (typeof window === "undefined") {
98
- return href.startsWith("/") && !href.startsWith("//");
99
- }
100
- const trimmed = href.trim();
101
- if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
102
- return true;
103
- }
104
- try {
105
- const url = new URL(trimmed, window.location.href);
106
- const currentOrigin = window.location.origin;
107
- const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
108
- return normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin);
109
- } catch {
110
- return false;
111
- }
112
- }
113
- function toRelativePath(href) {
114
- if (typeof window === "undefined") {
115
- return href;
116
- }
117
- const trimmed = href.trim();
118
- if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
119
- return trimmed;
120
- }
121
- try {
122
- const url = new URL(trimmed, window.location.href);
123
- const currentOrigin = window.location.origin;
124
- const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
125
- if (normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin)) {
126
- return url.pathname + url.search + url.hash;
127
- }
128
- } catch {
129
- }
130
- return trimmed;
131
- }
132
- function useNavigation({
133
- href,
134
- onClick
135
- } = {}) {
136
- const linkType = React4__namespace.useMemo(() => {
137
- if (!href || href.trim() === "") {
138
- return onClick ? "none" : "none";
139
- }
140
- const trimmed = href.trim();
141
- if (trimmed.toLowerCase().startsWith("mailto:") || isEmail(trimmed)) {
142
- return "mailto";
143
- }
144
- if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
145
- return "tel";
146
- }
147
- if (isInternalUrl(trimmed)) {
148
- return "internal";
149
- }
150
- try {
151
- new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
152
- return "external";
153
- } catch {
154
- return "internal";
155
- }
156
- }, [href, onClick]);
157
- const normalizedHref = React4__namespace.useMemo(() => {
158
- if (!href || href.trim() === "") {
159
- return void 0;
160
- }
161
- const trimmed = href.trim();
162
- switch (linkType) {
163
- case "tel":
164
- return normalizePhoneNumber(trimmed);
165
- case "mailto":
166
- return normalizeEmail(trimmed);
167
- case "internal":
168
- return toRelativePath(trimmed);
169
- case "external":
170
- return trimmed;
171
- default:
172
- return trimmed;
173
- }
174
- }, [href, linkType]);
175
- const target = React4__namespace.useMemo(() => {
176
- switch (linkType) {
177
- case "external":
178
- return "_blank";
179
- case "internal":
180
- return "_self";
181
- case "mailto":
182
- case "tel":
183
- return void 0;
184
- default:
185
- return void 0;
186
- }
187
- }, [linkType]);
188
- const rel = React4__namespace.useMemo(() => {
189
- if (linkType === "external") {
190
- return "noopener noreferrer";
191
- }
192
- return void 0;
193
- }, [linkType]);
194
- const isExternal = linkType === "external";
195
- const isInternal = linkType === "internal";
196
- const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
197
- const handleClick = React4__namespace.useCallback(
198
- (event) => {
199
- if (onClick) {
200
- try {
201
- onClick(event);
202
- } catch (error) {
203
- console.error("Error in user onClick handler:", error);
204
- }
205
- }
206
- if (event.defaultPrevented) {
207
- return;
208
- }
209
- if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
210
- !event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
211
- if (typeof window !== "undefined") {
212
- const handler = window.__opensiteNavigationHandler;
213
- if (typeof handler === "function") {
214
- try {
215
- const handled = handler(normalizedHref, event.nativeEvent || event);
216
- if (handled !== false) {
217
- event.preventDefault();
218
- }
219
- } catch (error) {
220
- console.error("Error in navigation handler:", error);
221
- }
222
- }
223
- }
224
- }
225
- },
226
- [onClick, shouldUseRouter, normalizedHref]
227
- );
228
- return {
229
- linkType,
230
- normalizedHref,
231
- target,
232
- rel,
233
- isExternal,
234
- isInternal,
235
- shouldUseRouter,
236
- handleClick
237
- };
238
- }
239
- var baseStyles = [
240
- // Layout
241
- "inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
242
- // Typography - using CSS variables with sensible defaults
243
- "font-[var(--button-font-family,inherit)]",
244
- "font-[var(--button-font-weight,500)]",
245
- "tracking-[var(--button-letter-spacing,0)]",
246
- "leading-[var(--button-line-height,1.25)]",
247
- "[text-transform:var(--button-text-transform,none)]",
248
- "text-sm",
249
- // Border radius
250
- "rounded-[var(--button-radius,var(--radius,0.375rem))]",
251
- // Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
252
- "[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
253
- // Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
254
- "[box-shadow:var(--button-shadow,none)]",
255
- "hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
256
- // Disabled state
257
- "disabled:pointer-events-none disabled:opacity-50",
258
- // SVG handling
259
- "[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
260
- // Focus styles
261
- "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
262
- // Invalid state
263
- "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
264
- ].join(" ");
265
- var buttonVariants = classVarianceAuthority.cva(baseStyles, {
266
- variants: {
267
- variant: {
268
- // Default (Primary) variant - full customization
269
- default: [
270
- "bg-[var(--button-default-bg,hsl(var(--primary)))]",
271
- "text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
272
- "border-[length:var(--button-default-border-width,0px)]",
273
- "border-[color:var(--button-default-border,transparent)]",
274
- "[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
275
- "hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
276
- "hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
277
- "hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
278
- "hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
279
- ].join(" "),
280
- // Destructive variant - full customization
281
- destructive: [
282
- "bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
283
- "text-[var(--button-destructive-fg,white)]",
284
- "border-[length:var(--button-destructive-border-width,0px)]",
285
- "border-[color:var(--button-destructive-border,transparent)]",
286
- "[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
287
- "hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
288
- "hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
289
- "hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
290
- "hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
291
- "focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
292
- "dark:bg-destructive/60"
293
- ].join(" "),
294
- // Outline variant - full customization with proper border handling
295
- outline: [
296
- "bg-[var(--button-outline-bg,hsl(var(--background)))]",
297
- "text-[var(--button-outline-fg,inherit)]",
298
- "border-[length:var(--button-outline-border-width,1px)]",
299
- "border-[color:var(--button-outline-border,hsl(var(--border)))]",
300
- "[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
301
- "hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
302
- "hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
303
- "hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
304
- "hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
305
- "dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
306
- ].join(" "),
307
- // Secondary variant - full customization
308
- secondary: [
309
- "bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
310
- "text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
311
- "border-[length:var(--button-secondary-border-width,0px)]",
312
- "border-[color:var(--button-secondary-border,transparent)]",
313
- "[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
314
- "hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
315
- "hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
316
- "hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
317
- "hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
318
- ].join(" "),
319
- // Ghost variant - full customization
320
- ghost: [
321
- "bg-[var(--button-ghost-bg,transparent)]",
322
- "text-[var(--button-ghost-fg,inherit)]",
323
- "border-[length:var(--button-ghost-border-width,0px)]",
324
- "border-[color:var(--button-ghost-border,transparent)]",
325
- "[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
326
- "hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
327
- "hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
328
- "hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
329
- "hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
330
- "dark:hover:bg-accent/50"
331
- ].join(" "),
332
- // Link variant - full customization
333
- link: [
334
- "bg-[var(--button-link-bg,transparent)]",
335
- "text-[var(--button-link-fg,hsl(var(--primary)))]",
336
- "border-[length:var(--button-link-border-width,0px)]",
337
- "border-[color:var(--button-link-border,transparent)]",
338
- "[box-shadow:var(--button-link-shadow,none)]",
339
- "hover:bg-[var(--button-link-hover-bg,transparent)]",
340
- "hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
341
- "hover:[box-shadow:var(--button-link-shadow-hover,none)]",
342
- "underline-offset-4 hover:underline"
343
- ].join(" ")
344
- },
345
- size: {
346
- default: [
347
- "h-[var(--button-height-md,2.25rem)]",
348
- "px-[var(--button-padding-x-md,1rem)]",
349
- "py-[var(--button-padding-y-md,0.5rem)]",
350
- "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
351
- ].join(" "),
352
- sm: [
353
- "h-[var(--button-height-sm,2rem)]",
354
- "px-[var(--button-padding-x-sm,0.75rem)]",
355
- "py-[var(--button-padding-y-sm,0.25rem)]",
356
- "gap-1.5",
357
- "has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
358
- ].join(" "),
359
- md: [
360
- "h-[var(--button-height-md,2.25rem)]",
361
- "px-[var(--button-padding-x-md,1rem)]",
362
- "py-[var(--button-padding-y-md,0.5rem)]",
363
- "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
364
- ].join(" "),
365
- lg: [
366
- "h-[var(--button-height-lg,2.5rem)]",
367
- "px-[var(--button-padding-x-lg,1.5rem)]",
368
- "py-[var(--button-padding-y-lg,0.5rem)]",
369
- "has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
370
- ].join(" "),
371
- icon: "size-[var(--button-height-md,2.25rem)]",
372
- "icon-sm": "size-[var(--button-height-sm,2rem)]",
373
- "icon-lg": "size-[var(--button-height-lg,2.5rem)]"
374
- }
375
- },
376
- defaultVariants: {
377
- variant: "default",
378
- size: "default"
379
- }
380
- });
381
- var Pressable = React4__namespace.forwardRef(
382
- ({
383
- children,
384
- className,
385
- href,
386
- onClick,
387
- variant,
388
- size,
389
- asButton = false,
390
- fallbackComponentType = "span",
391
- componentType,
392
- "aria-label": ariaLabel,
393
- "aria-describedby": ariaDescribedby,
394
- id,
395
- ...props
396
- }, ref) => {
397
- const navigation = useNavigation({ href, onClick });
398
- const {
399
- normalizedHref,
400
- target,
401
- rel,
402
- linkType,
403
- isInternal,
404
- handleClick
405
- } = navigation;
406
- const shouldRenderLink = normalizedHref && linkType !== "none";
407
- const shouldRenderButton = !shouldRenderLink && onClick;
408
- const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
409
- const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
410
- const shouldApplyButtonStyles = asButton || variant || size;
411
- const combinedClassName = cn(
412
- shouldApplyButtonStyles && buttonVariants({ variant, size }),
413
- className
414
- );
415
- const dataProps = Object.fromEntries(
416
- Object.entries(props).filter(([key]) => key.startsWith("data-"))
417
- );
418
- const buttonDataAttributes = shouldApplyButtonStyles ? {
419
- "data-slot": "button",
420
- "data-variant": variant ?? "default",
421
- "data-size": size ?? "default"
422
- } : {};
423
- const commonProps = {
424
- className: combinedClassName,
425
- onClick: handleClick,
426
- "aria-label": ariaLabel,
427
- "aria-describedby": ariaDescribedby,
428
- id,
429
- ...dataProps,
430
- ...buttonDataAttributes
431
- };
432
- if (finalComponentType === "a" && shouldRenderLink) {
433
- return /* @__PURE__ */ jsxRuntime.jsx(
434
- "a",
435
- {
436
- ref,
437
- href: normalizedHref,
438
- target,
439
- rel,
440
- ...commonProps,
441
- ...props,
442
- children
443
- }
444
- );
445
- }
446
- if (finalComponentType === "button") {
447
- return /* @__PURE__ */ jsxRuntime.jsx(
448
- "button",
449
- {
450
- ref,
451
- type: props.type || "button",
452
- ...commonProps,
453
- ...props,
454
- children
455
- }
456
- );
457
- }
458
- if (finalComponentType === "div") {
459
- return /* @__PURE__ */ jsxRuntime.jsx(
460
- "div",
461
- {
462
- ref,
463
- ...commonProps,
464
- children
465
- }
466
- );
467
- }
468
- return /* @__PURE__ */ jsxRuntime.jsx(
469
- "span",
470
- {
471
- ref,
472
- ...commonProps,
473
- children
474
- }
475
- );
476
- }
477
- );
478
- Pressable.displayName = "Pressable";
479
- var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
480
- var DynamicIcon = React4__namespace.memo(function DynamicIcon2({
481
- apiKey,
482
- ...props
483
- }) {
484
- return /* @__PURE__ */ jsxRuntime.jsx(icon.Icon, { ...props, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
485
- });
486
- DynamicIcon.displayName = "DynamicIcon";
487
- var PANEL_POSITION_CLASS = {
488
- "top-left": "left-4 top-4",
489
- "top-right": "right-4 top-4",
490
- "bottom-left": "bottom-4 left-4",
491
- "bottom-right": "bottom-4 right-4"
492
- };
493
- var DEFAULT_VIEW_STATE = {
494
- latitude: 39.5,
495
- longitude: -98.35,
496
- zoom: 3
497
- };
498
- var VIDEO_FILE_EXTENSION_REGEX = /\.(mp4|webm|ogg|mov|m4v|m3u8)(\?.*)?$/i;
499
- function resolveMediaType(item) {
500
- if (item.type) {
501
- return item.type;
502
- }
503
- return VIDEO_FILE_EXTENSION_REGEX.test(item.src) ? "video" : "image";
504
- }
505
- function normalizeId(value, fallback) {
506
- if (value === null || value === void 0 || value === "") {
507
- return fallback;
508
- }
509
- return String(value);
510
- }
511
- function buildClusterCenter(markers) {
512
- if (!markers.length) {
513
- return null;
514
- }
515
- const total = markers.reduce(
516
- (accumulator, marker) => ({
517
- latitude: accumulator.latitude + marker.latitude,
518
- longitude: accumulator.longitude + marker.longitude
519
- }),
520
- { latitude: 0, longitude: 0 }
521
- );
522
- return {
523
- latitude: total.latitude / markers.length,
524
- longitude: total.longitude / markers.length
525
- };
526
- }
527
- function resolveActionKey(action, index) {
528
- if (typeof action.label === "string" && action.label.trim().length > 0) {
529
- return `label:${action.label}:${index}`;
530
- }
531
- if (action.href) {
532
- return `href:${action.href}:${index}`;
533
- }
534
- return `action:${index}`;
535
- }
536
- function MarkerActions({ actions }) {
537
- if (!actions || actions.length === 0) {
538
- return null;
539
- }
540
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-4 flex flex-wrap gap-2", children: actions.map((action, index) => {
541
- const {
542
- label,
543
- icon,
544
- iconAfter,
545
- children,
546
- href,
547
- onClick,
548
- className: actionClassName,
549
- variant,
550
- size,
551
- asButton,
552
- ...rest
553
- } = action;
554
- return /* @__PURE__ */ jsxRuntime.jsx(
555
- Pressable,
556
- {
557
- href,
558
- onClick,
559
- variant: variant ?? (index === 0 ? "default" : "outline"),
560
- size: size ?? "sm",
561
- asButton: asButton ?? true,
562
- className: cn("inline-flex items-center gap-2", actionClassName),
563
- ...rest,
564
- children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
565
- icon,
566
- label,
567
- iconAfter
568
- ] })
569
- },
570
- resolveActionKey(action, index)
571
- );
572
- }) });
573
- }
574
- function MarkerMediaCarousel({
575
- mediaItems,
576
- optixFlowConfig
577
- }) {
578
- const [activeIndex, setActiveIndex] = React4__namespace.useState(0);
579
- const totalItems = mediaItems.length;
580
- const mediaResetKey = React4__namespace.useMemo(
581
- () => mediaItems.map((item, index) => {
582
- const itemId = normalizeId(item.id, `media-${index}`);
583
- return `${itemId}:${item.src}:${item.type ?? ""}:${item.poster ?? ""}`;
584
- }).join("|"),
585
- [mediaItems]
586
- );
587
- const activeItemIndex = Math.min(activeIndex, Math.max(0, totalItems - 1));
588
- React4__namespace.useEffect(() => {
589
- setActiveIndex(0);
590
- }, [mediaResetKey]);
591
- return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative border-b border-border/60 bg-muted/40", children: [
592
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative aspect-video w-full overflow-hidden", children: mediaItems.map((item, index) => {
593
- const isActive = index === activeItemIndex;
594
- const mediaType = resolveMediaType(item);
595
- return /* @__PURE__ */ jsxRuntime.jsx(
596
- "div",
597
- {
598
- "aria-hidden": !isActive,
599
- className: cn(
600
- "absolute inset-0 transition-opacity duration-500 ease-in-out",
601
- isActive ? "opacity-100 z-[1]" : "opacity-0 z-0 pointer-events-none"
602
- ),
603
- children: mediaType === "video" ? /* @__PURE__ */ jsxRuntime.jsx(
604
- "video",
605
- {
606
- className: "h-full w-full object-cover",
607
- controls: isActive,
608
- preload: "metadata",
609
- poster: item.poster,
610
- tabIndex: isActive ? 0 : -1,
611
- children: /* @__PURE__ */ jsxRuntime.jsx("source", { src: item.src })
612
- }
613
- ) : /* @__PURE__ */ jsxRuntime.jsx(
614
- img.Img,
615
- {
616
- src: item.src,
617
- alt: item.alt ?? "Map marker media",
618
- className: "h-full w-full object-cover",
619
- loading: "eager",
620
- optixFlowConfig
621
- }
622
- )
623
- },
624
- normalizeId(item.id, `media-slide-${index}`)
625
- );
626
- }) }),
627
- totalItems > 1 ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
628
- /* @__PURE__ */ jsxRuntime.jsx(
629
- "button",
630
- {
631
- type: "button",
632
- "aria-label": "Show previous media",
633
- className: "absolute left-4 top-1/2 inline-flex size-10 -translate-y-1/2 items-center justify-center rounded-2xl bg-card text-card-foreground shadow-lg border-4 border-black hover:border-white hover:bg-black hover:text-white transition-all duration-500 z-[2]",
634
- onClick: () => {
635
- setActiveIndex(
636
- (current) => (current - 1 + totalItems) % totalItems
637
- );
638
- },
639
- children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/arrow-left", size: 18 })
640
- }
641
- ),
642
- /* @__PURE__ */ jsxRuntime.jsx(
643
- "button",
644
- {
645
- type: "button",
646
- "aria-label": "Show next media",
647
- className: "absolute right-4 top-1/2 inline-flex size-10 -translate-y-1/2 items-center justify-center rounded-2xl bg-card text-card-foreground shadow-lg border-4 border-black hover:border-white hover:bg-black hover:text-white transition-all duration-500 z-[2]",
648
- onClick: () => {
649
- setActiveIndex((current) => (current + 1) % totalItems);
650
- },
651
- children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/arrow-right", size: 18 })
652
- }
653
- ),
654
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute bottom-2 left-1/2 flex -translate-x-1/2 items-center gap-1.5 z-[2]", children: mediaItems.map((item, index) => /* @__PURE__ */ jsxRuntime.jsx(
655
- "button",
656
- {
657
- type: "button",
658
- "aria-label": `Show media item ${index + 1}`,
659
- className: cn(
660
- "h-2 rounded-full transition-all duration-300",
661
- index === activeItemIndex ? "w-6 bg-card" : "w-2 bg-card opacity-50 hover:opacity-100"
662
- ),
663
- onClick: () => setActiveIndex(index)
664
- },
665
- normalizeId(item.id, `media-dot-${index}`)
666
- )) })
667
- ] }) : null
668
- ] });
669
- }
670
- function getMarkerTitle(marker, markerIndex) {
671
- if (marker.title !== void 0 && marker.title !== null) {
672
- return marker.title;
673
- }
674
- if (marker.label !== void 0 && marker.label !== null) {
675
- return marker.label;
676
- }
677
- return `Location ${markerIndex + 1}`;
678
- }
679
- function GeoMap({
680
- className,
681
- mapWrapperClassName,
682
- mapClassName,
683
- panelClassName,
684
- panelPosition = "top-left",
685
- stadiaApiKey = "",
686
- mapStyle = "osm-bright",
687
- styleUrl,
688
- mapLibreCssHref,
689
- markers = [],
690
- clusters = [],
691
- viewState,
692
- defaultViewState,
693
- onViewStateChange,
694
- onMapClick,
695
- onMarkerDrag,
696
- showNavigationControl = true,
697
- showGeolocateControl = false,
698
- navigationControlPosition = "top-right",
699
- geolocateControlPosition = "top-left",
700
- flyToOptions,
701
- markerFocusZoom = 14,
702
- clusterFocusZoom = 5,
703
- selectedMarkerId,
704
- initialSelectedMarkerId,
705
- onSelectionChange,
706
- clearSelectionOnMapClick = true,
707
- mapChildren,
708
- optixFlowConfig
709
- }) {
710
- const normalizedStandaloneMarkers = React4__namespace.useMemo(
711
- () => markers.map((marker, index) => ({
712
- ...marker,
713
- id: normalizeId(marker.id, `marker-${index}`)
714
- })),
715
- [markers]
716
- );
717
- const normalizedClusters = React4__namespace.useMemo(() => {
718
- const results = [];
719
- clusters.forEach((cluster, clusterIndex) => {
720
- const clusterId = normalizeId(cluster.id, `cluster-${clusterIndex}`);
721
- const normalizedClusterMarkers = cluster.markers.map(
722
- (marker, markerIndex) => ({
723
- ...marker,
724
- id: normalizeId(marker.id, `${clusterId}-marker-${markerIndex}`),
725
- clusterId
726
- })
727
- );
728
- const clusterCenter = cluster.latitude !== void 0 && cluster.longitude !== void 0 ? { latitude: cluster.latitude, longitude: cluster.longitude } : buildClusterCenter(normalizedClusterMarkers);
729
- if (!clusterCenter) {
730
- return;
731
- }
732
- results.push({
733
- ...cluster,
734
- id: clusterId,
735
- latitude: clusterCenter.latitude,
736
- longitude: clusterCenter.longitude,
737
- markers: normalizedClusterMarkers
738
- });
739
- });
740
- return results;
741
- }, [clusters]);
742
- const markerLookup = React4__namespace.useMemo(() => {
743
- const lookup = /* @__PURE__ */ new Map();
744
- normalizedStandaloneMarkers.forEach((marker) => {
745
- lookup.set(marker.id, marker);
746
- });
747
- normalizedClusters.forEach((cluster) => {
748
- cluster.markers.forEach((marker) => {
749
- lookup.set(marker.id, marker);
750
- });
751
- });
752
- return lookup;
753
- }, [normalizedClusters, normalizedStandaloneMarkers]);
754
- const clusterLookup = React4__namespace.useMemo(() => {
755
- const lookup = /* @__PURE__ */ new Map();
756
- normalizedClusters.forEach((cluster) => {
757
- lookup.set(cluster.id, cluster);
758
- });
759
- return lookup;
760
- }, [normalizedClusters]);
761
- const firstCoordinate = React4__namespace.useMemo(() => {
762
- if (normalizedStandaloneMarkers.length > 0) {
763
- const firstStandaloneMarker = normalizedStandaloneMarkers[0];
764
- return {
765
- latitude: firstStandaloneMarker.latitude,
766
- longitude: firstStandaloneMarker.longitude
767
- };
768
- }
769
- if (normalizedClusters.length > 0) {
770
- const firstCluster = normalizedClusters[0];
771
- return {
772
- latitude: firstCluster.latitude,
773
- longitude: firstCluster.longitude
774
- };
775
- }
776
- return {
777
- latitude: DEFAULT_VIEW_STATE.latitude,
778
- longitude: DEFAULT_VIEW_STATE.longitude
779
- };
780
- }, [normalizedClusters, normalizedStandaloneMarkers]);
781
- const [uncontrolledViewState, setUncontrolledViewState] = React4__namespace.useState({
782
- latitude: defaultViewState?.latitude ?? firstCoordinate.latitude,
783
- longitude: defaultViewState?.longitude ?? firstCoordinate.longitude,
784
- zoom: defaultViewState?.zoom ?? DEFAULT_VIEW_STATE.zoom
785
- });
786
- const isControlledViewState = viewState !== void 0;
787
- const resolvedViewState = isControlledViewState ? viewState : uncontrolledViewState;
788
- const applyViewState = React4__namespace.useCallback(
789
- (nextState) => {
790
- if (!isControlledViewState) {
791
- setUncontrolledViewState((current) => {
792
- const next = { ...current, ...nextState };
793
- const hasChanged = current.latitude !== next.latitude || current.longitude !== next.longitude || current.zoom !== next.zoom;
794
- return hasChanged ? next : current;
795
- });
796
- }
797
- onViewStateChange?.(nextState);
798
- },
799
- [isControlledViewState, onViewStateChange]
800
- );
801
- const [selection, setSelection] = React4__namespace.useState(() => {
802
- if (initialSelectedMarkerId !== void 0 && initialSelectedMarkerId !== null) {
803
- return {
804
- type: "marker",
805
- markerId: String(initialSelectedMarkerId)
806
- };
807
- }
808
- return { type: "none" };
809
- });
810
- React4__namespace.useEffect(() => {
811
- if (selectedMarkerId === void 0 || selectedMarkerId === null) {
812
- return;
813
- }
814
- setSelection({
815
- type: "marker",
816
- markerId: String(selectedMarkerId)
817
- });
818
- }, [selectedMarkerId]);
819
- const selectedMarker = selection.markerId ? markerLookup.get(selection.markerId) : void 0;
820
- const selectedCluster = selection.clusterId ? clusterLookup.get(selection.clusterId) : void 0;
821
- React4__namespace.useEffect(() => {
822
- if (selection.type === "marker" && selection.markerId && !selectedMarker) {
823
- setSelection({ type: "none" });
824
- onSelectionChange?.({ type: "none" });
825
- }
826
- }, [onSelectionChange, selectedMarker, selection]);
827
- const emitSelectionChange = React4__namespace.useCallback(
828
- (nextSelection) => {
829
- if (nextSelection.type === "none") {
830
- onSelectionChange?.({ type: "none" });
831
- return;
832
- }
833
- if (nextSelection.type === "marker") {
834
- const parentCluster = nextSelection.marker.clusterId ? clusterLookup.get(nextSelection.marker.clusterId) : void 0;
835
- onSelectionChange?.({
836
- type: "marker",
837
- marker: nextSelection.marker,
838
- cluster: parentCluster
839
- });
840
- return;
841
- }
842
- onSelectionChange?.({
843
- type: "cluster",
844
- cluster: nextSelection.cluster
845
- });
846
- },
847
- [clusterLookup, onSelectionChange]
848
- );
849
- const selectMarker = React4__namespace.useCallback(
850
- (marker) => {
851
- setSelection({
852
- type: "marker",
853
- markerId: marker.id,
854
- clusterId: marker.clusterId
855
- });
856
- applyViewState({
857
- latitude: marker.latitude,
858
- longitude: marker.longitude,
859
- zoom: markerFocusZoom
860
- });
861
- emitSelectionChange({ type: "marker", marker });
862
- },
863
- [applyViewState, emitSelectionChange, markerFocusZoom]
864
- );
865
- const selectCluster = React4__namespace.useCallback(
866
- (cluster) => {
867
- setSelection({
868
- type: "cluster",
869
- clusterId: cluster.id
870
- });
871
- applyViewState({
872
- latitude: cluster.latitude,
873
- longitude: cluster.longitude,
874
- zoom: clusterFocusZoom
875
- });
876
- emitSelectionChange({ type: "cluster", cluster });
877
- },
878
- [applyViewState, clusterFocusZoom, emitSelectionChange]
879
- );
880
- const clearSelection = React4__namespace.useCallback(() => {
881
- setSelection({ type: "none" });
882
- emitSelectionChange({ type: "none" });
883
- }, [emitSelectionChange]);
884
- const mapMarkers = React4__namespace.useMemo(() => {
885
- const resolvedMarkers = [];
886
- normalizedClusters.forEach((cluster) => {
887
- const isSelected = selection.type === "cluster" && selection.clusterId === cluster.id;
888
- resolvedMarkers.push({
889
- id: `cluster-pin:${cluster.id}`,
890
- latitude: cluster.latitude,
891
- longitude: cluster.longitude,
892
- element: () => {
893
- const customMarkerElement = cluster.markerElement;
894
- const markerBody = typeof customMarkerElement === "function" ? customMarkerElement({
895
- isSelected,
896
- count: cluster.markers.length
897
- }) : customMarkerElement;
898
- return /* @__PURE__ */ jsxRuntime.jsx(
899
- "button",
900
- {
901
- type: "button",
902
- className: "group cursor-pointer",
903
- onClick: (event) => {
904
- event.preventDefault();
905
- event.stopPropagation();
906
- selectCluster(cluster);
907
- },
908
- "aria-label": `View ${cluster.markers.length} clustered locations`,
909
- children: markerBody ?? /* @__PURE__ */ jsxRuntime.jsx(
910
- "span",
911
- {
912
- className: cn(
913
- "inline-flex min-h-10 min-w-10 items-center justify-center rounded-full border-2 border-white px-2 text-xs font-semibold text-white shadow-lg transition-transform duration-200 group-hover:scale-105",
914
- isSelected && "ring-4 ring-primary/30",
915
- cluster.pinClassName
916
- ),
917
- style: {
918
- backgroundColor: cluster.pinColor ?? "var(--foreground)"
919
- },
920
- children: cluster.markers.length
921
- }
922
- )
923
- }
924
- );
925
- }
926
- });
927
- });
928
- normalizedStandaloneMarkers.forEach((marker) => {
929
- const isSelected = selection.type === "marker" && selection.markerId === marker.id;
930
- const customMarkerElement = marker.markerElement;
931
- resolvedMarkers.push({
932
- id: marker.id,
933
- latitude: marker.latitude,
934
- longitude: marker.longitude,
935
- draggable: marker.draggable,
936
- element: () => {
937
- const markerBody = typeof customMarkerElement === "function" ? customMarkerElement({ isSelected }) : customMarkerElement;
938
- return /* @__PURE__ */ jsxRuntime.jsx(
939
- "button",
940
- {
941
- type: "button",
942
- className: "group cursor-pointer",
943
- onClick: (event) => {
944
- event.preventDefault();
945
- event.stopPropagation();
946
- selectMarker(marker);
947
- },
948
- "aria-label": typeof marker.title === "string" ? `View ${marker.title}` : "View location details",
949
- children: markerBody ?? /* @__PURE__ */ jsxRuntime.jsx(
950
- "span",
951
- {
952
- className: cn(
953
- "inline-flex h-4 w-4 rounded-full border-2 border-white shadow-md transition-transform duration-200 group-hover:scale-110",
954
- isSelected && "h-5 w-5 ring-4 ring-primary/30",
955
- marker.pinClassName
956
- ),
957
- style: {
958
- backgroundColor: marker.pinColor ?? "#f43f5e"
959
- }
960
- }
961
- )
962
- }
963
- );
964
- }
965
- });
966
- });
967
- return resolvedMarkers;
968
- }, [
969
- normalizedClusters,
970
- normalizedStandaloneMarkers,
971
- selectCluster,
972
- selectMarker,
973
- selection
974
- ]);
975
- const renderMarkerPanel = () => {
976
- if (selectedMarker) {
977
- const markerMediaItems = selectedMarker.mediaItems ?? [];
978
- return /* @__PURE__ */ jsxRuntime.jsxs(
979
- "div",
980
- {
981
- className: cn(
982
- "relative w-[min(24rem,calc(100vw-2rem))] overflow-hidden rounded-xl border border-border bg-card text-card-foreground shadow-2xl",
983
- panelClassName
984
- ),
985
- children: [
986
- /* @__PURE__ */ jsxRuntime.jsx(
987
- "button",
988
- {
989
- type: "button",
990
- "aria-label": "Close marker details",
991
- className: "\n flex size-12 items-center justify-center rounded-bl-lg rounded-br-0 rounded-t-0 bg-black text-white transition-all duration-500 absolute top-0 right-0 z-10 cursor-pointer ring-4 ring-white\n",
992
- onClick: clearSelection,
993
- children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/x", size: 20 })
994
- }
995
- ),
996
- markerMediaItems.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
997
- MarkerMediaCarousel,
998
- {
999
- mediaItems: markerMediaItems,
1000
- optixFlowConfig
1001
- }
1002
- ) : null,
1003
- /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-2 p-4", children: [
1004
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-start justify-between gap-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 space-y-1", children: [
1005
- selectedMarker.eyebrow ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold uppercase tracking-wide", children: selectedMarker.eyebrow }) : null,
1006
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base font-semibold leading-tight", children: selectedMarker.title ?? selectedMarker.label ?? "Location" })
1007
- ] }) }),
1008
- selectedMarker.summary ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm leading-relaxed", children: selectedMarker.summary }) : null,
1009
- selectedMarker.locationLine ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-start text-sm gap-2", children: [
1010
- /* @__PURE__ */ jsxRuntime.jsx(
1011
- DynamicIcon,
1012
- {
1013
- name: "lucide:map-pin",
1014
- className: "opacity-50",
1015
- size: 18
1016
- }
1017
- ),
1018
- typeof selectedMarker.locationLine === "string" ? /* @__PURE__ */ jsxRuntime.jsx(
1019
- Pressable,
1020
- {
1021
- href: selectedMarker.locationUrl,
1022
- className: cn(
1023
- "transition-all duration-500",
1024
- "font-medium opacity-75 hover:opacity-100",
1025
- selectedMarker.locationUrl ? "underline underline-offset-4" : ""
1026
- ),
1027
- children: selectedMarker.locationLine
1028
- }
1029
- ) : selectedMarker.locationLine
1030
- ] }) : null,
1031
- selectedMarker.hoursLine ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-row items-center justify-start text-sm gap-2", children: [
1032
- /* @__PURE__ */ jsxRuntime.jsx(
1033
- DynamicIcon,
1034
- {
1035
- name: "lucide:clock",
1036
- className: "opacity-50",
1037
- size: 18
1038
- }
1039
- ),
1040
- typeof selectedMarker.hoursLine === "string" ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium", children: selectedMarker.hoursLine }) : selectedMarker.hoursLine
1041
- ] }) : null,
1042
- selectedMarker.markerContentComponent ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "relative", children: selectedMarker.markerContentComponent }) : null,
1043
- /* @__PURE__ */ jsxRuntime.jsx(MarkerActions, { actions: selectedMarker.actions })
1044
- ] })
1045
- ]
1046
- }
1047
- );
1048
- }
1049
- if (selectedCluster) {
1050
- return /* @__PURE__ */ jsxRuntime.jsxs(
1051
- "div",
1052
- {
1053
- className: cn(
1054
- "relative w-[min(24rem,calc(100vw-2rem))] overflow-hidden rounded-xl border border-border bg-card text-card-foreground p-4 shadow-2xl",
1055
- panelClassName
1056
- ),
1057
- children: [
1058
- /* @__PURE__ */ jsxRuntime.jsx(
1059
- "button",
1060
- {
1061
- type: "button",
1062
- "aria-label": "Close cluster details",
1063
- className: "flex size-8 items-center justify-center rounded-full border border-border bg-card text-card-foreground transition hover:bg-muted hover:text-foreground absolute top-2 right-2 z-10",
1064
- onClick: clearSelection,
1065
- children: /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/x", size: 20 })
1066
- }
1067
- ),
1068
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex items-start justify-between gap-3", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0", children: [
1069
- selectedCluster.label ? /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: selectedCluster.label }) : null,
1070
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-base font-semibold leading-tight text-foreground", children: selectedCluster.title ?? "Clustered Locations" }),
1071
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: selectedCluster.summary ?? `${selectedCluster.markers.length} location${selectedCluster.markers.length === 1 ? "" : "s"} in this cluster.` })
1072
- ] }) }),
1073
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "max-h-56 space-y-2 overflow-y-auto pr-1", children: selectedCluster.markers.map((marker, markerIndex) => /* @__PURE__ */ jsxRuntime.jsxs(
1074
- "button",
1075
- {
1076
- type: "button",
1077
- className: "w-full rounded-lg border border-border/60 p-3 text-left transition hover:border-border hover:bg-muted/50",
1078
- onClick: () => selectMarker(marker),
1079
- children: [
1080
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "line-clamp-1 text-sm font-semibold text-foreground", children: getMarkerTitle(marker, markerIndex) }),
1081
- marker.summary ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 line-clamp-2 text-xs text-muted-foreground", children: marker.summary }) : null
1082
- ]
1083
- },
1084
- marker.id
1085
- )) })
1086
- ]
1087
- }
1088
- );
1089
- }
1090
- return null;
1091
- };
1092
- return /* @__PURE__ */ jsxRuntime.jsxs(
1093
- "div",
1094
- {
1095
- className: cn(
1096
- "relative overflow-hidden rounded-2xl border border-border bg-background",
1097
- className
1098
- ),
1099
- children: [
1100
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-[520px] w-full", mapWrapperClassName), children: /* @__PURE__ */ jsxRuntime.jsx(
1101
- maps.MapLibre,
1102
- {
1103
- stadiaApiKey,
1104
- mapStyle,
1105
- styleUrl,
1106
- mapLibreCssHref,
1107
- viewState: resolvedViewState,
1108
- onViewStateChange: applyViewState,
1109
- markers: mapMarkers,
1110
- onClick: (coord) => {
1111
- onMapClick?.(coord);
1112
- if (clearSelectionOnMapClick) {
1113
- clearSelection();
1114
- }
1115
- },
1116
- onMarkerDrag,
1117
- showNavigationControl,
1118
- showGeolocateControl,
1119
- navigationControlPosition,
1120
- geolocateControlPosition,
1121
- flyToOptions,
1122
- className: cn("h-full w-full", mapClassName),
1123
- children: mapChildren
1124
- }
1125
- ) }),
1126
- selection.type !== "none" ? /* @__PURE__ */ jsxRuntime.jsx(
1127
- "div",
1128
- {
1129
- className: cn(
1130
- "pointer-events-none absolute z-20",
1131
- PANEL_POSITION_CLASS[panelPosition]
1132
- ),
1133
- children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-auto", children: renderMarkerPanel() })
1134
- }
1135
- ) : null
1136
- ]
1137
- }
1138
- );
1139
- }
1140
60
  var maxWidthStyles = {
1141
61
  sm: "max-w-screen-sm",
1142
62
  md: "max-w-screen-md",
@@ -1513,6 +433,14 @@ var Section = React4__namespace.default.forwardRef(
1513
433
  }
1514
434
  );
1515
435
  Section.displayName = "Section";
436
+ var DEFAULT_ICON_API_KEY = "au382bi7fsh96w9h9xlrnat2jglx";
437
+ var DynamicIcon = React4__namespace.memo(function DynamicIcon2({
438
+ apiKey,
439
+ ...props
440
+ }) {
441
+ return /* @__PURE__ */ jsxRuntime.jsx(icon.Icon, { ...props, apiKey: apiKey ?? DEFAULT_ICON_API_KEY });
442
+ });
443
+ DynamicIcon.displayName = "DynamicIcon";
1516
444
  var DEFAULT_STYLE_RULES = {
1517
445
  formContainer: "",
1518
446
  fieldsContainer: "",
@@ -1602,7 +530,10 @@ function ContactMap({
1602
530
  panelPosition: "top-left",
1603
531
  ...mapProps,
1604
532
  className: cn("h-full w-full", mapClassName, mapProps?.className),
1605
- optixFlowConfig
533
+ optixFlowConfig,
534
+ // Provide icon and image components for rich marker panels
535
+ IconComponent: DynamicIcon,
536
+ ImgComponent: img.Img
1606
537
  };
1607
538
  }, [mapClassName, mapProps, optixFlowConfig]);
1608
539
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1647,7 +578,7 @@ function ContactMap({
1647
578
  ] }),
1648
579
  renderForm
1649
580
  ] }) }),
1650
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-full", mapColumnClassName), children: /* @__PURE__ */ jsxRuntime.jsx(GeoMap, { ...resolvedMapProps }) })
581
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("h-full", mapColumnClassName), children: /* @__PURE__ */ jsxRuntime.jsx(maps.GeoMap, { ...resolvedMapProps }) })
1651
582
  ]
1652
583
  }
1653
584
  )