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