@donotdev/cli 0.0.4 → 0.0.5
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 +194 -98
- package/dist/bin/commands/bump.js +103 -96
- package/dist/bin/commands/create-app.js +40 -28
- package/dist/bin/commands/create-project.js +40 -28
- package/dist/index.js +40 -28
- package/package.json +1 -1
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +5 -5
- package/templates/app-next/src/app/ClientLayout.tsx.example +1 -1
- package/templates/app-vite/src/App.tsx.example +1 -1
- package/templates/root-consumer/guides/AGENT_START_HERE.md.example +229 -7
- package/templates/root-consumer/guides/COMPONENTS_ADV.md.example +360 -0
- package/templates/root-consumer/guides/COMPONENTS_ATOMIC.md.example +1 -1
- package/templates/root-consumer/guides/COMPONENTS_UI.md.example +6 -0
- package/templates/root-consumer/guides/SETUP_I18N.md.example +145 -6
- package/templates/root-consumer/guides/SETUP_LAYOUTS.md.example +18 -0
- package/templates/root-consumer/guides/SETUP_PAGES.md.example +8 -0
|
@@ -49,7 +49,7 @@ export function DemoLayout({
|
|
|
49
49
|
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
50
50
|
const location = useLocation();
|
|
51
51
|
const navigate = useNavigate();
|
|
52
|
-
const
|
|
52
|
+
const isLaptop = useMediaQuery('(min-width: 1024px)');
|
|
53
53
|
|
|
54
54
|
const handleBack = () => {
|
|
55
55
|
if (location.pathname === '/full') {
|
|
@@ -140,11 +140,11 @@ export function DemoLayout({
|
|
|
140
140
|
return (
|
|
141
141
|
<Grid
|
|
142
142
|
className="dndev-h-screen dndev-w-full dndev-overflow-hidden"
|
|
143
|
-
templateColumns={
|
|
144
|
-
areas={
|
|
143
|
+
templateColumns={isLaptop ? '280px 1fr' : '1fr'}
|
|
144
|
+
areas={isLaptop ? 'sidebar main' : 'main'}
|
|
145
145
|
gap="none"
|
|
146
146
|
>
|
|
147
|
-
{
|
|
147
|
+
{isLaptop && (
|
|
148
148
|
<GridArea
|
|
149
149
|
name="sidebar"
|
|
150
150
|
style={{
|
|
@@ -224,7 +224,7 @@ export function DemoLayout({
|
|
|
224
224
|
{/* Right side: Theme Toggle + Mobile Menu */}
|
|
225
225
|
<Stack direction="row" gap="medium" justify="end" align="center">
|
|
226
226
|
<ThemeToggle />
|
|
227
|
-
{!
|
|
227
|
+
{!isLaptop && (
|
|
228
228
|
<Sheet
|
|
229
229
|
open={isMobileMenuOpen}
|
|
230
230
|
onOpenChange={setIsMobileMenuOpen}
|
|
@@ -25,7 +25,7 @@ export function ClientLayout({ children, serverCookies }: ClientLayoutProps) {
|
|
|
25
25
|
config={appConfig}
|
|
26
26
|
serverCookies={serverCookies}
|
|
27
27
|
layout={{
|
|
28
|
-
breadcrumbs: 'smart', // 'smart' | 'always' | 'never'
|
|
28
|
+
breadcrumbs: 'smart', // 'smart' | 'always' | 'never'
|
|
29
29
|
header: {
|
|
30
30
|
// end: () => <YourHeaderActions />,
|
|
31
31
|
},
|
|
@@ -29,7 +29,7 @@ export function App() {
|
|
|
29
29
|
<ViteAppProviders
|
|
30
30
|
config={appConfig}
|
|
31
31
|
layout={{
|
|
32
|
-
breadcrumbs: 'smart', // 'smart' | 'always' | 'never'
|
|
32
|
+
breadcrumbs: 'smart', // 'smart' | 'always' | 'never'
|
|
33
33
|
header: {
|
|
34
34
|
// end: () => <YourHeaderActions />,
|
|
35
35
|
},
|
|
@@ -10,15 +10,44 @@
|
|
|
10
10
|
|
|
11
11
|
**Never guess. Always verify.**
|
|
12
12
|
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## ✅ Success Path: Follow These Steps
|
|
16
|
+
|
|
17
|
+
**Step 1: Install dependencies**
|
|
18
|
+
- Run `bun install` in project root
|
|
19
|
+
- Wait for completion - framework components will load correctly
|
|
20
|
+
- TypeScript imports will resolve properly
|
|
21
|
+
|
|
22
|
+
**Step 2: Create pages correctly**
|
|
23
|
+
- Name files ending in `Page.tsx` (e.g., `HomePage.tsx`)
|
|
24
|
+
- Place them in `src/pages/` folder
|
|
25
|
+
- Framework will auto-discover and route them
|
|
26
|
+
- Navigation will show them automatically
|
|
27
|
+
|
|
28
|
+
**Step 3: Configure app**
|
|
29
|
+
- Edit `src/config/app.ts` with your preset and app name
|
|
30
|
+
- Framework will use your configuration
|
|
31
|
+
- Footer and legal links will be included automatically
|
|
32
|
+
|
|
33
|
+
**Step 4: Customize via config files**
|
|
34
|
+
- Override defaults in `src/config/app.ts`
|
|
35
|
+
- Override themes in `src/themes.css`
|
|
36
|
+
- Framework preserves your changes on updates
|
|
37
|
+
|
|
13
38
|
|
|
14
39
|
** dndev ** is our custom CLI, dndev --help for info.
|
|
15
40
|
|
|
16
41
|
|
|
17
42
|
**🧠 PHILOSOPHY & MINDSET (READ THIS):**
|
|
43
|
+
|
|
44
|
+
**CRITICAL: ALL YOU NEED TO DO IS FOLLOW OUR NAMING CONVENTIONS + FILE STRUCTURE CONVENTIONS AND FOCUS ON THE INSIDE OF YOUR PAGES, WITH OUR COMPONENTS. EVERYTHING ELSE IS HANDLED. JUST TRUST THE FRAMEWORK AND CODE AS FEW AS POSSIBLE.**
|
|
45
|
+
|
|
18
46
|
* **Speed > Polish:** Your goal is to reach UAT (User Acceptance Testing) fast. The app should look "good enough" (80%) using standard components.
|
|
19
47
|
* **Composition > Customization:** Do not waste time writing CSS to make it "perfect" pixel-wise. Drop components, use props, move on.
|
|
20
48
|
* **Standardize:** If it looks like a standard DoNotDev app, you succeeded. If you are writing custom CSS to fight the framework, you failed.
|
|
21
49
|
* **Polishing:** Deep styling is for *after* the core functionality is approved and the User asks you to polish, with their preferred method.
|
|
50
|
+
* **Trust the Framework:** Navigation, routing, layouts, auth, themes, i18n - all handled automatically. Focus on page content only.
|
|
22
51
|
|
|
23
52
|
---
|
|
24
53
|
|
|
@@ -49,19 +78,135 @@ import type { PageMeta } from '@donotdev/core';
|
|
|
49
78
|
|
|
50
79
|
## New App Setup
|
|
51
80
|
|
|
81
|
+
**CRITICAL: Follow these steps IN ORDER. Complete each step before moving to the next.**
|
|
82
|
+
|
|
83
|
+
**✅ SCAFFOLDING PHILOSOPHY:**
|
|
84
|
+
The `dndev init` or `dndev create-app` commands create files with working defaults. Your job is to UPDATE these scaffolded files with your specific needs - update values, add content, customize configuration. The scaffolded files are correctly structured and framework-ready. Preserve the structure and imports, update the values and content.
|
|
85
|
+
|
|
86
|
+
### Step 1: Create Project (if starting from scratch)
|
|
87
|
+
```bash
|
|
88
|
+
dndev init my-project-name
|
|
89
|
+
# OR if adding to existing project:
|
|
90
|
+
cd existing-project
|
|
91
|
+
dndev create-app my-app-name
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### Step 2: Install Dependencies (REQUIRED - FIRST STEP)
|
|
95
|
+
```bash
|
|
96
|
+
cd my-project-name # or cd apps/my-app-name
|
|
97
|
+
bun install
|
|
98
|
+
```
|
|
99
|
+
**✅ CRITICAL:** Run `bun install` as the first step. This installs all framework dependencies and enables framework components to work correctly.
|
|
100
|
+
|
|
101
|
+
### Step 3: Configure App (REQUIRED)
|
|
102
|
+
**CRITICAL:** The scaffolding process creates these files with working defaults. UPDATE them with your specific needs - do not replace them entirely.
|
|
103
|
+
|
|
104
|
+
**File: `src/config/app.ts`** (scaffolded - update with your values):
|
|
105
|
+
```typescript
|
|
106
|
+
import type { AppConfig } from '@donotdev/core';
|
|
107
|
+
|
|
108
|
+
export const appConfig: AppConfig = {
|
|
109
|
+
preset: 'landing', // Update: Choose your preset (landing | admin | moolti | docs | blog | game | plain)
|
|
110
|
+
app: {
|
|
111
|
+
name: 'My App', // Update: Your app name
|
|
112
|
+
url: 'https://myapp.com', // Update: Your app URL
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**File: `src/config/legal.ts`** (scaffolded - update with your legal pages):
|
|
118
|
+
```typescript
|
|
119
|
+
export const legalConfig = {
|
|
120
|
+
// Update: Add your legal pages (privacy, terms, etc.)
|
|
121
|
+
};
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
**File: `vite.config.ts`** (scaffolded - already configured correctly):
|
|
125
|
+
```typescript
|
|
126
|
+
import { defineViteConfig } from '@donotdev/core/vite';
|
|
127
|
+
import { appConfig } from './src/config/app';
|
|
128
|
+
|
|
129
|
+
export default defineViteConfig({
|
|
130
|
+
appConfig, // Already configured - framework imports your appConfig
|
|
131
|
+
});
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
**✅ UPDATE STRATEGY:**
|
|
135
|
+
- Scaffolded files are already correctly structured
|
|
136
|
+
- Update values (app name, preset, URLs) to match your needs
|
|
137
|
+
- Keep the file structure and imports as-is
|
|
138
|
+
- Framework expects these exact file paths and exports
|
|
139
|
+
|
|
140
|
+
**✅ CORRECT FILE PATHS:**
|
|
141
|
+
- `src/config/app.ts` - Place in `src/config/` folder
|
|
142
|
+
- `src/config/legal.ts` - Place in `src/config/` folder
|
|
143
|
+
- `vite.config.ts` - Place at project root (same level as `package.json`)
|
|
144
|
+
- `src/pages/*Page.tsx` - Place in `src/pages/` folder
|
|
145
|
+
|
|
146
|
+
### Step 4: Add Logo (Optional but recommended)
|
|
147
|
+
Drop `logo.svg` in `public/` folder. Framework auto-generates favicon, icons, PWA assets.
|
|
148
|
+
|
|
149
|
+
### Step 5: Create or Update Pages
|
|
150
|
+
**Scaffolding creates `src/pages/HomePage.tsx` with a working example. UPDATE it with your content:**
|
|
151
|
+
|
|
152
|
+
```tsx
|
|
153
|
+
import { PageContainer } from '@donotdev/ui';
|
|
154
|
+
|
|
155
|
+
export default function HomePage() {
|
|
156
|
+
return <PageContainer><h1>Hello</h1></PageContainer>;
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**✅ UPDATE STRATEGY:**
|
|
161
|
+
- Scaffolded `HomePage.tsx` is already correctly structured
|
|
162
|
+
- Update the content inside `PageContainer` with your components
|
|
163
|
+
- Keep the imports and export structure as-is
|
|
164
|
+
- Add more pages by creating new `*Page.tsx` files in `src/pages/`
|
|
165
|
+
|
|
166
|
+
### Step 6: Verify Setup (BEFORE running dev)
|
|
167
|
+
**Check these files exist:**
|
|
168
|
+
- ✅ `src/config/app.ts` exists
|
|
169
|
+
- ✅ `vite.config.ts` exists and imports `appConfig` from `src/config/app.ts`
|
|
170
|
+
- ✅ `src/pages/HomePage.tsx` exists (or at least one `*Page.tsx` file)
|
|
171
|
+
- ✅ `package.json` exists with `@donotdev/*` dependencies
|
|
172
|
+
- ✅ `bun install` completed successfully
|
|
52
173
|
|
|
53
|
-
|
|
174
|
+
### Step 7: Run Development Server
|
|
175
|
+
```bash
|
|
176
|
+
bun run dev
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
**Expected output:**
|
|
180
|
+
- Server starts on `http://localhost:5173` (or configured port)
|
|
181
|
+
- No "Cannot find module" errors
|
|
182
|
+
- Browser shows your app (may show watermark if no license key)
|
|
54
183
|
|
|
55
|
-
**
|
|
56
|
-
1.
|
|
57
|
-
2.
|
|
58
|
-
3.
|
|
184
|
+
**If you see errors:**
|
|
185
|
+
1. **"Cannot find module '@donotdev/...'"** → Run `bun install` again
|
|
186
|
+
2. **"Cannot find module './src/config/app'"** → Check `vite.config.ts` path is correct
|
|
187
|
+
3. **"No routes found"** → Check you have `*Page.tsx` files in `src/pages/`
|
|
188
|
+
4. **TypeScript errors** → Run `bun run type-check` to see details
|
|
189
|
+
|
|
190
|
+
**✅ ALWAYS DO:**
|
|
191
|
+
- Run `bun install` first - required for dependencies
|
|
192
|
+
- Create pages in `src/pages/` folder - framework discovers them automatically
|
|
193
|
+
- Name files ending in `Page.tsx` - framework routes them automatically
|
|
194
|
+
- Trust framework defaults - routing, navigation, layouts are automatic
|
|
195
|
+
- Use preset components - LanguageSelector, ThemeToggle, AuthMenu are included automatically
|
|
59
196
|
|
|
60
197
|
---
|
|
61
198
|
|
|
62
199
|
## Generic Conventions
|
|
63
200
|
|
|
64
|
-
**Routing
|
|
201
|
+
**File Routing Rule: Only files ending in `Page.tsx` inside `src/pages` become routes.**
|
|
202
|
+
|
|
203
|
+
**✅ ROUTING RULES:**
|
|
204
|
+
- Name files with `Page.tsx` suffix (e.g., `HomePage.tsx`, `AboutPage.tsx`)
|
|
205
|
+
- Place files inside `src/pages/` directory (or subdirectories)
|
|
206
|
+
- Framework auto-discovers routes from `src/pages/*Page.tsx` files
|
|
207
|
+
- Framework automatically generates navigation from discovered routes
|
|
208
|
+
|
|
209
|
+
**Routing:** Drop `*Page.tsx` files in `src/pages/**` → auto-discovered. Use `PageMeta` for routes, auth, icons.
|
|
65
210
|
|
|
66
211
|
**i18n:** Drop `<namespace>_<lng>.json` in `/locales` (eager) or `/pages/locales` (lazy). Framework auto-discovers languages.
|
|
67
212
|
|
|
@@ -69,6 +214,21 @@ import type { PageMeta } from '@donotdev/core';
|
|
|
69
214
|
|
|
70
215
|
---
|
|
71
216
|
|
|
217
|
+
## Success Checklist
|
|
218
|
+
|
|
219
|
+
**✅ Follow these to ensure success:**
|
|
220
|
+
|
|
221
|
+
1. **✅ Always name pages with `Page.tsx` suffix** - Example: `HomePage.tsx`, `AboutPage.tsx`
|
|
222
|
+
2. **✅ Always run `bun install` first** - Required before any other commands
|
|
223
|
+
3. **✅ Trust framework routing** - Framework auto-discovers routes from `src/pages/*Page.tsx`
|
|
224
|
+
4. **✅ Use preset components** - LanguageSelector, ThemeToggle, AuthMenu are included automatically
|
|
225
|
+
5. **✅ Configure via config files** - Edit `src/config/app.ts`, never modify `node_modules`
|
|
226
|
+
6. **✅ Create pages in `src/pages/` folder** - Framework discovers them automatically
|
|
227
|
+
7. **✅ Configure `src/config/app.ts`** - Set your preset and app name
|
|
228
|
+
8. **✅ Run `bun install` before `bun run dev`** - Dependencies must be installed first
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
72
232
|
## Landing Page Example
|
|
73
233
|
|
|
74
234
|
```tsx
|
|
@@ -91,7 +251,7 @@ export default function HomePage() {
|
|
|
91
251
|
</Section>
|
|
92
252
|
|
|
93
253
|
<Section title="Layout Examples">
|
|
94
|
-
<Grid cols={2} gap="medium">
|
|
254
|
+
<Grid cols={[1, 1, 2, 2]} gap="medium">
|
|
95
255
|
<Card title="Left Column" />
|
|
96
256
|
<Card title="Right Column" />
|
|
97
257
|
</Grid>
|
|
@@ -115,6 +275,68 @@ export default function HomePage() {
|
|
|
115
275
|
|
|
116
276
|
---
|
|
117
277
|
|
|
278
|
+
---
|
|
279
|
+
|
|
280
|
+
## Required File Structure
|
|
281
|
+
|
|
282
|
+
**CRITICAL:** Your project MUST have this exact structure:
|
|
283
|
+
|
|
284
|
+
```
|
|
285
|
+
my-project/
|
|
286
|
+
├── package.json # At root - contains dependencies
|
|
287
|
+
├── vite.config.ts # At root - imports appConfig
|
|
288
|
+
├── src/
|
|
289
|
+
│ ├── config/
|
|
290
|
+
│ │ ├── app.ts # REQUIRED - app configuration
|
|
291
|
+
│ │ └── legal.ts # REQUIRED - legal pages config
|
|
292
|
+
│ ├── pages/
|
|
293
|
+
│ │ └── HomePage.tsx # Your pages (must end in Page.tsx)
|
|
294
|
+
│ ├── App.tsx # App entry point
|
|
295
|
+
│ └── main.tsx # Vite entry point
|
|
296
|
+
└── public/
|
|
297
|
+
└── logo.svg # Optional - framework generates assets
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
**✅ CORRECT FILE PATHS EXAMPLES:**
|
|
301
|
+
- ✅ `src/config/app.ts` (correct location)
|
|
302
|
+
- ✅ `src/pages/HomePage.tsx` (correct location)
|
|
303
|
+
- ✅ `src/pages/AboutPage.tsx` (correct - in pages subfolder)
|
|
304
|
+
- ✅ `src/pages/blog/BlogPostPage.tsx` (correct - nested pages work)
|
|
305
|
+
|
|
306
|
+
---
|
|
307
|
+
|
|
308
|
+
## Troubleshooting
|
|
309
|
+
|
|
310
|
+
### "Cannot find module '@donotdev/...'"
|
|
311
|
+
**Solution:** Run `bun install` in the project root. Dependencies must be installed before running the app.
|
|
312
|
+
|
|
313
|
+
### "No routes found"
|
|
314
|
+
**Solution:**
|
|
315
|
+
1. Check files are in `src/pages/` folder
|
|
316
|
+
2. Check files end in `Page.tsx` (not `.tsx` or `.ts`)
|
|
317
|
+
3. Check files are exported as default: `export default function HomePage()`
|
|
318
|
+
|
|
319
|
+
### "Cannot find module './src/config/app'"
|
|
320
|
+
**Solution:**
|
|
321
|
+
1. Check `vite.config.ts` is at project root (same level as `package.json`)
|
|
322
|
+
2. Check `src/config/app.ts` exists
|
|
323
|
+
3. Check import path in `vite.config.ts`: `import { appConfig } from './src/config/app';`
|
|
324
|
+
|
|
325
|
+
### App shows blank page
|
|
326
|
+
**Solution:**
|
|
327
|
+
1. Check browser console for errors
|
|
328
|
+
2. Verify at least one `*Page.tsx` file exists in `src/pages/`
|
|
329
|
+
3. Verify `vite.config.ts` imports `appConfig` correctly
|
|
330
|
+
4. Check `src/App.tsx` uses `ViteAppProviders` with `config={appConfig}`
|
|
331
|
+
|
|
332
|
+
### TypeScript errors
|
|
333
|
+
**Solution:**
|
|
334
|
+
1. Run `bun run type-check` to see all errors
|
|
335
|
+
2. Ensure all `@donotdev/*` packages are installed
|
|
336
|
+
3. Check imports use root package names: `@donotdev/components`, not deep paths
|
|
337
|
+
|
|
338
|
+
---
|
|
339
|
+
|
|
118
340
|
**Component references:** [COMPONENTS_ATOMIC.md](./COMPONENTS_ATOMIC.md) | [COMPONENTS_UI.md](./COMPONENTS_UI.md) | [COMPONENTS_CRUD.md](./COMPONENTS_CRUD.md)
|
|
119
341
|
|
|
120
342
|
**Full guides:** [INDEX.md](./INDEX.md) - 50-100 LOC per topic (SETUP_*.md, advanced/*.md)
|
|
@@ -0,0 +1,360 @@
|
|
|
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
|