@donotdev/cli 0.0.3 → 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.
Files changed (55) hide show
  1. package/dependencies-matrix.json +194 -110
  2. package/dist/bin/commands/bump.d.ts +1 -1
  3. package/dist/bin/commands/bump.js +103 -96
  4. package/dist/bin/commands/create-app.js +40 -28
  5. package/dist/bin/commands/create-project.js +40 -28
  6. package/dist/bin/commands/format.d.ts +1 -1
  7. package/dist/bin/commands/lint.d.ts +1 -1
  8. package/dist/index.js +40 -28
  9. package/package.json +1 -9
  10. package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +5 -5
  11. package/templates/app-demo/src/themes.css.example +108 -156
  12. package/templates/app-next/src/app/ClientLayout.tsx.example +1 -1
  13. package/templates/app-next/src/locales/home_en.json.example +6 -0
  14. package/templates/app-next/src/pages/HomePage.tsx.example +152 -8
  15. package/templates/app-next/src/themes.css.example +92 -140
  16. package/templates/app-vite/src/App.tsx.example +3 -3
  17. package/templates/app-vite/src/locales/home_en.json.example +6 -0
  18. package/templates/app-vite/src/pages/HomePage.tsx.example +149 -8
  19. package/templates/app-vite/src/themes.css.example +90 -138
  20. package/templates/root-consumer/guides/AGENT_START_HERE.md.example +297 -53
  21. package/templates/root-consumer/guides/COMPONENTS_ADV.md.example +360 -0
  22. package/templates/root-consumer/guides/COMPONENTS_ATOMIC.md.example +134 -0
  23. package/templates/root-consumer/guides/COMPONENTS_CRUD.md.example +70 -0
  24. package/templates/root-consumer/guides/COMPONENTS_UI.md.example +141 -0
  25. package/templates/root-consumer/guides/ENV_SETUP.md.example +14 -0
  26. package/templates/root-consumer/guides/INDEX.md.example +17 -25
  27. package/templates/root-consumer/guides/SETUP_AUTH.md.example +77 -0
  28. package/templates/root-consumer/guides/SETUP_BILLING.md.example +78 -0
  29. package/templates/root-consumer/guides/SETUP_FUNCTIONS.md.example +62 -0
  30. package/templates/root-consumer/guides/SETUP_I18N.md.example +187 -0
  31. package/templates/root-consumer/guides/SETUP_LAYOUTS.md.example +126 -0
  32. package/templates/root-consumer/guides/SETUP_OAUTH.md.example +53 -0
  33. package/templates/root-consumer/guides/SETUP_PAGES.md.example +120 -0
  34. package/templates/root-consumer/guides/SETUP_THEMES.md.example +107 -0
  35. package/templates/root-consumer/guides/advanced/COOKIE_REFERENCE.md.example +252 -0
  36. package/templates/root-consumer/guides/{EMULATOR_SETUP.md.example → advanced/EMULATORS.md.example} +1 -1
  37. package/templates/root-consumer/guides/{VERSION_CONTROL.md.example → advanced/VERSION_CONTROL.md.example} +0 -7
  38. package/templates/root-consumer/guides/AUTH_SETUP.md.example +0 -92
  39. package/templates/root-consumer/guides/BILLING_SETUP.md.example +0 -120
  40. package/templates/root-consumer/guides/CLI.md.example +0 -293
  41. package/templates/root-consumer/guides/COMPONENTS.md.example +0 -875
  42. package/templates/root-consumer/guides/FEATURES.md.example +0 -286
  43. package/templates/root-consumer/guides/FRAMEWORK_OVERVIEW.md.example +0 -97
  44. package/templates/root-consumer/guides/FUNCTIONS.md.example +0 -177
  45. package/templates/root-consumer/guides/GETTING_STARTED.md.example +0 -451
  46. package/templates/root-consumer/guides/HOW_TO_USE.md.example +0 -296
  47. package/templates/root-consumer/guides/I18N_SETUP.md.example +0 -204
  48. package/templates/root-consumer/guides/IMPORT_PATTERNS.md.example +0 -79
  49. package/templates/root-consumer/guides/INSTALLATION.md.example +0 -296
  50. package/templates/root-consumer/guides/LAYOUTS.md.example +0 -310
  51. package/templates/root-consumer/guides/PAGES_SETUP.md.example +0 -123
  52. package/templates/root-consumer/guides/STYLING.md.example +0 -273
  53. package/templates/root-consumer/guides/THEMING_SETUP.md.example +0 -119
  54. /package/templates/root-consumer/guides/{CONFIG_SETUP.md.example → SETUP_APP_CONFIG.md.example} +0 -0
  55. /package/templates/root-consumer/guides/{APP_CHECK_SETUP.md.example → advanced/APP_CHECK.md.example} +0 -0
