@djangocfg/layouts 1.4.18 → 1.4.20
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/README.md
CHANGED
|
@@ -1,27 +1,52 @@
|
|
|
1
1
|
# @djangocfg/layouts
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> Pre-built dashboard layouts, authentication pages, and admin templates for Next.js applications with Tailwind CSS
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@djangocfg/layouts)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
- **Layout Components** - Public, Private, Auth layouts
|
|
9
|
-
- **Shared Components** - SEO, Navigation, Footer, Sidebar
|
|
10
|
-
- **Auth Hooks** - Authentication utilities
|
|
8
|
+
**Part of [DjangoCFG](https://djangocfg.com)** — a modern Django framework for building production-ready SaaS applications. All `@djangocfg/*` packages are designed to work together, providing type-safe configuration, real-time features, and beautiful admin interfaces out of the box.
|
|
11
9
|
|
|
12
|
-
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
## Overview
|
|
13
|
+
|
|
14
|
+
`@djangocfg/layouts` provides production-ready layout components for building admin dashboards, authentication flows, and application shells. Built with Next.js App Router and Tailwind CSS.
|
|
15
|
+
|
|
16
|
+
## Features
|
|
17
|
+
|
|
18
|
+
- **Dashboard Layouts** - Sidebar, header, and content area components
|
|
19
|
+
- **Auth Pages** - Login, register, forgot password templates
|
|
20
|
+
- **Auto Route Detection** - Automatically applies correct layout
|
|
21
|
+
- **Responsive Design** - Mobile-first responsive layouts
|
|
22
|
+
- **Authentication Context** - Built-in auth state management
|
|
23
|
+
- **Video Player** - Integrated Vidstack player components
|
|
24
|
+
- **SEO Component** - OG image generation, meta tags
|
|
25
|
+
- **TypeScript** - Full type safety
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @djangocfg/layouts
|
|
31
|
+
# or
|
|
32
|
+
pnpm add @djangocfg/layouts
|
|
33
|
+
# or
|
|
34
|
+
yarn add @djangocfg/layouts
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
13
38
|
|
|
14
39
|
### Basic Setup
|
|
15
40
|
|
|
16
41
|
```tsx
|
|
17
|
-
//
|
|
42
|
+
// app/layout.tsx
|
|
18
43
|
import { AppLayout } from '@djangocfg/layouts';
|
|
19
44
|
import { appLayoutConfig } from '@/core';
|
|
20
45
|
|
|
21
|
-
export default function
|
|
46
|
+
export default function RootLayout({ children }) {
|
|
22
47
|
return (
|
|
23
48
|
<AppLayout config={appLayoutConfig}>
|
|
24
|
-
|
|
49
|
+
{children}
|
|
25
50
|
</AppLayout>
|
|
26
51
|
);
|
|
27
52
|
}
|
|
@@ -55,14 +80,34 @@ export const appLayoutConfig: AppLayoutConfig = {
|
|
|
55
80
|
};
|
|
56
81
|
```
|
|
57
82
|
|
|
58
|
-
|
|
83
|
+
### Authentication
|
|
59
84
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
- **Type Safe** - Full TypeScript support
|
|
85
|
+
```tsx
|
|
86
|
+
import { AuthProvider, useAuth } from '@djangocfg/layouts/auth';
|
|
87
|
+
import { LoginForm } from '@djangocfg/layouts/auth';
|
|
64
88
|
|
|
65
|
-
|
|
89
|
+
function App() {
|
|
90
|
+
return (
|
|
91
|
+
<AuthProvider>
|
|
92
|
+
<LoginForm onSuccess={handleLogin} />
|
|
93
|
+
</AuthProvider>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Exports
|
|
99
|
+
|
|
100
|
+
| Path | Description |
|
|
101
|
+
|------|-------------|
|
|
102
|
+
| `@djangocfg/layouts` | Main exports |
|
|
103
|
+
| `@djangocfg/layouts/layouts` | Layout components |
|
|
104
|
+
| `@djangocfg/layouts/auth` | Auth components and context |
|
|
105
|
+
| `@djangocfg/layouts/auth/hooks` | Auth hooks |
|
|
106
|
+
| `@djangocfg/layouts/snippets` | Reusable code snippets |
|
|
107
|
+
| `@djangocfg/layouts/utils` | Utility functions |
|
|
108
|
+
| `@djangocfg/layouts/styles` | CSS stylesheets |
|
|
109
|
+
|
|
110
|
+
## Available Layouts
|
|
66
111
|
|
|
67
112
|
- **PublicLayout** - For public pages (landing, docs)
|
|
68
113
|
- **PrivateLayout** - For authenticated pages (dashboard)
|
|
@@ -75,3 +120,21 @@ export const appLayoutConfig: AppLayoutConfig = {
|
|
|
75
120
|
- `Footer` - Configurable footer
|
|
76
121
|
- `Sidebar` - Dashboard sidebar
|
|
77
122
|
- `Navigation` - Header navigation
|
|
123
|
+
|
|
124
|
+
## Requirements
|
|
125
|
+
|
|
126
|
+
- Next.js >= 15.4.4
|
|
127
|
+
- React >= 19.1.0
|
|
128
|
+
- Tailwind CSS >= 4.0.0
|
|
129
|
+
|
|
130
|
+
## Documentation
|
|
131
|
+
|
|
132
|
+
Full documentation available at [djangocfg.com](https://djangocfg.com)
|
|
133
|
+
|
|
134
|
+
## Contributing
|
|
135
|
+
|
|
136
|
+
Issues and pull requests are welcome at [GitHub](https://github.com/markolofsen/django-cfg)
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
MIT - see [LICENSE](./LICENSE) for details
|
package/package.json
CHANGED
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@djangocfg/layouts",
|
|
3
|
-
"version": "1.4.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "1.4.20",
|
|
4
|
+
"description": "Pre-built dashboard layouts, authentication pages, and admin templates for Next.js applications with Tailwind CSS",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"layouts",
|
|
7
|
+
"dashboard",
|
|
8
|
+
"admin-panel",
|
|
9
|
+
"authentication",
|
|
10
|
+
"nextjs",
|
|
11
|
+
"react",
|
|
12
|
+
"tailwindcss",
|
|
13
|
+
"typescript",
|
|
14
|
+
"django",
|
|
15
|
+
"templates",
|
|
16
|
+
"ui-kit"
|
|
17
|
+
],
|
|
5
18
|
"author": {
|
|
6
19
|
"name": "DjangoCFG",
|
|
7
20
|
"url": "https://djangocfg.com"
|
|
8
21
|
},
|
|
22
|
+
"homepage": "https://djangocfg.com",
|
|
23
|
+
"repository": {
|
|
24
|
+
"type": "git",
|
|
25
|
+
"url": "https://github.com/markolofsen/django-cfg.git",
|
|
26
|
+
"directory": "packages/layouts"
|
|
27
|
+
},
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/markolofsen/django-cfg/issues"
|
|
30
|
+
},
|
|
9
31
|
"license": "MIT",
|
|
10
32
|
"main": "./src/index.ts",
|
|
11
33
|
"types": "./src/index.ts",
|
|
@@ -63,9 +85,9 @@
|
|
|
63
85
|
"check": "tsc --noEmit"
|
|
64
86
|
},
|
|
65
87
|
"peerDependencies": {
|
|
66
|
-
"@djangocfg/api": "^1.4.
|
|
67
|
-
"@djangocfg/og-image": "^1.4.
|
|
68
|
-
"@djangocfg/ui": "^1.4.
|
|
88
|
+
"@djangocfg/api": "^1.4.20",
|
|
89
|
+
"@djangocfg/og-image": "^1.4.20",
|
|
90
|
+
"@djangocfg/ui": "^1.4.20",
|
|
69
91
|
"@hookform/resolvers": "^5.2.0",
|
|
70
92
|
"consola": "^3.4.2",
|
|
71
93
|
"lucide-react": "^0.468.0",
|
|
@@ -86,11 +108,14 @@
|
|
|
86
108
|
"vidstack": "0.6.15"
|
|
87
109
|
},
|
|
88
110
|
"devDependencies": {
|
|
89
|
-
"@djangocfg/typescript-config": "^1.4.
|
|
111
|
+
"@djangocfg/typescript-config": "^1.4.20",
|
|
90
112
|
"@types/node": "^24.7.2",
|
|
91
113
|
"@types/react": "19.2.2",
|
|
92
114
|
"@types/react-dom": "19.2.1",
|
|
93
115
|
"eslint": "^9.37.0",
|
|
94
116
|
"typescript": "^5.9.3"
|
|
117
|
+
},
|
|
118
|
+
"publishConfig": {
|
|
119
|
+
"access": "public"
|
|
95
120
|
}
|
|
96
121
|
}
|
|
@@ -48,7 +48,10 @@ export interface CoreProvidersProps {
|
|
|
48
48
|
*/
|
|
49
49
|
export function CoreProviders({ children, config, validation, cors, network, onError }: CoreProvidersProps) {
|
|
50
50
|
return (
|
|
51
|
-
<ThemeProvider
|
|
51
|
+
<ThemeProvider
|
|
52
|
+
defaultTheme={config.theme?.defaultTheme}
|
|
53
|
+
storageKey={config.theme?.storageKey}
|
|
54
|
+
>
|
|
52
55
|
<AuthProvider
|
|
53
56
|
config={{
|
|
54
57
|
apiUrl: config.api.baseUrl,
|
|
@@ -24,6 +24,14 @@ export interface AppLayoutConfig {
|
|
|
24
24
|
};
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
/** Theme configuration */
|
|
28
|
+
theme?: {
|
|
29
|
+
/** Default theme (default: 'light') */
|
|
30
|
+
defaultTheme?: 'light' | 'dark';
|
|
31
|
+
/** Storage key for theme persistence (default: 'theme') */
|
|
32
|
+
storageKey?: string;
|
|
33
|
+
};
|
|
34
|
+
|
|
27
35
|
/** API configuration */
|
|
28
36
|
api: {
|
|
29
37
|
baseUrl: string;
|