blocks-dusted 0.1.11 → 0.1.13

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 (161) hide show
  1. package/package.json +5 -2
  2. package/src/cli.js +39 -3
  3. package/src/commands/shop.js +59 -0
  4. package/src/commands/warehouse.js +73 -0
  5. package/src/installers/patchRenderBlocks.js +1 -1
  6. package/src/registry/validateTemplateManifest.js +2 -1
  7. package/templates/blocks/BannerDD790432/Component.tsx +63 -0
  8. package/templates/blocks/BannerDD790432/config.ts +54 -0
  9. package/templates/blocks/BannerDD790432/manifest.json +80 -0
  10. package/templates/blocks/Button47/Component.tsx +124 -0
  11. package/templates/blocks/Button47/config.ts +75 -0
  12. package/templates/blocks/Button47/link.ts +22 -0
  13. package/templates/blocks/Button47/manifest.json +105 -0
  14. package/templates/blocks/Button47/styles.module.scss +75 -0
  15. package/templates/blocks/DD-Accordion/Component.tsx +55 -36
  16. package/templates/blocks/DD-Accordion/config.ts +71 -59
  17. package/templates/blocks/DD-AnimText/Component.tsx +50 -32
  18. package/templates/blocks/DD-AnimText/config.ts +296 -295
  19. package/templates/blocks/DD-AsideNav/Component.tsx +323 -319
  20. package/templates/blocks/DD-Banner/Component.tsx +54 -51
  21. package/templates/blocks/DD-BookCall/Component.tsx +10 -9
  22. package/templates/blocks/DD-ButtonPop/Component.tsx +118 -117
  23. package/templates/blocks/DD-Card/Component.tsx +4 -4
  24. package/templates/blocks/DD-CardTemplate01/Component.tsx +5 -5
  25. package/templates/blocks/DD-CardsWithVariantV3/Component.tsx +472 -0
  26. package/templates/blocks/DD-CardsWithVariantV3/ElectricBorder/index.tsx +203 -0
  27. package/templates/blocks/DD-CardsWithVariantV3/ElectricBorder/styles.ts +87 -0
  28. package/templates/blocks/DD-CardsWithVariantV3/ElectricBorder/useInjectStyle.ts +39 -0
  29. package/templates/blocks/DD-CardsWithVariantV3/config.ts +326 -0
  30. package/templates/blocks/DD-CardsWithVariantV3/manifest.json +110 -0
  31. package/templates/blocks/DD-Carousel-A/Component.tsx +251 -249
  32. package/templates/blocks/DD-Carousel-B/Component.tsx +405 -403
  33. package/templates/blocks/DD-Chip/Component.tsx +14 -14
  34. package/templates/blocks/DD-ComparisonTable/Component.tsx +255 -256
  35. package/templates/blocks/DD-Contact/Component.tsx +433 -434
  36. package/templates/blocks/DD-Counter/Component.tsx +18 -13
  37. package/templates/blocks/DD-DeliCard/Component.tsx +303 -0
  38. package/templates/blocks/DD-DeliCard/config.ts +186 -0
  39. package/templates/blocks/DD-DeliCard/manifest.json +94 -0
  40. package/templates/blocks/DD-FeatCat/Component.tsx +302 -302
  41. package/templates/blocks/DD-FeatProd/CircularGallery.tsx +1179 -0
  42. package/templates/blocks/DD-FeatProd/Component.tsx +484 -0
  43. package/templates/blocks/DD-FeatProd/config.ts +173 -0
  44. package/templates/blocks/DD-FeatProd/manifest.json +93 -0
  45. package/templates/blocks/DD-FeatServ/Component.tsx +607 -0
  46. package/templates/blocks/DD-FeatServ/config.ts +213 -0
  47. package/templates/blocks/DD-FeatServ/manifest.json +113 -0
  48. package/templates/blocks/DD-FeatStrip/Component.tsx +584 -585
  49. package/templates/blocks/DD-FluidBtn/ButtonsEyeCatching.tsx +627 -628
  50. package/templates/blocks/DD-FluidBtn/Component.tsx +46 -43
  51. package/templates/blocks/DD-GooeyInfo/Component.tsx +150 -149
  52. package/templates/blocks/DD-GooeyInfo/config.ts +136 -135
  53. package/templates/blocks/DD-Hero/Component.tsx +16 -40
  54. package/templates/blocks/DD-HeroPlas/Component.tsx +50 -0
  55. package/templates/blocks/DD-HeroPlas/ThreeScene.tsx +109 -0
  56. package/templates/blocks/DD-HeroPlas/config.ts +33 -0
  57. package/templates/blocks/DD-HeroPlas/manifest.json +88 -0
  58. package/templates/blocks/DD-HorizontalScroll/Component.tsx +4 -5
  59. package/templates/blocks/DD-Icon/Component.tsx +46 -81
  60. package/templates/blocks/DD-IconButton/Component.tsx +13 -20
  61. package/templates/blocks/DD-IdTag/Component.tsx +22 -21
  62. package/templates/blocks/DD-IframeMedia/Component.tsx +14 -10
  63. package/templates/blocks/DD-LineAnim/Component.tsx +42 -36
  64. package/templates/blocks/DD-LogoMarq/Component.tsx +38 -48
  65. package/templates/blocks/DD-Lottie/Component.tsx +11 -3
  66. package/templates/blocks/DD-MasonaryMedia/Component.tsx +544 -547
  67. package/templates/blocks/DD-MasonaryMedia/config.ts +389 -389
  68. package/templates/blocks/DD-Masonry/Component.tsx +654 -644
  69. package/templates/blocks/DD-Masonry/config.ts +475 -475
  70. package/templates/blocks/DD-MaterialSwatches/Component.tsx +85 -0
  71. package/templates/blocks/DD-MaterialSwatches/config.ts +232 -0
  72. package/templates/blocks/DD-MaterialSwatches/manifest.json +84 -0
  73. package/templates/blocks/DD-MaterialSwatches/material.ts +107 -0
  74. package/templates/blocks/DD-NineCanvas/Component.tsx +129 -0
  75. package/templates/blocks/DD-NineCanvas/RenderBlocks.tsx +244 -0
  76. package/templates/blocks/DD-NineCanvas/allowedCanvasBlocks.ts +6 -0
  77. package/templates/blocks/DD-NineCanvas/blockComponents.tsx +8 -0
  78. package/templates/blocks/DD-NineCanvas/canvas/CanvasGrid.tsx +316 -0
  79. package/templates/blocks/DD-NineCanvas/canvas/RadialNav.tsx +432 -0
  80. package/templates/blocks/DD-NineCanvas/canvas/canvas-panels.css +889 -0
  81. package/templates/blocks/DD-NineCanvas/canvas/icons/custom-icons.tsx +364 -0
  82. package/templates/blocks/DD-NineCanvas/config.ts +61 -0
  83. package/templates/blocks/DD-NineCanvas/manifest.json +165 -0
  84. package/templates/blocks/DD-NineCanvas/styles.scss +152 -0
  85. package/templates/blocks/DD-NineCanvas/tooltip/get-strict-context.tsx +26 -0
  86. package/templates/blocks/DD-NineCanvas/tooltip/primitives.tsx +178 -0
  87. package/templates/blocks/DD-NineCanvas/tooltip/tooltip.tsx +71 -0
  88. package/templates/blocks/DD-NineCanvas/tooltip/use-controlled-state.tsx +33 -0
  89. package/templates/blocks/DD-NineCanvas/utilities/FadeOnScroll.tsx +68 -0
  90. package/templates/blocks/DD-NineCanvas/utilities/ParallaxWrapper.tsx +157 -0
  91. package/templates/blocks/DD-NineCanvas/utilities/renderCustomCSS.ts +5 -0
  92. package/templates/blocks/DD-NineCanvas/utilities/webglCleanup.ts +27 -0
  93. package/templates/blocks/DD-PayloadAIAssistant/Component.tsx +78 -0
  94. package/templates/blocks/DD-PayloadAIAssistant/DustedBot.tsx +590 -0
  95. package/templates/blocks/DD-PayloadAIAssistant/config.ts +37 -0
  96. package/templates/blocks/DD-PayloadAIAssistant/demo.css +125 -0
  97. package/templates/blocks/DD-PayloadAIAssistant/manifest.json +93 -0
  98. package/templates/blocks/DD-PayloadAIAssistant/source-defaults.ts +17 -0
  99. package/templates/blocks/DD-PayloadAIAssistant/styles.ts +306 -0
  100. package/templates/blocks/DD-Pricing/Component.tsx +368 -372
  101. package/templates/blocks/DD-Pricing/config.ts +215 -215
  102. package/templates/blocks/DD-Process/Component.tsx +147 -149
  103. package/templates/blocks/DD-Progress/Component.tsx +156 -141
  104. package/templates/blocks/DD-ProjHeader/Component.tsx +93 -91
  105. package/templates/blocks/DD-ProjSlider/Component.tsx +1 -1
  106. package/templates/blocks/DD-ProjSlider/config.ts +2 -2
  107. package/templates/blocks/DD-Section/Component.tsx +265 -266
  108. package/templates/blocks/DD-Separator/Component.tsx +66 -66
  109. package/templates/blocks/DD-Services/Component.tsx +176 -176
  110. package/templates/blocks/DD-ShowcaseGrid/Component.tsx +306 -307
  111. package/templates/blocks/DD-Slider-A/Component.tsx +237 -237
  112. package/templates/blocks/DD-StackCards/Component.tsx +474 -473
  113. package/templates/blocks/DD-Team/Component.tsx +247 -247
  114. package/templates/blocks/DD-TeamCards/Component.tsx +251 -251
  115. package/templates/blocks/DD-TechStack/Component.tsx +161 -168
  116. package/templates/blocks/DD-TestMarq/Component.tsx +158 -132
  117. package/templates/blocks/DD-Testim/Component.tsx +247 -247
  118. package/templates/blocks/DD-Testim2/Component.tsx +265 -256
  119. package/templates/blocks/DD-Testimonials/Component.tsx +139 -147
  120. package/templates/blocks/DD-TextMarq/Component.tsx +157 -157
  121. package/templates/blocks/DD-Thanks/Component.tsx +501 -500
  122. package/templates/blocks/DD-Work/Component.tsx +315 -315
  123. package/templates/blocks/DD-Work-B/Component.tsx +294 -294
  124. package/templates/blocks/DDHG-CTASection2/Component.tsx +183 -184
  125. package/templates/blocks/DDHG-HighlightArc/Component.tsx +246 -243
  126. package/templates/blocks/DDHG-LogoMarquee/Component.tsx +180 -93
  127. package/templates/blocks/DDHG-LogoMarquee/config.ts +154 -66
  128. package/templates/blocks/DDHG-NavCodeGrid/Component.tsx +225 -213
  129. package/templates/blocks/DDHG-ProcessSec/Component.tsx +38 -39
  130. package/templates/blocks/DDHG-ServiceDetails/Component.tsx +11 -11
  131. package/templates/blocks/DDHG-ServiceDetails/ServiceDetailCard.tsx +30 -47
  132. package/templates/blocks/DDHG-ServiceHero/Component.tsx +10 -10
  133. package/templates/blocks/DDHG-ServiceOverview/Component.tsx +23 -23
  134. package/templates/blocks/DDHG-StatsFAQ/Component.tsx +40 -40
  135. package/templates/blocks/DDHG-TeamCards/Component.tsx +140 -131
  136. package/templates/blocks/Form/Checkbox/index.tsx +45 -0
  137. package/templates/blocks/Form/Component.tsx +163 -0
  138. package/templates/blocks/Form/Country/index.tsx +65 -0
  139. package/templates/blocks/Form/Country/options.ts +982 -0
  140. package/templates/blocks/Form/Email/index.tsx +38 -0
  141. package/templates/blocks/Form/Error/index.tsx +15 -0
  142. package/templates/blocks/Form/Message/index.tsx +13 -0
  143. package/templates/blocks/Form/Number/index.tsx +36 -0
  144. package/templates/blocks/Form/Select/index.tsx +63 -0
  145. package/templates/blocks/Form/State/index.tsx +64 -0
  146. package/templates/blocks/Form/State/options.ts +52 -0
  147. package/templates/blocks/Form/Text/index.tsx +32 -0
  148. package/templates/blocks/Form/Textarea/index.tsx +40 -0
  149. package/templates/blocks/Form/Width/index.tsx +13 -0
  150. package/templates/blocks/Form/config.ts +51 -0
  151. package/templates/blocks/Form/fields.tsx +21 -0
  152. package/templates/blocks/Form/manifest.json +168 -0
  153. package/templates/blocks/MediaBlock/Component.tsx +67 -0
  154. package/templates/blocks/MediaBlock/config.ts +14 -0
  155. package/templates/blocks/MediaBlock/manifest.json +92 -0
  156. package/templates/blocks/TransitionsDustedShowcase/Component.tsx +9 -0
  157. package/templates/blocks/TransitionsDustedShowcase/config.ts +13 -0
  158. package/templates/blocks/TransitionsDustedShowcase/manifest.json +80 -0
  159. package/templates/blocks/rawHtml/Component.tsx +25 -0
  160. package/templates/blocks/rawHtml/config.ts +56 -0
  161. package/templates/blocks/rawHtml/manifest.json +80 -0
