blocks-dusted 0.1.1 → 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 +2 -2
  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,188 +1,176 @@
1
- "use client";
2
- import React, { useRef, useState } from "react";
3
- import * as LucideIcons from "lucide-react";
4
- import { TextFade } from "@/components/ui/anims/fade";
5
- import { cn } from "@/utilities/ui";
6
- export type DDServicesProps = Record<string, any>;
7
- type TagItem = { id?: string | null; tag?: string | null };
8
- type ServiceItem = {
9
- id?: string | null;
10
- iconName?: string | null;
11
- number?: string | null;
12
- title?: string | null;
13
- description?: string | null;
14
- tags?: TagItem[] | null;
15
- };
16
-
17
- // ─── Dynamic Icon ─────────────────────────────────────────────────────────────
18
- function DynamicIcon({
19
- name,
20
- size = 20,
21
- ...props
22
- }: { name?: string | null } & Omit<LucideIcons.LucideProps, "name">) {
23
- if (!name) return null;
24
- const Icon = (
25
- LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>
26
- )[name];
27
- if (!Icon) return null;
28
- return <Icon size={size} {...props} />;
29
- }
30
-
31
- // ─── Spotlight Hover Card ─────────────────────────────────────────────────────
32
- function SpotlightCard({
33
- children,
34
- className,
35
- }: {
36
- children: React.ReactNode;
37
- className?: string;
38
- }) {
39
- const ref = useRef<HTMLDivElement>(null);
40
- const [pos, setPos] = useState<{ x: number; y: number } | null>(null);
41
-
42
- const onMove = (e: React.MouseEvent<HTMLDivElement>) => {
43
- if (!ref.current) return;
44
- const rect = ref.current.getBoundingClientRect();
45
- setPos({
46
- x: e.clientX - rect.left,
47
- y: e.clientY - rect.top,
48
- });
49
- };
50
-
51
- const onLeave = () => setPos(null);
52
-
53
- return (
54
- <div
55
- ref={ref}
56
- onMouseMove={onMove}
57
- onMouseLeave={onLeave}
58
- className={cn(
59
- "relative overflow-hidden transition-all duration-300",
60
- className,
61
- )}
62
- >
63
- {/* spotlight */}
64
- {pos && (
65
- <div
66
- className="pointer-events-none absolute inset-0 z-0 transition-opacity duration-300"
67
- style={{
68
- background: `radial-gradient(500px circle at ${pos.x}px ${pos.y}px, rgba(132,204,22,0.12), transparent 60%)`,
69
- }}
70
- />
71
- )}
72
-
73
- {/* animated border glow */}
74
- <div className="absolute inset-0 rounded-3xl border border-stone-100 dark:border-stone-800 group-hover:border-lime-500/60 transition-colors duration-300" />
75
-
76
- {/* subtle noise / sheen */}
77
- <div className="pointer-events-none absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 bg-[linear-gradient(120deg,transparent,rgba(255,255,255,0.05),transparent)]" />
78
-
79
- <div className="relative z-10">{children}</div>
80
- </div>
81
- );
82
- }
83
-
84
- // ─── Component ────────────────────────────────────────────────────────────────
85
- export const DDServices: React.FC<DDServicesProps> = ({
86
- eyebrow,
87
- headlineMain,
88
- headlineAccent,
89
- description,
90
- services,
91
- sectionId,
92
- customCSS,
93
- }) => {
94
- const serviceItems = (services ?? []) as ServiceItem[];
95
-
96
- return (
97
- <>
98
- {customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
99
-
100
- <div id={sectionId ?? "services"} className="py-24">
101
- <div className="max-w-6xl lg:max-w-7xl mx-auto px-4 md:px-6">
102
- {/* Header */}
103
- <div className="max-w-2xl mb-16">
104
- <TextFade direction="right" className="text-base" delay={0}>
105
- {eyebrow && (
106
- <p className="text-[11.5px] font-semibold text-stone-400 tracking-widest uppercase mb-3 top-caption">
107
- {eyebrow}
108
- </p>
109
- )}
110
- </TextFade>
111
-
112
- <TextFade direction="up" className="mt-0" delay={0.3}>
113
- <h2 className="text-3d text-4xl md:text-5xl font-bold text-stone-900 dark:text-stone-50 leading-tight mb-5">
114
- {headlineMain}
115
- </h2>
116
- </TextFade>
117
-
118
- <TextFade direction="up" className="-mt-6" delay={0.3}>
119
- <h2 className="text-3d text-4xl md:text-5xl font-bold text-stone-400 leading-tight mb-5">
120
- {headlineAccent}
121
- </h2>
122
- </TextFade>
123
-
124
- <TextFade direction="down" className="px-1" delay={0.5}>
125
- {description && (
126
- <p className="text-stone-700 dark:text-stone-300 text-base leading-relaxed">
127
- {description}
128
- </p>
129
- )}
130
- </TextFade>
131
- </div>
132
-
133
- {/* Services Grid */}
134
- {serviceItems.length > 0 && (
135
- <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5">
136
- {serviceItems.map((svc, i) => (
137
- <SpotlightCard
138
- key={svc.id ?? i}
139
- className="group bg-[#19171ca4] backdrop-blur-md rounded-3xl shadow-md hover:shadow-2xl hover:-translate-y-1 transition-all duration-300"
140
- >
141
- <div className="bg-dots h-full w-full shadow-inner brightness-90 absolute p-6 md:p-8">
142
- {/* Icon Row */}
143
- <div className="flex items-start justify-between mb-6">
144
- <div className="w-12 h-12 flex items-center justify-center rounded-xl bg-stone-800/10 bg-lines border border-stone-600 group-hover:bg-stone-700 group-hover:scale-110 transition-all duration-300">
145
- <DynamicIcon
146
- className="text-stone-300 group-hover:text-lime-400 transition-colors duration-300"
147
- name={svc.iconName}
148
- size={20}
149
- />
150
- </div>
151
-
152
- {svc.number && (
153
- <span className="text-xs font-mono text-stone-400 group-hover:text-lime-400 transition-colors duration-300">
154
- {svc.number}
155
- </span>
156
- )}
157
- </div>
158
- {/* Title */}
159
- <h3 className="text-lg font-semibold text-stone-900 dark:text-stone-50 mb-3 group-hover:text-lime-300 transition-colors duration-300">
160
- {svc.title}
161
- </h3>
162
- {/* Description */}
163
- <p className="text-md text-stone-400 leading-relaxed mb-5 group-hover:text-stone-300 transition-colors duration-300">
164
- {svc.description}
165
- </p>
166
- {/* Tags */}
167
- {svc.tags && svc.tags.length > 0 && (
168
- <div className="flex flex-wrap gap-2">
169
- {svc.tags.map((t, ti) => (
170
- <span
171
- key={t.id ?? ti}
172
- className="text-xs px-2.5 py-1 rounded-full bg-stone-800/10 bg-lines text-stone-400 border border-stone-700 group-hover:border-lime-500/40 group-hover:text-lime-300 transition-all duration-300"
173
- >
174
- {t.tag}
175
- </span>
176
- ))}
177
- </div>
178
- )}
179
- </div>
180
- </SpotlightCard>
181
- ))}
182
- </div>
183
- )}
184
- </div>
185
- </div>
186
- </>
187
- );
188
- };
1
+ 'use client'
2
+ import React, { useRef, useState } from 'react'
3
+ import * as LucideIcons from 'lucide-react'
4
+ import { TextFade } from '@/components/ui/anims/fade'
5
+ import { cn } from '@/utilities/ui'
6
+ export type DDServicesProps = Record<string, any>
7
+ type TagItem = { id?: string | null; tag?: string | null }
8
+ type ServiceItem = {
9
+ id?: string | null
10
+ iconName?: string | null
11
+ number?: string | null
12
+ title?: string | null
13
+ description?: string | null
14
+ tags?: TagItem[] | null
15
+ }
16
+
17
+ // ─── Dynamic Icon ─────────────────────────────────────────────────────────────
18
+ function DynamicIcon({
19
+ name,
20
+ size = 20,
21
+ ...props
22
+ }: { name?: string | null } & Omit<LucideIcons.LucideProps, 'name'>) {
23
+ if (!name) return null
24
+ const Icon = (LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>)[name]
25
+ if (!Icon) return null
26
+ return <Icon size={size} {...props} />
27
+ }
28
+
29
+ // ─── Spotlight Hover Card ─────────────────────────────────────────────────────
30
+ function SpotlightCard({ children, className }: { children: React.ReactNode; className?: string }) {
31
+ const ref = useRef<HTMLDivElement>(null)
32
+ const [pos, setPos] = useState<{ x: number; y: number } | null>(null)
33
+
34
+ const onMove = (e: React.MouseEvent<HTMLDivElement>) => {
35
+ if (!ref.current) return
36
+ const rect = ref.current.getBoundingClientRect()
37
+ setPos({
38
+ x: e.clientX - rect.left,
39
+ y: e.clientY - rect.top,
40
+ })
41
+ }
42
+
43
+ const onLeave = () => setPos(null)
44
+
45
+ return (
46
+ <div
47
+ ref={ref}
48
+ onMouseMove={onMove}
49
+ onMouseLeave={onLeave}
50
+ className={cn('relative overflow-hidden transition-all duration-300', className)}
51
+ >
52
+ {/* spotlight */}
53
+ {pos && (
54
+ <div
55
+ className="pointer-events-none absolute inset-0 z-0 transition-opacity duration-300"
56
+ style={{
57
+ background: `radial-gradient(500px circle at ${pos.x}px ${pos.y}px, rgba(132,204,22,0.12), transparent 60%)`,
58
+ }}
59
+ />
60
+ )}
61
+
62
+ {/* animated border glow */}
63
+ <div className="absolute inset-0 rounded-3xl border border-stone-100 dark:border-stone-800 group-hover:border-lime-500/60 transition-colors duration-300" />
64
+
65
+ {/* subtle noise / sheen */}
66
+ <div className="pointer-events-none absolute inset-0 opacity-0 group-hover:opacity-100 transition-opacity duration-500 bg-[linear-gradient(120deg,transparent,rgba(255,255,255,0.05),transparent)]" />
67
+
68
+ <div className="relative z-10">{children}</div>
69
+ </div>
70
+ )
71
+ }
72
+
73
+ // ─── Component ────────────────────────────────────────────────────────────────
74
+ export const DDServices: React.FC<DDServicesProps> = ({
75
+ eyebrow,
76
+ headlineMain,
77
+ headlineAccent,
78
+ description,
79
+ services,
80
+ sectionId,
81
+ customCSS,
82
+ }) => {
83
+ const serviceItems = (services ?? []) as ServiceItem[]
84
+
85
+ return (
86
+ <>
87
+ {customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
88
+
89
+ <div id={sectionId ?? 'services'} className="py-24">
90
+ <div className="max-w-6xl lg:max-w-7xl mx-auto px-4 md:px-6">
91
+ {/* Header */}#BlockName-DDServices
92
+ <div className="max-w-2xl mb-16">
93
+ <TextFade direction="right" className="text-base" delay={0}>
94
+ {eyebrow && (
95
+ <p className="text-[11.5px] font-semibold text-stone-400 tracking-widest uppercase mb-3 top-caption">
96
+ {eyebrow}
97
+ </p>
98
+ )}
99
+ </TextFade>
100
+
101
+ <TextFade direction="up" className="mt-0" delay={0.3}>
102
+ <h2 className="text-3d text-4xl md:text-5xl font-bold text-stone-900 dark:text-stone-50 leading-tight mb-5">
103
+ {headlineMain}
104
+ </h2>
105
+ </TextFade>
106
+
107
+ <TextFade direction="up" className="-mt-6" delay={0.3}>
108
+ <h2 className="text-3d text-4xl md:text-5xl font-bold text-stone-400 leading-tight mb-5">
109
+ {headlineAccent}
110
+ </h2>
111
+ </TextFade>
112
+
113
+ <TextFade direction="down" className="px-1" delay={0.5}>
114
+ {description && (
115
+ <p className="text-stone-700 dark:text-stone-300 text-base leading-relaxed">
116
+ {description}
117
+ </p>
118
+ )}
119
+ </TextFade>
120
+ </div>
121
+ {/* Services Grid */}
122
+ {serviceItems.length > 0 && (
123
+ <div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-5">
124
+ {serviceItems.map((svc, i) => (
125
+ <SpotlightCard
126
+ key={svc.id ?? i}
127
+ className="group bg-[#19171ca4] backdrop-blur-md rounded-3xl shadow-md hover:shadow-2xl hover:-translate-y-1 transition-all duration-300"
128
+ >
129
+ <div className="bg-dots h-full w-full shadow-inner brightness-90 absolute p-6 md:p-8">
130
+ {/* Icon Row */}
131
+ <div className="flex items-start justify-between mb-6">
132
+ <div className="w-12 h-12 flex items-center justify-center rounded-xl bg-stone-800/10 bg-lines border border-stone-600 group-hover:bg-stone-700 group-hover:scale-110 transition-all duration-300">
133
+ <DynamicIcon
134
+ className="text-stone-300 group-hover:text-lime-400 transition-colors duration-300"
135
+ name={svc.iconName}
136
+ size={20}
137
+ />
138
+ </div>
139
+
140
+ {svc.number && (
141
+ <span className="text-xs font-mono text-stone-400 group-hover:text-lime-400 transition-colors duration-300">
142
+ {svc.number}
143
+ </span>
144
+ )}
145
+ </div>
146
+ {/* Title */}
147
+ <h3 className="text-lg font-semibold text-stone-900 dark:text-stone-50 mb-3 group-hover:text-lime-300 transition-colors duration-300">
148
+ {svc.title}
149
+ </h3>
150
+ {/* Description */}
151
+ <p className="text-md text-stone-400 leading-relaxed mb-5 group-hover:text-stone-300 transition-colors duration-300">
152
+ {svc.description}
153
+ </p>
154
+ {/* Tags */}
155
+ {svc.tags && svc.tags.length > 0 && (
156
+ <div className="flex flex-wrap gap-2">
157
+ {svc.tags.map((t, ti) => (
158
+ <span
159
+ key={t.id ?? ti}
160
+ className="text-xs px-2.5 py-1 rounded-full bg-stone-800/10 bg-lines text-stone-400 border border-stone-700 group-hover:border-lime-500/40 group-hover:text-lime-300 transition-all duration-300"
161
+ >
162
+ {t.tag}
163
+ </span>
164
+ ))}
165
+ </div>
166
+ )}
167
+ </div>
168
+ </SpotlightCard>
169
+ ))}
170
+ </div>
171
+ )}
172
+ </div>
173
+ </div>
174
+ </>
175
+ )
176
+ }