@opensite/ui 1.3.2 → 1.3.4

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 (167) hide show
  1. package/dist/footer-accordion-social.cjs +1344 -0
  2. package/dist/footer-accordion-social.d.cts +154 -0
  3. package/dist/footer-accordion-social.d.ts +154 -0
  4. package/dist/footer-accordion-social.js +1322 -0
  5. package/dist/footer-info-cards-accordion.cjs +1427 -0
  6. package/dist/footer-info-cards-accordion.d.cts +278 -0
  7. package/dist/footer-info-cards-accordion.d.ts +278 -0
  8. package/dist/footer-info-cards-accordion.js +1404 -0
  9. package/dist/footer-newsletter-contact.cjs +1281 -0
  10. package/dist/footer-newsletter-contact.d.cts +163 -0
  11. package/dist/footer-newsletter-contact.d.ts +163 -0
  12. package/dist/footer-newsletter-contact.js +1259 -0
  13. package/dist/footer-split-image-accordion.cjs +1395 -0
  14. package/dist/footer-split-image-accordion.d.cts +236 -0
  15. package/dist/footer-split-image-accordion.d.ts +236 -0
  16. package/dist/footer-split-image-accordion.js +1372 -0
  17. package/dist/list-achievements-showcase.cjs +1141 -0
  18. package/dist/list-achievements-showcase.d.cts +131 -0
  19. package/dist/list-achievements-showcase.d.ts +131 -0
  20. package/dist/list-achievements-showcase.js +1119 -0
  21. package/dist/list-career-timeline.cjs +531 -0
  22. package/dist/list-career-timeline.d.cts +153 -0
  23. package/dist/list-career-timeline.d.ts +153 -0
  24. package/dist/list-career-timeline.js +509 -0
  25. package/dist/list-feature-comparison.cjs +1211 -0
  26. package/dist/list-feature-comparison.d.cts +189 -0
  27. package/dist/list-feature-comparison.d.ts +189 -0
  28. package/dist/list-feature-comparison.js +1190 -0
  29. package/dist/list-metrics-dashboard.cjs +1402 -0
  30. package/dist/list-metrics-dashboard.d.cts +191 -0
  31. package/dist/list-metrics-dashboard.d.ts +191 -0
  32. package/dist/list-metrics-dashboard.js +1379 -0
  33. package/dist/list-service-category-table.cjs +762 -0
  34. package/dist/list-service-category-table.d.cts +135 -0
  35. package/dist/list-service-category-table.d.ts +135 -0
  36. package/dist/list-service-category-table.js +741 -0
  37. package/dist/offer-modal-membership-image.cjs +1361 -0
  38. package/dist/offer-modal-membership-image.d.cts +194 -0
  39. package/dist/offer-modal-membership-image.d.ts +194 -0
  40. package/dist/offer-modal-membership-image.js +1339 -0
  41. package/dist/offer-modal-newsletter-discount.cjs +1296 -0
  42. package/dist/offer-modal-newsletter-discount.d.cts +164 -0
  43. package/dist/offer-modal-newsletter-discount.d.ts +164 -0
  44. package/dist/offer-modal-newsletter-discount.js +1274 -0
  45. package/dist/offer-modal-sheet-newsletter.cjs +1360 -0
  46. package/dist/offer-modal-sheet-newsletter.d.cts +221 -0
  47. package/dist/offer-modal-sheet-newsletter.d.ts +221 -0
  48. package/dist/offer-modal-sheet-newsletter.js +1337 -0
  49. package/dist/pricing-addons-cards.cjs +1143 -0
  50. package/dist/pricing-addons-cards.d.cts +203 -0
  51. package/dist/pricing-addons-cards.d.ts +203 -0
  52. package/dist/pricing-addons-cards.js +1122 -0
  53. package/dist/pricing-addons-featured.cjs +1224 -0
  54. package/dist/pricing-addons-featured.d.cts +271 -0
  55. package/dist/pricing-addons-featured.d.ts +271 -0
  56. package/dist/pricing-addons-featured.js +1203 -0
  57. package/dist/pricing-collapsible-plans.cjs +1315 -0
  58. package/dist/pricing-collapsible-plans.d.cts +258 -0
  59. package/dist/pricing-collapsible-plans.d.ts +258 -0
  60. package/dist/pricing-collapsible-plans.js +1294 -0
  61. package/dist/pricing-columns-toggle.cjs +1234 -0
  62. package/dist/pricing-columns-toggle.d.cts +251 -0
  63. package/dist/pricing-columns-toggle.d.ts +251 -0
  64. package/dist/pricing-columns-toggle.js +1212 -0
  65. package/dist/pricing-comparison-headers.cjs +1235 -0
  66. package/dist/pricing-comparison-headers.d.cts +245 -0
  67. package/dist/pricing-comparison-headers.d.ts +245 -0
  68. package/dist/pricing-comparison-headers.js +1213 -0
  69. package/dist/pricing-comparison-table.cjs +1374 -0
  70. package/dist/pricing-comparison-table.d.cts +280 -0
  71. package/dist/pricing-comparison-table.d.ts +280 -0
  72. package/dist/pricing-comparison-table.js +1352 -0
  73. package/dist/pricing-discount-card.cjs +1217 -0
  74. package/dist/pricing-discount-card.d.cts +195 -0
  75. package/dist/pricing-discount-card.d.ts +195 -0
  76. package/dist/pricing-discount-card.js +1195 -0
  77. package/dist/pricing-enterprise-contact.cjs +1094 -0
  78. package/dist/pricing-enterprise-contact.d.cts +170 -0
  79. package/dist/pricing-enterprise-contact.d.ts +170 -0
  80. package/dist/pricing-enterprise-contact.js +1073 -0
  81. package/dist/pricing-feature-matrix.cjs +1197 -0
  82. package/dist/pricing-feature-matrix.d.cts +56 -0
  83. package/dist/pricing-feature-matrix.d.ts +56 -0
  84. package/dist/pricing-feature-matrix.js +1174 -0
  85. package/dist/pricing-four-tier-toggle.cjs +1320 -0
  86. package/dist/pricing-four-tier-toggle.d.cts +266 -0
  87. package/dist/pricing-four-tier-toggle.d.ts +266 -0
  88. package/dist/pricing-four-tier-toggle.js +1297 -0
  89. package/dist/pricing-full-comparison.cjs +1301 -0
  90. package/dist/pricing-full-comparison.d.cts +265 -0
  91. package/dist/pricing-full-comparison.d.ts +265 -0
  92. package/dist/pricing-full-comparison.js +1279 -0
  93. package/dist/pricing-gradient-cards.cjs +1248 -0
  94. package/dist/pricing-gradient-cards.d.cts +258 -0
  95. package/dist/pricing-gradient-cards.d.ts +258 -0
  96. package/dist/pricing-gradient-cards.js +1226 -0
  97. package/dist/pricing-icon-headers.cjs +1163 -0
  98. package/dist/pricing-icon-headers.d.cts +218 -0
  99. package/dist/pricing-icon-headers.d.ts +218 -0
  100. package/dist/pricing-icon-headers.js +1142 -0
  101. package/dist/pricing-minimal-cards.cjs +1146 -0
  102. package/dist/pricing-minimal-cards.d.cts +210 -0
  103. package/dist/pricing-minimal-cards.d.ts +210 -0
  104. package/dist/pricing-minimal-cards.js +1125 -0
  105. package/dist/pricing-packages-radio.cjs +1203 -0
  106. package/dist/pricing-packages-radio.d.cts +243 -0
  107. package/dist/pricing-packages-radio.d.ts +243 -0
  108. package/dist/pricing-packages-radio.js +1182 -0
  109. package/dist/pricing-popular-highlight.cjs +1293 -0
  110. package/dist/pricing-popular-highlight.d.cts +255 -0
  111. package/dist/pricing-popular-highlight.d.ts +255 -0
  112. package/dist/pricing-popular-highlight.js +1271 -0
  113. package/dist/pricing-radio-toggle.cjs +1277 -0
  114. package/dist/pricing-radio-toggle.d.cts +251 -0
  115. package/dist/pricing-radio-toggle.d.ts +251 -0
  116. package/dist/pricing-radio-toggle.js +1255 -0
  117. package/dist/pricing-responsive-table.cjs +1229 -0
  118. package/dist/pricing-responsive-table.d.cts +55 -0
  119. package/dist/pricing-responsive-table.d.ts +55 -0
  120. package/dist/pricing-responsive-table.js +1206 -0
  121. package/dist/pricing-services-cards.cjs +1209 -0
  122. package/dist/pricing-services-cards.d.cts +230 -0
  123. package/dist/pricing-services-cards.d.ts +230 -0
  124. package/dist/pricing-services-cards.js +1188 -0
  125. package/dist/pricing-simple-card.cjs +1102 -0
  126. package/dist/pricing-simple-card.d.cts +174 -0
  127. package/dist/pricing-simple-card.d.ts +174 -0
  128. package/dist/pricing-simple-card.js +1081 -0
  129. package/dist/pricing-single-card.cjs +1174 -0
  130. package/dist/pricing-single-card.d.cts +201 -0
  131. package/dist/pricing-single-card.d.ts +201 -0
  132. package/dist/pricing-single-card.js +1152 -0
  133. package/dist/pricing-split-layout.cjs +1001 -0
  134. package/dist/pricing-split-layout.d.cts +44 -0
  135. package/dist/pricing-split-layout.d.ts +44 -0
  136. package/dist/pricing-split-layout.js +980 -0
  137. package/dist/pricing-spotlight-card.cjs +1157 -0
  138. package/dist/pricing-spotlight-card.d.cts +201 -0
  139. package/dist/pricing-spotlight-card.d.ts +201 -0
  140. package/dist/pricing-spotlight-card.js +1136 -0
  141. package/dist/pricing-switch-cards.cjs +1274 -0
  142. package/dist/pricing-switch-cards.d.cts +254 -0
  143. package/dist/pricing-switch-cards.d.ts +254 -0
  144. package/dist/pricing-switch-cards.js +1252 -0
  145. package/dist/pricing-tabs-toggle.cjs +1314 -0
  146. package/dist/pricing-tabs-toggle.d.cts +274 -0
  147. package/dist/pricing-tabs-toggle.d.ts +274 -0
  148. package/dist/pricing-tabs-toggle.js +1291 -0
  149. package/dist/pricing-tier-grid.cjs +1190 -0
  150. package/dist/pricing-tier-grid.d.cts +224 -0
  151. package/dist/pricing-tier-grid.d.ts +224 -0
  152. package/dist/pricing-tier-grid.js +1169 -0
  153. package/dist/pricing-toggle-cards.cjs +1330 -0
  154. package/dist/pricing-toggle-cards.d.cts +267 -0
  155. package/dist/pricing-toggle-cards.d.ts +267 -0
  156. package/dist/pricing-toggle-cards.js +1307 -0
  157. package/dist/pricing-toggle-period.cjs +1251 -0
  158. package/dist/pricing-toggle-period.d.cts +265 -0
  159. package/dist/pricing-toggle-period.d.ts +265 -0
  160. package/dist/pricing-toggle-period.js +1230 -0
  161. package/dist/pricing-two-column-basic.cjs +1243 -0
  162. package/dist/pricing-two-column-basic.d.cts +244 -0
  163. package/dist/pricing-two-column-basic.d.ts +244 -0
  164. package/dist/pricing-two-column-basic.js +1222 -0
  165. package/dist/registry.cjs +109 -85
  166. package/dist/registry.js +931 -907
  167. package/package.json +1 -1
