@m13v/seo-components 0.31.3 → 0.31.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.
package/package.json
CHANGED
|
@@ -43,6 +43,13 @@ export interface BookCallCTAProps {
|
|
|
43
43
|
* redirected to Cal/Calendly immediately without a confirmation.
|
|
44
44
|
*/
|
|
45
45
|
successMessage?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Render a custom trigger element instead of the default button. Receives
|
|
48
|
+
* an `onClick` handler that opens the inline email form. Only honored by
|
|
49
|
+
* `appearance="hero"` (the click-to-expand variant). Other appearances are
|
|
50
|
+
* already standalone cards/forms that don't have a separable trigger.
|
|
51
|
+
*/
|
|
52
|
+
renderTrigger?: (props: { onClick: () => void; disabled?: boolean }) => React.ReactNode;
|
|
46
53
|
}
|
|
47
54
|
|
|
48
55
|
export function BookCallCTA(props: BookCallCTAProps) {
|
|
@@ -281,6 +288,7 @@ function HeroBookCall({
|
|
|
281
288
|
endpoint = "/api/book-call",
|
|
282
289
|
emailPlaceholder = "you@example.com",
|
|
283
290
|
submitLabel,
|
|
291
|
+
renderTrigger,
|
|
284
292
|
}: BookCallCTAProps & {
|
|
285
293
|
text: string;
|
|
286
294
|
section: string;
|
|
@@ -296,6 +304,9 @@ function HeroBookCall({
|
|
|
296
304
|
});
|
|
297
305
|
|
|
298
306
|
if (!open && gate.status !== "success") {
|
|
307
|
+
if (renderTrigger) {
|
|
308
|
+
return <>{renderTrigger({ onClick: () => setOpen(true) })}</>;
|
|
309
|
+
}
|
|
299
310
|
return (
|
|
300
311
|
<button
|
|
301
312
|
type="button"
|