@manago/admin 0.1.0 → 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/README.md CHANGED
@@ -1,17 +1,17 @@
1
1
  # @manago/admin
2
2
 
3
- A beautiful, fully-featured admin dashboard component library for Next.js built with shadcn/ui, TanStack Router, and Tailwind CSS.
3
+ A plug-and-play admin interface for e-commerce applications. Install once, configure minimally, and get a fully-featured admin panel.
4
+
5
+ > 🚀 **[Quick Start Guide](QUICK_START.md)** - Get started in less than 5 minutes!
4
6
 
5
7
  ## Features
6
8
 
7
- - 🎨 Beautiful UI components built with shadcn/ui
8
- - 🚀 Built for Next.js 15+ with React 19
9
- - 📱 Fully responsive with mobile support
10
- - 🎯 Type-safe with TypeScript
11
- - 🔐 Built-in authentication with Zustand
12
- - 🎭 Collapsible sidebar with icon mode
13
- - 🌐 Client-side routing with TanStack Router
14
- - ⚡ Fast and optimized with tsup
9
+ - 🎨 **Pre-built UI** - Beautiful, responsive admin interface
10
+ - 🔌 **Framework Agnostic** - Works with Next.js, React Router, TanStack Router
11
+ - ⚙️ **Minimal Configuration** - Just install and configure
12
+ - 🎯 **Type Safe** - Full TypeScript support
13
+ - 🎨 **Customizable** - Configure menu items, branding, and more
14
+ - 📦 **Zero UI Lock-in** - All components are accessible for custom implementations
15
15
 
16
16
  ## Installation
17
17
 
@@ -23,142 +23,280 @@ pnpm add @manago/admin
23
23
  yarn add @manago/admin
24
24
  ```
25
25
 
26
- ### Peer Dependencies
26
+ ## Quick Start
27
27
 
28
- Make sure you have these installed:
28
+ ### Next.js (App Router)
29
29
 
30
- ```bash
31
- npm install next@^15.0.0 react@^19.0.0 react-dom@^19.0.0
32
- ```
30
+ 1. Create a catch-all route at `app/admin/[[...slug]]/page.tsx`:
31
+
32
+ ```tsx
33
+ 'use client'
33
34
 
34
- ## Usage
35
+ import { ManagoAdmin } from '@manago/admin/nextjs'
36
+ import '@manago/admin/index.css'
37
+
38
+ export default function AdminPage() {
39
+ return (
40
+ <ManagoAdmin
41
+ apiKey={process.env.NEXT_PUBLIC_MANAGO_API_KEY!}
42
+ config={{
43
+ appName: 'My Store',
44
+ }}
45
+ />
46
+ )
47
+ }
48
+ ```
35
49
 
36
- ### Basic Setup
50
+ 2. That's it! Visit `/admin` to see your admin panel.
37
51
 
38
- 1. Import the styles in your root layout:
52
+ ### React Router v6
39
53
 
40
54
  ```tsx
41
- // app/layout.tsx
42
- import "@manago/admin/styles";
55
+ // routes/admin.tsx
56
+ import { Routes, Route } from 'react-router-dom'
57
+ import { ManagoAdmin } from '@manago/admin/react-router'
58
+ import '@manago/admin/index.css'
59
+
60
+ export function AdminRoute() {
61
+ return (
62
+ <Route
63
+ path="/admin/*"
64
+ element={
65
+ <ManagoAdmin
66
+ apiKey={process.env.REACT_APP_MANAGO_API_KEY!}
67
+ config={{
68
+ appName: 'My Store',
69
+ }}
70
+ />
71
+ }
72
+ />
73
+ )
74
+ }
43
75
  ```
44
76
 
45
- 2. Create an admin page with catch-all routes:
77
+ ### TanStack Router
46
78
 
47
79
  ```tsx
48
- // app/admin/[[...slug]]/page.tsx
49
- 'use client'
80
+ import { ManagoAdmin } from '@manago/admin/tanstack'
81
+ import '@manago/admin/index.css'
50
82
 
