@opensite/ui 2.8.7 → 2.8.9

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 (163) 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-icon-sidebar.cjs +5 -4
  18. package/dist/carousel-icon-sidebar.js +5 -4
  19. package/dist/community-initiatives.cjs +142 -142
  20. package/dist/community-initiatives.js +142 -142
  21. package/dist/components.cjs +723 -1364
  22. package/dist/components.d.cts +0 -2
  23. package/dist/components.d.ts +0 -2
  24. package/dist/components.js +633 -1273
  25. package/dist/contact-map.cjs +14 -1069
  26. package/dist/contact-map.d.cts +13 -3
  27. package/dist/contact-map.d.ts +13 -3
  28. package/dist/contact-map.js +14 -1069
  29. package/dist/cta-feature-checklist.cjs +142 -142
  30. package/dist/cta-feature-checklist.js +142 -142
  31. package/dist/faq-numbered-grid.cjs +142 -142
  32. package/dist/faq-numbered-grid.js +142 -142
  33. package/dist/feature-animated-carousel.cjs +142 -142
  34. package/dist/feature-animated-carousel.js +142 -142
  35. package/dist/feature-bento-utilities.cjs +142 -142
  36. package/dist/feature-bento-utilities.js +142 -142
  37. package/dist/feature-capabilities-grid.cjs +142 -142
  38. package/dist/feature-capabilities-grid.js +142 -142
  39. package/dist/feature-category-image-cards.cjs +142 -142
  40. package/dist/feature-category-image-cards.js +142 -142
  41. package/dist/feature-icon-grid-bordered.cjs +142 -142
  42. package/dist/feature-icon-grid-bordered.js +142 -142
  43. package/dist/feature-icon-grid-muted.cjs +142 -142
  44. package/dist/feature-icon-grid-muted.js +142 -142
  45. package/dist/feature-numbered-cards.cjs +142 -142
  46. package/dist/feature-numbered-cards.js +142 -142
  47. package/dist/feature-three-column-values.cjs +142 -142
  48. package/dist/feature-three-column-values.js +142 -142
  49. package/dist/hero-ad-campaign-expert.cjs +142 -142
  50. package/dist/hero-ad-campaign-expert.js +142 -142
  51. package/dist/hero-adaptable-product-grid.cjs +142 -142
  52. package/dist/hero-adaptable-product-grid.js +142 -142
  53. package/dist/hero-agency-animated-images.cjs +142 -142
  54. package/dist/hero-agency-animated-images.js +142 -142
  55. package/dist/hero-announcement-badge.cjs +142 -142
  56. package/dist/hero-announcement-badge.js +142 -142
  57. package/dist/hero-badge-image-split.cjs +142 -142
  58. package/dist/hero-badge-image-split.js +142 -142
  59. package/dist/hero-business-carousel-dots.cjs +142 -142
  60. package/dist/hero-business-carousel-dots.js +142 -142
  61. package/dist/hero-business-operations-mosaic.cjs +142 -142
  62. package/dist/hero-business-operations-mosaic.js +142 -142
  63. package/dist/hero-conversation-intelligence.cjs +142 -142
  64. package/dist/hero-conversation-intelligence.js +142 -142
  65. package/dist/hero-creative-studio-stacked.cjs +142 -142
  66. package/dist/hero-creative-studio-stacked.js +142 -142
  67. package/dist/hero-crm-streamlined.cjs +142 -142
  68. package/dist/hero-crm-streamlined.js +142 -142
  69. package/dist/hero-customer-support-layered.cjs +142 -142
  70. package/dist/hero-customer-support-layered.js +142 -142
  71. package/dist/hero-design-showcase-logos.cjs +142 -142
  72. package/dist/hero-design-showcase-logos.js +142 -142
  73. package/dist/hero-design-system-3d.cjs +142 -142
  74. package/dist/hero-design-system-3d.js +142 -142
  75. package/dist/hero-developer-tools-code.cjs +142 -142
  76. package/dist/hero-developer-tools-code.js +142 -142
  77. package/dist/hero-digital-agency-fullscreen.cjs +142 -142
  78. package/dist/hero-digital-agency-fullscreen.js +142 -142
  79. package/dist/hero-ecommerce-product-showcase.cjs +174 -174
  80. package/dist/hero-ecommerce-product-showcase.js +174 -174
  81. package/dist/hero-event-registration.cjs +142 -142
  82. package/dist/hero-event-registration.js +142 -142
  83. package/dist/hero-fullscreen-background-image.cjs +142 -142
  84. package/dist/hero-fullscreen-background-image.js +142 -142
  85. package/dist/hero-gradient-avatars-rating.cjs +142 -142
  86. package/dist/hero-gradient-avatars-rating.js +142 -142
  87. package/dist/hero-gradient-client-focused.cjs +142 -142
  88. package/dist/hero-gradient-client-focused.js +142 -142
  89. package/dist/hero-hiring-animated-text.cjs +142 -142
  90. package/dist/hero-hiring-animated-text.js +142 -142
  91. package/dist/hero-image-left-content.cjs +142 -142
  92. package/dist/hero-image-left-content.js +142 -142
  93. package/dist/hero-innovation-image-grid.cjs +142 -142
  94. package/dist/hero-innovation-image-grid.js +142 -142
  95. package/dist/hero-mental-health-team.cjs +142 -142
  96. package/dist/hero-mental-health-team.js +142 -142
  97. package/dist/hero-minimal-centered-dark.cjs +174 -174
  98. package/dist/hero-minimal-centered-dark.js +174 -174
  99. package/dist/hero-presentation-platform-video.cjs +142 -142
  100. package/dist/hero-presentation-platform-video.js +142 -142
  101. package/dist/hero-product-showcase-floating.cjs +174 -174
  102. package/dist/hero-product-showcase-floating.js +174 -174
  103. package/dist/hero-shared-inbox-layered.cjs +142 -142
  104. package/dist/hero-shared-inbox-layered.js +142 -142
  105. package/dist/hero-software-growth-video-dialog.cjs +142 -142
  106. package/dist/hero-software-growth-video-dialog.js +142 -142
  107. package/dist/hero-spiral-pattern-cards.cjs +174 -174
  108. package/dist/hero-spiral-pattern-cards.js +174 -174
  109. package/dist/hero-split-geometric-shapes.cjs +142 -142
  110. package/dist/hero-split-geometric-shapes.js +142 -142
  111. package/dist/hero-startup-launch-cta.cjs +174 -174
  112. package/dist/hero-startup-launch-cta.js +174 -174
  113. package/dist/hero-stats-social-proof.cjs +174 -174
  114. package/dist/hero-stats-social-proof.js +174 -174
  115. package/dist/hero-task-timer-animated.cjs +142 -142
  116. package/dist/hero-task-timer-animated.js +142 -142
  117. package/dist/hero-testimonial-image-grid.cjs +142 -142
  118. package/dist/hero-testimonial-image-grid.js +142 -142
  119. package/dist/hero-therapy-testimonial-grid.cjs +142 -142
  120. package/dist/hero-therapy-testimonial-grid.js +142 -142
  121. package/dist/hero-ui-library-showcase.cjs +142 -142
  122. package/dist/hero-ui-library-showcase.js +142 -142
  123. package/dist/hero-video-background-dark.cjs +174 -174
  124. package/dist/hero-video-background-dark.js +174 -174
  125. package/dist/hero-video-dialog-gradient.cjs +142 -142
  126. package/dist/hero-video-dialog-gradient.js +142 -142
  127. package/dist/hero-video-overlay-stars.cjs +142 -142
  128. package/dist/hero-video-overlay-stars.js +142 -142
  129. package/dist/hero-welcome-asymmetric-images.cjs +142 -142
  130. package/dist/hero-welcome-asymmetric-images.js +142 -142
  131. package/dist/index.cjs +725 -1366
  132. package/dist/index.d.cts +0 -2
  133. package/dist/index.d.ts +0 -2
  134. package/dist/index.js +634 -1274
  135. package/dist/registry.cjs +2371 -2915
  136. package/dist/registry.js +1120 -1664
  137. package/dist/testimonials-large-quote.cjs +74 -43
  138. package/dist/testimonials-large-quote.d.cts +5 -1
  139. package/dist/testimonials-large-quote.d.ts +5 -1
  140. package/dist/testimonials-large-quote.js +74 -43
  141. package/dist/testimonials-logo-cards.cjs +8 -2
  142. package/dist/testimonials-logo-cards.js +8 -2
  143. package/dist/testimonials-masonry-grid.cjs +486 -69
  144. package/dist/testimonials-masonry-grid.d.cts +5 -1
  145. package/dist/testimonials-masonry-grid.d.ts +5 -1
  146. package/dist/testimonials-masonry-grid.js +483 -63
  147. package/dist/testimonials-mini-dividers.cjs +2 -3
  148. package/dist/testimonials-mini-dividers.js +2 -3
  149. package/dist/testimonials-minimal-numbered.cjs +5 -4
  150. package/dist/testimonials-minimal-numbered.js +5 -4
  151. package/dist/testimonials-parallax-number.cjs +5 -4
  152. package/dist/testimonials-parallax-number.js +5 -4
  153. package/dist/testimonials-scrolling-columns.cjs +7 -12
  154. package/dist/testimonials-scrolling-columns.js +7 -12
  155. package/dist/testimonials-stats-header.cjs +528 -87
  156. package/dist/testimonials-stats-header.d.cts +39 -3
  157. package/dist/testimonials-stats-header.d.ts +39 -3
  158. package/dist/testimonials-stats-header.js +523 -82
  159. package/package.json +4 -7
  160. package/dist/geo-map.cjs +0 -1103
  161. package/dist/geo-map.d.cts +0 -92
  162. package/dist/geo-map.d.ts +0 -92
  163. package/dist/geo-map.js +0 -1081
