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,155 +1,149 @@
1
- "use client";
2
- import React from "react";
3
- import * as LucideIcons from "lucide-react";
4
- import { motion, type Variants } from "framer-motion";
5
- export type DDProcessProps = Record<string, any>;
6
- type StepItem = {
7
- id?: string | null;
8
- iconName?: string | null;
9
- title?: string | null;
10
- description?: string | null;
11
- duration?: string | null;
12
- };
13
-
14
- function DynamicIcon({
15
- name,
16
- size = 24,
17
- ...props
18
- }: { name?: string | null } & Omit<LucideIcons.LucideProps, "name">) {
19
- if (!name) return null;
20
- const Icon = (
21
- LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>
22
- )[name];
23
- if (!Icon) return null;
24
- return <Icon size={size} {...props} />;
25
- }
26
-
27
- // Enumerate all possible classes so Tailwind doesn't purge them
28
- const gridColsMap: Record<number, string> = {
29
- 1: "lg:grid-cols-1",
30
- 2: "lg:grid-cols-2",
31
- 3: "lg:grid-cols-3",
32
- 4: "lg:grid-cols-4",
33
- 5: "lg:grid-cols-5",
34
- 6: "lg:grid-cols-6",
35
- };
36
-
37
- const containerVariants: Variants = {
38
- hidden: {},
39
- show: {
40
- transition: {
41
- staggerChildren: 0.1,
42
- delayChildren: 0.05,
43
- },
44
- },
45
- };
46
-
47
- const stepVariants: Variants = {
48
- hidden: { opacity: 0, y: 28 },
49
- show: { opacity: 1, y: 0, transition: { duration: 0.5, ease: "easeOut" } },
50
- };
51
-
52
- export const DDProcess: React.FC<DDProcessProps> = ({
53
- eyebrow,
54
- headlineMain,
55
- headlineAccent,
56
- description,
57
- steps,
58
- sectionId,
59
- customCSS,
60
- }) => {
61
- const stepItems = (steps ?? []) as StepItem[];
62
- const colCount = Math.min(stepItems.length || 4, 6);
63
- const lgCols = gridColsMap[colCount] ?? "lg:grid-cols-4";
64
-
65
- return (
66
- <>
67
- {customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
68
-
69
- <div id={sectionId ?? "process"} className="py-24">
70
- <div className="max-w-6xl lg:max-w-7xl mx-auto px-4 md:px-6">
71
- {/* Header */}
72
- <div className="text-center max-w-2xl mx-auto mb-16">
73
- {eyebrow && (
74
- <p className="text-[11.5px] font-semibold text-stone-400 tracking-widest uppercase mb-3 top-caption">
75
- {eyebrow}
76
- </p>
77
- )}
78
- <h2 className="text-3d text-4xl md:text-5xl font-bold text-stone-900 dark:text-stone-50 leading-tight mb-5">
79
- {headlineMain}
80
- <br />
81
- <span className="text-stone-400">{headlineAccent}</span>
82
- </h2>
83
- {description && (
84
- <p className="text-stone-700 dark:text-stone-300 text-base leading-relaxed">
85
- {description}
86
- </p>
87
- )}
88
- </div>
89
-
90
- {/* Steps */}
91
- {stepItems.length > 0 && (
92
- <div className="relative steps-container mb-4">
93
- {/* Single connector line spanning icon centres */}
94
- <div
95
- className="hidden lg:block absolute top-10 h-px bg-indigo-700 z-0"
96
- style={{
97
- left: `calc(100% / ${colCount} / 2)`,
98
- right: `calc(100% / ${colCount} / 2)`,
99
- }}
100
- />
101
-
102
- <motion.div
103
- className={`grid grid-cols-2 sm:grid-cols-2 ${lgCols} gap-8 sm:gap-6 relative z-10`}
104
- variants={containerVariants}
105
- initial="hidden"
106
- whileInView="show"
107
- viewport={{ once: false, amount: 0.2 }}
108
- >
109
- {stepItems.map((step, i) => (
110
- <motion.div
111
- key={step.id ?? i}
112
- className="flex flex-col items-start md:items-center text-left md:text-center justify-start md:justify-center p-4 border-zinc-700/0 border focus:outline-none group bg-lines rounded-md hover:rounded-lg hover:border hover:bg-stone-100 dark:hover:bg-stone-950/90 hover:shadow-2xl hover:border-indigo-500 duration-300 hover:duration-300 transition-all card-bottom-lit"
113
- variants={stepVariants}
114
- >
115
- {/* Circular icon with numbered badge */}
116
- <div className="w-20 h-20 mx-auto flex items-center justify-center rounded-full bg-stone-200 dark:bg-stone-900 border-2 border-indigo-700 group-hover:border-indigo-500 -border-stone-700 mb-5 relative shrink-0">
117
- <DynamicIcon
118
- className="dark:text-indigo-400 text-indigo-700 group-hover:dark:text-lime-400 duration-300 transition-all"
119
- name={step.iconName}
120
- size={24}
121
- />
122
- <span className="absolute -top-1 -right-1 w-6 h-6 flex items-center justify-center rounded-full bg-stone-200 dark:bg-stone-900 border border-indigo-700 text-[10px] font-mono text-indigo-700 dark:text-indigo-400">
123
- {i + 1}
124
- </span>
125
- </div>
126
-
127
- {/* Duration badge */}
128
- {step.duration && (
129
- <div className="inline-flex items-center gap-1 bg-7 bg-stone-800 border border-stone-700 rounded-full px-2.5 py-0.5 mb-3 group-hover:bg-indigo-800 group-hover:border-indigo-600 dark:group-hover:border-lime-500">
130
- <LucideIcons.Clock
131
- size={10}
132
- className="text-stone-300"
133
- />
134
- <span className="text-[10px] text-stone-300 font-medium">
135
- {step.duration}
136
- </span>
137
- </div>
138
- )}
139
-
140
- <h3 className="text-lg font-semibold text-stone-900 dark:text-stone-50 mb-2">
141
- {step.title}
142
- </h3>
143
- <p className="text-sm text-stone-700 dark:text-stone-300 leading-relaxed pb-8">
144
- {step.description}
145
- </p>
146
- </motion.div>
147
- ))}
148
- </motion.div>
149
- </div>
150
- )}
151
- </div>
152
- </div>
153
- </>
154
- );
155
- };
1
+ 'use client'
2
+ import React from 'react'
3
+ import * as LucideIcons from 'lucide-react'
4
+ import { motion, type Variants } from 'framer-motion'
5
+ export type DDProcessProps = Record<string, any>
6
+ type StepItem = {
7
+ id?: string | null
8
+ iconName?: string | null
9
+ title?: string | null
10
+ description?: string | null
11
+ duration?: string | null
12
+ }
13
+
14
+ function DynamicIcon({
15
+ name,
16
+ size = 24,
17
+ ...props
18
+ }: { name?: string | null } & Omit<LucideIcons.LucideProps, 'name'>) {
19
+ if (!name) return null
20
+ const Icon = (LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>)[name]
21
+ if (!Icon) return null
22
+ return <Icon size={size} {...props} />
23
+ }
24
+
25
+ // Enumerate all possible classes so Tailwind doesn't purge them
26
+ const gridColsMap: Record<number, string> = {
27
+ 1: 'lg:grid-cols-1',
28
+ 2: 'lg:grid-cols-2',
29
+ 3: 'lg:grid-cols-3',
30
+ 4: 'lg:grid-cols-4',
31
+ 5: 'lg:grid-cols-5',
32
+ 6: 'lg:grid-cols-6',
33
+ }
34
+
35
+ const containerVariants: Variants = {
36
+ hidden: {},
37
+ show: {
38
+ transition: {
39
+ staggerChildren: 0.1,
40
+ delayChildren: 0.05,
41
+ },
42
+ },
43
+ }
44
+
45
+ const stepVariants: Variants = {
46
+ hidden: { opacity: 0, y: 28 },
47
+ show: { opacity: 1, y: 0, transition: { duration: 0.5, ease: 'easeOut' } },
48
+ }
49
+
50
+ export const DDProcess: React.FC<DDProcessProps> = ({
51
+ eyebrow,
52
+ headlineMain,
53
+ headlineAccent,
54
+ description,
55
+ steps,
56
+ sectionId,
57
+ customCSS,
58
+ }) => {
59
+ const stepItems = (steps ?? []) as StepItem[]
60
+ const colCount = Math.min(stepItems.length || 4, 6)
61
+ const lgCols = gridColsMap[colCount] ?? 'lg:grid-cols-4'
62
+
63
+ return (
64
+ <>
65
+ {customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
66
+
67
+ <div id={sectionId ?? 'process'} className="py-24">
68
+ <div className="max-w-6xl lg:max-w-7xl mx-auto px-4 md:px-6">
69
+ {/* Header */}#BlockName-DDProcess
70
+ <div className="text-center max-w-2xl mx-auto mb-16">
71
+ {eyebrow && (
72
+ <p className="text-[11.5px] font-semibold text-stone-400 tracking-widest uppercase mb-3 top-caption">
73
+ {eyebrow}
74
+ </p>
75
+ )}
76
+ <h2 className="text-3d text-4xl md:text-5xl font-bold text-stone-900 dark:text-stone-50 leading-tight mb-5">
77
+ {headlineMain}
78
+ <br />
79
+ <span className="text-stone-400">{headlineAccent}</span>
80
+ </h2>
81
+ {description && (
82
+ <p className="text-stone-700 dark:text-stone-300 text-base leading-relaxed">
83
+ {description}
84
+ </p>
85
+ )}
86
+ </div>
87
+ {/* Steps */}
88
+ {stepItems.length > 0 && (
89
+ <div className="relative steps-container mb-4">
90
+ {/* Single connector line spanning icon centres */}
91
+ <div
92
+ className="hidden lg:block absolute top-10 h-px bg-indigo-700 z-0"
93
+ style={{
94
+ left: `calc(100% / ${colCount} / 2)`,
95
+ right: `calc(100% / ${colCount} / 2)`,
96
+ }}
97
+ />
98
+
99
+ <motion.div
100
+ className={`grid grid-cols-2 sm:grid-cols-2 ${lgCols} gap-8 sm:gap-6 relative z-10`}
101
+ variants={containerVariants}
102
+ initial="hidden"
103
+ whileInView="show"
104
+ viewport={{ once: false, amount: 0.2 }}
105
+ >
106
+ {stepItems.map((step, i) => (
107
+ <motion.div
108
+ key={step.id ?? i}
109
+ className="flex flex-col items-start md:items-center text-left md:text-center justify-start md:justify-center p-4 border-zinc-700/0 border focus:outline-none group bg-lines rounded-md hover:rounded-lg hover:border hover:bg-stone-100 dark:hover:bg-stone-950/90 hover:shadow-2xl hover:border-indigo-500 duration-300 hover:duration-300 transition-all card-bottom-lit"
110
+ variants={stepVariants}
111
+ >
112
+ {/* Circular icon with numbered badge */}
113
+ <div className="w-20 h-20 mx-auto flex items-center justify-center rounded-full bg-stone-200 dark:bg-stone-900 border-2 border-indigo-700 group-hover:border-indigo-500 -border-stone-700 mb-5 relative shrink-0">
114
+ <DynamicIcon
115
+ className="dark:text-indigo-400 text-indigo-700 group-hover:dark:text-lime-400 duration-300 transition-all"
116
+ name={step.iconName}
117
+ size={24}
118
+ />
119
+ <span className="absolute -top-1 -right-1 w-6 h-6 flex items-center justify-center rounded-full bg-stone-200 dark:bg-stone-900 border border-indigo-700 text-[10px] font-mono text-indigo-700 dark:text-indigo-400">
120
+ {i + 1}
121
+ </span>
122
+ </div>
123
+
124
+ {/* Duration badge */}
125
+ {step.duration && (
126
+ <div className="inline-flex items-center gap-1 bg-7 bg-stone-800 border border-stone-700 rounded-full px-2.5 py-0.5 mb-3 group-hover:bg-indigo-800 group-hover:border-indigo-600 dark:group-hover:border-lime-500">
127
+ <LucideIcons.Clock size={10} className="text-stone-300" />
128
+ <span className="text-[10px] text-stone-300 font-medium">
129
+ {step.duration}
130
+ </span>
131
+ </div>
132
+ )}
133
+
134
+ <h3 className="text-lg font-semibold text-stone-900 dark:text-stone-50 mb-2">
135
+ {step.title}
136
+ </h3>
137
+ <p className="text-sm text-stone-700 dark:text-stone-300 leading-relaxed pb-8">
138
+ {step.description}
139
+ </p>
140
+ </motion.div>
141
+ ))}
142
+ </motion.div>
143
+ </div>
144
+ )}
145
+ </div>
146
+ </div>
147
+ </>
148
+ )
149
+ }