blocks-dusted 0.1.10 → 0.1.12
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/README.md +35 -0
- package/package.json +5 -2
- package/src/cli.js +39 -3
- package/src/commands/shop.js +59 -0
- package/src/commands/warehouse.js +73 -0
- package/src/utils/paths.js +13 -13
- package/templates/blocks/DD-Accordion/Component.tsx +229 -0
- package/templates/blocks/DD-Accordion/README.md +3 -0
- package/templates/blocks/DD-Accordion/config.ts +73 -0
- package/templates/blocks/DD-Accordion/manifest.json +75 -0
- package/templates/blocks/DD-AnimText/Component.tsx +788 -0
- package/templates/blocks/DD-AnimText/README.md +3 -0
- package/templates/blocks/DD-AnimText/config.ts +295 -0
- package/templates/blocks/DD-AnimText/manifest.json +85 -0
- package/templates/blocks/DD-AsideNav/Component.tsx +321 -0
- package/templates/blocks/DD-AsideNav/config.ts +204 -0
- package/templates/blocks/DD-AsideNav/manifest.json +80 -0
- package/templates/blocks/DD-Banner/Component.tsx +51 -0
- package/templates/blocks/DD-Banner/config.ts +57 -0
- package/templates/blocks/DD-Banner/manifest.json +72 -0
- package/templates/blocks/DD-BgLightning/Component.tsx +44 -0
- package/templates/blocks/DD-BgLightning/README.md +3 -0
- package/templates/blocks/DD-BgLightning/config.ts +97 -0
- package/templates/blocks/DD-BgLightning/manifest.json +79 -0
- package/templates/blocks/DD-BookCall/Component.tsx +535 -535
- package/templates/blocks/DD-BookCall/config.ts +238 -238
- package/templates/blocks/DD-ButtonPop/Component.tsx +117 -0
- package/templates/blocks/DD-ButtonPop/config.ts +105 -0
- package/templates/blocks/DD-ButtonPop/manifest.json +88 -0
- package/templates/blocks/DD-ButtonPop/svg-icons/Dust2.tsx +167 -0
- package/templates/blocks/DD-Card/Component.tsx +251 -0
- package/templates/blocks/DD-Card/README.md +4 -0
- package/templates/blocks/DD-Card/config.ts +154 -0
- package/templates/blocks/DD-Card/manifest.json +82 -0
- package/templates/blocks/DD-CardTemplate01/Component.tsx +140 -140
- package/templates/blocks/DD-CardTemplate01/config.ts +106 -106
- package/templates/blocks/DD-Carousel-A/Component.tsx +249 -249
- package/templates/blocks/DD-Carousel-B/Component.tsx +403 -403
- package/templates/blocks/DD-Chip/Component.tsx +250 -0
- package/templates/blocks/DD-Chip/EXAMPLES.md +313 -0
- package/templates/blocks/DD-Chip/README.md +202 -0
- package/templates/blocks/DD-Chip/config.ts +369 -0
- package/templates/blocks/DD-Chip/manifest.json +74 -0
- package/templates/blocks/DD-ComparisonTable/Component.tsx +256 -256
- package/templates/blocks/DD-Contact/Component.tsx +435 -434
- package/templates/blocks/DD-Contact/config.ts +22 -22
- package/templates/blocks/DD-Counter/Component.tsx +190 -0
- package/templates/blocks/DD-Counter/README.md +4 -0
- package/templates/blocks/DD-Counter/config.ts +291 -0
- package/templates/blocks/DD-Counter/manifest.json +74 -0
- package/templates/blocks/DD-CustomCSS/Component.tsx +8 -0
- package/templates/blocks/DD-CustomCSS/README.md +4 -0
- package/templates/blocks/DD-CustomCSS/addToLayout.md +5 -0
- package/templates/blocks/DD-CustomCSS/config.ts +22 -0
- package/templates/blocks/DD-CustomCSS/manifest.json +72 -0
- package/templates/blocks/DD-CustomCSS/renderCustomCSS.md +7 -0
- package/templates/blocks/DD-FeatCat/Component.tsx +302 -302
- package/templates/blocks/DD-FeatCat/config.ts +201 -201
- package/templates/blocks/DD-FeatStrip/Component.tsx +585 -585
- package/templates/blocks/DD-FeatStrip/config.ts +134 -134
- package/templates/blocks/DD-FluidBtn/ButtonsEyeCatching.tsx +628 -0
- package/templates/blocks/DD-FluidBtn/Component.tsx +43 -0
- package/templates/blocks/DD-FluidBtn/README.md +6 -0
- package/templates/blocks/DD-FluidBtn/config.ts +102 -0
- package/templates/blocks/DD-FluidBtn/manifest.json +86 -0
- package/templates/blocks/DD-GooeyInfo/Component.tsx +149 -0
- package/templates/blocks/DD-GooeyInfo/config.ts +135 -0
- package/templates/blocks/DD-GooeyInfo/manifest.json +72 -0
- package/templates/blocks/DD-Hero/Component.tsx +297 -297
- package/templates/blocks/DD-Hero/config.ts +267 -267
- package/templates/blocks/DD-HorizontalScroll/Component.tsx +936 -936
- package/templates/blocks/DD-HorizontalScroll/config.ts +231 -231
- package/templates/blocks/DD-Icon/Component.tsx +287 -0
- package/templates/blocks/DD-Icon/README.md +4 -0
- package/templates/blocks/DD-Icon/config.ts +258 -0
- package/templates/blocks/DD-Icon/hooks/revalidateBlockIds.ts +66 -0
- package/templates/blocks/DD-Icon/manifest.json +82 -0
- package/templates/blocks/DD-IconButton/Component.tsx +455 -0
- package/templates/blocks/DD-IconButton/README.md +326 -0
- package/templates/blocks/DD-IconButton/config.ts +239 -0
- package/templates/blocks/DD-IconButton/manifest.json +85 -0
- package/templates/blocks/DD-IdTag/Component.tsx +21 -0
- package/templates/blocks/DD-IdTag/README.md +4 -0
- package/templates/blocks/DD-IdTag/config.ts +41 -0
- package/templates/blocks/DD-IdTag/manifest.json +72 -0
- package/templates/blocks/DD-Iframe/Component.tsx +45 -0
- package/templates/blocks/DD-Iframe/README.md +4 -0
- package/templates/blocks/DD-Iframe/config.ts +47 -0
- package/templates/blocks/DD-Iframe/manifest.json +72 -0
- package/templates/blocks/DD-IframeMedia/Component.tsx +133 -0
- package/templates/blocks/DD-IframeMedia/README.md +4 -0
- package/templates/blocks/DD-IframeMedia/config.ts +79 -0
- package/templates/blocks/DD-IframeMedia/manifest.json +72 -0
- package/templates/blocks/DD-LineAnim/Component.tsx +36 -0
- package/templates/blocks/DD-LineAnim/README.md +4 -0
- package/templates/blocks/DD-LineAnim/config.ts +90 -0
- package/templates/blocks/DD-LineAnim/manifest.json +80 -0
- package/templates/blocks/DD-LinkGrid/Component.tsx +119 -0
- package/templates/blocks/DD-LinkGrid/README.md +4 -0
- package/templates/blocks/DD-LinkGrid/config.ts +51 -0
- package/templates/blocks/DD-LinkGrid/manifest.json +74 -0
- package/templates/blocks/DD-LogoMarq/Component.tsx +132 -0
- package/templates/blocks/DD-LogoMarq/README.md +4 -0
- package/templates/blocks/DD-LogoMarq/config.ts +264 -0
- package/templates/blocks/DD-LogoMarq/manifest.json +82 -0
- package/templates/blocks/DD-Lottie/Component.tsx +459 -0
- package/templates/blocks/DD-Lottie/README.md +4 -0
- package/templates/blocks/DD-Lottie/config.ts +379 -0
- package/templates/blocks/DD-Lottie/index.tsx +28 -0
- package/templates/blocks/DD-Lottie/manifest.json +83 -0
- package/templates/blocks/DD-MagicBento/Component.tsx +777 -0
- package/templates/blocks/DD-MagicBento/README.md +4 -0
- package/templates/blocks/DD-MagicBento/config.ts +264 -0
- package/templates/blocks/DD-MagicBento/manifest.json +74 -0
- package/templates/blocks/DD-MasonaryMedia/Component.tsx +545 -545
- package/templates/blocks/DD-MasonaryMedia/config.ts +2 -2
- package/templates/blocks/DD-MasonaryMedia/vendor.d.ts +2 -2
- package/templates/blocks/DD-Masonry/Component.tsx +645 -0
- package/templates/blocks/DD-Masonry/README.md +4 -0
- package/templates/blocks/DD-Masonry/config.ts +475 -0
- package/templates/blocks/DD-Masonry/manifest.json +82 -0
- package/templates/blocks/DD-Pricing/Component.tsx +2 -5
- package/templates/blocks/DD-Process/Component.tsx +2 -4
- package/templates/blocks/DD-Process/config.ts +150 -150
- package/templates/blocks/DD-Progress/Component.tsx +156 -0
- package/templates/blocks/DD-Progress/README.md +4 -0
- package/templates/blocks/DD-Progress/config.ts +175 -0
- package/templates/blocks/DD-Progress/manifest.json +74 -0
- package/templates/blocks/DD-ProjHeader/Component.tsx +91 -0
- package/templates/blocks/DD-ProjHeader/README.md +4 -0
- package/templates/blocks/DD-ProjHeader/config.ts +96 -0
- package/templates/blocks/DD-ProjHeader/manifest.json +72 -0
- package/templates/blocks/DD-ProjSlider/Component.tsx +123 -0
- package/templates/blocks/DD-ProjSlider/README.md +4 -0
- package/templates/blocks/DD-ProjSlider/config.ts +64 -0
- package/templates/blocks/DD-ProjSlider/manifest.json +72 -0
- package/templates/blocks/DD-ScrollText/Component.tsx +114 -0
- package/templates/blocks/DD-ScrollText/README.md +4 -0
- package/templates/blocks/DD-ScrollText/config.ts +58 -0
- package/templates/blocks/DD-ScrollText/manifest.json +72 -0
- package/templates/blocks/DD-Section/Component.tsx +266 -266
- package/templates/blocks/DD-Separator/Component.tsx +66 -0
- package/templates/blocks/DD-Separator/README.md +4 -0
- package/templates/blocks/DD-Separator/config.ts +58 -0
- package/templates/blocks/DD-Separator/manifest.json +72 -0
- package/templates/blocks/DD-Services/Component.tsx +176 -176
- package/templates/blocks/DD-Services/config.ts +149 -149
- package/templates/blocks/DD-ShowcaseGrid/Component.tsx +307 -307
- package/templates/blocks/DD-Slider-A/Component.tsx +1 -1
- package/templates/blocks/DD-StackCards/Component.tsx +1 -1
- package/templates/blocks/DD-StackCards/config.ts +399 -399
- package/templates/blocks/DD-Team/Component.tsx +247 -247
- package/templates/blocks/DD-Team/config.ts +173 -173
- package/templates/blocks/DD-TeamCards/Component.tsx +251 -0
- package/templates/blocks/DD-TeamCards/README.md +4 -0
- package/templates/blocks/DD-TeamCards/config.ts +302 -0
- package/templates/blocks/DD-TeamCards/manifest.json +74 -0
- package/templates/blocks/DD-TechStack/Component.tsx +174 -174
- package/templates/blocks/DD-TechStack/config.ts +153 -153
- package/templates/blocks/DD-TestMarq/Component.tsx +132 -0
- package/templates/blocks/DD-TestMarq/README.md +4 -0
- package/templates/blocks/DD-TestMarq/RowLabel.tsx +9 -0
- package/templates/blocks/DD-TestMarq/config.ts +88 -0
- package/templates/blocks/DD-TestMarq/manifest.json +72 -0
- package/templates/blocks/DD-Testim/Component.tsx +247 -0
- package/templates/blocks/DD-Testim/README.md +4 -0
- package/templates/blocks/DD-Testim/config.ts +101 -0
- package/templates/blocks/DD-Testim/manifest.json +75 -0
- package/templates/blocks/DD-Testim2/Component.tsx +256 -0
- package/templates/blocks/DD-Testim2/README.md +4 -0
- package/templates/blocks/DD-Testim2/config.ts +100 -0
- package/templates/blocks/DD-Testim2/manifest.json +74 -0
- package/templates/blocks/DD-Testimonials/Component.tsx +139 -147
- package/templates/blocks/DD-Testimonials/config.ts +120 -120
- package/templates/blocks/DD-TextMarq/Component.tsx +157 -0
- package/templates/blocks/DD-TextMarq/README.md +4 -0
- package/templates/blocks/DD-TextMarq/config.ts +237 -0
- package/templates/blocks/DD-TextMarq/manifest.json +82 -0
- package/templates/blocks/DD-Thanks/Component.tsx +501 -0
- package/templates/blocks/DD-Thanks/README.md +4 -0
- package/templates/blocks/DD-Thanks/config.ts +224 -0
- package/templates/blocks/DD-Thanks/manifest.json +72 -0
- package/templates/blocks/DD-VertMarq/Component.tsx +154 -0
- package/templates/blocks/DD-VertMarq/README.md +4 -0
- package/templates/blocks/DD-VertMarq/config.ts +236 -0
- package/templates/blocks/DD-VertMarq/dist/index.css +6 -0
- package/templates/blocks/DD-VertMarq/dist/index.min.css +1 -0
- package/templates/blocks/DD-VertMarq/manifest.json +74 -0
- package/templates/blocks/DD-Work/Component.tsx +318 -315
- package/templates/blocks/DD-Work/config.ts +165 -165
- package/templates/blocks/DD-Work-B/Component.tsx +294 -294
- package/templates/blocks/DDHG-CTASection2/Component.tsx +185 -0
- package/templates/blocks/DDHG-CTASection2/config.ts +140 -0
- package/templates/blocks/DDHG-CTASection2/manifest.json +45 -0
- package/templates/blocks/DDHG-HighlightArc/Component.tsx +243 -0
- package/templates/blocks/DDHG-HighlightArc/config.ts +85 -0
- package/templates/blocks/DDHG-HighlightArc/manifest.json +46 -0
- package/templates/blocks/DDHG-LogoMarquee/Component.tsx +143 -0
- package/templates/blocks/DDHG-LogoMarquee/config.ts +154 -0
- package/templates/blocks/DDHG-LogoMarquee/manifest.json +39 -0
- package/templates/blocks/DDHG-NavCodeGrid/Component.tsx +227 -0
- package/templates/blocks/DDHG-NavCodeGrid/config.ts +64 -0
- package/templates/blocks/DDHG-NavCodeGrid/manifest.json +45 -0
- package/templates/blocks/DDHG-ProcessSec/Component.tsx +574 -0
- package/templates/blocks/DDHG-ProcessSec/config.ts +170 -0
- package/templates/blocks/DDHG-ProcessSec/manifest.json +56 -0
- package/templates/blocks/DDHG-ServiceDetails/Component.tsx +164 -0
- package/templates/blocks/DDHG-ServiceDetails/ServiceDetailCard.tsx +390 -0
- package/templates/blocks/DDHG-ServiceDetails/config.ts +77 -0
- package/templates/blocks/DDHG-ServiceDetails/manifest.json +50 -0
- package/templates/blocks/DDHG-ServiceHero/Component.tsx +234 -0
- package/templates/blocks/DDHG-ServiceHero/config.ts +49 -0
- package/templates/blocks/DDHG-ServiceHero/manifest.json +26 -0
- package/templates/blocks/DDHG-ServiceOverview/Component.tsx +277 -0
- package/templates/blocks/DDHG-ServiceOverview/config.ts +64 -0
- package/templates/blocks/DDHG-ServiceOverview/manifest.json +44 -0
- package/templates/blocks/DDHG-StatsFAQ/Component.tsx +389 -0
- package/templates/blocks/DDHG-StatsFAQ/config.ts +204 -0
- package/templates/blocks/DDHG-StatsFAQ/manifest.json +45 -0
- package/templates/blocks/DDHG-TeamCards/Component.tsx +169 -0
- package/templates/blocks/DDHG-TeamCards/config.ts +48 -0
- package/templates/blocks/DDHG-TeamCards/manifest.json +29 -0
- package/templates/shared/src/components/BgLightning/index.tsx +242 -0
- package/templates/shared/src/components/ui/ShareButton/index.tsx +80 -0
- package/templates/shared/src/components/ui/anims/FadeOnScroll.tsx +48 -0
- package/templates/shared/src/components/ui/anims/FadeUpOnInView.tsx +63 -0
- package/templates/shared/src/components/ui/anims/GlareHover.tsx +111 -0
- package/templates/shared/src/components/ui/anims/LineAnims.tsx +81 -0
- package/templates/shared/src/components/ui/anims/TitleAnims01.tsx +54 -0
- package/templates/shared/src/components/ui/anims/animation-container.tsx +29 -0
- package/templates/shared/src/components/ui/anims/blur-in.tsx +26 -0
- package/templates/shared/src/components/ui/anims/counter.tsx +53 -0
- package/templates/shared/src/components/ui/anims/fade.tsx +83 -0
- package/templates/shared/src/components/ui/anims/gradual-spacing.tsx +39 -0
- package/templates/shared/src/components/ui/anims/pull-up.tsx +93 -0
- package/templates/shared/src/components/ui/anims/reveal-text.tsx +76 -0
- package/templates/shared/src/components/ui/anims/rotate-words.tsx +43 -0
- package/templates/shared/src/components/ui/anims/shiny-text.tsx +58 -0
- package/templates/shared/src/components/ui/anims/shuffle-text.tsx +85 -0
- package/templates/shared/src/components/ui/anims/split-text.tsx +211 -0
- package/templates/shared/src/components/ui/anims/staggered-fade.tsx +133 -0
- package/templates/shared/src/components/ui/anims/text-scroll.tsx +111 -0
- package/templates/shared/src/components/ui/anims/typing-effect.tsx +112 -0
- package/templates/shared/src/components/ui/button-dusted-fluid/index.tsx +1521 -0
- package/templates/shared/src/components/ui/separator.tsx +85 -0
- package/templates/shared/src/hooks/useBodyScrollLock.ts +97 -0
- package/templates/shared/src/hooks/useClickOutside.ts +28 -0
- package/templates/shared/src/utilities/renderCustomCSS.ts +5 -0
- package/templates/shared/src/utilities/smoothScroll.ts +65 -0
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
4
|
+
import Link from 'next/link'
|
|
5
|
+
import { motion, type Variants } from 'framer-motion'
|
|
6
|
+
import { cn } from '@/utilities/ui'
|
|
7
|
+
|
|
8
|
+
export interface Chip {
|
|
9
|
+
label: string
|
|
10
|
+
icon?: string
|
|
11
|
+
customBackgroundColor?: string
|
|
12
|
+
customTextColor?: string
|
|
13
|
+
customBorderColor?: string
|
|
14
|
+
link?: string
|
|
15
|
+
id?: string
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface ChipBlockProps {
|
|
19
|
+
blockName?: string
|
|
20
|
+
blockType?: 'chipBlock'
|
|
21
|
+
layout?: 'row' | 'column' | 'row-wrap'
|
|
22
|
+
size?: 'small' | 'medium' | 'large'
|
|
23
|
+
gap?: 'none' | 'small' | 'medium' | 'large'
|
|
24
|
+
alignment?: 'start' | 'center' | 'end' | 'space-between'
|
|
25
|
+
backgroundColor?: string
|
|
26
|
+
textColor?: string
|
|
27
|
+
borderColor?: string
|
|
28
|
+
borderWidth?: '0' | '1' | '2' | '3' | '4'
|
|
29
|
+
borderRadius?: 'none' | 'sm' | 'md' | 'lg' | 'full'
|
|
30
|
+
hoverEffect?: boolean
|
|
31
|
+
chips?: Chip[]
|
|
32
|
+
customClassName?: string
|
|
33
|
+
animate?: boolean
|
|
34
|
+
maxWidth?: string
|
|
35
|
+
padding?: 'none' | 'small' | 'medium' | 'large'
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const ChipBlockComponent: React.FC<ChipBlockProps> = ({
|
|
39
|
+
layout = 'row',
|
|
40
|
+
gap = 'medium',
|
|
41
|
+
alignment = 'center',
|
|
42
|
+
backgroundColor,
|
|
43
|
+
textColor,
|
|
44
|
+
borderColor,
|
|
45
|
+
hoverEffect = true,
|
|
46
|
+
chips = [],
|
|
47
|
+
customClassName,
|
|
48
|
+
animate = false,
|
|
49
|
+
maxWidth,
|
|
50
|
+
padding = 'none',
|
|
51
|
+
}) => {
|
|
52
|
+
// Gap mappings
|
|
53
|
+
const gapClasses = {
|
|
54
|
+
none: 'gap-0',
|
|
55
|
+
small: 'gap-2',
|
|
56
|
+
medium: 'gap-3',
|
|
57
|
+
large: 'gap-4',
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
// Layout mappings
|
|
61
|
+
const layoutClasses = {
|
|
62
|
+
row: 'flex-row flex-nowrap overflow-x-auto',
|
|
63
|
+
column: 'flex-col',
|
|
64
|
+
'row-wrap': 'flex-row flex-wrap',
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Alignment mappings
|
|
68
|
+
const alignmentClasses = {
|
|
69
|
+
start: 'justify-start',
|
|
70
|
+
center: 'justify-center',
|
|
71
|
+
end: 'justify-end',
|
|
72
|
+
'space-between': 'justify-between',
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// Padding mappings
|
|
76
|
+
const paddingClasses = {
|
|
77
|
+
none: '',
|
|
78
|
+
small: 'p-2',
|
|
79
|
+
medium: 'p-4',
|
|
80
|
+
large: 'p-6',
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
// Helper to determine if a color is a Tailwind class or CSS color
|
|
84
|
+
const isColorValue = (color?: string): boolean => {
|
|
85
|
+
if (!color) return false
|
|
86
|
+
return color.startsWith('#') || color.startsWith('rgb') || color.startsWith('hsl')
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Generate chip styles
|
|
90
|
+
const getChipStyles = (chip: Chip) => {
|
|
91
|
+
const bgColor = chip.customBackgroundColor || backgroundColor
|
|
92
|
+
const txtColor = chip.customTextColor || textColor
|
|
93
|
+
const bdrColor = chip.customBorderColor || borderColor
|
|
94
|
+
|
|
95
|
+
const styles: React.CSSProperties = {}
|
|
96
|
+
|
|
97
|
+
if (bgColor && isColorValue(bgColor)) {
|
|
98
|
+
styles.backgroundColor = bgColor
|
|
99
|
+
}
|
|
100
|
+
if (txtColor && isColorValue(txtColor)) {
|
|
101
|
+
styles.color = txtColor
|
|
102
|
+
}
|
|
103
|
+
if (bdrColor && isColorValue(bdrColor)) {
|
|
104
|
+
styles.borderColor = bdrColor
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return styles
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// Generate chip classes
|
|
111
|
+
const getChipClasses = (chip: Chip) => {
|
|
112
|
+
const bgColor = chip.customBackgroundColor || backgroundColor
|
|
113
|
+
const txtColor = chip.customTextColor || textColor
|
|
114
|
+
const bdrColor = chip.customBorderColor || borderColor
|
|
115
|
+
|
|
116
|
+
const classes = []
|
|
117
|
+
|
|
118
|
+
if (bgColor && !isColorValue(bgColor)) {
|
|
119
|
+
classes.push(bgColor)
|
|
120
|
+
}
|
|
121
|
+
if (txtColor && !isColorValue(txtColor)) {
|
|
122
|
+
classes.push(txtColor)
|
|
123
|
+
}
|
|
124
|
+
if (bdrColor && !isColorValue(bdrColor)) {
|
|
125
|
+
classes.push(bdrColor)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
return classes.join(' ')
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Container styles
|
|
132
|
+
const containerStyles: React.CSSProperties = maxWidth ? { maxWidth } : {}
|
|
133
|
+
|
|
134
|
+
// Animation variants
|
|
135
|
+
const containerVariants: Variants = {
|
|
136
|
+
hidden: { opacity: 0 },
|
|
137
|
+
visible: {
|
|
138
|
+
opacity: 1,
|
|
139
|
+
transition: {
|
|
140
|
+
staggerChildren: 0.1,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
const chipVariants: Variants = {
|
|
146
|
+
hidden: { opacity: 0, y: 20 },
|
|
147
|
+
visible: {
|
|
148
|
+
opacity: 1,
|
|
149
|
+
y: 0,
|
|
150
|
+
transition: {
|
|
151
|
+
duration: 0.4,
|
|
152
|
+
ease: 'easeOut',
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
const ChipElement = ({ chip, index }: { chip: Chip; index: number }): React.ReactElement => {
|
|
158
|
+
const chipContent = (
|
|
159
|
+
<>
|
|
160
|
+
<div className="absolute inset-0 left-0 right-0 mx-auto h-full w-full mix-blend-hard-light">
|
|
161
|
+
<div className="absolute inset-0 mx-auto flex items-center justify-center overflow-hidden rounded-full border-y border-white/10 bg-white/[0.05] text-[18px] font-bold tracking-[1px] text-white shadow-[0_15px_35px_rgba(255,255,255,0.15)] backdrop-blur-[15px] transition-all duration-500 before:absolute before:left-0 before:top-0 before:h-full before:w-1/2 before:skew-x-[45deg] before:bg-[linear-gradient(to_left,rgba(255,255,255,0.22),transparent)] before:transition-transform before:duration-700 after:absolute after:inset-[-0.5px] after:rounded-full after:border after:border-white/10 after:shadow-[inset_0_1px_0_rgba(255,255,255,0.45),inset_0_-8px_18px_rgba(0,0,0,0.25)] group-hover:tracking-[2px] group-hover:before:translate-x-[220%]" />
|
|
162
|
+
<div className="absolute left-1/2 top-[-3px] h-[4px] w-[30px] -translate-x-1/2 rounded-full bg-[#ba55d3] shadow-[0_0_5px_#663399,0_0_15px_#ba55d3,0_0_30px_#663399,0_0_60px_#ff00ff] transition-all duration-500 group-hover:top-0 group-hover:h-full group-hover:w-[80%] group-hover:rounded-full group-hover:bg-[#ba55d355] group-hover:mix-blend-color-dodge group-hover:delay-300" />
|
|
163
|
+
<div className="absolute bottom-[-3px] left-1/2 h-[4px] w-[30px] -translate-x-1/2 rounded-full bg-[#ba55d3] shadow-[0_0_5px_#663399,0_0_15px_#ba55d3,0_0_30px_#663399,0_0_60px_#ff00ff] transition-all duration-500 group-hover:bottom-0 group-hover:h-full group-hover:w-[80%] group-hover:rounded-full group-hover:bg-[#ba55d399] group-hover:mix-blend-screen group-hover:delay-300 select-none" />
|
|
164
|
+
</div>
|
|
165
|
+
<span className="relative z-10 mx-auto flex max-w-md items-center bg-gradient-to-r from-transparent via-white/80 via-50% to-transparent bg-clip-text bg-no-repeat text-neutral-400/70 [background-position:0_0] [background-size:var(--shiny-width)_100%] [--shiny-width:100px] select-none">
|
|
166
|
+
<span className="flex items-center text-white">
|
|
167
|
+
{/* {chip.icon && (
|
|
168
|
+
<span className="chip-icon mr-2 inline-flex h-3.5 w-3.5 items-center justify-center text-xs leading-none">
|
|
169
|
+
{chip.icon}
|
|
170
|
+
</span>
|
|
171
|
+
)} */}
|
|
172
|
+
<span className="chip-label inline-block select-none">{chip.label}</span>
|
|
173
|
+
</span>
|
|
174
|
+
</span>
|
|
175
|
+
</>
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
const chipClasses = cn(
|
|
179
|
+
'badge-chip group relative inline-flex items-center justify-center overflow-hidden rounded-full border !border-lime-500 bg-black/80 px-4 py-1.5 text-xs font-semibold text-foreground backdrop-blur-md transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
|
|
180
|
+
'[&[href]]:cursor-pointer [&[href]]:no-underline',
|
|
181
|
+
hoverEffect &&
|
|
182
|
+
'hover:-translate-y-0.5 hover:shadow-[0_0_26px_rgba(186,85,211,0.35)] active:translate-y-0',
|
|
183
|
+
getChipClasses(chip),
|
|
184
|
+
)
|
|
185
|
+
|
|
186
|
+
const chipElement = chip.link ? (
|
|
187
|
+
<Link
|
|
188
|
+
href={chip.link}
|
|
189
|
+
className={chipClasses}
|
|
190
|
+
style={getChipStyles(chip)}
|
|
191
|
+
aria-label={chip.label}
|
|
192
|
+
>
|
|
193
|
+
{chipContent}
|
|
194
|
+
</Link>
|
|
195
|
+
) : (
|
|
196
|
+
<span className={chipClasses} style={getChipStyles(chip)}>
|
|
197
|
+
{chipContent}
|
|
198
|
+
</span>
|
|
199
|
+
)
|
|
200
|
+
|
|
201
|
+
if (animate) {
|
|
202
|
+
return (
|
|
203
|
+
<motion.div key={chip.id || index} variants={chipVariants} className="inline-flex">
|
|
204
|
+
{chipElement}
|
|
205
|
+
</motion.div>
|
|
206
|
+
)
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
return <React.Fragment key={chip.id || index}>{chipElement}</React.Fragment>
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
const containerClasses = cn(
|
|
213
|
+
'chip-block-container',
|
|
214
|
+
'flex w-full items-center justify-center',
|
|
215
|
+
layoutClasses[layout],
|
|
216
|
+
gapClasses[gap],
|
|
217
|
+
alignmentClasses[alignment],
|
|
218
|
+
paddingClasses[padding],
|
|
219
|
+
customClassName,
|
|
220
|
+
)
|
|
221
|
+
|
|
222
|
+
if (animate) {
|
|
223
|
+
return (
|
|
224
|
+
<motion.div
|
|
225
|
+
className={containerClasses}
|
|
226
|
+
style={containerStyles}
|
|
227
|
+
initial="hidden"
|
|
228
|
+
whileInView="visible"
|
|
229
|
+
viewport={{ once: true, margin: '-100px' }}
|
|
230
|
+
variants={containerVariants}
|
|
231
|
+
>
|
|
232
|
+
{chips.map((chip, index) => (
|
|
233
|
+
<ChipElement key={chip.id || index} chip={chip} index={index} />
|
|
234
|
+
))}
|
|
235
|
+
</motion.div>
|
|
236
|
+
)
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
return (
|
|
240
|
+
<div className={containerClasses} style={containerStyles}>
|
|
241
|
+
{chips.map((chip, index) => (
|
|
242
|
+
<ChipElement key={chip.id || index} chip={chip} index={index} />
|
|
243
|
+
))}
|
|
244
|
+
</div>
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
export default ChipBlockComponent
|
|
249
|
+
|
|
250
|
+
export const DDChip = ChipBlockComponent
|
|
@@ -0,0 +1,313 @@
|
|
|
1
|
+
# ChipBlock Usage Examples
|
|
2
|
+
|
|
3
|
+
## Example 1: Technology Stack Tags
|
|
4
|
+
|
|
5
|
+
**Configuration:**
|
|
6
|
+
|
|
7
|
+
```yaml
|
|
8
|
+
Layout: Row Wrap
|
|
9
|
+
Size: Small
|
|
10
|
+
Gap: Medium
|
|
11
|
+
Background Color: #e0e7ff (indigo-100)
|
|
12
|
+
Text Color: #3730a3 (indigo-800)
|
|
13
|
+
Border Width: 1px
|
|
14
|
+
Border Color: #c7d2fe (indigo-300)
|
|
15
|
+
Border Radius: Full
|
|
16
|
+
Hover Effect: Yes
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
**Chips:**
|
|
20
|
+
|
|
21
|
+
- React
|
|
22
|
+
- Next.js
|
|
23
|
+
- TypeScript
|
|
24
|
+
- Tailwind CSS
|
|
25
|
+
- Payload CMS
|
|
26
|
+
- Framer Motion
|
|
27
|
+
|
|
28
|
+
**Result:** Clean, pill-shaped tags that represent your tech stack.
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## Example 2: Feature Checklist
|
|
33
|
+
|
|
34
|
+
**Configuration:**
|
|
35
|
+
|
|
36
|
+
```yaml
|
|
37
|
+
Layout: Column
|
|
38
|
+
Size: Medium
|
|
39
|
+
Gap: Small
|
|
40
|
+
Alignment: Start
|
|
41
|
+
Background Color: #dcfce7 (green-100)
|
|
42
|
+
Text Color: #14532d (green-900)
|
|
43
|
+
Border Width: 2px
|
|
44
|
+
Border Color: #86efac (green-300)
|
|
45
|
+
Border Radius: Medium
|
|
46
|
+
Animate: Yes
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
**Chips:**
|
|
50
|
+
|
|
51
|
+
- ✓ Lightning Fast Performance
|
|
52
|
+
- ✓ SEO Optimized
|
|
53
|
+
- ✓ Mobile Responsive
|
|
54
|
+
- ✓ Fully Accessible
|
|
55
|
+
- ✓ Type Safe
|
|
56
|
+
|
|
57
|
+
**Result:** Vertical list with checkmarks, great for feature highlights.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Example 3: Status Badges
|
|
62
|
+
|
|
63
|
+
**Configuration:**
|
|
64
|
+
|
|
65
|
+
```yaml
|
|
66
|
+
Layout: Row
|
|
67
|
+
Size: Medium
|
|
68
|
+
Gap: Large
|
|
69
|
+
Border Radius: Small
|
|
70
|
+
Hover Effect: Yes
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
**Chips with Individual Colors:**
|
|
74
|
+
|
|
75
|
+
1. **Active**
|
|
76
|
+
- Background: #10b981 (green-500)
|
|
77
|
+
- Text: #ffffff (white)
|
|
78
|
+
- Border: None
|
|
79
|
+
|
|
80
|
+
2. **Pending**
|
|
81
|
+
- Background: #f59e0b (amber-500)
|
|
82
|
+
- Text: #ffffff (white)
|
|
83
|
+
- Border: None
|
|
84
|
+
|
|
85
|
+
3. **Completed**
|
|
86
|
+
- Background: #3b82f6 (blue-500)
|
|
87
|
+
- Text: #ffffff (white)
|
|
88
|
+
- Border: None
|
|
89
|
+
|
|
90
|
+
**Result:** Color-coded status indicators with vibrant colors.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## Example 4: Skill Levels with Links
|
|
95
|
+
|
|
96
|
+
**Configuration:**
|
|
97
|
+
|
|
98
|
+
```yaml
|
|
99
|
+
Layout: Row Wrap
|
|
100
|
+
Size: Large
|
|
101
|
+
Gap: Large
|
|
102
|
+
Background Color: transparent
|
|
103
|
+
Text Color: #1f2937 (gray-800)
|
|
104
|
+
Border Width: 3px
|
|
105
|
+
Border Color: #9ca3af (gray-400)
|
|
106
|
+
Border Radius: Large
|
|
107
|
+
Hover Effect: Yes
|
|
108
|
+
Max Width: 800px
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**Chips with Links:**
|
|
112
|
+
|
|
113
|
+
- JavaScript (Expert) → /skills/javascript
|
|
114
|
+
- Python (Advanced) → /skills/python
|
|
115
|
+
- Design (Intermediate) → /skills/design
|
|
116
|
+
- DevOps (Learning) → /skills/devops
|
|
117
|
+
|
|
118
|
+
**Result:** Outlined chips that act as navigation links.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
## Example 5: Category Tags with Icons
|
|
123
|
+
|
|
124
|
+
**Configuration:**
|
|
125
|
+
|
|
126
|
+
```yaml
|
|
127
|
+
Layout: Row Wrap
|
|
128
|
+
Size: Small
|
|
129
|
+
Gap: Small
|
|
130
|
+
Alignment: Center
|
|
131
|
+
Background: Custom gradient
|
|
132
|
+
Custom Class: gradient-chips
|
|
133
|
+
Animate: Yes
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
**Custom CSS:**
|
|
137
|
+
|
|
138
|
+
```css
|
|
139
|
+
.gradient-chips .chip-item {
|
|
140
|
+
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
|
141
|
+
color: white;
|
|
142
|
+
border: none;
|
|
143
|
+
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
|
|
144
|
+
}
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Chips:**
|
|
148
|
+
|
|
149
|
+
- 🎨 Design
|
|
150
|
+
- 💻 Development
|
|
151
|
+
- 📱 Mobile
|
|
152
|
+
- 🚀 Performance
|
|
153
|
+
- 🔒 Security
|
|
154
|
+
|
|
155
|
+
**Result:** Gradient background chips with emoji icons.
|
|
156
|
+
|
|
157
|
+
---
|
|
158
|
+
|
|
159
|
+
## Example 6: Pricing Features
|
|
160
|
+
|
|
161
|
+
**Configuration:**
|
|
162
|
+
|
|
163
|
+
```yaml
|
|
164
|
+
Layout: Column
|
|
165
|
+
Size: Medium
|
|
166
|
+
Gap: Medium
|
|
167
|
+
Background Color: #ffffff (white)
|
|
168
|
+
Text Color: #111827 (gray-900)
|
|
169
|
+
Border Width: 1px
|
|
170
|
+
Border Color: #e5e7eb (gray-200)
|
|
171
|
+
Border Radius: Medium
|
|
172
|
+
Padding: Medium
|
|
173
|
+
Max Width: 400px
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
**Chips:**
|
|
177
|
+
|
|
178
|
+
- ⚡ Unlimited projects
|
|
179
|
+
- 👥 Up to 10 team members
|
|
180
|
+
- 📊 Advanced analytics
|
|
181
|
+
- 🔧 Priority support
|
|
182
|
+
- 🌐 Custom domain
|
|
183
|
+
|
|
184
|
+
**Result:** Clean feature list for pricing cards.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## Example 7: Social Media Links
|
|
189
|
+
|
|
190
|
+
**Configuration:**
|
|
191
|
+
|
|
192
|
+
```yaml
|
|
193
|
+
Layout: Row
|
|
194
|
+
Size: Large
|
|
195
|
+
Gap: Large
|
|
196
|
+
Alignment: Center
|
|
197
|
+
Background Color: #f3f4f6 (gray-100)
|
|
198
|
+
Border Radius: Full
|
|
199
|
+
Hover Effect: Yes
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
**Chips with Links:**
|
|
203
|
+
|
|
204
|
+
- 🐦 Twitter → https://twitter.com/username
|
|
205
|
+
- 📷 Instagram → https://instagram.com/username
|
|
206
|
+
- 💼 LinkedIn → https://linkedin.com/in/username
|
|
207
|
+
- 🎨 Dribbble → https://dribbble.com/username
|
|
208
|
+
|
|
209
|
+
**Result:** Social media buttons with hover effects.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Example 8: Time-based Tags
|
|
214
|
+
|
|
215
|
+
**Configuration:**
|
|
216
|
+
|
|
217
|
+
```yaml
|
|
218
|
+
Layout: Row Wrap
|
|
219
|
+
Size: Small
|
|
220
|
+
Gap: Small
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
**Chips with Time-based Colors:**
|
|
224
|
+
|
|
225
|
+
1. **Today** (Background: #ef4444 - red-500, Text: white)
|
|
226
|
+
2. **This Week** (Background: #f59e0b - amber-500, Text: white)
|
|
227
|
+
3. **This Month** (Background: #3b82f6 - blue-500, Text: white)
|
|
228
|
+
4. **Older** (Background: #6b7280 - gray-500, Text: white)
|
|
229
|
+
|
|
230
|
+
**Result:** Time-based categorization with color coding.
|
|
231
|
+
|
|
232
|
+
---
|
|
233
|
+
|
|
234
|
+
## Pro Tips
|
|
235
|
+
|
|
236
|
+
### 1. Gradient Backgrounds
|
|
237
|
+
|
|
238
|
+
Use Tailwind gradient classes:
|
|
239
|
+
|
|
240
|
+
```
|
|
241
|
+
Background: bg-gradient-to-r from-purple-500 to-pink-500
|
|
242
|
+
Text Color: text-white
|
|
243
|
+
```
|
|
244
|
+
|
|
245
|
+
### 2. Outline Style
|
|
246
|
+
|
|
247
|
+
For minimal look:
|
|
248
|
+
|
|
249
|
+
```
|
|
250
|
+
Background: transparent
|
|
251
|
+
Border Width: 2px
|
|
252
|
+
Border Color: Current color
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
### 3. Glossy Effect
|
|
256
|
+
|
|
257
|
+
Add custom CSS:
|
|
258
|
+
|
|
259
|
+
```css
|
|
260
|
+
.glossy-chips .chip-item {
|
|
261
|
+
background: linear-gradient(to bottom, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
|
|
262
|
+
backdrop-filter: blur(10px);
|
|
263
|
+
}
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
### 4. Stagger Animation
|
|
267
|
+
|
|
268
|
+
Enable animation for smooth entrance:
|
|
269
|
+
|
|
270
|
+
```
|
|
271
|
+
Animate: Yes
|
|
272
|
+
Layout: Row Wrap or Column
|
|
273
|
+
```
|
|
274
|
+
|
|
275
|
+
### 5. Responsive Design
|
|
276
|
+
|
|
277
|
+
- Use Row Wrap for tags that should wrap on smaller screens
|
|
278
|
+
- Use Column for mobile-friendly vertical lists
|
|
279
|
+
- Set Max Width to prevent chips from being too wide
|
|
280
|
+
|
|
281
|
+
---
|
|
282
|
+
|
|
283
|
+
## Color Combinations
|
|
284
|
+
|
|
285
|
+
### Professional Blue
|
|
286
|
+
|
|
287
|
+
- Background: `#dbeafe` (blue-50)
|
|
288
|
+
- Text: `#1e3a8a` (blue-900)
|
|
289
|
+
- Border: `#93c5fd` (blue-300)
|
|
290
|
+
|
|
291
|
+
### Success Green
|
|
292
|
+
|
|
293
|
+
- Background: `#dcfce7` (green-100)
|
|
294
|
+
- Text: `#14532d` (green-900)
|
|
295
|
+
- Border: `#86efac` (green-300)
|
|
296
|
+
|
|
297
|
+
### Warning Yellow
|
|
298
|
+
|
|
299
|
+
- Background: `#fef3c7` (amber-100)
|
|
300
|
+
- Text: `#78350f` (amber-900)
|
|
301
|
+
- Border: `#fcd34d` (amber-300)
|
|
302
|
+
|
|
303
|
+
### Error Red
|
|
304
|
+
|
|
305
|
+
- Background: `#fee2e2` (red-100)
|
|
306
|
+
- Text: `#7f1d1d` (red-900)
|
|
307
|
+
- Border: `#fca5a5` (red-300)
|
|
308
|
+
|
|
309
|
+
### Dark Mode
|
|
310
|
+
|
|
311
|
+
- Background: `#374151` (gray-700)
|
|
312
|
+
- Text: `#f3f4f6` (gray-100)
|
|
313
|
+
- Border: `#4b5563` (gray-600)
|