@donotdev/cli 0.0.5 → 0.0.6
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/dependencies-matrix.json +57 -33
- package/dist/bin/commands/build.js +9 -3
- package/dist/bin/commands/bump.js +19 -7
- package/dist/bin/commands/cacheout.js +9 -3
- package/dist/bin/commands/create-app.js +21 -7
- package/dist/bin/commands/create-project.js +22 -7
- package/dist/bin/commands/deploy.js +22 -14
- package/dist/bin/commands/dev.js +9 -3
- package/dist/bin/commands/emu.js +9 -3
- package/dist/bin/commands/format.js +9 -3
- package/dist/bin/commands/lint.js +9 -3
- package/dist/bin/commands/make-admin.d.ts +11 -0
- package/dist/bin/commands/make-admin.d.ts.map +1 -0
- package/dist/bin/commands/make-admin.js +12 -0
- package/dist/bin/commands/make-admin.js.map +1 -0
- package/dist/bin/commands/preview.js +9 -3
- package/dist/bin/commands/sync-secrets.js +9 -3
- package/dist/index.js +33 -17
- package/package.json +1 -1
- package/templates/app-demo/index.html.example +4 -0
- package/templates/app-demo/src/App.tsx.example +28 -10
- package/templates/app-demo/src/config/app.ts.example +56 -0
- package/templates/app-next/src/app/ClientLayout.tsx.example +4 -3
- package/templates/app-next/src/app/layout.tsx.example +17 -25
- package/templates/app-next/src/globals.css.example +10 -7
- package/templates/app-next/src/locales/dndev_en.json.example +68 -0
- package/templates/app-next/src/pages/locales/example_en.json.example +5 -0
- package/templates/app-vite/index.html.example +3 -0
- package/templates/app-vite/src/globals.css.example +14 -6
- package/templates/app-vite/src/locales/dndev_en.json.example +68 -0
- package/templates/functions-firebase/README.md.example +25 -0
- package/templates/functions-firebase/tsconfig.json.example +3 -13
- package/templates/functions-vercel/tsconfig.json.example +1 -13
- package/templates/root-consumer/firebase.json.example +1 -1
- package/templates/root-consumer/guides/COMPONENTS_ADV.md.example +456 -360
- package/templates/root-consumer/guides/COMPONENTS_ATOMIC.md.example +42 -0
- package/templates/root-consumer/guides/INDEX.md.example +3 -0
- package/templates/root-consumer/guides/SETUP_APP_CONFIG.md.example +5 -2
- package/templates/root-consumer/guides/SETUP_BILLING.md.example +44 -4
- package/templates/root-consumer/guides/SETUP_CRUD.md.example +1244 -0
- package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +52 -0
- package/templates/root-consumer/guides/SETUP_PAGES.md.example +17 -0
- package/templates/root-consumer/guides/SETUP_PWA.md.example +213 -0
- package/templates/root-consumer/guides/USE_ROUTING.md.example +503 -0
- package/templates/root-consumer/vercel.json.example +315 -20
- package/templates/app-demo/src/Routes.tsx.example +0 -20
- package/templates/app-vite/src/Routes.tsx.example +0 -16
- package/templates/app-vite/src/pages/locales/README.md.example +0 -1
|
@@ -1,360 +1,456 @@
|
|
|
1
|
-
# Advanced Components (@donotdev/adv-comps)
|
|
2
|
-
|
|
3
|
-
High-level, opinionated, and marketing-focused UI components for DoNotDev framework.
|
|
4
|
-
|
|
5
|
-
## Setup
|
|
6
|
-
|
|
7
|
-
**IMPORTANT:** You must import the styles in your `globals.css` file:
|
|
8
|
-
|
|
9
|
-
```css
|
|
10
|
-
@import '@donotdev/adv-comps/styles';
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
Without this import, components will not have their required CSS styles.
|
|
14
|
-
|
|
15
|
-
## Components
|
|
16
|
-
|
|
17
|
-
### Crawl
|
|
18
|
-
|
|
19
|
-
Cinematic 3D text crawl component with lazy loading.
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
import { Crawl } from '@donotdev/adv-comps';
|
|
23
|
-
|
|
24
|
-
<Crawl
|
|
25
|
-
intro?: ReactNode | string
|
|
26
|
-
title?: ReactNode | string
|
|
27
|
-
content: ReactNode | string | string[]
|
|
28
|
-
duration?: number // @default 26
|
|
29
|
-
contentHeight?: string // @default "150vh"
|
|
30
|
-
tiltAngle?: number
|
|
31
|
-
className?: string
|
|
32
|
-
style?: CSSProperties
|
|
33
|
-
aria-label?: string
|
|
34
|
-
/>
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Marquee
|
|
38
|
-
|
|
39
|
-
Production-grade marquee with accessibility, reduced motion support, and smart behavior detection.
|
|
40
|
-
|
|
41
|
-
```tsx
|
|
42
|
-
import { Marquee } from '@donotdev/adv-comps';
|
|
43
|
-
|
|
44
|
-
<Marquee<T>
|
|
45
|
-
items: T[]
|
|
46
|
-
renderItem: (item: T, index: number) => ReactNode
|
|
47
|
-
className?: string
|
|
48
|
-
itemClassName?: string
|
|
49
|
-
gap?: 'none' | 'tight' | 'medium' | 'large' // @default 'medium'
|
|
50
|
-
speed?: number // px per second
|
|
51
|
-
direction?: 'left' | 'right' | 'up' | 'down' | 'auto' // @default 'auto'
|
|
52
|
-
pauseOnHover?: boolean
|
|
53
|
-
ariaLabel?: string
|
|
54
|
-
reducedMotion?: 'respect' | 'ignore'
|
|
55
|
-
behavior?: 'bounce' | 'infinite' | 'auto'
|
|
56
|
-
pauseOnFocusWithin?: boolean
|
|
57
|
-
easing?: 'linear' | 'ease-in-out' | 'ease-out'
|
|
58
|
-
/>
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### Roadmap
|
|
62
|
-
|
|
63
|
-
Timeline component with horizontal (desktop) / vertical (mobile) layout. Features animated progress line, glowing nodes, and lift-on-hover cards.
|
|
64
|
-
|
|
65
|
-
```tsx
|
|
66
|
-
import { Roadmap } from '@donotdev/adv-comps';
|
|
67
|
-
import type { RoadmapStep } from '@donotdev/adv-comps';
|
|
68
|
-
|
|
69
|
-
<Roadmap
|
|
70
|
-
steps: RoadmapStep[]
|
|
71
|
-
className?: string
|
|
72
|
-
variant?: CardVariant // @default 'default'
|
|
73
|
-
/>
|
|
74
|
-
|
|
75
|
-
// RoadmapStep interface:
|
|
76
|
-
interface RoadmapStep {
|
|
77
|
-
phase: string // e.g., "Week 1", "Days 1-2"
|
|
78
|
-
icon: LucideIcon
|
|
79
|
-
title: string
|
|
80
|
-
subtitle: string
|
|
81
|
-
description?: string
|
|
82
|
-
content?: CardContent // Optional content shown in popover on click
|
|
83
|
-
}
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### StackedCards
|
|
87
|
-
|
|
88
|
-
Simple scroll-reveal stacked cards. Active card shows full content, stacked cards show only bottom edge with number.
|
|
89
|
-
|
|
90
|
-
```tsx
|
|
91
|
-
import { StackedCards } from '@donotdev/adv-comps';
|
|
92
|
-
import type { StackedCardData } from '@donotdev/adv-comps';
|
|
93
|
-
|
|
94
|
-
<StackedCards
|
|
95
|
-
items: StackedCardData[]
|
|
96
|
-
variant?: SurfaceVariantProps['variant']
|
|
97
|
-
ariaLabel?: string
|
|
98
|
-
threshold?: number // Intersection threshold (0.0 - 1.0) @default 0.3
|
|
99
|
-
className?: string
|
|
100
|
-
style?: CSSProperties
|
|
101
|
-
/>
|
|
102
|
-
|
|
103
|
-
// StackedCardData extends ComponentData with:
|
|
104
|
-
interface StackedCardData extends ComponentData {
|
|
105
|
-
number?: string | number // Custom number/label (e.g. "01", "Week 1"). Defaults to index.
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### Reveal
|
|
110
|
-
|
|
111
|
-
Reveal component for staggered animations. Features viewport-based visibility detection, directional animations, and customizable stagger delays.
|
|
112
|
-
|
|
113
|
-
```tsx
|
|
114
|
-
import { Reveal } from '@donotdev/adv-comps';
|
|
115
|
-
|
|
116
|
-
<Reveal
|
|
117
|
-
items: string[] | ReactNode[]
|
|
118
|
-
direction?: 'left' | 'right' | 'top' | 'bottom' | 'fade-in' | 'alternate-h' | 'alternate-v'
|
|
119
|
-
stagger?: number // milliseconds between items
|
|
120
|
-
threshold?: number
|
|
121
|
-
distance?: number // animation distance in pixels
|
|
122
|
-
duration?: number // animation duration in milliseconds
|
|
123
|
-
once?: boolean // if true, only animate once
|
|
124
|
-
viewport?: boolean // if true, only animate items in viewport
|
|
125
|
-
overrides?: Array<{
|
|
126
|
-
index: number
|
|
127
|
-
direction: 'left' | 'right' | 'top' | 'bottom' | 'fade-in'
|
|
128
|
-
}>
|
|
129
|
-
className?: string
|
|
130
|
-
children?: ReactNode
|
|
131
|
-
/>
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### InspectorGadget
|
|
135
|
-
|
|
136
|
-
Floating code inspector component. Displays a floating eye icon button that opens a dialog showing the page's source code.
|
|
137
|
-
|
|
138
|
-
```tsx
|
|
139
|
-
import { InspectorGadget } from '@donotdev/adv-comps';
|
|
140
|
-
|
|
141
|
-
<InspectorGadget
|
|
142
|
-
data?: string // Source code string
|
|
143
|
-
sourcePath?: string // Path to source file (import with ?raw) - overrides data if provided
|
|
144
|
-
sourceCode?: string // Source code loaded from file
|
|
145
|
-
language?: string // Code language for syntax highlighting @default 'tsx'
|
|
146
|
-
title?: string // Dialog title @default 'Page Source'
|
|
147
|
-
className?: string
|
|
148
|
-
/>
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### Breathing Components
|
|
152
|
-
|
|
153
|
-
Breathing exercise components for meditation and wellness apps.
|
|
154
|
-
|
|
155
|
-
```tsx
|
|
156
|
-
import { LungsAnimation, BreathingExerciseLayout } from '@donotdev/adv-comps';
|
|
157
|
-
import type { BreathingExerciseDnDevLayoutProps } from '@donotdev/adv-comps';
|
|
158
|
-
|
|
159
|
-
<BreathingExerciseLayout
|
|
160
|
-
status?: ReactNode
|
|
161
|
-
animation: ReactNode
|
|
162
|
-
instructions: ReactNode
|
|
163
|
-
debug?: boolean
|
|
164
|
-
onSkip?: () => void
|
|
165
|
-
statusValue?: string
|
|
166
|
-
onRestart?: () => void
|
|
167
|
-
isPaused?: boolean
|
|
168
|
-
isComplete?: boolean
|
|
169
|
-
/>
|
|
170
|
-
|
|
171
|
-
<LungsAnimation ... />
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
### Carousel
|
|
175
|
-
|
|
176
|
-
Premium carousel component with lazy loading built-in. Features true infinite circular loop, hardware-accelerated animations, swipe/touch gestures, and autoplay with pause-on-hover.
|
|
177
|
-
|
|
178
|
-
```tsx
|
|
179
|
-
import { Carousel } from '@donotdev/adv-comps';
|
|
180
|
-
import type { CarouselProps, CarouselRef } from '@donotdev/adv-comps';
|
|
181
|
-
|
|
182
|
-
<Carousel<T>
|
|
183
|
-
items: T[]
|
|
184
|
-
renderItem: (item: T, index: number, isActive: boolean) => ReactNode
|
|
185
|
-
className?: string
|
|
186
|
-
slideClassName?: string
|
|
187
|
-
showArrows?: boolean
|
|
188
|
-
showDots?: boolean
|
|
189
|
-
showProgress?: boolean
|
|
190
|
-
autoplay?: boolean
|
|
191
|
-
autoplayInterval?: number // milliseconds
|
|
192
|
-
transitionDuration?: number // milliseconds
|
|
193
|
-
loop?: boolean
|
|
194
|
-
// ... and more props
|
|
195
|
-
/>
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
### ComparisonGrid
|
|
199
|
-
|
|
200
|
-
Comparison grid component for displaying feature comparisons. Provides lazy-loaded content with skeleton loading states.
|
|
201
|
-
|
|
202
|
-
```tsx
|
|
203
|
-
import { ComparisonGrid } from '@donotdev/adv-comps';
|
|
204
|
-
import type { ComparisonItem } from '@donotdev/adv-comps';
|
|
205
|
-
|
|
206
|
-
<ComparisonGrid
|
|
207
|
-
title?: string
|
|
208
|
-
items: ComparisonItem[]
|
|
209
|
-
gridCols?: 1 | 2 | 3 | 4 // @default 2
|
|
210
|
-
className?: string
|
|
211
|
-
ariaLabel?: string
|
|
212
|
-
/>
|
|
213
|
-
|
|
214
|
-
// ComparisonItem interface:
|
|
215
|
-
interface ComparisonItem {
|
|
216
|
-
useCase: string
|
|
217
|
-
bestFit: string
|
|
218
|
-
dndev: string
|
|
219
|
-
reason: string
|
|
220
|
-
}
|
|
221
|
-
```
|
|
222
|
-
|
|
223
|
-
### CongratulationsCard
|
|
224
|
-
|
|
225
|
-
Card component for displaying congratulatory messages. Features customizable icon and text with centered layout.
|
|
226
|
-
|
|
227
|
-
```tsx
|
|
228
|
-
import { CongratulationsCard } from '@donotdev/adv-comps';
|
|
229
|
-
|
|
230
|
-
<CongratulationsCard
|
|
231
|
-
text: string
|
|
232
|
-
icon?: ReactNode // @default '🎉'
|
|
233
|
-
className?: string
|
|
234
|
-
/>
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
### GuideModal
|
|
238
|
-
|
|
239
|
-
Modal component for displaying guides and tutorials. Provides step-by-step guide display with navigation, progress tracking, and completion handling.
|
|
240
|
-
|
|
241
|
-
```tsx
|
|
242
|
-
import { GuideModal } from '@donotdev/adv-comps';
|
|
243
|
-
import type { GuideModalProps, GuideTemplate } from '@donotdev/adv-comps';
|
|
244
|
-
|
|
245
|
-
<GuideModal
|
|
246
|
-
open: boolean
|
|
247
|
-
onOpenChange: (open: boolean) => void
|
|
248
|
-
guide: GuideTemplate
|
|
249
|
-
icon?: LucideIcon
|
|
250
|
-
/>
|
|
251
|
-
|
|
252
|
-
// GuideTemplate interface:
|
|
253
|
-
interface GuideTemplate {
|
|
254
|
-
title: string
|
|
255
|
-
subtitle: string
|
|
256
|
-
quickStart?: {
|
|
257
|
-
title: string
|
|
258
|
-
code: string
|
|
259
|
-
description: string
|
|
260
|
-
}
|
|
261
|
-
steps?: GuideStep[]
|
|
262
|
-
features?: string[]
|
|
263
|
-
templates?: Array<{
|
|
264
|
-
name: string
|
|
265
|
-
description: string
|
|
266
|
-
}>
|
|
267
|
-
actions?: Array<{
|
|
268
|
-
label: string
|
|
269
|
-
href: string
|
|
270
|
-
variant?: 'default' | 'outline'
|
|
271
|
-
icon?: LucideIcon
|
|
272
|
-
}>
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
// GuideStep interface:
|
|
276
|
-
interface GuideStep {
|
|
277
|
-
icon: LucideIcon
|
|
278
|
-
title: string
|
|
279
|
-
description: string
|
|
280
|
-
code?: string
|
|
281
|
-
details?: string
|
|
282
|
-
}
|
|
283
|
-
```
|
|
284
|
-
|
|
285
|
-
### SplitReveal
|
|
286
|
-
|
|
287
|
-
Split reveal component for displaying content in two columns. Features left column content and right column stat cards or custom content with reveal animations.
|
|
288
|
-
|
|
289
|
-
```tsx
|
|
290
|
-
import { SplitReveal } from '@donotdev/adv-comps';
|
|
291
|
-
import type { StatCardData } from '@donotdev/adv-comps';
|
|
292
|
-
|
|
293
|
-
<SplitReveal
|
|
294
|
-
left: ReactNode
|
|
295
|
-
right: ReactNode | StatCardData[]
|
|
296
|
-
leftDirection?: 'left' | 'right' | 'top' | 'bottom' | 'fade-in' // @default 'left'
|
|
297
|
-
rightDirection?: 'left' | 'right' | 'top' | 'bottom' | 'fade-in' // @default 'right'
|
|
298
|
-
threshold?: number // @default 0.3
|
|
299
|
-
className?: string
|
|
300
|
-
/>
|
|
301
|
-
|
|
302
|
-
// StatCardData interface:
|
|
303
|
-
interface StatCardData {
|
|
304
|
-
title: string
|
|
305
|
-
description: string
|
|
306
|
-
}
|
|
307
|
-
```
|
|
308
|
-
|
|
309
|
-
### StartChallengeForm
|
|
310
|
-
|
|
311
|
-
Generic form layout component for input + CTA button patterns.
|
|
312
|
-
|
|
313
|
-
```tsx
|
|
314
|
-
import { StartChallengeForm } from '@donotdev/adv-comps';
|
|
315
|
-
|
|
316
|
-
<StartChallengeForm
|
|
317
|
-
input={{
|
|
318
|
-
value: string
|
|
319
|
-
onChange: (value: string) => void
|
|
320
|
-
placeholder?: string
|
|
321
|
-
label?: string
|
|
322
|
-
maxLength?: number
|
|
323
|
-
className?: string
|
|
324
|
-
}}
|
|
325
|
-
button={{
|
|
326
|
-
label: string
|
|
327
|
-
onClick: () => void
|
|
328
|
-
icon?: ComponentType<{ className?: string }>
|
|
329
|
-
variant?: ButtonVariant
|
|
330
|
-
className?: string
|
|
331
|
-
}}
|
|
332
|
-
size?: 'sm' | 'md' | 'lg'
|
|
333
|
-
className?: string
|
|
334
|
-
/>
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
### Waterfall
|
|
338
|
-
|
|
339
|
-
Waterfall component with lazy loading built-in. Features clean cascade layout with diagonal staircase effect, perfect for step-by-step processes or feature showcases.
|
|
340
|
-
|
|
341
|
-
```tsx
|
|
342
|
-
import { Waterfall } from '@donotdev/adv-comps';
|
|
343
|
-
import type { WaterfallProps } from '@donotdev/adv-comps';
|
|
344
|
-
|
|
345
|
-
<Waterfall
|
|
346
|
-
items: ComponentData[]
|
|
347
|
-
className?: string
|
|
348
|
-
connectorClassName?: string
|
|
349
|
-
density?: 'compact' | 'comfortable'
|
|
350
|
-
ariaLabel?: string
|
|
351
|
-
direction?: 'horizontal' | 'descending'
|
|
352
|
-
/>
|
|
353
|
-
```
|
|
354
|
-
|
|
355
|
-
## Notes
|
|
356
|
-
|
|
357
|
-
- All components are lazy-loaded by default for optimal performance
|
|
358
|
-
- Components use framework theme variables for consistent styling
|
|
359
|
-
- Most components support reduced motion preferences
|
|
360
|
-
- All components are SSR-safe and work with both Vite and Next.js
|
|
1
|
+
# Advanced Components (@donotdev/adv-comps)
|
|
2
|
+
|
|
3
|
+
High-level, opinionated, and marketing-focused UI components for DoNotDev framework.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
**IMPORTANT:** You must import the styles in your `globals.css` file:
|
|
8
|
+
|
|
9
|
+
```css
|
|
10
|
+
@import '@donotdev/adv-comps/styles';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Without this import, components will not have their required CSS styles.
|
|
14
|
+
|
|
15
|
+
## Components
|
|
16
|
+
|
|
17
|
+
### Crawl
|
|
18
|
+
|
|
19
|
+
Cinematic 3D text crawl component with lazy loading.
|
|
20
|
+
|
|
21
|
+
```tsx
|
|
22
|
+
import { Crawl } from '@donotdev/adv-comps';
|
|
23
|
+
|
|
24
|
+
<Crawl
|
|
25
|
+
intro?: ReactNode | string
|
|
26
|
+
title?: ReactNode | string
|
|
27
|
+
content: ReactNode | string | string[]
|
|
28
|
+
duration?: number // @default 26
|
|
29
|
+
contentHeight?: string // @default "150vh"
|
|
30
|
+
tiltAngle?: number
|
|
31
|
+
className?: string
|
|
32
|
+
style?: CSSProperties
|
|
33
|
+
aria-label?: string
|
|
34
|
+
/>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### Marquee
|
|
38
|
+
|
|
39
|
+
Production-grade marquee with accessibility, reduced motion support, and smart behavior detection.
|
|
40
|
+
|
|
41
|
+
```tsx
|
|
42
|
+
import { Marquee } from '@donotdev/adv-comps';
|
|
43
|
+
|
|
44
|
+
<Marquee<T>
|
|
45
|
+
items: T[]
|
|
46
|
+
renderItem: (item: T, index: number) => ReactNode
|
|
47
|
+
className?: string
|
|
48
|
+
itemClassName?: string
|
|
49
|
+
gap?: 'none' | 'tight' | 'medium' | 'large' // @default 'medium'
|
|
50
|
+
speed?: number // px per second
|
|
51
|
+
direction?: 'left' | 'right' | 'up' | 'down' | 'auto' // @default 'auto'
|
|
52
|
+
pauseOnHover?: boolean
|
|
53
|
+
ariaLabel?: string
|
|
54
|
+
reducedMotion?: 'respect' | 'ignore'
|
|
55
|
+
behavior?: 'bounce' | 'infinite' | 'auto'
|
|
56
|
+
pauseOnFocusWithin?: boolean
|
|
57
|
+
easing?: 'linear' | 'ease-in-out' | 'ease-out'
|
|
58
|
+
/>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
### Roadmap
|
|
62
|
+
|
|
63
|
+
Timeline component with horizontal (desktop) / vertical (mobile) layout. Features animated progress line, glowing nodes, and lift-on-hover cards.
|
|
64
|
+
|
|
65
|
+
```tsx
|
|
66
|
+
import { Roadmap } from '@donotdev/adv-comps';
|
|
67
|
+
import type { RoadmapStep } from '@donotdev/adv-comps';
|
|
68
|
+
|
|
69
|
+
<Roadmap
|
|
70
|
+
steps: RoadmapStep[]
|
|
71
|
+
className?: string
|
|
72
|
+
variant?: CardVariant // @default 'default'
|
|
73
|
+
/>
|
|
74
|
+
|
|
75
|
+
// RoadmapStep interface:
|
|
76
|
+
interface RoadmapStep {
|
|
77
|
+
phase: string // e.g., "Week 1", "Days 1-2"
|
|
78
|
+
icon: LucideIcon
|
|
79
|
+
title: string
|
|
80
|
+
subtitle: string
|
|
81
|
+
description?: string
|
|
82
|
+
content?: CardContent // Optional content shown in popover on click
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### StackedCards
|
|
87
|
+
|
|
88
|
+
Simple scroll-reveal stacked cards. Active card shows full content, stacked cards show only bottom edge with number.
|
|
89
|
+
|
|
90
|
+
```tsx
|
|
91
|
+
import { StackedCards } from '@donotdev/adv-comps';
|
|
92
|
+
import type { StackedCardData } from '@donotdev/adv-comps';
|
|
93
|
+
|
|
94
|
+
<StackedCards
|
|
95
|
+
items: StackedCardData[]
|
|
96
|
+
variant?: SurfaceVariantProps['variant']
|
|
97
|
+
ariaLabel?: string
|
|
98
|
+
threshold?: number // Intersection threshold (0.0 - 1.0) @default 0.3
|
|
99
|
+
className?: string
|
|
100
|
+
style?: CSSProperties
|
|
101
|
+
/>
|
|
102
|
+
|
|
103
|
+
// StackedCardData extends ComponentData with:
|
|
104
|
+
interface StackedCardData extends ComponentData {
|
|
105
|
+
number?: string | number // Custom number/label (e.g. "01", "Week 1"). Defaults to index.
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### Reveal
|
|
110
|
+
|
|
111
|
+
Reveal component for staggered animations. Features viewport-based visibility detection, directional animations, and customizable stagger delays.
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
import { Reveal } from '@donotdev/adv-comps';
|
|
115
|
+
|
|
116
|
+
<Reveal
|
|
117
|
+
items: string[] | ReactNode[]
|
|
118
|
+
direction?: 'left' | 'right' | 'top' | 'bottom' | 'fade-in' | 'alternate-h' | 'alternate-v'
|
|
119
|
+
stagger?: number // milliseconds between items
|
|
120
|
+
threshold?: number
|
|
121
|
+
distance?: number // animation distance in pixels
|
|
122
|
+
duration?: number // animation duration in milliseconds
|
|
123
|
+
once?: boolean // if true, only animate once
|
|
124
|
+
viewport?: boolean // if true, only animate items in viewport
|
|
125
|
+
overrides?: Array<{
|
|
126
|
+
index: number
|
|
127
|
+
direction: 'left' | 'right' | 'top' | 'bottom' | 'fade-in'
|
|
128
|
+
}>
|
|
129
|
+
className?: string
|
|
130
|
+
children?: ReactNode
|
|
131
|
+
/>
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
### InspectorGadget
|
|
135
|
+
|
|
136
|
+
Floating code inspector component. Displays a floating eye icon button that opens a dialog showing the page's source code.
|
|
137
|
+
|
|
138
|
+
```tsx
|
|
139
|
+
import { InspectorGadget } from '@donotdev/adv-comps';
|
|
140
|
+
|
|
141
|
+
<InspectorGadget
|
|
142
|
+
data?: string // Source code string
|
|
143
|
+
sourcePath?: string // Path to source file (import with ?raw) - overrides data if provided
|
|
144
|
+
sourceCode?: string // Source code loaded from file
|
|
145
|
+
language?: string // Code language for syntax highlighting @default 'tsx'
|
|
146
|
+
title?: string // Dialog title @default 'Page Source'
|
|
147
|
+
className?: string
|
|
148
|
+
/>
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
### Breathing Components
|
|
152
|
+
|
|
153
|
+
Breathing exercise components for meditation and wellness apps.
|
|
154
|
+
|
|
155
|
+
```tsx
|
|
156
|
+
import { LungsAnimation, BreathingExerciseLayout } from '@donotdev/adv-comps';
|
|
157
|
+
import type { BreathingExerciseDnDevLayoutProps } from '@donotdev/adv-comps';
|
|
158
|
+
|
|
159
|
+
<BreathingExerciseLayout
|
|
160
|
+
status?: ReactNode
|
|
161
|
+
animation: ReactNode
|
|
162
|
+
instructions: ReactNode
|
|
163
|
+
debug?: boolean
|
|
164
|
+
onSkip?: () => void
|
|
165
|
+
statusValue?: string
|
|
166
|
+
onRestart?: () => void
|
|
167
|
+
isPaused?: boolean
|
|
168
|
+
isComplete?: boolean
|
|
169
|
+
/>
|
|
170
|
+
|
|
171
|
+
<LungsAnimation ... />
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
### Carousel
|
|
175
|
+
|
|
176
|
+
Premium carousel component with lazy loading built-in. Features true infinite circular loop, hardware-accelerated animations, swipe/touch gestures, and autoplay with pause-on-hover.
|
|
177
|
+
|
|
178
|
+
```tsx
|
|
179
|
+
import { Carousel } from '@donotdev/adv-comps';
|
|
180
|
+
import type { CarouselProps, CarouselRef } from '@donotdev/adv-comps';
|
|
181
|
+
|
|
182
|
+
<Carousel<T>
|
|
183
|
+
items: T[]
|
|
184
|
+
renderItem: (item: T, index: number, isActive: boolean) => ReactNode
|
|
185
|
+
className?: string
|
|
186
|
+
slideClassName?: string
|
|
187
|
+
showArrows?: boolean
|
|
188
|
+
showDots?: boolean
|
|
189
|
+
showProgress?: boolean
|
|
190
|
+
autoplay?: boolean
|
|
191
|
+
autoplayInterval?: number // milliseconds
|
|
192
|
+
transitionDuration?: number // milliseconds
|
|
193
|
+
loop?: boolean
|
|
194
|
+
// ... and more props
|
|
195
|
+
/>
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### ComparisonGrid
|
|
199
|
+
|
|
200
|
+
Comparison grid component for displaying feature comparisons. Provides lazy-loaded content with skeleton loading states.
|
|
201
|
+
|
|
202
|
+
```tsx
|
|
203
|
+
import { ComparisonGrid } from '@donotdev/adv-comps';
|
|
204
|
+
import type { ComparisonItem } from '@donotdev/adv-comps';
|
|
205
|
+
|
|
206
|
+
<ComparisonGrid
|
|
207
|
+
title?: string
|
|
208
|
+
items: ComparisonItem[]
|
|
209
|
+
gridCols?: 1 | 2 | 3 | 4 // @default 2
|
|
210
|
+
className?: string
|
|
211
|
+
ariaLabel?: string
|
|
212
|
+
/>
|
|
213
|
+
|
|
214
|
+
// ComparisonItem interface:
|
|
215
|
+
interface ComparisonItem {
|
|
216
|
+
useCase: string
|
|
217
|
+
bestFit: string
|
|
218
|
+
dndev: string
|
|
219
|
+
reason: string
|
|
220
|
+
}
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
### CongratulationsCard
|
|
224
|
+
|
|
225
|
+
Card component for displaying congratulatory messages. Features customizable icon and text with centered layout.
|
|
226
|
+
|
|
227
|
+
```tsx
|
|
228
|
+
import { CongratulationsCard } from '@donotdev/adv-comps';
|
|
229
|
+
|
|
230
|
+
<CongratulationsCard
|
|
231
|
+
text: string
|
|
232
|
+
icon?: ReactNode // @default '🎉'
|
|
233
|
+
className?: string
|
|
234
|
+
/>
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
### GuideModal
|
|
238
|
+
|
|
239
|
+
Modal component for displaying guides and tutorials. Provides step-by-step guide display with navigation, progress tracking, and completion handling.
|
|
240
|
+
|
|
241
|
+
```tsx
|
|
242
|
+
import { GuideModal } from '@donotdev/adv-comps';
|
|
243
|
+
import type { GuideModalProps, GuideTemplate } from '@donotdev/adv-comps';
|
|
244
|
+
|
|
245
|
+
<GuideModal
|
|
246
|
+
open: boolean
|
|
247
|
+
onOpenChange: (open: boolean) => void
|
|
248
|
+
guide: GuideTemplate
|
|
249
|
+
icon?: LucideIcon
|
|
250
|
+
/>
|
|
251
|
+
|
|
252
|
+
// GuideTemplate interface:
|
|
253
|
+
interface GuideTemplate {
|
|
254
|
+
title: string
|
|
255
|
+
subtitle: string
|
|
256
|
+
quickStart?: {
|
|
257
|
+
title: string
|
|
258
|
+
code: string
|
|
259
|
+
description: string
|
|
260
|
+
}
|
|
261
|
+
steps?: GuideStep[]
|
|
262
|
+
features?: string[]
|
|
263
|
+
templates?: Array<{
|
|
264
|
+
name: string
|
|
265
|
+
description: string
|
|
266
|
+
}>
|
|
267
|
+
actions?: Array<{
|
|
268
|
+
label: string
|
|
269
|
+
href: string
|
|
270
|
+
variant?: 'default' | 'outline'
|
|
271
|
+
icon?: LucideIcon
|
|
272
|
+
}>
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
// GuideStep interface:
|
|
276
|
+
interface GuideStep {
|
|
277
|
+
icon: LucideIcon
|
|
278
|
+
title: string
|
|
279
|
+
description: string
|
|
280
|
+
code?: string
|
|
281
|
+
details?: string
|
|
282
|
+
}
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### SplitReveal
|
|
286
|
+
|
|
287
|
+
Split reveal component for displaying content in two columns. Features left column content and right column stat cards or custom content with reveal animations.
|
|
288
|
+
|
|
289
|
+
```tsx
|
|
290
|
+
import { SplitReveal } from '@donotdev/adv-comps';
|
|
291
|
+
import type { StatCardData } from '@donotdev/adv-comps';
|
|
292
|
+
|
|
293
|
+
<SplitReveal
|
|
294
|
+
left: ReactNode
|
|
295
|
+
right: ReactNode | StatCardData[]
|
|
296
|
+
leftDirection?: 'left' | 'right' | 'top' | 'bottom' | 'fade-in' // @default 'left'
|
|
297
|
+
rightDirection?: 'left' | 'right' | 'top' | 'bottom' | 'fade-in' // @default 'right'
|
|
298
|
+
threshold?: number // @default 0.3
|
|
299
|
+
className?: string
|
|
300
|
+
/>
|
|
301
|
+
|
|
302
|
+
// StatCardData interface:
|
|
303
|
+
interface StatCardData {
|
|
304
|
+
title: string
|
|
305
|
+
description: string
|
|
306
|
+
}
|
|
307
|
+
```
|
|
308
|
+
|
|
309
|
+
### StartChallengeForm
|
|
310
|
+
|
|
311
|
+
Generic form layout component for input + CTA button patterns.
|
|
312
|
+
|
|
313
|
+
```tsx
|
|
314
|
+
import { StartChallengeForm } from '@donotdev/adv-comps';
|
|
315
|
+
|
|
316
|
+
<StartChallengeForm
|
|
317
|
+
input={{
|
|
318
|
+
value: string
|
|
319
|
+
onChange: (value: string) => void
|
|
320
|
+
placeholder?: string
|
|
321
|
+
label?: string
|
|
322
|
+
maxLength?: number
|
|
323
|
+
className?: string
|
|
324
|
+
}}
|
|
325
|
+
button={{
|
|
326
|
+
label: string
|
|
327
|
+
onClick: () => void
|
|
328
|
+
icon?: ComponentType<{ className?: string }>
|
|
329
|
+
variant?: ButtonVariant
|
|
330
|
+
className?: string
|
|
331
|
+
}}
|
|
332
|
+
size?: 'sm' | 'md' | 'lg'
|
|
333
|
+
className?: string
|
|
334
|
+
/>
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Waterfall
|
|
338
|
+
|
|
339
|
+
Waterfall component with lazy loading built-in. Features clean cascade layout with diagonal staircase effect, perfect for step-by-step processes or feature showcases.
|
|
340
|
+
|
|
341
|
+
```tsx
|
|
342
|
+
import { Waterfall } from '@donotdev/adv-comps';
|
|
343
|
+
import type { WaterfallProps } from '@donotdev/adv-comps';
|
|
344
|
+
|
|
345
|
+
<Waterfall
|
|
346
|
+
items: ComponentData[]
|
|
347
|
+
className?: string
|
|
348
|
+
connectorClassName?: string
|
|
349
|
+
density?: 'compact' | 'comfortable'
|
|
350
|
+
ariaLabel?: string
|
|
351
|
+
direction?: 'horizontal' | 'descending'
|
|
352
|
+
/>
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
## Notes
|
|
356
|
+
|
|
357
|
+
- All components are lazy-loaded by default for optimal performance
|
|
358
|
+
- Components use framework theme variables for consistent styling
|
|
359
|
+
- Most components support reduced motion preferences
|
|
360
|
+
- All components are SSR-safe and work with both Vite and Next.js
|
|
361
|
+
|
|
362
|
+
## FAQSection (from @donotdev/core)
|
|
363
|
+
|
|
364
|
+
FAQ section component for displaying frequently asked questions using accordion. Reads FAQ items from i18n JSON files.
|
|
365
|
+
|
|
366
|
+
**Note:** This component is from `@donotdev/core`, not `@donotdev/adv-comps`. It requires i18n setup with translation files.
|
|
367
|
+
|
|
368
|
+
```tsx
|
|
369
|
+
import { FAQSection, useTranslation } from '@donotdev/core';
|
|
370
|
+
import { Section } from '@donotdev/components';
|
|
371
|
+
|
|
372
|
+
function FAQPage() {
|
|
373
|
+
const { t } = useTranslation(['faq']);
|
|
374
|
+
|
|
375
|
+
return (
|
|
376
|
+
<Section>
|
|
377
|
+
<FAQSection t={t} keyPrefix="faqs.items" maxIndex={50} />
|
|
378
|
+
</Section>
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
```
|
|
382
|
+
|
|
383
|
+
**Props:**
|
|
384
|
+
- `t: TFunction` - Translation function from `useTranslation` hook
|
|
385
|
+
- `keyPrefix: string` - Base key prefix for FAQ items (e.g., `'faqs.items'`)
|
|
386
|
+
- `maxIndex?: number` - Maximum number of FAQ items to check (default: 50)
|
|
387
|
+
- `className?: string` - CSS class for container
|
|
388
|
+
- `itemClassName?: string` - CSS class for each accordion item
|
|
389
|
+
- `aria-label?: string` - ARIA label for accessibility (default: 'Frequently Asked Questions')
|
|
390
|
+
|
|
391
|
+
**JSON Structure:**
|
|
392
|
+
|
|
393
|
+
FAQ items must be in your i18n JSON files with this structure:
|
|
394
|
+
|
|
395
|
+
```json
|
|
396
|
+
{
|
|
397
|
+
"faqs": {
|
|
398
|
+
"items": [
|
|
399
|
+
{
|
|
400
|
+
"q": "Question text",
|
|
401
|
+
"a": "Answer text"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
"q": "Another question",
|
|
405
|
+
"a": "Another answer"
|
|
406
|
+
}
|
|
407
|
+
]
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
```
|
|
411
|
+
|
|
412
|
+
The component uses `translateObjectArray` to automatically load all items from `keyPrefix` (e.g., `faqs.items[0]`, `faqs.items[1]`, etc.) up to `maxIndex`.
|
|
413
|
+
|
|
414
|
+
**Example:**
|
|
415
|
+
|
|
416
|
+
```tsx
|
|
417
|
+
// src/pages/FAQPage.tsx
|
|
418
|
+
import { FAQSection, useTranslation } from '@donotdev/core';
|
|
419
|
+
import { HeroSection, Section } from '@donotdev/components';
|
|
420
|
+
import { PageContainer } from '@donotdev/ui';
|
|
421
|
+
|
|
422
|
+
export const NAMESPACE = 'faq';
|
|
423
|
+
|
|
424
|
+
function FAQPage() {
|
|
425
|
+
const { t } = useTranslation([NAMESPACE]);
|
|
426
|
+
|
|
427
|
+
return (
|
|
428
|
+
<PageContainer variant="docs">
|
|
429
|
+
<HeroSection title={t('title')} subtitle={t('subtitle')} />
|
|
430
|
+
<Section>
|
|
431
|
+
<FAQSection t={t} keyPrefix="faqs.items" maxIndex={50} />
|
|
432
|
+
</Section>
|
|
433
|
+
</PageContainer>
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
```
|
|
437
|
+
|
|
438
|
+
```json
|
|
439
|
+
// src/pages/locales/faq_en.json
|
|
440
|
+
{
|
|
441
|
+
"title": "Frequently Asked Questions",
|
|
442
|
+
"subtitle": "Everything you need to know.",
|
|
443
|
+
"faqs": {
|
|
444
|
+
"items": [
|
|
445
|
+
{
|
|
446
|
+
"q": "How long does the free trial last?",
|
|
447
|
+
"a": "There is no limit. You can use the framework packages indefinitely for development and local testing."
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
"q": "What is the watermark?",
|
|
451
|
+
"a": "The watermark is a floating button that appears when running applications without a valid license."
|
|
452
|
+
}
|
|
453
|
+
]
|
|
454
|
+
}
|
|
455
|
+
}
|
|
456
|
+
```
|