51
- import { ManagoProvider, ManagoAdmin } from '@manago/admin'
52
-
53
- export default function AdminPage() {
83
+ function App() {
54
84
  return (
55
- <ManagoProvider
56
- apiKey={process.env.NEXT_PUBLIC_MANAGO_API_KEY!}
85
+ <ManagoAdmin
86
+ apiKey={import.meta.env.VITE_MANAGO_API_KEY}
57
87
  config={{
58
- appName: 'My Admin Dashboard',
59
- menu: {
60
- users: false, // Hide specific menu items
61
- },
88
+ appName: 'My Store',
62
89
  }}
63
- >
64
- <ManagoAdmin />
65
- </ManagoProvider>
90
+ basePath="/admin"
91
+ />
66
92
  )
67
93
  }
68
94
  ```
69
95
 
70
- ### Configuration
96
+ ## Configuration
97
+
98
+ ### Menu Customization
99
+
100
+ Hide or show specific menu items:
71
101
 
72
102
  ```tsx
73
- <ManagoProvider
103
+ <ManagoAdmin
74
104
  apiKey="your-api-key"
75
105
  config={{
76
- appName: 'My Store Admin',
77
- logo: '/logo.png', // or React component
106
+ appName: 'My Store',
78
107
  menu: {
79
- dashboard: true,
80
- products: true,
81
- orders: true,
82
- customers: true,
83
- payments: true,
84
- users: false,
85
- settings: true,
108
+ dashboard: true, // Show (default)
109
+ orders: true, // Show (default)
110
+ customers: false, // Hide
111
+ products: true, // Show (default)
112
+ settings: true, // Show (default)
86
113
  },
87
- customMenuItems: [
88
- {
89
- href: '/analytics',
90
- label: 'Analytics',
91
- icon: '📊',
92
- },
93
- ],
94
114
  }}
95
- >
96
- <ManagoAdmin />
97
- </ManagoProvider>
115
+ />
98
116
  ```
99
117
 
100
- ## Features
118
+ ### Branding
119
+
120
+ Customize the appearance:
101
121
 
102
- ### Dashboard
103
- - Real-time statistics
104
- - Recent orders and products
105
- - Beautiful cards and charts
122
+ ```tsx
123
+ <ManagoAdmin
124
+ apiKey="your-api-key"
125
+ config={{
126
+ appName: 'My Awesome Store',
127
+ theme: {
128
+ primaryColor: '#3b82f6',
129
+ logo: '/path/to/logo.png',
130
+ },
131
+ }}
132
+ />
133
+ ```
106
134
 
107
- ### Sidebar Navigation
108
- - Collapsible to icon mode
109
- - Active state highlighting
110
- - Custom menu items support
111
- - Mobile-responsive
135
+ ### API Endpoint
112
136
 
113
- ### Authentication
114
- - Built-in login page
115
- - Persistent authentication with Zustand
116
- - Protected routes
137
+ Configure the API endpoint for data fetching:
117
138
 
118
- ## Styling
139
+ ```tsx
140
+ <ManagoAdmin
141
+ apiKey="your-api-key"
142
+ config={{
143
+ appName: 'My Store',
144
+ apiEndpoint: 'https://api.mystore.com',
145
+ }}
146
+ />
147
+ ```
119
148
 
120
- The package uses Tailwind CSS v4. Make sure your project has Tailwind CSS configured.
149
+ ## Available Pages
121
150
 
122
- The styles are automatically imported when you import `@manago/admin/styles`.
151
+ The admin interface includes these pages out of the box:
123
152
 
124
- ## API
153
+ - **Dashboard** (`/admin`) - Overview with key metrics
154
+ - **Orders** (`/admin/orders`) - Order management
155
+ - **Customers** (`/admin/customers`) - Customer management
156
+ - **Products** (`/admin/products`) - Product management (coming soon)
157
+ - **Settings** (`/admin/settings`) - Application settings
125
158
 
126
- ### Components
159
+ ## Advanced Usage
127
160
 
128
- - `ManagoProvider` - Main provider component
129
- - `ManagoAdmin` - Admin dashboard component
161
+ ### Custom Implementation
130
162
 
131
- ### Configuration Options
163
+ If you need more control, you can use the core components directly:
132
164
 
133
- ```typescript
134
- interface AdminConfig {
135
- appName?: string
136
- logo?: string | React.ReactNode
137
- menu?: {
138
- dashboard?: boolean
139
- products?: boolean
140
- orders?: boolean
141
- customers?: boolean
142
- payments?: boolean
143
- users?: boolean
144
- settings?: boolean
165
+ ```tsx
166
+ import {
167
+ ManagoProvider,
168
+ Layout,
169
+ Dashboard,
170
+ useNavigation
171
+ } from '@manago/admin'
172
+ import '@manago/admin/index.css'
173
+
174
+ function CustomAdmin() {
175
+ const navigate = (path: string) => {
176
+ // Your custom navigation logic
145
177
  }
146
- customMenuItems?: Array<{
147
- href: string
148
- label: string
149
- icon: string
150
- }>
178
+
179
+ return (
180
+ <ManagoProvider
181
+ apiKey="your-api-key"
182
+ config={{ appName: 'My Store' }}
183
+ navigate={navigate}
184
+ currentPath="/admin"
185
+ >
186
+ <Layout>
187
+ <Dashboard />
188
+ </Layout>
189
+ </ManagoProvider>
190
+ )
151
191
  }
152
192
  ```
153
193
 
154
- ## License
194
+ ### Available Exports
155
195
 
156
- MIT
196
+ #### Framework Adapters
197
+ - `@manago/admin/nextjs` - Next.js App Router adapter
198
+ - `@manago/admin/react-router` - React Router v6 adapter
199
+ - `@manago/admin/tanstack` - TanStack Router adapter
200
+
201
+ #### Core Components (from `@manago/admin`)
202
+ - `ManagoProvider` - Context provider
203
+ - `Layout` - Main layout component
204
+ - `Sidebar` - Navigation sidebar
205
+ - `Header` - Top header
206
+ - `Dashboard` - Dashboard page
207
+ - `Orders` - Orders page
208
+ - `Customers` - Customers page
209
+ - `Products` - Products page
210
+ - `Settings` - Settings page
211
+
212
+ #### Hooks
213
+ - `useManago()` - Access config and API key
214
+ - `useNavigation()` - Framework-agnostic navigation
215
+
216
+ ## TypeScript
217
+
218
+ Full TypeScript support with exported types:
219
+
220
+ ```tsx
221
+ import type { ManagoConfig, ManagoContextType, MenuItem } from '@manago/admin'
222
+
223
+ const config: ManagoConfig = {
224
+ appName: 'My Store',
225
+ menu: {
226
+ customers: false,
227
+ },
228
+ }
229
+ ```
230
+
231
+ ## Styling
232
+
233
+ The package uses Tailwind CSS with a `mng-` prefix to avoid conflicts with your existing styles. All styles are scoped and won't interfere with your application.
234
+
235
+ ## Browser Support
236
+
237
+ - Chrome (latest)
238
+ - Firefox (latest)
239
+ - Safari (latest)
240
+ - Edge (latest)
241
+
242
+ ## Development
157
243
 
158
- ## Author
244
+ ### Available Scripts
159
245
 
160
- Your Name
246
+ ```bash
247
+ # Build the package
248
+ pnpm build
249
+
250
+ # Development mode with watch
251
+ pnpm dev
252
+
253
+ # Test the package locally
254
+ pnpm pack:test
255
+
256
+ # Publishing (requires npm login)
257
+ pnpm release:patch # 0.1.0 → 0.1.1 (bug fixes)
258
+ pnpm release:minor # 0.1.0 → 0.2.0 (new features)
259
+ pnpm release:major # 0.1.0 → 1.0.0 (breaking changes)
260
+ pnpm release:beta # 0.1.0 → 0.1.1-beta.0 (pre-release)
261
+ ```
262
+
263
+ ### Local Testing
264
+
265
+ To test the package locally before publishing:
266
+
267
+ ```bash
268
+ # In the package directory
269
+ pnpm pack:test
270
+
271
+ # This creates a .tgz file
272
+ # Install it in your test project:
273
+ npm install /path/to/manago-admin-0.1.0.tgz
274
+ ```
275
+
276
+ Or use npm link:
277
+
278
+ ```bash
279
+ # In the package directory
280
+ npm link
281
+
282
+ # In your test project
283
+ npm link @manago/admin
284
+ ```
285
+
286
+ ## Roadmap
287
+
288
+ - [ ] More page components (Products, Analytics, etc.)
289
+ - [ ] Real API integration
290
+ - [ ] Data fetching hooks
291
+ - [ ] Form components
292
+ - [ ] Advanced filtering and search
293
+ - [ ] Export functionality
294
+ - [ ] Multi-language support
295
+
296
+ ## License
297
+
298
+ MIT
161
299
 
162
- ## Contributing
300
+ ## Support
163
301
 
164
- Contributions are welcome! Please open an issue or submit a pull request.
302
+ For issues and feature requests, please visit [GitHub Issues](https://github.com/manago/admin/issues).
@@ -0,0 +1,44 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface ManagoConfig {
5
+ appName: string;
6
+ menu?: {
7
+ dashboard?: boolean;
8
+ orders?: boolean;
9
+ customers?: boolean;
10
+ products?: boolean;
11
+ settings?: boolean;
12
+ users?: boolean;
13
+ };
14
+ theme?: {
15
+ primaryColor?: string;
16
+ logo?: string;
17
+ };
18
+ apiEndpoint?: string;
19
+ }
20
+ interface ManagoContextType {
21
+ apiKey: string;
22
+ config: ManagoConfig;
23
+ navigate: (path: string) => void;
24
+ currentPath: string;
25
+ }
26
+ interface MenuItem {
27
+ id: string;
28
+ label: string;
29
+ path: string;
30
+ icon?: React.ReactNode;
31
+ hidden?: boolean;
32
+ }
33
+
34
+ interface ManagoProviderProps {
35
+ children: ReactNode;
36
+ apiKey: string;
37
+ config: ManagoConfig;
38
+ navigate: (path: string) => void;
39
+ currentPath: string;
40
+ }
41
+ declare const ManagoProvider: ({ children, apiKey, config, navigate, currentPath, }: ManagoProviderProps) => react_jsx_runtime.JSX.Element;
42
+ declare const useManago: () => ManagoContextType;
43
+
44
+ export { ManagoProvider as M, type ManagoConfig as a, type ManagoContextType as b, type MenuItem as c, useManago as u };
@@ -0,0 +1,44 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface ManagoConfig {
5
+ appName: string;
6
+ menu?: {
7
+ dashboard?: boolean;
8
+ orders?: boolean;
9
+ customers?: boolean;
10
+ products?: boolean;
11
+ settings?: boolean;
12
+ users?: boolean;
13
+ };
14
+ theme?: {
15
+ primaryColor?: string;
16
+ logo?: string;
17
+ };
18
+ apiEndpoint?: string;
19
+ }
20
+ interface ManagoContextType {
21
+ apiKey: string;
22
+ config: ManagoConfig;
23
+ navigate: (path: string) => void;
24
+ currentPath: string;
25
+ }
26
+ interface MenuItem {
27
+ id: string;
28
+ label: string;
29
+ path: string;
30
+ icon?: React.ReactNode;
31
+ hidden?: boolean;
32
+ }
33
+
34
+ interface ManagoProviderProps {
35
+ children: ReactNode;
36
+ apiKey: string;
37
+ config: ManagoConfig;
38
+ navigate: (path: string) => void;
39
+ currentPath: string;
40
+ }
41
+ declare const ManagoProvider: ({ children, apiKey, config, navigate, currentPath, }: ManagoProviderProps) => react_jsx_runtime.JSX.Element;
42
+ declare const useManago: () => ManagoContextType;
43
+
44
+ export { ManagoProvider as M, type ManagoConfig as a, type ManagoContextType as b, type MenuItem as c, useManago as u };
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { a as ManagoConfig } from '../../ManagoProvider-DtovqU61.mjs';
3
+ export { u as useManago } from '../../ManagoProvider-DtovqU61.mjs';
4
+ import 'react';
5
+
6
+ interface ManagoAdminProps {
7
+ apiKey: string;
8
+ config: ManagoConfig;
9
+ basePath?: string;
10
+ }
11
+ /**
12
+ * Next.js App Router adapter for Manago Admin
13
+ *
14
+ * Usage:
15
+ * Create app/admin/[[...slug]]/page.tsx with:
16
+ *
17
+ * 'use client'
18
+ * import { ManagoAdmin } from '@manago/admin/nextjs'
19
+ *
20
+ * export default function AdminPage() {
21
+ * return <ManagoAdmin apiKey="..." config={{ appName: "My Store" }} />
22
+ * }
23
+ */
24
+ declare const ManagoAdmin: ({ apiKey, config, basePath }: ManagoAdminProps) => react_jsx_runtime.JSX.Element | null;
25
+
26
+ export { ManagoAdmin, ManagoConfig };
@@ -0,0 +1,26 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { a as ManagoConfig } from '../../ManagoProvider-DtovqU61.js';
3
+ export { u as useManago } from '../../ManagoProvider-DtovqU61.js';
4
+ import 'react';
5
+
6
+ interface ManagoAdminProps {
7
+ apiKey: string;
8
+ config: ManagoConfig;
9
+ basePath?: string;
10
+ }
11
+ /**
12
+ * Next.js App Router adapter for Manago Admin
13
+ *
14
+ * Usage:
15
+ * Create app/admin/[[...slug]]/page.tsx with:
16
+ *
17
+ * 'use client'
18
+ * import { ManagoAdmin } from '@manago/admin/nextjs'
19
+ *
20
+ * export default function AdminPage() {
21
+ * return <ManagoAdmin apiKey="..." config={{ appName: "My Store" }} />
22
+ * }
23
+ */
24
+ declare const ManagoAdmin: ({ apiKey, config, basePath }: ManagoAdminProps) => react_jsx_runtime.JSX.Element | null;
25
+
26
+ export { ManagoAdmin, ManagoConfig };
@@ -0,0 +1,6 @@
1
+ "use strict";var z=Object.create;var f=Object.defineProperty;var G=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,F=Object.prototype.hasOwnProperty;var J=(e,t)=>{for(var s in t)f(e,s,{get:t[s],enumerable:!0})},D=(e,t,s,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let g of K(t))!F.call(e,g)&&g!==s&&f(e,g,{get:()=>t[g],enumerable:!(i=G(t,g))||i.enumerable});return e};var U=(e,t,s)=>(s=e!=null?z(B(e)):{},D(t||!e||!e.__esModule?f(s,"default",{value:e,enumerable:!0}):s,e)),q=e=>D(f({},"__esModule",{value:!0}),e);var Z={};J(Z,{ManagoAdmin:()=>L,useManago:()=>d});module.exports=q(Z);var N=require("react"),y=require("next/navigation");var h=U(require("react")),I=require("react/jsx-runtime"),v=(0,h.createContext)(void 0),k=({children:e,apiKey:t,config:s,navigate:i,currentPath:g})=>(0,I.jsx)(v.Provider,{value:{apiKey:t,config:s,navigate:i,currentPath:g},children:e}),d=()=>{let e=h.default.useContext(v);if(!e)throw new Error("useManago must be used within ManagoProvider");return e};var E=require("react");var j=()=>{let e=(0,E.useContext)(v);if(!e)throw new Error("useNavigation must be used within ManagoProvider");return{navigate:e.navigate,currentPath:e.currentPath,isActive:t=>t==="/"?e.currentPath==="/"||e.currentPath==="":e.currentPath.startsWith(t)}};var o=require("react/jsx-runtime"),Q=[{id:"dashboard",label:"Dashboard",path:"/"},{id:"orders",label:"Orders",path:"/orders"},{id:"customers",label:"Customers",path:"/customers"},{id:"products",label:"Products",path:"/products"},{id:"settings",label:"Settings",path:"/settings"}],T=()=>{let{config:e}=d(),{navigate:t,isActive:s}=j(),i=Q.filter(g=>(e.menu||{})[g.id]!==!1);return(0,o.jsxs)("aside",{className:"mng-w-64 mng-bg-slate-900 mng-text-white mng-flex mng-flex-col",children:[(0,o.jsx)("div",{className:"mng-p-6 mng-flex mng-items-center mng-gap-3",children:e.theme?.logo?(0,o.jsx)("img",{src:e.theme.logo,alt:e.appName,className:"mng-h-8"}):(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("div",{className:"mng-w-8 mng-h-8 mng-bg-blue-500 mng-rounded-md mng-flex mng-items-center mng-justify-center mng-font-bold",children:e.appName.charAt(0).toUpperCase()}),(0,o.jsx)("span",{className:"mng-text-xl mng-font-bold mng-tracking-tight",children:e.appName||"Manago"})]})}),(0,o.jsx)("nav",{className:"mng-flex-1 mng-px-3 mng-space-y-1",children:i.map(g=>(0,o.jsxs)("button",{onClick:()=>t(g.path),className:`
2
+ mng-w-full mng-flex mng-items-center mng-px-4 mng-py-2.5 mng-text-sm mng-rounded-lg
3
+ mng-transition-colors mng-text-left
4
+ ${s(g.path)?"mng-bg-blue-600 mng-text-white":"mng-text-slate-300 hover:mng-bg-slate-800 hover:mng-text-white"}
5
+ `,children:[g.icon&&(0,o.jsx)("span",{className:"mng-mr-3",children:g.icon}),g.label]},g.id))}),(0,o.jsx)("div",{className:"mng-p-4 mng-border-t mng-border-slate-800",children:(0,o.jsx)("p",{className:"mng-text-xs mng-text-slate-500 mng-text-center",children:"Powered by Manago"})})]})};var x=require("react/jsx-runtime"),W=({title:e="Admin Panel"})=>{let{config:t}=d();return(0,x.jsxs)("header",{className:"mng-h-16 mng-bg-white mng-border-b mng-border-slate-200 mng-flex mng-items-center mng-px-8 mng-justify-between",children:[(0,x.jsx)("h1",{className:"mng-text-sm mng-font-medium mng-text-slate-500",children:e}),(0,x.jsx)("div",{className:"mng-flex mng-items-center mng-gap-4",children:(0,x.jsx)("span",{className:"mng-text-sm mng-text-slate-600",children:t.appName})})]})};var u=require("react/jsx-runtime"),$=({children:e})=>(0,u.jsxs)("div",{className:"mng-flex mng-h-screen mng-bg-slate-50 mng-font-sans",children:[(0,u.jsx)(T,{}),(0,u.jsxs)("div",{className:"mng-flex-1 mng-flex mng-flex-col mng-overflow-hidden",children:[(0,u.jsx)(W,{}),(0,u.jsx)("main",{className:"mng-flex-1 mng-overflow-y-auto mng-p-8",children:e})]})]});var r=require("react/jsx-runtime"),w=()=>(0,r.jsxs)("div",{className:"mng-space-y-6",children:[(0,r.jsxs)("div",{className:"mng-flex mng-items-center mng-justify-between",children:[(0,r.jsx)("h2",{className:"mng-text-2xl mng-font-bold mng-text-slate-800",children:"Overview"}),(0,r.jsx)("button",{className:"mng-bg-blue-600 mng-text-white mng-px-4 mng-py-2 mng-rounded-lg mng-text-sm mng-font-medium hover:mng-bg-blue-700 mng-transition-colors",children:"Download Report"})]}),(0,r.jsx)("div",{className:"mng-grid mng-grid-cols-1 md:mng-grid-cols-3 mng-gap-6",children:[{label:"Total Revenue",value:"\u20AC45,231.89",change:"+20.1%",color:"mng-text-green-600"},{label:"Active Orders",value:"154",change:"+12.5%",color:"mng-text-green-600"},{label:"Refund Rate",value:"1.2%",change:"-0.4%",color:"mng-text-red-600"}].map(e=>(0,r.jsxs)("div",{className:"mng-bg-white mng-p-6 mng-rounded-xl mng-border mng-border-slate-200 mng-shadow-sm",children:[(0,r.jsx)("p",{className:"mng-text-sm mng-font-medium mng-text-slate-500",children:e.label}),(0,r.jsxs)("div",{className:"mng-flex mng-items-baseline mng-gap-2 mng-mt-2",children:[(0,r.jsx)("h3",{className:"mng-text-3xl mng-font-bold mng-text-slate-900",children:e.value}),(0,r.jsx)("span",{className:`mng-text-xs mng-font-medium ${e.color}`,children:e.change})]})]},e.label))}),(0,r.jsx)("div",{className:"mng-bg-white mng-rounded-xl mng-border mng-border-slate-200 mng-shadow-sm mng-h-64 mng-flex mng-items-center mng-justify-center",children:(0,r.jsx)("p",{className:"mng-text-slate-400 mng-italic",children:"Chart visualization will be here..."})})]});var m=require("react/jsx-runtime"),V=[{id:"#ORD-7721",customer:"Ion Popescu",status:"Completed",total:"\u20AC120.00",date:"Acum 2 ore"},{id:"#ORD-7722",customer:"Elena Radu",status:"Processing",total:"\u20AC45.50",date:"Acum 5 ore"},{id:"#ORD-7723",customer:"Mihai Sandu",status:"Pending",total:"\u20AC210.99",date:"Ieri"},{id:"#ORD-7724",customer:"Ana Ionescu",status:"Completed",total:"\u20AC89.99",date:"Ieri"},{id:"#ORD-7725",customer:"George Popa",status:"Cancelled",total:"\u20AC156.00",date:"Acum 2 zile"}],X=e=>{switch(e){case"Completed":return"mng-bg-green-100 mng-text-green-700";case"Processing":return"mng-bg-blue-100 mng-text-blue-700";case"Pending":return"mng-bg-yellow-100 mng-text-yellow-700";case"Cancelled":return"mng-bg-red-100 mng-text-red-700";default:return"mng-bg-slate-100 mng-text-slate-700"}},P=()=>(0,m.jsxs)("div",{className:"mng-space-y-6",children:[(0,m.jsxs)("div",{className:"mng-flex mng-items-center mng-justify-between",children:[(0,m.jsx)("h2",{className:"mng-text-2xl mng-font-bold mng-text-slate-800",children:"Orders Management"}),(0,m.jsx)("button",{className:"mng-bg-blue-600 mng-text-white mng-px-4 mng-py-2 mng-rounded-lg mng-text-sm mng-font-medium hover:mng-bg-blue-700 mng-transition-colors",children:"Export Orders"})]}),(0,m.jsx)("div",{className:"mng-bg-white mng-rounded-xl mng-border mng-border-slate-200 mng-shadow-sm mng-overflow-hidden",children:(0,m.jsxs)("table",{className:"mng-w-full mng-text-left mng-border-collapse",children:[(0,m.jsx)("thead",{children:(0,m.jsxs)("tr",{className:"mng-bg-slate-50 mng-border-b mng-border-slate-200",children:[(0,m.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Order ID"}),(0,m.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Customer"}),(0,m.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Status"}),(0,m.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Total"}),(0,m.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Date"})]})}),(0,m.jsx)("tbody",{className:"mng-divide-y mng-divide-slate-200",children:V.map(e=>(0,m.jsxs)("tr",{className:"hover:mng-bg-slate-50 mng-transition-colors",children:[(0,m.jsx)("td",{className:"mng-px-6 mng-py-4 mng-text-sm mng-font-medium mng-text-blue-600",children:e.id}),(0,m.jsx)("td",{className:"mng-px-6 mng-py-4 mng-text-sm mng-text-slate-600",children:e.customer}),(0,m.jsx)("td",{className:"mng-px-6 mng-py-4",children:(0,m.jsx)("span",{className:`mng-px-2.5 mng-py-0.5 mng-rounded-full mng-text-xs mng-font-medium ${X(e.status)}`,children:e.status})}),(0,m.jsx)("td",{className:"mng-px-6 mng-py-4 mng-text-sm mng-font-semibold mng-text-slate-900",children:e.total}),(0,m.jsx)("td",{className:"mng-px-6 mng-py-4 mng-text-sm mng-text-slate-500",children:e.date})]},e.id))})]})})]});var n=require("react/jsx-runtime"),Y=[{id:"1",name:"Ion Popescu",email:"ion.popescu@example.com",orders:12,totalSpent:"\u20AC1,234.56",joined:"2024-01-15"},{id:"2",name:"Elena Radu",email:"elena.radu@example.com",orders:8,totalSpent:"\u20AC876.32",joined:"2024-02-20"},{id:"3",name:"Mihai Sandu",email:"mihai.sandu@example.com",orders:15,totalSpent:"\u20AC2,103.45",joined:"2023-11-10"},{id:"4",name:"Ana Ionescu",email:"ana.ionescu@example.com",orders:5,totalSpent:"\u20AC543.21",joined:"2024-03-05"}],M=()=>(0,n.jsxs)("div",{className:"mng-space-y-6",children:[(0,n.jsxs)("div",{className:"mng-flex mng-items-center mng-justify-between",children:[(0,n.jsx)("h2",{className:"mng-text-2xl mng-font-bold mng-text-slate-800",children:"Customers"}),(0,n.jsx)("button",{className:"mng-bg-blue-600 mng-text-white mng-px-4 mng-py-2 mng-rounded-lg mng-text-sm mng-font-medium hover:mng-bg-blue-700 mng-transition-colors",children:"Add Customer"})]}),(0,n.jsx)("div",{className:"mng-bg-white mng-rounded-xl mng-border mng-border-slate-200 mng-shadow-sm mng-overflow-hidden",children:(0,n.jsxs)("table",{className:"mng-w-full mng-text-left mng-border-collapse",children:[(0,n.jsx)("thead",{children:(0,n.jsxs)("tr",{className:"mng-bg-slate-50 mng-border-b mng-border-slate-200",children:[(0,n.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Customer"}),(0,n.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Email"}),(0,n.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Orders"}),(0,n.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Total Spent"}),(0,n.jsx)("th",{className:"mng-px-6 mng-py-4 mng-text-xs mng-font-semibold mng-text-slate-500 mng-uppercase",children:"Joined"})]})}),(0,n.jsx)("tbody",{className:"mng-divide-y mng-divide-slate-200",children:Y.map(e=>(0,n.jsxs)("tr",{className:"hover:mng-bg-slate-50 mng-transition-colors",children:[(0,n.jsx)("td",{className:"mng-px-6 mng-py-4",children:(0,n.jsxs)("div",{className:"mng-flex mng-items-center mng-gap-3",children:[(0,n.jsx)("div",{className:"mng-w-10 mng-h-10 mng-rounded-full mng-bg-blue-100 mng-flex mng-items-center mng-justify-center mng-text-blue-600 mng-font-semibold",children:e.name.charAt(0)}),(0,n.jsx)("span",{className:"mng-text-sm mng-font-medium mng-text-slate-900",children:e.name})]})}),(0,n.jsx)("td",{className:"mng-px-6 mng-py-4 mng-text-sm mng-text-slate-600",children:e.email}),(0,n.jsx)("td",{className:"mng-px-6 mng-py-4 mng-text-sm mng-text-slate-900",children:e.orders}),(0,n.jsx)("td",{className:"mng-px-6 mng-py-4 mng-text-sm mng-font-semibold mng-text-slate-900",children:e.totalSpent}),(0,n.jsx)("td",{className:"mng-px-6 mng-py-4 mng-text-sm mng-text-slate-500",children:e.joined})]},e.id))})]})})]});var c=require("react/jsx-runtime"),C=()=>(0,c.jsxs)("div",{className:"mng-space-y-6",children:[(0,c.jsxs)("div",{className:"mng-flex mng-items-center mng-justify-between",children:[(0,c.jsx)("h2",{className:"mng-text-2xl mng-font-bold mng-text-slate-800",children:"Products"}),(0,c.jsx)("button",{className:"mng-bg-blue-600 mng-text-white mng-px-4 mng-py-2 mng-rounded-lg mng-text-sm mng-font-medium hover:mng-bg-blue-700 mng-transition-colors",children:"Add Product"})]}),(0,c.jsx)("div",{className:"mng-bg-white mng-rounded-xl mng-border mng-border-slate-200 mng-shadow-sm mng-p-12 mng-flex mng-items-center mng-justify-center mng-min-h-96",children:(0,c.jsx)("p",{className:"mng-text-slate-400 mng-italic",children:"Products management coming soon..."})})]});var a=require("react/jsx-runtime"),R=()=>{let{config:e}=d();return(0,a.jsxs)("div",{className:"mng-space-y-6",children:[(0,a.jsx)("h2",{className:"mng-text-2xl mng-font-bold mng-text-slate-800",children:"Settings"}),(0,a.jsxs)("div",{className:"mng-bg-white mng-rounded-xl mng-border mng-border-slate-200 mng-shadow-sm mng-p-6 mng-space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"mng-text-lg mng-font-semibold mng-text-slate-800 mng-mb-4",children:"General Settings"}),(0,a.jsxs)("div",{className:"mng-space-y-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mng-block mng-text-sm mng-font-medium mng-text-slate-700 mng-mb-2",children:"Application Name"}),(0,a.jsx)("input",{type:"text",disabled:!0,value:e.appName,className:"mng-w-full mng-px-4 mng-py-2 mng-border mng-border-slate-300 mng-rounded-lg mng-bg-slate-50 mng-text-slate-500"}),(0,a.jsx)("p",{className:"mng-text-xs mng-text-slate-500 mng-mt-1",children:"Configured via ManagoProvider"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"mng-block mng-text-sm mng-font-medium mng-text-slate-700 mng-mb-2",children:"API Endpoint"}),(0,a.jsx)("input",{type:"text",disabled:!0,value:e.apiEndpoint||"Not configured",className:"mng-w-full mng-px-4 mng-py-2 mng-border mng-border-slate-300 mng-rounded-lg mng-bg-slate-50 mng-text-slate-500"})]})]})]}),(0,a.jsxs)("div",{className:"mng-border-t mng-border-slate-200 mng-pt-6",children:[(0,a.jsx)("h3",{className:"mng-text-lg mng-font-semibold mng-text-slate-800 mng-mb-4",children:"Menu Configuration"}),(0,a.jsx)("div",{className:"mng-space-y-2",children:Object.entries(e.menu||{}).map(([t,s])=>(0,a.jsxs)("div",{className:"mng-flex mng-items-center mng-justify-between",children:[(0,a.jsx)("span",{className:"mng-text-sm mng-text-slate-700 mng-capitalize",children:t}),(0,a.jsx)("span",{className:`mng-text-sm mng-font-medium ${s?"mng-text-green-600":"mng-text-red-600"}`,children:s?"Enabled":"Disabled"})]},t))})]})]})]})};var l=require("react/jsx-runtime"),L=({apiKey:e,config:t,basePath:s="/admin"})=>{let i=(0,y.usePathname)(),g=(0,y.useRouter)(),[A,H]=(0,N.useState)(!1);(0,N.useEffect)(()=>{H(!0)},[]);let p=(b=>b.startsWith(s)&&b.slice(s.length)||"/")(i),S=b=>{let O=b==="/"?s:`${s}${b}`;g.push(O)};return A?(0,l.jsx)(k,{apiKey:e,config:t,navigate:S,currentPath:p,children:(0,l.jsx)($,{children:p==="/"||p===""?(0,l.jsx)(w,{}):p.startsWith("/orders")?(0,l.jsx)(P,{}):p.startsWith("/customers")?(0,l.jsx)(M,{}):p.startsWith("/products")?(0,l.jsx)(C,{}):p.startsWith("/settings")?(0,l.jsx)(R,{}):(0,l.jsx)("div",{className:"mng-flex mng-items-center mng-justify-center mng-h-full",children:(0,l.jsxs)("div",{className:"mng-text-center",children:[(0,l.jsx)("h2",{className:"mng-text-2xl mng-font-bold mng-text-slate-800 mng-mb-2",children:"Page Not Found"}),(0,l.jsx)("p",{className:"mng-text-slate-600 mng-mb-4",children:"The page you're looking for doesn't exist."}),(0,l.jsx)("button",{onClick:()=>S("/"),className:"mng-bg-blue-600 mng-text-white mng-px-4 mng-py-2 mng-rounded-lg mng-text-sm mng-font-medium hover:mng-bg-blue-700",children:"Go to Dashboard"})]})})})}):null};0&&(module.exports={ManagoAdmin,useManago});
6
+ //# sourceMappingURL=index.js.map