@@ -0,0 +1,1296 @@
1
+ "use client";
2
+ 'use strict';
3
+
4
+ var React = require('react');
5
+ var forms = require('@page-speed/forms');
6
+ var inputs = require('@page-speed/forms/inputs');
7
+ var clsx = require('clsx');
8
+ var tailwindMerge = require('tailwind-merge');
9
+ var classVarianceAuthority = require('class-variance-authority');
10
+ var jsxRuntime = require('react/jsx-runtime');
11
+ var DialogPrimitive = require('@radix-ui/react-dialog');
12
+ var integration = require('@page-speed/forms/integration');
13
+
14
+ function _interopNamespace(e) {
15
+ if (e && e.__esModule) return e;
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ Object.keys(e).forEach(function (k) {
19
+ if (k !== 'default') {
20
+ var d = Object.getOwnPropertyDescriptor(e, k);
21
+ Object.defineProperty(n, k, d.get ? d : {
22
+ enumerable: true,
23
+ get: function () { return e[k]; }
24
+ });
25
+ }
26
+ });
27
+ }
28
+ n.default = e;
29
+ return Object.freeze(n);
30
+ }
31
+
32
+ var React__namespace = /*#__PURE__*/_interopNamespace(React);
33
+ var DialogPrimitive__namespace = /*#__PURE__*/_interopNamespace(DialogPrimitive);
34
+
35
+ // components/blocks/offer-modal/offer-modal-newsletter-discount.tsx
36
+ var TextInput = inputs.TextInput;
37
+ function cn(...inputs) {
38
+ return tailwindMerge.twMerge(clsx.clsx(inputs));
39
+ }
40
+ function normalizePhoneNumber(input) {
41
+ const trimmed = input.trim();
42
+ if (trimmed.toLowerCase().startsWith("tel:")) {
43
+ return trimmed;
44
+ }
45
+ const match = trimmed.match(/^[\s\+\-\(\)]*(\d[\d\s\-\(\)\.]*\d)[\s\-]*(x|ext\.?|extension)?[\s\-]*(\d+)?$/i);
46
+ if (match) {
47
+ const mainNumber = match[1].replace(/[\s\-\(\)\.]/g, "");
48
+ const extension = match[3];
49
+ const normalized = mainNumber.length >= 10 && !trimmed.startsWith("+") ? `+${mainNumber}` : mainNumber;
50
+ const withExtension = extension ? `${normalized};ext=${extension}` : normalized;
51
+ return `tel:${withExtension}`;
52
+ }
53
+ const cleaned = trimmed.replace(/[\s\-\(\)\.]/g, "");
54
+ return `tel:${cleaned}`;
55
+ }
56
+ function normalizeEmail(input) {
57
+ const trimmed = input.trim();
58
+ if (trimmed.toLowerCase().startsWith("mailto:")) {
59
+ return trimmed;
60
+ }
61
+ return `mailto:${trimmed}`;
62
+ }
63
+ function isEmail(input) {
64
+ const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
65
+ return emailRegex.test(input.trim());
66
+ }
67
+ function isPhoneNumber(input) {
68
+ const trimmed = input.trim();
69
+ if (trimmed.toLowerCase().startsWith("tel:")) {
70
+ return true;
71
+ }
72
+ const phoneRegex = /^[\s\+\-\(\)]*\d[\d\s\-\(\)\.]*\d[\s\-]*(x|ext\.?|extension)?[\s\-]*\d*$/i;
73
+ return phoneRegex.test(trimmed);
74
+ }
75
+ function isInternalUrl(href) {
76
+ if (typeof window === "undefined") {
77
+ return href.startsWith("/") && !href.startsWith("//");
78
+ }
79
+ const trimmed = href.trim();
80
+ if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
81
+ return true;
82
+ }
83
+ try {
84
+ const url = new URL(trimmed, window.location.href);
85
+ const currentOrigin = window.location.origin;
86
+ const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
87
+ return normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin);
88
+ } catch {
89
+ return false;
90
+ }
91
+ }
92
+ function toRelativePath(href) {
93
+ if (typeof window === "undefined") {
94
+ return href;
95
+ }
96
+ const trimmed = href.trim();
97
+ if (trimmed.startsWith("/") && !trimmed.startsWith("//")) {
98
+ return trimmed;
99
+ }
100
+ try {
101
+ const url = new URL(trimmed, window.location.href);
102
+ const currentOrigin = window.location.origin;
103
+ const normalizeOrigin = (origin) => origin.replace(/^(https?:\/\/)(www\.)?/, "$1");
104
+ if (normalizeOrigin(url.origin) === normalizeOrigin(currentOrigin)) {
105
+ return url.pathname + url.search + url.hash;
106
+ }
107
+ } catch {
108
+ }
109
+ return trimmed;
110
+ }
111
+ function useNavigation({
112
+ href,
113
+ onClick
114
+ } = {}) {
115
+ const linkType = React__namespace.useMemo(() => {
116
+ if (!href || href.trim() === "") {
117
+ return onClick ? "none" : "none";
118
+ }
119
+ const trimmed = href.trim();
120
+ if (trimmed.toLowerCase().startsWith("mailto:") || isEmail(trimmed)) {
121
+ return "mailto";
122
+ }
123
+ if (trimmed.toLowerCase().startsWith("tel:") || isPhoneNumber(trimmed)) {
124
+ return "tel";
125
+ }
126
+ if (isInternalUrl(trimmed)) {
127
+ return "internal";
128
+ }
129
+ try {
130
+ new URL(trimmed, typeof window !== "undefined" ? window.location.href : "http://localhost");
131
+ return "external";
132
+ } catch {
133
+ return "internal";
134
+ }
135
+ }, [href, onClick]);
136
+ const normalizedHref = React__namespace.useMemo(() => {
137
+ if (!href || href.trim() === "") {
138
+ return void 0;
139
+ }
140
+ const trimmed = href.trim();
141
+ switch (linkType) {
142
+ case "tel":
143
+ return normalizePhoneNumber(trimmed);
144
+ case "mailto":
145
+ return normalizeEmail(trimmed);
146
+ case "internal":
147
+ return toRelativePath(trimmed);
148
+ case "external":
149
+ return trimmed;
150
+ default:
151
+ return trimmed;
152
+ }
153
+ }, [href, linkType]);
154
+ const target = React__namespace.useMemo(() => {
155
+ switch (linkType) {
156
+ case "external":
157
+ return "_blank";
158
+ case "internal":
159
+ return "_self";
160
+ case "mailto":
161
+ case "tel":
162
+ return void 0;
163
+ default:
164
+ return void 0;
165
+ }
166
+ }, [linkType]);
167
+ const rel = React__namespace.useMemo(() => {
168
+ if (linkType === "external") {
169
+ return "noopener noreferrer";
170
+ }
171
+ return void 0;
172
+ }, [linkType]);
173
+ const isExternal = linkType === "external";
174
+ const isInternal = linkType === "internal";
175
+ const shouldUseRouter = isInternal && typeof normalizedHref === "string" && normalizedHref.startsWith("/");
176
+ const handleClick = React__namespace.useCallback(
177
+ (event) => {
178
+ if (onClick) {
179
+ try {
180
+ onClick(event);
181
+ } catch (error) {
182
+ console.error("Error in user onClick handler:", error);
183
+ }
184
+ }
185
+ if (event.defaultPrevented) {
186
+ return;
187
+ }
188
+ if (shouldUseRouter && normalizedHref && event.button === 0 && // left-click only
189
+ !event.metaKey && !event.altKey && !event.ctrlKey && !event.shiftKey) {
190
+ if (typeof window !== "undefined") {
191
+ const handler = window.__opensiteNavigationHandler;
192
+ if (typeof handler === "function") {
193
+ try {
194
+ const handled = handler(normalizedHref, event.nativeEvent || event);
195
+ if (handled !== false) {
196
+ event.preventDefault();
197
+ }
198
+ } catch (error) {
199
+ console.error("Error in navigation handler:", error);
200
+ }
201
+ }
202
+ }
203
+ }
204
+ },
205
+ [onClick, shouldUseRouter, normalizedHref]
206
+ );
207
+ return {
208
+ linkType,
209
+ normalizedHref,
210
+ target,
211
+ rel,
212
+ isExternal,
213
+ isInternal,
214
+ shouldUseRouter,
215
+ handleClick
216
+ };
217
+ }
218
+ var baseStyles = [
219
+ // Layout
220
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap shrink-0",
221
+ // Typography - using CSS variables with sensible defaults
222
+ "font-[var(--button-font-family,inherit)]",
223
+ "font-[var(--button-font-weight,500)]",
224
+ "tracking-[var(--button-letter-spacing,0)]",
225
+ "leading-[var(--button-line-height,1.25)]",
226
+ "[text-transform:var(--button-text-transform,none)]",
227
+ "text-sm",
228
+ // Border radius
229
+ "rounded-[var(--button-radius,var(--radius,0.375rem))]",
230
+ // Smooth transition - using [transition:...] to set full shorthand property (not just transition-property)
231
+ "[transition:var(--button-transition,all_250ms_cubic-bezier(0.4,0,0.2,1))]",
232
+ // Box shadow (master level) - using [box-shadow:...] for complex multi-value shadows
233
+ "[box-shadow:var(--button-shadow,none)]",
234
+ "hover:[box-shadow:var(--button-shadow-hover,var(--button-shadow,none))]",
235
+ // Disabled state
236
+ "disabled:pointer-events-none disabled:opacity-50",
237
+ // SVG handling
238
+ "[&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 [&_svg]:shrink-0",
239
+ // Focus styles
240
+ "outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px]",
241
+ // Invalid state
242
+ "aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive"
243
+ ].join(" ");
244
+ var buttonVariants = classVarianceAuthority.cva(baseStyles, {
245
+ variants: {
246
+ variant: {
247
+ // Default (Primary) variant - full customization
248
+ default: [
249
+ "bg-[var(--button-default-bg,hsl(var(--primary)))]",
250
+ "text-[var(--button-default-fg,hsl(var(--primary-foreground)))]",
251
+ "border-[length:var(--button-default-border-width,0px)]",
252
+ "border-[color:var(--button-default-border,transparent)]",
253
+ "[box-shadow:var(--button-default-shadow,var(--button-shadow,none))]",
254
+ "hover:bg-[var(--button-default-hover-bg,hsl(var(--primary)/0.9))]",
255
+ "hover:text-[var(--button-default-hover-fg,var(--button-default-fg,hsl(var(--primary-foreground))))]",
256
+ "hover:border-[color:var(--button-default-hover-border,var(--button-default-border,transparent))]",
257
+ "hover:[box-shadow:var(--button-default-shadow-hover,var(--button-shadow-hover,var(--button-default-shadow,var(--button-shadow,none))))]"
258
+ ].join(" "),
259
+ // Destructive variant - full customization
260
+ destructive: [
261
+ "bg-[var(--button-destructive-bg,hsl(var(--destructive)))]",
262
+ "text-[var(--button-destructive-fg,white)]",
263
+ "border-[length:var(--button-destructive-border-width,0px)]",
264
+ "border-[color:var(--button-destructive-border,transparent)]",
265
+ "[box-shadow:var(--button-destructive-shadow,var(--button-shadow,none))]",
266
+ "hover:bg-[var(--button-destructive-hover-bg,hsl(var(--destructive)/0.9))]",
267
+ "hover:text-[var(--button-destructive-hover-fg,var(--button-destructive-fg,white))]",
268
+ "hover:border-[color:var(--button-destructive-hover-border,var(--button-destructive-border,transparent))]",
269
+ "hover:[box-shadow:var(--button-destructive-shadow-hover,var(--button-shadow-hover,var(--button-destructive-shadow,var(--button-shadow,none))))]",
270
+ "focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",
271
+ "dark:bg-destructive/60"
272
+ ].join(" "),
273
+ // Outline variant - full customization with proper border handling
274
+ outline: [
275
+ "bg-[var(--button-outline-bg,hsl(var(--background)))]",
276
+ "text-[var(--button-outline-fg,inherit)]",
277
+ "border-[length:var(--button-outline-border-width,1px)]",
278
+ "border-[color:var(--button-outline-border,hsl(var(--border)))]",
279
+ "[box-shadow:var(--button-outline-shadow,var(--button-shadow,0_1px_2px_0_rgb(0_0_0/0.05)))]",
280
+ "hover:bg-[var(--button-outline-hover-bg,hsl(var(--accent)))]",
281
+ "hover:text-[var(--button-outline-hover-fg,hsl(var(--accent-foreground)))]",
282
+ "hover:border-[color:var(--button-outline-hover-border,var(--button-outline-border,hsl(var(--border))))]",
283
+ "hover:[box-shadow:var(--button-outline-shadow-hover,var(--button-shadow-hover,var(--button-outline-shadow,var(--button-shadow,none))))]",
284
+ "dark:bg-input/30 dark:border-input dark:hover:bg-input/50"
285
+ ].join(" "),
286
+ // Secondary variant - full customization
287
+ secondary: [
288
+ "bg-[var(--button-secondary-bg,hsl(var(--secondary)))]",
289
+ "text-[var(--button-secondary-fg,hsl(var(--secondary-foreground)))]",
290
+ "border-[length:var(--button-secondary-border-width,0px)]",
291
+ "border-[color:var(--button-secondary-border,transparent)]",
292
+ "[box-shadow:var(--button-secondary-shadow,var(--button-shadow,none))]",
293
+ "hover:bg-[var(--button-secondary-hover-bg,hsl(var(--secondary)/0.8))]",
294
+ "hover:text-[var(--button-secondary-hover-fg,var(--button-secondary-fg,hsl(var(--secondary-foreground))))]",
295
+ "hover:border-[color:var(--button-secondary-hover-border,var(--button-secondary-border,transparent))]",
296
+ "hover:[box-shadow:var(--button-secondary-shadow-hover,var(--button-shadow-hover,var(--button-secondary-shadow,var(--button-shadow,none))))]"
297
+ ].join(" "),
298
+ // Ghost variant - full customization
299
+ ghost: [
300
+ "bg-[var(--button-ghost-bg,transparent)]",
301
+ "text-[var(--button-ghost-fg,inherit)]",
302
+ "border-[length:var(--button-ghost-border-width,0px)]",
303
+ "border-[color:var(--button-ghost-border,transparent)]",
304
+ "[box-shadow:var(--button-ghost-shadow,var(--button-shadow,none))]",
305
+ "hover:bg-[var(--button-ghost-hover-bg,hsl(var(--accent)))]",
306
+ "hover:text-[var(--button-ghost-hover-fg,hsl(var(--accent-foreground)))]",
307
+ "hover:border-[color:var(--button-ghost-hover-border,var(--button-ghost-border,transparent))]",
308
+ "hover:[box-shadow:var(--button-ghost-shadow-hover,var(--button-shadow-hover,var(--button-ghost-shadow,var(--button-shadow,none))))]",
309
+ "dark:hover:bg-accent/50"
310
+ ].join(" "),
311
+ // Link variant - full customization
312
+ link: [
313
+ "bg-[var(--button-link-bg,transparent)]",
314
+ "text-[var(--button-link-fg,hsl(var(--primary)))]",
315
+ "border-[length:var(--button-link-border-width,0px)]",
316
+ "border-[color:var(--button-link-border,transparent)]",
317
+ "[box-shadow:var(--button-link-shadow,none)]",
318
+ "hover:bg-[var(--button-link-hover-bg,transparent)]",
319
+ "hover:text-[var(--button-link-hover-fg,var(--button-link-fg,hsl(var(--primary))))]",
320
+ "hover:[box-shadow:var(--button-link-shadow-hover,none)]",
321
+ "underline-offset-4 hover:underline"
322
+ ].join(" ")
323
+ },
324
+ size: {
325
+ default: [
326
+ "h-[var(--button-height-md,2.25rem)]",
327
+ "px-[var(--button-padding-x-md,1rem)]",
328
+ "py-[var(--button-padding-y-md,0.5rem)]",
329
+ "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
330
+ ].join(" "),
331
+ sm: [
332
+ "h-[var(--button-height-sm,2rem)]",
333
+ "px-[var(--button-padding-x-sm,0.75rem)]",
334
+ "py-[var(--button-padding-y-sm,0.25rem)]",
335
+ "gap-1.5",
336
+ "has-[>svg]:px-[calc(var(--button-padding-x-sm,0.75rem)*0.83)]"
337
+ ].join(" "),
338
+ md: [
339
+ "h-[var(--button-height-md,2.25rem)]",
340
+ "px-[var(--button-padding-x-md,1rem)]",
341
+ "py-[var(--button-padding-y-md,0.5rem)]",
342
+ "has-[>svg]:px-[calc(var(--button-padding-x-md,1rem)*0.75)]"
343
+ ].join(" "),
344
+ lg: [
345
+ "h-[var(--button-height-lg,2.5rem)]",
346
+ "px-[var(--button-padding-x-lg,1.5rem)]",
347
+ "py-[var(--button-padding-y-lg,0.5rem)]",
348
+ "has-[>svg]:px-[calc(var(--button-padding-x-lg,1.5rem)*0.67)]"
349
+ ].join(" "),
350
+ icon: "size-[var(--button-height-md,2.25rem)]",
351
+ "icon-sm": "size-[var(--button-height-sm,2rem)]",
352
+ "icon-lg": "size-[var(--button-height-lg,2.5rem)]"
353
+ }
354
+ },
355
+ defaultVariants: {
356
+ variant: "default",
357
+ size: "default"
358
+ }
359
+ });
360
+ var Pressable = React__namespace.forwardRef(
361
+ ({
362
+ children,
363
+ className,
364
+ href,
365
+ onClick,
366
+ variant,
367
+ size,
368
+ asButton = false,
369
+ fallbackComponentType = "span",
370
+ componentType,
371
+ "aria-label": ariaLabel,
372
+ "aria-describedby": ariaDescribedby,
373
+ id,
374
+ ...props
375
+ }, ref) => {
376
+ const navigation = useNavigation({ href, onClick });
377
+ const {
378
+ normalizedHref,
379
+ target,
380
+ rel,
381
+ linkType,
382
+ isInternal,
383
+ handleClick
384
+ } = navigation;
385
+ const shouldRenderLink = normalizedHref && linkType !== "none";
386
+ const shouldRenderButton = !shouldRenderLink && onClick;
387
+ const effectiveComponentType = componentType || (shouldRenderLink ? "a" : shouldRenderButton ? "button" : fallbackComponentType);
388
+ const finalComponentType = isInternal && shouldRenderLink ? "a" : effectiveComponentType;
389
+ const shouldApplyButtonStyles = asButton || variant || size;
390
+ const combinedClassName = cn(
391
+ shouldApplyButtonStyles && buttonVariants({ variant, size }),
392
+ className
393
+ );
394
+ const dataProps = Object.fromEntries(
395
+ Object.entries(props).filter(([key]) => key.startsWith("data-"))
396
+ );
397
+ const buttonDataAttributes = shouldApplyButtonStyles ? {
398
+ "data-slot": "button",
399
+ "data-variant": variant ?? "default",
400
+ "data-size": size ?? "default"
401
+ } : {};
402
+ const commonProps = {
403
+ className: combinedClassName,
404
+ onClick: handleClick,
405
+ "aria-label": ariaLabel,
406
+ "aria-describedby": ariaDescribedby,
407
+ id,
408
+ ...dataProps,
409
+ ...buttonDataAttributes
410
+ };
411
+ if (finalComponentType === "a" && shouldRenderLink) {
412
+ return /* @__PURE__ */ jsxRuntime.jsx(
413
+ "a",
414
+ {
415
+ ref,
416
+ href: normalizedHref,
417
+ target,
418
+ rel,
419
+ ...commonProps,
420
+ ...props,
421
+ children
422
+ }
423
+ );
424
+ }
425
+ if (finalComponentType === "button") {
426
+ return /* @__PURE__ */ jsxRuntime.jsx(
427
+ "button",
428
+ {
429
+ ref,
430
+ type: props.type || "button",
431
+ ...commonProps,
432
+ ...props,
433
+ children
434
+ }
435
+ );
436
+ }
437
+ if (finalComponentType === "div") {
438
+ return /* @__PURE__ */ jsxRuntime.jsx(
439
+ "div",
440
+ {
441
+ ref,
442
+ ...commonProps,
443
+ children
444
+ }
445
+ );
446
+ }
447
+ return /* @__PURE__ */ jsxRuntime.jsx(
448
+ "span",
449
+ {
450
+ ref,
451
+ ...commonProps,
452
+ children
453
+ }
454
+ );
455
+ }
456
+ );
457
+ Pressable.displayName = "Pressable";
458
+ var maxWidthStyles = {
459
+ sm: "max-w-screen-sm",
460
+ md: "max-w-screen-md",
461
+ lg: "max-w-screen-lg",
462
+ xl: "max-w-7xl",
463
+ "2xl": "max-w-screen-2xl",
464
+ "4xl": "max-w-[1536px]",
465
+ full: "max-w-full"
466
+ };
467
+ var Container = React__namespace.default.forwardRef(
468
+ ({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
469
+ const Component = as;
470
+ return /* @__PURE__ */ jsxRuntime.jsx(
471
+ Component,
472
+ {
473
+ ref,
474
+ className: cn(
475
+ "mx-auto w-full px-2 sm:px-4 lg:px-8",
476
+ maxWidthStyles[maxWidth],
477
+ className
478
+ ),
479
+ ...props,
480
+ children
481
+ }
482
+ );
483
+ }
484
+ );
485
+ Container.displayName = "Container";
486
+
487
+ // lib/patternSvgs.ts
488
+ var patternSvgs = {
489
+ squareAltGrid: "https://cdn.ing/assets/files/record/286187/4gpn0yq2ptra8iwlvmwwv860ggwv",
490
+ grid1: "https://cdn.ing/assets/files/record/286186/nbdflpgp4ostrno079hygibsflp3",
491
+ noise: "https://cdn.ing/assets/i/r/286188/zrqcp9hynh3j7p2laihwzfbujgrl/noise.png",
492
+ dots: "https://cdn.ing/assets/files/record/286198/yfsjx9thvtxzhl2qtshxyhkrm524",
493
+ dotPattern: "https://cdn.ing/assets/files/record/286192/7ig0cku8aqbboiza8nuk6hw0nnsr",
494
+ dotPattern2: "https://cdn.ing/assets/files/record/286189/arez6gd2s7isn9i1o6c7sexdq7bl",
495
+ circles: "https://cdn.ing/assets/files/record/286190/gtmia3sncjtzetdshc20zf1d3c17",
496
+ waves: "https://cdn.ing/assets/files/record/286191/mqlb33fzxz9cdth1bx7if0wmpkp1",
497
+ crossPattern: "https://cdn.ing/assets/files/record/286193/9yfqwdbnqaipbp7fsb3wbzzmq472",
498
+ architect: "https://cdn.ing/assets/files/record/286194/vgs88ugpvyhxu13wqgy0acvae6re",
499
+ tinyCheckers: "https://cdn.ing/assets/files/record/286195/65efaknsw8kcpf9o3c2gybytsl5b",
500
+ p6: "https://cdn.ing/assets/i/r/286196/6kl0rqnd6mjk8j7e525fo8fo0vkc/p6.webp"
501
+ };
502
+ var maskTop = "radial-gradient(ellipse 70% 60% at 50% 0%, #000 60%, transparent 100%)";
503
+ var maskBottom = "radial-gradient(ellipse 100% 80% at 50% 100%, #000 50%, transparent 90%)";
504
+ var maskCenter = "radial-gradient(ellipse 60% 60% at 50% 50%, #000 30%, transparent 70%)";
505
+ var maskTopLeft = "radial-gradient(ellipse 80% 80% at 0% 0%, #000 50%, transparent 90%)";
506
+ var maskTopRight = "radial-gradient(ellipse 80% 80% at 100% 0%, #000 50%, transparent 90%)";
507
+ var maskBottomLeft = "radial-gradient(ellipse 80% 80% at 0% 100%, #000 50%, transparent 90%)";
508
+ var maskBottomRight = "radial-gradient(ellipse 80% 80% at 100% 100%, #000 50%, transparent 90%)";
509
+ var circuitBoardPattern = (id, mask) => /* @__PURE__ */ jsxRuntime.jsxs(
510
+ "svg",
511
+ {
512
+ className: "h-full w-full",
513
+ xmlns: "http://www.w3.org/2000/svg",
514
+ style: mask ? {
515
+ maskImage: mask,
516
+ WebkitMaskImage: mask
517
+ } : void 0,
518
+ children: [
519
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs(
520
+ "pattern",
521
+ {
522
+ id,
523
+ x: "0",
524
+ y: "0",
525
+ width: "100",
526
+ height: "100",
527
+ patternUnits: "userSpaceOnUse",
528
+ children: [
529
+ /* @__PURE__ */ jsxRuntime.jsx(
530
+ "path",
531
+ {
532
+ d: "M0 50h40M60 50h40M50 0v40M50 60v40",
533
+ stroke: "hsl(var(--muted))",
534
+ strokeWidth: "1",
535
+ fill: "none"
536
+ }
537
+ ),
538
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "50", cy: "50", r: "3", fill: "hsl(var(--muted))" }),
539
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "0", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
540
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "100", cy: "50", r: "2", fill: "hsl(var(--muted))" }),
541
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "50", cy: "0", r: "2", fill: "hsl(var(--muted))" }),
542
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "50", cy: "100", r: "2", fill: "hsl(var(--muted))" })
543
+ ]
544
+ }
545
+ ) }),
546
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
547
+ ]
548
+ }
549
+ );
550
+ var gridDotsPattern = (id, mask) => /* @__PURE__ */ jsxRuntime.jsxs(
551
+ "svg",
552
+ {
553
+ className: "h-full w-full",
554
+ xmlns: "http://www.w3.org/2000/svg",
555
+ style: mask ? {
556
+ maskImage: mask,
557
+ WebkitMaskImage: mask
558
+ } : void 0,
559
+ children: [
560
+ /* @__PURE__ */ jsxRuntime.jsx("defs", { children: /* @__PURE__ */ jsxRuntime.jsxs(
561
+ "pattern",
562
+ {
563
+ id,
564
+ x: "0",
565
+ y: "0",
566
+ width: "40",
567
+ height: "40",
568
+ patternUnits: "userSpaceOnUse",
569
+ children: [
570
+ /* @__PURE__ */ jsxRuntime.jsx(
571
+ "path",
572
+ {
573
+ d: "M0 20h40M20 0v40",
574
+ stroke: "hsl(var(--muted))",
575
+ strokeWidth: "0.5",
576
+ fill: "none"
577
+ }
578
+ ),
579
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "20", cy: "20", r: "2", fill: "hsl(var(--muted))" })
580
+ ]
581
+ }
582
+ ) }),
583
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "100%", height: "100%", fill: `url(#${id})` })
584
+ ]
585
+ }
586
+ );
587
+ var gridPattern = (size, mask) => /* @__PURE__ */ jsxRuntime.jsx(
588
+ "div",
589
+ {
590
+ className: "h-full w-full bg-[linear-gradient(to_right,_hsl(var(--muted))_1px,_transparent_1px),linear-gradient(to_bottom,_hsl(var(--muted))_1px,_transparent_1px)]",
591
+ style: {
592
+ backgroundSize: `${size}px ${size}px`,
593
+ ...mask ? {
594
+ maskImage: mask,
595
+ WebkitMaskImage: mask
596
+ } : {}
597
+ }
598
+ }
599
+ );
600
+ var diagonalCrossPattern = (mask) => /* @__PURE__ */ jsxRuntime.jsx(
601
+ "div",
602
+ {
603
+ className: "h-full w-full",
604
+ style: {
605
+ backgroundImage: "repeating-linear-gradient(45deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px), repeating-linear-gradient(135deg, transparent, transparent 32px, hsl(var(--muted)) 32px, hsl(var(--muted)) 33px)",
606
+ ...mask ? {
607
+ maskImage: mask,
608
+ WebkitMaskImage: mask
609
+ } : {}
610
+ }
611
+ }
612
+ );
613
+ var dashedGridMaskBase = "repeating-linear-gradient(to right, black 0px, black 3px, transparent 3px, transparent 8px), repeating-linear-gradient(to bottom, black 0px, black 3px, transparent 3px, transparent 8px)";
614
+ var dashedGridPattern = (fadeMask) => {
615
+ const mask = fadeMask ? `${dashedGridMaskBase}, ${fadeMask}` : dashedGridMaskBase;
616
+ return /* @__PURE__ */ jsxRuntime.jsx(
617
+ "div",
618
+ {
619
+ className: "h-full w-full",
620
+ style: {
621
+ backgroundImage: "linear-gradient(to right, hsl(var(--muted)) 1px, transparent 1px), linear-gradient(to bottom, hsl(var(--muted)) 1px, transparent 1px)",
622
+ backgroundSize: "20px 20px",
623
+ backgroundPosition: "0 0, 0 0",
624
+ maskImage: mask,
625
+ WebkitMaskImage: mask,
626
+ maskComposite: "intersect",
627
+ WebkitMaskComposite: "source-in"
628
+ }
629
+ }
630
+ );
631
+ };
632
+ var gradientGlow = (position) => /* @__PURE__ */ jsxRuntime.jsx(
633
+ "div",
634
+ {
635
+ className: cn(
636
+ "pointer-events-none absolute left-1/2 z-0 aspect-square w-3/4 -translate-x-1/2 rounded-full opacity-50 blur-3xl",
637
+ position === "top" ? "-top-1/4" : "-bottom-1/4"
638
+ ),
639
+ style: {
640
+ background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
641
+ }
642
+ }
643
+ );
644
+ var spotlight = (position) => /* @__PURE__ */ jsxRuntime.jsx(
645
+ "div",
646
+ {
647
+ className: cn(
648
+ "pointer-events-none absolute top-1/2 z-0 aspect-square w-3/4 -translate-y-1/2 rounded-full opacity-40 blur-3xl",
649
+ position === "left" ? "-left-1/4" : "-right-1/4"
650
+ ),
651
+ style: {
652
+ background: "radial-gradient(circle, hsl(var(--primary)) 0%, transparent 70%)"
653
+ }
654
+ }
655
+ );
656
+ var patternOverlays = {
657
+ circuitBoardBasic: () => circuitBoardPattern("circuit-board-basic"),
658
+ circuitBoardFadeTop: () => circuitBoardPattern("circuit-board-fade-top", maskTop),
659
+ circuitBoardFadeBottom: () => circuitBoardPattern("circuit-board-fade-bottom", maskBottom),
660
+ circuitBoardFadeCenter: () => circuitBoardPattern("circuit-board-fade-center", maskCenter),
661
+ circuitBoardFadeTopLeft: () => circuitBoardPattern("circuit-board-fade-top-left", maskTopLeft),
662
+ circuitBoardFadeTopRight: () => circuitBoardPattern("circuit-board-fade-top-right", maskTopRight),
663
+ circuitBoardFadeBottomLeft: () => circuitBoardPattern("circuit-board-fade-bottom-left", maskBottomLeft),
664
+ circuitBoardFadeBottomRight: () => circuitBoardPattern("circuit-board-fade-bottom-right", maskBottomRight),
665
+ dashedGridBasic: () => dashedGridPattern(),
666
+ dashedGridFadeTop: () => dashedGridPattern(maskTop),
667
+ dashedGridFadeBottom: () => dashedGridPattern(maskBottom),
668
+ dashedGridFadeCenter: () => dashedGridPattern(maskCenter),
669
+ dashedGridFadeTopLeft: () => dashedGridPattern(maskTopLeft),
670
+ dashedGridFadeTopRight: () => dashedGridPattern(maskTopRight),
671
+ dashedGridFadeBottomLeft: () => dashedGridPattern(maskBottomLeft),
672
+ dashedGridFadeBottomRight: () => dashedGridPattern(maskBottomRight),
673
+ diagonalCrossBasic: () => diagonalCrossPattern(),
674
+ diagonalCrossFadeTop: () => diagonalCrossPattern(maskTop),
675
+ diagonalCrossFadeBottom: () => diagonalCrossPattern(maskBottom),
676
+ diagonalCrossFadeCenter: () => diagonalCrossPattern(maskCenter),
677
+ diagonalCrossFadeTopLeft: () => diagonalCrossPattern(maskTopLeft),
678
+ diagonalCrossFadeTopRight: () => diagonalCrossPattern(maskTopRight),
679
+ diagonalCrossFadeBottomLeft: () => diagonalCrossPattern(maskBottomLeft),
680
+ diagonalCrossFadeBottomRight: () => diagonalCrossPattern(maskBottomRight),
681
+ gridBasic: () => gridPattern(40),
682
+ gridFadeTop: () => gridPattern(32, maskTop),
683
+ gridFadeBottom: () => gridPattern(32, maskBottom),
684
+ gridFadeCenter: () => gridPattern(40, maskCenter),
685
+ gridFadeTopLeft: () => gridPattern(32, maskTopLeft),
686
+ gridFadeTopRight: () => gridPattern(32, maskTopRight),
687
+ gridFadeBottomLeft: () => gridPattern(32, maskBottomLeft),
688
+ gridFadeBottomRight: () => gridPattern(32, maskBottomRight),
689
+ gridDotsBasic: () => gridDotsPattern("grid-dots-basic"),
690
+ gridDotsFadeCenter: () => gridDotsPattern("grid-dots-fade-center", maskCenter),
691
+ gradientGlowTop: () => gradientGlow("top"),
692
+ gradientGlowBottom: () => gradientGlow("bottom"),
693
+ spotlightLeft: () => spotlight("left"),
694
+ spotlightRight: () => spotlight("right")
695
+ };
696
+ var inlinePatternStyles = {
697
+ radialGradientTop: {
698
+ background: "radial-gradient(125% 125% at 50% 10%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
699
+ },
700
+ radialGradientBottom: {
701
+ background: "radial-gradient(125% 125% at 50% 90%, hsl(var(--background)) 40%, hsl(var(--primary)) 100%)"
702
+ }
703
+ };
704
+ function PatternBackground({
705
+ pattern,
706
+ opacity = 0.08,
707
+ className,
708
+ style
709
+ }) {
710
+ if (!pattern) {
711
+ return null;
712
+ }
713
+ if (pattern in inlinePatternStyles) {
714
+ const inlineStyle = inlinePatternStyles[pattern];
715
+ return /* @__PURE__ */ jsxRuntime.jsx(
716
+ "div",
717
+ {
718
+ className: cn("pointer-events-none absolute inset-0 z-0", className),
719
+ style: { ...inlineStyle, opacity, ...style },
720
+ "aria-hidden": "true"
721
+ }
722
+ );
723
+ }
724
+ if (pattern in patternOverlays) {
725
+ const Overlay2 = patternOverlays[pattern];
726
+ return /* @__PURE__ */ jsxRuntime.jsx(
727
+ "div",
728
+ {
729
+ className: cn("pointer-events-none absolute inset-0 z-0", className),
730
+ style: { opacity, ...style },
731
+ "aria-hidden": "true",
732
+ children: Overlay2()
733
+ }
734
+ );
735
+ }
736
+ const patternUrl = pattern in patternSvgs ? patternSvgs[pattern] : pattern;
737
+ return /* @__PURE__ */ jsxRuntime.jsx(
738
+ "div",
739
+ {
740
+ className: cn("pointer-events-none absolute inset-0 z-0", className),
741
+ style: {
742
+ backgroundImage: `url(${patternUrl})`,
743
+ backgroundRepeat: "repeat",
744
+ backgroundSize: "auto",
745
+ opacity,
746
+ ...style
747
+ },
748
+ "aria-hidden": "true"
749
+ }
750
+ );
751
+ }
752
+ var backgroundStyles = {
753
+ default: "bg-background text-foreground",
754
+ white: "bg-white text-dark",
755
+ gray: "bg-muted/30 text-foreground",
756
+ dark: "bg-foreground text-background",
757
+ transparent: "bg-transparent text-foreground",
758
+ gradient: "bg-linear-to-br from-primary via-primary/90 to-foreground text-primary-foreground",
759
+ primary: "bg-primary text-primary-foreground",
760
+ secondary: "bg-secondary text-secondary-foreground",
761
+ muted: "bg-muted text-muted-foreground"
762
+ };
763
+ var spacingStyles = {
764
+ none: "py-0 md:py-0",
765
+ sm: "py-12 md:py-16",
766
+ md: "py-16 md:py-24",
767
+ lg: "py-20 md:py-32",
768
+ xl: "py-24 md:py-40"
769
+ };
770
+ var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
771
+ var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
772
+ var Section = React__namespace.default.forwardRef(
773
+ ({
774
+ id,
775
+ title,
776
+ subtitle,
777
+ children,
778
+ className,
779
+ style,
780
+ background = "default",
781
+ spacing = "lg",
782
+ pattern,
783
+ patternOpacity,
784
+ patternClassName,
785
+ containerClassName,
786
+ containerMaxWidth = "xl",
787
+ ...props
788
+ }, ref) => {
789
+ const effectivePatternOpacity = patternOpacity !== void 0 ? patternOpacity : pattern ? 1 : 0;
790
+ return /* @__PURE__ */ jsxRuntime.jsxs(
791
+ "section",
792
+ {
793
+ ref,
794
+ id,
795
+ className: cn(
796
+ "relative",
797
+ pattern ? "overflow-hidden" : null,
798
+ backgroundStyles[background],
799
+ isPredefinedSpacing(spacing) ? spacingStyles[spacing] : spacing,
800
+ className
801
+ ),
802
+ style,
803
+ ...props,
804
+ children: [
805
+ /* @__PURE__ */ jsxRuntime.jsx(
806
+ PatternBackground,
807
+ {
808
+ pattern,
809
+ opacity: effectivePatternOpacity,
810
+ className: patternClassName
811
+ }
812
+ ),
813
+ /* @__PURE__ */ jsxRuntime.jsxs(
814
+ Container,
815
+ {
816
+ maxWidth: containerMaxWidth,
817
+ className: cn("relative z-10", containerClassName),
818
+ children: [
819
+ (title || subtitle) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mb-6 text-center md:mb-16", children: [
820
+ subtitle && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-2 text-sm font-semibold uppercase tracking-wider", children: subtitle }),
821
+ title && /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-3xl font-bold tracking-tight md:text-4xl lg:text-5xl", children: title })
822
+ ] }),
823
+ children
824
+ ]
825
+ }
826
+ )
827
+ ]
828
+ }
829
+ );
830
+ }
831
+ );
832
+ Section.displayName = "Section";
833
+ var svgCache = /* @__PURE__ */ new Map();
834
+ function DynamicIcon({
835
+ name,
836
+ size = 28,
837
+ color,
838
+ className,
839
+ alt
840
+ }) {
841
+ const [svgContent, setSvgContent] = React__namespace.useState(null);
842
+ const [isLoading, setIsLoading] = React__namespace.useState(true);
843
+ const [error, setError] = React__namespace.useState(null);
844
+ const { url, iconName } = React__namespace.useMemo(() => {
845
+ const separator = name.includes("/") ? "/" : ":";
846
+ const [prefix, iconName2] = name.split(separator);
847
+ const baseUrl = `https://icons.opensite.ai/api/icon/${prefix}/${iconName2}?format=svg&width=${size}&height=${size}`;
848
+ return {
849
+ url: baseUrl,
850
+ iconName: iconName2
851
+ };
852
+ }, [name, size]);
853
+ React__namespace.useEffect(() => {
854
+ let isMounted = true;
855
+ const fetchSvg = async () => {
856
+ const cached = svgCache.get(url);
857
+ if (cached) {
858
+ if (isMounted) {
859
+ setSvgContent(cached);
860
+ setIsLoading(false);
861
+ }
862
+ return;
863
+ }
864
+ try {
865
+ setIsLoading(true);
866
+ setError(null);
867
+ const response = await fetch(url);
868
+ if (!response.ok) {
869
+ throw new Error(`Failed to fetch icon: ${response.status}`);
870
+ }
871
+ let svg = await response.text();
872
+ svg = processSvgForCurrentColor(svg);
873
+ svgCache.set(url, svg);
874
+ if (isMounted) {
875
+ setSvgContent(svg);
876
+ setIsLoading(false);
877
+ }
878
+ } catch (err) {
879
+ if (isMounted) {
880
+ setError(err instanceof Error ? err.message : "Failed to load icon");
881
+ setIsLoading(false);
882
+ }
883
+ }
884
+ };
885
+ fetchSvg();
886
+ return () => {
887
+ isMounted = false;
888
+ };
889
+ }, [url]);
890
+ if (isLoading) {
891
+ return /* @__PURE__ */ jsxRuntime.jsx(
892
+ "span",
893
+ {
894
+ className: cn("inline-block", className),
895
+ style: { width: size, height: size },
896
+ "aria-hidden": "true"
897
+ }
898
+ );
899
+ }
900
+ if (error || !svgContent) {
901
+ return /* @__PURE__ */ jsxRuntime.jsx(
902
+ "span",
903
+ {
904
+ className: cn("inline-block", className),
905
+ style: { width: size, height: size },
906
+ role: "img",
907
+ "aria-label": alt || iconName
908
+ }
909
+ );
910
+ }
911
+ return /* @__PURE__ */ jsxRuntime.jsx(
912
+ "span",
913
+ {
914
+ className: cn("inline-flex items-center justify-center", className),
915
+ style: {
916
+ width: size,
917
+ height: size,
918
+ color: color || "inherit"
919
+ },
920
+ role: "img",
921
+ "aria-label": alt || iconName,
922
+ dangerouslySetInnerHTML: { __html: svgContent }
923
+ }
924
+ );
925
+ }
926
+ function processSvgForCurrentColor(svg) {
927
+ let processed = svg;
928
+ processed = processed.replace(
929
+ /stroke=["'](#000000|#000|black)["']/gi,
930
+ 'stroke="currentColor"'
931
+ );
932
+ processed = processed.replace(
933
+ /fill=["'](#000000|#000|black)["']/gi,
934
+ 'fill="currentColor"'
935
+ );
936
+ return processed;
937
+ }
938
+ function Dialog({
939
+ ...props
940
+ }) {
941
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Root, { "data-slot": "dialog", ...props });
942
+ }
943
+ function DialogPortal({
944
+ ...props
945
+ }) {
946
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Portal, { "data-slot": "dialog-portal", ...props });
947
+ }
948
+ function DialogClose({
949
+ ...props
950
+ }) {
951
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogPrimitive__namespace.Close, { "data-slot": "dialog-close", ...props });
952
+ }
953
+ function DialogOverlay({
954
+ className,
955
+ ...props
956
+ }) {
957
+ return /* @__PURE__ */ jsxRuntime.jsx(
958
+ DialogPrimitive__namespace.Overlay,
959
+ {
960
+ "data-slot": "dialog-overlay",
961
+ className: cn(
962
+ "data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
963
+ className
964
+ ),
965
+ ...props
966
+ }
967
+ );
968
+ }
969
+ function DialogContent({
970
+ className,
971
+ children,
972
+ showCloseButton = true,
973
+ ...props
974
+ }) {
975
+ return /* @__PURE__ */ jsxRuntime.jsxs(DialogPortal, { "data-slot": "dialog-portal", children: [
976
+ /* @__PURE__ */ jsxRuntime.jsx(DialogOverlay, {}),
977
+ /* @__PURE__ */ jsxRuntime.jsxs(
978
+ DialogPrimitive__namespace.Content,
979
+ {
980
+ "data-slot": "dialog-content",
981
+ className: cn(
982
+ "bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg",
983
+ className
984
+ ),
985
+ ...props,
986
+ children: [
987
+ children,
988
+ showCloseButton && /* @__PURE__ */ jsxRuntime.jsxs(
989
+ DialogPrimitive__namespace.Close,
990
+ {
991
+ "data-slot": "dialog-close",
992
+ className: "ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
993
+ children: [
994
+ /* @__PURE__ */ jsxRuntime.jsx(DynamicIcon, { name: "lucide/x", size: 16 }),
995
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Close" })
996
+ ]
997
+ }
998
+ )
999
+ ]
1000
+ }
1001
+ )
1002
+ ] });
1003
+ }
1004
+ function DialogHeader({ className, ...props }) {
1005
+ return /* @__PURE__ */ jsxRuntime.jsx(
1006
+ "div",
1007
+ {
1008
+ "data-slot": "dialog-header",
1009
+ className: cn("flex flex-col gap-2 text-center sm:text-left", className),
1010
+ ...props
1011
+ }
1012
+ );
1013
+ }
1014
+ function DialogTitle({
1015
+ className,
1016
+ ...props
1017
+ }) {
1018
+ return /* @__PURE__ */ jsxRuntime.jsx(
1019
+ DialogPrimitive__namespace.Title,
1020
+ {
1021
+ "data-slot": "dialog-title",
1022
+ className: cn("text-lg leading-none font-semibold", className),
1023
+ ...props
1024
+ }
1025
+ );
1026
+ }
1027
+ var PageSpeedFormSubmissionError = class extends Error {
1028
+ constructor(message, options = {}) {
1029
+ super(message);
1030
+ this.name = "PageSpeedFormSubmissionError";
1031
+ this.formErrors = options.formErrors;
1032
+ this.status = options.status;
1033
+ }
1034
+ };
1035
+ var EMAIL_REGEX = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
1036
+ function isValidEmail(value) {
1037
+ return EMAIL_REGEX.test(value);
1038
+ }
1039
+ function buildUrlWithParams(endpoint, values) {
1040
+ const base = typeof window === "undefined" ? "http://localhost" : window.location.origin;
1041
+ const url = new URL(endpoint, base);
1042
+ Object.entries(values).forEach(([key, value]) => {
1043
+ if (value === void 0 || value === null) {
1044
+ return;
1045
+ }
1046
+ if (Array.isArray(value)) {
1047
+ value.forEach((item) => {
1048
+ if (item !== void 0 && item !== null) {
1049
+ url.searchParams.append(key, String(item));
1050
+ }
1051
+ });
1052
+ return;
1053
+ }
1054
+ url.searchParams.set(key, String(value));
1055
+ });
1056
+ return url.toString();
1057
+ }
1058
+ function normalizeMethod(method) {
1059
+ return (method || "post").toUpperCase();
1060
+ }
1061
+ function resolveFormat(config) {
1062
+ if (config?.format) {
1063
+ return config.format;
1064
+ }
1065
+ return config?.apiKey ? "rails" : "json";
1066
+ }
1067
+ function mergeValues(values, config) {
1068
+ return {
1069
+ ...config?.values ?? {},
1070
+ ...values
1071
+ };
1072
+ }
1073
+ async function submitPageSpeedForm(values, config) {
1074
+ if (!config?.endpoint) {
1075
+ return null;
1076
+ }
1077
+ const payload = mergeValues(values, config);
1078
+ const method = normalizeMethod(config.method);
1079
+ const format = resolveFormat(config);
1080
+ const headers = { ...config.headers ?? {} };
1081
+ if (format === "rails") {
1082
+ if (!config.apiKey) {
1083
+ throw new PageSpeedFormSubmissionError(
1084
+ "Missing apiKey for Rails form submission."
1085
+ );
1086
+ }
1087
+ const railsConfig = {
1088
+ apiKey: config.apiKey,
1089
+ contactCategoryToken: config.contactCategoryToken,
1090
+ locationId: config.locationId,
1091
+ websiteId: config.websiteId,
1092
+ websiteFormAssignmentId: config.websiteFormAssignmentId,
1093
+ visitorIpAddress: config.visitorIpAddress
1094
+ };
1095
+ const serialized = integration.serializeForRails(payload, railsConfig);
1096
+ if (serialized.contact.contact_form_upload_tokens) {
1097
+ serialized.contact.contact_form_upload_tokens = serialized.contact.contact_form_upload_tokens.map((token) => token.replace(/^upload_/, ""));
1098
+ }
1099
+ headers["Content-Type"] ?? (headers["Content-Type"] = "application/json");
1100
+ const response2 = await fetch(config.endpoint, {
1101
+ method,
1102
+ headers,
1103
+ body: JSON.stringify(serialized)
1104
+ });
1105
+ const data2 = await response2.json().catch(() => null);
1106
+ if (!response2.ok || data2 && data2.errors) {
1107
+ const errorResponse = {
1108
+ errors: data2?.errors ?? { base: ["Form submission failed"] },
1109
+ status: data2?.status ?? response2.status
1110
+ };
1111
+ const formErrors = integration.deserializeErrors(errorResponse);
1112
+ throw new PageSpeedFormSubmissionError("Form submission failed.", {
1113
+ formErrors,
1114
+ status: errorResponse.status
1115
+ });
1116
+ }
1117
+ return data2;
1118
+ }
1119
+ if (method === "GET") {
1120
+ const url = buildUrlWithParams(config.endpoint, payload);
1121
+ const response2 = await fetch(url, { method, headers });
1122
+ const data2 = await response2.json().catch(() => null);
1123
+ if (!response2.ok) {
1124
+ throw new PageSpeedFormSubmissionError(
1125
+ data2?.message || "Form submission failed.",
1126
+ { status: response2.status }
1127
+ );
1128
+ }
1129
+ return data2;
1130
+ }
1131
+ headers["Content-Type"] ?? (headers["Content-Type"] = "application/json");
1132
+ const response = await fetch(config.endpoint, {
1133
+ method,
1134
+ headers,
1135
+ body: JSON.stringify(payload)
1136
+ });
1137
+ const data = await response.json().catch(() => null);
1138
+ if (!response.ok) {
1139
+ throw new PageSpeedFormSubmissionError(
1140
+ data?.message || "Form submission failed.",
1141
+ { status: response.status }
1142
+ );
1143
+ }
1144
+ return data;
1145
+ }
1146
+ var { useMemo: useMemo3 } = React__namespace;
1147
+ function OfferModalNewsletterDiscount({
1148
+ title,
1149
+ emailPlaceholder,
1150
+ buttonText,
1151
+ closeButtonText,
1152
+ closeButtonSlot,
1153
+ formSlot,
1154
+ headerSlot,
1155
+ open,
1156
+ onOpenChange,
1157
+ defaultOpen = true,
1158
+ closeOnOutsideClick = false,
1159
+ onSubmit,
1160
+ formConfig,
1161
+ onSuccess,
1162
+ onError,
1163
+ className,
1164
+ contentClassName,
1165
+ headerClassName,
1166
+ titleClassName,
1167
+ formClassName,
1168
+ inputClassName,
1169
+ submitClassName,
1170
+ closeClassName,
1171
+ background = "default"
1172
+ }) {
1173
+ const form = forms.useForm({
1174
+ initialValues: {
1175
+ email: ""
1176
+ },
1177
+ validationSchema: {
1178
+ email: (value) => {
1179
+ if (!value) return "Email is required";
1180
+ if (!isValidEmail(value)) return "Please enter a valid email address";
1181
+ return void 0;
1182
+ }
1183
+ },
1184
+ onSubmit: async (values, helpers) => {
1185
+ const shouldAutoSubmit = Boolean(formConfig?.endpoint);
1186
+ if (!shouldAutoSubmit && !onSubmit) {
1187
+ return;
1188
+ }
1189
+ try {
1190
+ let result;
1191
+ if (shouldAutoSubmit) {
1192
+ result = await submitPageSpeedForm(values, formConfig);
1193
+ }
1194
+ if (onSubmit) {
1195
+ await onSubmit(values.email);
1196
+ }
1197
+ if (shouldAutoSubmit || onSubmit) {
1198
+ if (formConfig?.resetOnSuccess !== false) {
1199
+ helpers.resetForm();
1200
+ }
1201
+ onSuccess?.(result);
1202
+ }
1203
+ } catch (error) {
1204
+ if (error instanceof PageSpeedFormSubmissionError && error.formErrors) {
1205
+ helpers.setErrors(error.formErrors);
1206
+ }
1207
+ onError?.(error);
1208
+ throw error;
1209
+ }
1210
+ }
1211
+ });
1212
+ const formMethod = formConfig?.method?.toLowerCase() === "get" ? "get" : "post";
1213
+ const dialogProps = open !== void 0 ? { open, onOpenChange } : { defaultOpen };
1214
+ const renderCloseButton = useMemo3(() => {
1215
+ if (closeButtonSlot) return closeButtonSlot;
1216
+ if (!closeButtonText) return null;
1217
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute end-1.5 top-1.5", children: /* @__PURE__ */ jsxRuntime.jsx(DialogClose, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
1218
+ Pressable,
1219
+ {
1220
+ variant: "ghost",
1221
+ className: cn("text-muted-foreground text-xs uppercase", closeClassName),
1222
+ size: "sm",
1223
+ asButton: true,
1224
+ children: closeButtonText
1225
+ }
1226
+ ) }) });
1227
+ }, [closeButtonSlot, closeButtonText, closeClassName]);
1228
+ const renderHeader = useMemo3(() => {
1229
+ if (headerSlot) return headerSlot;
1230
+ if (!title) return null;
1231
+ return /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { className: headerClassName, children: typeof title === "string" ? /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: cn("text-start font-serif text-2xl font-normal leading-snug", titleClassName), children: title }) : /* @__PURE__ */ jsxRuntime.jsx(DialogTitle, { className: cn("text-start font-serif text-2xl font-normal leading-snug", titleClassName), children: title }) });
1232
+ }, [headerSlot, title, headerClassName, titleClassName]);
1233
+ const renderForm = useMemo3(() => {
1234
+ if (formSlot) return formSlot;
1235
+ return /* @__PURE__ */ jsxRuntime.jsxs(
1236
+ forms.Form,
1237
+ {
1238
+ form,
1239
+ action: formConfig?.endpoint,
1240
+ method: formMethod,
1241
+ className: cn("space-y-2.5", formClassName),
1242
+ children: [
1243
+ /* @__PURE__ */ jsxRuntime.jsx(forms.Field, { name: "email", children: ({ field, meta }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
1244
+ /* @__PURE__ */ jsxRuntime.jsx(
1245
+ TextInput,
1246
+ {
1247
+ ...field,
1248
+ type: "email",
1249
+ placeholder: emailPlaceholder,
1250
+ error: meta.touched && !!meta.error,
1251
+ className: cn("w-full", inputClassName),
1252
+ "aria-label": emailPlaceholder || "Email address",
1253
+ required: true
1254
+ }
1255
+ ),
1256
+ meta.touched && meta.error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-destructive text-xs mt-1", children: meta.error })
1257
+ ] }) }),
1258
+ /* @__PURE__ */ jsxRuntime.jsx(
1259
+ Pressable,
1260
+ {
1261
+ componentType: "button",
1262
+ type: "submit",
1263
+ className: cn("w-full text-xs uppercase", submitClassName),
1264
+ variant: "default",
1265
+ asButton: true,
1266
+ disabled: form.isSubmitting,
1267
+ children: buttonText
1268
+ }
1269
+ )
1270
+ ]
1271
+ }
1272
+ );
1273
+ }, [formSlot, form, formConfig, formMethod, emailPlaceholder, inputClassName, submitClassName, buttonText, formClassName]);
1274
+ return /* @__PURE__ */ jsxRuntime.jsx(Dialog, { ...dialogProps, modal: false, children: /* @__PURE__ */ jsxRuntime.jsx(
1275
+ DialogContent,
1276
+ {
1277
+ showCloseButton: false,
1278
+ onInteractOutside: (event) => {
1279
+ if (!closeOnOutsideClick) {
1280
+ event.preventDefault();
1281
+ }
1282
+ },
1283
+ className: cn(
1284
+ "duration-400 data-[state=closed]:slide-out-to-bottom-full data-[state=open]:slide-in-from-bottom-full max-w-[460px] bottom-4 left-auto right-4 top-auto block h-fit max-h-dvh translate-x-0 translate-y-0 rounded-sm",
1285
+ className
1286
+ ),
1287
+ children: /* @__PURE__ */ jsxRuntime.jsx(Section, { background, spacing: "none", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-2.5 p-10", contentClassName), children: [
1288
+ renderCloseButton,
1289
+ renderHeader,
1290
+ renderForm
1291
+ ] }) })
1292
+ }
1293
+ ) });
1294
+ }
1295
+
1296
+ exports.OfferModalNewsletterDiscount = OfferModalNewsletterDiscount;