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,51 +1,51 @@
1
- "use client";
2
- import React, { useRef, useState } from "react";
3
- import * as LucideIcons from "lucide-react";
4
- import { cn } from "@/utilities/ui";
5
- export type DDCardTemplate01Props = Record<string, any>;
1
+ 'use client'
2
+ import React, { useRef, useState } from 'react'
3
+ import * as LucideIcons from 'lucide-react'
4
+ import { cn } from '@/utilities/ui'
5
+ export type DDCardTemplate01Props = Record<string, any>
6
6
 
7
7
  // ─── SpotlightCard ────────────────────────────────────────────────────────────
8
8
  interface SpotlightCardProps {
9
- children: React.ReactNode;
10
- className?: string;
11
- spotlightColor?: string;
12
- enableTilt?: boolean;
13
- style?: React.CSSProperties;
9
+ children: React.ReactNode
10
+ className?: string
11
+ spotlightColor?: string
12
+ enableTilt?: boolean
13
+ style?: React.CSSProperties
14
14
  }
15
15
 
16
16
  function SpotlightCard({
17
17
  children,
18
18
  className,
19
- spotlightColor = "rgba(214,211,209,0.08)",
19
+ spotlightColor = 'rgba(214,211,209,0.08)',
20
20
  enableTilt = true,
21
21
  style,
22
22
  }: SpotlightCardProps) {
23
- const cardRef = useRef<HTMLDivElement>(null);
24
- const [pos, setPos] = useState<{ x: number; y: number } | null>(null);
25
- const [tilt, setTilt] = useState({ rx: 0, ry: 0 });
23
+ const cardRef = useRef<HTMLDivElement>(null)
24
+ const [pos, setPos] = useState<{ x: number; y: number } | null>(null)
25
+ const [tilt, setTilt] = useState({ rx: 0, ry: 0 })
26
26
 
27
27
  const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
28
- if (!cardRef.current) return;
29
- const rect = cardRef.current.getBoundingClientRect();
30
- const x = e.clientX - rect.left;
31
- const y = e.clientY - rect.top;
32
- setPos({ x, y });
28
+ if (!cardRef.current) return
29
+ const rect = cardRef.current.getBoundingClientRect()
30
+ const x = e.clientX - rect.left
31
+ const y = e.clientY - rect.top
32
+ setPos({ x, y })
33
33
  if (enableTilt) {
34
- const rx = (y / rect.height - 0.5) * -10;
35
- const ry = (x / rect.width - 0.5) * 10;
36
- setTilt({ rx, ry });
34
+ const rx = (y / rect.height - 0.5) * -10
35
+ const ry = (x / rect.width - 0.5) * 10
36
+ setTilt({ rx, ry })
37
37
  }
38
- };
38
+ }
39
39
 
40
40
  const handleMouseLeave = () => {
41
- setPos(null);
42
- setTilt({ rx: 0, ry: 0 });
43
- };
41
+ setPos(null)
42
+ setTilt({ rx: 0, ry: 0 })
43
+ }
44
44
 
45
45
  return (
46
46
  <div
47
47
  ref={cardRef}
48
- className={cn("relative overflow-hidden", className)}
48
+ className={cn('relative overflow-hidden', className)}
49
49
  onMouseMove={handleMouseMove}
50
50
  onMouseLeave={handleMouseLeave}
51
51
  style={
@@ -53,7 +53,7 @@ function SpotlightCard({
53
53
  ? {
54
54
  ...style,
55
55
  transform: `perspective(800px) rotateX(${tilt.rx}deg) rotateY(${tilt.ry}deg)`,
56
- transition: "transform 0.1s ease",
56
+ transition: 'transform 0.1s ease',
57
57
  }
58
58
  : style
59
59
  }
@@ -68,20 +68,18 @@ function SpotlightCard({
68
68
  )}
69
69
  <div className="relative z-10">{children}</div>
70
70
  </div>
71
- );
71
+ )
72
72
  }
73
73
 
74
74
  // ─── Dynamic Icon ─────────────────────────────────────────────────────────────
75
75
  function DynamicIcon({
76
76
  name,
77
77
  ...props
78
- }: { name?: string | null } & Omit<LucideIcons.LucideProps, "name">) {
79
- if (!name) return null;
80
- const Icon = (
81
- LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>
82
- )[name];
83
- if (!Icon) return null;
84
- return <Icon {...props} />;
78
+ }: { name?: string | null } & Omit<LucideIcons.LucideProps, 'name'>) {
79
+ if (!name) return null
80
+ const Icon = (LucideIcons as unknown as Record<string, React.FC<LucideIcons.LucideProps>>)[name]
81
+ if (!Icon) return null
82
+ return <Icon {...props} />
85
83
  }
86
84
 
87
85
  // ─── Component ────────────────────────────────────────────────────────────────
@@ -89,33 +87,31 @@ export const DDCardTemplate01: React.FC<DDCardTemplate01Props> = ({
89
87
  eyebrow,
90
88
  headline,
91
89
  description,
92
- iconName = "ShieldCheck",
93
- glowColor = "rgba(214,211,209,0.08)",
90
+ iconName = 'ShieldCheck',
91
+ glowColor = 'rgba(214,211,209,0.08)',
94
92
  enableTilt = true,
95
- minHeight = "220px",
93
+ minHeight = '220px',
96
94
  className,
97
95
  sectionId,
98
96
  customCSS,
99
97
  }) => {
100
98
  return (
101
- <div
102
- id={sectionId ?? undefined}
103
- className="spotlight-card overflow-clip py-8"
104
- >
99
+ <div id={sectionId ?? undefined} className="spotlight-card overflow-clip py-8">
105
100
  {customCSS && <style dangerouslySetInnerHTML={{ __html: customCSS }} />}
106
101
  <SpotlightCard
107
102
  spotlightColor={glowColor ?? undefined}
108
103
  enableTilt={enableTilt ?? true}
109
104
  className={cn(
110
- "border border-stone-50 dark:border-stone-950 bg-stone-100 dark:bg-stone-900 hover:shadow-2xl transition-all hover:transition-all duration-900 hover:duration-900 flex flex-col justify-between p-6 max-w-[100rem] mx-auto",
105
+ 'border border-stone-50 dark:border-stone-950 bg-stone-100 dark:bg-stone-900 hover:shadow-2xl transition-all hover:transition-all duration-900 hover:duration-900 flex flex-col justify-between p-6 max-w-[100rem] mx-auto',
111
106
  className,
112
107
  )}
113
- style={{ minHeight: minHeight ?? "220px" }}
108
+ style={{ minHeight: minHeight ?? '220px' }}
114
109
  >
110
+ #BlockName-DDCardTemplate01
115
111
  <div className="w-11 h-11 flex items-center justify-center rounded-xl border border-stone-300 text-stone-300 mb-6">
116
112
  <DynamicIcon
117
113
  className="text-stone-600 dark:text-stone-300"
118
- name={iconName ?? "ShieldCheck"}
114
+ name={iconName ?? 'ShieldCheck'}
119
115
  size={20}
120
116
  />
121
117
  </div>
@@ -138,7 +134,7 @@ export const DDCardTemplate01: React.FC<DDCardTemplate01Props> = ({
138
134
  </div>
139
135
  </SpotlightCard>
140
136
  </div>
141
- );
142
- };
137
+ )
138
+ }
143
139
 
144
- export default DDCardTemplate01;
140
+ export default DDCardTemplate01