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,272 +1,256 @@
1
- "use client";
2
-
3
- import React, { Fragment, useState } from "react";
4
- import { Check, Minus, Plus } from "lucide-react";
5
-
6
- type TierKey = "free" | "pro" | "team";
7
-
8
- type CellValue = boolean | string;
9
-
10
- interface FeatureRow {
11
- id?: string | null;
12
- label?: string | null;
13
- free?: CellValue | null;
14
- pro?: CellValue | null;
15
- team?: CellValue | null;
16
- }
17
-
18
- interface FeatureGroup {
19
- id?: string | null;
20
- group?: string | null;
21
- rows?: FeatureRow[] | null;
22
- }
23
-
24
- interface TierHeader {
25
- key: TierKey;
26
- label: string;
27
- highlight: boolean;
28
- }
29
-
30
- interface StudioComparisonTableProps {
31
- eyebrow?: string | null;
32
- heading?: string | null;
33
- defaultOpen?: boolean | null;
34
- groups?: FeatureGroup[] | null;
35
- sectionId?: string | null;
36
- customCSS?: string | null;
37
- [key: string]: unknown;
38
- }
39
-
40
- const DEFAULT_GROUPS: FeatureGroup[] = [
41
- {
42
- group: "Components & Templates",
43
- rows: [
44
- { label: "Free components", free: true, pro: true, team: true },
45
- { label: "Premium components", free: false, pro: "120+", team: "120+" },
46
- { label: "Free templates", free: true, pro: true, team: true },
47
- { label: "Premium templates", free: false, pro: "24+", team: "24+" },
48
- { label: "Payload CMS v3 blocks", free: false, pro: true, team: true },
49
- { label: "Figma source files", free: false, pro: true, team: true },
50
- ],
51
- },
52
- {
53
- group: "Licensing",
54
- rows: [
55
- { label: "Personal use", free: true, pro: true, team: true },
56
- {
57
- label: "Commercial projects",
58
- free: false,
59
- pro: "1 project",
60
- team: "Unlimited",
61
- },
62
- { label: "White-label license", free: false, pro: false, team: true },
63
- { label: "Client resale rights", free: false, pro: false, team: true },
64
- ],
65
- },
66
- {
67
- group: "Updates & Access",
68
- rows: [
69
- { label: "Lifetime updates", free: true, pro: true, team: true },
70
- {
71
- label: "Early access to new releases",
72
- free: false,
73
- pro: true,
74
- team: true,
75
- },
76
- { label: "Download source files", free: false, pro: true, team: true },
77
- ],
78
- },
79
- {
80
- group: "Support",
81
- rows: [
82
- { label: "Community Discord", free: true, pro: true, team: true },
83
- { label: "Priority email support", free: false, pro: true, team: true },
84
- { label: "Dedicated Slack channel", free: false, pro: false, team: true },
85
- { label: "1-on-1 onboarding call", free: false, pro: false, team: true },
86
- { label: "SLA support guarantee", free: false, pro: false, team: true },
87
- ],
88
- },
89
- {
90
- group: "Team",
91
- rows: [
92
- { label: "Team seats", free: "1", pro: "1", team: "Up to 10" },
93
- {
94
- label: "Invoice & billing management",
95
- free: false,
96
- pro: false,
97
- team: true,
98
- },
99
- {
100
- label: "Custom Payload CMS schemas",
101
- free: false,
102
- pro: false,
103
- team: true,
104
- },
105
- ],
106
- },
107
- ];
108
-
109
- function Cell({
110
- value,
111
- highlight,
112
- }: {
113
- value: CellValue | null | undefined;
114
- highlight: boolean;
115
- }) {
116
- if (typeof value === "string") {
117
- return (
118
- <span
119
- className={`text-sm font-medium ${highlight ? "text-indigo-900 dark:text-lime-400" : "text-stone-700 dark:text-stone-300"}`}
120
- >
121
- {value}
122
- </span>
123
- );
124
- }
125
-
126
- if (value === true) {
127
- return (
128
- <div
129
- className={`mx-auto flex h-5 w-5 items-center justify-center rounded-full ${
130
- highlight ? "bg-stone-900" : "bg-stone-800"
131
- }`}
132
- style={{ cornerShape: "squircle" } as React.CSSProperties}
133
- >
134
- <Check
135
- className={`h-3 w-3 ${highlight ? "text-stone-50" : "text-stone-300"}`}
136
- />
137
- </div>
138
- );
139
- }
140
-
141
- return (
142
- <div className="mx-auto flex h-5 w-5 items-center justify-center opacity-30">
143
- <Minus className="h-4 w-4 text-stone-600" />
144
- </div>
145
- );
146
- }
147
-
148
- export function DDComparisonTable({
149
- eyebrow = "Full breakdown",
150
- heading = "Compare all features",
151
- defaultOpen = true,
152
- groups,
153
- sectionId,
154
- }: StudioComparisonTableProps) {
155
- const [open, setOpen] = useState(defaultOpen !== false);
156
- const featureGroups = groups && groups.length > 0 ? groups : DEFAULT_GROUPS;
157
-
158
- const tiers: TierHeader[] = [
159
- { key: "free", label: "Free", highlight: false },
160
- { key: "pro", label: "Pro", highlight: true },
161
- { key: "team", label: "Team", highlight: false },
162
- ];
163
-
164
- return (
165
- <section
166
- id={sectionId ?? undefined}
167
- className="studio-comparison-table border-t border-stone-800 bg-transparent px-6 py-20"
168
- >
169
- <div className="mx-auto max-w-6xl">
170
- <button
171
- type="button"
172
- onClick={() => setOpen((current) => !current)}
173
- className="group mb-8 flex w-full cursor-pointer items-center justify-between gap-6 text-left"
174
- >
175
- <div>
176
- {eyebrow && (
177
- <p className="mb-1 text-xs font-semibold uppercase tracking-widest text-stone-500">
178
- {eyebrow}
179
- </p>
180
- )}
181
- {heading && (
182
- <h2 className="text-3xl font-semibold text-stone-900 dark:text-stone-50">
183
- {heading}
184
- </h2>
185
- )}
186
- </div>
187
-
188
- <div
189
- className="flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-stone-100 bg-stone-200 dark:border-stone-700 dark:bg-stone-800 transition-colors group-hover:border-stone-300 dark:group-hover:border-stone-500"
190
- style={{ cornerShape: "squircle" } as React.CSSProperties}
191
- >
192
- {open ? (
193
- <Minus className="h-4 w-4 text-stone-700 dark:text-stone-400 transition-transform duration-300" />
194
- ) : (
195
- <Plus className="h-4 w-4 text-stone-700 dark:text-stone-300 transition-transform duration-300" />
196
- )}
197
- </div>
198
- </button>
199
-
200
- {open && (
201
- <div className="overflow-x-auto">
202
- <table className="w-full min-w-160">
203
- <thead>
204
- <tr>
205
- <th className="w-1/2 pb-0 text-left" />
206
- {tiers.map((tier) => (
207
- <th key={tier.key} className="pb-0 text-center">
208
- <span
209
- className={`inline-block rounded-lg px-4 py-1.5 text-sm font-semibold ${
210
- tier.highlight
211
- ? "bg-stone-100 text-stone-900"
212
- : "border-stone-100 bg-stone-200 dark:border-stone-700 dark:bg-stone-800/50 transition-colors group-hover:border-stone-300 dark:group-hover:border-stone-500"
213
- }`}
214
- style={
215
- { cornerShape: "squircle" } as React.CSSProperties
216
- }
217
- >
218
- {tier.label}
219
- </span>
220
- </th>
221
- ))}
222
- </tr>
223
- </thead>
224
-
225
- <tbody>
226
- {featureGroups.map((group, groupIndex) => (
227
- <Fragment key={group.id ?? group.group ?? groupIndex}>
228
- <tr>
229
- <td colSpan={4} className="pb-3 pt-0">
230
- <span className="text-xs font-bold uppercase tracking-widest text-stone-500">
231
- {group.group}
232
- </span>
233
- </td>
234
- </tr>
235
-
236
- {(group.rows ?? []).map((row, rowIndex) => (
237
- <tr
238
- key={row.id ?? row.label ?? rowIndex}
239
- className={`border-t transition-colors hover:bg-stone-200/40 dark:hover:bg-stone-900/40 ${
240
- rowIndex === 0
241
- ? "border-stone-800"
242
- : "border-stone-800/50"
243
- }`}
244
- >
245
- <td className="py-3.5 pr-6">
246
- <span className="text-sm text-stone-400">
247
- {row.label}
248
- </span>
249
- </td>
250
-
251
- {tiers.map((tier) => (
252
- <td key={tier.key} className="py-3.5 text-center">
253
- <Cell
254
- value={row[tier.key]}
255
- highlight={tier.highlight}
256
- />
257
- </td>
258
- ))}
259
- </tr>
260
- ))}
261
- </Fragment>
262
- ))}
263
- </tbody>
264
- </table>
265
- </div>
266
- )}
267
- </div>
268
- </section>
269
- );
270
- }
271
-
272
- export default DDComparisonTable;
1
+ 'use client'
2
+
3
+ import React, { Fragment, useState } from 'react'
4
+ import { Check, Minus, Plus } from 'lucide-react'
5
+
6
+ type TierKey = 'free' | 'pro' | 'team'
7
+
8
+ type CellValue = boolean | string
9
+
10
+ interface FeatureRow {
11
+ id?: string | null
12
+ label?: string | null
13
+ free?: CellValue | null
14
+ pro?: CellValue | null
15
+ team?: CellValue | null
16
+ }
17
+
18
+ interface FeatureGroup {
19
+ id?: string | null
20
+ group?: string | null
21
+ rows?: FeatureRow[] | null
22
+ }
23
+
24
+ interface TierHeader {
25
+ key: TierKey
26
+ label: string
27
+ highlight: boolean
28
+ }
29
+
30
+ interface StudioComparisonTableProps {
31
+ eyebrow?: string | null
32
+ heading?: string | null
33
+ defaultOpen?: boolean | null
34
+ groups?: FeatureGroup[] | null
35
+ sectionId?: string | null
36
+ customCSS?: string | null
37
+ [key: string]: unknown
38
+ }
39
+
40
+ const DEFAULT_GROUPS: FeatureGroup[] = [
41
+ {
42
+ group: 'Components & Templates',
43
+ rows: [
44
+ { label: 'Free components', free: true, pro: true, team: true },
45
+ { label: 'Premium components', free: false, pro: '120+', team: '120+' },
46
+ { label: 'Free templates', free: true, pro: true, team: true },
47
+ { label: 'Premium templates', free: false, pro: '24+', team: '24+' },
48
+ { label: 'Payload CMS v3 blocks', free: false, pro: true, team: true },
49
+ { label: 'Figma source files', free: false, pro: true, team: true },
50
+ ],
51
+ },
52
+ {
53
+ group: 'Licensing',
54
+ rows: [
55
+ { label: 'Personal use', free: true, pro: true, team: true },
56
+ {
57
+ label: 'Commercial projects',
58
+ free: false,
59
+ pro: '1 project',
60
+ team: 'Unlimited',
61
+ },
62
+ { label: 'White-label license', free: false, pro: false, team: true },
63
+ { label: 'Client resale rights', free: false, pro: false, team: true },
64
+ ],
65
+ },
66
+ {
67
+ group: 'Updates & Access',
68
+ rows: [
69
+ { label: 'Lifetime updates', free: true, pro: true, team: true },
70
+ {
71
+ label: 'Early access to new releases',
72
+ free: false,
73
+ pro: true,
74
+ team: true,
75
+ },
76
+ { label: 'Download source files', free: false, pro: true, team: true },
77
+ ],
78
+ },
79
+ {
80
+ group: 'Support',
81
+ rows: [
82
+ { label: 'Community Discord', free: true, pro: true, team: true },
83
+ { label: 'Priority email support', free: false, pro: true, team: true },
84
+ { label: 'Dedicated Slack channel', free: false, pro: false, team: true },
85
+ { label: '1-on-1 onboarding call', free: false, pro: false, team: true },
86
+ { label: 'SLA support guarantee', free: false, pro: false, team: true },
87
+ ],
88
+ },
89
+ {
90
+ group: 'Team',
91
+ rows: [
92
+ { label: 'Team seats', free: '1', pro: '1', team: 'Up to 10' },
93
+ {
94
+ label: 'Invoice & billing management',
95
+ free: false,
96
+ pro: false,
97
+ team: true,
98
+ },
99
+ {
100
+ label: 'Custom Payload CMS schemas',
101
+ free: false,
102
+ pro: false,
103
+ team: true,
104
+ },
105
+ ],
106
+ },
107
+ ]
108
+
109
+ function Cell({ value, highlight }: { value: CellValue | null | undefined; highlight: boolean }) {
110
+ if (typeof value === 'string') {
111
+ return (
112
+ <span
113
+ className={`text-sm font-medium ${highlight ? 'text-indigo-900 dark:text-lime-400' : 'text-stone-700 dark:text-stone-300'}`}
114
+ >
115
+ {value}
116
+ </span>
117
+ )
118
+ }
119
+
120
+ if (value === true) {
121
+ return (
122
+ <div
123
+ className={`mx-auto flex h-5 w-5 items-center justify-center rounded-full ${
124
+ highlight ? 'bg-stone-900' : 'bg-stone-800'
125
+ }`}
126
+ style={{ cornerShape: 'squircle' } as React.CSSProperties}
127
+ >
128
+ <Check className={`h-3 w-3 ${highlight ? 'text-stone-50' : 'text-stone-300'}`} />
129
+ </div>
130
+ )
131
+ }
132
+
133
+ return (
134
+ <div className="mx-auto flex h-5 w-5 items-center justify-center opacity-30">
135
+ <Minus className="h-4 w-4 text-stone-600" />
136
+ </div>
137
+ )
138
+ }
139
+
140
+ export function DDComparisonTable({
141
+ eyebrow = 'Full breakdown',
142
+ heading = 'Compare all features',
143
+ defaultOpen = true,
144
+ groups,
145
+ sectionId,
146
+ }: StudioComparisonTableProps) {
147
+ const [open, setOpen] = useState(defaultOpen !== false)
148
+ const featureGroups = groups && groups.length > 0 ? groups : DEFAULT_GROUPS
149
+
150
+ const tiers: TierHeader[] = [
151
+ { key: 'free', label: 'Free', highlight: false },
152
+ { key: 'pro', label: 'Pro', highlight: true },
153
+ { key: 'team', label: 'Team', highlight: false },
154
+ ]
155
+
156
+ return (
157
+ <section
158
+ id={sectionId ?? undefined}
159
+ className="studio-comparison-table border-t border-stone-800 bg-transparent px-6 py-20"
160
+ >
161
+ <div className="mx-auto max-w-6xl">
162
+ #BlockName-DDComparisonTable
163
+ <button
164
+ type="button"
165
+ onClick={() => setOpen((current) => !current)}
166
+ className="group mb-8 flex w-full cursor-pointer items-center justify-between gap-6 text-left"
167
+ >
168
+ <div>
169
+ {eyebrow && (
170
+ <p className="mb-1 text-xs font-semibold uppercase tracking-widest text-stone-500">
171
+ {eyebrow}
172
+ </p>
173
+ )}
174
+ {heading && (
175
+ <h2 className="text-3xl font-semibold text-stone-900 dark:text-stone-50">
176
+ {heading}
177
+ </h2>
178
+ )}
179
+ </div>
180
+
181
+ <div
182
+ className="flex h-9 w-9 shrink-0 items-center justify-center rounded-xl border border-stone-100 bg-stone-200 dark:border-stone-700 dark:bg-stone-800 transition-colors group-hover:border-stone-300 dark:group-hover:border-stone-500"
183
+ style={{ cornerShape: 'squircle' } as React.CSSProperties}
184
+ >
185
+ {open ? (
186
+ <Minus className="h-4 w-4 text-stone-700 dark:text-stone-400 transition-transform duration-300" />
187
+ ) : (
188
+ <Plus className="h-4 w-4 text-stone-700 dark:text-stone-300 transition-transform duration-300" />
189
+ )}
190
+ </div>
191
+ </button>
192
+
193
+ {open && (
194
+ <div className="overflow-x-auto">
195
+ <table className="w-full min-w-160">
196
+ <thead>
197
+ <tr>
198
+ <th className="w-1/2 pb-0 text-left" />
199
+ {tiers.map((tier) => (
200
+ <th key={tier.key} className="pb-0 text-center">
201
+ <span
202
+ className={`inline-block rounded-lg px-4 py-1.5 text-sm font-semibold ${
203
+ tier.highlight
204
+ ? 'bg-stone-100 text-stone-900'
205
+ : 'border-stone-100 bg-stone-200 dark:border-stone-700 dark:bg-stone-800/50 transition-colors group-hover:border-stone-300 dark:group-hover:border-stone-500'
206
+ }`}
207
+ style={{ cornerShape: 'squircle' } as React.CSSProperties}
208
+ >
209
+ {tier.label}
210
+ </span>
211
+ </th>
212
+ ))}
213
+ </tr>
214
+ </thead>
215
+
216
+ <tbody>
217
+ {featureGroups.map((group, groupIndex) => (
218
+ <Fragment key={group.id ?? group.group ?? groupIndex}>
219
+ <tr>
220
+ <td colSpan={4} className="pb-3 pt-0">
221
+ <span className="text-xs font-bold uppercase tracking-widest text-stone-500">
222
+ {group.group}
223
+ </span>
224
+ </td>
225
+ </tr>
226
+
227
+ {(group.rows ?? []).map((row, rowIndex) => (
228
+ <tr
229
+ key={row.id ?? row.label ?? rowIndex}
230
+ className={`border-t transition-colors hover:bg-stone-200/40 dark:hover:bg-stone-900/40 ${
231
+ rowIndex === 0 ? 'border-stone-800' : 'border-stone-800/50'
232
+ }`}
233
+ >
234
+ <td className="py-3.5 pr-6">
235
+ <span className="text-sm text-stone-400">{row.label}</span>
236
+ </td>
237
+
238
+ {tiers.map((tier) => (
239
+ <td key={tier.key} className="py-3.5 text-center">
240
+ <Cell value={row[tier.key]} highlight={tier.highlight} />
241
+ </td>
242
+ ))}
243
+ </tr>
244
+ ))}
245
+ </Fragment>
246
+ ))}
247
+ </tbody>
248
+ </table>
249
+ </div>
250
+ )}
251
+ </div>
252
+ </section>
253
+ )
254
+ }
255
+
256
+ export default DDComparisonTable