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