blocks-dusted 0.1.9 → 0.1.11

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 (248) hide show
  1. package/README.md +35 -0
  2. package/package.json +1 -1
  3. package/src/utils/paths.js +13 -13
  4. package/templates/blocks/DD-Accordion/Component.tsx +229 -0
  5. package/templates/blocks/DD-Accordion/README.md +3 -0
  6. package/templates/blocks/DD-Accordion/config.ts +73 -0
  7. package/templates/blocks/DD-Accordion/manifest.json +75 -0
  8. package/templates/blocks/DD-AnimText/Component.tsx +788 -0
  9. package/templates/blocks/DD-AnimText/README.md +3 -0
  10. package/templates/blocks/DD-AnimText/config.ts +295 -0
  11. package/templates/blocks/DD-AnimText/manifest.json +85 -0
  12. package/templates/blocks/DD-AsideNav/Component.tsx +321 -0
  13. package/templates/blocks/DD-AsideNav/config.ts +204 -0
  14. package/templates/blocks/DD-AsideNav/manifest.json +80 -0
  15. package/templates/blocks/DD-Banner/Component.tsx +51 -0
  16. package/templates/blocks/DD-Banner/config.ts +57 -0
  17. package/templates/blocks/DD-Banner/manifest.json +72 -0
  18. package/templates/blocks/DD-BgLightning/Component.tsx +44 -0
  19. package/templates/blocks/DD-BgLightning/README.md +3 -0
  20. package/templates/blocks/DD-BgLightning/config.ts +97 -0
  21. package/templates/blocks/DD-BgLightning/manifest.json +79 -0
  22. package/templates/blocks/DD-BookCall/Component.tsx +10 -11
  23. package/templates/blocks/DD-BookCall/config.ts +238 -238
  24. package/templates/blocks/DD-ButtonPop/Component.tsx +117 -0
  25. package/templates/blocks/DD-ButtonPop/config.ts +105 -0
  26. package/templates/blocks/DD-ButtonPop/manifest.json +88 -0
  27. package/templates/blocks/DD-ButtonPop/svg-icons/Dust2.tsx +167 -0
  28. package/templates/blocks/DD-Card/Component.tsx +251 -0
  29. package/templates/blocks/DD-Card/README.md +4 -0
  30. package/templates/blocks/DD-Card/config.ts +154 -0
  31. package/templates/blocks/DD-Card/manifest.json +82 -0
  32. package/templates/blocks/DD-CardTemplate01/Component.tsx +5 -6
  33. package/templates/blocks/DD-CardTemplate01/config.ts +106 -106
  34. package/templates/blocks/DD-Carousel-A/Component.tsx +249 -249
  35. package/templates/blocks/DD-Carousel-B/Component.tsx +403 -403
  36. package/templates/blocks/DD-Chip/Component.tsx +250 -0
  37. package/templates/blocks/DD-Chip/EXAMPLES.md +313 -0
  38. package/templates/blocks/DD-Chip/README.md +202 -0
  39. package/templates/blocks/DD-Chip/config.ts +369 -0
  40. package/templates/blocks/DD-Chip/manifest.json +74 -0
  41. package/templates/blocks/DD-ComparisonTable/Component.tsx +256 -256
  42. package/templates/blocks/DD-Contact/Component.tsx +434 -434
  43. package/templates/blocks/DD-Contact/config.ts +22 -22
  44. package/templates/blocks/DD-Counter/Component.tsx +190 -0
  45. package/templates/blocks/DD-Counter/README.md +4 -0
  46. package/templates/blocks/DD-Counter/config.ts +291 -0
  47. package/templates/blocks/DD-Counter/manifest.json +74 -0
  48. package/templates/blocks/DD-CustomCSS/Component.tsx +8 -0
  49. package/templates/blocks/DD-CustomCSS/README.md +4 -0
  50. package/templates/blocks/DD-CustomCSS/addToLayout.md +5 -0
  51. package/templates/blocks/DD-CustomCSS/config.ts +22 -0
  52. package/templates/blocks/DD-CustomCSS/manifest.json +72 -0
  53. package/templates/blocks/DD-CustomCSS/renderCustomCSS.md +7 -0
  54. package/templates/blocks/DD-FeatCat/Component.tsx +302 -302
  55. package/templates/blocks/DD-FeatCat/config.ts +201 -201
  56. package/templates/blocks/DD-FeatStrip/Component.tsx +585 -585
  57. package/templates/blocks/DD-FeatStrip/config.ts +134 -134
  58. package/templates/blocks/DD-FluidBtn/ButtonsEyeCatching.tsx +628 -0
  59. package/templates/blocks/DD-FluidBtn/Component.tsx +43 -0
  60. package/templates/blocks/DD-FluidBtn/README.md +6 -0
  61. package/templates/blocks/DD-FluidBtn/config.ts +102 -0
  62. package/templates/blocks/DD-FluidBtn/manifest.json +86 -0
  63. package/templates/blocks/DD-GooeyInfo/Component.tsx +149 -0
  64. package/templates/blocks/DD-GooeyInfo/config.ts +135 -0
  65. package/templates/blocks/DD-GooeyInfo/manifest.json +72 -0
  66. package/templates/blocks/DD-Hero/Component.tsx +40 -17
  67. package/templates/blocks/DD-Hero/config.ts +267 -267
  68. package/templates/blocks/DD-HorizontalScroll/Component.tsx +4 -2
  69. package/templates/blocks/DD-HorizontalScroll/config.ts +231 -231
  70. package/templates/blocks/DD-Icon/Component.tsx +287 -0
  71. package/templates/blocks/DD-Icon/README.md +4 -0
  72. package/templates/blocks/DD-Icon/config.ts +258 -0
  73. package/templates/blocks/DD-Icon/hooks/revalidateBlockIds.ts +66 -0
  74. package/templates/blocks/DD-Icon/manifest.json +82 -0
  75. package/templates/blocks/DD-IconButton/Component.tsx +455 -0
  76. package/templates/blocks/DD-IconButton/README.md +326 -0
  77. package/templates/blocks/DD-IconButton/config.ts +239 -0
  78. package/templates/blocks/DD-IconButton/manifest.json +85 -0
  79. package/templates/blocks/DD-IdTag/Component.tsx +21 -0
  80. package/templates/blocks/DD-IdTag/README.md +4 -0
  81. package/templates/blocks/DD-IdTag/config.ts +41 -0
  82. package/templates/blocks/DD-IdTag/manifest.json +72 -0
  83. package/templates/blocks/DD-Iframe/Component.tsx +45 -0
  84. package/templates/blocks/DD-Iframe/README.md +4 -0
  85. package/templates/blocks/DD-Iframe/config.ts +47 -0
  86. package/templates/blocks/DD-Iframe/manifest.json +72 -0
  87. package/templates/blocks/DD-IframeMedia/Component.tsx +129 -0
  88. package/templates/blocks/DD-IframeMedia/README.md +4 -0
  89. package/templates/blocks/DD-IframeMedia/config.ts +79 -0
  90. package/templates/blocks/DD-IframeMedia/manifest.json +72 -0
  91. package/templates/blocks/DD-LineAnim/Component.tsx +36 -0
  92. package/templates/blocks/DD-LineAnim/README.md +4 -0
  93. package/templates/blocks/DD-LineAnim/config.ts +90 -0
  94. package/templates/blocks/DD-LineAnim/manifest.json +80 -0
  95. package/templates/blocks/DD-LinkGrid/Component.tsx +119 -0
  96. package/templates/blocks/DD-LinkGrid/README.md +4 -0
  97. package/templates/blocks/DD-LinkGrid/config.ts +51 -0
  98. package/templates/blocks/DD-LinkGrid/manifest.json +74 -0
  99. package/templates/blocks/DD-LogoMarq/Component.tsx +132 -0
  100. package/templates/blocks/DD-LogoMarq/README.md +4 -0
  101. package/templates/blocks/DD-LogoMarq/config.ts +264 -0
  102. package/templates/blocks/DD-LogoMarq/manifest.json +82 -0
  103. package/templates/blocks/DD-Lottie/Component.tsx +459 -0
  104. package/templates/blocks/DD-Lottie/README.md +4 -0
  105. package/templates/blocks/DD-Lottie/config.ts +379 -0
  106. package/templates/blocks/DD-Lottie/index.tsx +28 -0
  107. package/templates/blocks/DD-Lottie/manifest.json +83 -0
  108. package/templates/blocks/DD-MagicBento/Component.tsx +777 -0
  109. package/templates/blocks/DD-MagicBento/README.md +4 -0
  110. package/templates/blocks/DD-MagicBento/config.ts +264 -0
  111. package/templates/blocks/DD-MagicBento/manifest.json +74 -0
  112. package/templates/blocks/DD-MasonaryMedia/Component.tsx +547 -545
  113. package/templates/blocks/DD-MasonaryMedia/config.ts +2 -2
  114. package/templates/blocks/DD-MasonaryMedia/vendor.d.ts +2 -2
  115. package/templates/blocks/DD-Masonry/Component.tsx +645 -0
  116. package/templates/blocks/DD-Masonry/README.md +4 -0
  117. package/templates/blocks/DD-Masonry/config.ts +475 -0
  118. package/templates/blocks/DD-Masonry/manifest.json +82 -0
  119. package/templates/blocks/DD-Pricing/Component.tsx +372 -372
  120. package/templates/blocks/DD-Process/Component.tsx +149 -149
  121. package/templates/blocks/DD-Process/config.ts +150 -150
  122. package/templates/blocks/DD-Progress/Component.tsx +141 -0
  123. package/templates/blocks/DD-Progress/README.md +4 -0
  124. package/templates/blocks/DD-Progress/config.ts +175 -0
  125. package/templates/blocks/DD-Progress/manifest.json +74 -0
  126. package/templates/blocks/DD-ProjHeader/Component.tsx +91 -0
  127. package/templates/blocks/DD-ProjHeader/README.md +4 -0
  128. package/templates/blocks/DD-ProjHeader/config.ts +96 -0
  129. package/templates/blocks/DD-ProjHeader/manifest.json +72 -0
  130. package/templates/blocks/DD-ProjSlider/Component.tsx +123 -0
  131. package/templates/blocks/DD-ProjSlider/README.md +4 -0
  132. package/templates/blocks/DD-ProjSlider/config.ts +64 -0
  133. package/templates/blocks/DD-ProjSlider/manifest.json +72 -0
  134. package/templates/blocks/DD-ScrollText/Component.tsx +114 -0
  135. package/templates/blocks/DD-ScrollText/README.md +4 -0
  136. package/templates/blocks/DD-ScrollText/config.ts +58 -0
  137. package/templates/blocks/DD-ScrollText/manifest.json +72 -0
  138. package/templates/blocks/DD-Section/Component.tsx +266 -266
  139. package/templates/blocks/DD-Separator/Component.tsx +66 -0
  140. package/templates/blocks/DD-Separator/README.md +4 -0
  141. package/templates/blocks/DD-Separator/config.ts +58 -0
  142. package/templates/blocks/DD-Separator/manifest.json +72 -0
  143. package/templates/blocks/DD-Services/Component.tsx +176 -176
  144. package/templates/blocks/DD-Services/config.ts +149 -149
  145. package/templates/blocks/DD-ShowcaseGrid/Component.tsx +307 -307
  146. package/templates/blocks/DD-Slider-A/Component.tsx +237 -237
  147. package/templates/blocks/DD-StackCards/Component.tsx +473 -473
  148. package/templates/blocks/DD-StackCards/config.ts +399 -399
  149. package/templates/blocks/DD-Team/Component.tsx +247 -247
  150. package/templates/blocks/DD-Team/config.ts +173 -173
  151. package/templates/blocks/DD-TeamCards/Component.tsx +251 -0
  152. package/templates/blocks/DD-TeamCards/README.md +4 -0
  153. package/templates/blocks/DD-TeamCards/config.ts +302 -0
  154. package/templates/blocks/DD-TeamCards/manifest.json +74 -0
  155. package/templates/blocks/DD-TechStack/Component.tsx +168 -162
  156. package/templates/blocks/DD-TechStack/config.ts +153 -153
  157. package/templates/blocks/DD-TestMarq/Component.tsx +132 -0
  158. package/templates/blocks/DD-TestMarq/README.md +4 -0
  159. package/templates/blocks/DD-TestMarq/RowLabel.tsx +9 -0
  160. package/templates/blocks/DD-TestMarq/config.ts +88 -0
  161. package/templates/blocks/DD-TestMarq/manifest.json +72 -0
  162. package/templates/blocks/DD-Testim/Component.tsx +247 -0
  163. package/templates/blocks/DD-Testim/README.md +4 -0
  164. package/templates/blocks/DD-Testim/config.ts +101 -0
  165. package/templates/blocks/DD-Testim/manifest.json +75 -0
  166. package/templates/blocks/DD-Testim2/Component.tsx +256 -0
  167. package/templates/blocks/DD-Testim2/README.md +4 -0
  168. package/templates/blocks/DD-Testim2/config.ts +100 -0
  169. package/templates/blocks/DD-Testim2/manifest.json +74 -0
  170. package/templates/blocks/DD-Testimonials/Component.tsx +147 -147
  171. package/templates/blocks/DD-Testimonials/config.ts +120 -120
  172. package/templates/blocks/DD-TextMarq/Component.tsx +157 -0
  173. package/templates/blocks/DD-TextMarq/README.md +4 -0
  174. package/templates/blocks/DD-TextMarq/config.ts +237 -0
  175. package/templates/blocks/DD-TextMarq/manifest.json +82 -0
  176. package/templates/blocks/DD-Thanks/Component.tsx +500 -0
  177. package/templates/blocks/DD-Thanks/README.md +4 -0
  178. package/templates/blocks/DD-Thanks/config.ts +224 -0
  179. package/templates/blocks/DD-Thanks/manifest.json +72 -0
  180. package/templates/blocks/DD-VertMarq/Component.tsx +154 -0
  181. package/templates/blocks/DD-VertMarq/README.md +4 -0
  182. package/templates/blocks/DD-VertMarq/config.ts +236 -0
  183. package/templates/blocks/DD-VertMarq/dist/index.css +6 -0
  184. package/templates/blocks/DD-VertMarq/dist/index.min.css +1 -0
  185. package/templates/blocks/DD-VertMarq/manifest.json +74 -0
  186. package/templates/blocks/DD-Work/Component.tsx +318 -315
  187. package/templates/blocks/DD-Work/config.ts +165 -165
  188. package/templates/blocks/DD-Work-B/Component.tsx +294 -294
  189. package/templates/blocks/DDHG-CTASection2/Component.tsx +185 -0
  190. package/templates/blocks/DDHG-CTASection2/config.ts +140 -0
  191. package/templates/blocks/DDHG-CTASection2/manifest.json +45 -0
  192. package/templates/blocks/DDHG-HighlightArc/Component.tsx +243 -0
  193. package/templates/blocks/DDHG-HighlightArc/config.ts +85 -0
  194. package/templates/blocks/DDHG-HighlightArc/manifest.json +46 -0
  195. package/templates/blocks/DDHG-LogoMarquee/Component.tsx +93 -0
  196. package/templates/blocks/DDHG-LogoMarquee/config.ts +66 -0
  197. package/templates/blocks/DDHG-LogoMarquee/manifest.json +39 -0
  198. package/templates/blocks/DDHG-NavCodeGrid/Component.tsx +213 -0
  199. package/templates/blocks/DDHG-NavCodeGrid/config.ts +64 -0
  200. package/templates/blocks/DDHG-NavCodeGrid/manifest.json +45 -0
  201. package/templates/blocks/DDHG-ProcessSec/Component.tsx +575 -0
  202. package/templates/blocks/DDHG-ProcessSec/config.ts +170 -0
  203. package/templates/blocks/DDHG-ProcessSec/manifest.json +56 -0
  204. package/templates/blocks/DDHG-ServiceDetails/Component.tsx +164 -0
  205. package/templates/blocks/DDHG-ServiceDetails/ServiceDetailCard.tsx +394 -0
  206. package/templates/blocks/DDHG-ServiceDetails/config.ts +77 -0
  207. package/templates/blocks/DDHG-ServiceDetails/manifest.json +50 -0
  208. package/templates/blocks/DDHG-ServiceHero/Component.tsx +234 -0
  209. package/templates/blocks/DDHG-ServiceHero/config.ts +49 -0
  210. package/templates/blocks/DDHG-ServiceHero/manifest.json +26 -0
  211. package/templates/blocks/DDHG-ServiceOverview/Component.tsx +277 -0
  212. package/templates/blocks/DDHG-ServiceOverview/config.ts +64 -0
  213. package/templates/blocks/DDHG-ServiceOverview/manifest.json +44 -0
  214. package/templates/blocks/DDHG-StatsFAQ/Component.tsx +389 -0
  215. package/templates/blocks/DDHG-StatsFAQ/config.ts +204 -0
  216. package/templates/blocks/DDHG-StatsFAQ/manifest.json +45 -0
  217. package/templates/blocks/DDHG-TeamCards/Component.tsx +131 -0
  218. package/templates/blocks/DDHG-TeamCards/config.ts +48 -0
  219. package/templates/blocks/DDHG-TeamCards/manifest.json +29 -0
  220. package/templates/components/HeaderDD02/MobileBottomNav/index.tsx +352 -257
  221. package/templates/components/HeaderDD02/index.tsx +313 -229
  222. package/templates/shared/src/components/BgLightning/index.tsx +242 -0
  223. package/templates/shared/src/components/ui/ShareButton/index.tsx +80 -0
  224. package/templates/shared/src/components/ui/anims/FadeOnScroll.tsx +48 -0
  225. package/templates/shared/src/components/ui/anims/FadeUpOnInView.tsx +63 -0
  226. package/templates/shared/src/components/ui/anims/GlareHover.tsx +111 -0
  227. package/templates/shared/src/components/ui/anims/LineAnims.tsx +81 -0
  228. package/templates/shared/src/components/ui/anims/TitleAnims01.tsx +54 -0
  229. package/templates/shared/src/components/ui/anims/animation-container.tsx +29 -0
  230. package/templates/shared/src/components/ui/anims/blur-in.tsx +26 -0
  231. package/templates/shared/src/components/ui/anims/counter.tsx +53 -0
  232. package/templates/shared/src/components/ui/anims/fade.tsx +83 -0
  233. package/templates/shared/src/components/ui/anims/gradual-spacing.tsx +39 -0
  234. package/templates/shared/src/components/ui/anims/pull-up.tsx +93 -0
  235. package/templates/shared/src/components/ui/anims/reveal-text.tsx +76 -0
  236. package/templates/shared/src/components/ui/anims/rotate-words.tsx +43 -0
  237. package/templates/shared/src/components/ui/anims/shiny-text.tsx +58 -0
  238. package/templates/shared/src/components/ui/anims/shuffle-text.tsx +85 -0
  239. package/templates/shared/src/components/ui/anims/split-text.tsx +211 -0
  240. package/templates/shared/src/components/ui/anims/staggered-fade.tsx +133 -0
  241. package/templates/shared/src/components/ui/anims/text-scroll.tsx +111 -0
  242. package/templates/shared/src/components/ui/anims/typing-effect.tsx +112 -0
  243. package/templates/shared/src/components/ui/button-dusted-fluid/index.tsx +1521 -0
  244. package/templates/shared/src/components/ui/separator.tsx +85 -0
  245. package/templates/shared/src/hooks/useBodyScrollLock.ts +97 -0
  246. package/templates/shared/src/hooks/useClickOutside.ts +28 -0
  247. package/templates/shared/src/utilities/renderCustomCSS.ts +5 -0
  248. package/templates/shared/src/utilities/smoothScroll.ts +65 -0
