@donotdev/cli 0.0.18 → 0.0.19
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 +55 -156
- package/dist/bin/commands/coach.js +8177 -0
- package/dist/bin/commands/create-app.js +5 -5
- package/dist/bin/commands/create-project.js +10 -7
- package/dist/bin/commands/deploy.js +81 -59
- package/dist/bin/commands/doctor.js +243 -698
- package/dist/bin/commands/emu.js +2 -2
- package/dist/bin/commands/format.js +4 -1
- package/dist/bin/commands/get-demo.js +8351 -0
- package/dist/bin/commands/make-admin.js +773 -152
- package/dist/bin/commands/setup.js +519 -1711
- package/dist/bin/commands/staging.js +17852 -0
- package/dist/bin/commands/sync-secrets.js +2 -11
- package/dist/bin/commands/type-check.js +7733 -1713
- package/dist/bin/dndev.js +913 -185
- package/dist/bin/donotdev.js +913 -185
- package/dist/index.js +96 -65
- package/package.json +1 -1
- package/templates/app-demo/index.html.example +147 -10
- package/templates/app-demo/src/App.tsx.example +7 -13
- package/templates/app-demo/src/config/app.ts.example +12 -48
- package/templates/app-demo/src/entities/product.ts.example +38 -0
- package/templates/app-demo/src/globals.css.example +5 -1
- package/templates/app-demo/src/main.tsx.example +13 -7
- package/templates/app-demo/src/pages/ChangelogPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/DashboardPage.tsx.example +15 -0
- package/templates/app-demo/src/pages/HomePage.tsx.example +3 -77
- package/templates/app-demo/src/pages/PricingPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/ProductsPage.tsx.example +17 -0
- package/templates/app-demo/src/pages/ProfilePage.tsx.example +16 -0
- package/templates/app-demo/src/pages/SettingsPage.tsx.example +15 -0
- package/templates/app-demo/src/pages/ShowcaseDetailPage.tsx.example +112 -0
- package/templates/app-demo/src/pages/ShowcasePage.tsx.example +91 -0
- package/templates/app-demo/src/pages/legal/LegalPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/legal/PrivacyPage.tsx.example +14 -0
- package/templates/app-demo/src/pages/legal/TermsPage.tsx.example +14 -0
- package/templates/app-demo/tsconfig.json.example +1 -1
- package/templates/app-demo/vite.config.ts.example +23 -48
- package/templates/app-expo/README.md.example +1 -1
- package/templates/app-expo/app/index.tsx.example +1 -1
- package/templates/app-vite/src/pages/HomePage.tsx.example +8 -10
- package/templates/overlay-firebase/env.fragment.example +1 -1
- package/templates/overlay-firebase/env.fragment.expo.example +1 -1
- package/templates/overlay-firebase/env.fragment.nextjs.example +1 -1
- package/templates/overlay-supabase/env.fragment.example +1 -1
- package/templates/overlay-supabase/env.fragment.expo.example +1 -1
- package/templates/overlay-supabase/env.fragment.nextjs.example +1 -1
- package/templates/overlay-vercel/env.fragment.example +1 -1
- package/templates/overlay-vercel/env.fragment.nextjs.example +1 -1
- package/templates/root-consumer/AI.md.example +4 -3
- package/templates/root-consumer/guides/dndev/AGENT_START_HERE.md.example +21 -6
- package/templates/root-consumer/guides/dndev/COMPONENTS_ADV.md.example +16 -179
- package/templates/root-consumer/guides/dndev/ENV_SETUP.md.example +19 -21
- package/templates/root-consumer/guides/dndev/GOTCHAS.md.example +14 -3
- package/templates/root-consumer/guides/dndev/INDEX.md.example +2 -2
- package/templates/root-consumer/guides/dndev/SETUP_APP_CONFIG.md.example +3 -3
- package/templates/root-consumer/guides/dndev/SETUP_BLOG.md.example +19 -2
- package/templates/root-consumer/guides/dndev/SETUP_CRUD.md.example +35 -1
- package/templates/root-consumer/guides/dndev/SETUP_FIREBASE.md.example +17 -12
- package/templates/root-consumer/guides/dndev/SETUP_LAYOUTS.md.example +32 -0
- package/templates/root-consumer/guides/dndev/SETUP_OAUTH_PROVIDERS.md.example +1 -1
- package/templates/root-consumer/guides/dndev/SETUP_PAGES.md.example +19 -15
- package/templates/root-consumer/guides/dndev/SETUP_STRIPE.md.example +2 -2
- package/templates/root-consumer/guides/dndev/SETUP_SUPABASE.md.example +17 -12
- package/templates/root-consumer/guides/dndev/SETUP_VERCEL.md.example +37 -16
- package/templates/root-consumer/guides/dndev/USE_ROUTING.md.example +18 -18
- package/templates/root-consumer/guides/dndev/essences_reference.css.example +119 -2
- package/templates/root-consumer/guides/wai-way/blueprints/1_scaffold.md.example +14 -0
- package/templates/root-consumer/guides/wai-way/blueprints/2_entities.md.example +6 -0
- package/templates/root-consumer/guides/wai-way/blueprints/3_compose.md.example +14 -0
- package/templates/root-consumer/guides/wai-way/entity_patterns.md.example +4 -5
- package/templates/root-consumer/guides/wai-way/page_patterns.md.example +2 -2
- package/dist/bin/commands/agent-setup.d.ts +0 -6
- package/dist/bin/commands/agent-setup.d.ts.map +0 -1
- package/dist/bin/commands/agent-setup.js.map +0 -1
- package/dist/bin/commands/build.d.ts +0 -11
- package/dist/bin/commands/build.d.ts.map +0 -1
- package/dist/bin/commands/build.js.map +0 -1
- package/dist/bin/commands/bump.d.ts +0 -11
- package/dist/bin/commands/bump.d.ts.map +0 -1
- package/dist/bin/commands/bump.js.map +0 -1
- package/dist/bin/commands/cacheout.d.ts +0 -11
- package/dist/bin/commands/cacheout.d.ts.map +0 -1
- package/dist/bin/commands/cacheout.js.map +0 -1
- package/dist/bin/commands/create-app.d.ts +0 -11
- package/dist/bin/commands/create-app.d.ts.map +0 -1
- package/dist/bin/commands/create-app.js.map +0 -1
- package/dist/bin/commands/create-project.d.ts +0 -11
- package/dist/bin/commands/create-project.d.ts.map +0 -1
- package/dist/bin/commands/create-project.js.map +0 -1
- package/dist/bin/commands/deploy.d.ts +0 -11
- package/dist/bin/commands/deploy.d.ts.map +0 -1
- package/dist/bin/commands/deploy.js.map +0 -1
- package/dist/bin/commands/dev.d.ts +0 -11
- package/dist/bin/commands/dev.d.ts.map +0 -1
- package/dist/bin/commands/dev.js.map +0 -1
- package/dist/bin/commands/doctor.d.ts +0 -6
- package/dist/bin/commands/doctor.d.ts.map +0 -1
- package/dist/bin/commands/doctor.js.map +0 -1
- package/dist/bin/commands/emu.d.ts +0 -11
- package/dist/bin/commands/emu.d.ts.map +0 -1
- package/dist/bin/commands/emu.js.map +0 -1
- package/dist/bin/commands/format.d.ts +0 -11
- package/dist/bin/commands/format.d.ts.map +0 -1
- package/dist/bin/commands/format.js.map +0 -1
- package/dist/bin/commands/make-admin.d.ts +0 -11
- package/dist/bin/commands/make-admin.d.ts.map +0 -1
- package/dist/bin/commands/make-admin.js.map +0 -1
- package/dist/bin/commands/preview.d.ts +0 -11
- package/dist/bin/commands/preview.d.ts.map +0 -1
- package/dist/bin/commands/preview.js.map +0 -1
- package/dist/bin/commands/setup.d.ts +0 -6
- package/dist/bin/commands/setup.d.ts.map +0 -1
- package/dist/bin/commands/setup.js.map +0 -1
- package/dist/bin/commands/sync-secrets.d.ts +0 -11
- package/dist/bin/commands/sync-secrets.d.ts.map +0 -1
- package/dist/bin/commands/sync-secrets.js.map +0 -1
- package/dist/bin/commands/type-check.d.ts +0 -14
- package/dist/bin/commands/type-check.d.ts.map +0 -1
- package/dist/bin/commands/type-check.js.map +0 -1
- package/dist/bin/commands/wai.d.ts +0 -11
- package/dist/bin/commands/wai.d.ts.map +0 -1
- package/dist/bin/commands/wai.js.map +0 -1
- package/dist/index.d.ts +0 -8
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/templates/app-demo/src/components/ThemeToggle.tsx.example +0 -48
- package/templates/app-demo/src/pages/DetailPage.tsx.example +0 -103
- package/templates/app-demo/src/pages/FullPage.tsx.example +0 -142
- package/templates/app-demo/src/pages/components/DemoLayout.tsx.example +0 -266
- package/templates/app-demo/src/pages/components/LayoutRoute.tsx.example +0 -20
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
// apps/demo/src/pages/FullPage.tsx
|
|
2
|
-
|
|
3
|
-
import { Rocket, ExternalLink } from 'lucide-react';
|
|
4
|
-
|
|
5
|
-
import {
|
|
6
|
-
Button,
|
|
7
|
-
CallToAction,
|
|
8
|
-
Card,
|
|
9
|
-
Code,
|
|
10
|
-
Grid,
|
|
11
|
-
GridArea,
|
|
12
|
-
HeroSection,
|
|
13
|
-
Section,
|
|
14
|
-
Stack,
|
|
15
|
-
Text,
|
|
16
|
-
} from '@donotdev/components';
|
|
17
|
-
|
|
18
|
-
export default function FullPage() {
|
|
19
|
-
return (
|
|
20
|
-
<>
|
|
21
|
-
<HeroSection
|
|
22
|
-
title="Fullwidht hero section with gradient text"
|
|
23
|
-
subtitle="This page displays the Sections, Grid, GridArea, Stack and CallToAction layout components that are meant to wrap the other compoennts."
|
|
24
|
-
badge="This is HeroSection Component"
|
|
25
|
-
/>
|
|
26
|
-
|
|
27
|
-
<Section
|
|
28
|
-
title="Grid + GridArea Components"
|
|
29
|
-
subtitle="CSS Grid layout with named areas. GridArea components map to grid template areas. Full-width container."
|
|
30
|
-
>
|
|
31
|
-
<Card variant="muted" title="Grid Layout Example">
|
|
32
|
-
<Code language="tsx" showLineNumbers={false}>
|
|
33
|
-
{`<Grid
|
|
34
|
-
areas={\`"header header header"
|
|
35
|
-
"main main sidebar"
|
|
36
|
-
"footer footer footer"\`}
|
|
37
|
-
cols="1fr 3fr 1fr"
|
|
38
|
-
gap="none"
|
|
39
|
-
>
|
|
40
|
-
{/* Children */}
|
|
41
|
-
</Grid>`}
|
|
42
|
-
</Code>
|
|
43
|
-
</Card>
|
|
44
|
-
<Grid
|
|
45
|
-
areas={`"header header header"
|
|
46
|
-
"main main sidebar"
|
|
47
|
-
"footer footer footer"`}
|
|
48
|
-
cols="1fr 3fr 1fr"
|
|
49
|
-
gap="none"
|
|
50
|
-
>
|
|
51
|
-
<GridArea as="header" name="header">
|
|
52
|
-
<Section tone="muted" title="Header Area">
|
|
53
|
-
<Text variant="muted">Header content (as="header")</Text>
|
|
54
|
-
</Section>
|
|
55
|
-
</GridArea>
|
|
56
|
-
<GridArea as="section" name="main">
|
|
57
|
-
<Section title="Main Content Area">
|
|
58
|
-
<Text variant="muted">Main content (as="section")</Text>
|
|
59
|
-
</Section>
|
|
60
|
-
</GridArea>
|
|
61
|
-
<GridArea as="aside" name="sidebar">
|
|
62
|
-
<Section tone="muted" title="Sidebar Area">
|
|
63
|
-
<Text variant="muted">Sidebar content (as="aside")</Text>
|
|
64
|
-
</Section>
|
|
65
|
-
</GridArea>
|
|
66
|
-
<GridArea as="footer" name="footer">
|
|
67
|
-
<Section tone="muted" title="Footer Area">
|
|
68
|
-
<Text variant="muted">Footer content (as="footer")</Text>
|
|
69
|
-
</Section>
|
|
70
|
-
</GridArea>
|
|
71
|
-
</Grid>
|
|
72
|
-
</Section>
|
|
73
|
-
|
|
74
|
-
<Section
|
|
75
|
-
title="Stack Component"
|
|
76
|
-
subtitle="Flexbox layout component. Full-width container."
|
|
77
|
-
>
|
|
78
|
-
<Card variant="muted" title="Stack Layout Example">
|
|
79
|
-
<Text variant="muted">
|
|
80
|
-
Stack creates flex containers. Use direction="row" for horizontal,
|
|
81
|
-
default is vertical. Gap controls spacing between items.
|
|
82
|
-
</Text>
|
|
83
|
-
</Card>
|
|
84
|
-
<Stack>
|
|
85
|
-
<Card variant="muted" title="Stack Item 1">
|
|
86
|
-
<Text variant="muted">Vertical stack with</Text>
|
|
87
|
-
</Card>
|
|
88
|
-
<Card variant="muted" title="Stack Item 2">
|
|
89
|
-
<Text variant="muted">Items stack vertically by default</Text>
|
|
90
|
-
</Card>
|
|
91
|
-
<Stack direction="row">
|
|
92
|
-
<Card variant="muted" title="Row Item 1">
|
|
93
|
-
<Text variant="muted">Horizontal stack</Text>
|
|
94
|
-
</Card>
|
|
95
|
-
<Card variant="muted" title="Row Item 2">
|
|
96
|
-
<Text variant="muted">direction="row"</Text>
|
|
97
|
-
</Card>
|
|
98
|
-
</Stack>
|
|
99
|
-
</Stack>
|
|
100
|
-
</Section>
|
|
101
|
-
|
|
102
|
-
<CallToAction
|
|
103
|
-
title="CallToAction Component"
|
|
104
|
-
subtitle="Full-width CTA section with gradient background. Constrained by --content-width, centered. Use for conversion sections."
|
|
105
|
-
primaryAction={
|
|
106
|
-
<Button
|
|
107
|
-
variant="primary"
|
|
108
|
-
fullWidth
|
|
109
|
-
icon={ExternalLink}
|
|
110
|
-
iconEnd
|
|
111
|
-
tooltip="https://donotdev.com/purchase"
|
|
112
|
-
onClick={() =>
|
|
113
|
-
window.open(
|
|
114
|
-
'https://donotdev.com/purchase',
|
|
115
|
-
'_blank',
|
|
116
|
-
'noopener,noreferrer'
|
|
117
|
-
)
|
|
118
|
-
}
|
|
119
|
-
>
|
|
120
|
-
Get Full Framework
|
|
121
|
-
</Button>
|
|
122
|
-
}
|
|
123
|
-
secondaryAction={
|
|
124
|
-
|
|
125
|
-
<Button
|
|
126
|
-
variant="outline"
|
|
127
|
-
icon={ExternalLink}
|
|
128
|
-
iconEnd
|
|
129
|
-
fullWidth
|
|
130
|
-
onClick={() =>
|
|
131
|
-
window.open('https://donotdev.com', '_blank', 'noopener,noreferrer')
|
|
132
|
-
}
|
|
133
|
-
tooltip="https://donotdev.com"
|
|
134
|
-
>
|
|
135
|
-
Check it more online
|
|
136
|
-
</Button>
|
|
137
|
-
}
|
|
138
|
-
/>
|
|
139
|
-
</>
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
// apps/demo/src/pages/components/DemoLayout.tsx
|
|
2
|
-
|
|
3
|
-
import { useState, useEffect } from 'react';
|
|
4
|
-
import type { ChangeEvent } from 'react';
|
|
5
|
-
import { useLocation, useNavigate, Outlet } from 'react-router-dom';
|
|
6
|
-
import { ArrowLeft, ExternalLink, Menu } from 'lucide-react';
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
Button,
|
|
10
|
-
Input,
|
|
11
|
-
Stack,
|
|
12
|
-
Tabs,
|
|
13
|
-
Text,
|
|
14
|
-
Sheet,
|
|
15
|
-
Grid,
|
|
16
|
-
GridArea,
|
|
17
|
-
} from '@donotdev/components';
|
|
18
|
-
import type { TextProps } from '@donotdev/components';
|
|
19
|
-
|
|
20
|
-
import { getCSSFamilies } from './componentConfig';
|
|
21
|
-
import type { CSSFamily } from './ComponentsData';
|
|
22
|
-
import { ThemeToggle } from '../../components/ThemeToggle';
|
|
23
|
-
|
|
24
|
-
function useMediaQuery(query: string) {
|
|
25
|
-
const [matches, setMatches] = useState(false);
|
|
26
|
-
useEffect(() => {
|
|
27
|
-
const media = window.matchMedia(query);
|
|
28
|
-
if (media.matches !== matches) setMatches(media.matches);
|
|
29
|
-
const listener = () => setMatches(media.matches);
|
|
30
|
-
media.addEventListener('change', listener);
|
|
31
|
-
return () => media.removeEventListener('change', listener);
|
|
32
|
-
}, [matches, query]);
|
|
33
|
-
return matches;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
interface DemoLayoutProps {
|
|
37
|
-
selectedTab: CSSFamily | 'all';
|
|
38
|
-
onTabChange: (tab: CSSFamily | 'all') => void;
|
|
39
|
-
searchQuery: string;
|
|
40
|
-
onSearchChange: (query: string) => void;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
export function DemoLayout({
|
|
44
|
-
selectedTab,
|
|
45
|
-
onTabChange,
|
|
46
|
-
searchQuery,
|
|
47
|
-
onSearchChange,
|
|
48
|
-
}: DemoLayoutProps) {
|
|
49
|
-
const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false);
|
|
50
|
-
const location = useLocation();
|
|
51
|
-
const navigate = useNavigate();
|
|
52
|
-
const isLaptop = useMediaQuery('(min-width: 1024px)');
|
|
53
|
-
|
|
54
|
-
const handleBack = () => {
|
|
55
|
-
if (location.pathname === '/full') {
|
|
56
|
-
navigate('/');
|
|
57
|
-
} else if (location.pathname.startsWith('/component/')) {
|
|
58
|
-
navigate('/');
|
|
59
|
-
} else if (selectedTab !== 'all') {
|
|
60
|
-
onTabChange('all');
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
const showBackButton =
|
|
65
|
-
location.pathname === '/full' ||
|
|
66
|
-
location.pathname.startsWith('/component/') ||
|
|
67
|
-
selectedTab !== 'all';
|
|
68
|
-
|
|
69
|
-
const SidebarContent = (
|
|
70
|
-
<Stack gap="large" className="dndev-h-full">
|
|
71
|
-
<Stack gap="tight">
|
|
72
|
-
<Text as="h1">
|
|
73
|
-
DoNotDev
|
|
74
|
-
</Text>
|
|
75
|
-
<Text variant="muted">Components Showcase</Text>
|
|
76
|
-
</Stack>
|
|
77
|
-
|
|
78
|
-
<Stack gap="large" className="dndev-flex-1 dndev-min-h-0 dndev-overflow-y-auto">
|
|
79
|
-
<Input
|
|
80
|
-
placeholder="Filter components..."
|
|
81
|
-
value={searchQuery}
|
|
82
|
-
onChange={(e: ChangeEvent<HTMLInputElement>) => onSearchChange(e.target.value)}
|
|
83
|
-
/>
|
|
84
|
-
|
|
85
|
-
<Tabs
|
|
86
|
-
items={getCSSFamilies().map((family) => ({
|
|
87
|
-
value: family.id,
|
|
88
|
-
label: family.label,
|
|
89
|
-
className: 'dndev-w-full',
|
|
90
|
-
content: null,
|
|
91
|
-
}))}
|
|
92
|
-
value={selectedTab}
|
|
93
|
-
onValueChange={(value) => {
|
|
94
|
-
onTabChange(value as CSSFamily | 'all');
|
|
95
|
-
setIsMobileMenuOpen(false);
|
|
96
|
-
if (location.pathname !== '/') {
|
|
97
|
-
navigate('/');
|
|
98
|
-
}
|
|
99
|
-
}}
|
|
100
|
-
cols={1}
|
|
101
|
-
gap="tight"
|
|
102
|
-
/>
|
|
103
|
-
</Stack>
|
|
104
|
-
|
|
105
|
-
<Stack>
|
|
106
|
-
<Button
|
|
107
|
-
variant="primary"
|
|
108
|
-
fullWidth
|
|
109
|
-
icon={ExternalLink}
|
|
110
|
-
iconEnd
|
|
111
|
-
onClick={() =>
|
|
112
|
-
window.open(
|
|
113
|
-
'https://donotdev.com/purchase',
|
|
114
|
-
'_blank',
|
|
115
|
-
'noopener,noreferrer'
|
|
116
|
-
)
|
|
117
|
-
}
|
|
118
|
-
>
|
|
119
|
-
Get Full Framework
|
|
120
|
-
</Button>
|
|
121
|
-
<Button
|
|
122
|
-
variant="outline"
|
|
123
|
-
icon={ExternalLink}
|
|
124
|
-
iconEnd
|
|
125
|
-
fullWidth
|
|
126
|
-
onClick={() =>
|
|
127
|
-
window.open('https://donotdev.com', '_blank', 'noopener,noreferrer')
|
|
128
|
-
}
|
|
129
|
-
>
|
|
130
|
-
Check it more online
|
|
131
|
-
</Button>
|
|
132
|
-
</Stack>
|
|
133
|
-
</Stack>
|
|
134
|
-
);
|
|
135
|
-
|
|
136
|
-
function lowerCase(label: string): "body" | "code" | "small" | "heading" | "default" | "muted" | "primary" | "secondary" | undefined {
|
|
137
|
-
throw new Error('Function not implemented.');
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
return (
|
|
141
|
-
<Grid
|
|
142
|
-
className="dndev-h-screen dndev-w-full dndev-overflow-hidden"
|
|
143
|
-
cols={isLaptop ? '280px 1fr' : '1fr'}
|
|
144
|
-
areas={isLaptop ? 'sidebar main' : 'main'}
|
|
145
|
-
gap="none"
|
|
146
|
-
>
|
|
147
|
-
{isLaptop && (
|
|
148
|
-
<GridArea
|
|
149
|
-
name="sidebar"
|
|
150
|
-
style={{
|
|
151
|
-
padding: 'var(--gap-sm) var(--gap-md)',
|
|
152
|
-
overflowY: 'auto',
|
|
153
|
-
background: 'var(--background)',
|
|
154
|
-
borderRadius: 0,
|
|
155
|
-
borderInlineEnd: 'var(--border-hairline) solid var(--border)',
|
|
156
|
-
}}
|
|
157
|
-
>
|
|
158
|
-
{SidebarContent}
|
|
159
|
-
</GridArea>
|
|
160
|
-
)}
|
|
161
|
-
|
|
162
|
-
<GridArea name="main" className="dndev-h-full dndev-overflow-hidden">
|
|
163
|
-
<Stack className="dndev-h-full" gap="none">
|
|
164
|
-
{/* Header */}
|
|
165
|
-
<Grid
|
|
166
|
-
cols="1fr auto 1fr"
|
|
167
|
-
align="center"
|
|
168
|
-
style={{
|
|
169
|
-
padding: 'var(--gap-sm) var(--gap-md)',
|
|
170
|
-
background: 'var(--background)',
|
|
171
|
-
flexShrink: 0,
|
|
172
|
-
borderRadius: 0,
|
|
173
|
-
borderBottom: 'var(--border-hairline) solid var(--border)',
|
|
174
|
-
}}
|
|
175
|
-
>
|
|
176
|
-
<Stack direction="row" align="center" justify="start">
|
|
177
|
-
<Button
|
|
178
|
-
variant="ghost"
|
|
179
|
-
icon={ArrowLeft}
|
|
180
|
-
onClick={showBackButton ? handleBack : undefined}
|
|
181
|
-
disabled={!showBackButton}
|
|
182
|
-
className={!showBackButton ? 'dndev-opacity-0' : ''}
|
|
183
|
-
aria-hidden={!showBackButton}
|
|
184
|
-
>
|
|
185
|
-
Back
|
|
186
|
-
</Button>
|
|
187
|
-
</Stack>
|
|
188
|
-
|
|
189
|
-
<Stack align="center" gap="tight">
|
|
190
|
-
<Text variant="muted" level="body">
|
|
191
|
-
We use a high contrast theme to demonstrate component usage. Update themes.css to customize.
|
|
192
|
-
</Text>
|
|
193
|
-
<Grid cols={4} gap="tight">
|
|
194
|
-
{[
|
|
195
|
-
{ label: 'Foreground', color: 'var(--foreground)', border: true },
|
|
196
|
-
{ label: 'Primary', color: 'var(--primary)' },
|
|
197
|
-
{ label: 'Secondary', color: 'var(--secondary)' },
|
|
198
|
-
{ label: 'Accent', color: 'var(--accent)' },
|
|
199
|
-
].map((item) => (
|
|
200
|
-
<Stack
|
|
201
|
-
key={item.label}
|
|
202
|
-
direction="row"
|
|
203
|
-
gap="tight"
|
|
204
|
-
align="center"
|
|
205
|
-
>
|
|
206
|
-
<span
|
|
207
|
-
style={{
|
|
208
|
-
width: '20px',
|
|
209
|
-
height: '20px',
|
|
210
|
-
background: item.color
|
|
211
|
-
}}
|
|
212
|
-
/>
|
|
213
|
-
<Text
|
|
214
|
-
level="small"
|
|
215
|
-
style={{ color: item.color }}
|
|
216
|
-
>
|
|
217
|
-
{item.label}
|
|
218
|
-
</Text>
|
|
219
|
-
</Stack>
|
|
220
|
-
))}
|
|
221
|
-
</Grid>
|
|
222
|
-
</Stack>
|
|
223
|
-
|
|
224
|
-
{/* Right side: Theme Toggle + Mobile Menu */}
|
|
225
|
-
<Stack direction="row" justify="end" align="center">
|
|
226
|
-
<ThemeToggle />
|
|
227
|
-
{!isLaptop && (
|
|
228
|
-
<Sheet
|
|
229
|
-
open={isMobileMenuOpen}
|
|
230
|
-
onOpenChange={setIsMobileMenuOpen}
|
|
231
|
-
side="left"
|
|
232
|
-
trigger={
|
|
233
|
-
<Button
|
|
234
|
-
variant="ghost"
|
|
235
|
-
display="compact"
|
|
236
|
-
aria-label="Open menu"
|
|
237
|
-
icon={Menu}
|
|
238
|
-
/>
|
|
239
|
-
}
|
|
240
|
-
title="Components"
|
|
241
|
-
>
|
|
242
|
-
{SidebarContent}
|
|
243
|
-
</Sheet>
|
|
244
|
-
)}
|
|
245
|
-
</Stack>
|
|
246
|
-
</Grid>
|
|
247
|
-
|
|
248
|
-
{/* Content */}
|
|
249
|
-
<div
|
|
250
|
-
className="dndev-flex-1 dndev-overflow-y-auto dndev-w-full"
|
|
251
|
-
style={{ padding: 'var(--gap-md)' }}
|
|
252
|
-
>
|
|
253
|
-
<Outlet
|
|
254
|
-
context={{
|
|
255
|
-
selectedTab,
|
|
256
|
-
setSelectedTab: onTabChange,
|
|
257
|
-
searchQuery,
|
|
258
|
-
setSearchQuery: onSearchChange,
|
|
259
|
-
}}
|
|
260
|
-
/>
|
|
261
|
-
</div>
|
|
262
|
-
</Stack>
|
|
263
|
-
</GridArea>
|
|
264
|
-
</Grid>
|
|
265
|
-
);
|
|
266
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
// apps/demo/src/pages/components/LayoutRoute.tsx
|
|
2
|
-
|
|
3
|
-
import { useState } from 'react';
|
|
4
|
-
|
|
5
|
-
import { DemoLayout } from './DemoLayout';
|
|
6
|
-
import type { CSSFamily } from './ComponentsData';
|
|
7
|
-
|
|
8
|
-
export function LayoutRoute() {
|
|
9
|
-
const [selectedTab, setSelectedTab] = useState<CSSFamily | 'all'>('all');
|
|
10
|
-
const [searchQuery, setSearchQuery] = useState('');
|
|
11
|
-
|
|
12
|
-
return (
|
|
13
|
-
<DemoLayout
|
|
14
|
-
selectedTab={selectedTab}
|
|
15
|
-
onTabChange={setSelectedTab}
|
|
16
|
-
searchQuery={searchQuery}
|
|
17
|
-
onSearchChange={setSearchQuery}
|
|
18
|
-
/>
|
|
19
|
-
);
|
|
20
|
-
}
|