blocks-dusted 0.1.0

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 (102) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +68 -0
  3. package/bin/index.js +8 -0
  4. package/package.json +40 -0
  5. package/src/cli.js +79 -0
  6. package/src/commands/add.js +327 -0
  7. package/src/commands/doctor.js +21 -0
  8. package/src/commands/list.js +18 -0
  9. package/src/installers/checkRequirements.js +101 -0
  10. package/src/installers/copyTemplateFiles.js +79 -0
  11. package/src/installers/installDependencies.js +69 -0
  12. package/src/installers/patchPayloadBlocksArray.js +122 -0
  13. package/src/installers/patchRenderBlocks.js +110 -0
  14. package/src/installers/runGenerators.js +3 -0
  15. package/src/installers/writeInstalledBlockReadme.js +117 -0
  16. package/src/registry/listTemplates.js +17 -0
  17. package/src/registry/loadTemplateManifest.js +20 -0
  18. package/src/registry/validateTemplateManifest.js +69 -0
  19. package/src/utils/logger.js +8 -0
  20. package/src/utils/packageManager.js +42 -0
  21. package/src/utils/paths.js +7 -0
  22. package/src/utils/project.js +122 -0
  23. package/src/utils/strings.js +7 -0
  24. package/templates/blocks/DD-BookCall/Component.tsx +573 -0
  25. package/templates/blocks/DD-BookCall/config.ts +239 -0
  26. package/templates/blocks/DD-BookCall/manifest.json +112 -0
  27. package/templates/blocks/DD-CardTemplate01/Component.tsx +144 -0
  28. package/templates/blocks/DD-CardTemplate01/config.ts +106 -0
  29. package/templates/blocks/DD-CardTemplate01/manifest.json +84 -0
  30. package/templates/blocks/DD-Carousel-A/Component.tsx +266 -0
  31. package/templates/blocks/DD-Carousel-A/config.ts +163 -0
  32. package/templates/blocks/DD-Carousel-A/manifest.json +86 -0
  33. package/templates/blocks/DD-Carousel-B/Component.tsx +432 -0
  34. package/templates/blocks/DD-Carousel-B/config.ts +176 -0
  35. package/templates/blocks/DD-Carousel-B/manifest.json +86 -0
  36. package/templates/blocks/DD-ComparisonTable/Component.tsx +272 -0
  37. package/templates/blocks/DD-ComparisonTable/config.ts +105 -0
  38. package/templates/blocks/DD-ComparisonTable/manifest.json +78 -0
  39. package/templates/blocks/DD-Contact/Component.tsx +439 -0
  40. package/templates/blocks/DD-Contact/config.ts +217 -0
  41. package/templates/blocks/DD-Contact/manifest.json +107 -0
  42. package/templates/blocks/DD-FeatCat/Component.tsx +361 -0
  43. package/templates/blocks/DD-FeatCat/config.ts +204 -0
  44. package/templates/blocks/DD-FeatCat/manifest.json +87 -0
  45. package/templates/blocks/DD-FeatStrip/Component.tsx +615 -0
  46. package/templates/blocks/DD-FeatStrip/config.ts +134 -0
  47. package/templates/blocks/DD-FeatStrip/manifest.json +82 -0
  48. package/templates/blocks/DD-Hero/Component.tsx +317 -0
  49. package/templates/blocks/DD-Hero/config.ts +267 -0
  50. package/templates/blocks/DD-Hero/manifest.json +92 -0
  51. package/templates/blocks/DD-HorizontalScroll/Component.tsx +995 -0
  52. package/templates/blocks/DD-HorizontalScroll/config.ts +231 -0
  53. package/templates/blocks/DD-HorizontalScroll/manifest.json +85 -0
  54. package/templates/blocks/DD-MasonaryMedia/Component.tsx +571 -0
  55. package/templates/blocks/DD-MasonaryMedia/config.ts +390 -0
  56. package/templates/blocks/DD-MasonaryMedia/manifest.json +101 -0
  57. package/templates/blocks/DD-MasonaryMedia/vendor.d.ts +2 -0
  58. package/templates/blocks/DD-Pricing/Component.tsx +380 -0
  59. package/templates/blocks/DD-Pricing/config.ts +215 -0
  60. package/templates/blocks/DD-Pricing/manifest.json +78 -0
  61. package/templates/blocks/DD-Process/Component.tsx +155 -0
  62. package/templates/blocks/DD-Process/config.ts +150 -0
  63. package/templates/blocks/DD-Process/manifest.json +82 -0
  64. package/templates/blocks/DD-Section/Component.tsx +327 -0
  65. package/templates/blocks/DD-Section/config.ts +214 -0
  66. package/templates/blocks/DD-Section/manifest.json +85 -0
  67. package/templates/blocks/DD-Services/Component.tsx +188 -0
  68. package/templates/blocks/DD-Services/config.ts +149 -0
  69. package/templates/blocks/DD-Services/manifest.json +95 -0
  70. package/templates/blocks/DD-ShowcaseGrid/Component.tsx +317 -0
  71. package/templates/blocks/DD-ShowcaseGrid/config.ts +197 -0
  72. package/templates/blocks/DD-ShowcaseGrid/manifest.json +80 -0
  73. package/templates/blocks/DD-Slider-A/Component.tsx +252 -0
  74. package/templates/blocks/DD-Slider-A/config.ts +118 -0
  75. package/templates/blocks/DD-Slider-A/manifest.json +86 -0
  76. package/templates/blocks/DD-StackCards/Component.tsx +496 -0
  77. package/templates/blocks/DD-StackCards/config.ts +399 -0
  78. package/templates/blocks/DD-StackCards/manifest.json +87 -0
  79. package/templates/blocks/DD-Team/Component.tsx +265 -0
  80. package/templates/blocks/DD-Team/config.ts +173 -0
  81. package/templates/blocks/DD-Team/manifest.json +82 -0
  82. package/templates/blocks/DD-TechStack/Component.tsx +189 -0
  83. package/templates/blocks/DD-TechStack/config.ts +153 -0
  84. package/templates/blocks/DD-TechStack/manifest.json +118 -0
  85. package/templates/blocks/DD-Testimonials/Component.tsx +147 -0
  86. package/templates/blocks/DD-Testimonials/config.ts +120 -0
  87. package/templates/blocks/DD-Testimonials/manifest.json +87 -0
  88. package/templates/blocks/DD-Work/Component.tsx +328 -0
  89. package/templates/blocks/DD-Work/config.ts +165 -0
  90. package/templates/blocks/DD-Work/manifest.json +87 -0
  91. package/templates/blocks/DD-Work-B/Component.tsx +320 -0
  92. package/templates/blocks/DD-Work-B/config.ts +165 -0
  93. package/templates/blocks/DD-Work-B/manifest.json +75 -0
  94. package/templates/shared/components/ui/anims/fade.tsx +83 -0
  95. package/templates/shared/components/ui/button.tsx +233 -0
  96. package/templates/shared/components/ui/input.tsx +41 -0
  97. package/templates/shared/fields/lucide-icon-picker/Cell.tsx +24 -0
  98. package/templates/shared/fields/lucide-icon-picker/README.md +160 -0
  99. package/templates/shared/fields/lucide-icon-picker/field.ts +40 -0
  100. package/templates/shared/fields/lucide-icon-picker/index.tsx +203 -0
  101. package/templates/shared/utilities/canUseDOM.ts +1 -0
  102. package/templates/shared/utilities/getURL.ts +31 -0
