@donotdev/cli 0.0.37 → 0.1.1
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/LICENSE.md +21 -48
- package/dependencies-matrix.json +108 -58
- package/dist/bin/commands/agent-setup.js +7196 -123
- package/dist/bin/commands/build.js +3341 -207
- package/dist/bin/commands/bump.js +268 -24
- package/dist/bin/commands/cacheout.js +262 -13
- package/dist/bin/commands/coach.js +365 -61
- package/dist/bin/commands/create-app.js +261 -14
- package/dist/bin/commands/create-project.js +270 -15
- package/dist/bin/commands/db.js +10743 -2346
- package/dist/bin/commands/deploy.js +4202 -776
- package/dist/bin/commands/dev.js +353 -38
- package/dist/bin/commands/doctor.js +412 -108
- package/dist/bin/commands/emu.js +392 -57
- package/dist/bin/commands/format.js +250 -15
- package/dist/bin/commands/get-demo.js +261 -14
- package/dist/bin/commands/make-admin.js +10022 -1552
- package/dist/bin/commands/preview.js +353 -38
- package/dist/bin/commands/seed.js +10743 -2346
- package/dist/bin/commands/setup-cicd.js +456 -133
- package/dist/bin/commands/setup.js +428 -125
- package/dist/bin/commands/staging.js +4202 -776
- package/dist/bin/commands/sync-secrets.js +250 -14
- package/dist/bin/commands/type-check.js +249 -13
- package/dist/bin/commands/wai.js +249 -13
- package/dist/bin/dndev.js +33 -4
- package/dist/bin/donotdev.js +33 -4
- package/dist/index.js +4278 -856
- package/{templates/root-consumer/guides/dndev/advanced/VERSION_CONTROL.md.example → guidelines/VERSION_CONTROL.md} +7 -11
- package/package.json +3 -2
- package/templates/app-demo/src/themes.css.example +21 -0
- package/templates/app-dndev/index.html.example +0 -3
- package/templates/app-dndev/src/themes.css.example +21 -0
- package/templates/app-next/src/app/layout.tsx.example +13 -4
- package/templates/app-next/src/themes.css.example +21 -0
- package/templates/app-vite/csp.example.json +44 -0
- package/templates/app-vite/index.html.example +0 -3
- package/templates/app-vite/src/themes.css.example +21 -0
- package/templates/functions-supabase/supabase/functions/.env.example +12 -0
- package/templates/functions-supabase/supabase/functions/disconnect-oauth/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/exchange-token/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/get-connections/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/functions/refresh-token/index.ts.example +7 -0
- package/templates/functions-supabase/supabase/migrations/20250101000000_idempotency.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000001_rate_limits.sql +3 -0
- package/templates/functions-supabase/supabase/migrations/20250101000003_operation_metrics.sql +3 -0
- package/templates/preset-admin/src/pages/DashboardPage.tsx.example +189 -0
- package/templates/preset-admin/src/pages/EntityPage.tsx.example +84 -0
- package/templates/preset-admin/src/pages/ReportsPage.tsx.example +243 -0
- package/templates/preset-admin/src/pages/SettingsPage.tsx.example +283 -0
- package/templates/preset-admin/src/pages/UsersPage.tsx.example +128 -0
- package/templates/preset-ecommerce/src/pages/CartPage.tsx.example +167 -0
- package/templates/preset-ecommerce/src/pages/CatalogPage.tsx.example +187 -0
- package/templates/preset-ecommerce/src/pages/CheckoutPage.tsx.example +244 -0
- package/templates/preset-ecommerce/src/pages/HomePage.tsx.example +268 -0
- package/templates/preset-ecommerce/src/pages/ProductPage.tsx.example +228 -0
- package/templates/preset-landing/src/pages/AboutPage.tsx.example +237 -0
- package/templates/preset-landing/src/pages/ContactPage.tsx.example +192 -0
- package/templates/preset-landing/src/pages/HomePage.tsx.example +399 -0
- package/templates/preset-saas/src/pages/DashboardPage.tsx.example +195 -0
- package/templates/preset-saas/src/pages/HomePage.tsx.example +270 -0
- package/templates/preset-saas/src/pages/PricingPage.tsx.example +204 -0
- package/templates/preset-saas/src/pages/ProfilePage.tsx.example +191 -0
- package/templates/preset-saas/src/pages/SettingsPage.tsx.example +292 -0
- package/templates/root-consumer/.claude/hooks/framework-compliance.sh.example +56 -0
- package/templates/root-consumer/.claude/hooks/guard-bash.sh.example +61 -0
- package/templates/root-consumer/.claude/hooks/guard-files.sh.example +46 -0
- package/templates/root-consumer/.claude/hooks/guard-mcp.sh.example +91 -0
- package/templates/root-consumer/.claude/hooks/guard-secrets.sh.example +67 -0
- package/templates/root-consumer/.claude/hooks/guard-write.sh.example +89 -0
- package/templates/root-consumer/.claude/hooks/session-start.sh.example +50 -0
- package/templates/root-consumer/.claude/hooks/track-mcp-lookup.sh.example +20 -0
- package/templates/root-consumer/.claude/hooks/typecheck-stop.sh.example +18 -0
- package/templates/root-consumer/.claude/rules/consumer-ux.md.example +32 -0
- package/templates/root-consumer/.claude/rules/definition-of-done.md.example +32 -0
- package/templates/root-consumer/.claude/rules/framework.md.example +39 -0
- package/templates/root-consumer/.claude/rules/git.md.example +14 -0
- package/templates/root-consumer/.claude/rules/security.md.example +13 -0
- package/templates/root-consumer/.claude/settings.json.example +123 -1
- package/templates/root-consumer/.claude/skills/brainstorm/SKILL.md.example +16 -0
- package/templates/root-consumer/.claude/skills/build/SKILL.md.example +103 -25
- package/templates/root-consumer/.claude/skills/design/SKILL.md.example +17 -0
- package/templates/root-consumer/.claude/skills/grill/SKILL.md.example +33 -16
- package/templates/root-consumer/.claude/skills/polish/SKILL.md.example +50 -37
- package/templates/root-consumer/AI.md.example +2 -2
- package/templates/root-consumer/CLAUDE.md.example +33 -1
- package/templates/root-consumer/guides/dndev/INDEX.md.example +23 -27
- package/templates/root-consumer/guides/dndev/SETUP_AUTH.md.example +3 -2
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH.md.example +12 -6
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +50 -3
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +13 -15
- package/templates/app-demo/public/manifest.json.example +0 -10
- package/templates/app-dndev/public/manifest.json.example +0 -10
- package/templates/root-consumer/.claude/commands/brainstorm.md.example +0 -147
- package/templates/root-consumer/.claude/commands/build.md.example +0 -131
- package/templates/root-consumer/.claude/commands/design.md.example +0 -153
- package/templates/root-consumer/.claude/commands/grill.md.example +0 -108
- package/templates/root-consumer/.claude/commands/polish.md.example +0 -146
- package/templates/root-consumer/.claude/commands/techdebt.md.example +0 -28
- package/templates/root-consumer/guides/dndev/COMPONENTS_ATOMIC.md.example +0 -180
- package/templates/root-consumer/guides/dndev/COMPONENTS_CRUD.md.example +0 -234
- package/templates/root-consumer/guides/dndev/COMPONENTS_UI.md.example +0 -136
- package/templates/root-consumer/guides/dndev/COMPONENT_API.md.example +0 -195
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +0 -219
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +0 -197
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +0 -132
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +0 -280
- package/templates/root-consumer/guides/dndev/SETUP_CICD.md.example +0 -115
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +0 -334
- package/templates/root-consumer/guides/dndev/SETUP_FUNCTIONS.md.example +0 -9
- package/templates/root-consumer/guides/dndev/SETUP_I18N.md.example +0 -233
- package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +0 -158
- package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +0 -205
- package/templates/root-consumer/guides/dndev/SETUP_PWA.md.example +0 -213
- package/templates/root-consumer/guides/dndev/SETUP_TESTING.md.example +0 -184
- package/templates/root-consumer/guides/dndev/SETUP_THEMES.md.example +0 -111
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +0 -260
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +0 -499
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +0 -288
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: End-of-session tech debt sweep — surfaces cleanup items, does NOT fix
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
**Phase gate: only use after Phase 3 (COMPOSE) is complete.**
|
|
6
|
-
|
|
7
|
-
Scan files modified in this session for tech debt.
|
|
8
|
-
|
|
9
|
-
Check for:
|
|
10
|
-
- Duplicate logic (same pattern implemented 2+ places)
|
|
11
|
-
- Dead exports (exported symbols with no consumers)
|
|
12
|
-
- Missing JSDoc on public API functions/types
|
|
13
|
-
- Broken or missing imports (type-only imports used as values, etc.)
|
|
14
|
-
- Unused dependencies in package.json vs actual imports
|
|
15
|
-
- Hardcoded strings that should be in config or i18n
|
|
16
|
-
|
|
17
|
-
Output: prioritized list, grouped by area. Format:
|
|
18
|
-
```
|
|
19
|
-
## <area>
|
|
20
|
-
- [HIGH] <description> — <file>:<line>
|
|
21
|
-
- [MED] <description> — <file>:<line>
|
|
22
|
-
- [LOW] <description> — <file>:<line>
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
Rules:
|
|
26
|
-
- DO NOT fix anything. Report only.
|
|
27
|
-
- Skip node_modules, dist, .d.ts files.
|
|
28
|
-
- Skip items already in .dndev/implementation.md as known TODOs.
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
# Component Reference
|
|
2
|
-
|
|
3
|
-
**Check JSDoc in your IDE** - Hover over any component import to see props, types, and examples.
|
|
4
|
-
|
|
5
|
-
**Import from:** `@donotdev/components` (atomic UI)
|
|
6
|
-
|
|
7
|
-
**This is your GOTO Semantic React package**
|
|
8
|
-
|
|
9
|
-
---
|
|
10
|
-
|
|
11
|
-
## Layout Components
|
|
12
|
-
|
|
13
|
-
These are the only ways one should handle layout to get to quick results functionality wide.
|
|
14
|
-
- **Section** - Layout section with title, grid, tone system, and `bleed` prop for full-viewport-width content (images, maps, galleries).
|
|
15
|
-
- **Grid** - CSS Grid layout primitive with responsive column control.
|
|
16
|
-
- **Stack** - Flexbox layout for arranging items in rows or columns.
|
|
17
|
-
- **HeroSection** - Hero banner with title, subtitle, gradient backgrounds, `bleed` for full-width, and `backgroundImage` for cover images with overlay.
|
|
18
|
-
- **CallToAction** - Conversion-focused section with actions, `bleed` for full-width, and `backgroundImage` for cover images with overlay.
|
|
19
|
-
|
|
20
|
-
---
|
|
21
|
-
|
|
22
|
-
## Content Components
|
|
23
|
-
|
|
24
|
-
- **Card** - Premium card component with title, content, footer, and elevation variants.
|
|
25
|
-
- **Navigation with middle-click support:** Wrap Card in Link component for navigation that supports middle-click (opens in new tab). See navigation section below.
|
|
26
|
-
- **DualCard** - Side-by-side card layout for comparison or feature showcases.
|
|
27
|
-
- **Text** - Typography component with semantic text variants.
|
|
28
|
-
- **Blockquote** - Styled blockquote for citations and testimonials.
|
|
29
|
-
- **List** - Bullet points, numbered lists, and feature lists with zero CSS. Use `icon` prop for custom icons, `icon={null}` for plain bullets.
|
|
30
|
-
- **DescriptionList** - Key-value pairs and metadata using semantic HTML (dl, dt, dd).
|
|
31
|
-
- **Separator** - Visual separator with semantic styling variants.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Action Components
|
|
36
|
-
|
|
37
|
-
- **Button** - Accessible button with variants, icons, tooltips, and render prop composition.
|
|
38
|
-
- **ActionButton** - Button with async action handling and loading states.
|
|
39
|
-
- **FileButton** - Button that triggers file input selection.
|
|
40
|
-
- **PortalButton** - Button that opens content in a portal overlay.
|
|
41
|
-
- **ButtonGroup** - Visual grouping of buttons with joined borders. Supports horizontal/vertical orientation, variant propagation, and items-based API.
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
## Form Components
|
|
46
|
-
|
|
47
|
-
- **Input** - Accessible input with mobile-friendly touch targets and key state styling.
|
|
48
|
-
- **PasswordInput** - Password field with show/hide toggle functionality.
|
|
49
|
-
- **Textarea** - Multi-line text input component.
|
|
50
|
-
- **Label** - Accessible label with icon support and various positions.
|
|
51
|
-
- **Checkbox** - Accessible checkbox with custom styling.
|
|
52
|
-
- **RadioGroup** - Accessible radio group with multiple visual variants.
|
|
53
|
-
- **Select** - Accessible select dropdown with search and multi-select support.
|
|
54
|
-
- **Combobox** - Searchable combobox with autocomplete functionality.
|
|
55
|
-
- **Switch** - Toggle switch component.
|
|
56
|
-
- **Slider** - Range slider for numeric input.
|
|
57
|
-
- **ColorPicker** - Color selection with preset swatch grid, native color input, and ARIA radiogroup pattern. Built-in palettes: basic, material, pastel.
|
|
58
|
-
|
|
59
|
-
---
|
|
60
|
-
|
|
61
|
-
## Feedback Components
|
|
62
|
-
|
|
63
|
-
- **Alert** - Attention-grabbing alert with semantic variants and icons.
|
|
64
|
-
- **AlertDialog** - Modal dialog that interrupts with important content expecting a response.
|
|
65
|
-
- **Dialog** - Accessible modal dialog with custom content sizes and actions.
|
|
66
|
-
- **Toast** - Toast notifications via Toaster component with ToastProvider.
|
|
67
|
-
- **Skeleton** - Loading state skeleton with multiple animation variants.
|
|
68
|
-
- **Spinner** - Loading spinner with multiple sizes and theme-aware colors.
|
|
69
|
-
- **Progress** - Progress bar component for task completion.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Navigation Components
|
|
74
|
-
|
|
75
|
-
- **Tabs** - Tabbed interface with props-based API and full keyboard navigation.
|
|
76
|
-
- **Accordion** - Vertically stacked headings that reveal content sections.
|
|
77
|
-
- **NavigationMenu** - Props-based navigation menu with nested menus and rich content.
|
|
78
|
-
- **Pagination** - Accessible pagination with page number generation and ellipsis.
|
|
79
|
-
- **Command** - Command palette component for keyboard navigation and search.
|
|
80
|
-
- **CommandDialog** - Command palette dialog optimized for Cmd+K navigation.
|
|
81
|
-
- **TreeView** - Hierarchical tree component with WAI-ARIA TreeView pattern. Supports expand/collapse, single/multi selection, keyboard navigation, type-ahead search, and connector lines.
|
|
82
|
-
|
|
83
|
-
---
|
|
84
|
-
|
|
85
|
-
## Overlay Components
|
|
86
|
-
|
|
87
|
-
- **Popover** - Accessible popover displaying rich content in a portal.
|
|
88
|
-
- **Tooltip** - Tooltip component with positioning and delay controls.
|
|
89
|
-
- **HoverCard** - Card that appears on hover with rich content.
|
|
90
|
-
- **Sheet** - Slide-out panel for sidebars, mobile navigation, or editing panels.
|
|
91
|
-
- **ContextMenu** - Right-click context menu with nested submenus.
|
|
92
|
-
- **DropdownMenu** - Professional dropdown menu with props-based API.
|
|
93
|
-
|
|
94
|
-
---
|
|
95
|
-
|
|
96
|
-
## Data Display Components
|
|
97
|
-
|
|
98
|
-
- **Table** - Accessible table component with sorting and selection.
|
|
99
|
-
- **DataTable** - High-level table with built-in sorting, filtering, search, and pagination.
|
|
100
|
-
- **Avatar** - Accessible avatar with image and fallback support.
|
|
101
|
-
- **Badge** - Status indicator with semantic variants (polymorphic: div, span, mark).
|
|
102
|
-
- **Tag** - Tag component for labels and categories.
|
|
103
|
-
- **Calendar** - Accessible date picker built on react-day-picker.
|
|
104
|
-
|
|
105
|
-
---
|
|
106
|
-
|
|
107
|
-
## Utility Components
|
|
108
|
-
|
|
109
|
-
- **Collapsible** - Collapsible content component.
|
|
110
|
-
- **Toggle** - Toggle button component.
|
|
111
|
-
- **ToggleGroup** - Group of toggle buttons.
|
|
112
|
-
- **ScrollArea** - Scrollable area with custom scrollbars.
|
|
113
|
-
- **Portal** - Portal component for rendering outside DOM hierarchy.
|
|
114
|
-
- **VisuallyHidden** - Screen reader-only content component.
|
|
115
|
-
- **Slot** - Slot component for composition patterns.
|
|
116
|
-
- **SkipLink** - Accessibility skip-to-content links, visible only on keyboard focus. Supports multiple targets with smooth scroll and focus management.
|
|
117
|
-
|
|
118
|
-
---
|
|
119
|
-
|
|
120
|
-
## Advanced Components
|
|
121
|
-
|
|
122
|
-
- **InfiniteScroll** - Infinite scroll component with load more functionality.
|
|
123
|
-
- **Stepper** - Step-by-step workflow component with navigation controls.
|
|
124
|
-
- **CopyToClipboard** - Copy to clipboard with visual feedback.
|
|
125
|
-
- **VideoPlayer** - Video player component with controls.
|
|
126
|
-
- **FeatureFallback** - Fallback UI when features are unavailable.
|
|
127
|
-
|
|
128
|
-
---
|
|
129
|
-
|
|
130
|
-
## Icons
|
|
131
|
-
|
|
132
|
-
- **Icons** - Icon components from lucide-react and custom partner icons.
|
|
133
|
-
|
|
134
|
-
---
|
|
135
|
-
|
|
136
|
-
**See also:** [COMPONENTS_UI.md](./COMPONENTS_UI.md) for layout/composition components | [COMPONENTS_CRUD.md](./COMPONENTS_CRUD.md) for CRUD operations and entity forms
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## Navigation with Card Component
|
|
141
|
-
|
|
142
|
-
**For clickable cards with navigation support (including middle-click):**
|
|
143
|
-
|
|
144
|
-
Wrap Card in Link component from `@donotdev/ui`:
|
|
145
|
-
|
|
146
|
-
```tsx
|
|
147
|
-
import { Card } from '@donotdev/components';
|
|
148
|
-
import { Link } from '@donotdev/ui';
|
|
149
|
-
|
|
150
|
-
// Card with navigation (supports middle-click)
|
|
151
|
-
<Link
|
|
152
|
-
path="/about"
|
|
153
|
-
style={{ display: 'block', textDecoration: 'none', height: '100%' }}
|
|
154
|
-
aria-label="Learn more about About"
|
|
155
|
-
>
|
|
156
|
-
<Card
|
|
157
|
-
title="About"
|
|
158
|
-
subtitle="Learn more about us"
|
|
159
|
-
content="Click to navigate"
|
|
160
|
-
/>
|
|
161
|
-
</Link>
|
|
162
|
-
|
|
163
|
-
// Card with onClick only (no middle-click support)
|
|
164
|
-
<Card
|
|
165
|
-
title="Action Card"
|
|
166
|
-
onClick={() => handleAction()}
|
|
167
|
-
/>
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
**Why wrap in Link?**
|
|
171
|
-
- Card component is standalone and not routing-aware
|
|
172
|
-
- Link wrapper provides framework navigation (SPA routing, keeps outlet context)
|
|
173
|
-
- Native browser middle-click support (opens in new tab)
|
|
174
|
-
- CSR/SSR safe
|
|
175
|
-
|
|
176
|
-
**Alternative:** Use FeatureCard from `@donotdev/ui` which handles this automatically when `href` prop is provided.
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
|
-
**All props documented in JSDoc** - Hover in IDE for complete reference.
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
# CRUD Package Reference
|
|
2
|
-
|
|
3
|
-
**Import:** `@donotdev/crud`
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Hooks
|
|
8
|
-
|
|
9
|
-
### useCrud
|
|
10
|
-
Single document CRUD actions (add, update, delete, get, subscribe).
|
|
11
|
-
|
|
12
|
-
```tsx
|
|
13
|
-
const { add, update, delete: remove, get, data, loading, error } = useCrud(carEntity);
|
|
14
|
-
await add({ name: 'Tesla', year: 2024 });
|
|
15
|
-
await remove('doc-id');
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
### useCrudList
|
|
19
|
-
Paginated list with automatic loading. For data tables.
|
|
20
|
-
|
|
21
|
-
```tsx
|
|
22
|
-
const { items, loading, refresh } = useCrudList(productEntity);
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### useCrudCardList
|
|
26
|
-
Card-based list with infinite scroll.
|
|
27
|
-
|
|
28
|
-
```tsx
|
|
29
|
-
const { items, loading, refresh } = useCrudCardList(articleEntity);
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
---
|
|
33
|
-
|
|
34
|
-
## Form Components
|
|
35
|
-
|
|
36
|
-
### EntityFormRenderer
|
|
37
|
-
Auto-render full entity form from definition.
|
|
38
|
-
|
|
39
|
-
```tsx
|
|
40
|
-
<EntityFormRenderer
|
|
41
|
-
entity={productEntity}
|
|
42
|
-
operation="create"
|
|
43
|
-
onSubmit={handleSubmit}
|
|
44
|
-
/>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### FormFieldRenderer
|
|
48
|
-
Render single field. Used inside custom forms.
|
|
49
|
-
|
|
50
|
-
```tsx
|
|
51
|
-
<FormFieldRenderer field={field} control={form.control} />
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### EntityList
|
|
55
|
-
Data table for entity collection.
|
|
56
|
-
|
|
57
|
-
```tsx
|
|
58
|
-
<EntityList entity={userEntity} onRowClick={(user) => edit(user.id)} />
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
### EntityCardList
|
|
62
|
-
Card grid for entity collection.
|
|
63
|
-
|
|
64
|
-
```tsx
|
|
65
|
-
<EntityCardList entity={productEntity} renderCard={(item) => <ProductCard {...item} />} />
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
---
|
|
69
|
-
|
|
70
|
-
## Form Building Blocks
|
|
71
|
-
|
|
72
|
-
For custom forms, use these low-level utilities:
|
|
73
|
-
|
|
74
|
-
```tsx
|
|
75
|
-
import { useEntityForm, getFieldsForOperation, validateEntity } from '@donotdev/crud';
|
|
76
|
-
|
|
77
|
-
const { register, handleSubmit, fields, formState } = useEntityForm(productEntity, {
|
|
78
|
-
operation: 'create'
|
|
79
|
-
});
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
| Export | Purpose |
|
|
83
|
-
|--------|---------|
|
|
84
|
-
| `useEntityForm` | React Hook Form wrapper for entities |
|
|
85
|
-
| `useEntityField` | Single field hook |
|
|
86
|
-
| `getFieldsForOperation` | Get editable fields for create/edit |
|
|
87
|
-
| `validateEntity` | Validate data against entity schema |
|
|
88
|
-
| `isFieldEditable` | Check if field is editable |
|
|
89
|
-
|
|
90
|
-
---
|
|
91
|
-
|
|
92
|
-
## Field Types (Built-in)
|
|
93
|
-
|
|
94
|
-
Field components are auto-rendered by `FormFieldRenderer`. You don't import them directly.
|
|
95
|
-
|
|
96
|
-
### Text Inputs
|
|
97
|
-
- `text` - Single-line text input
|
|
98
|
-
- `email` - Email input with validation
|
|
99
|
-
- `tel` - Phone number input
|
|
100
|
-
- `url` - URL input
|
|
101
|
-
- `color` - Color picker
|
|
102
|
-
- `password` - Password input (masked)
|
|
103
|
-
- `textarea` - Multi-line text input
|
|
104
|
-
- `richtext` - Rich text editor
|
|
105
|
-
|
|
106
|
-
### Numbers
|
|
107
|
-
- `number` - Numeric input
|
|
108
|
-
- `range` - Slider input
|
|
109
|
-
- `rating` - Star rating input (1–5, configurable max)
|
|
110
|
-
|
|
111
|
-
**Rating + comment (e.g. reviews):** Use two fields on the same entity — `rating` (type `rating`) for stars and `comment` (type `textarea`) for the text. The form renders them as separate rows; no composite field type needed.
|
|
112
|
-
|
|
113
|
-
### Boolean
|
|
114
|
-
- `checkbox` - Checkbox input
|
|
115
|
-
- `boolean` - Alias for checkbox
|
|
116
|
-
- `switch` - Toggle switch
|
|
117
|
-
|
|
118
|
-
### Dates & Time
|
|
119
|
-
- `date` - Date picker
|
|
120
|
-
- `datetime-local` - Date and time picker
|
|
121
|
-
- `time` - Time picker
|
|
122
|
-
- `week` - Week picker
|
|
123
|
-
- `month` - Month picker
|
|
124
|
-
- `timestamp` - Timestamp (Firestore Timestamp)
|
|
125
|
-
|
|
126
|
-
### Selection
|
|
127
|
-
- `select` - Dropdown select
|
|
128
|
-
- `combobox` - Searchable dropdown
|
|
129
|
-
- `multiselect` - Multiple selection dropdown
|
|
130
|
-
- `radio` - Radio button group
|
|
131
|
-
|
|
132
|
-
### Files & Media
|
|
133
|
-
- `file` - Single file upload
|
|
134
|
-
- `files` - Multiple file uploads
|
|
135
|
-
- `document` - Document upload (PDF, etc.)
|
|
136
|
-
- `documents` - Multiple document uploads
|
|
137
|
-
- `image` - Single image upload
|
|
138
|
-
- `images` - Multiple image uploads
|
|
139
|
-
|
|
140
|
-
### Complex Types
|
|
141
|
-
- `geopoint` - Geographic coordinates (lat/lng)
|
|
142
|
-
- `address` - Address input with autocomplete
|
|
143
|
-
- `map` - Map picker
|
|
144
|
-
- `array` - Array of text inputs
|
|
145
|
-
|
|
146
|
-
### Special
|
|
147
|
-
- `avatar` - Avatar image upload
|
|
148
|
-
- `badge` - Badge display
|
|
149
|
-
- `hidden` - Hidden field (not displayed)
|
|
150
|
-
- `submit` - Submit button (uncontrolled)
|
|
151
|
-
- `reset` - Reset button (uncontrolled)
|
|
152
|
-
|
|
153
|
-
To add custom field types:
|
|
154
|
-
```tsx
|
|
155
|
-
import { useController, registerFieldType } from '@donotdev/crud';
|
|
156
|
-
import type { ControlledFieldProps } from '@donotdev/crud';
|
|
157
|
-
|
|
158
|
-
// Custom controlled component MUST use framework's useController (not react-hook-form's)
|
|
159
|
-
function ScoreField({
|
|
160
|
-
fieldConfig,
|
|
161
|
-
control,
|
|
162
|
-
errors,
|
|
163
|
-
t,
|
|
164
|
-
onChange
|
|
165
|
-
}: ControlledFieldProps) {
|
|
166
|
-
// REQUIRED: Use framework's useController - ensures type compatibility
|
|
167
|
-
const { field, fieldState } = useController({
|
|
168
|
-
name: fieldConfig.name,
|
|
169
|
-
control: control,
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
return (
|
|
173
|
-
<div>
|
|
174
|
-
<label>{t(fieldConfig.label)}</label>
|
|
175
|
-
{/* Use field.value and field.onChange */}
|
|
176
|
-
<input
|
|
177
|
-
type="number"
|
|
178
|
-
value={field.value ?? 0}
|
|
179
|
-
onChange={(e) => {
|
|
180
|
-
const value = Number(e.target.value);
|
|
181
|
-
field.onChange(value);
|
|
182
|
-
onChange?.(value);
|
|
183
|
-
}}
|
|
184
|
-
min={0}
|
|
185
|
-
max={10}
|
|
186
|
-
/>
|
|
187
|
-
{fieldState?.error && (
|
|
188
|
-
<span className="error">{fieldState.error.message}</span>
|
|
189
|
-
)}
|
|
190
|
-
</div>
|
|
191
|
-
);
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
registerFieldType({
|
|
195
|
-
type: 'score',
|
|
196
|
-
controlledComponent: ScoreField,
|
|
197
|
-
});
|
|
198
|
-
```
|
|
199
|
-
|
|
200
|
-
**Important:**
|
|
201
|
-
- Custom controlled components receive `control` prop, NOT `field` prop
|
|
202
|
-
- You must use **framework's `useController`** (from `@donotdev/crud`), NOT `react-hook-form`'s useController
|
|
203
|
-
- This ensures type compatibility - no type assertions needed
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
## Service & Store
|
|
208
|
-
|
|
209
|
-
Direct access (rarely needed):
|
|
210
|
-
|
|
211
|
-
```tsx
|
|
212
|
-
import { getCrudService, useCrudStore } from '@donotdev/crud';
|
|
213
|
-
|
|
214
|
-
const service = getCrudService();
|
|
215
|
-
await service.query('products', { where: [['active', '==', true]] });
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
---
|
|
219
|
-
|
|
220
|
-
## Collection Utilities
|
|
221
|
-
|
|
222
|
-
```tsx
|
|
223
|
-
import { loadDeterministicRange, upsertDeterministic, appendToCollection } from '@donotdev/crud';
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
| Utility | Purpose |
|
|
227
|
-
|---------|---------|
|
|
228
|
-
| `loadDeterministicRange` | Paginated loading with deterministic IDs |
|
|
229
|
-
| `upsertDeterministic` | Insert or update with deterministic ID |
|
|
230
|
-
| `appendToCollection` | Add to collection end |
|
|
231
|
-
|
|
232
|
-
---
|
|
233
|
-
|
|
234
|
-
**JSDoc in IDE** - Hover over any import for full props and examples.
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# UI Package Reference
|
|
2
|
-
|
|
3
|
-
**Check JSDoc in your IDE** - Hover over any component import to see props, types, and examples.
|
|
4
|
-
|
|
5
|
-
**Import from:** `@donotdev/ui` (layout/composition components)
|
|
6
|
-
|
|
7
|
-
---
|
|
8
|
-
|
|
9
|
-
## Layout Components
|
|
10
|
-
|
|
11
|
-
- **PageContainer** - Page wrapper with width constraints, spacing, and density system.
|
|
12
|
-
- **GameContainer** - Game preset container with fixed header/footer layout.
|
|
13
|
-
- **GameFlow** - Game flow component for step-by-step game interfaces.
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
## Layout Sub-Components
|
|
18
|
-
|
|
19
|
-
- **AppBranding** - App branding display with logo and name.
|
|
20
|
-
- **AppIcon** - App icon component.
|
|
21
|
-
- **AppTitle** - App title display component.
|
|
22
|
-
- **GameTitle** - Game title component for game preset.
|
|
23
|
-
- **Breadcrumbs** - Breadcrumb navigation component.
|
|
24
|
-
- **HeaderNavigation** - Header navigation menu component.
|
|
25
|
-
- **DropdownNavigation** - Dropdown navigation menu.
|
|
26
|
-
- **HeaderMenu** - Header menu component.
|
|
27
|
-
- **SettingsMenu** - Settings menu component.
|
|
28
|
-
- **ThemeToggle** - Theme toggle button component.
|
|
29
|
-
- **CacheSettings** - Cache settings component.
|
|
30
|
-
- **Notifications** - Notifications component.
|
|
31
|
-
- **FloatingLanguageSwitcher** - Floating language selector component.
|
|
32
|
-
|
|
33
|
-
---
|
|
34
|
-
|
|
35
|
-
## Auth Components
|
|
36
|
-
|
|
37
|
-
- **AuthHeader** - Header component with authentication UI (sign in/out, user menu).
|
|
38
|
-
- **AuthMenu** - Authentication menu component.
|
|
39
|
-
|
|
40
|
-
---
|
|
41
|
-
|
|
42
|
-
## Helpers
|
|
43
|
-
|
|
44
|
-
- **tList(t, key, count, icon?, size?)** - Translated array as List. Default: CheckCircle icon. Pass `null` for no icon (use with emoji labels).
|
|
45
|
-
|
|
46
|
-
---
|
|
47
|
-
|
|
48
|
-
## Common Components
|
|
49
|
-
|
|
50
|
-
- **FeatureDisabled** - Component shown when features are disabled.
|
|
51
|
-
- **Icon** - Icon component wrapper.
|
|
52
|
-
- **ProgressBar** - Progress bar component.
|
|
53
|
-
- **Skeleton** - Skeleton loading component (consumer use, not used internally).
|
|
54
|
-
- **FeatureCard** - Feature showcase card component.
|
|
55
|
-
- **TechBento** - Tech stack showcase component.
|
|
56
|
-
|
|
57
|
-
---
|
|
58
|
-
|
|
59
|
-
## Routing Components
|
|
60
|
-
|
|
61
|
-
- **Link** - Platform-agnostic link component (works in Vite + Next.js).
|
|
62
|
-
- **AuthGuard** - Route guard component for protected routes.
|
|
63
|
-
- **AuthGuardFallback** - Fallback component for auth-guarded routes.
|
|
64
|
-
- **GoTo** - Programmatic navigation component.
|
|
65
|
-
- **GoToWrapper** - Wrapper for GoTo navigation.
|
|
66
|
-
- **GoToInput** - Input component for GoTo navigation.
|
|
67
|
-
- **GoToDialog** - Dialog for GoTo navigation.
|
|
68
|
-
- **DnDevNavigationMenu** - Framework navigation menu component.
|
|
69
|
-
- **NotFoundPage** - 404 page component.
|
|
70
|
-
|
|
71
|
-
---
|
|
72
|
-
|
|
73
|
-
## Routing Hooks
|
|
74
|
-
|
|
75
|
-
- **useNavigate** - Navigate to routes programmatically.
|
|
76
|
-
- **useBack** - Navigate back in history.
|
|
77
|
-
- **useRefresh** - Refresh current route.
|
|
78
|
-
- **usePrefetch** - Prefetch route data.
|
|
79
|
-
- **useLocation** - Get current location.
|
|
80
|
-
- **useParams** - Get route parameters.
|
|
81
|
-
- **useSearchParams** - Get URL search parameters. Returns `URLSearchParams` directly (NOT a tuple). Use `.get('key')` to read values.
|
|
82
|
-
- **useMatch** - Match current route pattern.
|
|
83
|
-
- **useQueryParams** - Get and set query parameters.
|
|
84
|
-
- **useRedirectGuard** - Guard against redirects.
|
|
85
|
-
- **useNavigation** - Navigation state and methods.
|
|
86
|
-
- **useGoTo** - GoTo navigation hook.
|
|
87
|
-
- **useRouteDiscovery** - Route discovery hook.
|
|
88
|
-
|
|
89
|
-
---
|
|
90
|
-
|
|
91
|
-
## Cookie Consent
|
|
92
|
-
|
|
93
|
-
- **CookieConsent** - Cookie consent management component.
|
|
94
|
-
- **ConsentBanner** - Cookie consent banner component.
|
|
95
|
-
|
|
96
|
-
---
|
|
97
|
-
|
|
98
|
-
## Platform-Specific Providers
|
|
99
|
-
|
|
100
|
-
- **ViteAppProviders** - App providers for Vite (import from `@donotdev/ui/vite`).
|
|
101
|
-
- **NextJsAppProviders** - App providers for Next.js (import from `@donotdev/ui/next`).
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
## CRUD Display Components (from @donotdev/ui)
|
|
106
|
-
|
|
107
|
-
- **DisplayFieldRenderer** - Renders read-only field displays.
|
|
108
|
-
- **EntityDisplayRenderer** - Renders complete entity displays.
|
|
109
|
-
- **TextFieldDisplay** - Text field display component.
|
|
110
|
-
- **BadgeFieldDisplay** - Badge field display component.
|
|
111
|
-
- **AvatarFieldDisplay** - Avatar field display component.
|
|
112
|
-
- **LinkFieldDisplay** - Link field display component.
|
|
113
|
-
- **DateFieldDisplay** - Date field display component.
|
|
114
|
-
- **NumberFieldDisplay** - Number field display component.
|
|
115
|
-
- **PhoneNumberDisplay** - Phone number display component.
|
|
116
|
-
- **TextAreaDisplay** - Textarea display component.
|
|
117
|
-
- **CheckboxFieldDisplay** - Checkbox display component.
|
|
118
|
-
- **DropdownDisplay** - Dropdown display component.
|
|
119
|
-
- **MultiDropdownDisplay** - Multi-select dropdown display component.
|
|
120
|
-
- **MultiInputTextFieldDisplay** - Multi-input text field display component.
|
|
121
|
-
- **RadioFieldDisplay** - Radio field display component.
|
|
122
|
-
- **RangeFieldDisplay** - Range field display component.
|
|
123
|
-
- **FileFieldDisplay** - File field display component.
|
|
124
|
-
- **ImageFieldDisplay** - Image field display component.
|
|
125
|
-
- **GeoPointFieldDisplay** - GeoPoint field display component.
|
|
126
|
-
- **MapFieldDisplay** - Map field display component.
|
|
127
|
-
- **ReferenceFieldDisplay** - Reference field display component.
|
|
128
|
-
- **TimestampFieldDisplay** - Timestamp field display component.
|
|
129
|
-
- **HiddenFieldDisplay** - Hidden field display component.
|
|
130
|
-
- **ButtonFieldDisplay** - Button field display component.
|
|
131
|
-
|
|
132
|
-
---
|
|
133
|
-
|
|
134
|
-
**For MVP:** Only `PageContainer` is needed. All other components are optional.
|
|
135
|
-
|
|
136
|
-
**All props documented in JSDoc** - Hover in IDE for complete reference.
|