blocks-dusted 0.1.0 → 0.1.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/README.md +967 -3
- package/package.json +40 -40
- package/src/commands/add.js +143 -45
- package/src/commands/list.js +2 -2
- package/src/installers/checkRequirements.js +1 -0
- package/src/installers/copyTemplateFiles.js +23 -2
- package/src/installers/patchPayloadConfigCollections.js +92 -0
- package/src/installers/writeInstalledBlockReadme.js +17 -4
- package/src/registry/listTemplates.js +16 -7
- package/src/registry/loadTemplateManifest.js +20 -11
- package/src/registry/validateTemplateManifest.js +6 -5
- package/src/utils/paths.js +7 -0
- package/templates/blocks/DD-BookCall/Component.tsx +535 -573
- package/templates/blocks/DD-CardTemplate01/Component.tsx +45 -49
- package/templates/blocks/DD-Carousel-A/Component.tsx +249 -266
- package/templates/blocks/DD-Carousel-B/Component.tsx +403 -432
- package/templates/blocks/DD-ComparisonTable/Component.tsx +256 -272
- package/templates/blocks/DD-Contact/Component.tsx +434 -439
- package/templates/blocks/DD-Contact/config.ts +8 -3
- package/templates/blocks/DD-FeatCat/Component.tsx +302 -361
- package/templates/blocks/DD-FeatCat/config.ts +201 -204
- package/templates/blocks/DD-FeatStrip/Component.tsx +171 -201
- package/templates/blocks/DD-Hero/Component.tsx +297 -317
- package/templates/blocks/DD-HorizontalScroll/Component.tsx +244 -303
- package/templates/blocks/DD-MasonaryMedia/Component.tsx +202 -228
- package/templates/blocks/DD-MasonaryMedia/config.ts +13 -14
- package/templates/blocks/DD-Pricing/Component.tsx +372 -380
- package/templates/blocks/DD-Process/Component.tsx +149 -155
- package/templates/blocks/DD-Section/Component.tsx +266 -327
- package/templates/blocks/DD-Services/Component.tsx +176 -188
- package/templates/blocks/DD-ShowcaseGrid/Component.tsx +307 -317
- package/templates/blocks/DD-Slider-A/Component.tsx +237 -252
- package/templates/blocks/DD-StackCards/Component.tsx +137 -160
- package/templates/blocks/DD-Team/Component.tsx +247 -265
- package/templates/blocks/DD-TechStack/Component.tsx +57 -72
- package/templates/blocks/DD-Testimonials/Component.tsx +147 -147
- package/templates/blocks/DD-Testimonials/config.ts +66 -66
- package/templates/blocks/DD-Work/Component.tsx +315 -328
- package/templates/blocks/DD-Work-B/Component.tsx +294 -320
- package/templates/collections/Testimonials/README.md +11 -0
- package/templates/collections/Testimonials/Testimonials.ts +161 -0
- package/templates/collections/Testimonials/manifest.json +55 -0
- package/templates/components/RichText/README.md +13 -0
- package/templates/components/RichText/converter/componentConverter/blocks.tsx +43 -0
- package/templates/components/RichText/converter/componentConverter/types.ts +11 -0
- package/templates/components/RichText/converter/index.tsx +18 -0
- package/templates/components/RichText/converter/internalLinks.tsx +45 -0
- package/templates/components/RichText/converter/textConverter.tsx +27 -0
- package/templates/components/RichText/index.tsx +35 -0
- package/templates/components/RichText/manifest.json +80 -0
|
@@ -1,266 +1,249 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import React, { useState, useCallback, useEffect } from
|
|
4
|
-
import Link from
|
|
5
|
-
import Image from
|
|
6
|
-
import { ChevronLeft, ChevronRight } from
|
|
7
|
-
import { cn } from
|
|
8
|
-
import useEmblaCarousel from
|
|
9
|
-
|
|
10
|
-
type MediaObj = { url?: string | null; alt?: string | null }
|
|
11
|
-
|
|
12
|
-
function isValidImageSrc(src?: string | null): src is string {
|
|
13
|
-
return Boolean(src && src.startsWith(
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
type CarouselItemA = {
|
|
17
|
-
id?: string | null
|
|
18
|
-
name: string
|
|
19
|
-
category?: string | null
|
|
20
|
-
badge?: string | null
|
|
21
|
-
image?: MediaObj | string | null
|
|
22
|
-
imageFallbackUrl?: string | null
|
|
23
|
-
description?: string | null
|
|
24
|
-
href?: string | null
|
|
25
|
-
features?: Array<{ id?: string | null; label?: string | null }> | null
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
export type DDCarouselAProps = {
|
|
29
|
-
blockType:
|
|
30
|
-
blockName?: string | null
|
|
31
|
-
eyebrow?: string | null
|
|
32
|
-
heading?: string | null
|
|
33
|
-
subtext?: string | null
|
|
34
|
-
viewAllLabel?: string | null
|
|
35
|
-
viewAllHref?: string | null
|
|
36
|
-
items?: CarouselItemA[] | null
|
|
37
|
-
sectionId?: string | null
|
|
38
|
-
customCSS?: string | null
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
export const DDCarouselA: React.FC<DDCarouselAProps> = ({
|
|
42
|
-
eyebrow,
|
|
43
|
-
heading,
|
|
44
|
-
subtext,
|
|
45
|
-
viewAllLabel =
|
|
46
|
-
viewAllHref,
|
|
47
|
-
items: itemsProp,
|
|
48
|
-
sectionId,
|
|
49
|
-
customCSS,
|
|
50
|
-
}) => {
|
|
51
|
-
const items = itemsProp ?? []
|
|
52
|
-
const [emblaRef, emblaApi] = useEmblaCarousel({
|
|
53
|
-
align:
|
|
54
|
-
slidesToScroll: 1,
|
|
55
|
-
containScroll:
|
|
56
|
-
dragFree: false,
|
|
57
|
-
})
|
|
58
|
-
const [activeIdx, setActiveIdx] = useState(0)
|
|
59
|
-
const [canPrev, setCanPrev] = useState(false)
|
|
60
|
-
const [canNext, setCanNext] = useState(true)
|
|
61
|
-
|
|
62
|
-
const onSelect = useCallback(() => {
|
|
63
|
-
if (!emblaApi) return
|
|
64
|
-
setActiveIdx(emblaApi.selectedScrollSnap())
|
|
65
|
-
setCanPrev(emblaApi.canScrollPrev())
|
|
66
|
-
setCanNext(emblaApi.canScrollNext())
|
|
67
|
-
}, [emblaApi])
|
|
68
|
-
|
|
69
|
-
useEffect(() => {
|
|
70
|
-
if (!emblaApi) return
|
|
71
|
-
onSelect()
|
|
72
|
-
emblaApi.on(
|
|
73
|
-
emblaApi.on(
|
|
74
|
-
return () => {
|
|
75
|
-
emblaApi.off(
|
|
76
|
-
emblaApi.off(
|
|
77
|
-
}
|
|
78
|
-
}, [emblaApi, onSelect])
|
|
79
|
-
|
|
80
|
-
const scrollPrev = useCallback(() => emblaApi?.scrollPrev(), [emblaApi])
|
|
81
|
-
const scrollNext = useCallback(() => emblaApi?.scrollNext(), [emblaApi])
|
|
82
|
-
const scrollTo = useCallback(
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
>
|
|
251
|
-
<span
|
|
252
|
-
className={cn(
|
|
253
|
-
"block rounded-full transition-all duration-300",
|
|
254
|
-
i === activeIdx
|
|
255
|
-
? "h-2.5 w-8 bg-lime-500"
|
|
256
|
-
: "h-2.5 w-2.5 bg-stone-600 hover:bg-stone-400",
|
|
257
|
-
)}
|
|
258
|
-
/>
|
|
259
|
-
</button>
|
|
260
|
-
))}
|
|
261
|
-
</div>
|
|
262
|
-
)}
|
|
263
|
-
</div>
|
|
264
|
-
</section>
|
|
265
|
-
);
|
|
266
|
-
};
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React, { useState, useCallback, useEffect } from 'react'
|
|
4
|
+
import Link from 'next/link'
|
|
5
|
+
import Image from 'next/image'
|
|
6
|
+
import { ChevronLeft, ChevronRight } from 'lucide-react'
|
|
7
|
+
import { cn } from '@/utilities/ui'
|
|
8
|
+
import useEmblaCarousel from 'embla-carousel-react'
|
|
9
|
+
|
|
10
|
+
type MediaObj = { url?: string | null; alt?: string | null }
|
|
11
|
+
|
|
12
|
+
function isValidImageSrc(src?: string | null): src is string {
|
|
13
|
+
return Boolean(src && src.startsWith('/api/media/file/'))
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type CarouselItemA = {
|
|
17
|
+
id?: string | null
|
|
18
|
+
name: string
|
|
19
|
+
category?: string | null
|
|
20
|
+
badge?: string | null
|
|
21
|
+
image?: MediaObj | string | null
|
|
22
|
+
imageFallbackUrl?: string | null
|
|
23
|
+
description?: string | null
|
|
24
|
+
href?: string | null
|
|
25
|
+
features?: Array<{ id?: string | null; label?: string | null }> | null
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type DDCarouselAProps = {
|
|
29
|
+
blockType: 'DD-Carousel-A'
|
|
30
|
+
blockName?: string | null
|
|
31
|
+
eyebrow?: string | null
|
|
32
|
+
heading?: string | null
|
|
33
|
+
subtext?: string | null
|
|
34
|
+
viewAllLabel?: string | null
|
|
35
|
+
viewAllHref?: string | null
|
|
36
|
+
items?: CarouselItemA[] | null
|
|
37
|
+
sectionId?: string | null
|
|
38
|
+
customCSS?: string | null
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const DDCarouselA: React.FC<DDCarouselAProps> = ({
|
|
42
|
+
eyebrow,
|
|
43
|
+
heading,
|
|
44
|
+
subtext,
|
|
45
|
+
viewAllLabel = 'View All',
|
|
46
|
+
viewAllHref,
|
|
47
|
+
items: itemsProp,
|
|
48
|
+
sectionId,
|
|
49
|
+
customCSS,
|
|
50
|
+
}) => {
|
|
51
|
+
const items = itemsProp ?? []
|
|
52
|
+
const [emblaRef, emblaApi] = useEmblaCarousel({
|
|
53
|
+
align: 'start',
|
|
54
|
+
slidesToScroll: 1,
|
|
55
|
+
containScroll: 'trimSnaps',
|
|
56
|
+
dragFree: false,
|
|
57
|
+
})
|
|
58
|
+
const [activeIdx, setActiveIdx] = useState(0)
|
|
59
|
+
const [canPrev, setCanPrev] = useState(false)
|
|
60
|
+
const [canNext, setCanNext] = useState(true)
|
|
61
|
+
|
|
62
|
+
const onSelect = useCallback(() => {
|
|
63
|
+
if (!emblaApi) return
|
|
64
|
+
setActiveIdx(emblaApi.selectedScrollSnap())
|
|
65
|
+
setCanPrev(emblaApi.canScrollPrev())
|
|
66
|
+
setCanNext(emblaApi.canScrollNext())
|
|
67
|
+
}, [emblaApi])
|
|
68
|
+
|
|
69
|
+
useEffect(() => {
|
|
70
|
+
if (!emblaApi) return
|
|
71
|
+
onSelect()
|
|
72
|
+
emblaApi.on('select', onSelect)
|
|
73
|
+
emblaApi.on('reInit', onSelect)
|
|
74
|
+
return () => {
|
|
75
|
+
emblaApi.off('select', onSelect)
|
|
76
|
+
emblaApi.off('reInit', onSelect)
|
|
77
|
+
}
|
|
78
|
+
}, [emblaApi, onSelect])
|
|
79
|
+
|
|
80
|
+
const scrollPrev = useCallback(() => emblaApi?.scrollPrev(), [emblaApi])
|
|
81
|
+
const scrollNext = useCallback(() => emblaApi?.scrollNext(), [emblaApi])
|
|
82
|
+
const scrollTo = useCallback((i: number) => emblaApi?.scrollTo(i), [emblaApi])
|
|
83
|
+
|
|
84
|
+
const snapCount = emblaApi?.scrollSnapList().length ?? 0
|
|
85
|
+
|
|
86
|
+
if (!items.length) return null
|
|
87
|
+
|
|
88
|
+
return (
|
|
89
|
+
<section id={sectionId ?? undefined} className="py-20 overflow-hidden">
|
|
90
|
+
{customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
|
|
91
|
+
<div className="max-w-6xl lg:max-w-7xl mx-auto px-4 md:px-6">
|
|
92
|
+
{/* Header */}#BlockName-DDCarouselA
|
|
93
|
+
<div className="flex flex-col md:flex-row md:items-end justify-between mb-12 gap-4 px-0 md:px-4">
|
|
94
|
+
<div>
|
|
95
|
+
{eyebrow && (
|
|
96
|
+
<div className="text-lime-500 text-xs font-bold uppercase tracking-widest mb-2">
|
|
97
|
+
{eyebrow}
|
|
98
|
+
</div>
|
|
99
|
+
)}
|
|
100
|
+
{heading && (
|
|
101
|
+
<h2 className="text-4xl lg:text-5xl font-bold text-stone-900 dark:text-stone-50 leading-tight">
|
|
102
|
+
{heading}
|
|
103
|
+
</h2>
|
|
104
|
+
)}
|
|
105
|
+
{subtext && <p className="text-stone-400 mt-3 text-base max-w-xl">{subtext}</p>}
|
|
106
|
+
</div>
|
|
107
|
+
<div className="flex items-center gap-3 shrink-0">
|
|
108
|
+
<button
|
|
109
|
+
onClick={scrollPrev}
|
|
110
|
+
disabled={!canPrev}
|
|
111
|
+
aria-label="Previous"
|
|
112
|
+
className="w-11 h-11 flex items-center justify-center rounded-full border-2 border-white/30 text-stone-900 dark:text-stone-50 hover:border-white hover:bg-stone-50 hover:text-stone-900 transition-all disabled:opacity-30 disabled:cursor-not-allowed cursor-pointer"
|
|
113
|
+
>
|
|
114
|
+
<ChevronLeft className="w-5 h-5" />
|
|
115
|
+
</button>
|
|
116
|
+
<button
|
|
117
|
+
onClick={scrollNext}
|
|
118
|
+
disabled={!canNext}
|
|
119
|
+
aria-label="Next"
|
|
120
|
+
className="w-11 h-11 flex items-center justify-center rounded-full bg-lime-500 text-stone-900 hover:bg-lime-400 transition-all disabled:opacity-30 disabled:cursor-not-allowed cursor-pointer"
|
|
121
|
+
>
|
|
122
|
+
<ChevronRight className="w-5 h-5" />
|
|
123
|
+
</button>
|
|
124
|
+
{viewAllHref && (
|
|
125
|
+
<Link
|
|
126
|
+
href={viewAllHref}
|
|
127
|
+
className="ml-2 text-sm font-semibold text-stone-600 dark:text-stone-300 hover:text-lime-500 transition-colors whitespace-nowrap"
|
|
128
|
+
>
|
|
129
|
+
{viewAllLabel} →
|
|
130
|
+
</Link>
|
|
131
|
+
)}
|
|
132
|
+
</div>
|
|
133
|
+
</div>
|
|
134
|
+
{/* Embla viewport */}
|
|
135
|
+
<div
|
|
136
|
+
ref={emblaRef}
|
|
137
|
+
className="overflow-visible select-none cursor-grab active:cursor-grabbing"
|
|
138
|
+
>
|
|
139
|
+
<div className="flex gap-6 py-4">
|
|
140
|
+
{items.map((item, i) => {
|
|
141
|
+
const candidateImgSrc =
|
|
142
|
+
item.image && typeof item.image === 'object' && (item.image as MediaObj).url
|
|
143
|
+
? (item.image as MediaObj).url!
|
|
144
|
+
: (item.imageFallbackUrl ?? '')
|
|
145
|
+
const imgSrc = isValidImageSrc(candidateImgSrc) ? candidateImgSrc : ''
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<div
|
|
149
|
+
key={item.id ?? i}
|
|
150
|
+
className="flex-none w-[calc(100%-0px)] sm:w-[calc(50%-12px)] lg:w-[calc(33.333%-16px)] min-w-70"
|
|
151
|
+
>
|
|
152
|
+
<Link href={item.href ?? '#'} className="block group h-full" draggable={false}>
|
|
153
|
+
<div className="border border-border rounded-2xl overflow-hidden hover:-translate-y-2 hover:outline-3 hover:outline-lime-500/30 hover:outline-solid hover:outline-offset-2 transition-all duration-300 hover:shadow-xl hover:border-lime-500/30 h-full flex flex-col">
|
|
154
|
+
{/* Image */}
|
|
155
|
+
<div className="relative h-52 overflow-hidden bg-stone-900 shrink-0 ">
|
|
156
|
+
{imgSrc ? (
|
|
157
|
+
<Image
|
|
158
|
+
src={imgSrc}
|
|
159
|
+
alt={item.name}
|
|
160
|
+
fill
|
|
161
|
+
sizes="(max-width: 768px) 100vw, (max-width: 1200px) 50vw, 33vw"
|
|
162
|
+
className="w-full h-full object-cover object-top group-hover:scale-105 transition-transform duration-500"
|
|
163
|
+
draggable={false}
|
|
164
|
+
/>
|
|
165
|
+
) : (
|
|
166
|
+
<div className="w-full h-full bg-linear-to-br from-violet-950 to-indigo-950" />
|
|
167
|
+
)}
|
|
168
|
+
|
|
169
|
+
{item.badge && (
|
|
170
|
+
<div className="absolute top-3 left-3 bg-lime-500 text-stone-900 text-xs font-bold px-3 py-1 rounded-full z-10">
|
|
171
|
+
{item.badge}
|
|
172
|
+
</div>
|
|
173
|
+
)}
|
|
174
|
+
|
|
175
|
+
<div className="absolute inset-0 bg-linear-to-t from-stone-900/60 via-transparent to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-300" />
|
|
176
|
+
|
|
177
|
+
<div className="absolute bottom-3 left-3 right-3 opacity-0 group-hover:opacity-100 transition-opacity duration-300">
|
|
178
|
+
<span className="text-stone-900 dark:text-stone-50 text-sm font-semibold">
|
|
179
|
+
View Details →
|
|
180
|
+
</span>
|
|
181
|
+
</div>
|
|
182
|
+
</div>
|
|
183
|
+
|
|
184
|
+
{/* Content */}
|
|
185
|
+
<div className="p-5 flex flex-col flex-1">
|
|
186
|
+
{item.category && (
|
|
187
|
+
<div className="text-lime-500 text-xs font-semibold uppercase tracking-widest mb-1">
|
|
188
|
+
{item.category}
|
|
189
|
+
</div>
|
|
190
|
+
)}
|
|
191
|
+
|
|
192
|
+
<h3 className="text-stone-900 dark:text-stone-50 font-bold text-base leading-snug mb-2 line-clamp-2">
|
|
193
|
+
{item.name}
|
|
194
|
+
</h3>
|
|
195
|
+
|
|
196
|
+
{item.description && (
|
|
197
|
+
<div className="grid grid-rows-[0fr] group-hover:grid-rows-[1fr] transition-[grid-template-rows,margin] duration-300 ease-out mb-0 group-hover:mb-4">
|
|
198
|
+
<p className="min-h-0 overflow-hidden text-stone-400 text-sm leading-relaxed line-clamp-2 opacity-0 group-hover:opacity-100 transition-opacity duration-300">
|
|
199
|
+
{item.description}
|
|
200
|
+
</p>
|
|
201
|
+
</div>
|
|
202
|
+
)}
|
|
203
|
+
|
|
204
|
+
{item.features && item.features.length > 0 && (
|
|
205
|
+
<div className="flex flex-wrap gap-1.5 mt-auto">
|
|
206
|
+
{item.features.slice(0, 3).map((f, fi) => (
|
|
207
|
+
<span
|
|
208
|
+
key={f.id ?? fi}
|
|
209
|
+
className="text-xs bg-lime-500/10 text-lime-400 px-2.5 py-1 rounded-full"
|
|
210
|
+
>
|
|
211
|
+
{f.label}
|
|
212
|
+
</span>
|
|
213
|
+
))}
|
|
214
|
+
</div>
|
|
215
|
+
)}
|
|
216
|
+
</div>
|
|
217
|
+
</div>
|
|
218
|
+
</Link>
|
|
219
|
+
</div>
|
|
220
|
+
)
|
|
221
|
+
})}
|
|
222
|
+
</div>
|
|
223
|
+
</div>
|
|
224
|
+
{/* Dot indicators */}
|
|
225
|
+
{snapCount > 1 && (
|
|
226
|
+
<div className="flex justify-center gap-2 mt-0">
|
|
227
|
+
{Array.from({ length: snapCount }).map((_, i) => (
|
|
228
|
+
<button
|
|
229
|
+
key={i}
|
|
230
|
+
onClick={() => scrollTo(i)}
|
|
231
|
+
aria-label={`Go to slide ${i + 1}`}
|
|
232
|
+
className="flex h-11 w-11 items-center justify-center rounded-full cursor-pointer"
|
|
233
|
+
>
|
|
234
|
+
<span
|
|
235
|
+
className={cn(
|
|
236
|
+
'block rounded-full transition-all duration-300',
|
|
237
|
+
i === activeIdx
|
|
238
|
+
? 'h-2.5 w-8 bg-lime-500'
|
|
239
|
+
: 'h-2.5 w-2.5 bg-stone-600 hover:bg-stone-400',
|
|
240
|
+
)}
|
|
241
|
+
/>
|
|
242
|
+
</button>
|
|
243
|
+
))}
|
|
244
|
+
</div>
|
|
245
|
+
)}
|
|
246
|
+
</div>
|
|
247
|
+
</section>
|
|
248
|
+
)
|
|
249
|
+
}
|