@@ -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,1071 +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
- const activeMediaItem = mediaItems[activeItemIndex];
571
- const mediaType = resolveMediaType(activeMediaItem);
572
- return /* @__PURE__ */ jsxs("div", { className: "relative border-b border-border/60 bg-muted/40", children: [
573
- /* @__PURE__ */ jsx("div", { className: "relative h-44 w-full overflow-hidden", children: mediaType === "video" ? /* @__PURE__ */ jsx(
574
- "video",
575
- {
576
- className: "h-full w-full object-cover",
577
- controls: true,
578
- preload: "metadata",
579
- poster: activeMediaItem.poster,
580
- children: /* @__PURE__ */ jsx("source", { src: activeMediaItem.src })
581
- }
582
- ) : /* @__PURE__ */ jsx(
583
- Img,
584
- {
585
- src: activeMediaItem.src,
586
- alt: activeMediaItem.alt ?? "Map marker media",
587
- className: "h-full w-full object-cover",
588
- loading: "eager",
589
- optixFlowConfig
590
- }
591
- ) }),
592
- totalItems > 1 ? /* @__PURE__ */ jsxs(Fragment, { children: [
593
- /* @__PURE__ */ jsx(
594
- "button",
595
- {
596
- type: "button",
597
- "aria-label": "Show previous media",
598
- className: "absolute left-2 top-1/2 inline-flex size-8 -translate-y-1/2 items-center justify-center rounded-full bg-card text-card-foreground shadow-sm transition hover:bg-muted hover:text-muted-foreground",
599
- onClick: () => {
600
- setActiveIndex(
601
- (current) => (current - 1 + totalItems) % totalItems
602
- );
603
- },
604
- children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/arrow-left", size: 16 })
605
- }
606
- ),
607
- /* @__PURE__ */ jsx(
608
- "button",
609
- {
610
- type: "button",
611
- "aria-label": "Show next media",
612
- className: "absolute right-2 top-1/2 inline-flex h-8 w-8 -translate-y-1/2 items-center justify-center rounded-full bg-card text-card-foreground shadow-sm transition hover:bg-muted hover:text-muted-foreground",
613
- onClick: () => {
614
- setActiveIndex((current) => (current + 1) % totalItems);
615
- },
616
- children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/arrow-right", size: 16 })
617
- }
618
- ),
619
- /* @__PURE__ */ jsx("div", { className: "absolute bottom-2 left-1/2 flex -translate-x-1/2 items-center gap-1.5", children: mediaItems.map((item, index) => /* @__PURE__ */ jsx(
620
- "button",
621
- {
622
- type: "button",
623
- "aria-label": `Show media item ${index + 1}`,
624
- className: cn(
625
- "h-2 rounded-full transition-all",
626
- index === activeItemIndex ? "w-6 bg-card" : "w-2 bg-card opacity-50 hover:opacity-100"
627
- ),
628
- onClick: () => setActiveIndex(index)
629
- },
630
- normalizeId(item.id, `media-dot-${index}`)
631
- )) })
632
- ] }) : null
633
- ] });
634
- }
635
- function getMarkerTitle(marker, markerIndex) {
636
- if (marker.title !== void 0 && marker.title !== null) {
637
- return marker.title;
638
- }
639
- if (marker.label !== void 0 && marker.label !== null) {
640
- return marker.label;
641
- }
642
- return `Location ${markerIndex + 1}`;
643
- }
644
- function GeoMap({
645
- className,
646
- mapWrapperClassName,
647
- mapClassName,
648
- panelClassName,
649
- panelPosition = "top-left",
650
- stadiaApiKey = "",
651
- mapStyle = "osm-bright",
652
- styleUrl,
653
- mapLibreCssHref,
654
- markers = [],
655
- clusters = [],
656
- viewState,
657
- defaultViewState,
658
- onViewStateChange,
659
- onMapClick,
660
- onMarkerDrag,
661
- showNavigationControl = true,
662
- showGeolocateControl = false,
663
- navigationControlPosition = "top-right",
664
- geolocateControlPosition = "top-left",
665
- flyToOptions,
666
- markerFocusZoom = 14,
667
- clusterFocusZoom = 5,
668
- selectedMarkerId,
669
- initialSelectedMarkerId,
670
- onSelectionChange,
671
- clearSelectionOnMapClick = true,
672
- mapChildren,
673
- optixFlowConfig
674
- }) {
675
- const normalizedStandaloneMarkers = React4.useMemo(
676
- () => markers.map((marker, index) => ({
677
- ...marker,
678
- id: normalizeId(marker.id, `marker-${index}`)
679
- })),
680
- [markers]
681
- );
682
- const normalizedClusters = React4.useMemo(() => {
683
- const results = [];
684
- clusters.forEach((cluster, clusterIndex) => {
685
- const clusterId = normalizeId(cluster.id, `cluster-${clusterIndex}`);
686
- const normalizedClusterMarkers = cluster.markers.map(
687
- (marker, markerIndex) => ({
688
- ...marker,
689
- id: normalizeId(marker.id, `${clusterId}-marker-${markerIndex}`),
690
- clusterId
691
- })
692
- );
693
- const clusterCenter = cluster.latitude !== void 0 && cluster.longitude !== void 0 ? { latitude: cluster.latitude, longitude: cluster.longitude } : buildClusterCenter(normalizedClusterMarkers);
694
- if (!clusterCenter) {
695
- return;
696
- }
697
- results.push({
698
- ...cluster,
699
- id: clusterId,
700
- latitude: clusterCenter.latitude,
701
- longitude: clusterCenter.longitude,
702
- markers: normalizedClusterMarkers
703
- });
704
- });
705
- return results;
706
- }, [clusters]);
707
- const markerLookup = React4.useMemo(() => {
708
- const lookup = /* @__PURE__ */ new Map();
709
- normalizedStandaloneMarkers.forEach((marker) => {
710
- lookup.set(marker.id, marker);
711
- });
712
- normalizedClusters.forEach((cluster) => {
713
- cluster.markers.forEach((marker) => {
714
- lookup.set(marker.id, marker);
715
- });
716
- });
717
- return lookup;
718
- }, [normalizedClusters, normalizedStandaloneMarkers]);
719
- const clusterLookup = React4.useMemo(() => {
720
- const lookup = /* @__PURE__ */ new Map();
721
- normalizedClusters.forEach((cluster) => {
722
- lookup.set(cluster.id, cluster);
723
- });
724
- return lookup;
725
- }, [normalizedClusters]);
726
- const firstCoordinate = React4.useMemo(() => {
727
- if (normalizedStandaloneMarkers.length > 0) {
728
- const firstStandaloneMarker = normalizedStandaloneMarkers[0];
729
- return {
730
- latitude: firstStandaloneMarker.latitude,
731
- longitude: firstStandaloneMarker.longitude
732
- };
733
- }
734
- if (normalizedClusters.length > 0) {
735
- const firstCluster = normalizedClusters[0];
736
- return {
737
- latitude: firstCluster.latitude,
738
- longitude: firstCluster.longitude
739
- };
740
- }
741
- return {
742
- latitude: DEFAULT_VIEW_STATE.latitude,
743
- longitude: DEFAULT_VIEW_STATE.longitude
744
- };
745
- }, [normalizedClusters, normalizedStandaloneMarkers]);
746
- const [uncontrolledViewState, setUncontrolledViewState] = React4.useState({
747
- latitude: defaultViewState?.latitude ?? firstCoordinate.latitude,
748
- longitude: defaultViewState?.longitude ?? firstCoordinate.longitude,
749
- zoom: defaultViewState?.zoom ?? DEFAULT_VIEW_STATE.zoom
750
- });
751
- const isControlledViewState = viewState !== void 0;
752
- const resolvedViewState = isControlledViewState ? viewState : uncontrolledViewState;
753
- const applyViewState = React4.useCallback(
754
- (nextState) => {
755
- if (!isControlledViewState) {
756
- setUncontrolledViewState((current) => {
757
- const next = { ...current, ...nextState };
758
- const hasChanged = current.latitude !== next.latitude || current.longitude !== next.longitude || current.zoom !== next.zoom;
759
- return hasChanged ? next : current;
760
- });
761
- }
762
- onViewStateChange?.(nextState);
763
- },
764
- [isControlledViewState, onViewStateChange]
765
- );
766
- const [selection, setSelection] = React4.useState(() => {
767
- if (initialSelectedMarkerId !== void 0 && initialSelectedMarkerId !== null) {
768
- return {
769
- type: "marker",
770
- markerId: String(initialSelectedMarkerId)
771
- };
772
- }
773
- return { type: "none" };
774
- });
775
- React4.useEffect(() => {
776
- if (selectedMarkerId === void 0 || selectedMarkerId === null) {
777
- return;
778
- }
779
- setSelection({
780
- type: "marker",
781
- markerId: String(selectedMarkerId)
782
- });
783
- }, [selectedMarkerId]);
784
- const selectedMarker = selection.markerId ? markerLookup.get(selection.markerId) : void 0;
785
- const selectedCluster = selection.clusterId ? clusterLookup.get(selection.clusterId) : void 0;
786
- React4.useEffect(() => {
787
- if (selection.type === "marker" && selection.markerId && !selectedMarker) {
788
- setSelection({ type: "none" });
789
- onSelectionChange?.({ type: "none" });
790
- }
791
- }, [onSelectionChange, selectedMarker, selection]);
792
- const emitSelectionChange = React4.useCallback(
793
- (nextSelection) => {
794
- if (nextSelection.type === "none") {
795
- onSelectionChange?.({ type: "none" });
796
- return;
797
- }
798
- if (nextSelection.type === "marker") {
799
- const parentCluster = nextSelection.marker.clusterId ? clusterLookup.get(nextSelection.marker.clusterId) : void 0;
800
- onSelectionChange?.({
801
- type: "marker",
802
- marker: nextSelection.marker,
803
- cluster: parentCluster
804
- });
805
- return;
806
- }
807
- onSelectionChange?.({
808
- type: "cluster",
809
- cluster: nextSelection.cluster
810
- });
811
- },
812
- [clusterLookup, onSelectionChange]
813
- );
814
- const selectMarker = React4.useCallback(
815
- (marker) => {
816
- setSelection({
817
- type: "marker",
818
- markerId: marker.id,
819
- clusterId: marker.clusterId
820
- });
821
- applyViewState({
822
- latitude: marker.latitude,
823
- longitude: marker.longitude,
824
- zoom: markerFocusZoom
825
- });
826
- emitSelectionChange({ type: "marker", marker });
827
- },
828
- [applyViewState, emitSelectionChange, markerFocusZoom]
829
- );
830
- const selectCluster = React4.useCallback(
831
- (cluster) => {
832
- setSelection({
833
- type: "cluster",
834
- clusterId: cluster.id
835
- });
836
- applyViewState({
837
- latitude: cluster.latitude,
838
- longitude: cluster.longitude,
839
- zoom: clusterFocusZoom
840
- });
841
- emitSelectionChange({ type: "cluster", cluster });
842
- },
843
- [applyViewState, clusterFocusZoom, emitSelectionChange]
844
- );
845
- const clearSelection = React4.useCallback(() => {
846
- setSelection({ type: "none" });
847
- emitSelectionChange({ type: "none" });
848
- }, [emitSelectionChange]);
849
- const mapMarkers = React4.useMemo(() => {
850
- const resolvedMarkers = [];
851
- normalizedClusters.forEach((cluster) => {
852
- const isSelected = selection.type === "cluster" && selection.clusterId === cluster.id;
853
- resolvedMarkers.push({
854
- id: `cluster-pin:${cluster.id}`,
855
- latitude: cluster.latitude,
856
- longitude: cluster.longitude,
857
- element: () => {
858
- const customMarkerElement = cluster.markerElement;
859
- const markerBody = typeof customMarkerElement === "function" ? customMarkerElement({
860
- isSelected,
861
- count: cluster.markers.length
862
- }) : customMarkerElement;
863
- return /* @__PURE__ */ jsx(
864
- "button",
865
- {
866
- type: "button",
867
- className: "group cursor-pointer",
868
- onClick: (event) => {
869
- event.preventDefault();
870
- event.stopPropagation();
871
- selectCluster(cluster);
872
- },
873
- "aria-label": `View ${cluster.markers.length} clustered locations`,
874
- children: markerBody ?? /* @__PURE__ */ jsx(
875
- "span",
876
- {
877
- className: cn(
878
- "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",
879
- isSelected && "ring-4 ring-primary/30",
880
- cluster.pinClassName
881
- ),
882
- style: {
883
- backgroundColor: cluster.pinColor ?? "var(--foreground)"
884
- },
885
- children: cluster.markers.length
886
- }
887
- )
888
- }
889
- );
890
- }
891
- });
892
- });
893
- normalizedStandaloneMarkers.forEach((marker) => {
894
- const isSelected = selection.type === "marker" && selection.markerId === marker.id;
895
- const customMarkerElement = marker.markerElement;
896
- resolvedMarkers.push({
897
- id: marker.id,
898
- latitude: marker.latitude,
899
- longitude: marker.longitude,
900
- draggable: marker.draggable,
901
- element: () => {
902
- const markerBody = typeof customMarkerElement === "function" ? customMarkerElement({ isSelected }) : customMarkerElement;
903
- return /* @__PURE__ */ jsx(
904
- "button",
905
- {
906
- type: "button",
907
- className: "group cursor-pointer",
908
- onClick: (event) => {
909
- event.preventDefault();
910
- event.stopPropagation();
911
- selectMarker(marker);
912
- },
913
- "aria-label": typeof marker.title === "string" ? `View ${marker.title}` : "View location details",
914
- children: markerBody ?? /* @__PURE__ */ jsx(
915
- "span",
916
- {
917
- className: cn(
918
- "inline-flex h-4 w-4 rounded-full border-2 border-white shadow-md transition-transform duration-200 group-hover:scale-110",
919
- isSelected && "h-5 w-5 ring-4 ring-primary/30",
920
- marker.pinClassName
921
- ),
922
- style: {
923
- backgroundColor: marker.pinColor ?? "#f43f5e"
924
- }
925
- }
926
- )
927
- }
928
- );
929
- }
930
- });
931
- });
932
- return resolvedMarkers;
933
- }, [
934
- normalizedClusters,
935
- normalizedStandaloneMarkers,
936
- selectCluster,
937
- selectMarker,
938
- selection
939
- ]);
940
- const renderMarkerPanel = () => {
941
- if (selectedMarker) {
942
- const markerMediaItems = selectedMarker.mediaItems ?? [];
943
- return /* @__PURE__ */ jsxs(
944
- "div",
945
- {
946
- className: cn(
947
- "relative w-[min(24rem,calc(100vw-2rem))] overflow-hidden rounded-xl border border-border bg-card text-card-foreground shadow-2xl",
948
- panelClassName
949
- ),
950
- children: [
951
- /* @__PURE__ */ jsx(
952
- "button",
953
- {
954
- type: "button",
955
- "aria-label": "Close marker details",
956
- 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",
957
- onClick: clearSelection,
958
- children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/x", size: 16 })
959
- }
960
- ),
961
- markerMediaItems.length > 0 ? /* @__PURE__ */ jsx(
962
- MarkerMediaCarousel,
963
- {
964
- mediaItems: markerMediaItems,
965
- optixFlowConfig
966
- }
967
- ) : null,
968
- /* @__PURE__ */ jsxs("div", { className: "space-y-2 p-4", children: [
969
- /* @__PURE__ */ jsx("div", { className: "flex items-start justify-between gap-3", children: /* @__PURE__ */ jsxs("div", { className: "min-w-0 space-y-1", children: [
970
- selectedMarker.eyebrow ? /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wide", children: selectedMarker.eyebrow }) : null,
971
- /* @__PURE__ */ jsx("div", { className: "text-base font-semibold leading-tight", children: selectedMarker.title ?? selectedMarker.label ?? "Location" })
972
- ] }) }),
973
- selectedMarker.summary ? /* @__PURE__ */ jsx("div", { className: "text-sm leading-relaxed", children: selectedMarker.summary }) : null,
974
- selectedMarker.locationLine ? /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-start text-sm gap-2", children: [
975
- /* @__PURE__ */ jsx(
976
- DynamicIcon,
977
- {
978
- name: "lucide:map-pin",
979
- className: "opacity-50",
980
- size: 14
981
- }
982
- ),
983
- typeof selectedMarker.locationLine === "string" ? /* @__PURE__ */ jsx(
984
- Pressable,
985
- {
986
- href: selectedMarker.locationUrl,
987
- className: cn(
988
- "transition-all duration-500",
989
- "font-medium opacity-75 hover:opacity-100",
990
- selectedMarker.locationUrl ? "underline underline-offset-4" : ""
991
- ),
992
- children: selectedMarker.locationLine
993
- }
994
- ) : selectedMarker.locationLine
995
- ] }) : null,
996
- selectedMarker.hoursLine ? /* @__PURE__ */ jsxs("div", { className: "flex flex-row items-center justify-start text-sm gap-2", children: [
997
- /* @__PURE__ */ jsx(
998
- DynamicIcon,
999
- {
1000
- name: "lucide:clock",
1001
- className: "opacity-50",
1002
- size: 14
1003
- }
1004
- ),
1005
- typeof selectedMarker.hoursLine === "string" ? /* @__PURE__ */ jsx("div", { className: "font-medium", children: selectedMarker.hoursLine }) : selectedMarker.hoursLine
1006
- ] }) : null,
1007
- selectedMarker.markerContentComponent ? /* @__PURE__ */ jsx("div", { className: "relative", children: selectedMarker.markerContentComponent }) : null,
1008
- /* @__PURE__ */ jsx(MarkerActions, { actions: selectedMarker.actions })
1009
- ] })
1010
- ]
1011
- }
1012
- );
1013
- }
1014
- if (selectedCluster) {
1015
- return /* @__PURE__ */ jsxs(
1016
- "div",
1017
- {
1018
- className: cn(
1019
- "relative w-[min(24rem,calc(100vw-2rem))] overflow-hidden rounded-xl border border-border bg-card text-card-foreground p-4 shadow-2xl",
1020
- panelClassName
1021
- ),
1022
- children: [
1023
- /* @__PURE__ */ jsx(
1024
- "button",
1025
- {
1026
- type: "button",
1027
- "aria-label": "Close cluster details",
1028
- 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",
1029
- onClick: clearSelection,
1030
- children: /* @__PURE__ */ jsx(DynamicIcon, { name: "lucide/x", size: 16 })
1031
- }
1032
- ),
1033
- /* @__PURE__ */ jsx("div", { className: "mb-3 flex items-start justify-between gap-3", children: /* @__PURE__ */ jsxs("div", { className: "min-w-0", children: [
1034
- selectedCluster.label ? /* @__PURE__ */ jsx("p", { className: "text-xs font-semibold uppercase tracking-wide text-muted-foreground", children: selectedCluster.label }) : null,
1035
- /* @__PURE__ */ jsx("div", { className: "text-base font-semibold leading-tight text-foreground", children: selectedCluster.title ?? "Clustered Locations" }),
1036
- /* @__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.` })
1037
- ] }) }),
1038
- /* @__PURE__ */ jsx("div", { className: "max-h-56 space-y-2 overflow-y-auto pr-1", children: selectedCluster.markers.map((marker, markerIndex) => /* @__PURE__ */ jsxs(
1039
- "button",
1040
- {
1041
- type: "button",
1042
- className: "w-full rounded-lg border border-border/60 p-3 text-left transition hover:border-border hover:bg-muted/50",
1043
- onClick: () => selectMarker(marker),
1044
- children: [
1045
- /* @__PURE__ */ jsx("div", { className: "line-clamp-1 text-sm font-semibold text-foreground", children: getMarkerTitle(marker, markerIndex) }),
1046
- marker.summary ? /* @__PURE__ */ jsx("div", { className: "mt-1 line-clamp-2 text-xs text-muted-foreground", children: marker.summary }) : null
1047
- ]
1048
- },
1049
- marker.id
1050
- )) })
1051
- ]
1052
- }
1053
- );
1054
- }
1055
- return null;
1056
- };
1057
- return /* @__PURE__ */ jsxs(
1058
- "div",
1059
- {
1060
- className: cn(
1061
- "relative overflow-hidden rounded-2xl border border-border bg-background",
1062
- className
1063
- ),
1064
- children: [
1065
- /* @__PURE__ */ jsx("div", { className: cn("h-[520px] w-full", mapWrapperClassName), children: /* @__PURE__ */ jsx(
1066
- MapLibre,
1067
- {
1068
- stadiaApiKey,
1069
- mapStyle,
1070
- styleUrl,
1071
- mapLibreCssHref,
1072
- viewState: resolvedViewState,
1073
- onViewStateChange: applyViewState,
1074
- markers: mapMarkers,
1075
- onClick: (coord) => {
1076
- onMapClick?.(coord);
1077
- if (clearSelectionOnMapClick) {
1078
- clearSelection();
1079
- }
1080
- },
1081
- onMarkerDrag,
1082
- showNavigationControl,
1083
- showGeolocateControl,
1084
- navigationControlPosition,
1085
- geolocateControlPosition,
1086
- flyToOptions,
1087
- className: cn("h-full w-full", mapClassName),
1088
- children: mapChildren
1089
- }
1090
- ) }),
1091
- selection.type !== "none" ? /* @__PURE__ */ jsx(
1092
- "div",
1093
- {
1094
- className: cn(
1095
- "pointer-events-none absolute z-20",
1096
- PANEL_POSITION_CLASS[panelPosition]
1097
- ),
1098
- children: /* @__PURE__ */ jsx("div", { className: "pointer-events-auto", children: renderMarkerPanel() })
1099
- }
1100
- ) : null
1101
- ]
1102
- }
1103
- );
1104
- }
1105
39
  var maxWidthStyles = {
1106
40
  sm: "max-w-screen-sm",
1107
41
  md: "max-w-screen-md",
@@ -1478,6 +412,14 @@ var Section = React4__default.forwardRef(
1478
412
  }
1479
413
  );
1480
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";
1481
423
  var DEFAULT_STYLE_RULES = {
1482
424
  formContainer: "",
1483
425
  fieldsContainer: "",
@@ -1567,7 +509,10 @@ function ContactMap({
1567
509
  panelPosition: "top-left",
1568
510
  ...mapProps,
1569
511
  className: cn("h-full w-full", mapClassName, mapProps?.className),
1570
- optixFlowConfig
512
+ optixFlowConfig,
513
+ // Provide icon and image components for rich marker panels
514
+ IconComponent: DynamicIcon,
515
+ ImgComponent: Img
1571
516
  };
1572
517
  }, [mapClassName, mapProps, optixFlowConfig]);
1573
518
  return /* @__PURE__ */ jsx(