blocks-dusted 0.1.12 → 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.
- package/package.json +1 -1
- package/src/installers/patchRenderBlocks.js +1 -1
- package/src/registry/validateTemplateManifest.js +2 -1
- package/templates/blocks/BannerDD790432/Component.tsx +63 -0
- package/templates/blocks/BannerDD790432/config.ts +54 -0
- package/templates/blocks/BannerDD790432/manifest.json +80 -0
- package/templates/blocks/Button47/Component.tsx +124 -0
- package/templates/blocks/Button47/config.ts +75 -0
- package/templates/blocks/Button47/link.ts +22 -0
- package/templates/blocks/Button47/manifest.json +105 -0
- package/templates/blocks/Button47/styles.module.scss +75 -0
- package/templates/blocks/DD-Accordion/Component.tsx +55 -36
- package/templates/blocks/DD-Accordion/config.ts +71 -59
- package/templates/blocks/DD-AnimText/Component.tsx +50 -32
- package/templates/blocks/DD-AnimText/config.ts +296 -295
- package/templates/blocks/DD-AsideNav/Component.tsx +323 -319
- package/templates/blocks/DD-Banner/Component.tsx +54 -51
- package/templates/blocks/DD-BookCall/Component.tsx +535 -535
- package/templates/blocks/DD-ButtonPop/Component.tsx +118 -117
- package/templates/blocks/DD-Card/Component.tsx +4 -4
- package/templates/blocks/DD-CardTemplate01/Component.tsx +139 -140
- package/templates/blocks/DD-CardsWithVariantV3/Component.tsx +472 -0
- package/templates/blocks/DD-CardsWithVariantV3/ElectricBorder/index.tsx +203 -0
- package/templates/blocks/DD-CardsWithVariantV3/ElectricBorder/styles.ts +87 -0
- package/templates/blocks/DD-CardsWithVariantV3/ElectricBorder/useInjectStyle.ts +39 -0
- package/templates/blocks/DD-CardsWithVariantV3/config.ts +326 -0
- package/templates/blocks/DD-CardsWithVariantV3/manifest.json +110 -0
- package/templates/blocks/DD-Carousel-A/Component.tsx +251 -249
- package/templates/blocks/DD-Carousel-B/Component.tsx +405 -403
- package/templates/blocks/DD-ComparisonTable/Component.tsx +255 -256
- package/templates/blocks/DD-Contact/Component.tsx +433 -435
- package/templates/blocks/DD-Counter/Component.tsx +11 -6
- package/templates/blocks/DD-DeliCard/Component.tsx +303 -0
- package/templates/blocks/DD-DeliCard/config.ts +186 -0
- package/templates/blocks/DD-DeliCard/manifest.json +94 -0
- package/templates/blocks/DD-FeatCat/Component.tsx +302 -302
- package/templates/blocks/DD-FeatProd/CircularGallery.tsx +1179 -0
- package/templates/blocks/DD-FeatProd/Component.tsx +484 -0
- package/templates/blocks/DD-FeatProd/config.ts +173 -0
- package/templates/blocks/DD-FeatProd/manifest.json +93 -0
- package/templates/blocks/DD-FeatServ/Component.tsx +607 -0
- package/templates/blocks/DD-FeatServ/config.ts +213 -0
- package/templates/blocks/DD-FeatServ/manifest.json +113 -0
- package/templates/blocks/DD-FeatStrip/Component.tsx +584 -585
- package/templates/blocks/DD-FluidBtn/ButtonsEyeCatching.tsx +627 -628
- package/templates/blocks/DD-FluidBtn/Component.tsx +46 -43
- package/templates/blocks/DD-GooeyInfo/Component.tsx +150 -149
- package/templates/blocks/DD-GooeyInfo/config.ts +136 -135
- package/templates/blocks/DD-Hero/Component.tsx +296 -297
- package/templates/blocks/DD-HeroPlas/Component.tsx +50 -0
- package/templates/blocks/DD-HeroPlas/ThreeScene.tsx +109 -0
- package/templates/blocks/DD-HeroPlas/config.ts +33 -0
- package/templates/blocks/DD-HeroPlas/manifest.json +88 -0
- package/templates/blocks/DD-HorizontalScroll/Component.tsx +937 -936
- package/templates/blocks/DD-Icon/Component.tsx +46 -81
- package/templates/blocks/DD-IconButton/Component.tsx +13 -20
- package/templates/blocks/DD-IdTag/Component.tsx +22 -21
- package/templates/blocks/DD-LineAnim/Component.tsx +42 -36
- package/templates/blocks/DD-LogoMarq/Component.tsx +38 -48
- package/templates/blocks/DD-Lottie/Component.tsx +11 -3
- package/templates/blocks/DD-MasonaryMedia/Component.tsx +544 -545
- package/templates/blocks/DD-MasonaryMedia/config.ts +389 -389
- package/templates/blocks/DD-Masonry/Component.tsx +654 -644
- package/templates/blocks/DD-Masonry/config.ts +475 -475
- package/templates/blocks/DD-MaterialSwatches/Component.tsx +85 -0
- package/templates/blocks/DD-MaterialSwatches/config.ts +232 -0
- package/templates/blocks/DD-MaterialSwatches/manifest.json +84 -0
- package/templates/blocks/DD-MaterialSwatches/material.ts +107 -0
- package/templates/blocks/DD-NineCanvas/Component.tsx +129 -0
- package/templates/blocks/DD-NineCanvas/RenderBlocks.tsx +244 -0
- package/templates/blocks/DD-NineCanvas/allowedCanvasBlocks.ts +6 -0
- package/templates/blocks/DD-NineCanvas/blockComponents.tsx +8 -0
- package/templates/blocks/DD-NineCanvas/canvas/CanvasGrid.tsx +316 -0
- package/templates/blocks/DD-NineCanvas/canvas/RadialNav.tsx +432 -0
- package/templates/blocks/DD-NineCanvas/canvas/canvas-panels.css +889 -0
- package/templates/blocks/DD-NineCanvas/canvas/icons/custom-icons.tsx +364 -0
- package/templates/blocks/DD-NineCanvas/config.ts +61 -0
- package/templates/blocks/DD-NineCanvas/manifest.json +165 -0
- package/templates/blocks/DD-NineCanvas/styles.scss +152 -0
- package/templates/blocks/DD-NineCanvas/tooltip/get-strict-context.tsx +26 -0
- package/templates/blocks/DD-NineCanvas/tooltip/primitives.tsx +178 -0
- package/templates/blocks/DD-NineCanvas/tooltip/tooltip.tsx +71 -0
- package/templates/blocks/DD-NineCanvas/tooltip/use-controlled-state.tsx +33 -0
- package/templates/blocks/DD-NineCanvas/utilities/FadeOnScroll.tsx +68 -0
- package/templates/blocks/DD-NineCanvas/utilities/ParallaxWrapper.tsx +157 -0
- package/templates/blocks/DD-NineCanvas/utilities/renderCustomCSS.ts +5 -0
- package/templates/blocks/DD-NineCanvas/utilities/webglCleanup.ts +27 -0
- package/templates/blocks/DD-PayloadAIAssistant/Component.tsx +78 -0
- package/templates/blocks/DD-PayloadAIAssistant/DustedBot.tsx +590 -0
- package/templates/blocks/DD-PayloadAIAssistant/config.ts +37 -0
- package/templates/blocks/DD-PayloadAIAssistant/demo.css +125 -0
- package/templates/blocks/DD-PayloadAIAssistant/manifest.json +93 -0
- package/templates/blocks/DD-PayloadAIAssistant/source-defaults.ts +17 -0
- package/templates/blocks/DD-PayloadAIAssistant/styles.ts +306 -0
- package/templates/blocks/DD-Pricing/Component.tsx +2 -3
- package/templates/blocks/DD-Pricing/config.ts +215 -215
- package/templates/blocks/DD-Process/Component.tsx +2 -2
- package/templates/blocks/DD-ProjHeader/Component.tsx +93 -91
- package/templates/blocks/DD-ProjSlider/Component.tsx +1 -1
- package/templates/blocks/DD-Section/Component.tsx +265 -266
- package/templates/blocks/DD-Separator/Component.tsx +66 -66
- package/templates/blocks/DD-Services/Component.tsx +176 -176
- package/templates/blocks/DD-ShowcaseGrid/Component.tsx +306 -307
- package/templates/blocks/DD-Slider-A/Component.tsx +2 -2
- package/templates/blocks/DD-StackCards/Component.tsx +172 -171
- package/templates/blocks/DD-Team/Component.tsx +247 -247
- package/templates/blocks/DD-TeamCards/Component.tsx +251 -251
- package/templates/blocks/DD-TechStack/Component.tsx +173 -174
- package/templates/blocks/DD-TestMarq/Component.tsx +158 -132
- package/templates/blocks/DD-Testim/Component.tsx +247 -247
- package/templates/blocks/DD-Testim2/Component.tsx +265 -256
- package/templates/blocks/DD-Testimonials/Component.tsx +139 -139
- package/templates/blocks/DD-Thanks/Component.tsx +1 -1
- package/templates/blocks/DD-Work/Component.tsx +318 -318
- package/templates/blocks/DD-Work-B/Component.tsx +294 -294
- package/templates/blocks/DDHG-CTASection2/Component.tsx +183 -184
- package/templates/blocks/DDHG-HighlightArc/Component.tsx +6 -3
- package/templates/blocks/DDHG-LogoMarquee/Component.tsx +45 -8
- package/templates/blocks/DDHG-NavCodeGrid/Component.tsx +1 -3
- package/templates/blocks/DDHG-ServiceDetails/ServiceDetailCard.tsx +9 -22
- package/templates/blocks/DDHG-ServiceHero/Component.tsx +10 -10
- package/templates/blocks/DDHG-TeamCards/Component.tsx +6 -35
- package/templates/blocks/Form/Checkbox/index.tsx +45 -0
- package/templates/blocks/Form/Component.tsx +163 -0
- package/templates/blocks/Form/Country/index.tsx +65 -0
- package/templates/blocks/Form/Country/options.ts +982 -0
- package/templates/blocks/Form/Email/index.tsx +38 -0
- package/templates/blocks/Form/Error/index.tsx +15 -0
- package/templates/blocks/Form/Message/index.tsx +13 -0
- package/templates/blocks/Form/Number/index.tsx +36 -0
- package/templates/blocks/Form/Select/index.tsx +63 -0
- package/templates/blocks/Form/State/index.tsx +64 -0
- package/templates/blocks/Form/State/options.ts +52 -0
- package/templates/blocks/Form/Text/index.tsx +32 -0
- package/templates/blocks/Form/Textarea/index.tsx +40 -0
- package/templates/blocks/Form/Width/index.tsx +13 -0
- package/templates/blocks/Form/config.ts +51 -0
- package/templates/blocks/Form/fields.tsx +21 -0
- package/templates/blocks/Form/manifest.json +168 -0
- package/templates/blocks/MediaBlock/Component.tsx +67 -0
- package/templates/blocks/MediaBlock/config.ts +14 -0
- package/templates/blocks/MediaBlock/manifest.json +92 -0
- package/templates/blocks/TransitionsDustedShowcase/Component.tsx +9 -0
- package/templates/blocks/TransitionsDustedShowcase/config.ts +13 -0
- package/templates/blocks/TransitionsDustedShowcase/manifest.json +80 -0
- package/templates/blocks/rawHtml/Component.tsx +25 -0
- package/templates/blocks/rawHtml/config.ts +56 -0
- package/templates/blocks/rawHtml/manifest.json +80 -0
|
@@ -10,10 +10,30 @@ import { cn } from '@/utilities/ui'
|
|
|
10
10
|
|
|
11
11
|
type AccordionButtonVariant = 'default' | 'destructive' | 'v1' | 'v2' | 'v3' | 'v5' | 'v7'
|
|
12
12
|
|
|
13
|
+
type AccordionButtonVariantName =
|
|
14
|
+
| 'default'
|
|
15
|
+
| 'destructive'
|
|
16
|
+
| 'offset_shadow'
|
|
17
|
+
| 'gradient_sheen'
|
|
18
|
+
| 'contrast_sweep'
|
|
19
|
+
| 'reveal_panel'
|
|
20
|
+
| 'underline_accent'
|
|
21
|
+
|
|
22
|
+
const buttonVariantNames: Record<AccordionButtonVariant, AccordionButtonVariantName> = {
|
|
23
|
+
default: 'default',
|
|
24
|
+
destructive: 'destructive',
|
|
25
|
+
v1: 'offset_shadow',
|
|
26
|
+
v2: 'gradient_sheen',
|
|
27
|
+
v3: 'contrast_sweep',
|
|
28
|
+
v5: 'reveal_panel',
|
|
29
|
+
v7: 'underline_accent',
|
|
30
|
+
}
|
|
31
|
+
|
|
13
32
|
const rippleCSS = `
|
|
14
33
|
.accordion-ripple-container { position: relative; overflow: hidden; }
|
|
15
34
|
.accordion-ripple-effect { position: absolute; border-radius: 50%; transform: scale(0); animation: accordion-ripple-animation 600ms linear; pointer-events: none; z-index: 10; }
|
|
16
35
|
@keyframes accordion-ripple-animation { to { transform: scale(4); opacity: 0; } }
|
|
36
|
+
[data-theme="light"] [data-button-variant="destructive"] { background-color: rgba(239,68,68,1) !important;}
|
|
17
37
|
`
|
|
18
38
|
|
|
19
39
|
const buttonAccordVariants = cva(
|
|
@@ -23,26 +43,27 @@ const buttonAccordVariants = cva(
|
|
|
23
43
|
variants: {
|
|
24
44
|
variant: {
|
|
25
45
|
default:
|
|
26
|
-
'ripple-default bg-
|
|
46
|
+
'ripple-default border border-stone-300/10 bg-stone-100 text-stone-800 dark:text-stone-900 hover:bg-stone-200 hover:shadow-md hover:color-accent will-change-transform',
|
|
27
47
|
destructive:
|
|
28
|
-
'ripple-destructive bg-red-950/
|
|
29
|
-
v1: 'ripple-v1 border-[0.5px]
|
|
30
|
-
v2: 'ripple-v2
|
|
31
|
-
v3: 'ripple-v3
|
|
32
|
-
v5: 'ripple-v5
|
|
33
|
-
v7: "ripple-v7 text-stone-
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
48
|
+
'ripple-destructive border border-red-700 bg-red-100 text-red-950 shadow-[inset_0_0_0_1px_rgb(185_28_28/0.45),inset_0_0_12px_rgb(185_28_28/0.25)] hover:bg-red-200 dark:border-red-500/50 dark:bg-red-950/50 dark:text-stone-200 dark:shadow-[inset_0_0_0_1px_rgba(239,68,68,0.6),inset_0_0_12px_rgba(239,68,68,0.8)] dark:hover:bg-red-900/80 will-change-transform',
|
|
49
|
+
v1: 'ripple-v1 border-[0.5px] border-stone-800 bg-stone-50 text-stone-800 duration-200 hover:bg-stone-800 hover:text-stone-50 shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] active:shadow-none dark:border-stone-600 dark:bg-zinc-950 dark:text-stone-200 dark:shadow-[3px_3px_0px_0px_var(--border-color)] active:dark:shadow-none',
|
|
50
|
+
v2: 'ripple-v2 group relative overflow-hidden rounded-none border border-stone-300/10 bg-stone-100 text-stone-800 ease-in-out hover:scale-100 hover:bg-stone-200 hover:shadow-lg hover:shadow-stone-400/30 dark:bg-gradient-to-tr dark:from-neutral-950 dark:to-neutral-900 dark:text-stone-100 dark:hover:shadow-zinc-700/30',
|
|
51
|
+
v3: 'ripple-v3 group relative overflow-hidden border border-stone-300/10 bg-stone-100 text-stone-800 ease-out hover:bg-gradient-to-r hover:from-stone-100 hover:to-stone-200 dark:bg-zinc-50 dark:text-stone-900 dark:hover:from-zinc-50 dark:hover:to-zinc-100',
|
|
52
|
+
v5: 'ripple-v5 group relative overflow-hidden border border-stone-300/10 bg-stone-50 text-stone-800 shadow dark:border-stone-700 dark:bg-zinc-950 dark:text-stone-200',
|
|
53
|
+
v7: "ripple-v7 text-stone-800 dark:text-stone-200 relative hover:no-underline px-[1px] pb-0 ease-in after:absolute after:bottom-[-2px] after:left-0 after:h-1 after:w-full after:translate-y-[3px] after:rounded-full after:dark:bg-indigo-50 after:bg-indigo-800 after:opacity-0 after:duration-300 after:content-[''] hover:after:-translate-y-1 hover:after:opacity-100",
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
37
57
|
)
|
|
38
58
|
|
|
39
59
|
interface ButtonAccordProps
|
|
40
|
-
extends
|
|
60
|
+
extends
|
|
61
|
+
React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
41
62
|
VariantProps<typeof buttonAccordVariants> {}
|
|
42
63
|
|
|
43
64
|
const ButtonAccord = React.forwardRef<HTMLButtonElement, ButtonAccordProps>(function ButtonAccord(
|
|
44
65
|
{ className, variant, onClick, children, ...props },
|
|
45
|
-
ref
|
|
66
|
+
ref,
|
|
46
67
|
) {
|
|
47
68
|
useEffect(() => {
|
|
48
69
|
const style = document.createElement('style')
|
|
@@ -60,7 +81,8 @@ const ButtonAccord = React.forwardRef<HTMLButtonElement, ButtonAccordProps>(func
|
|
|
60
81
|
ripple.style.left = `${event.clientX - rect.left}px`
|
|
61
82
|
ripple.style.top = `${event.clientY - rect.top}px`
|
|
62
83
|
ripple.style.width = ripple.style.height = `${Math.max(rect.width, rect.height)}px`
|
|
63
|
-
ripple.style.backgroundColor =
|
|
84
|
+
ripple.style.backgroundColor =
|
|
85
|
+
variant === 'destructive' ? 'rgba(255, 0, 0, 0.3)' : 'rgba(139, 92, 246, 0.45)'
|
|
64
86
|
|
|
65
87
|
button.appendChild(ripple)
|
|
66
88
|
ripple.addEventListener('animationend', () => ripple.remove())
|
|
@@ -70,7 +92,9 @@ const ButtonAccord = React.forwardRef<HTMLButtonElement, ButtonAccordProps>(func
|
|
|
70
92
|
const content =
|
|
71
93
|
variant === 'v5' ? (
|
|
72
94
|
<>
|
|
73
|
-
<span className="absolute inset-0 !border-none rounded-none flex items-center justify-center
|
|
95
|
+
<span className="absolute inset-0 !border-none rounded-none flex size-full -translate-x-full items-center justify-center bg-stone-800 text-stone-50 duration-700 group-hover:translate-x-0 dark:bg-zinc-100 dark:text-zinc-900">
|
|
96
|
+
{children}
|
|
97
|
+
</span>
|
|
74
98
|
<span className="absolute flex items-center justify-center w-full h-full transition-all duration-500 ease-out transform group-hover:translate-x-full">
|
|
75
99
|
{children}
|
|
76
100
|
</span>
|
|
@@ -95,6 +119,7 @@ const ButtonAccord = React.forwardRef<HTMLButtonElement, ButtonAccordProps>(func
|
|
|
95
119
|
<button
|
|
96
120
|
ref={ref}
|
|
97
121
|
onClick={handleClick}
|
|
122
|
+
data-button-variant={buttonVariantNames[variant || 'default']}
|
|
98
123
|
className={cn(buttonAccordVariants({ variant }), className)}
|
|
99
124
|
{...props}
|
|
100
125
|
>
|
|
@@ -140,12 +165,9 @@ export interface AccordionBlockProps {
|
|
|
140
165
|
accordionButtonVariant?: AccordionButtonVariant
|
|
141
166
|
}
|
|
142
167
|
|
|
143
|
-
export const AccordionItem: React.FC<
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
accordionId,
|
|
147
|
-
buttonVariant = 'v2'
|
|
148
|
-
}) => {
|
|
168
|
+
export const AccordionItem: React.FC<
|
|
169
|
+
AccordionItemData & { buttonVariant?: AccordionButtonVariant }
|
|
170
|
+
> = ({ title, content, accordionId, buttonVariant = 'v2' }) => {
|
|
149
171
|
const [isOpen, setIsOpen] = useState(false)
|
|
150
172
|
const [height, setHeight] = useState('0px')
|
|
151
173
|
const contentRef = useRef<HTMLDivElement>(null)
|
|
@@ -162,7 +184,7 @@ export const AccordionItem: React.FC<AccordionItemData & { buttonVariant?: Accor
|
|
|
162
184
|
className={`accordion-item max-w-full ${isOpen ? 'mb-4 shadow-2xl' : 'mb-0 shadow-md'}`}
|
|
163
185
|
id={accordionId}
|
|
164
186
|
>
|
|
165
|
-
<div className="accordion-title-button shadow-lg backdrop-blur-lg">
|
|
187
|
+
<div className="accordion-title-button border border-stone-300/10 bg-stone-100/80 shadow-lg backdrop-blur-lg dark:border-stone-800 dark:bg-stone-950/20">
|
|
166
188
|
<ButtonAccord
|
|
167
189
|
suppressHydrationWarning
|
|
168
190
|
suppressContentEditableWarning
|
|
@@ -178,29 +200,23 @@ export const AccordionItem: React.FC<AccordionItemData & { buttonVariant?: Accor
|
|
|
178
200
|
<RichText className={TITLE_CLS} data={title as any} enableGutter={false} />
|
|
179
201
|
</div>
|
|
180
202
|
{isOpen ? (
|
|
181
|
-
<ChevronUp
|
|
182
|
-
className="chevron-up-icon fixed right-2 top-1 mt-3 h-6 w-6 opacity-50 color-accent dark:text-[var(--color-alt)]"
|
|
183
|
-
style={{ color: 'var(--active)' }}
|
|
184
|
-
/>
|
|
203
|
+
<ChevronUp className="chevron-up-icon fixed right-2 top-1 mt-3 h-6 w-6 opacity-50 text-stone-900 dark:text-stone-100 mix-blend-difference" />
|
|
185
204
|
) : (
|
|
186
|
-
<ChevronDown
|
|
187
|
-
className="chevron-down-icon fixed right-2 top-1 mt-3 h-6 w-6 opacity-50 color-accent dark:text-[var(--color-alt)]"
|
|
188
|
-
style={{ color: 'var(--active)' }}
|
|
189
|
-
/>
|
|
205
|
+
<ChevronDown className="chevron-down-icon fixed right-2 top-1 mt-3 h-6 w-6 opacity-50 text-stone-900 dark:text-stone-100 mix-blend-difference" />
|
|
190
206
|
)}
|
|
191
207
|
</ButtonAccord>
|
|
192
|
-
<AccordionSeparator className="accordion-separator
|
|
208
|
+
<AccordionSeparator className="accordion-separator bg-stone-300 dark:bg-border" />
|
|
193
209
|
<div
|
|
194
210
|
ref={contentRef}
|
|
195
211
|
id={`accordion-content-${accordionId}`}
|
|
196
212
|
style={{
|
|
197
213
|
height,
|
|
198
|
-
transition: 'height 0.3s ease'
|
|
214
|
+
transition: 'height 0.3s ease',
|
|
199
215
|
}}
|
|
200
|
-
className="accordion-content-wrapper overflow-hidden"
|
|
216
|
+
className="accordion-content-wrapper overflow-hidden border-x border-b border-stone-300/10 bg-stone-50 dark:border-stone-800 dark:bg-transparent"
|
|
201
217
|
>
|
|
202
218
|
<RichText
|
|
203
|
-
className="p-4
|
|
219
|
+
className="bg-stone-100/80 p-4 text-stone-700 dark:bg-[rgba(159,159,159,0.18)] dark:text-stone-200"
|
|
204
220
|
data={content as any}
|
|
205
221
|
enableGutter={false}
|
|
206
222
|
/>
|
|
@@ -210,9 +226,12 @@ export const AccordionItem: React.FC<AccordionItemData & { buttonVariant?: Accor
|
|
|
210
226
|
)
|
|
211
227
|
}
|
|
212
228
|
|
|
213
|
-
export const DDAccordion: React.FC<AccordionBlockProps> = ({
|
|
229
|
+
export const DDAccordion: React.FC<AccordionBlockProps> = ({
|
|
230
|
+
items,
|
|
231
|
+
accordionButtonVariant = 'v2',
|
|
232
|
+
}) => {
|
|
214
233
|
return (
|
|
215
|
-
<div className="accordion-container max-w-
|
|
234
|
+
<div className="accordion-container mx-auto my-6 w-full max-w-5xl space-y-3 px-4">
|
|
216
235
|
{items.map((item, index) => (
|
|
217
236
|
<AccordionItem
|
|
218
237
|
key={item.accordionId || `accordion-item-${index}`}
|
|
@@ -226,4 +245,4 @@ export const DDAccordion: React.FC<AccordionBlockProps> = ({ items, accordionBut
|
|
|
226
245
|
)
|
|
227
246
|
}
|
|
228
247
|
|
|
229
|
-
export default DDAccordion
|
|
248
|
+
export default DDAccordion
|
|
@@ -1,34 +1,32 @@
|
|
|
1
|
-
import type { Block } from 'payload'
|
|
2
|
-
|
|
3
|
-
import { BlocksFeature } from '@payloadcms/richtext-lexical'
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
31
|
-
},
|
|
1
|
+
import type { Block } from 'payload'
|
|
2
|
+
|
|
3
|
+
import { BlocksFeature } from '@payloadcms/richtext-lexical'
|
|
4
|
+
import { createDefaultLexical } from '@/fields/defaultLexical'
|
|
5
|
+
|
|
6
|
+
import { DDBanner } from '@/blocks/DD-Banner/config'
|
|
7
|
+
import { Code } from '@/blocks/Code/config'
|
|
8
|
+
import { MediaBlock } from '@/blocks/MediaBlock/config'
|
|
9
|
+
import { DDAnimText } from '@/blocks/DD-AnimText/config'
|
|
10
|
+
|
|
11
|
+
export const DDAccordion: Block = {
|
|
12
|
+
slug: 'DD-Accordion',
|
|
13
|
+
interfaceName: 'DDAccordion',
|
|
14
|
+
labels: {
|
|
15
|
+
singular: 'Accordion Block',
|
|
16
|
+
plural: 'Accordion Blocks',
|
|
17
|
+
},
|
|
18
|
+
fields: [
|
|
19
|
+
{
|
|
20
|
+
name: 'accordionId',
|
|
21
|
+
type: 'text',
|
|
22
|
+
hidden: true,
|
|
23
|
+
label: 'Accordian ID',
|
|
24
|
+
required: false,
|
|
25
|
+
admin: {
|
|
26
|
+
description: 'Unique ID for the accordian block',
|
|
27
|
+
width: '50%',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
32
30
|
{
|
|
33
31
|
name: 'accordionButtonVariant',
|
|
34
32
|
type: 'select',
|
|
@@ -41,33 +39,47 @@ export const DDAccordion: Block = {
|
|
|
41
39
|
{ label: 'Gradient Sheen', value: 'v2' },
|
|
42
40
|
{ label: 'Contrast Sweep', value: 'v3' },
|
|
43
41
|
{ label: 'Reveal Panel', value: 'v5' },
|
|
44
|
-
{ label: 'Underline Accent', value: 'v7' }
|
|
42
|
+
{ label: 'Underline Accent', value: 'v7' },
|
|
45
43
|
],
|
|
46
44
|
admin: {
|
|
47
|
-
description:
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
45
|
+
description:
|
|
46
|
+
'Selects the local ButtonAccord visual treatment for every accordion title button.',
|
|
47
|
+
width: '50%',
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'items',
|
|
52
|
+
type: 'array',
|
|
53
|
+
label: 'Accordion Items',
|
|
54
|
+
required: true,
|
|
55
|
+
fields: [
|
|
56
|
+
{
|
|
57
|
+
name: 'title',
|
|
58
|
+
label: 'Accordian Title',
|
|
59
|
+
type: 'richText',
|
|
60
|
+
editor: createDefaultLexical({
|
|
61
|
+
features: [
|
|
62
|
+
BlocksFeature({
|
|
63
|
+
blocks: [DDBanner, Code, MediaBlock, DDAnimText], // No Buttons in Button(Title)
|
|
64
|
+
}),
|
|
65
|
+
],
|
|
66
|
+
}),
|
|
67
|
+
required: false,
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'content',
|
|
71
|
+
label: 'Accordian Content',
|
|
72
|
+
type: 'richText',
|
|
73
|
+
editor: createDefaultLexical({
|
|
74
|
+
features: [
|
|
75
|
+
BlocksFeature({
|
|
76
|
+
blocks: [DDBanner, Code, MediaBlock, DDAnimText], // No Buttons in Button(Title)
|
|
77
|
+
}),
|
|
78
|
+
],
|
|
79
|
+
}),
|
|
80
|
+
required: false,
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
}
|
|
@@ -66,31 +66,48 @@ type Props = {
|
|
|
66
66
|
shinyColor?: string
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
+
const VARIATION_COLOR_CLASSES: Record<NonNullable<Props['variation']>, string> = {
|
|
70
|
+
'gradual-spacing': 'text-violet-700 dark:text-violet-300',
|
|
71
|
+
typing: 'text-blue-700 dark:text-blue-300',
|
|
72
|
+
'staggered-fade': 'text-emerald-700 dark:text-emerald-300',
|
|
73
|
+
rotate: 'text-amber-700 dark:text-amber-300',
|
|
74
|
+
'letters-pull-up': 'text-rose-700 dark:text-rose-300',
|
|
75
|
+
'words-pull-up': 'text-cyan-700 dark:text-cyan-300',
|
|
76
|
+
'blur-in': 'text-indigo-700 dark:text-indigo-300',
|
|
77
|
+
'text-fade-up': 'text-teal-700 dark:text-teal-300',
|
|
78
|
+
'text-fade-down': 'text-orange-700 dark:text-orange-300',
|
|
79
|
+
'no-animation': 'text-slate-800 dark:text-slate-200',
|
|
80
|
+
'split-text': 'text-fuchsia-700 dark:text-fuchsia-300',
|
|
81
|
+
'text-type': 'text-sky-700 dark:text-sky-300',
|
|
82
|
+
'shuffle-text': 'text-lime-700 dark:text-lime-300',
|
|
83
|
+
'shiny-text': 'text-purple-700 dark:text-purple-300',
|
|
84
|
+
}
|
|
85
|
+
|
|
69
86
|
// Staggered Animation Variants
|
|
70
87
|
const containerVariants = {
|
|
71
88
|
hidden: {
|
|
72
|
-
opacity: 0
|
|
89
|
+
opacity: 0,
|
|
73
90
|
},
|
|
74
91
|
visible: {
|
|
75
92
|
opacity: 1,
|
|
76
93
|
transition: {
|
|
77
|
-
staggerChildren: 0.2
|
|
78
|
-
}
|
|
79
|
-
}
|
|
94
|
+
staggerChildren: 0.2,
|
|
95
|
+
},
|
|
96
|
+
},
|
|
80
97
|
}
|
|
81
98
|
|
|
82
99
|
const childVariants = {
|
|
83
100
|
hidden: {
|
|
84
101
|
opacity: 0,
|
|
85
|
-
y: 20
|
|
102
|
+
y: 20,
|
|
86
103
|
},
|
|
87
104
|
visible: {
|
|
88
105
|
opacity: 1,
|
|
89
106
|
y: 0,
|
|
90
107
|
transition: {
|
|
91
|
-
duration: 0.5
|
|
92
|
-
}
|
|
93
|
-
}
|
|
108
|
+
duration: 0.5,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
94
111
|
}
|
|
95
112
|
|
|
96
113
|
// Inline SplitText Component with scroll trigger repeat
|
|
@@ -113,7 +130,7 @@ export const SplitText: React.FC<SplitTextProps> = ({
|
|
|
113
130
|
ease = 'back.out(1.7)',
|
|
114
131
|
yOffset = 80,
|
|
115
132
|
opacity = true,
|
|
116
|
-
trigger = 'view'
|
|
133
|
+
trigger = 'view',
|
|
117
134
|
}) => {
|
|
118
135
|
const ref = useRef<HTMLParagraphElement>(null)
|
|
119
136
|
const [fontsLoaded, setFontsLoaded] = useState<boolean>(false)
|
|
@@ -145,7 +162,7 @@ export const SplitText: React.FC<SplitTextProps> = ({
|
|
|
145
162
|
|
|
146
163
|
const splitInstance = new GSAPSplitText(el, {
|
|
147
164
|
type: 'chars',
|
|
148
|
-
charsClass: 'split-char'
|
|
165
|
+
charsClass: 'split-char',
|
|
149
166
|
})
|
|
150
167
|
|
|
151
168
|
const chars = splitInstance.chars || []
|
|
@@ -153,7 +170,7 @@ export const SplitText: React.FC<SplitTextProps> = ({
|
|
|
153
170
|
// Set initial state
|
|
154
171
|
gsap.set(chars, {
|
|
155
172
|
opacity: opacity ? 0 : 1,
|
|
156
|
-
y: yOffset
|
|
173
|
+
y: yOffset,
|
|
157
174
|
})
|
|
158
175
|
|
|
159
176
|
const animateIn = () => {
|
|
@@ -163,7 +180,7 @@ export const SplitText: React.FC<SplitTextProps> = ({
|
|
|
163
180
|
duration,
|
|
164
181
|
ease,
|
|
165
182
|
stagger: delay,
|
|
166
|
-
force3D: true
|
|
183
|
+
force3D: true,
|
|
167
184
|
})
|
|
168
185
|
}
|
|
169
186
|
|
|
@@ -173,7 +190,7 @@ export const SplitText: React.FC<SplitTextProps> = ({
|
|
|
173
190
|
y: yOffset,
|
|
174
191
|
duration: duration * 0.5,
|
|
175
192
|
ease: 'power2.in',
|
|
176
|
-
stagger: delay * 0.5
|
|
193
|
+
stagger: delay * 0.5,
|
|
177
194
|
})
|
|
178
195
|
}
|
|
179
196
|
|
|
@@ -185,7 +202,7 @@ export const SplitText: React.FC<SplitTextProps> = ({
|
|
|
185
202
|
onEnter: animateIn,
|
|
186
203
|
onLeave: animateOut,
|
|
187
204
|
onEnterBack: animateIn,
|
|
188
|
-
onLeaveBack: animateOut
|
|
205
|
+
onLeaveBack: animateOut,
|
|
189
206
|
})
|
|
190
207
|
} else if (trigger === 'hover') {
|
|
191
208
|
el.addEventListener('mouseenter', animateIn)
|
|
@@ -215,8 +232,8 @@ export const SplitText: React.FC<SplitTextProps> = ({
|
|
|
215
232
|
},
|
|
216
233
|
{
|
|
217
234
|
dependencies: [text, delay, duration, ease, yOffset, opacity, trigger, fontsLoaded],
|
|
218
|
-
scope: ref
|
|
219
|
-
}
|
|
235
|
+
scope: ref,
|
|
236
|
+
},
|
|
220
237
|
)
|
|
221
238
|
|
|
222
239
|
return (
|
|
@@ -225,7 +242,7 @@ export const SplitText: React.FC<SplitTextProps> = ({
|
|
|
225
242
|
className={`split-parent ${className}`}
|
|
226
243
|
style={{
|
|
227
244
|
// Ensure styles are inherited by split characters
|
|
228
|
-
display: 'inline-block'
|
|
245
|
+
display: 'inline-block',
|
|
229
246
|
}}
|
|
230
247
|
>
|
|
231
248
|
{text}
|
|
@@ -251,7 +268,7 @@ export const TextType: React.FC<TextTypeProps> = ({
|
|
|
251
268
|
delay = 0,
|
|
252
269
|
showCursor = true,
|
|
253
270
|
cursorChar = '|',
|
|
254
|
-
autoStart = true
|
|
271
|
+
autoStart = true,
|
|
255
272
|
}) => {
|
|
256
273
|
const [displayedText, setDisplayedText] = useState('')
|
|
257
274
|
const [isTyping, setIsTyping] = useState(false)
|
|
@@ -295,7 +312,7 @@ export const TextType: React.FC<TextTypeProps> = ({
|
|
|
295
312
|
duration: 0.5,
|
|
296
313
|
repeat: -1,
|
|
297
314
|
yoyo: true,
|
|
298
|
-
ease: 'power2.inOut'
|
|
315
|
+
ease: 'power2.inOut',
|
|
299
316
|
})
|
|
300
317
|
}
|
|
301
318
|
}, [showCursor])
|
|
@@ -308,7 +325,7 @@ export const TextType: React.FC<TextTypeProps> = ({
|
|
|
308
325
|
trigger: containerRef.current,
|
|
309
326
|
start: 'top 80%',
|
|
310
327
|
onEnter: startTyping,
|
|
311
|
-
once: true // Only trigger once
|
|
328
|
+
once: true, // Only trigger once
|
|
312
329
|
})
|
|
313
330
|
}
|
|
314
331
|
|
|
@@ -347,7 +364,7 @@ export const Shuffle: React.FC<ShuffleProps> = ({
|
|
|
347
364
|
duration = 600,
|
|
348
365
|
speed = 100,
|
|
349
366
|
chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
|
|
350
|
-
autoStart = false
|
|
367
|
+
autoStart = false,
|
|
351
368
|
}) => {
|
|
352
369
|
const [displayText, setDisplayText] = useState(text)
|
|
353
370
|
const containerRef = useRef<HTMLDivElement>(null)
|
|
@@ -371,7 +388,7 @@ export const Shuffle: React.FC<ShuffleProps> = ({
|
|
|
371
388
|
}
|
|
372
389
|
return chars[Math.floor(Math.random() * chars.length)]
|
|
373
390
|
})
|
|
374
|
-
.join('')
|
|
391
|
+
.join(''),
|
|
375
392
|
)
|
|
376
393
|
|
|
377
394
|
if (iteration >= originalText.length) {
|
|
@@ -400,7 +417,7 @@ export const Shuffle: React.FC<ShuffleProps> = ({
|
|
|
400
417
|
onEnter: shuffle,
|
|
401
418
|
onLeave: resetText,
|
|
402
419
|
onEnterBack: shuffle,
|
|
403
|
-
onLeaveBack: resetText
|
|
420
|
+
onLeaveBack: resetText,
|
|
404
421
|
})
|
|
405
422
|
}
|
|
406
423
|
}, [shuffle, resetText, autoStart])
|
|
@@ -432,7 +449,7 @@ export const ShinyText: React.FC<ShinyTextProps> = ({
|
|
|
432
449
|
duration = 2,
|
|
433
450
|
delay = 0,
|
|
434
451
|
repeat = true,
|
|
435
|
-
color = 'rgba(255, 255, 255, 0.6)'
|
|
452
|
+
color = 'rgba(255, 255, 255, 0.6)',
|
|
436
453
|
}) => {
|
|
437
454
|
const ref = useRef<HTMLDivElement>(null)
|
|
438
455
|
const containerRef = useRef(null)
|
|
@@ -443,8 +460,8 @@ export const ShinyText: React.FC<ShinyTextProps> = ({
|
|
|
443
460
|
show: (i: number) => ({
|
|
444
461
|
y: 0,
|
|
445
462
|
opacity: 1,
|
|
446
|
-
transition: { delay: i * 0.1 }
|
|
447
|
-
})
|
|
463
|
+
transition: { delay: i * 0.1 },
|
|
464
|
+
}),
|
|
448
465
|
}
|
|
449
466
|
|
|
450
467
|
const letters = text.split('')
|
|
@@ -494,16 +511,16 @@ export const ShinyText: React.FC<ShinyTextProps> = ({
|
|
|
494
511
|
backgroundPosition: '200% 0',
|
|
495
512
|
WebkitBackgroundClip: 'text',
|
|
496
513
|
backgroundClip: 'text',
|
|
497
|
-
color: 'transparent'
|
|
514
|
+
color: 'transparent',
|
|
498
515
|
})
|
|
499
516
|
.to(ref.current, {
|
|
500
517
|
backgroundPosition: '-200% 0',
|
|
501
518
|
duration,
|
|
502
|
-
ease: 'none'
|
|
519
|
+
ease: 'none',
|
|
503
520
|
})
|
|
504
521
|
.set(ref.current, {
|
|
505
522
|
backgroundImage: 'none',
|
|
506
|
-
color: 'inherit'
|
|
523
|
+
color: 'inherit',
|
|
507
524
|
})
|
|
508
525
|
}
|
|
509
526
|
|
|
@@ -512,7 +529,7 @@ export const ShinyText: React.FC<ShinyTextProps> = ({
|
|
|
512
529
|
start: 'top 80%',
|
|
513
530
|
end: 'bottom 20%',
|
|
514
531
|
onEnter: shine,
|
|
515
|
-
onEnterBack: shine
|
|
532
|
+
onEnterBack: shine,
|
|
516
533
|
})
|
|
517
534
|
}, [duration, delay, repeat, color])
|
|
518
535
|
|
|
@@ -562,7 +579,7 @@ export const DDAnimText: React.FC<Props> = ({
|
|
|
562
579
|
shuffleDuration = 0.8,
|
|
563
580
|
// Shiny props
|
|
564
581
|
shinyDuration = 5,
|
|
565
|
-
shinyColor = 'rgba(255, 255, 255, 0.6)'
|
|
582
|
+
shinyColor = 'rgba(255, 255, 255, 0.6)',
|
|
566
583
|
}) => {
|
|
567
584
|
// Generate unique ID for this component instance
|
|
568
585
|
const uniqueId = useId()
|
|
@@ -603,7 +620,8 @@ export const DDAnimText: React.FC<Props> = ({
|
|
|
603
620
|
aniTextBoxClass,
|
|
604
621
|
className,
|
|
605
622
|
aniTextBoxContainerClass,
|
|
606
|
-
'animated-text-container'
|
|
623
|
+
'animated-text-container text-xl md:text-4xl lg:text-5xl font-medium [&_.payload-richtext]:text-current [&_.payload-richtext_*]:text-current',
|
|
624
|
+
VARIATION_COLOR_CLASSES[variation],
|
|
607
625
|
)}
|
|
608
626
|
>
|
|
609
627
|
{/* Animations that require plain text */}
|