@olwiba/ui 0.2.18 → 0.2.19
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/index.d.ts +15 -2
- package/dist/index.js +23 -13
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/marketing/HeroSection.tsx +35 -11
package/package.json
CHANGED
|
@@ -14,8 +14,21 @@ export interface HeroSectionProps {
|
|
|
14
14
|
heading: string;
|
|
15
15
|
badge?: string;
|
|
16
16
|
description: string;
|
|
17
|
-
|
|
17
|
+
/** Ignored when `primarySlot` is given. */
|
|
18
|
+
primaryCta?: { label: string; href: string };
|
|
18
19
|
secondaryCta?: { label: string; href: string };
|
|
20
|
+
/**
|
|
21
|
+
* Replaces the primary button with your own control — a search field, a
|
|
22
|
+
* short form, an email capture.
|
|
23
|
+
*
|
|
24
|
+
* A hero whose first action *is* the product converts better than one that
|
|
25
|
+
* links to a page where the product starts. `secondaryCta` still renders
|
|
26
|
+
* beside it, so "…or see pricing" survives.
|
|
27
|
+
*
|
|
28
|
+
* Rendered full-width above the secondary CTA on small screens, since a
|
|
29
|
+
* field sharing a row with a button gets squeezed to nothing on a phone.
|
|
30
|
+
*/
|
|
31
|
+
primarySlot?: React.ReactNode;
|
|
19
32
|
heroImage?: React.ReactNode;
|
|
20
33
|
media?: 'image' | 'phone' | 'none';
|
|
21
34
|
phoneSize?: 'sm' | 'md' | 'lg';
|
|
@@ -34,6 +47,7 @@ export function HeroSection({
|
|
|
34
47
|
description,
|
|
35
48
|
primaryCta,
|
|
36
49
|
secondaryCta,
|
|
50
|
+
primarySlot,
|
|
37
51
|
heroImage,
|
|
38
52
|
media = 'image',
|
|
39
53
|
phoneSize = 'lg',
|
|
@@ -60,16 +74,26 @@ export function HeroSection({
|
|
|
60
74
|
<p className="max-w-lg text-pretty text-lg text-muted-foreground">
|
|
61
75
|
{description}
|
|
62
76
|
</p>
|
|
63
|
-
<div
|
|
64
|
-
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
77
|
+
<div
|
|
78
|
+
className={cn(
|
|
79
|
+
'flex gap-3',
|
|
80
|
+
primarySlot
|
|
81
|
+
? 'flex-col items-stretch sm:flex-row sm:items-center'
|
|
82
|
+
: 'flex-wrap items-center',
|
|
83
|
+
)}
|
|
84
|
+
>
|
|
85
|
+
{primarySlot ?? (
|
|
86
|
+
primaryCta &&
|
|
87
|
+
renderLink({
|
|
88
|
+
href: primaryCta.href,
|
|
89
|
+
children: (
|
|
90
|
+
<Button size="lg">
|
|
91
|
+
{primaryCta.label}
|
|
92
|
+
<ArrowRight className="ml-2 size-4" />
|
|
93
|
+
</Button>
|
|
94
|
+
),
|
|
95
|
+
})
|
|
96
|
+
)}
|
|
73
97
|
{secondaryCta &&
|
|
74
98
|
renderLink({
|
|
75
99
|
href: secondaryCta.href,
|