@opensite/ui 2.2.3 → 2.2.5
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.
- package/dist/about-culture-tabs.cjs +83 -17
- package/dist/about-culture-tabs.js +83 -17
- package/dist/components.cjs +83 -17
- package/dist/components.js +83 -17
- package/dist/contact-callback.cjs +38 -552
- package/dist/contact-callback.d.cts +6 -74
- package/dist/contact-callback.d.ts +6 -74
- package/dist/contact-callback.js +36 -535
- package/dist/contact-careers.cjs +19 -555
- package/dist/contact-careers.d.cts +6 -62
- package/dist/contact-careers.d.ts +6 -62
- package/dist/contact-careers.js +18 -539
- package/dist/contact-catering.cjs +19 -531
- package/dist/contact-catering.d.cts +6 -61
- package/dist/contact-catering.d.ts +6 -61
- package/dist/contact-catering.js +18 -515
- package/dist/contact-consultation.cjs +87 -543
- package/dist/contact-consultation.d.cts +6 -61
- package/dist/contact-consultation.d.ts +6 -61
- package/dist/contact-consultation.js +88 -544
- package/dist/contact-demo.cjs +20 -563
- package/dist/contact-demo.d.cts +10 -50
- package/dist/contact-demo.d.ts +10 -50
- package/dist/contact-demo.js +19 -547
- package/dist/contact-emergency.cjs +1 -1
- package/dist/contact-emergency.js +1 -1
- package/dist/contact-event.cjs +19 -562
- package/dist/contact-event.d.cts +10 -50
- package/dist/contact-event.d.ts +10 -50
- package/dist/contact-event.js +19 -547
- package/dist/contact-feedback.cjs +19 -562
- package/dist/contact-feedback.d.cts +10 -50
- package/dist/contact-feedback.d.ts +10 -50
- package/dist/contact-feedback.js +19 -547
- package/dist/contact-fitness.cjs +19 -562
- package/dist/contact-fitness.d.cts +10 -50
- package/dist/contact-fitness.d.ts +10 -50
- package/dist/contact-fitness.js +19 -547
- package/dist/contact-guest.cjs +19 -562
- package/dist/contact-guest.d.cts +10 -50
- package/dist/contact-guest.d.ts +10 -50
- package/dist/contact-guest.js +19 -547
- package/dist/contact-insurance.cjs +19 -562
- package/dist/contact-insurance.d.cts +10 -50
- package/dist/contact-insurance.d.ts +10 -50
- package/dist/contact-insurance.js +19 -547
- package/dist/contact-interview.cjs +19 -562
- package/dist/contact-interview.d.cts +11 -51
- package/dist/contact-interview.d.ts +11 -51
- package/dist/contact-interview.js +19 -547
- package/dist/contact-locations.cjs +19 -562
- package/dist/contact-locations.d.cts +11 -51
- package/dist/contact-locations.d.ts +11 -51
- package/dist/contact-locations.js +19 -547
- package/dist/contact-maintenance.cjs +19 -562
- package/dist/contact-maintenance.d.cts +10 -50
- package/dist/contact-maintenance.d.ts +10 -50
- package/dist/contact-maintenance.js +19 -547
- package/dist/contact-map.cjs +19 -562
- package/dist/contact-map.d.cts +11 -51
- package/dist/contact-map.d.ts +11 -51
- package/dist/contact-map.js +19 -547
- package/dist/contact-minimal.cjs +19 -562
- package/dist/contact-minimal.d.cts +10 -50
- package/dist/contact-minimal.d.ts +10 -50
- package/dist/contact-minimal.js +19 -547
- package/dist/contact-moving.cjs +19 -562
- package/dist/contact-moving.d.cts +11 -51
- package/dist/contact-moving.d.ts +11 -51
- package/dist/contact-moving.js +19 -547
- package/dist/contact-multistep.cjs +19 -562
- package/dist/contact-multistep.d.cts +11 -51
- package/dist/contact-multistep.d.ts +11 -51
- package/dist/contact-multistep.js +19 -547
- package/dist/contact-partnership.cjs +22 -565
- package/dist/contact-partnership.d.cts +10 -50
- package/dist/contact-partnership.d.ts +10 -50
- package/dist/contact-partnership.js +22 -550
- package/dist/contact-photography.cjs +19 -562
- package/dist/contact-photography.d.cts +7 -50
- package/dist/contact-photography.d.ts +7 -50
- package/dist/contact-photography.js +18 -546
- package/dist/contact-press.cjs +19 -562
- package/dist/contact-press.d.cts +10 -50
- package/dist/contact-press.d.ts +10 -50
- package/dist/contact-press.js +19 -547
- package/dist/contact-quote.cjs +19 -562
- package/dist/contact-quote.d.cts +11 -51
- package/dist/contact-quote.d.ts +11 -51
- package/dist/contact-quote.js +19 -547
- package/dist/contact-referral.cjs +19 -562
- package/dist/contact-referral.d.cts +10 -50
- package/dist/contact-referral.d.ts +10 -50
- package/dist/contact-referral.js +19 -547
- package/dist/contact-report.cjs +19 -562
- package/dist/contact-report.d.cts +10 -50
- package/dist/contact-report.d.ts +10 -50
- package/dist/contact-report.js +19 -547
- package/dist/contact-reservation.cjs +19 -562
- package/dist/contact-reservation.d.cts +10 -50
- package/dist/contact-reservation.d.ts +10 -50
- package/dist/contact-reservation.js +19 -547
- package/dist/contact-retreat.cjs +88 -567
- package/dist/contact-retreat.d.cts +11 -51
- package/dist/contact-retreat.d.ts +11 -51
- package/dist/contact-retreat.js +90 -569
- package/dist/contact-rsvp.cjs +19 -562
- package/dist/contact-rsvp.d.cts +11 -51
- package/dist/contact-rsvp.d.ts +11 -51
- package/dist/contact-rsvp.js +19 -547
- package/dist/contact-sales.cjs +19 -562
- package/dist/contact-sales.d.cts +10 -50
- package/dist/contact-sales.d.ts +10 -50
- package/dist/contact-sales.js +19 -547
- package/dist/contact-schedule.cjs +19 -562
- package/dist/contact-schedule.d.cts +11 -51
- package/dist/contact-schedule.d.ts +11 -51
- package/dist/contact-schedule.js +19 -547
- package/dist/contact-sponsorship.cjs +19 -562
- package/dist/contact-sponsorship.d.cts +11 -51
- package/dist/contact-sponsorship.d.ts +11 -51
- package/dist/contact-sponsorship.js +19 -547
- package/dist/contact-support.cjs +19 -562
- package/dist/contact-support.d.cts +11 -51
- package/dist/contact-support.d.ts +11 -51
- package/dist/contact-support.js +19 -547
- package/dist/contact-tenant.cjs +19 -562
- package/dist/contact-tenant.d.cts +11 -51
- package/dist/contact-tenant.d.ts +11 -51
- package/dist/contact-tenant.js +19 -547
- package/dist/contact-volunteer.cjs +19 -562
- package/dist/contact-volunteer.d.cts +11 -51
- package/dist/contact-volunteer.d.ts +11 -51
- package/dist/contact-volunteer.js +19 -547
- package/dist/contact-warranty.cjs +19 -562
- package/dist/contact-warranty.d.cts +10 -50
- package/dist/contact-warranty.d.ts +10 -50
- package/dist/contact-warranty.js +19 -547
- package/dist/contact-wedding.cjs +19 -562
- package/dist/contact-wedding.d.cts +10 -50
- package/dist/contact-wedding.d.ts +10 -50
- package/dist/contact-wedding.js +19 -547
- package/dist/hero-presentation-platform-video.cjs +76 -27
- package/dist/hero-presentation-platform-video.js +76 -27
- package/dist/index.cjs +83 -17
- package/dist/index.js +83 -17
- package/dist/registry.cjs +768 -4196
- package/dist/registry.js +769 -4197
- package/package.json +12 -2
package/dist/contact-demo.cjs
CHANGED
|
@@ -1,457 +1,21 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var forms = require('@page-speed/forms');
|
|
6
4
|
var integration = require('@page-speed/forms/integration');
|
|
7
5
|
var clsx = require('clsx');
|
|
8
6
|
var tailwindMerge = require('tailwind-merge');
|
|
9
|
-
var
|
|
10
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
11
8
|
var framerMotion = require('framer-motion');
|
|
9
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
12
10
|
|
|
13
|
-
function
|
|
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
|
-
}
|
|
11
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
30
12
|
|
|
31
|
-
var
|
|
13
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
32
14
|
|
|
33
15
|
// components/blocks/contact/contact-demo.tsx
|
|
34
16
|
function cn(...inputs) {
|
|
35
17
|
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
36
18
|
}
|
|
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 = React__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 = React__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 = React__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 = React__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 = React__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 = React__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
19
|
var buildKeyframes = (from, steps) => {
|
|
456
20
|
const keys = /* @__PURE__ */ new Set([
|
|
457
21
|
...Object.keys(from),
|
|
@@ -600,7 +164,7 @@ var maxWidthStyles = {
|
|
|
600
164
|
"4xl": "max-w-[1536px]",
|
|
601
165
|
full: "max-w-full"
|
|
602
166
|
};
|
|
603
|
-
var Container =
|
|
167
|
+
var Container = React__default.default.forwardRef(
|
|
604
168
|
({ children, maxWidth = "xl", className, as = "div", ...props }, ref) => {
|
|
605
169
|
const Component = as;
|
|
606
170
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
@@ -905,7 +469,7 @@ var spacingStyles = {
|
|
|
905
469
|
};
|
|
906
470
|
var predefinedSpacings = ["none", "sm", "md", "lg", "xl"];
|
|
907
471
|
var isPredefinedSpacing = (spacing) => predefinedSpacings.includes(spacing);
|
|
908
|
-
var Section =
|
|
472
|
+
var Section = React__default.default.forwardRef(
|
|
909
473
|
({
|
|
910
474
|
id,
|
|
911
475
|
title,
|
|
@@ -966,6 +530,12 @@ var Section = React__namespace.default.forwardRef(
|
|
|
966
530
|
}
|
|
967
531
|
);
|
|
968
532
|
Section.displayName = "Section";
|
|
533
|
+
var DEFAULT_STYLE_RULES = {
|
|
534
|
+
formContainer: "",
|
|
535
|
+
fieldsContainer: "",
|
|
536
|
+
fieldClassName: "",
|
|
537
|
+
formClassName: "space-y-6"
|
|
538
|
+
};
|
|
969
539
|
var DEFAULT_FORM_FIELDS = [
|
|
970
540
|
{
|
|
971
541
|
name: "first_name",
|
|
@@ -1012,82 +582,19 @@ var DEFAULT_FORM_FIELDS = [
|
|
|
1012
582
|
function ContactDemo({
|
|
1013
583
|
heading,
|
|
1014
584
|
description,
|
|
1015
|
-
buttonText = "Submit",
|
|
1016
|
-
buttonIcon,
|
|
1017
|
-
actions,
|
|
1018
|
-
actionsSlot,
|
|
1019
|
-
formFields = DEFAULT_FORM_FIELDS,
|
|
1020
|
-
successMessage = "Thank you! Your message has been sent successfully.",
|
|
1021
585
|
className,
|
|
586
|
+
formEngineSetup,
|
|
1022
587
|
containerClassName = "px-6 sm:px-6 md:px-8 lg:px-8",
|
|
1023
588
|
headerClassName,
|
|
1024
589
|
headingClassName,
|
|
1025
590
|
descriptionClassName,
|
|
1026
591
|
cardClassName,
|
|
1027
592
|
cardContentClassName,
|
|
1028
|
-
formClassName,
|
|
1029
|
-
submitClassName,
|
|
1030
|
-
successMessageClassName,
|
|
1031
|
-
errorMessageClassName,
|
|
1032
593
|
background,
|
|
1033
594
|
spacing = "xl",
|
|
1034
595
|
pattern,
|
|
1035
|
-
patternOpacity
|
|
1036
|
-
formConfig,
|
|
1037
|
-
onSubmit,
|
|
1038
|
-
onSuccess,
|
|
1039
|
-
onError
|
|
596
|
+
patternOpacity
|
|
1040
597
|
}) {
|
|
1041
|
-
const {
|
|
1042
|
-
uploadTokens,
|
|
1043
|
-
uploadProgress,
|
|
1044
|
-
isUploading,
|
|
1045
|
-
uploadFiles,
|
|
1046
|
-
removeFile,
|
|
1047
|
-
resetUpload
|
|
1048
|
-
} = integration.useFileUpload({ onError });
|
|
1049
|
-
const { form, submissionError, formMethod, resetSubmissionState } = integration.useContactForm({
|
|
1050
|
-
formFields,
|
|
1051
|
-
formConfig,
|
|
1052
|
-
onSubmit,
|
|
1053
|
-
onSuccess: (data) => {
|
|
1054
|
-
resetUpload();
|
|
1055
|
-
onSuccess?.(data);
|
|
1056
|
-
},
|
|
1057
|
-
onError,
|
|
1058
|
-
resetOnSuccess: formConfig?.resetOnSuccess !== false,
|
|
1059
|
-
uploadTokens
|
|
1060
|
-
});
|
|
1061
|
-
const actionsContent = React.useMemo(() => {
|
|
1062
|
-
if (actionsSlot) return actionsSlot;
|
|
1063
|
-
if (actions && actions.length > 0) {
|
|
1064
|
-
return actions.map((action, index) => {
|
|
1065
|
-
const {
|
|
1066
|
-
label,
|
|
1067
|
-
icon,
|
|
1068
|
-
iconAfter,
|
|
1069
|
-
children,
|
|
1070
|
-
className: actionClassName,
|
|
1071
|
-
...pressableProps
|
|
1072
|
-
} = action;
|
|
1073
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1074
|
-
Pressable,
|
|
1075
|
-
{
|
|
1076
|
-
asButton: true,
|
|
1077
|
-
className: actionClassName,
|
|
1078
|
-
...pressableProps,
|
|
1079
|
-
children: children ?? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
1080
|
-
icon,
|
|
1081
|
-
label,
|
|
1082
|
-
iconAfter
|
|
1083
|
-
] })
|
|
1084
|
-
},
|
|
1085
|
-
index
|
|
1086
|
-
);
|
|
1087
|
-
});
|
|
1088
|
-
}
|
|
1089
|
-
return null;
|
|
1090
|
-
}, [actionsSlot, actions]);
|
|
1091
598
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1092
599
|
Section,
|
|
1093
600
|
{
|
|
@@ -1133,64 +640,14 @@ function ContactDemo({
|
|
|
1133
640
|
]
|
|
1134
641
|
}
|
|
1135
642
|
),
|
|
1136
|
-
/* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("rounded-2xl shadow-2xl", cardClassName), children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: /* @__PURE__ */ jsxRuntime.
|
|
1137
|
-
|
|
643
|
+
/* @__PURE__ */ jsxRuntime.jsx(Card, { className: cn("rounded-2xl shadow-2xl", cardClassName), children: /* @__PURE__ */ jsxRuntime.jsx(CardContent, { className: cn("p-6 lg:p-8", cardContentClassName), children: formEngineSetup ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
644
|
+
integration.FormEngine,
|
|
1138
645
|
{
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
successMessage
|
|
1143
|
-
},
|
|
1144
|
-
styleConfig: {
|
|
1145
|
-
formClassName: cn("space-y-4", formClassName),
|
|
1146
|
-
successMessageClassName,
|
|
1147
|
-
errorMessageClassName
|
|
1148
|
-
},
|
|
1149
|
-
formConfig: {
|
|
1150
|
-
endpoint: formConfig?.endpoint,
|
|
1151
|
-
method: formMethod,
|
|
1152
|
-
submissionConfig: formConfig?.submissionConfig
|
|
1153
|
-
},
|
|
1154
|
-
onNewSubmission: () => {
|
|
1155
|
-
resetUpload();
|
|
1156
|
-
resetSubmissionState();
|
|
1157
|
-
},
|
|
1158
|
-
children: [
|
|
1159
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "grid grid-cols-12 gap-6", children: formFields.map((field) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1160
|
-
"div",
|
|
1161
|
-
{
|
|
1162
|
-
className: integration.getColumnSpanClass(field.columnSpan),
|
|
1163
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1164
|
-
integration.DynamicFormField,
|
|
1165
|
-
{
|
|
1166
|
-
field,
|
|
1167
|
-
uploadProgress,
|
|
1168
|
-
onFileUpload: uploadFiles,
|
|
1169
|
-
onFileRemove: removeFile,
|
|
1170
|
-
isUploading
|
|
1171
|
-
}
|
|
1172
|
-
)
|
|
1173
|
-
},
|
|
1174
|
-
field.name
|
|
1175
|
-
)) }),
|
|
1176
|
-
actionsSlot || actions && actions.length > 0 ? actionsContent : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1177
|
-
Pressable,
|
|
1178
|
-
{
|
|
1179
|
-
componentType: "button",
|
|
1180
|
-
type: "submit",
|
|
1181
|
-
className: cn("w-full", submitClassName),
|
|
1182
|
-
size: "lg",
|
|
1183
|
-
asButton: true,
|
|
1184
|
-
disabled: form.isSubmitting,
|
|
1185
|
-
children: [
|
|
1186
|
-
buttonIcon,
|
|
1187
|
-
buttonText
|
|
1188
|
-
]
|
|
1189
|
-
}
|
|
1190
|
-
)
|
|
1191
|
-
]
|
|
646
|
+
formEngineSetup,
|
|
647
|
+
defaultFields: DEFAULT_FORM_FIELDS,
|
|
648
|
+
defaultStyleRules: DEFAULT_STYLE_RULES
|
|
1192
649
|
}
|
|
1193
|
-
) }) })
|
|
650
|
+
) : null }) })
|
|
1194
651
|
] })
|
|
1195
652
|
}
|
|
1196
653
|
);
|