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