@@ -1,875 +0,0 @@
1
- # Component Reference
2
-
3
- **Auto-generated from JSDoc** - All components use props-based API, no CSS needed.
4
-
5
- ---
6
-
7
- ## Actions
8
-
9
- ### Button
10
-
11
- Accessible, type-safe button component with behavioral variants.
12
- Supports icons, tooltips, responsive layouts, and render prop composition.
13
-
14
- **Props:**
15
-
16
- | Prop | Type | Required | Default | Description |
17
- |------|------|----------|---------|-------------|
18
- | `render` | `(props: ButtonRenderProps) => ReactNode` | No | - | Render function for custom element composition (React 19 compatible). Use this instead of wrapping Button around a Link. See examples below. |
19
- | `display` | `compact \| full \| auto` | No | auto | Display mode: 'compact' (icon-only), 'full' (icon+label), 'auto' (CSS-driven) |
20
- | `icon` | `ComponentType<LucideProps> \| ReactNode` | No | - | Icon - Lucide component, string name, or ReactNode |
21
- | `iconEnd` | `boolean` | No | - | Whether to place icon on the right side. |
22
- | `tooltip` | `string` | No | - | Tooltip text to show on hover |
23
- | `floating` | `boolean` | No | - | Whether the button floats (e.g., FAB). |
24
- | `fullWidth` | `boolean` | No | - | Whether the button takes full width of container. |
25
- | `aria-label` | `string` | No | - | Defines a string value that labels the current element. |
26
- | `aria-describedby` | `string` | No | - | Identifies the element (or elements) that describes the object. |
27
- | `variant` | `"default" \| "primary" \| "outline" \| "ghost" \| "destructive" \| "link"` | No | - | Visual variant |
28
-
29
- **Examples:**
30
-
31
- ```tsx
32
- // Standard button
33
- <Button variant="primary" icon={Mail}>Send Email</Button>
34
-
35
- // Button as Link (render prop pattern - React 19 compatible)
36
- <Button
37
- icon={Home}
38
- render={({ children, ...props }) => (
39
- <Link href="/" {...props}>{children}</Link>
40
- )}
41
- >
42
- Home
43
- </Button>
44
-
45
- // Button with Next.js Link
46
- <Button
47
- variant="primary"
48
- render={({ children, ...props }) => (
49
- <Link href="/dashboard" {...props}>{children}</Link>
50
- )}
51
- >
52
- Go to Dashboard
53
- </Button>
54
- ```
55
-
56
- ---
57
-
58
- ### FileButton
59
-
60
- File button component
61
-
62
- Renders a button that triggers file input selection.
63
-
64
- **Props:**
65
-
66
- | Prop | Type | Required | Default | Description |
67
- |------|------|----------|---------|-------------|
68
- | `label` | `ReactNode` | No | Upload | - |
69
- | `asChild` | `boolean` | No | - | - |
70
-
71
- ---
72
-
73
- ## Complex
74
-
75
- ### Calendar
76
-
77
- Accessible date picker component built on react-day-picker.
78
-
79
- ---
80
-
81
- ### InfiniteScroll
82
-
83
- InfiniteScroll component
84
-
85
- **Props:**
86
-
87
- | Prop | Type | Required | Default | Description |
88
- |------|------|----------|---------|-------------|
89
- | `items` | `T[]` | Yes | - | - |
90
- | `renderItem` | `(item: T, index: number) => ReactNode` | Yes | - | - |
91
- | `loadMore` | `() => void` | Yes | - | - |
92
- | `hasMore` | `boolean` | Yes | - | - |
93
- | `loading` | `boolean` | No | - | - |
94
- | `loadingComponent` | `ReactNode` | No | - | - |
95
- | `endMessage` | `ReactNode` | No | - | - |
96
- | `threshold` | `number` | No | 0.1 | - |
97
- | `rootMargin` | `string` | No | 100px | - |
98
- | `itemClassName` | `string` | No | - | - |
99
- | `gridCols` | `1 | 2 | 3 | 4 | 5 | 6` | No | 3 | - |
100
- | `gap` | `none | tight | medium | large` | No | medium | - |
101
-
102
- ---
103
-
104
- ### Stepper
105
-
106
- Reusable stepper component for step-by-step workflows.
107
- Shows one step at a time with navigation controls.
108
-
109
- ---
110
-
111
- ### Toggle
112
-
113
- Toggle component
114
-
115
- **Props:**
116
-
117
- | Prop | Type | Required | Default | Description |
118
- |------|------|----------|---------|-------------|
119
- | `variant` | `"default" | "outline" | null` | No | - | - |
120
-
121
- ---
122
-
123
- ### ToggleGroup
124
-
125
- ToggleGroup component
126
-
127
- ---
128
-
129
- ## Data Display
130
-
131
- ### Avatar
132
-
133
- Accessible avatar component built on Radix UI primitives. Provides image and fallback support.
134
-
135
- **Props:**
136
-
137
- | Prop | Type | Required | Default | Description |
138
- |------|------|----------|---------|-------------|
139
- | `src` | `string` | No | - | The URL of the avatar image |
140
- | `fallback` | `string` | Yes | - | The initials or text to display when image fails to load |
141
- | `alt` | `string` | No | - | Alt text for the image |
142
-
143
- ---
144
-
145
- ### Badge
146
-
147
- Status indicator component with semantic variants.
148
-
149
- **Polymorphic Component**: Can render as `div`, `span`, or `mark` based on context.
150
- Defaults to `div` for block-level badges. Use `span` for inline badges within text.
151
- Use `mark` for semantic highlighting of important content.
152
-
153
- **Props:**
154
-
155
- | Prop | Type | Required | Default | Description |
156
- |------|------|----------|---------|-------------|
157
- | `variant` | `"default" | "secondary" | "destructive" | "outline" | "accent" | null` | No | - | - |
158
- | `as` | `div | mark | span` | No | div | Element type to render as
159
- @example 'div' - Block-level badge (default)
160
- @example 'span' - Inline badge (for text content)
161
- @example 'mark' - Semantic highlight/mark (for emphasized content) |
162
- | `tooltip` | `string` | No | - | Tooltip text to show on hover |
163
-
164
- ---
165
-
166
- ### Card
167
-
168
- Premium card component with behavioral variants and elevation.
169
- Supports header, content, and footer sections with automatic grid layout.
170
-
171
- **Props:**
172
-
173
- | Prop | Type | Required | Default | Description |
174
- |------|------|----------|---------|-------------|
175
- | `asChild` | `boolean` | No | - | Whether to render as a child element (Radix Slot). |
176
- | `icon` | `IconType` | No | - | Optional icon to display next to the title |
177
- | `title` | `ReactNode` | No | - | Main title of the card |
178
- | `subtitle` | `ReactNode` | No | - | Subtitle displayed below the title |
179
- | `content` | `ReactNode` | No | - | Main content of the card |
180
- | `footer` | `ReactNode` | No | - | Footer content |
181
- | `tooltip` | `string` | No | - | Tooltip text |
182
- | `onClick` | `(() => void)` | No | - | Click handler |
183
- | `elevated` | `boolean` | No | - | Whether the card has elevation/shadow. |
184
- | `variant` | `"default" | "muted" | "accent" | null` | No | - | - |
185
-
186
- ---
187
-
188
- ### DataTable
189
-
190
- High-level DataTable component with built-in sorting, filtering, search, and pagination.
191
-
192
- **Props:**
193
-
194
- | Prop | Type | Required | Default | Description |
195
- |------|------|----------|---------|-------------|
196
- | `data` | `T[]` | Yes | - | Data array |
197
- | `columns` | `TableColumn<T>[]` | Yes | - | Column definitions |
198
- | `sortable` | `boolean` | No | true | Enable sorting |
199
- | `selectable` | `boolean` | No | - | Enable row selection |
200
- | `searchable` | `boolean` | No | true | Enable search |
201
- | `filterable` | `boolean` | No | - | Enable filtering (placeholder UI) |
202
- | `pagination` | `boolean` | No | true | Enable pagination |
203
- | `pageSize` | `number` | No | 10 | Page size |
204
- | `loading` | `boolean` | No | - | Loading state |
205
- | `onSort` | `((column: string, direction: "asc" | "desc") => void)` | No | - | Callback when sorting changes |
206
- | `onSelect` | `((selectedRows: T[]) => void)` | No | - | Callback when selection changes |
207
- | `onSearch` | `((query: string) => void)` | No | - | Callback when search query changes |
208
- | `onFilter` | `((filters: Record<string, any>) => void)` | No | - | Callback when filters change |
209
-
210
- ---
211
-
212
- ### Separator
213
-
214
- Accessible separator component with semantic styling.
215
- Used to visually separate content in a list or group.
216
-
217
- **Variants:** `default` | `primary` | `accent` | `muted`
218
-
219
- **Props:**
220
-
221
- | Prop | Type | Required | Default | Description |
222
- |------|------|----------|---------|-------------|
223
- | `width` | `string | number` | No | - | Width of the separator (default: 80% for better visual hierarchy) |
224
- | `variant` | `default | primary | accent | muted` | No | default | Visual style variant. |
225
-
226
- ---
227
-
228
- ### Text
229
-
230
- Text variant constants - DRY single source of truth
231
- Used for text styling via data-variant attribute
232
-
233
- ---
234
-
235
- ## Feedback
236
-
237
- ### Alert
238
-
239
- Attention-grabbing alert component with semantic variants and icons.
240
-
241
- **Variants:** `default` | `error` | `warning` | `success` | `info`
242
-
243
- **Props:**
244
-
245
- | Prop | Type | Required | Default | Description |
246
- |------|------|----------|---------|-------------|
247
- | `variant` | `default | error | warning | success | info` | No | default | The visual style of the alert. |
248
- | `hideIcon` | `boolean` | No | - | Whether to hide the variant icon. |
249
- | `title` | `ReactNode` | No | - | The title of the alert |
250
- | `description` | `ReactNode` | No | - | The main content/description of the alert |
251
- | `tooltip` | `string` | No | - | Tooltip text to show on hover |
252
-
253
- ---
254
-
255
- ### FeatureFallback
256
-
257
- FeatureFallback component
258
-
259
- **Props:**
260
-
261
- | Prop | Type | Required | Default | Description |
262
- |------|------|----------|---------|-------------|
263
- | `featureName` | `string` | Yes | - | - |
264
- | `message` | `string` | No | - | - |
265
- | `icon` | `any` | No | 🔧 | - |
266
- | `showActionButton` | `boolean` | No | - | - |
267
- | `actionButtonText` | `string` | No | - | - |
268
- | `helpText` | `string` | No | - | - |
269
-
270
- ---
271
-
272
- ### Skeleton
273
-
274
- Skeleton component for loading states.
275
-
276
- Features:
277
- - Multiple animation variants (pulse, wave, shimmer)
278
- - Size presets for common content types
279
- - Content-aware sizing
280
- - Full ARIA compliance
281
- - Customizable dimensions
282
-
283
- **Variants:** `pulse` | `wave` | `shimmer` | `none` | `text` | `heading` | `avatar` | `button` | `card` | `image` | `custom`
284
-
285
- **Props:**
286
-
287
- | Prop | Type | Required | Default | Description |
288
- |------|------|----------|---------|-------------|
289
- | `variant` | `pulse | wave | shimmer | none` | No | pulse | Animation variant |
290
- | `size` | `text | heading | avatar | button | card | image | custom` | No | custom | Size preset for common content types |
291
- | `width` | `string | number` | No | - | Custom width |
292
- | `height` | `string | number` | No | - | Custom height |
293
- | `lines` | `number` | No | 1 | Number of lines for text skeleton |
294
- | `aria-label` | `string` | No | Loading content | Accessibility label for screen readers |
295
-
296
- ---
297
-
298
- ### Spinner
299
-
300
- Spinner component for loading states.
301
-
302
- Features:
303
- - Multiple sizes (sm, md, lg)
304
- - Accessible with proper ARIA labels
305
- - Theme-aware colors
306
- - Smooth animation
307
-
308
- **Variants:** `sm` | `md` | `lg`
309
-
310
- **Props:**
311
-
312
- | Prop | Type | Required | Default | Description |
313
- |------|------|----------|---------|-------------|
314
- | `size` | `sm | md | lg` | No | md | Size of the spinner |
315
- | `aria-label` | `string` | No | Loading | Accessibility label |
316
-
317
- ---
318
-
319
- ## Inputs
320
-
321
- ### Input
322
-
323
- Accessible input component with mobile-friendly touch targets.
324
- Styles key input states (focus, disabled, error) automatically.
325
-
326
- ---
327
-
328
- ### Label
329
-
330
- Accessible label component built on Radix UI Label.
331
- Supports icons and various label positions.
332
-
333
- **Props:**
334
-
335
- | Prop | Type | Required | Default | Description |
336
- |------|------|----------|---------|-------------|
337
- | `icon` | `ComponentType<{ className?: string; }>` | No | - | Optional icon to display with the label |
338
- | `iconEnd` | `boolean` | No | false | Whether to place icon at end (after text). RTL-safe. |
339
-
340
- ---
341
-
342
- ### PasswordInput
343
-
344
- PasswordInput Component
345
-
346
- A password input field with show/hide toggle functionality.
347
- Features industry-standard UX patterns:
348
- - Eye icon toggle (show/hide password)
349
- - Keyboard accessibility (Enter to toggle)
350
- - Smooth icon transitions
351
- - Mobile-friendly touch targets
352
- - Screen reader support
353
- - ARIA labels and descriptions
354
-
355
- **Props:**
356
-
357
- | Prop | Type | Required | Default | Description |
358
- |------|------|----------|---------|-------------|
359
- | `showToggle` | `boolean` | No | true | Whether to show the password toggle button |
360
- | `toggleButton` | `ReactNode` | No | - | Custom toggle button content |
361
- | `visible` | `boolean` | No | - | Whether the password is currently visible |
362
- | `onVisibilityChange` | `((visible: boolean) => void)` | No | - | Callback when visibility changes |
363
-
364
- ---
365
-
366
- ### RadioGroup
367
-
368
- Accessible radio group component built on Radix UI.
369
-
370
- **Props:**
371
-
372
- | Prop | Type | Required | Default | Description |
373
- |------|------|----------|---------|-------------|
374
- | `variant` | `"round" | "square" | "dot" | "outline" | null` | No | 'round' | Visual style of the radio buttons. |
375
-
376
- ---
377
-
378
- ### Textarea
379
-
380
- Textarea component
381
-
382
- ---
383
-
384
- ## Interactive
385
-
386
- ### AlertDialog
387
-
388
- A modal dialog that interrupts the user with important content and expects a response.
389
- Built on Radix UI AlertDialog.
390
-
391
- **Props:**
392
-
393
- | Prop | Type | Required | Default | Description |
394
- |------|------|----------|---------|-------------|
395
- | `trigger` | `ReactNode` | No | - | The element that triggers the dialog to open |
396
- | `title` | `ReactNode` | Yes | - | The title of the alert dialog |
397
- | `description` | `ReactNode` | No | - | The description content of the alert dialog |
398
- | `cancelLabel` | `string` | No | Cancel | Text for the cancel button. |
399
- | `confirmLabel` | `string` | Yes | - | Text for the confirm button |
400
- | `onConfirm` | `(() => void)` | No | - | Callback when confirm action is taken |
401
- | `onCancel` | `(() => void)` | No | - | Callback when cancel action is taken |
402
- | `open` | `boolean` | No | - | Controlled open state |
403
- | `onOpenChange` | `((open: boolean) => void)` | No | - | Callback when open state changes |
404
-
405
- ---
406
-
407
- ### ContextMenu
408
-
409
- Accessible context menu component built on Radix UI primitives.
410
- Supports nested submenus, checkboxes, and radio groups.
411
-
412
- **Props:**
413
-
414
- | Prop | Type | Required | Default | Description |
415
- |------|------|----------|---------|-------------|
416
- | `trigger` | `ReactNode` | Yes | - | The element that triggers the context menu (right-click) |
417
- | `items` | `ContextMenuItemType[]` | Yes | - | List of items to display in the menu |
418
-
419
- ---
420
-
421
- ### Dialog
422
-
423
- Accessible modal dialog component built on Radix UI primitives.
424
- Supports custom content sizes, actions, and variants.
425
-
426
- **Props:**
427
-
428
- | Prop | Type | Required | Default | Description |
429
- |------|------|----------|---------|-------------|
430
- | `trigger` | `ReactNode` | No | - | The element that opens the dialog |
431
- | `title` | `ReactNode` | No | - | The title of the dialog |
432
- | `description` | `ReactNode` | No | - | The description of the dialog |
433
- | `footer` | `ReactNode` | No | - | Footer content |
434
- | `open` | `boolean` | No | - | Controlled open state |
435
- | `onOpenChange` | `((open: boolean) => void)` | No | - | Callback when open state changes |
436
- | `showClose` | `boolean` | No | true | Whether to show the close button |
437
- | `variant` | `any` | No | - | Visual variant of the dialog (uses surface variants: default, muted, accent) |
438
- | `actions` | `{ cancel?: { label: string; onClick?: (() => void); }; confirm?: { label: string; onClick?: (() => void) | undefined; variant?: any; } | undefined; } | undefined` | No | - | Shortcut prop to configure standard actions |
439
-
440
- ---
441
-
442
- ### DropdownMenu
443
-
444
- Professional dropdown menu implementation with props-based API.
445
- Provides accessible, keyboard-navigable dropdown menus with DoNotDev theming.
446
-
447
- **Props:**
448
-
449
- | Prop | Type | Required | Default | Description |
450
- |------|------|----------|---------|-------------|
451
- | `trigger` | `ReactNode` | No | - | The element that opens the menu |
452
- | `items` | `DropdownMenuItemData[]` | No | [] | List of menu items (alternative to children) |
453
- | `contentWidth` | `string` | No | - | Custom width for the content |
454
- | `contentAlign` | `start | center | end` | No | start | Alignment of the menu content |
455
- | `open` | `boolean` | No | - | Controlled open state |
456
- | `onOpenChange` | `((open: boolean) => void)` | No | - | Callback when open state changes |
457
-
458
- ---
459
-
460
- ### HoverCard
461
-
462
- HoverCard component
463
-
464
- ---
465
-
466
- ### Popover
467
-
468
- Accessible popover component built on Radix UI primitives.
469
- Displays rich content in a portal, triggered by a button.
470
-
471
- **Variants:** `default` | `inverted` | `muted` | `accent` | `ghost` | `subtle`
472
-
473
- **Props:**
474
-
475
- | Prop | Type | Required | Default | Description |
476
- |------|------|----------|---------|-------------|
477
- | `trigger` | `ReactNode` | No | - | Trigger element (button, text, etc.) |
478
- | `children` | `ReactNode` | No | - | Popover content (rendered inside the floating panel) |
479
- | `open` | `boolean` | No | - | Controlled open state |
480
- | `onOpenChange` | `((open: boolean) => void)` | No | - | Callback when open state changes |
481
- | `align` | `start | center | end` | No | center | Alignment relative to trigger |
482
- | `side` | `top | right | bottom | left` | No | bottom | Side to show popover |
483
- | `sideOffset` | `number` | No | 4 | Side offset in pixels |
484
- | `variant` | `default | inverted | muted | accent | ghost | subtle` | No | - | Optional variant for themed popovers |
485
- | `modal` | `boolean` | No | true | Whether popover is modal (blocks interaction with rest of page) |
486
- | `onInteractOutside` | `((event: Event) => void)` | No | - | Handler for outside click |
487
-
488
- ---
489
-
490
- ### Sheet
491
-
492
- Accessible sheet (slide-out) component built on Radix UI Dialog.
493
- Used for sidebars, mobile navigation, or complex editing panels.
494
-
495
- **Props:**
496
-
497
- | Prop | Type | Required | Default | Description |
498
- |------|------|----------|---------|-------------|
499
- | `trigger` | `ReactNode` | No | - | The element that opens the sheet |
500
- | `title` | `ReactNode` | No | - | The title of the sheet |
501
- | `description` | `ReactNode` | No | - | The description of the sheet |
502
- | `footer` | `ReactNode` | No | - | Footer content |
503
- | `open` | `boolean` | No | - | Controlled open state |
504
- | `onOpenChange` | `((open: boolean) => void)` | No | - | Callback when open state changes |
505
- | `showClose` | `boolean` | No | true | Whether to show the close button |
506
- | `showOverlay` | `boolean` | No | true | Whether to show the overlay |
507
- | `side` | `top | bottom | left | right` | No | right | The side of the screen the sheet slides from. |
508
- | `variant` | `any` | No | - | Visual variant of the sheet (uses surface variants: default, muted, accent) |
509
-
510
- ---
511
-
512
- ### Tooltip
513
-
514
- Tooltip component
515
-
516
- **Props:**
517
-
518
- | Prop | Type | Required | Default | Description |
519
- |------|------|----------|---------|-------------|
520
- | `content` | `ReactNode` | Yes | - | - |
521
- | `side` | `top | right | bottom | left` | No | top | - |
522
- | `align` | `start | center | end` | No | center | - |
523
- | `delayDuration` | `number` | No | 300 | - |
524
-
525
- ---
526
-
527
- ## Layout
528
-
529
- ### CallToAction
530
-
531
- CallToAction component
532
-
533
- **Props:**
534
-
535
- | Prop | Type | Required | Default | Description |
536
- |------|------|----------|---------|-------------|
537
- | `as` | `section | aside | div` | No | section | Element type to render as
538
- @example 'section' - Standard CTA section (default)
539
- @example 'aside' - Sidebar promotional CTA
540
- @example 'div' - Generic container when semantic meaning not needed |
541
- | `title` | `string` | Yes | - | Main title |
542
- | `subtitle` | `string` | No | - | Subtitle or description |
543
- | `primaryAction` | `ReactNode` | No | - | Primary action button (ReactNode - bring your own Button+Link) |
544
- | `secondaryAction` | `ReactNode` | No | - | Secondary action button (ReactNode - bring your own Button+Link) |
545
-
546
- ---
547
-
548
- ### HeroSection
549
-
550
- HeroSection component
551
-
552
- **Props:**
553
-
554
- | Prop | Type | Required | Default | Description |
555
- |------|------|----------|---------|-------------|
556
- | `variant` | `"primary" | "subtle" | "accent" | null` | No | - | - |
557
- | `as` | `section | div | header` | No | section | Element type to render as
558
- @example 'section' - Standard hero section (default)
559
- @example 'header' - Page header with hero content
560
- @example 'div' - Generic container when semantic meaning not needed |
561
- | `badge` | `string` | No | - | Badge text |
562
- | `title` | `string` | No | - | Hero title |
563
- | `subtitle` | `string` | No | - | Hero subtitle |
564
- | `fullHeight` | `boolean` | No | - | Full viewport height |
565
-
566
- ---
567
-
568
- ### ScrollArea
569
-
570
- Scrollable area component with cross-browser custom scrollbars.
571
- Built on Radix UI ScrollArea.
572
-
573
- **Props:**
574
-
575
- | Prop | Type | Required | Default | Description |
576
- |------|------|----------|---------|-------------|
577
- | `showHorizontal` | `boolean` | No | - | Show horizontal scrollbar. |
578
- | `showVertical` | `boolean` | No | true | Show vertical scrollbar. |
579
-
580
- ---
581
-
582
- ### Section
583
-
584
- Layout section component with header, grid, and tone system.
585
- Content width is automatically constrained by PageContainer's --content-width variable.
586
- Use utility class `dndev-max-w-none` on content wrapper to bypass width constraints.
587
-
588
- **Polymorphic Component**: Can render as `section`, `article`, `aside`, `div`, or `main`
589
- based on semantic needs. Defaults to `section` for semantic HTML.
590
-
591
- **Variants:** `base` | `muted` | `elevated` | `contrast` | `accent`
592
-
593
- **Props:**
594
-
595
- | Prop | Type | Required | Default | Description |
596
- |------|------|----------|---------|-------------|
597
- | `as` | `section | article | aside | div | main` | No | section | Element type to render as
598
- @example 'section' - Standard section (default)
599
- @example 'article' - Independent content (blog posts, articles)
600
- @example 'aside' - Sidebar content, complementary information
601
- @example 'div' - Generic container when semantic meaning not needed
602
- @example 'main' - Main content area (use once per page) |
603
- | `title` | `string` | No | - | Section title (small, uppercase, accent color) |
604
- | `separator` | `boolean` | No | false | Show separator above section |
605
- | `tone` | `base | muted | elevated | contrast | accent` | No | base | Tone system for visual rhythm |
606
- | `gridCols` | `1 | 2 | 3 | 4` | No | - | Grid columns (1-4) |
607
- | `gridGap` | `none | tight | medium | large` | No | medium | Grid gap size |
608
- | `start` | `boolean` | No | false | Left-align content instead of centered |
609
-
610
- ---
611
-
612
- ## Navigation
613
-
614
- ### Accordion
615
-
616
- A vertically stacked set of interactive headings that each reveal a section of content.
617
- Built on Radix UI Accordion.
618
-
619
- **Props:**
620
-
621
- | Prop | Type | Required | Default | Description |
622
- |------|------|----------|---------|-------------|
623
- | `type` | `single | multiple` | No | single | The type of accordion. |
624
- | `collapsible` | `boolean` | No | - | Whether an accordion item can be collapsed after opening (only for type="single"). |
625
- | `defaultValue` | `string | string[]` | No | - | The default active value(s) |
626
- | `value` | `string | string[]` | No | - | The controlled active value(s) |
627
- | `onValueChange` | `((value: string | string[]) => void)` | No | - | Callback when value changes |
628
- | `items` | `AccordionItemType[]` | Yes | - | The list of items to render |
629
-
630
- ---
631
-
632
- ### Command
633
-
634
- Custom Command component using our design system.
635
- Pure React implementation with our interactive patterns.
636
-
637
- **Props:**
638
-
639
- | Prop | Type | Required | Default | Description |
640
- |------|------|----------|---------|-------------|
641
- | `placeholder` | `string` | No | Search... | Placeholder text for the search input |
642
- | `emptyMessage` | `string` | No | No results found. | Message to show when no results found |
643
- | `groups` | `CommandGroup[]` | No | [] | Groups of command items |
644
- | `items` | `CommandItem[]` | No | [] | Standalone command items (ungrouped) |
645
-
646
- ---
647
-
648
- ### CommandDialog
649
-
650
- CommandDialog component
651
-
652
- **Props:**
653
-
654
- | Prop | Type | Required | Default | Description |
655
- |------|------|----------|---------|-------------|
656
- | `open` | `boolean` | No | - | - |
657
- | `onOpenChange` | `((open: boolean) => void)` | No | - | - |
658
- | `title` | `ReactNode` | No | - | - |
659
-
660
- ---
661
-
662
- ### NavigationMenu
663
-
664
- Props-based navigation menu component built on Radix UI primitives.
665
- Supports nested menus, rich content, responsive layouts, and collapsed icon-only mode for sidebars.
666
-
667
- **Props:**
668
-
669
- | Prop | Type | Required | Default | Description |
670
- |------|------|----------|---------|-------------|
671
- | `items` | `NavigationMenuItem[]` | No | - | List of navigation items |
672
- | `vertical` | `boolean` | No | - | Whether to render vertically |
673
- | `collapsed` | `boolean` | No | - | Collapsed state (icon-only, for sidebars) |
674
- | `LinkComponent` | `ComponentType<any>` | No | 'a' as any | Custom link component (e.g., Next.js Link) |
675
-
676
- ---
677
-
678
- ### Pagination
679
-
680
- Accessible pagination component with props-based API.
681
- Handles page number generation, ellipsis truncation, and navigation controls.
682
-
683
- **Props:**
684
-
685
- | Prop | Type | Required | Default | Description |
686
- |------|------|----------|---------|-------------|
687
- | `currentPage` | `number` | Yes | - | Current page (1-indexed) |
688
- | `totalPages` | `number` | Yes | - | Total number of pages |
689
- | `onPageChange` | `(page: number) => void` | Yes | - | Callback when page changes |
690
- | `maxVisible` | `number` | No | 7 | Maximum number of page buttons to show (default: 7) |
691
- | `showNavigation` | `boolean` | No | true | Show previous/next buttons (default: true) |
692
-
693
- ---
694
-
695
- ### Tabs
696
-
697
- Tabbed interface component with props-based API. WCAG 2.1 compliant with full keyboard navigation and ARIA support. Built on Radix UI Tabs primitives with Grid-based layout control.
698
-
699
- **Props:**
700
-
701
- | Prop | Type | Required | Default | Description |
702
- |------|------|----------|---------|-------------|
703
- | `items` | `TabItem[]` | Yes | - | Array of tab items (see TabItem interface below) |
704
- | `defaultValue` | `string` | No | - | Default active tab value (uncontrolled) |
705
- | `value` | `string` | No | - | Controlled active tab value |
706
- | `onValueChange` | `(value: string) => void` | No | - | Callback when tab changes (for controlled mode) |
707
- | `cols` | `1 \| 2 \| 3 \| 4 \| 5 \| 6 \| 12 \| 'auto-fit' \| 'auto-fill'` | No | `6` | Number of columns for tab list (Grid prop) |
708
- | `minColWidth` | `string` | No | - | Minimum column width for auto-fit/auto-fill layouts (e.g., "250px") |
709
- | `gap` | `'none' \| 'tight' \| 'medium' \| 'large'` | No | `'none'` | Spacing between tabs (Grid prop) |
710
- | `align` | `'start' \| 'center' \| 'end' \| 'stretch'` | No | `'stretch'` | Vertical alignment (Grid prop) |
711
- | `listClassName` | `string` | No | - | Custom className for tab list container |
712
- | `contentClassName` | `string` | No | - | Custom className for tab content panels |
713
- | `className` | `string` | No | - | Custom className for root container |
714
-
715
- **TabItem Interface:**
716
-
717
- | Prop | Type | Required | Description |
718
- |------|------|----------|-------------|
719
- | `value` | `string` | Yes | Unique identifier for the tab |
720
- | `label` | `string \| ReactNode` | Yes | Tab label content (text or React element) |
721
- | `content` | `ReactNode` | Yes | Tab panel content |
722
- | `disabled` | `boolean` | No | Whether the tab is disabled |
723
- | `className` | `string` | No | Additional className for the tab trigger |
724
- | `forceMount` | `boolean` | No | Force mount content even when inactive (for animations) |
725
-
726
- **Examples:**
727
-
728
- Basic usage:
729
- ```tsx
730
- <Tabs
731
- defaultValue="tab1"
732
- items={[
733
- { value: 'tab1', label: 'Tab 1', content: <div>Content 1</div> },
734
- { value: 'tab2', label: 'Tab 2', content: <div>Content 2</div> }
735
- ]}
736
- />
737
- ```
738
-
739
- Responsive tabs (6 columns desktop, auto-wraps to 3 columns mobile):
740
- ```tsx
741
- <Tabs
742
- items={tabItems}
743
- defaultValue="tab1"
744
- cols={6}
745
- minColWidth="250px"
746
- gap="none"
747
- />
748
- ```
749
-
750
- Fixed 3-column grid (2 rows of 3 on mobile):
751
- ```tsx
752
- <Tabs
753
- items={tabItems}
754
- cols={3}
755
- gap="tight"
756
- />
757
- ```
758
-
759
- Controlled tabs:
760
- ```tsx
761
- const [activeTab, setActiveTab] = useState('tab1');
762
-
763
- <Tabs
764
- value={activeTab}
765
- onValueChange={setActiveTab}
766
- items={items}
767
- />
768
- ```
769
-
770
- **Accessibility:**
771
- - Full keyboard navigation (Arrow keys, Home, End)
772
- - ARIA roles: `tablist`, `tab`, `tabpanel`
773
- - ARIA attributes: `aria-selected`, `aria-controls`, `aria-labelledby`
774
- - Focus management handled automatically
775
- - Screen reader support
776
- - Active tab: Background color + shadow (distinct from hover/focus states)
777
- - WCAG 2.1 Level AA compliant
778
-
779
- **Layout:**
780
- - Uses Grid internally for precise multi-row layouts
781
- - Accepts Grid props: `cols`, `minColWidth`, `gap`, `align`
782
- - Responsive: Use `cols={6}` with `minColWidth="250px"` for desktop 6 cols, mobile 3 cols
783
- - No card styling by default (composable - wrap in Card if needed)
784
-
785
- ---
786
-
787
- ## Other
788
-
789
- ### Collapsible
790
-
791
- Collapsible component
792
-
793
- **Props:**
794
-
795
- | Prop | Type | Required | Default | Description |
796
- |------|------|----------|---------|-------------|
797
- | `asChild` | `boolean` | No | - | - |
798
-
799
- ---
800
-
801
- ### DescriptionList
802
-
803
- DescriptionList component for key-value pairs, specifications, and metadata.
804
- Uses semantic HTML (dl, dt, dd) for proper accessibility.
805
-
806
- **Props:**
807
-
808
- | Prop | Type | Required | Default | Description |
809
- |------|------|----------|---------|-------------|
810
- | `items` | `DescriptionItem[]` | Yes | - | Array of term/definition pairs |
811
- | `orientation` | `horizontal | vertical` | No | vertical | Layout orientation |
812
-
813
- ---
814
-
815
- ### Grid
816
-
817
- Grid Component
818
-
819
- Polymorphic CSS Grid layout primitive.
820
- Can render as any HTML element while maintaining grid layout.
821
-
822
- **Props:**
823
-
824
- | Prop | Type | Required | Default | Description |
825
- |------|------|----------|---------|-------------|
826
- | `as` | `ElementType` | No | div | Element type to render as
827
- @example 'section', 'article', 'aside', 'header', 'footer', 'main' |
828
- | `cols` | `1 | 2 | 3 | 4 | 5 | 6 | 12 | auto-fit | auto-fill` | No | 1 | Number of columns |
829
- | `minColWidth` | `string` | No | "250px" | Minimum column width for auto-fit/auto-fill layouts
830
- @example "250px", "20rem" |
831
- | `gap` | `none | tight | medium | large` | No | medium | Spacing between items |
832
- | `align` | `center | start | end | stretch` | No | stretch | Vertical alignment (align-items) |
833
- | `areas` | `string` | No | - | Named grid areas (CSS grid-template-areas)
834
- Use with GridArea component for semantic grid layouts
835
- @example "left center right", "left right", "header header" / "sidebar main" |
836
- | `templateColumns` | `string` | No | - | Grid template columns (CSS grid-template-columns)
837
- Required when using `areas` prop
838
- @example "1fr auto 1fr", "1fr auto", "200px 1fr" |
839
-
840
- ---
841
-
842
- ### List
843
-
844
- List component for bullet points, numbered lists, and feature lists.
845
- Zero CSS required - handles all styling via framework patterns.
846
-
847
- **Props:**
848
-
849
- | Prop | Type | Required | Default | Description |
850
- |------|------|----------|---------|-------------|
851
- | `items` | `(ReactNode | ListItem)[]` | Yes | - | Array of items (strings or objects) |
852
- | `ordered` | `boolean` | No | - | Whether to render as ordered list (numbers) |
853
-
854
- ---
855
-
856
- ### ToggleGroupItem
857
-
858
- ToggleGroupItem component
859
-
860
- ---
861
-
862
- ### VisuallyHidden
863
-
864
- VisuallyHidden component
865
-
866
- **Props:**
867
-
868
- | Prop | Type | Required | Default | Description |
869
- |------|------|----------|---------|-------------|
870
- | `asChild` | `boolean` | No | - | - |
871
-
872
- ---
873
-
874
-
875
- **Remember:** No CSS. Just compose components with props.