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.
Files changed (50) hide show
  1. package/README.md +967 -3
  2. package/package.json +40 -40
  3. package/src/commands/add.js +143 -45
  4. package/src/commands/list.js +2 -2
  5. package/src/installers/checkRequirements.js +1 -0
  6. package/src/installers/copyTemplateFiles.js +23 -2
  7. package/src/installers/patchPayloadConfigCollections.js +92 -0
  8. package/src/installers/writeInstalledBlockReadme.js +17 -4
  9. package/src/registry/listTemplates.js +16 -7
  10. package/src/registry/loadTemplateManifest.js +20 -11
  11. package/src/registry/validateTemplateManifest.js +6 -5
  12. package/src/utils/paths.js +7 -0
  13. package/templates/blocks/DD-BookCall/Component.tsx +535 -573
  14. package/templates/blocks/DD-CardTemplate01/Component.tsx +45 -49
  15. package/templates/blocks/DD-Carousel-A/Component.tsx +249 -266
  16. package/templates/blocks/DD-Carousel-B/Component.tsx +403 -432
  17. package/templates/blocks/DD-ComparisonTable/Component.tsx +256 -272
  18. package/templates/blocks/DD-Contact/Component.tsx +434 -439
  19. package/templates/blocks/DD-Contact/config.ts +8 -3
  20. package/templates/blocks/DD-FeatCat/Component.tsx +302 -361
  21. package/templates/blocks/DD-FeatCat/config.ts +201 -204
  22. package/templates/blocks/DD-FeatStrip/Component.tsx +171 -201
  23. package/templates/blocks/DD-Hero/Component.tsx +297 -317
  24. package/templates/blocks/DD-HorizontalScroll/Component.tsx +244 -303
  25. package/templates/blocks/DD-MasonaryMedia/Component.tsx +202 -228
  26. package/templates/blocks/DD-MasonaryMedia/config.ts +13 -14
  27. package/templates/blocks/DD-Pricing/Component.tsx +372 -380
  28. package/templates/blocks/DD-Process/Component.tsx +149 -155
  29. package/templates/blocks/DD-Section/Component.tsx +266 -327
  30. package/templates/blocks/DD-Services/Component.tsx +176 -188
  31. package/templates/blocks/DD-ShowcaseGrid/Component.tsx +307 -317
  32. package/templates/blocks/DD-Slider-A/Component.tsx +237 -252
  33. package/templates/blocks/DD-StackCards/Component.tsx +137 -160
  34. package/templates/blocks/DD-Team/Component.tsx +247 -265
  35. package/templates/blocks/DD-TechStack/Component.tsx +57 -72
  36. package/templates/blocks/DD-Testimonials/Component.tsx +147 -147
  37. package/templates/blocks/DD-Testimonials/config.ts +66 -66
  38. package/templates/blocks/DD-Work/Component.tsx +315 -328
  39. package/templates/blocks/DD-Work-B/Component.tsx +294 -320
  40. package/templates/collections/Testimonials/README.md +11 -0
  41. package/templates/collections/Testimonials/Testimonials.ts +161 -0
  42. package/templates/collections/Testimonials/manifest.json +55 -0
  43. package/templates/components/RichText/README.md +13 -0
  44. package/templates/components/RichText/converter/componentConverter/blocks.tsx +43 -0
  45. package/templates/components/RichText/converter/componentConverter/types.ts +11 -0
  46. package/templates/components/RichText/converter/index.tsx +18 -0
  47. package/templates/components/RichText/converter/internalLinks.tsx +45 -0
  48. package/templates/components/RichText/converter/textConverter.tsx +27 -0
  49. package/templates/components/RichText/index.tsx +35 -0
  50. package/templates/components/RichText/manifest.json +80 -0