@@ -0,0 +1,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 = (
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
+ };
@@ -0,0 +1,149 @@
1
+ import type { Block } from 'payload'
2
+
3
+ export const DDServices: Block = {
4
+ slug: 'DD-Services',
5
+ interfaceName: 'DDServices',
6
+ labels: {
7
+ singular: 'Studio Services',
8
+ plural: 'Studio Services Sections'
9
+ },
10
+ fields: [
11
+ {
12
+ type: 'tabs',
13
+ tabs: [
14
+ {
15
+ label: 'Header',
16
+ fields: [
17
+ {
18
+ name: 'eyebrow',
19
+ type: 'text',
20
+ label: 'Eyebrow Label',
21
+ defaultValue: 'What We Do'
22
+ },
23
+ {
24
+ name: 'headlineMain',
25
+ type: 'text',
26
+ label: 'Headline (Main)',
27
+ defaultValue: 'Services built for',
28
+ required: true
29
+ },
30
+ {
31
+ name: 'headlineAccent',
32
+ type: 'text',
33
+ label: 'Headline (Accent / Second Line)',
34
+ defaultValue: 'modern teams',
35
+ required: true
36
+ },
37
+ {
38
+ name: 'description',
39
+ type: 'textarea',
40
+ label: 'Description',
41
+ defaultValue:
42
+ 'We specialize in the intersection of design and engineering — where beautiful interfaces meet robust, scalable code.'
43
+ }
44
+ ]
45
+ },
46
+ {
47
+ label: 'Services',
48
+ fields: [
49
+ {
50
+ name: 'services',
51
+ type: 'array',
52
+ label: 'Services',
53
+ minRows: 1,
54
+ fields: [
55
+ {
56
+ name: 'iconName',
57
+ type: 'text',
58
+ label: 'Lucide Icon Name',
59
+ required: true,
60
+ admin: {
61
+ description: 'e.g. PenTool, Code2, Database, Lightbulb, Zap, RefreshCw'
62
+ }
63
+ },
64
+ {
65
+ name: 'number',
66
+ type: 'text',
67
+ label: 'Number Label',
68
+ admin: {
69
+ description: 'e.g. 01, 02 — displayed top right of the card'
70
+ }
71
+ },
72
+ {
73
+ name: 'title',
74
+ type: 'text',
75
+ label: 'Title',
76
+ required: true
77
+ },
78
+ {
79
+ name: 'description',
80
+ type: 'textarea',
81
+ label: 'Description',
82
+ required: true
83
+ },
84
+ {
85
+ name: 'tags',
86
+ type: 'array',
87
+ label: 'Tags',
88
+ fields: [
89
+ {
90
+ name: 'tag',
91
+ type: 'text',
92
+ label: 'Tag',
93
+ required: true
94
+ }
95
+ ]
96
+ }
97
+ ],
98
+ defaultValue: [
99
+ {
100
+ iconName: 'PenTool',
101
+ number: '01',
102
+ title: 'UX/UI Design',
103
+ description:
104
+ 'User research, wireframing, prototyping, and high-fidelity design systems built for developer handoff.',
105
+ tags: [
106
+ { tag: 'Figma' },
107
+ { tag: 'Design Systems' },
108
+ { tag: 'Prototyping' },
109
+ { tag: 'User Research' }
110
+ ]
111
+ },
112
+ {
113
+ iconName: 'Code2',
114
+ number: '02',
115
+ title: 'Web Application Development',
116
+ description:
117
+ 'Full-stack Next.js applications with Payload CMS, TypeScript, and modern deployment pipelines.',
118
+ tags: [
119
+ { tag: 'Next.js' },
120
+ { tag: 'TypeScript' },
121
+ { tag: 'Payload CMS' },
122
+ { tag: 'Vercel' }
123
+ ]
124
+ }
125
+ ]
126
+ }
127
+ ]
128
+ },
129
+ {
130
+ label: 'Settings',
131
+ fields: [
132
+ {
133
+ name: 'sectionId',
134
+ type: 'text',
135
+ label: 'Section ID',
136
+ defaultValue: 'services'
137
+ },
138
+ {
139
+ name: 'customCSS',
140
+ type: 'code',
141
+ label: 'Custom CSS',
142
+ admin: { language: 'css' }
143
+ }
144
+ ]
145
+ }
146
+ ]
147
+ }
148
+ ]
149
+ }
@@ -0,0 +1,95 @@
1
+ {
2
+ "type": "block",
3
+ "name": "DD-Services",
4
+ "label": "Studio Services Block",
5
+ "sourceName": "StudioServicesBlock",
6
+ "portableName": "DD-Services",
7
+ "slug": "DD-Services",
8
+ "version": "0.0.1",
9
+ "source": {
10
+ "repo": "Hadizainal/DesignsDustedv3",
11
+ "originalPath": "src/blocks/StudioServicesBlock",
12
+ "originalSlug": "studioServicesBlock",
13
+ "originalConfigExport": "StudioServicesBlock",
14
+ "originalComponentExport": "StudioServicesBlock",
15
+ "originalInterfaceName": "StudioServicesBlock"
16
+ },
17
+ "files": [
18
+ {
19
+ "from": "Component.tsx",
20
+ "to": "src/blocks/DD-Services/Component.tsx"
21
+ },
22
+ {
23
+ "from": "config.ts",
24
+ "to": "src/blocks/DD-Services/config.ts"
25
+ }
26
+ ],
27
+ "dependencies": [
28
+ {
29
+ "name": "framer-motion"
30
+ },
31
+ {
32
+ "name": "lucide-react"
33
+ }
34
+ ],
35
+ "sharedFiles": [
36
+ {
37
+ "from": "templates/shared/components/ui/anims/fade.tsx",
38
+ "to": "src/components/ui/anims/fade.tsx",
39
+ "required": true,
40
+ "safeToCopy": true
41
+ }
42
+ ],
43
+ "requiredProjectFiles": [
44
+ {
45
+ "path": "src/utilities/ui.ts",
46
+ "reason": "Block uses cn from @/utilities/ui."
47
+ }
48
+ ],
49
+ "optionalProjectFiles": [],
50
+ "collectionRegistration": {
51
+ "enabled": true,
52
+ "collections": [
53
+ "Pages",
54
+ "Posts"
55
+ ]
56
+ },
57
+ "renderBlocksRegistration": {
58
+ "enabled": true
59
+ },
60
+ "renderBlocksBehavior": {
61
+ "wrapperless": false
62
+ },
63
+ "pageRouteIntegration": {
64
+ "required": false,
65
+ "manualSteps": []
66
+ },
67
+ "manual": [
68
+ "Register DDServices in Pages/Posts blocks arrays if automatic registration was skipped.",
69
+ "Register DD-Services in RenderBlocks if automatic registration was skipped.",
70
+ "Run payload generate:types after schema changes.",
71
+ "Run payload generate:importmap if admin/component imports changed."
72
+ ],
73
+ "manualSteps": [
74
+ "Register DDServices in Pages/Posts blocks arrays if automatic registration was skipped.",
75
+ "Register DD-Services in RenderBlocks if automatic registration was skipped.",
76
+ "Run payload generate:types after schema changes.",
77
+ "Run payload generate:importmap if admin/component imports changed."
78
+ ],
79
+ "patchTargets": {
80
+ "blockConfigRegistration": {
81
+ "description": "Installer can add import { DDServices } from '@/blocks/DD-Services/config' and add DDServices to clear Pages/Posts blocks arrays."
82
+ },
83
+ "renderBlocksRegistration": {
84
+ "description": "Installer can register DD-Services in src/blocks/**/RenderBlocks.tsx when the blockComponents map is clear."
85
+ }
86
+ },
87
+ "notes": [
88
+ "Converted from DesignsDustedv3 StudioServicesBlock.",
89
+ "Generated Payload type imports are replaced with portable fallback types when needed.",
90
+ "Installer must not overwrite existing target files.",
91
+ "Includes shared TextFade animation component because component imports @/components/ui/anims/fade."
92
+ ],
93
+ "exportName": "DDServices",
94
+ "interfaceName": "DDServices"
95
+ }