@@ -0,0 +1,628 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import Link from 'next/link'
5
+ import { usePathname, useRouter } from 'next/navigation'
6
+ import { cn } from '@/utilities/ui'
7
+ import { Button, type ButtonProps } from '@/components/ui/button'
8
+ import type { Page, Post } from '@/payload-types'
9
+ import * as LucideIcons from 'lucide-react'
10
+ const useDrawerClose = () => undefined
11
+
12
+ // import './index.scss'
13
+
14
+
15
+ const useDrawerCloseIfAvailable = () => {
16
+ try {
17
+ return useDrawerClose()
18
+ } catch {
19
+ return undefined
20
+ }
21
+ }
22
+
23
+ export type ButtonsEyeCatchingProps = {
24
+ variant?: 'v1' | 'v2' | 'v3' | 'v4' | 'v5' | 'v6' | 'v7'
25
+ label?: string
26
+ displayMode?: 'iconWithLabel' | 'iconOnly' | 'labelOnly'
27
+ iconPosition?: 'before' | 'after'
28
+ iconName?: string
29
+ type?: 'custom' | 'reference' | null
30
+ reference?: {
31
+ relationTo: 'pages' | 'posts'
32
+ value: Page | Post | string | number
33
+ } | null
34
+ url?: string | null
35
+ newTab?: boolean
36
+ size?: ButtonProps['size']
37
+ className?: string
38
+ wrapperClassName?: string
39
+ fullWidth?: boolean
40
+ disabled?: ButtonProps['disabled']
41
+ closeDrawerOnClick?: boolean
42
+ onClick?: (e: React.MouseEvent<HTMLButtonElement>) => void
43
+ onMouseEnter?: (e: React.MouseEvent<HTMLButtonElement>) => void
44
+ onSubmit?: (e: React.FormEvent<HTMLButtonElement>) => void
45
+ form?: string
46
+ htmlType?: 'submit' | 'button' | 'reset'
47
+ }
48
+
49
+ const getCollectionPath = (relationTo: string) => {
50
+ return relationTo === 'posts' ? 'posts' : relationTo
51
+ }
52
+
53
+ const getHref = (props: ButtonsEyeCatchingProps): string | null => {
54
+ const { type, reference, url } = props
55
+
56
+ if (type === 'reference' && reference?.value) {
57
+ const slug =
58
+ typeof reference.value === 'object' && 'slug' in reference.value
59
+ ? reference.value.slug
60
+ : typeof reference.value === 'string'
61
+ ? reference.value
62
+ : null
63
+
64
+ if (!slug) return null
65
+
66
+ const basePath =
67
+ reference.relationTo === 'pages' ? '' : `/${getCollectionPath(reference.relationTo)}`
68
+
69
+ return `${basePath}/${slug}`
70
+ }
71
+
72
+ return url || null
73
+ }
74
+
75
+ const LinkWrapper: React.FC<
76
+ React.PropsWithChildren<{
77
+ href: string
78
+ newTab?: boolean
79
+ onClick?: () => void
80
+ className?: string
81
+ closeDrawerOnClick?: boolean
82
+ }>
83
+ > = ({ href, newTab, onClick, className, children, closeDrawerOnClick = true }) => {
84
+ const closeDrawer = useDrawerClose?.() || (() => {})
85
+ const pathname = usePathname()
86
+
87
+ const hashIndex = href.indexOf('#')
88
+ const hasHash = hashIndex >= 0
89
+ const basePath = hasHash ? href.slice(0, hashIndex) : href
90
+ const hash = hasHash ? href.slice(hashIndex) : ''
91
+
92
+ const normalise = (p?: string) => (p ? p.replace(/\/$/, '') : '')
93
+ const isSamePageHash = hasHash && (basePath === '' || normalise(basePath) === normalise(pathname))
94
+
95
+ const handleClick = (e: React.MouseEvent) => {
96
+ onClick?.()
97
+
98
+ if (isSamePageHash && hash) {
99
+ e.preventDefault()
100
+
101
+ const targetId = hash.slice(1)
102
+ const el = document.getElementById(targetId)
103
+
104
+ if (el) {
105
+ el.scrollIntoView({ behavior: 'smooth', block: 'start' })
106
+ window.history.pushState(null, '', href)
107
+ }
108
+
109
+ if (closeDrawerOnClick) {
110
+ closeDrawer()
111
+ }
112
+
113
+ return
114
+ }
115
+
116
+ if (closeDrawerOnClick && !newTab) {
117
+ closeDrawer()
118
+ }
119
+ }
120
+
121
+ const newTabProps = newTab ? { rel: 'noopener noreferrer', target: '_blank' } : {}
122
+
123
+ return (
124
+ <Link href={href} {...newTabProps} onClick={handleClick} className={className} prefetch>
125
+ {children}
126
+ </Link>
127
+ )
128
+ }
129
+ function GlassChip() {
130
+ return (
131
+ <div className="absolute w-full h-full group mx-auto left-0 right-0 rounded-2xl squircle overflow-hidden">
132
+ <div
133
+ className="
134
+ absolute inset-0 mx-auto
135
+ flex items-center justify-center
136
+ overflow-hidden
137
+ rounded-full
138
+ border-t border-b border-white/10
139
+ bg-white/[0.05]
140
+ text-white
141
+ text-[18px]
142
+ font-bold
143
+ tracking-[1px]
144
+ backdrop-blur-[15px]
145
+ shadow-[0_15px_35px_rgba(255,255,255,0.15)]
146
+ transition-all duration-500
147
+ hover:tracking-[2px]
148
+
149
+ before:absolute
150
+ before:left-0
151
+ before:top-0
152
+ before:h-full
153
+ before:w-1/2
154
+ before:skew-x-[45deg]
155
+ before:bg-[linear-gradient(to_left,rgba(255,255,255,0.22),transparent)]
156
+ before:transition-transform
157
+ before:duration-700
158
+ hover:before:translate-x-[220%]
159
+
160
+ after:absolute
161
+ after:inset-[1px]
162
+ after:rounded-full
163
+ after:border
164
+ after:border-white/10
165
+ after:shadow-[inset_0_1px_0_rgba(255,255,255,0.45),inset_0_-8px_18px_rgba(0,0,0,0.25)]
166
+ "
167
+ ></div>
168
+
169
+ <div
170
+ className="
171
+ absolute left-1/2 -translate-x-1/2
172
+ -top-[3px]
173
+ h-[8px] w-[30px]
174
+ rounded-full
175
+ bg-[#ba55d3]
176
+ shadow-[0_0_5px_#663399,0_0_15px_#ba55d3,0_0_30px_#663399,0_0_60px_#ff00ff]
177
+ transition-all duration-500
178
+ group-hover:top-0
179
+ group-hover:bg-[#ba55d355]
180
+ group-hover:h-full
181
+ group-hover:w-[80%]
182
+ group-hover:rounded-full
183
+ group-hover:delay-300
184
+ "
185
+ />
186
+
187
+ <div
188
+ className="
189
+ absolute left-1/2 -translate-x-1/2
190
+ -bottom-[3px]
191
+ h-[8px] w-[30px]
192
+ rounded-full
193
+ bg-[#ba55d3]
194
+ shadow-[0_0_5px_#663399,0_0_15px_#ba55d3,0_0_30px_#663399,0_0_60px_#ff00ff]
195
+ transition-all duration-500
196
+ group-hover:bottom-0
197
+ group-hover:bg-[#ba55d399]
198
+ group-hover:h-full
199
+ group-hover:brightness-150
200
+ group-hover:w-[80%]
201
+ group-hover:rounded-full
202
+ group-hover:delay-300
203
+ "
204
+ />
205
+ </div>
206
+ )
207
+ }
208
+ function EyeCatchingButton_v1(props: ButtonProps & { wrapperClassName?: string }) {
209
+ const { wrapperClassName, size = 'default', children, ...buttonProps } = props
210
+
211
+ const sizeClasses = {
212
+ sm: 'h-8 w-fit',
213
+ default: 'h-10 w-40',
214
+ lg: 'h-12 w-48',
215
+ icon: 'h-10 w-10',
216
+ clear: ''
217
+ }
218
+
219
+ return (
220
+ <div
221
+ className={cn(
222
+ sizeClasses[size || 'default'],
223
+ wrapperClassName,
224
+ 'relative min-w-fit overflow-hidden rounded-2xl p-0.5 font-semibold group',
225
+ 'border-1 border-stone-800/20',
226
+ '-bg-card !dark:bg-zinc-900',
227
+ 'shadow',
228
+ 'drop-shadow-[2px_4px_6px_rgba(0,0,0,0.25)]',
229
+ 'transition-all duration-300 hover:duration-300',
230
+ 'hover:-translate-y-0.5 hover:scale-[1]',
231
+ 'hover:!bg-[rgba(102,51,153,1)] hover:border-0 hover:border-[#985fd023] hover:drop-shadow-[inset_0px_0px_6px_rgba(102,51,153,1)]'
232
+ )}
233
+ >
234
+ <GlassChip />
235
+
236
+ <span className="absolute inset-[-1000%] animate-[spin_5s_linear_infinite] dark:bg-[conic-gradient(from_90deg_at_50%_50%,#fff_0%,#4a4a4a_7%)] bg-[conic-gradient(from_90deg_at_50%_50%,#000_0%,#fff_5%)] group-hover:bg-none rounded-2xl overflow-hidden blur-[4px] brightness-[1.2]" />
237
+
238
+ <Button
239
+ {...buttonProps}
240
+ className={cn(
241
+ buttonProps.className,
242
+ 'h-full w-full rounded-full text-zinc-800 dark:text-zinc-200 backdrop-blur-xl -bg-card dark:!bg-zinc-900 flex items-center justify-center gap-2',
243
+ 'border-2 border-ridge border-[#938eab8c]',
244
+ 'group-hover:shadow-[inset_0_1px_6px_rgba(255,255,255,0.28),inset_0_-8px_18px_rgba(0,0,0,0.22)]',
245
+ 'group-active:translate-y-[1px] group-active:scale-[0.985]',
246
+ // 'group-active:bg-[rgba(74,35,120,0.95)]',
247
+ 'group-active:shadow-[inset_0_3px_10px_rgba(0,0,0,0.45),inset_0_1px_2px_rgba(255,255,255,0.18)]',
248
+ 'group-active:duration-75'
249
+ )}
250
+ >
251
+ {children}
252
+ </Button>
253
+ </div>
254
+ )
255
+ }
256
+
257
+ function EyeCatchingButton_v2(props: ButtonProps & { wrapperClassName?: string }) {
258
+ const { wrapperClassName, size = 'default', children, ...buttonProps } = props
259
+
260
+ const sizeClasses = {
261
+ sm: 'h-8',
262
+ default: 'h-10',
263
+ lg: 'h-12',
264
+ icon: 'h-10 w-10',
265
+ clear: ''
266
+ }
267
+
268
+ return (
269
+ <div
270
+ className={cn(
271
+ 'eyecatchingbtn-2',
272
+ sizeClasses[size || 'default'],
273
+ wrapperClassName,
274
+ 'relative overflow-hidden rounded-2xl dark:bg-card-purple bg-violet-600 shadow border dark:border-stone-900/50 group border-stone-400 p-0.5 min-w-fit hover:bg-violet-600 hover:brightness-110 duration-300 hover:duration-300 transition-all font-semibold',
275
+ 'transition-all duration-300 ease-out',
276
+ 'hover:-translate-y-0.5 hover:scale-[1]',
277
+ 'hover:border-[#985fd066] hover:shadow-[0_0_22px_rgba(152,95,208,0.32)] hover:drop-shadow-[0_8px_18px_rgba(102,51,153,0.35)]',
278
+ 'active:translate-y-0 active:scale-[0.975]',
279
+ 'active:shadow-[inset_0_2px_10px_rgba(0,0,0,0.35),0_0_10px_rgba(152,95,208,0.25)]',
280
+ 'active:duration-75'
281
+ )}
282
+ >
283
+ <GlassChip />
284
+ <span className="absolute inset-[-1000%] animate-[spin_5s_linear_infinite] dark:bg-[conic-gradient(from_90deg_at_50%_50%,#fff_0%,#4a4a4a_7%)] bg-[conic-gradient(from_90deg_at_50%_50%,#000_0%,#fff_5%)] group-hover:bg-none rounded-2xl overflow-hidden blur-[4px] brightness-[1.2]" />
285
+ <Button
286
+ {...buttonProps}
287
+ className={cn(
288
+ buttonProps.className,
289
+ 'h-full w-full rounded-full text-zinc-800 dark:text-zinc-200 backdrop-blur-xl bg-card-purple dark:bg-zinc-900 flex items-center justify-center gap-2'
290
+ )}
291
+ >
292
+ {children}
293
+ </Button>
294
+ </div>
295
+ )
296
+ }
297
+
298
+ function EyeCatchingButton_v3(props: ButtonProps & { wrapperClassName?: string }) {
299
+ const { wrapperClassName, size = 'default', children, ...buttonProps } = props
300
+
301
+ const sizeClasses = {
302
+ sm: 'h-8 w-fit',
303
+ default: 'h-10 w-40',
304
+ lg: 'h-12 w-48',
305
+ icon: 'h-10 w-10',
306
+ clear: ''
307
+ }
308
+
309
+ return (
310
+ <div
311
+ className={cn(
312
+ sizeClasses[size || 'default'],
313
+ wrapperClassName,
314
+ 'relative overflow-hidden rounded-2xl dark:bg-card-purple bg-violet-600 shadow border dark:border-[rgba(132,43,222,0.5)] group border-[rgba(132,43,222,0.5)] p-0.5 min-w-fit hover:bg-violet-600 hover:brightness-110 duration-300 hover:duration-300 transition-all font-semibold drop-shadow-xl'
315
+ // 'relative min-w-fit overflow-hidden rounded-2xl p-0.5 font-semibold group',
316
+ // 'border-2 border-[rgba(132,43,222,0.915)]',
317
+ // '!bg-[rgba(102,51,153,0.551)]',
318
+ // 'drop-shadow-[2px_4px_6px_rgba(0,0,0,0.25)]',
319
+ // 'transition-all duration-300 hover:duration-300 ease-in-out',
320
+ // 'hover:!bg-[rgba(102,51,153,0.842)] hover:!mix-blend-normal hover:brightness-110'
321
+ )}
322
+ >
323
+ <span className="absolute inset-[-1000%] animate-[spin_5s_linear_infinite_reverse] dark:bg-[conic-gradient(from_90deg_at_50%_50%,#fff_0%,#4a4a4a_7%)] bg-[conic-gradient(from_90deg_at_50%_50%,#000_0%,#fff_5%)] group-hover:bg-none blur-[4px] brightness-[1.2]" />
324
+ <Button
325
+ {...buttonProps}
326
+ className={cn(
327
+ buttonProps.className,
328
+ 'h-full w-full rounded-full text-zinc-800 dark:text-zinc-800 backdrop-blur-xl bg-[radial-gradient(circle_at_center,_#e4e0e0,_#9b9898)] dark:bg-[radial-gradient(circle_at_center,_#e4e0e0,_#9b9898)] --bg-zinc-300 --dark:bg-zinc-300 flex items-center justify-center gap-2 drop-shadow-md'
329
+ )}
330
+ >
331
+ {children}
332
+ </Button>
333
+ </div>
334
+ )
335
+ }
336
+
337
+ function EyeCatchingButton_v4(props: ButtonProps & { wrapperClassName?: string }) {
338
+ const { wrapperClassName, size = 'default', children, ...buttonProps } = props
339
+
340
+ const sizeClasses = {
341
+ sm: 'h-8',
342
+ default: 'h-10',
343
+ lg: 'h-12',
344
+ icon: 'h-10 w-10',
345
+ clear: ''
346
+ }
347
+
348
+ return (
349
+ <div
350
+ className={cn(
351
+ 'relative !rounded-full min-w-fit inline-flex items-center gap-1',
352
+ sizeClasses[size || 'default'],
353
+ wrapperClassName
354
+ )}
355
+ >
356
+ <Button
357
+ {...buttonProps}
358
+ className={cn(
359
+ 'w-full animate-bg-shine border-[1px] rounded-full bg-card shadow-xl bg-[length:200%_100%] tracking-wide flex items-center justify-center gap-2',
360
+ 'dark:bg-[linear-gradient(110deg,#09090B,45%,#27272A,55%,#09090B)] dark:text-zinc-200 dark:border-stone-800 font-semibold',
361
+ 'bg-[linear-gradient(110deg,#FFF,45%,#E4E4E7,55%,#FFF)] text-zinc-800 border-stone-300',
362
+ 'hover:border-violet-500 hover:outline hover:outline-2 hover:outline-offset-1 hover:outline-violet-600',
363
+ buttonProps.className
364
+ )}
365
+ >
366
+ {children}
367
+ </Button>
368
+ </div>
369
+ )
370
+ }
371
+
372
+ function EyeCatchingButton_v5(props: ButtonProps & { wrapperClassName?: string }) {
373
+ const { wrapperClassName, size = 'default', children, ...buttonProps } = props
374
+
375
+ const sizeClasses = {
376
+ sm: 'h-8',
377
+ default: 'h-10',
378
+ lg: 'h-12',
379
+ icon: 'h-10 w-10',
380
+ clear: ''
381
+ }
382
+
383
+ return (
384
+ <div
385
+ className={cn(
386
+ 'relative !rounded-full min-w-fit inline-flex items-center gap-1',
387
+ sizeClasses[size || 'default'],
388
+ wrapperClassName
389
+ )}
390
+ >
391
+ <Button
392
+ {...buttonProps}
393
+ className={cn(
394
+ 'w-full border border-stone-800 rounded-full shadow-xl tracking-wide flex items-center justify-center gap-2',
395
+ 'bg-[radial-gradient(circle,_rgba(255,_255,_255,_1),_rgba(230,_230,_235,_0.95))] bg-[length:200%_100%] animate-bg-shine',
396
+ '!text-stone-950 hover:text-stone-950 font-semibold',
397
+ 'hover:border-violet-500 hover:outline hover:outline-2 hover:outline-offset-1 hover:outline-violet-600',
398
+ buttonProps.className
399
+ )}
400
+ >
401
+ {children}
402
+ </Button>
403
+ </div>
404
+ )
405
+ }
406
+
407
+ function EyeCatchingButton_v6(props: ButtonProps & { wrapperClassName?: string }) {
408
+ const { wrapperClassName, size = 'default', children, ...buttonProps } = props
409
+
410
+ const sizeClasses = {
411
+ sm: 'h-8',
412
+ default: 'h-10',
413
+ lg: 'h-12',
414
+ icon: 'h-10 w-10',
415
+ clear: ''
416
+ }
417
+
418
+ return (
419
+ <div
420
+ className={cn(
421
+ 'relative !rounded-full min-w-fit inline-flex items-center gap-1',
422
+ sizeClasses[size || 'default'],
423
+ wrapperClassName
424
+ )}
425
+ >
426
+ <Button
427
+ {...buttonProps}
428
+ className={cn(
429
+ 'w-full border border-stone-800 rounded-full shadow-xl tracking-wide flex items-center justify-center gap-2',
430
+ 'bg-[radial-gradient(circle,_rgba(190,_242,_100,_1),_rgba(132,_204,_22,_0.95))] bg-[length:200%_100%] animate-bg-shine',
431
+ '!text-stone-950 hover:text-stone-950 font-semibold',
432
+ 'hover:border-violet-500 hover:outline hover:outline-2 hover:outline-offset-1 hover:outline-violet-600',
433
+ buttonProps.className
434
+ )}
435
+ >
436
+ {children}
437
+ </Button>
438
+ </div>
439
+ )
440
+ }
441
+
442
+ function EyeCatchingButton_v7(props: ButtonProps & { wrapperClassName?: string }) {
443
+ const { wrapperClassName, size = 'default', children, ...buttonProps } = props
444
+
445
+ const sizeClasses = {
446
+ sm: 'text-sm',
447
+ default: 'text-base',
448
+ lg: 'text-lg',
449
+ icon: 'text-base',
450
+ clear: ''
451
+ }
452
+
453
+ return (
454
+ <div className={cn('relative inline-flex items-center min-w-fit', wrapperClassName)}>
455
+ <Button
456
+ {...buttonProps}
457
+ variant="ghost"
458
+ className={cn(
459
+ 'p-0 h-auto bg-transparent shadow-none border-0 rounded-none',
460
+ 'tracking-wide underline-none hover:brightness-110',
461
+ 'text-zinc-800 dark:text-zinc-200 font-semibold',
462
+ 'hover:text-violet-300 transition-colors duration-200',
463
+ sizeClasses[size || 'default'],
464
+ buttonProps.className
465
+ )}
466
+ >
467
+ {children}
468
+ </Button>
469
+ </div>
470
+ )
471
+ }
472
+
473
+ function renderVariant(
474
+ variant: NonNullable<ButtonsEyeCatchingProps['variant']>,
475
+ props: ButtonProps & { wrapperClassName?: string }
476
+ ) {
477
+ switch (variant) {
478
+ case 'v1':
479
+ return <EyeCatchingButton_v1 {...props} />
480
+ case 'v2':
481
+ return <EyeCatchingButton_v2 {...props} />
482
+ case 'v3':
483
+ return <EyeCatchingButton_v3 {...props} />
484
+ case 'v4':
485
+ return <EyeCatchingButton_v4 {...props} />
486
+ case 'v5':
487
+ return <EyeCatchingButton_v5 {...props} />
488
+ case 'v6':
489
+ return <EyeCatchingButton_v6 {...props} />
490
+ case 'v7':
491
+ return <EyeCatchingButton_v7 {...props} />
492
+ default:
493
+ return <EyeCatchingButton_v1 {...props} />
494
+ }
495
+ }
496
+
497
+ export const ButtonsEyeCatching = ({
498
+ variant = 'v1',
499
+ label,
500
+ displayMode = 'iconWithLabel',
501
+ iconPosition = 'before',
502
+ iconName,
503
+ type: linkType,
504
+ reference,
505
+ url,
506
+ newTab,
507
+ size,
508
+ className,
509
+ wrapperClassName,
510
+ fullWidth,
511
+ disabled,
512
+ closeDrawerOnClick = true,
513
+ onClick,
514
+ onMouseEnter,
515
+ onSubmit,
516
+ form,
517
+ htmlType
518
+ }: ButtonsEyeCatchingProps) => {
519
+ const closeDrawer = useDrawerClose?.() || (() => {})
520
+ const router = useRouter()
521
+ const pathname = usePathname()
522
+
523
+ const href = getHref({ type: linkType, reference, url, label })
524
+
525
+ const IconComponent =
526
+ iconName && LucideIcons[iconName as keyof typeof LucideIcons]
527
+ ? (LucideIcons[iconName as keyof typeof LucideIcons] as React.ComponentType<{
528
+ className?: string
529
+ }>)
530
+ : null
531
+
532
+ const hashIndex = href?.indexOf('#') ?? -1
533
+ const hasHash = hashIndex >= 0
534
+ const basePath = hasHash && href ? href.slice(0, hashIndex) : href
535
+ const hash = hasHash && href ? href.slice(hashIndex) : ''
536
+
537
+ const normalise = (p?: string) => (p ? p.replace(/\/$/, '') : '')
538
+ const isSamePageHash =
539
+ hasHash && (basePath === '' || normalise(basePath ?? undefined) === normalise(pathname))
540
+
541
+ const handleClick = (e: React.MouseEvent<HTMLButtonElement>) => {
542
+ if (onClick) {
543
+ onClick(e)
544
+ if (e.defaultPrevented) return
545
+ }
546
+
547
+ if (isSamePageHash && hash) {
548
+ e.preventDefault()
549
+
550
+ const targetId = hash.slice(1)
551
+ const el = document.getElementById(targetId)
552
+
553
+ if (el) {
554
+ el.scrollIntoView({ behavior: 'smooth', block: 'start' })
555
+
556
+ if (href) {
557
+ window.history.pushState(null, '', href)
558
+ }
559
+ }
560
+
561
+ if (closeDrawerOnClick) {
562
+ closeDrawer()
563
+ }
564
+
565
+ return
566
+ }
567
+
568
+ if (closeDrawerOnClick && !newTab && href) {
569
+ closeDrawer()
570
+ }
571
+
572
+ if (href) {
573
+ e.preventDefault()
574
+ router.push(href)
575
+ }
576
+ }
577
+
578
+ const iconElement =
579
+ IconComponent && displayMode !== 'labelOnly' ? (
580
+ <IconComponent
581
+ className={cn('h-4 w-4', size === 'sm' && 'h-3 w-3', size === 'lg' && 'h-5 w-5')}
582
+ />
583
+ ) : null
584
+
585
+ let buttonChildren: React.ReactNode
586
+
587
+ if (displayMode === 'iconOnly') {
588
+ buttonChildren = iconElement
589
+ } else if (displayMode === 'labelOnly') {
590
+ buttonChildren = label
591
+ } else {
592
+ buttonChildren =
593
+ iconPosition === 'before' ? (
594
+ <>
595
+ {iconElement}
596
+ {label}
597
+ </>
598
+ ) : (
599
+ <>
600
+ {label}
601
+ {iconElement}
602
+ </>
603
+ )
604
+ }
605
+
606
+ const btn = renderVariant(variant, {
607
+ size,
608
+ disabled,
609
+ className: cn(fullWidth ? 'w-full' : undefined, className),
610
+ wrapperClassName,
611
+ children: buttonChildren,
612
+ onClick: handleClick,
613
+ onMouseEnter,
614
+ onSubmit,
615
+ form,
616
+ type: htmlType
617
+ })
618
+
619
+ if (href && newTab) {
620
+ return (
621
+ <LinkWrapper href={href} newTab={newTab} closeDrawerOnClick={closeDrawerOnClick}>
622
+ {btn}
623
+ </LinkWrapper>
624
+ )
625
+ }
626
+
627
+ return btn
628
+ }
@@ -0,0 +1,43 @@
1
+ 'use client'
2
+
3
+ import * as React from 'react'
4
+ import ButtonDustedFluid, {
5
+ type ButtonDustedFluidLinkType
6
+ } from '@/components/ui/button-dusted-fluid'
7
+ import { cn } from '@/utilities/ui'
8
+
9
+ export type ButtonECDustedFluidProps = {
10
+ variant?: 'v1' | 'v2' | 'v3' | 'v4' | 'v5'
11
+ label?: string
12
+ className?: string
13
+ wrapperClassName?: string
14
+ displayMode?: 'iconWithLabel' | 'iconOnly' | 'labelOnly'
15
+ iconPosition?: 'before' | 'after'
16
+ iconName?: string
17
+ link?: ButtonDustedFluidLinkType | null
18
+ }
19
+
20
+ export function DDFluidBtn({
21
+ variant = 'v1',
22
+ label = 'BUTTON',
23
+ className,
24
+ wrapperClassName,
25
+ displayMode,
26
+ iconPosition,
27
+ iconName,
28
+ link
29
+ }: ButtonECDustedFluidProps) {
30
+ return (
31
+ <div className={wrapperClassName}>
32
+ <ButtonDustedFluid
33
+ variant={variant}
34
+ label={label}
35
+ className={cn('dustedfluid-button', className)}
36
+ displayMode={displayMode}
37
+ iconPosition={iconPosition}
38
+ iconName={iconName}
39
+ link={link}
40
+ />
41
+ </div>
42
+ )
43
+ }
@@ -0,0 +1,6 @@
1
+ # Todo: Update and re-enable other variants if needed.
2
+
3
+ # @/components/ui/button-dusted-fluid
4
+
5
+ - Deps
6
+ import { ButtonsEyeCatching } from '@/blocks/DD-FluidBtn/ButtonsEyeCatching'