@@ -1,135 +1,136 @@
1
- import type { Block } from 'payload'
2
- import { BlocksFeature } from '@payloadcms/richtext-lexical'
3
-
4
- import { MediaBlock } from '@/blocks/MediaBlock/config'
5
- import { DDIcon } from '@/blocks/DD-Icon/config'
6
- import { DDAnimText } from '@/blocks/DD-AnimText/config'
7
- import { DDIconButton } from '@/blocks/DD-IconButton/config'
8
- import { defaultLexical } from '@/fields/defaultLexical'
9
-
10
- export const DDGooeyInfo: Block = {
11
- slug: 'DD-GooeyInfo',
12
- interfaceName: 'DDGooeyInfo',
13
- labels: {
14
- singular: 'Button Gooey Info',
15
- plural: 'Button Gooey Info Blocks'
16
- },
17
- fields: [
18
- {
19
- type: 'row',
20
- fields: [
21
- {
22
- name: 'buttonLabel',
23
- type: 'text',
24
- label: 'Button Label/Icon',
25
- defaultValue: 'i',
26
- admin: {
27
- width: '50%',
28
- description: 'Text or single character to display on button (e.g., "i", "?", "N")'
29
- }
30
- },
31
- {
32
- name: 'xOffset',
33
- type: 'number',
34
- label: 'Panel X Offset',
35
- defaultValue: 110,
36
- admin: {
37
- width: '50%',
38
- description: 'Horizontal distance from button to panel in pixels'
39
- }
40
- }
41
- ]
42
- },
43
- {
44
- type: 'row',
45
- fields: [
46
- {
47
- name: 'panelWidth',
48
- type: 'text',
49
- label: 'Panel Width',
50
- defaultValue: '16rem',
51
- admin: {
52
- width: '33.33%',
53
- description: 'Width of info panel (e.g., 16rem, 300px)'
54
- }
55
- },
56
- {
57
- name: 'buttonBgColor',
58
- type: 'text',
59
- label: 'Button Background',
60
- defaultValue: 'black',
61
- admin: {
62
- width: '33.33%',
63
- description: 'CSS color (e.g., black, #000, var(--primary))'
64
- }
65
- },
66
- {
67
- name: 'buttonTextColor',
68
- type: 'text',
69
- label: 'Button Text Color',
70
- defaultValue: 'white',
71
- admin: {
72
- width: '33.33%',
73
- description: 'CSS color for button text'
74
- }
75
- }
76
- ]
77
- },
78
- {
79
- type: 'row',
80
- fields: [
81
- {
82
- name: 'panelBgColor',
83
- type: 'text',
84
- label: 'Panel Background',
85
- defaultValue: 'black',
86
- admin: {
87
- width: '50%',
88
- description: 'CSS color for panel background'
89
- }
90
- },
91
- {
92
- name: 'panelTextColor',
93
- type: 'text',
94
- label: 'Panel Text Color',
95
- defaultValue: 'white',
96
- admin: {
97
- width: '50%',
98
- description: 'CSS color for panel text'
99
- }
100
- }
101
- ]
102
- },
103
- {
104
- type: 'row',
105
- fields: [
106
- {
107
- name: 'className',
108
- type: 'text',
109
- label: 'Container CSS Classes',
110
- admin: {
111
- width: '50%',
112
- description: 'Additional CSS classes for the outer container'
113
- }
114
- },
115
- {
116
- name: 'panelClassName',
117
- type: 'text',
118
- label: 'Panel CSS Classes',
119
- admin: {
120
- width: '50%',
121
- description: 'Additional CSS classes for the info panel'
122
- }
123
- }
124
- ]
125
- },
126
- {
127
- name: 'richTextData',
128
- type: 'richText',
129
- editor: defaultLexical,
130
- label: 'Panel Content'
131
- }
132
- ]
133
- }
134
-
135
- export default DDGooeyInfo
1
+ import type { Block } from 'payload'
2
+ import { BlocksFeature } from '@payloadcms/richtext-lexical'
3
+
4
+ import { MediaBlock } from '@/blocks/MediaBlock/config'
5
+ import { DDIcon } from '@/blocks/DD-Icon/config'
6
+ import { DDAnimText } from '@/blocks/DD-AnimText/config'
7
+ import { DDIconButton } from '@/blocks/DD-IconButton/config'
8
+ import { defaultLexical } from '@/fields/defaultLexical'
9
+
10
+ export const DDGooeyInfo: Block = {
11
+ slug: 'DD-GooeyInfo',
12
+ interfaceName: 'DDGooeyInfo',
13
+ labels: {
14
+ singular: 'Button Gooey Info',
15
+ plural: 'Button Gooey Info Blocks',
16
+ },
17
+ fields: [
18
+ {
19
+ type: 'row',
20
+ fields: [
21
+ {
22
+ name: 'buttonLabel',
23
+ type: 'text',
24
+ label: 'Button Label/Icon',
25
+ defaultValue: 'i',
26
+ admin: {
27
+ width: '50%',
28
+ description: 'Text or single character to display on button (e.g., "i", "?", "N")',
29
+ },
30
+ },
31
+ {
32
+ name: 'xOffset',
33
+ type: 'number',
34
+ label: 'Panel X Offset',
35
+ defaultValue: 48,
36
+ admin: {
37
+ width: '50%',
38
+ description:
39
+ 'Horizontal panel offset in pixels. Keep at or below 48 so the panel stays connected to the button',
40
+ },
41
+ },
42
+ ],
43
+ },
44
+ {
45
+ type: 'row',
46
+ fields: [
47
+ {
48
+ name: 'panelWidth',
49
+ type: 'text',
50
+ label: 'Panel Width',
51
+ defaultValue: '16rem',
52
+ admin: {
53
+ width: '33.33%',
54
+ description: 'Width of info panel (e.g., 16rem, 300px)',
55
+ },
56
+ },
57
+ {
58
+ name: 'buttonBgColor',
59
+ type: 'text',
60
+ label: 'Button Background',
61
+ defaultValue: 'black',
62
+ admin: {
63
+ width: '33.33%',
64
+ description: 'CSS color (e.g., black, #000, var(--primary))',
65
+ },
66
+ },
67
+ {
68
+ name: 'buttonTextColor',
69
+ type: 'text',
70
+ label: 'Button Text Color',
71
+ defaultValue: 'white',
72
+ admin: {
73
+ width: '33.33%',
74
+ description: 'CSS color for button text',
75
+ },
76
+ },
77
+ ],
78
+ },
79
+ {
80
+ type: 'row',
81
+ fields: [
82
+ {
83
+ name: 'panelBgColor',
84
+ type: 'text',
85
+ label: 'Panel Background',
86
+ defaultValue: 'black',
87
+ admin: {
88
+ width: '50%',
89
+ description: 'CSS color for panel background',
90
+ },
91
+ },
92
+ {
93
+ name: 'panelTextColor',
94
+ type: 'text',
95
+ label: 'Panel Text Color',
96
+ defaultValue: 'white',
97
+ admin: {
98
+ width: '50%',
99
+ description: 'CSS color for panel text',
100
+ },
101
+ },
102
+ ],
103
+ },
104
+ {
105
+ type: 'row',
106
+ fields: [
107
+ {
108
+ name: 'className',
109
+ type: 'text',
110
+ label: 'Container CSS Classes',
111
+ admin: {
112
+ width: '50%',
113
+ description: 'Additional CSS classes for the outer container',
114
+ },
115
+ },
116
+ {
117
+ name: 'panelClassName',
118
+ type: 'text',
119
+ label: 'Panel CSS Classes',
120
+ admin: {
121
+ width: '50%',
122
+ description: 'Additional CSS classes for the info panel',
123
+ },
124
+ },
125
+ ],
126
+ },
127
+ {
128
+ name: 'richTextData',
129
+ type: 'richText',
130
+ editor: defaultLexical,
131
+ label: 'Panel Content',
132
+ },
133
+ ],
134
+ }
135
+
136
+ export default DDGooeyInfo
@@ -68,19 +68,9 @@ function DynamicIcon({
68
68
 
69
69
  export const DDHero: React.FC<DDHeroProps> = ({
70
70
  badge,
71
- eyebrow,
72
71
  headlineMain,
73
72
  headlineAccent,
74
73
  description,
75
- headlineText,
76
- accentText,
77
- subText,
78
- phase1,
79
- phase2,
80
- phase3,
81
- phase1Desc,
82
- phase2Desc,
83
- phase3Desc,
84
74
  // primaryCta,
85
75
  // secondaryCta,
86
76
  stats,
@@ -100,20 +90,8 @@ export const DDHero: React.FC<DDHeroProps> = ({
100
90
  const bgUrl = bgMedia?.url ?? backgroundImageFallbackUrl ?? undefined
101
91
  const safeBgUrl = isLocalAssetSrc(bgUrl) ? bgUrl : null
102
92
  const isVideo = Boolean(safeBgUrl && (bgMedia?.mimeType?.startsWith('video/') ?? false))
103
- const resolvedBadge = badge?.text ?? eyebrow
104
- const resolvedHeadlineMain = headlineMain ?? headlineText ?? 'Launch-ready digital products'
105
- const resolvedHeadlineAccent = headlineAccent ?? accentText ?? 'with sharper positioning'
106
- const resolvedDescription =
107
- description ??
108
- subText ??
109
- 'A hero section for selling a focused offer with clear messaging, visual depth, and direct action.'
110
- const phaseStats = [
111
- phase1 && { value: phase1, label: phase1Desc },
112
- phase2 && { value: phase2, label: phase2Desc },
113
- phase3 && { value: phase3, label: phase3Desc }
114
- ].filter(Boolean) as StatItem[]
115
93
  const buttonItems = buttons as ButtonItem[]
116
- const statItems = ((stats?.length ? stats : phaseStats) ?? []) as StatItem[]
94
+ const statItems = (stats ?? []) as StatItem[]
117
95
 
118
96
  const [bgLoaded, setBgLoaded] = useState(false)
119
97
 
@@ -126,7 +104,7 @@ export const DDHero: React.FC<DDHeroProps> = ({
126
104
 
127
105
  <div
128
106
  id={sectionId ?? undefined}
129
- className="relative flex min-h-[72vh] w-full items-center overflow-hidden rounded-2xl"
107
+ className="relative min-h-screen flex items-center overflow-hidden"
130
108
  >
131
109
  {/* Background Image */}
132
110
  <div className="absolute inset-0">
@@ -164,20 +142,20 @@ export const DDHero: React.FC<DDHeroProps> = ({
164
142
  </div>
165
143
 
166
144
  {/* Content */}
167
- <div className="relative z-10 mx-auto flex w-full max-w-6xl items-center px-6 py-20 md:px-10 lg:px-14">
168
- <div className="max-w-3xl">
145
+ <div className="relative z-10 w-full max-w-6xl lg:max-w-7xl mx-auto px-4 md:px-6 pt-28 pb-24">
146
+ <div className="max-w-2xl">
169
147
  {/* Badge */}
170
148
  {/* {badge?.show && badge.text && (
171
149
  <div className="inline-flex items-center gap-2 bg-stone-50/10 border border-white/20 rounded-full px-4 py-1.5 mb-8">
172
150
  <span className="w-1.5 h-1.5 rounded-full bg-lime-400 animate-pulse" />
173
151
  <span className="text-stone-50/80 text-xs font-medium tracking-wide">
174
- {resolvedBadge}
152
+ {badge.text}
175
153
  </span>
176
154
  </div>
177
155
  )} */}
178
156
 
179
157
  {/* Badge - to convert to dynamic */}
180
- {(badge?.show ?? Boolean(resolvedBadge)) && resolvedBadge && (
158
+ {badge?.show && badge.text && (
181
159
  <motion.div
182
160
  variants={{
183
161
  hidden: { opacity: 0, y: -20, filter: 'blur(6px)' },
@@ -188,16 +166,16 @@ export const DDHero: React.FC<DDHeroProps> = ({
188
166
  <span className="inline-flex items-center gap-2 rounded-full border border-lime-500 bg-black/70 px-4 py-1.5 text-xs text-lime-100">
189
167
  {/* TODO: Reconnect Badge/AnimatedShinyText if this project provides them. */}
190
168
  <ChipIcon className="mr-2 h-3.5 w-3.5" />
191
- {resolvedBadge}
169
+ {badge.text}
192
170
  </span>
193
171
  </motion.div>
194
172
  )}
195
173
 
196
174
  {/* Headline */}
197
175
  {/* <h1 className="text-5xl md:text-6xl lg:text-7xl font-semibold text-stone-900 dark:text-stone-50 leading-[1.05] tracking-tight mb-6">
198
- {resolvedHeadlineMain}
176
+ {headlineMain}
199
177
  <br />
200
- <span className="text-stone-400">{resolvedHeadlineAccent}</span>
178
+ <span className="text-stone-400">{headlineAccent}</span>
201
179
  </h1> */}
202
180
 
203
181
  {/* Headline */}
@@ -211,9 +189,9 @@ export const DDHero: React.FC<DDHeroProps> = ({
211
189
  transition={{ duration: 0.6, ease: 'easeOut' }}
212
190
  style={{ filter: 'drop-shadow(3px 3px 1px #151515)' }}
213
191
  >
214
- <span className="block text-left text-5xl font-semibold tracking-tight text-lime-300 drop-shadow-lg sm:text-6xl md:text-7xl">
192
+ <span className="block text-6xl sm:text-6xl font-semibold text-left tracking-tight md:text-7xl text-purple-600 dark:text-violet-600 hyphens-auto">
215
193
  {/* TODO: Reconnect SplittingText animation if this project provides it. */}
216
- {resolvedHeadlineMain}
194
+ {headlineMain}
217
195
  </span>
218
196
  </motion.div>
219
197
  <motion.div
@@ -226,18 +204,16 @@ export const DDHero: React.FC<DDHeroProps> = ({
226
204
  transition={{ duration: 0.6, ease: 'easeOut' }}
227
205
  style={{ filter: 'drop-shadow(3px 3px 1px #151515)' }}
228
206
  >
229
- <span className="block text-left text-5xl font-semibold tracking-tight text-stone-50 drop-shadow-lg sm:text-6xl md:text-7xl">
207
+ <span className="block text-6xl sm:text-6xl font-semibold text-left tracking-tight md:text-7xl text-purple-900 dark:text-violet-900 hyphens-auto">
230
208
  {/* TODO: Reconnect SplittingText animation if this project provides it. */}
231
- {resolvedHeadlineAccent}
209
+ {headlineAccent}
232
210
  </span>
233
211
  </motion.div>
234
212
 
235
213
  {/* Description */}
236
214
  <TextFade direction="down" className="mt-10" delay={0.5}>
237
- {resolvedDescription && (
238
- <p className="mt-4 mb-0 max-w-2xl text-lg leading-relaxed text-stone-50/75">
239
- {resolvedDescription}
240
- </p>
215
+ {description && (
216
+ <p className="text-stone-50/65 leading-relaxed mt-4 mb-0 max-w-xl">{description}</p>
241
217
  )}
242
218
  </TextFade>
243
219
 
@@ -279,7 +255,7 @@ export const DDHero: React.FC<DDHeroProps> = ({
279
255
  href={(button as any).href ?? '#'}
280
256
  className={
281
257
  button.class ??
282
- 'inline-flex items-center justify-center gap-2 rounded-full bg-lime-400 px-5 py-2.5 text-sm font-semibold text-stone-950 shadow-[0_0_28px_rgba(132,204,22,0.35)] transition-all duration-150 hover:bg-lime-300 hover:scale-[1.03] whitespace-nowrap'
258
+ 'inline-flex items-center gap-1.5 bg-indigo-700 text-stone-50 text-xs font-semibold px-3 py-1.5 rounded-lg group-hover:bg-indigo-600 group-hover:scale-[1.05] group-hover:shadow-xl transition-all duration-150 whitespace-nowrap'
283
259
  }
284
260
  style={{ cornerShape: 'squircle' } as React.CSSProperties}
285
261
  >
@@ -0,0 +1,50 @@
1
+ 'use client'
2
+
3
+ import dynamic from 'next/dynamic'
4
+ import { Suspense } from 'react'
5
+
6
+ import { cn } from '@/utilities/ui'
7
+
8
+ const ThreeScene = dynamic(() => import('./ThreeScene'), {
9
+ ssr: false,
10
+ })
11
+
12
+ function LoadingDots() {
13
+ return (
14
+ <div className="absolute inset-0 flex items-center justify-center gap-2">
15
+ {[0, 1, 2].map((i) => (
16
+ <span
17
+ key={i}
18
+ className="w-2 h-2 rounded-full bg-indigo-500 dark:bg-indigo-300 animate-bounce"
19
+ style={{ animationDelay: `${i * 0.15}s` }}
20
+ />
21
+ ))}
22
+ </div>
23
+ )
24
+ }
25
+
26
+ export type DDHeroPlasProps = {
27
+ blockType?: 'DD-HeroPlas'
28
+ blockName?: string | null
29
+ containerClass?: string
30
+ }
31
+
32
+ export function DDHeroPlas(props: DDHeroPlasProps) {
33
+ const { containerClass } = props
34
+
35
+ return (
36
+ <div
37
+ suppressHydrationWarning
38
+ className={cn(
39
+ 'relative h-[520px] w-full overflow-hidden bg-stone-100 text-stone-900 dark:bg-stone-950 dark:text-stone-100',
40
+ containerClass,
41
+ )}
42
+ >
43
+ <Suspense fallback={<LoadingDots />}>
44
+ <ThreeScene />
45
+ </Suspense>
46
+ </div>
47
+ )
48
+ }
49
+
50
+ export default DDHeroPlas
@@ -0,0 +1,109 @@
1
+ 'use client'
2
+
3
+ import { useState, useRef, type RefObject } from 'react'
4
+ import { Canvas, useFrame } from '@react-three/fiber'
5
+ import { BakeShadows, SoftShadows, useCursor } from '@react-three/drei'
6
+
7
+ export default function ThreeScene({
8
+ eventSource,
9
+ }: {
10
+ eventSource?: HTMLElement | RefObject<HTMLElement> | null
11
+ }) {
12
+ return (
13
+ <div className="relative h-full w-full">
14
+ <Canvas
15
+ shadows
16
+ dpr={1.5}
17
+ camera={{ position: [-10, 10, 2], fov: 45 }}
18
+ // Allow the scene to stay interactive even when the canvas is visually "behind" other content.
19
+ // Pointer events are captured from `eventSource` (hero container), but the canvas itself
20
+ // does not block clicks on buttons/links.
21
+ eventSource={eventSource ?? undefined}
22
+ eventPrefix="client"
23
+ style={{ position: 'absolute', inset: 0, pointerEvents: eventSource ? 'none' : 'auto' }}
24
+ >
25
+ {/* Softer PCSS-style shadows (client-side) */}
26
+ <SoftShadows size={25} samples={12} focus={0.4} />
27
+ <Stage />
28
+ {Array.from({ length: 12 }, (_, i) => (
29
+ <Stair
30
+ key={i}
31
+ name={'stair-' + (i + 1)}
32
+ rotation={[-Math.PI / 2, 0, i / Math.PI / 2]}
33
+ position={[2 - Math.sin(i / 5) * 5, i * 0.5, 2 - Math.cos(i / 5) * 5]}
34
+ defaultColor={[5, 8, 9].includes(i) ? '#4f46e5' : i === 6 ? '#818cf8' : null}
35
+ />
36
+ ))}
37
+ </Canvas>
38
+ </div>
39
+ )
40
+ }
41
+
42
+ function Stair({
43
+ defaultColor = null,
44
+ ...props
45
+ }: {
46
+ defaultColor?: string | null
47
+ [key: string]: any
48
+ }) {
49
+ const ref = useRef()
50
+ const [hovered, setHovered] = useState(false)
51
+ const [clicked, setClicked] = useState<string | null>(defaultColor)
52
+ useFrame((state) =>
53
+ ref.current.scale.setScalar(hovered ? 1 + Math.sin(state.clock.elapsedTime * 10) / 50 : 1),
54
+ )
55
+ // Sets document.body.style.cursor: useCursor(flag, onPointerOver = 'pointer', onPointerOut = 'auto')
56
+ useCursor(hovered)
57
+ return (
58
+ <mesh
59
+ {...props}
60
+ ref={ref}
61
+ receiveShadow
62
+ castShadow
63
+ onClick={(e) => (
64
+ e.stopPropagation(),
65
+ setClicked((c) => (c === '#4f46e5' ? '#818cf8' : '#4f46e5'))
66
+ )}
67
+ onPointerOver={(e) => (e.stopPropagation(), setHovered(true))}
68
+ onPointerOut={(e) => setHovered(false)}
69
+ >
70
+ <boxGeometry args={[5, 8, 0.075]} />
71
+ <meshStandardMaterial
72
+ roughness={1}
73
+ transparent
74
+ opacity={0.6}
75
+ color={clicked ?? (hovered ? '#818cf8' : '#f5f5f4')}
76
+ />
77
+ </mesh>
78
+ )
79
+ }
80
+
81
+ function Stage() {
82
+ return (
83
+ <>
84
+ {/* Fill */}
85
+ <ambientLight intensity={0.4} />
86
+ {/* Main */}
87
+ <directionalLight
88
+ position={[1, 10, -2]}
89
+ intensity={1.5}
90
+ shadow-camera-far={70}
91
+ shadow-camera-left={-10}
92
+ shadow-camera-right={10}
93
+ shadow-camera-top={10}
94
+ shadow-camera-bottom={-10}
95
+ shadow-mapSize={[512, 512]}
96
+ castShadow
97
+ />
98
+ {/* Strip */}
99
+ <directionalLight position={[-10, -10, 2]} intensity={3} />
100
+ {/* Ground */}
101
+ <mesh receiveShadow rotation-x={-Math.PI / 2} position={[0, -0.75, 0]}>
102
+ <planeGeometry args={[20, 20]} />
103
+ <shadowMaterial opacity={0.25} />
104
+ </mesh>
105
+ {/* This freezes the shadow map, which is fast, but the model has to be static */}
106
+ <BakeShadows />
107
+ </>
108
+ )
109
+ }
@@ -0,0 +1,33 @@
1
+ import type { Block } from 'payload'
2
+
3
+ export const DDHeroPlas: Block = {
4
+ slug: 'DD-HeroPlas',
5
+ labels: {
6
+ singular: 'DD Hero Plastics',
7
+ plural: 'DD Hero Plastics',
8
+ },
9
+ interfaceName: 'DDHeroPlas',
10
+ fields: [
11
+ {
12
+ admin: {
13
+ initCollapsed: true,
14
+ className: 'custom-css-class',
15
+ },
16
+ type: 'collapsible',
17
+ label: 'Add container class',
18
+ fields: [
19
+ {
20
+ name: 'containerClass',
21
+ type: 'textarea',
22
+ label: false,
23
+ required: false,
24
+ admin: {
25
+ description: 'Optional Tailwind/CSS classes applied to the block container.',
26
+ },
27
+ },
28
+ ],
29
+ },
30
+ ],
31
+ }
32
+
33
+ export default DDHeroPlas