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
@@ -0,0 +1,105 @@
1
+ {
2
+ "type": "block",
3
+ "name": "Button47",
4
+ "label": "Button 47",
5
+ "sourceName": "Button47",
6
+ "portableName": "Button47",
7
+ "slug": "button47",
8
+ "version": "0.0.1",
9
+ "source": {
10
+ "repo": "Hadizainal/Dusted-Payload-Blocks",
11
+ "originalPath": "CLI-TestGround/dusted-blocks-demo/src/blocks/Button47",
12
+ "originalSlug": "button47",
13
+ "originalConfigExport": "Button47",
14
+ "originalComponentExport": "Button47",
15
+ "originalInterfaceName": "Button47Block"
16
+ },
17
+ "files": [
18
+ {
19
+ "from": "Component.tsx",
20
+ "to": "src/blocks/Button47/Component.tsx"
21
+ },
22
+ {
23
+ "from": "config.ts",
24
+ "to": "src/blocks/Button47/config.ts"
25
+ },
26
+ {
27
+ "from": "link.ts",
28
+ "to": "src/blocks/Button47/link.ts"
29
+ },
30
+ {
31
+ "from": "styles.module.scss",
32
+ "to": "src/blocks/Button47/styles.module.scss"
33
+ }
34
+ ],
35
+ "dependencies": [
36
+ "@mui/material",
37
+ "lucide-react",
38
+ "motion",
39
+ "sass"
40
+ ],
41
+ "sharedFiles": [],
42
+ "requiredProjectFiles": [
43
+ {
44
+ "path": "src/payload-types.ts",
45
+ "reason": "Component and link resolver use generated Button47 types."
46
+ },
47
+ {
48
+ "path": "src/utilities/ui.ts",
49
+ "reason": "Component imports cn from @/utilities/ui."
50
+ },
51
+ {
52
+ "path": "src/fields/link.ts",
53
+ "reason": "Payload config uses the shared link field."
54
+ },
55
+ {
56
+ "path": "src/fields/lucide-icon-picker/field.ts",
57
+ "reason": "Payload config uses the Lucide icon picker field."
58
+ }
59
+ ],
60
+ "optionalProjectFiles": [],
61
+ "collectionRegistration": {
62
+ "enabled": true,
63
+ "collections": [
64
+ "Pages",
65
+ "Posts"
66
+ ]
67
+ },
68
+ "renderBlocksRegistration": {
69
+ "enabled": true
70
+ },
71
+ "renderBlocksBehavior": {
72
+ "wrapperless": false
73
+ },
74
+ "pageRouteIntegration": {
75
+ "required": false,
76
+ "manualSteps": []
77
+ },
78
+ "manual": [
79
+ "Register Button47 in Pages/Posts block arrays if automatic registration was skipped.",
80
+ "Register button47 in RenderBlocks if automatic registration was skipped.",
81
+ "Run payload generate:types after schema changes.",
82
+ "Run payload generate:importmap if admin/component imports changed."
83
+ ],
84
+ "manualSteps": [
85
+ "Register Button47 in Pages/Posts block arrays if automatic registration was skipped.",
86
+ "Register button47 in RenderBlocks if automatic registration was skipped.",
87
+ "Run payload generate:types after schema changes.",
88
+ "Run payload generate:importmap if admin/component imports changed."
89
+ ],
90
+ "patchTargets": {
91
+ "blockConfigRegistration": {
92
+ "description": "Installer can register Button47 from @/blocks/Button47/config."
93
+ },
94
+ "renderBlocksRegistration": {
95
+ "description": "Installer can register button47 with component export Button47."
96
+ }
97
+ },
98
+ "notes": [
99
+ "Promoted from the verified Dusted Blocks demo implementation.",
100
+ "Installer preserves existing destination files and reports project requirements before writing."
101
+ ],
102
+ "exportName": "Button47",
103
+ "componentExportName": "Button47",
104
+ "interfaceName": "Button47Block"
105
+ }
@@ -0,0 +1,75 @@
1
+ .root {
2
+ --button47-frame: #a3e635;
3
+ --button47-ghost-bg: #1e1b4b;
4
+ --button47-ghost-hover: #312e81;
5
+ --button47-ghost-text: #d9f99d;
6
+ --button47-focus: #a3e635;
7
+ display: flex;
8
+ flex-wrap: wrap;
9
+ gap: 1rem;
10
+ font-family: inherit;
11
+ }
12
+ :global([data-theme='light']) .root {
13
+ --button47-frame: #4338ca;
14
+ --button47-focus: #4338ca;
15
+ --button47-ghost-bg: #eef2ff;
16
+ --button47-ghost-hover: #e0e7ff;
17
+ --button47-ghost-text: #3730a3;
18
+ }
19
+
20
+ .focusFrame {
21
+ max-width: 100%;
22
+ min-width: 0;
23
+ border-radius: 4px;
24
+ corner-shape: squircle;
25
+ &:has(a:focus-visible) {
26
+ outline: 3px solid var(--button47-focus);
27
+ outline-offset: 4px;
28
+ }
29
+ }
30
+ .bevel,
31
+ .button {
32
+ clip-path: polygon(
33
+ 0 0,
34
+ calc(100% - 16px) 0,
35
+ 100% 16px,
36
+ 100% 100%,
37
+ 16px 100%,
38
+ 0 calc(100% - 16px)
39
+ );
40
+ transition:
41
+ background-color 0.3s,
42
+ border-color 0.3s,
43
+ clip-path 0.3s,
44
+ box-shadow 0.3s;
45
+ }
46
+ .bevel {
47
+ padding: 0;
48
+ border: 1px outset;
49
+ border-radius: 4px;
50
+ corner-shape: squircle;
51
+ &:hover {
52
+ clip-path: polygon(
53
+ 0 0,
54
+ calc(100% - 14px) 0,
55
+ 100% 14px,
56
+ 100% 100%,
57
+ 14px 100%,
58
+ 0 calc(100% - 14px)
59
+ );
60
+ }
61
+ }
62
+ .button {
63
+ border-radius: 4px;
64
+ corner-shape: squircle;
65
+ overflow-wrap: anywhere;
66
+ text-decoration: none !important;
67
+ }
68
+ @media (prefers-reduced-motion: reduce) {
69
+ .root *,
70
+ .root *::before,
71
+ .root *::after {
72
+ transition: none !important;
73
+ animation: none !important;
74
+ }
75
+ }
@@ -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-primary text-stone-200 dark:text-stone-900 hover:shadow-md hover:color-accent will-change-transform',
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/50 border border-red-500/50 text-stone-200 shadow-[inset_0_0_0_1px_rgba(239,68,68,0.6),inset_0_0_12px_rgba(239,68,68,0.8)] dark:text-stone-200 text-destructive-foreground hover:bg-destructive/90 will-change-transform',
29
- v1: 'ripple-v1 border-[0.5px] text-stone-200 dark:text-stone-200 rounded-sm bg-transparent duration-200 hover:bg-primary shadow-[4px_4px_0px_0px_rgba(0,0,0,1)] active:shadow-none border-stone-800 hover:text-zinc-200 dark:border-stone-600 dark:shadow-[3px_3px_0px_0px_var(--border-color)] active:dark:shadow-none dark:bg-zinc-950',
30
- v2: 'ripple-v2 text-stone-200 dark:text-stone-900 group relative rounded-none overflow-hidden ease-in-out hover:scale-100 hover:shadow-lg bg-gradient-to-tr from-zinc-900 to-zinc-700 hover:shadow-zinc-500/30 dark:bg-gradient-to-tr dark:from-neutral-950 dark:to-neutral-900 dark:hover:shadow-zinc-700/30',
31
- v3: 'ripple-v3 text-stone-200 dark:text-stone-900 relative overflow-hidden group ease-out bg-zinc-900 hover:bg-gradient-to-r hover:from-zinc-800 hover:to-zinc-700 dark:bg-zinc-50 dark:hover:from-zinc-50 dark:hover:to-zinc-100',
32
- v5: 'ripple-v5 text-stone-200 dark:text-stone-200 relative overflow-hidden border shadow group invert-[1] border-stone-300 bg-zinc-50 dark:border-stone-700 dark:bg-zinc-950',
33
- v7: "ripple-v7 text-stone-200 dark:text-stone-200 relative hover:no-underline px-[1px] pb-0 ease-in after:absolute after:bottom-[-2px] after:left-0 after:h-0.5 after:w-full after:translate-y-[3px] after:rounded-full after:dark:bg-zinc-50 after:bg-zinc-800 after:opacity-0 after:duration-300 after:content-[''] hover:after:-translate-y-1 hover:after:opacity-100"
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 React.ButtonHTMLAttributes<HTMLButtonElement>,
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 = variant === 'destructive' ? 'rgba(255, 0, 0, 0.3)' : 'rgba(139, 92, 246, 0.45)'
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 size-full duration-700 -translate-x-full group-hover:translate-x-0 bg-zinc-800 dark:bg-zinc-100 text-zinc-100 dark:text-zinc-100" />
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<AccordionItemData & { buttonVariant?: AccordionButtonVariant }> = ({
144
- title,
145
- content,
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 dd-bg-50" />
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 color-text bg-[rgba(159,159,159,0.18)]"
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> = ({ items, accordionButtonVariant = 'v2' }) => {
229
+ export const DDAccordion: React.FC<AccordionBlockProps> = ({
230
+ items,
231
+ accordionButtonVariant = 'v2',
232
+ }) => {
214
233
  return (
215
- <div className="accordion-container max-w-full">
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
- import { defaultLexical } from '@/fields/defaultLexical'
6
-
7
- import { DDBanner } from '@/blocks/DD-Banner/config'
8
- import { Code } from '@/blocks/Code/config'
9
- import { MediaBlock } from '@/blocks/MediaBlock/config'
10
- import { DDIconButton } from '../DD-IconButton/config'
11
- import { DDAnimText } from '@/blocks/DD-AnimText/config'
12
-
13
- export const DDAccordion: Block = {
14
- slug: 'DD-Accordion',
15
- interfaceName: 'DDAccordion',
16
- labels: {
17
- singular: 'Accordion Block',
18
- plural: 'Accordion Blocks'
19
- },
20
- fields: [
21
- {
22
- name: 'accordionId',
23
- type: 'text',
24
- hidden: true,
25
- label: 'Accordian ID',
26
- required: false,
27
- admin: {
28
- description: 'Unique ID for the accordian block',
29
- width: '50%'
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: 'Selects the local ButtonAccord visual treatment for every accordion title button.',
48
- width: '50%'
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: defaultLexical,
61
- required: false
62
- },
63
- {
64
- name: 'content',
65
- label: 'Accordian Content',
66
- type: 'richText',
67
- editor: defaultLexical,
68
- required: false
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
+ }