@@ -1,328 +1,315 @@
1
- /* eslint-disable @next/next/no-img-element */
2
- "use client";
3
-
4
- import React, { useRef, useState } from "react";
5
- import Image from "next/image";
6
- import { BarChart2, ExternalLink } from "lucide-react";
7
- import { motion, type Variants } from "framer-motion";
8
-
9
- import { cn } from "@/utilities/ui";
10
- export type DDWorkProps = Record<string, any>;
11
- type Media = { url?: string | null; alt?: string | null; [key: string]: any };
12
- type CategoryItem = { id?: string | null; label?: string | null };
13
- type TagItem = { id?: string | null; tag?: string | null };
14
- type ProjectItem = {
15
- id?: string | null;
16
- title?: string | null;
17
- category?: string | null;
18
- description?: string | null;
19
- highlight?: string | null;
20
- year?: string | null;
21
- image?: Media | string | null;
22
- imageFallbackUrl?: string | null;
23
- tags?: TagItem[] | null;
24
- link?: string | null;
25
- };
26
-
27
- function isLocalImageSrc(src?: string | null): src is string {
28
- return typeof src === "string" && src.startsWith("/api/media/file/");
29
- }
30
-
31
- // ─── SpotlightCard ────────────────────────────────────────────────────────────
32
- interface SpotlightCardProps {
33
- children: React.ReactNode;
34
- className?: string;
35
- spotlightColor?: string;
36
- }
37
-
38
- function SpotlightCard({
39
- children,
40
- className,
41
- spotlightColor = "rgba(214,211,209,0.08)",
42
- }: SpotlightCardProps) {
43
- const cardRef = useRef<HTMLDivElement>(null);
44
- const [pos, setPos] = useState<{ x: number; y: number } | null>(null);
45
-
46
- const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
47
- if (!cardRef.current) return;
48
-
49
- const rect = cardRef.current.getBoundingClientRect();
50
-
51
- setPos({
52
- x: e.clientX - rect.left,
53
- y: e.clientY - rect.top,
54
- });
55
- };
56
-
57
- const handleMouseLeave = () => setPos(null);
58
-
59
- return (
60
- <div
61
- ref={cardRef}
62
- className={cn("relative overflow-hidden", className)}
63
- onMouseMove={handleMouseMove}
64
- onMouseLeave={handleMouseLeave}
65
- >
66
- {pos && (
67
- <div
68
- className="pointer-events-none absolute inset-0 z-0 transition-opacity duration-300"
69
- style={{
70
- background: `radial-gradient(400px circle at ${pos.x}px ${pos.y}px, ${spotlightColor}, transparent 60%)`,
71
- }}
72
- />
73
- )}
74
-
75
- <div className="relative z-10">{children}</div>
76
- </div>
77
- );
78
- }
79
-
80
- // ─── Animation variants ───────────────────────────────────────────────────────
81
- const containerVariants: Variants = {
82
- hidden: {},
83
- show: {
84
- transition: {
85
- staggerChildren: 0.1,
86
- delayChildren: 0.05,
87
- },
88
- },
89
- };
90
-
91
- const itemVariants: Variants = {
92
- hidden: {
93
- opacity: 0,
94
- y: 24,
95
- },
96
- show: {
97
- opacity: 1,
98
- y: 0,
99
- transition: {
100
- duration: 0.45,
101
- ease: "easeOut",
102
- },
103
- },
104
- };
105
-
106
- // ─── Component ────────────────────────────────────────────────────────────────
107
- export const DDWork: React.FC<DDWorkProps> = ({
108
- eyebrow,
109
- headlineMain,
110
- headlineAccent,
111
- categories,
112
- projects,
113
- sectionId,
114
- customCSS,
115
- }) => {
116
- const categoryItems = (categories ?? []) as CategoryItem[];
117
- const projectItems = (projects ?? []) as ProjectItem[];
118
- const allLabel = categoryItems[0]?.label ?? "All";
119
- const [activeCategory, setActiveCategory] = useState(allLabel);
120
-
121
- const filtered =
122
- activeCategory === allLabel
123
- ? projectItems
124
- : projectItems.filter((p) => p.category === activeCategory);
125
-
126
- return (
127
- <>
128
- {customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
129
-
130
- <div id={sectionId ?? "work"} className="py-24">
131
- <div className="mx-auto max-w-6xl lg:max-w-7xl px-6">
132
- {/* Header */}
133
- <motion.div
134
- variants={containerVariants}
135
- initial="hidden"
136
- whileInView="show"
137
- viewport={{ once: false, amount: 0.2 }}
138
- className="mb-12 flex flex-col gap-6 overflow-hidden md:flex-row md:items-end md:justify-between px-0 md:px-4"
139
- >
140
- <motion.div variants={itemVariants}>
141
- {eyebrow && (
142
- <p className="top-caption mb-3 text-sm font-semibold uppercase tracking-widest text-stone-500 dark:text-stone-400">
143
- {eyebrow}
144
- </p>
145
- )}
146
-
147
- <h2 className="text-4xl font-bold leading-tight text-stone-900 dark:text-stone-50 md:text-5xl">
148
- {headlineMain}
149
- {headlineAccent && (
150
- <>
151
- <br />
152
- <span className="text-stone-600 dark:text-stone-400">
153
- {headlineAccent}
154
- </span>
155
- </>
156
- )}
157
- </h2>
158
- </motion.div>
159
-
160
- {/* Filter tabs */}
161
- {categoryItems.length > 1 && (
162
- <motion.div
163
- variants={itemVariants}
164
- className="flex flex-wrap gap-2 py-4"
165
- >
166
- {categoryItems.map((cat, i) => {
167
- const categoryLabel = cat.label ?? "";
168
-
169
- return (
170
- <button
171
- key={cat.id ?? i}
172
- onClick={() => setActiveCategory(categoryLabel)}
173
- className={cn(
174
- "cursor-pointer whitespace-nowrap rounded-full px-4 py-1.5 text-xs font-medium transition-all duration-300",
175
- activeCategory === categoryLabel
176
- ? "border-indigo-500 bg-indigo-800 text-stone-200 shadow-lg shadow-blue-500/20"
177
- : "border-stone-300 dark:border-stone-700 bg-stone-50/80 dark:bg-stone-900/80 text-stone-600 dark:text-stone-400 hover:border-stone-400 dark:hover:border-stone-500 hover:bg-stone-100 dark:hover:bg-stone-800 hover:text-stone-900 dark:hover:text-stone-50",
178
- )}
179
- >
180
- {categoryLabel}
181
- </button>
182
- );
183
- })}
184
- </motion.div>
185
- )}
186
- </motion.div>
187
-
188
- {/* Projects Grid */}
189
- <motion.div
190
- variants={containerVariants}
191
- initial="hidden"
192
- whileInView="show"
193
- viewport={{ once: false, amount: 0.1 }}
194
- className="grid grid-cols-1 gap-5 py-4 md:grid-cols-2 lg:grid-cols-3"
195
- >
196
- {filtered.map((project, i) => {
197
- const projectTitle = project.title ?? "";
198
- const projectDescription = project.description ?? "";
199
- const projectCategory = project.category ?? "";
200
- const projectYear = project.year ?? "";
201
- const projectHighlight = project.highlight ?? "";
202
- const projectLink = project.link ?? "";
203
- const imgSrc =
204
- project.image && typeof project.image === "object"
205
- ? ((project.image as Media).url ??
206
- project.imageFallbackUrl ??
207
- undefined)
208
- : (project.imageFallbackUrl ?? undefined);
209
- const safeImgSrc = isLocalImageSrc(imgSrc) ? imgSrc : null;
210
-
211
- const CardInner = (
212
- <SpotlightCard
213
- spotlightColor="rgba(214,211,209,0.08)"
214
- className="group h-full overflow-hidden rounded-3xl border border-stone-200 dark:border-stone-800 bg-stone-50 dark:bg-stone-900 shadow-md outline-none transition-colors duration-300 hover:border-indigo-500 hover:shadow-2xl hover:outline-4 hover:outline-stone-200/10 dark:hover:outline-stone-200/10"
215
- style={{ cornerShape: "squircle" } as React.CSSProperties}
216
- >
217
- {/* Image */}
218
- <div className="relative h-52 w-full overflow-hidden rounded-t-2xl">
219
- {safeImgSrc ? (
220
- <Image
221
- src={safeImgSrc}
222
- alt={projectTitle}
223
- fill
224
- className="studio-card-image corner-squircle scale-105 rounded-[2.5rem] object-cover object-top transition-transform duration-500 group-hover:scale-110"
225
- sizes="(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw"
226
- priority={false}
227
- style={
228
- { cornerShape: "squircle" } as React.CSSProperties
229
- }
230
- />
231
- ) : (
232
- <div className="h-full w-full bg-stone-200 dark:bg-stone-800" />
233
- )}
234
-
235
- <div className="absolute inset-0 bg-linear-to-t from-black/60 via-black/20 to-transparent dark:from-stone-950/80 dark:via-stone-950/20 dark:to-transparent" />
236
-
237
- {projectCategory && (
238
- <span className="absolute top-2 left-2 z-20 border bg-lime-500/50 border-lime-500 text-stone-50 text-xs font-semibold px-2.5 py-1 rounded-full">
239
- {projectCategory}
240
- </span>
241
- )}
242
-
243
- {projectYear && (
244
- <span className="absolute top-2 right-2 z-20 border bg-stone-900/70 border-stone-700 text-stone-300 text-xs font-mono px-2.5 py-1 rounded-full">
245
- {projectYear}
246
- </span>
247
- )}
248
- </div>
249
-
250
- {/* Content */}
251
- <div className="card-content relative z-5 mx-2 mb-2 -mt-6 rounded-2xl bg-stone-50/90 dark:bg-stone-950/50 p-4 backdrop-blur-md drop-shadow-md transition-all duration-300 group-hover:-translate-y-1 group-hover:brightness-110 group-hover:shadow-2xl hover:duration-300 corner-squircle">
252
- <div className="mb-4 flex items-start justify-between gap-4">
253
- <div>
254
- <h3 className="mb-2 text-lg font-bold text-stone-900 dark:text-stone-50">
255
- {projectTitle}
256
- </h3>
257
-
258
- {projectDescription && (
259
- <p className="text-md mb-5 leading-relaxed text-stone-800 dark:text-stone-400">
260
- {projectDescription}
261
- </p>
262
- )}
263
- </div>
264
-
265
- {projectLink && (
266
- <ExternalLink className="mt-1 h-4 w-4 shrink-0 text-stone-400 dark:text-stone-400 transition-colors duration-300 group-hover:text-indigo-800" />
267
- )}
268
- </div>
269
-
270
- {/* Highlight */}
271
- {projectHighlight && (
272
- <div className="mb-4 flex items-center gap-2 rounded-lg border border-stone-200 dark:border-stone-800 bg-stone-100/60 group-hover:bg-stone-300 group-hover:shadow-xl dark:bg-stone-800/60 p-2.5">
273
- <BarChart2
274
- size={14}
275
- className="shrink-0 text-indigo-800 dark:text-indigo-400"
276
- />
277
- <span className="text-xs font-medium text-indigo-800 dark:text-indigo-400">
278
- {projectHighlight}
279
- </span>
280
- </div>
281
- )}
282
-
283
- {/* Tags */}
284
- {project.tags && project.tags.length > 0 && (
285
- <div className="flex flex-wrap gap-1.5">
286
- {project.tags.map((t, ti) => (
287
- <span
288
- key={t.id ?? ti}
289
- className="rounded-full border border-stone-200 dark:border-indigo-700 bg-stone-100 dark:bg-indigo-900/50 px-2 py-0.5 text-[11.5px] text-stone-700 dark:text-stone-300 transition-all duration-300"
290
- >
291
- {t.tag}
292
- </span>
293
- ))}
294
- </div>
295
- )}
296
- </div>
297
- </SpotlightCard>
298
- );
299
-
300
- return (
301
- <motion.div
302
- key={project.id ?? i}
303
- variants={itemVariants}
304
- className="h-full"
305
- >
306
- {projectLink ? (
307
- <a
308
- href={projectLink}
309
- target="_blank"
310
- rel="noopener noreferrer"
311
- className="block h-full"
312
- >
313
- {CardInner}
314
- </a>
315
- ) : (
316
- CardInner
317
- )}
318
- </motion.div>
319
- );
320
- })}
321
- </motion.div>
322
- </div>
323
- </div>
324
- </>
325
- );
326
- };
327
-
328
- export default DDWork;
1
+ /* eslint-disable @next/next/no-img-element */
2
+ 'use client'
3
+
4
+ import React, { useRef, useState } from 'react'
5
+ import Image from 'next/image'
6
+ import { BarChart2, ExternalLink } from 'lucide-react'
7
+ import { motion, type Variants } from 'framer-motion'
8
+
9
+ import { cn } from '@/utilities/ui'
10
+ export type DDWorkProps = Record<string, any>
11
+ type Media = { url?: string | null; alt?: string | null; [key: string]: any }
12
+ type CategoryItem = { id?: string | null; label?: string | null }
13
+ type TagItem = { id?: string | null; tag?: string | null }
14
+ type ProjectItem = {
15
+ id?: string | null
16
+ title?: string | null
17
+ category?: string | null
18
+ description?: string | null
19
+ highlight?: string | null
20
+ year?: string | null
21
+ image?: Media | string | null
22
+ imageFallbackUrl?: string | null
23
+ tags?: TagItem[] | null
24
+ link?: string | null
25
+ }
26
+
27
+ function isLocalImageSrc(src?: string | null): src is string {
28
+ return typeof src === 'string' && src.startsWith('/api/media/file/')
29
+ }
30
+
31
+ // ─── SpotlightCard ────────────────────────────────────────────────────────────
32
+ interface SpotlightCardProps {
33
+ children: React.ReactNode
34
+ className?: string
35
+ spotlightColor?: string
36
+ }
37
+
38
+ function SpotlightCard({
39
+ children,
40
+ className,
41
+ spotlightColor = 'rgba(214,211,209,0.08)',
42
+ }: SpotlightCardProps) {
43
+ const cardRef = useRef<HTMLDivElement>(null)
44
+ const [pos, setPos] = useState<{ x: number; y: number } | null>(null)
45
+
46
+ const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
47
+ if (!cardRef.current) return
48
+
49
+ const rect = cardRef.current.getBoundingClientRect()
50
+
51
+ setPos({
52
+ x: e.clientX - rect.left,
53
+ y: e.clientY - rect.top,
54
+ })
55
+ }
56
+
57
+ const handleMouseLeave = () => setPos(null)
58
+
59
+ return (
60
+ <div
61
+ ref={cardRef}
62
+ className={cn('relative overflow-hidden', className)}
63
+ onMouseMove={handleMouseMove}
64
+ onMouseLeave={handleMouseLeave}
65
+ >
66
+ {pos && (
67
+ <div
68
+ className="pointer-events-none absolute inset-0 z-0 transition-opacity duration-300"
69
+ style={{
70
+ background: `radial-gradient(400px circle at ${pos.x}px ${pos.y}px, ${spotlightColor}, transparent 60%)`,
71
+ }}
72
+ />
73
+ )}
74
+
75
+ <div className="relative z-10">{children}</div>
76
+ </div>
77
+ )
78
+ }
79
+
80
+ // ─── Animation variants ───────────────────────────────────────────────────────
81
+ const containerVariants: Variants = {
82
+ hidden: {},
83
+ show: {
84
+ transition: {
85
+ staggerChildren: 0.1,
86
+ delayChildren: 0.05,
87
+ },
88
+ },
89
+ }
90
+
91
+ const itemVariants: Variants = {
92
+ hidden: {
93
+ opacity: 0,
94
+ y: 24,
95
+ },
96
+ show: {
97
+ opacity: 1,
98
+ y: 0,
99
+ transition: {
100
+ duration: 0.45,
101
+ ease: 'easeOut',
102
+ },
103
+ },
104
+ }
105
+
106
+ // ─── Component ────────────────────────────────────────────────────────────────
107
+ export const DDWork: React.FC<DDWorkProps> = ({
108
+ eyebrow,
109
+ headlineMain,
110
+ headlineAccent,
111
+ categories,
112
+ projects,
113
+ sectionId,
114
+ customCSS,
115
+ }) => {
116
+ const categoryItems = (categories ?? []) as CategoryItem[]
117
+ const projectItems = (projects ?? []) as ProjectItem[]
118
+ const allLabel = categoryItems[0]?.label ?? 'All'
119
+ const [activeCategory, setActiveCategory] = useState(allLabel)
120
+
121
+ const filtered =
122
+ activeCategory === allLabel
123
+ ? projectItems
124
+ : projectItems.filter((p) => p.category === activeCategory)
125
+
126
+ return (
127
+ <>
128
+ {customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
129
+
130
+ <div id={sectionId ?? 'work'} className="py-24">
131
+ <div className="mx-auto max-w-6xl lg:max-w-7xl px-6">
132
+ {/* Header */}#BlockName-DDWork
133
+ <motion.div
134
+ variants={containerVariants}
135
+ initial="hidden"
136
+ whileInView="show"
137
+ viewport={{ once: false, amount: 0.2 }}
138
+ className="mb-12 flex flex-col gap-6 overflow-hidden md:flex-row md:items-end md:justify-between px-0 md:px-4"
139
+ >
140
+ <motion.div variants={itemVariants}>
141
+ {eyebrow && (
142
+ <p className="top-caption mb-3 text-sm font-semibold uppercase tracking-widest text-stone-500 dark:text-stone-400">
143
+ {eyebrow}
144
+ </p>
145
+ )}
146
+
147
+ <h2 className="text-4xl font-bold leading-tight text-stone-900 dark:text-stone-50 md:text-5xl">
148
+ {headlineMain}
149
+ {headlineAccent && (
150
+ <>
151
+ <br />
152
+ <span className="text-stone-600 dark:text-stone-400">{headlineAccent}</span>
153
+ </>
154
+ )}
155
+ </h2>
156
+ </motion.div>
157
+
158
+ {/* Filter tabs */}
159
+ {categoryItems.length > 1 && (
160
+ <motion.div variants={itemVariants} className="flex flex-wrap gap-2 py-4">
161
+ {categoryItems.map((cat, i) => {
162
+ const categoryLabel = cat.label ?? ''
163
+
164
+ return (
165
+ <button
166
+ key={cat.id ?? i}
167
+ onClick={() => setActiveCategory(categoryLabel)}
168
+ className={cn(
169
+ 'cursor-pointer whitespace-nowrap rounded-full px-4 py-1.5 text-xs font-medium transition-all duration-300',
170
+ activeCategory === categoryLabel
171
+ ? 'border-indigo-500 bg-indigo-800 text-stone-200 shadow-lg shadow-blue-500/20'
172
+ : 'border-stone-300 dark:border-stone-700 bg-stone-50/80 dark:bg-stone-900/80 text-stone-600 dark:text-stone-400 hover:border-stone-400 dark:hover:border-stone-500 hover:bg-stone-100 dark:hover:bg-stone-800 hover:text-stone-900 dark:hover:text-stone-50',
173
+ )}
174
+ >
175
+ {categoryLabel}
176
+ </button>
177
+ )
178
+ })}
179
+ </motion.div>
180
+ )}
181
+ </motion.div>
182
+
183
+ {/* Projects Grid */}
184
+ <motion.div
185
+ variants={containerVariants}
186
+ initial="hidden"
187
+ whileInView="show"
188
+ viewport={{ once: false, amount: 0.1 }}
189
+ className="grid grid-cols-1 gap-5 py-4 md:grid-cols-2 lg:grid-cols-3"
190
+ >
191
+ {filtered.map((project, i) => {
192
+ const projectTitle = project.title ?? ''
193
+ const projectDescription = project.description ?? ''
194
+ const projectCategory = project.category ?? ''
195
+ const projectYear = project.year ?? ''
196
+ const projectHighlight = project.highlight ?? ''
197
+ const projectLink = project.link ?? ''
198
+ const imgSrc =
199
+ project.image && typeof project.image === 'object'
200
+ ? ((project.image as Media).url ?? project.imageFallbackUrl ?? undefined)
201
+ : (project.imageFallbackUrl ?? undefined)
202
+ const safeImgSrc = isLocalImageSrc(imgSrc) ? imgSrc : null
203
+
204
+ const CardInner = (
205
+ <SpotlightCard
206
+ spotlightColor="rgba(214,211,209,0.08)"
207
+ className="group h-full overflow-hidden rounded-3xl border border-stone-200 dark:border-stone-800 bg-stone-50 dark:bg-stone-900 shadow-md outline-none transition-colors duration-300 hover:border-indigo-500 hover:shadow-2xl hover:outline-4 hover:outline-stone-200/10 dark:hover:outline-stone-200/10"
208
+ style={{ cornerShape: 'squircle' } as React.CSSProperties}
209
+ >
210
+ {/* Image */}
211
+ <div className="relative h-52 w-full overflow-hidden rounded-t-2xl">
212
+ {safeImgSrc ? (
213
+ <Image
214
+ src={safeImgSrc}
215
+ alt={projectTitle}
216
+ fill
217
+ className="studio-card-image corner-squircle scale-105 rounded-[2.5rem] object-cover object-top transition-transform duration-500 group-hover:scale-110"
218
+ sizes="(max-width: 768px) 100vw, (max-width: 1024px) 50vw, 33vw"
219
+ priority={false}
220
+ style={{ cornerShape: 'squircle' } as React.CSSProperties}
221
+ />
222
+ ) : (
223
+ <div className="h-full w-full bg-stone-200 dark:bg-stone-800" />
224
+ )}
225
+
226
+ <div className="absolute inset-0 bg-linear-to-t from-black/60 via-black/20 to-transparent dark:from-stone-950/80 dark:via-stone-950/20 dark:to-transparent" />
227
+
228
+ {projectCategory && (
229
+ <span className="absolute top-2 left-2 z-20 border bg-lime-500/50 border-lime-500 text-stone-50 text-xs font-semibold px-2.5 py-1 rounded-full">
230
+ {projectCategory}
231
+ </span>
232
+ )}
233
+
234
+ {projectYear && (
235
+ <span className="absolute top-2 right-2 z-20 border bg-stone-900/70 border-stone-700 text-stone-300 text-xs font-mono px-2.5 py-1 rounded-full">
236
+ {projectYear}
237
+ </span>
238
+ )}
239
+ </div>
240
+
241
+ {/* Content */}
242
+ <div className="card-content relative z-5 mx-2 mb-2 -mt-6 rounded-2xl bg-stone-50/90 dark:bg-stone-950/50 p-4 backdrop-blur-md drop-shadow-md transition-all duration-300 group-hover:-translate-y-1 group-hover:brightness-110 group-hover:shadow-2xl hover:duration-300 corner-squircle">
243
+ <div className="mb-4 flex items-start justify-between gap-4">
244
+ <div>
245
+ <h3 className="mb-2 text-lg font-bold text-stone-900 dark:text-stone-50">
246
+ {projectTitle}
247
+ </h3>
248
+
249
+ {projectDescription && (
250
+ <p className="text-md mb-5 leading-relaxed text-stone-800 dark:text-stone-400">
251
+ {projectDescription}
252
+ </p>
253
+ )}
254
+ </div>
255
+
256
+ {projectLink && (
257
+ <ExternalLink className="mt-1 h-4 w-4 shrink-0 text-stone-400 dark:text-stone-400 transition-colors duration-300 group-hover:text-indigo-800" />
258
+ )}
259
+ </div>
260
+
261
+ {/* Highlight */}
262
+ {projectHighlight && (
263
+ <div className="mb-4 flex items-center gap-2 rounded-lg border border-stone-200 dark:border-stone-800 bg-stone-100/60 group-hover:bg-stone-300 group-hover:shadow-xl dark:bg-stone-800/60 p-2.5">
264
+ <BarChart2
265
+ size={14}
266
+ className="shrink-0 text-indigo-800 dark:text-indigo-400"
267
+ />
268
+ <span className="text-xs font-medium text-indigo-800 dark:text-indigo-400">
269
+ {projectHighlight}
270
+ </span>
271
+ </div>
272
+ )}
273
+
274
+ {/* Tags */}
275
+ {project.tags && project.tags.length > 0 && (
276
+ <div className="flex flex-wrap gap-1.5">
277
+ {project.tags.map((t, ti) => (
278
+ <span
279
+ key={t.id ?? ti}
280
+ className="rounded-full border border-stone-200 dark:border-indigo-700 bg-stone-100 dark:bg-indigo-900/50 px-2 py-0.5 text-[11.5px] text-stone-700 dark:text-stone-300 transition-all duration-300"
281
+ >
282
+ {t.tag}
283
+ </span>
284
+ ))}
285
+ </div>
286
+ )}
287
+ </div>
288
+ </SpotlightCard>
289
+ )
290
+
291
+ return (
292
+ <motion.div key={project.id ?? i} variants={itemVariants} className="h-full">
293
+ {projectLink ? (
294
+ <a
295
+ href={projectLink}
296
+ target="_blank"
297
+ rel="noopener noreferrer"
298
+ className="block h-full"
299
+ >
300
+ {CardInner}
301
+ </a>
302
+ ) : (
303
+ CardInner
304
+ )}
305
+ </motion.div>
306
+ )
307
+ })}
308
+ </motion.div>
309
+ </div>
310
+ </div>
311
+ </>
312
+ )
313
+ }
314
+
315
+ export default DDWork