@hanzo/ui 4.6.0 → 4.8.2
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/assets/general.tsx +1 -1
- package/assets/hanzo-logo.tsx +3 -1
- package/assets/index.ts +119 -5
- package/blocks/auth/index.ts +6 -0
- package/blocks/auth/login-2fa.tsx +165 -0
- package/blocks/auth/login-basic.tsx +94 -0
- package/blocks/auth/login-social.tsx +148 -0
- package/blocks/auth/magic-link.tsx +129 -0
- package/blocks/auth/password-reset.tsx +97 -0
- package/blocks/auth/signup.tsx +157 -0
- package/blocks/data-display/activity-feed.tsx +242 -0
- package/blocks/data-display/data-table.tsx +235 -0
- package/blocks/data-display/stats-grid.tsx +194 -0
- package/blocks/ecommerce/checkout.tsx +242 -0
- package/blocks/ecommerce/index.ts +7 -0
- package/blocks/ecommerce/product-detail.tsx +257 -0
- package/blocks/ecommerce/product-grid.tsx +148 -0
- package/blocks/ecommerce/shopping-cart.tsx +181 -0
- package/blocks/marketing/cta-section.tsx +207 -0
- package/blocks/marketing/faq.tsx +159 -0
- package/blocks/marketing/features-grid.tsx +156 -0
- package/blocks/marketing/hero-section.tsx +192 -0
- package/blocks/marketing/index.ts +6 -0
- package/blocks/marketing/pricing-table.tsx +121 -0
- package/blocks/marketing/testimonials.tsx +196 -0
- package/components/index.ts +4 -51
- package/dist/index.js +9351 -0
- package/dist/index.mjs +9340 -0
- package/dist/lib/utils.js +47 -0
- package/dist/lib/utils.mjs +28 -0
- package/dist/src/utils.js +47 -0
- package/dist/src/utils.mjs +28 -0
- package/dist/tailwind/index.js +2050 -0
- package/dist/tailwind/index.mjs +2019 -0
- package/dist/types/index.js +79 -0
- package/dist/types/index.mjs +56 -0
- package/dist/util/format-text.js +51 -0
- package/dist/util/format-text.mjs +32 -0
- package/dist/util/index.js +384 -0
- package/dist/util/index.mjs +363 -0
- package/frameworks/core/index.ts +6 -0
- package/frameworks/core/utils/index.ts +64 -0
- package/frameworks/react/components/button.tsx +26 -0
- package/frameworks/react/components/index.ts +5 -0
- package/frameworks/react/hooks/index.ts +5 -0
- package/frameworks/react/index.ts +9 -0
- package/frameworks/react/package.json +8 -0
- package/frameworks/react/utils/index.ts +2 -0
- package/frameworks/react-native/index.ts +9 -0
- package/frameworks/react-native/package.json +8 -0
- package/frameworks/registry.json +371 -0
- package/frameworks/setup.sh +69 -0
- package/frameworks/svelte/index.ts +9 -0
- package/frameworks/svelte/package.json +8 -0
- package/frameworks/tracker.json +1854 -0
- package/frameworks/vue/index.ts +9 -0
- package/frameworks/vue/package.json +8 -0
- package/package.json +192 -28
- package/primitives/accordion.tsx +1 -1
- package/primitives/alert-dialog.tsx +1 -1
- package/primitives/alert.tsx +1 -1
- package/primitives/avatar.tsx +1 -1
- package/primitives/badge.tsx +2 -1
- package/primitives/breadcrumb.tsx +1 -1
- package/primitives/button.tsx +37 -47
- package/primitives/card.tsx +1 -1
- package/primitives/carousel.tsx +3 -2
- package/primitives/chat/chat-input-area.tsx +5 -4
- package/primitives/chat/chat-input.tsx +2 -2
- package/primitives/chat/files-preview.tsx +5 -4
- package/primitives/chat/message-list.tsx +2 -1
- package/primitives/chat/sqlite-preview.tsx +8 -8
- package/primitives/checkbox.tsx +2 -1
- package/primitives/command.tsx +3 -1
- package/primitives/context-menu.tsx +1 -1
- package/primitives/dialog.tsx +6 -1
- package/primitives/drawer.tsx +4 -1
- package/primitives/dropdown-menu.tsx +1 -1
- package/primitives/file-uploader.tsx +4 -2
- package/primitives/form.tsx +1 -1
- package/primitives/hover-card.tsx +1 -1
- package/primitives/icons/github.tsx +2 -2
- package/primitives/icons/youtube-logo.tsx +1 -1
- package/primitives/index-common.ts +7 -6
- package/primitives/input-otp.tsx +1 -1
- package/primitives/input.tsx +2 -1
- package/primitives/label.tsx +2 -1
- package/primitives/markdown-preview.tsx +3 -0
- package/primitives/mermaid.tsx +13 -18
- package/primitives/next/image.tsx +2 -1
- package/primitives/next/inline-icon.tsx +14 -14
- package/primitives/next/media-stack.tsx +2 -19
- package/primitives/pagination.tsx +1 -1
- package/primitives/popover.tsx +4 -2
- package/primitives/progress.tsx +2 -1
- package/primitives/prompt-textarea.tsx +1 -1
- package/primitives/radio-group.tsx +1 -1
- package/primitives/scroll-area.tsx +1 -1
- package/primitives/search-input.tsx +1 -1
- package/primitives/select.tsx +1 -1
- package/primitives/separator.tsx +2 -1
- package/primitives/sheet.tsx +1 -1
- package/primitives/skeleton.tsx +1 -0
- package/primitives/slider.tsx +2 -1
- package/primitives/stepper.tsx +1 -1
- package/primitives/switch.tsx +2 -1
- package/primitives/table.tsx +1 -1
- package/primitives/tabs.tsx +1 -1
- package/primitives/textarea.tsx +2 -1
- package/primitives/textfield.tsx +1 -0
- package/primitives/toggle-group.tsx +1 -1
- package/primitives/toggle.tsx +1 -1
- package/primitives/tooltip.tsx +1 -1
- package/src/hooks/use-copy-clipboard.ts +1 -1
- package/src/index-lean.ts +87 -0
- package/src/index.ts +54 -0
- package/src/registry/api.ts +1 -1
- package/src/utils.ts +19 -1
- package/tailwind/tailwind.config.hanzo-preset.js +7 -7
- package/tailwind/typo-plugin/index.js +1 -1
- package/types/animation-def.ts +1 -1
- package/types/index.ts +2 -1
- package/util/blob.ts +9 -4
- package/util/date.ts +2 -1
- package/util/format-text.ts +2 -1
- package/util/index.ts +103 -0
- package/util/spread-to-transform.ts +9 -8
- package/MCP-INSTRUCTIONS.md +0 -73
- package/README-MCP.md +0 -175
- package/dist/button.d.ts +0 -1
- package/dist/button.js +0 -1
- package/dist/hooks/index.d.ts +0 -7
- package/dist/hooks/index.js +0 -7
- package/dist/hooks/use-click-away.d.ts +0 -2
- package/dist/hooks/use-click-away.js +0 -23
- package/dist/hooks/use-combined-refs.d.ts +0 -3
- package/dist/hooks/use-combined-refs.js +0 -18
- package/dist/hooks/use-copy-clipboard.d.ts +0 -9
- package/dist/hooks/use-copy-clipboard.js +0 -21
- package/dist/hooks/use-debounce.d.ts +0 -1
- package/dist/hooks/use-debounce.js +0 -13
- package/dist/hooks/use-fill-ids.d.ts +0 -8
- package/dist/hooks/use-fill-ids.js +0 -20
- package/dist/hooks/use-map.d.ts +0 -1
- package/dist/hooks/use-map.js +0 -20
- package/dist/hooks/use-measure.d.ts +0 -8
- package/dist/hooks/use-measure.js +0 -25
- package/dist/hooks/use-reverse-video-playback.d.ts +0 -1
- package/dist/hooks/use-reverse-video-playback.js +0 -41
- package/dist/hooks/use-scroll-restoration.d.ts +0 -8
- package/dist/hooks/use-scroll-restoration.js +0 -36
- package/dist/mcp/enhanced-server.d.ts +0 -29
- package/dist/mcp/enhanced-server.js +0 -1128
- package/dist/mcp/index.d.ts +0 -28
- package/dist/mcp/index.js +0 -436
- package/dist/registry/api.d.ts +0 -37
- package/dist/registry/api.js +0 -129
- package/dist/registry/index.d.ts +0 -353
- package/dist/registry/index.js +0 -45
- package/dist/utils.d.ts +0 -1
- package/dist/utils.js +0 -1
- package/environment.d.ts +0 -6
- package/public/r/accordion.json +0 -11
- package/public/r/alert.json +0 -11
- package/public/r/avatar.json +0 -11
- package/public/r/badge.json +0 -11
- package/public/r/button.json +0 -11
- package/public/r/card.json +0 -11
- package/public/r/checkbox.json +0 -11
- package/public/r/default.json +0 -6
- package/public/r/dialog.json +0 -11
- package/public/r/input.json +0 -11
- package/public/r/label.json +0 -11
- package/public/r/new-york.json +0 -6
- package/public/r/popover.json +0 -11
- package/public/r/select.json +0 -11
- package/public/r/table.json +0 -11
- package/public/r/tabs.json +0 -11
- package/public/r/toast.json +0 -11
- package/registry.json +0 -184
- package/test/test-registry.js +0 -73
- package/test-imports.mjs +0 -19
- package/tsconfig.json +0 -22
- package/utils.ts +0 -9
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { cn } from '@hanzo/ui/util'
|
|
4
|
+
import { Button } from '@hanzo/ui/primitives'
|
|
5
|
+
|
|
6
|
+
interface CTASectionProps extends React.ComponentPropsWithoutRef<'section'> {
|
|
7
|
+
title: string
|
|
8
|
+
description?: string
|
|
9
|
+
primaryAction?: {
|
|
10
|
+
label: string
|
|
11
|
+
onClick: () => void
|
|
12
|
+
}
|
|
13
|
+
secondaryAction?: {
|
|
14
|
+
label: string
|
|
15
|
+
onClick: () => void
|
|
16
|
+
}
|
|
17
|
+
variant?: 'default' | 'centered' | 'card' | 'gradient'
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function CTASection({
|
|
21
|
+
className,
|
|
22
|
+
title,
|
|
23
|
+
description,
|
|
24
|
+
primaryAction,
|
|
25
|
+
secondaryAction,
|
|
26
|
+
variant = 'default',
|
|
27
|
+
...props
|
|
28
|
+
}: CTASectionProps) {
|
|
29
|
+
if (variant === 'card') {
|
|
30
|
+
return (
|
|
31
|
+
<section className={cn('py-24 sm:py-32', className)} {...props}>
|
|
32
|
+
<div className="container">
|
|
33
|
+
<div className="rounded-2xl bg-muted px-6 py-16 sm:px-12 sm:py-20">
|
|
34
|
+
<div className="mx-auto max-w-3xl text-center">
|
|
35
|
+
<h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
|
|
36
|
+
{title}
|
|
37
|
+
</h2>
|
|
38
|
+
{description && (
|
|
39
|
+
<p className="mt-4 text-lg text-muted-foreground">
|
|
40
|
+
{description}
|
|
41
|
+
</p>
|
|
42
|
+
)}
|
|
43
|
+
{(primaryAction || secondaryAction) && (
|
|
44
|
+
<div className="mt-10 flex flex-col gap-4 sm:flex-row sm:justify-center">
|
|
45
|
+
{primaryAction && (
|
|
46
|
+
<Button
|
|
47
|
+
size="lg"
|
|
48
|
+
onClick={primaryAction.onClick}
|
|
49
|
+
className="w-full sm:w-auto"
|
|
50
|
+
>
|
|
51
|
+
{primaryAction.label}
|
|
52
|
+
</Button>
|
|
53
|
+
)}
|
|
54
|
+
{secondaryAction && (
|
|
55
|
+
<Button
|
|
56
|
+
size="lg"
|
|
57
|
+
variant="outline"
|
|
58
|
+
onClick={secondaryAction.onClick}
|
|
59
|
+
className="w-full sm:w-auto"
|
|
60
|
+
>
|
|
61
|
+
{secondaryAction.label}
|
|
62
|
+
</Button>
|
|
63
|
+
)}
|
|
64
|
+
</div>
|
|
65
|
+
)}
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</section>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (variant === 'gradient') {
|
|
74
|
+
return (
|
|
75
|
+
<section
|
|
76
|
+
className={cn(
|
|
77
|
+
'relative overflow-hidden bg-gradient-to-br from-primary/90 to-primary py-24 sm:py-32',
|
|
78
|
+
className
|
|
79
|
+
)}
|
|
80
|
+
{...props}
|
|
81
|
+
>
|
|
82
|
+
<div className="absolute inset-0 bg-grid-white/10" />
|
|
83
|
+
<div className="container relative">
|
|
84
|
+
<div className="mx-auto max-w-3xl text-center">
|
|
85
|
+
<h2 className="text-3xl font-bold tracking-tight text-primary-foreground sm:text-4xl">
|
|
86
|
+
{title}
|
|
87
|
+
</h2>
|
|
88
|
+
{description && (
|
|
89
|
+
<p className="mt-4 text-lg text-primary-foreground/90">
|
|
90
|
+
{description}
|
|
91
|
+
</p>
|
|
92
|
+
)}
|
|
93
|
+
{(primaryAction || secondaryAction) && (
|
|
94
|
+
<div className="mt-10 flex flex-col gap-4 sm:flex-row sm:justify-center">
|
|
95
|
+
{primaryAction && (
|
|
96
|
+
<Button
|
|
97
|
+
size="lg"
|
|
98
|
+
variant="secondary"
|
|
99
|
+
onClick={primaryAction.onClick}
|
|
100
|
+
className="w-full sm:w-auto"
|
|
101
|
+
>
|
|
102
|
+
{primaryAction.label}
|
|
103
|
+
</Button>
|
|
104
|
+
)}
|
|
105
|
+
{secondaryAction && (
|
|
106
|
+
<Button
|
|
107
|
+
size="lg"
|
|
108
|
+
variant="outline"
|
|
109
|
+
className="w-full border-primary-foreground/20 text-primary-foreground hover:bg-primary-foreground/10 sm:w-auto"
|
|
110
|
+
onClick={secondaryAction.onClick}
|
|
111
|
+
>
|
|
112
|
+
{secondaryAction.label}
|
|
113
|
+
</Button>
|
|
114
|
+
)}
|
|
115
|
+
</div>
|
|
116
|
+
)}
|
|
117
|
+
</div>
|
|
118
|
+
</div>
|
|
119
|
+
</section>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (variant === 'centered') {
|
|
124
|
+
return (
|
|
125
|
+
<section className={cn('py-24 sm:py-32', className)} {...props}>
|
|
126
|
+
<div className="container">
|
|
127
|
+
<div className="mx-auto max-w-3xl text-center">
|
|
128
|
+
<h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
|
|
129
|
+
{title}
|
|
130
|
+
</h2>
|
|
131
|
+
{description && (
|
|
132
|
+
<p className="mt-4 text-lg text-muted-foreground">
|
|
133
|
+
{description}
|
|
134
|
+
</p>
|
|
135
|
+
)}
|
|
136
|
+
{(primaryAction || secondaryAction) && (
|
|
137
|
+
<div className="mt-10 flex flex-col gap-4 sm:flex-row sm:justify-center">
|
|
138
|
+
{primaryAction && (
|
|
139
|
+
<Button
|
|
140
|
+
size="lg"
|
|
141
|
+
onClick={primaryAction.onClick}
|
|
142
|
+
className="w-full sm:w-auto"
|
|
143
|
+
>
|
|
144
|
+
{primaryAction.label}
|
|
145
|
+
</Button>
|
|
146
|
+
)}
|
|
147
|
+
{secondaryAction && (
|
|
148
|
+
<Button
|
|
149
|
+
size="lg"
|
|
150
|
+
variant="outline"
|
|
151
|
+
onClick={secondaryAction.onClick}
|
|
152
|
+
className="w-full sm:w-auto"
|
|
153
|
+
>
|
|
154
|
+
{secondaryAction.label}
|
|
155
|
+
</Button>
|
|
156
|
+
)}
|
|
157
|
+
</div>
|
|
158
|
+
)}
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</section>
|
|
162
|
+
)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
// Default variant
|
|
166
|
+
return (
|
|
167
|
+
<section className={cn('py-24 sm:py-32', className)} {...props}>
|
|
168
|
+
<div className="container">
|
|
169
|
+
<div className="flex flex-col items-center justify-between gap-8 sm:flex-row sm:gap-12">
|
|
170
|
+
<div className="max-w-xl">
|
|
171
|
+
<h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
|
|
172
|
+
{title}
|
|
173
|
+
</h2>
|
|
174
|
+
{description && (
|
|
175
|
+
<p className="mt-4 text-lg text-muted-foreground">
|
|
176
|
+
{description}
|
|
177
|
+
</p>
|
|
178
|
+
)}
|
|
179
|
+
</div>
|
|
180
|
+
{(primaryAction || secondaryAction) && (
|
|
181
|
+
<div className="flex flex-col gap-4 sm:flex-row">
|
|
182
|
+
{primaryAction && (
|
|
183
|
+
<Button
|
|
184
|
+
size="lg"
|
|
185
|
+
onClick={primaryAction.onClick}
|
|
186
|
+
className="w-full sm:w-auto"
|
|
187
|
+
>
|
|
188
|
+
{primaryAction.label}
|
|
189
|
+
</Button>
|
|
190
|
+
)}
|
|
191
|
+
{secondaryAction && (
|
|
192
|
+
<Button
|
|
193
|
+
size="lg"
|
|
194
|
+
variant="outline"
|
|
195
|
+
onClick={secondaryAction.onClick}
|
|
196
|
+
className="w-full sm:w-auto"
|
|
197
|
+
>
|
|
198
|
+
{secondaryAction.label}
|
|
199
|
+
</Button>
|
|
200
|
+
)}
|
|
201
|
+
</div>
|
|
202
|
+
)}
|
|
203
|
+
</div>
|
|
204
|
+
</div>
|
|
205
|
+
</section>
|
|
206
|
+
)
|
|
207
|
+
}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { cn } from '@hanzo/ui/util'
|
|
4
|
+
import {
|
|
5
|
+
Accordion,
|
|
6
|
+
AccordionContent,
|
|
7
|
+
AccordionItem,
|
|
8
|
+
AccordionTrigger,
|
|
9
|
+
} from '@hanzo/ui/primitives'
|
|
10
|
+
|
|
11
|
+
interface FAQItem {
|
|
12
|
+
question: string
|
|
13
|
+
answer: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface FAQProps extends React.ComponentPropsWithoutRef<'section'> {
|
|
17
|
+
title?: string
|
|
18
|
+
subtitle?: string
|
|
19
|
+
description?: string
|
|
20
|
+
items: FAQItem[]
|
|
21
|
+
variant?: 'default' | 'centered' | 'split'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function FAQ({
|
|
25
|
+
className,
|
|
26
|
+
title,
|
|
27
|
+
subtitle,
|
|
28
|
+
description,
|
|
29
|
+
items,
|
|
30
|
+
variant = 'default',
|
|
31
|
+
...props
|
|
32
|
+
}: FAQProps) {
|
|
33
|
+
if (variant === 'split') {
|
|
34
|
+
return (
|
|
35
|
+
<section className={cn('py-24 sm:py-32', className)} {...props}>
|
|
36
|
+
<div className="container">
|
|
37
|
+
<div className="grid gap-12 lg:grid-cols-5">
|
|
38
|
+
<div className="lg:col-span-2">
|
|
39
|
+
{subtitle && (
|
|
40
|
+
<p className="mb-4 text-sm font-semibold uppercase tracking-wide text-primary">
|
|
41
|
+
{subtitle}
|
|
42
|
+
</p>
|
|
43
|
+
)}
|
|
44
|
+
{title && (
|
|
45
|
+
<h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
|
|
46
|
+
{title}
|
|
47
|
+
</h2>
|
|
48
|
+
)}
|
|
49
|
+
{description && (
|
|
50
|
+
<p className="mt-4 text-lg text-muted-foreground">
|
|
51
|
+
{description}
|
|
52
|
+
</p>
|
|
53
|
+
)}
|
|
54
|
+
</div>
|
|
55
|
+
<div className="lg:col-span-3">
|
|
56
|
+
<Accordion type="single" collapsible className="w-full">
|
|
57
|
+
{items.map((item, i) => (
|
|
58
|
+
<AccordionItem key={i} value={`item-${i}`}>
|
|
59
|
+
<AccordionTrigger className="text-left">
|
|
60
|
+
{item.question}
|
|
61
|
+
</AccordionTrigger>
|
|
62
|
+
<AccordionContent>{item.answer}</AccordionContent>
|
|
63
|
+
</AccordionItem>
|
|
64
|
+
))}
|
|
65
|
+
</Accordion>
|
|
66
|
+
</div>
|
|
67
|
+
</div>
|
|
68
|
+
</div>
|
|
69
|
+
</section>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
if (variant === 'centered') {
|
|
74
|
+
return (
|
|
75
|
+
<section className={cn('py-24 sm:py-32', className)} {...props}>
|
|
76
|
+
<div className="container">
|
|
77
|
+
<div className="mx-auto max-w-3xl">
|
|
78
|
+
{(title || subtitle || description) && (
|
|
79
|
+
<div className="text-center">
|
|
80
|
+
{subtitle && (
|
|
81
|
+
<p className="mb-4 text-sm font-semibold uppercase tracking-wide text-primary">
|
|
82
|
+
{subtitle}
|
|
83
|
+
</p>
|
|
84
|
+
)}
|
|
85
|
+
{title && (
|
|
86
|
+
<h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
|
|
87
|
+
{title}
|
|
88
|
+
</h2>
|
|
89
|
+
)}
|
|
90
|
+
{description && (
|
|
91
|
+
<p className="mt-4 text-lg text-muted-foreground">
|
|
92
|
+
{description}
|
|
93
|
+
</p>
|
|
94
|
+
)}
|
|
95
|
+
</div>
|
|
96
|
+
)}
|
|
97
|
+
<Accordion
|
|
98
|
+
type="single"
|
|
99
|
+
collapsible
|
|
100
|
+
className={cn('w-full', (title || subtitle || description) && 'mt-12')}
|
|
101
|
+
>
|
|
102
|
+
{items.map((item, i) => (
|
|
103
|
+
<AccordionItem key={i} value={`item-${i}`}>
|
|
104
|
+
<AccordionTrigger className="text-left">
|
|
105
|
+
{item.question}
|
|
106
|
+
</AccordionTrigger>
|
|
107
|
+
<AccordionContent>{item.answer}</AccordionContent>
|
|
108
|
+
</AccordionItem>
|
|
109
|
+
))}
|
|
110
|
+
</Accordion>
|
|
111
|
+
</div>
|
|
112
|
+
</div>
|
|
113
|
+
</section>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
// Default variant
|
|
118
|
+
return (
|
|
119
|
+
<section className={cn('py-24 sm:py-32', className)} {...props}>
|
|
120
|
+
<div className="container">
|
|
121
|
+
<div className="mx-auto max-w-4xl">
|
|
122
|
+
{(title || subtitle || description) && (
|
|
123
|
+
<div>
|
|
124
|
+
{subtitle && (
|
|
125
|
+
<p className="mb-4 text-sm font-semibold uppercase tracking-wide text-primary">
|
|
126
|
+
{subtitle}
|
|
127
|
+
</p>
|
|
128
|
+
)}
|
|
129
|
+
{title && (
|
|
130
|
+
<h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
|
|
131
|
+
{title}
|
|
132
|
+
</h2>
|
|
133
|
+
)}
|
|
134
|
+
{description && (
|
|
135
|
+
<p className="mt-4 text-lg text-muted-foreground">
|
|
136
|
+
{description}
|
|
137
|
+
</p>
|
|
138
|
+
)}
|
|
139
|
+
</div>
|
|
140
|
+
)}
|
|
141
|
+
<Accordion
|
|
142
|
+
type="single"
|
|
143
|
+
collapsible
|
|
144
|
+
className={cn('w-full', (title || subtitle || description) && 'mt-12')}
|
|
145
|
+
>
|
|
146
|
+
{items.map((item, i) => (
|
|
147
|
+
<AccordionItem key={i} value={`item-${i}`}>
|
|
148
|
+
<AccordionTrigger className="text-left">
|
|
149
|
+
{item.question}
|
|
150
|
+
</AccordionTrigger>
|
|
151
|
+
<AccordionContent>{item.answer}</AccordionContent>
|
|
152
|
+
</AccordionItem>
|
|
153
|
+
))}
|
|
154
|
+
</Accordion>
|
|
155
|
+
</div>
|
|
156
|
+
</div>
|
|
157
|
+
</section>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { cn } from '@hanzo/ui/util'
|
|
4
|
+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@hanzo/ui/primitives'
|
|
5
|
+
import type { LucideIcon } from 'lucide-react'
|
|
6
|
+
|
|
7
|
+
interface Feature {
|
|
8
|
+
icon?: LucideIcon
|
|
9
|
+
title: string
|
|
10
|
+
description: string
|
|
11
|
+
href?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
interface FeaturesGridProps extends React.ComponentPropsWithoutRef<'section'> {
|
|
15
|
+
title?: string
|
|
16
|
+
subtitle?: string
|
|
17
|
+
description?: string
|
|
18
|
+
features: Feature[]
|
|
19
|
+
columns?: 2 | 3 | 4
|
|
20
|
+
variant?: 'default' | 'cards' | 'minimal'
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export function FeaturesGrid({
|
|
24
|
+
className,
|
|
25
|
+
title,
|
|
26
|
+
subtitle,
|
|
27
|
+
description,
|
|
28
|
+
features,
|
|
29
|
+
columns = 3,
|
|
30
|
+
variant = 'default',
|
|
31
|
+
...props
|
|
32
|
+
}: FeaturesGridProps) {
|
|
33
|
+
const gridCols = {
|
|
34
|
+
2: 'md:grid-cols-2',
|
|
35
|
+
3: 'md:grid-cols-2 lg:grid-cols-3',
|
|
36
|
+
4: 'md:grid-cols-2 lg:grid-cols-4',
|
|
37
|
+
}[columns]
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<section className={cn('py-24 sm:py-32', className)} {...props}>
|
|
41
|
+
<div className="container">
|
|
42
|
+
{(title || subtitle || description) && (
|
|
43
|
+
<div className="mx-auto max-w-3xl text-center">
|
|
44
|
+
{subtitle && (
|
|
45
|
+
<p className="mb-4 text-sm font-semibold uppercase tracking-wide text-primary">
|
|
46
|
+
{subtitle}
|
|
47
|
+
</p>
|
|
48
|
+
)}
|
|
49
|
+
{title && (
|
|
50
|
+
<h2 className="text-3xl font-bold tracking-tight sm:text-4xl">
|
|
51
|
+
{title}
|
|
52
|
+
</h2>
|
|
53
|
+
)}
|
|
54
|
+
{description && (
|
|
55
|
+
<p className="mt-4 text-lg text-muted-foreground">
|
|
56
|
+
{description}
|
|
57
|
+
</p>
|
|
58
|
+
)}
|
|
59
|
+
</div>
|
|
60
|
+
)}
|
|
61
|
+
|
|
62
|
+
{variant === 'cards' && (
|
|
63
|
+
<div className={cn('mt-16 grid gap-6', gridCols)}>
|
|
64
|
+
{features.map((feature, i) => {
|
|
65
|
+
const Icon = feature.icon
|
|
66
|
+
return (
|
|
67
|
+
<Card key={i} className="relative">
|
|
68
|
+
{feature.href && (
|
|
69
|
+
<a
|
|
70
|
+
href={feature.href}
|
|
71
|
+
className="absolute inset-0 z-10"
|
|
72
|
+
aria-label={feature.title}
|
|
73
|
+
/>
|
|
74
|
+
)}
|
|
75
|
+
<CardHeader>
|
|
76
|
+
{Icon && (
|
|
77
|
+
<div className="mb-2 inline-flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10">
|
|
78
|
+
<Icon className="h-5 w-5 text-primary" />
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
<CardTitle>{feature.title}</CardTitle>
|
|
82
|
+
</CardHeader>
|
|
83
|
+
<CardContent>
|
|
84
|
+
<CardDescription>{feature.description}</CardDescription>
|
|
85
|
+
</CardContent>
|
|
86
|
+
</Card>
|
|
87
|
+
)
|
|
88
|
+
})}
|
|
89
|
+
</div>
|
|
90
|
+
)}
|
|
91
|
+
|
|
92
|
+
{variant === 'minimal' && (
|
|
93
|
+
<div className={cn('mt-16 grid gap-x-8 gap-y-10', gridCols)}>
|
|
94
|
+
{features.map((feature, i) => {
|
|
95
|
+
const Icon = feature.icon
|
|
96
|
+
return (
|
|
97
|
+
<div key={i} className="relative">
|
|
98
|
+
{feature.href && (
|
|
99
|
+
<a
|
|
100
|
+
href={feature.href}
|
|
101
|
+
className="absolute inset-0 z-10"
|
|
102
|
+
aria-label={feature.title}
|
|
103
|
+
/>
|
|
104
|
+
)}
|
|
105
|
+
<div className="flex items-start gap-4">
|
|
106
|
+
{Icon && (
|
|
107
|
+
<div className="flex-shrink-0">
|
|
108
|
+
<div className="inline-flex h-10 w-10 items-center justify-center rounded-lg bg-primary/10">
|
|
109
|
+
<Icon className="h-5 w-5 text-primary" />
|
|
110
|
+
</div>
|
|
111
|
+
</div>
|
|
112
|
+
)}
|
|
113
|
+
<div>
|
|
114
|
+
<h3 className="font-semibold">{feature.title}</h3>
|
|
115
|
+
<p className="mt-2 text-sm text-muted-foreground">
|
|
116
|
+
{feature.description}
|
|
117
|
+
</p>
|
|
118
|
+
</div>
|
|
119
|
+
</div>
|
|
120
|
+
</div>
|
|
121
|
+
)
|
|
122
|
+
})}
|
|
123
|
+
</div>
|
|
124
|
+
)}
|
|
125
|
+
|
|
126
|
+
{variant === 'default' && (
|
|
127
|
+
<div className={cn('mt-16 grid gap-8', gridCols)}>
|
|
128
|
+
{features.map((feature, i) => {
|
|
129
|
+
const Icon = feature.icon
|
|
130
|
+
return (
|
|
131
|
+
<div key={i} className="relative text-center">
|
|
132
|
+
{feature.href && (
|
|
133
|
+
<a
|
|
134
|
+
href={feature.href}
|
|
135
|
+
className="absolute inset-0 z-10"
|
|
136
|
+
aria-label={feature.title}
|
|
137
|
+
/>
|
|
138
|
+
)}
|
|
139
|
+
{Icon && (
|
|
140
|
+
<div className="mx-auto mb-4 inline-flex h-12 w-12 items-center justify-center rounded-lg bg-primary/10">
|
|
141
|
+
<Icon className="h-6 w-6 text-primary" />
|
|
142
|
+
</div>
|
|
143
|
+
)}
|
|
144
|
+
<h3 className="mb-2 text-lg font-semibold">{feature.title}</h3>
|
|
145
|
+
<p className="text-sm text-muted-foreground">
|
|
146
|
+
{feature.description}
|
|
147
|
+
</p>
|
|
148
|
+
</div>
|
|
149
|
+
)
|
|
150
|
+
})}
|
|
151
|
+
</div>
|
|
152
|
+
)}
|
|
153
|
+
</div>
|
|
154
|
+
</section>
|
|
155
|
+
)
|
|
156
|
+
}
|