@axzydev/axzy_ui_system 1.2.6 → 1.2.7
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/dist/index.cjs +246 -182
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +7 -1
- package/dist/index.d.ts +7 -1
- package/dist/index.js +246 -182
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/grid/grid.tsx +7 -2
- package/src/components/layout/layout.tsx +14 -17
- package/src/components/navbar/navbar.tsx +51 -46
- package/src/components/page/page.props.ts +4 -0
- package/src/components/page/page.tsx +17 -7
- package/src/components/page-header/page-header.props.ts +2 -0
- package/src/components/page-header/page-header.stories.tsx +14 -0
- package/src/components/page-header/page-header.tsx +35 -15
- package/src/index.css +15 -0
- package/src/showcases/PageShowcases.tsx +465 -45
- package/src/showcases/StructureShowcases.tsx +205 -36
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import React, { useState } from "react";
|
|
2
|
-
import {
|
|
3
|
-
|
|
2
|
+
import {
|
|
3
|
+
FaCheckCircle,
|
|
4
|
+
FaHome,
|
|
5
|
+
FaUsers,
|
|
6
|
+
FaShoppingCart,
|
|
7
|
+
FaCog,
|
|
8
|
+
FaBoxOpen,
|
|
9
|
+
FaChartLine,
|
|
10
|
+
FaFileAlt,
|
|
11
|
+
FaBell,
|
|
12
|
+
} from "react-icons/fa";
|
|
13
|
+
import {
|
|
14
|
+
ITCard,
|
|
15
|
+
ITButton,
|
|
16
|
+
ITInput,
|
|
17
|
+
ITSlideToggle,
|
|
18
|
+
ITText,
|
|
19
|
+
ITNavbar,
|
|
20
|
+
ITLayout,
|
|
21
|
+
ITStack,
|
|
22
|
+
ITStatCard,
|
|
23
|
+
ITGrid,
|
|
24
|
+
ITPageHeader,
|
|
25
|
+
ITPage,
|
|
26
|
+
} from "../index";
|
|
4
27
|
import { ShowcaseLayout, CodeViewer } from "./ShowcaseLayout";
|
|
5
28
|
|
|
6
29
|
// 1. ITCard Showcase
|
|
@@ -110,43 +133,189 @@ const ITSelectStub = ({ name, label, value, onChange, options }: any) => {
|
|
|
110
133
|
|
|
111
134
|
// 3. ITLayout & ITNavbar Showcase
|
|
112
135
|
export const LayoutShowcase = () => {
|
|
113
|
-
const
|
|
136
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
137
|
+
const [activeId, setActiveId] = useState("dashboard");
|
|
138
|
+
|
|
139
|
+
const topBar = {
|
|
140
|
+
logo: <div className="w-9 h-9 rounded-lg bg-primary-500 flex items-center justify-center text-white font-bold">A</div>,
|
|
141
|
+
logoText: "AXZY Console",
|
|
142
|
+
navItems: [
|
|
143
|
+
{ id: "home", label: "Inicio", icon: <FaHome />, action: () => setActiveId("home") },
|
|
144
|
+
{ id: "docs", label: "Documentos", icon: <FaFileAlt />, action: () => setActiveId("docs") },
|
|
145
|
+
{ id: "alerts", label: "Alertas", icon: <FaBell />, action: () => setActiveId("alerts") },
|
|
146
|
+
],
|
|
147
|
+
onNavItemClick: (id: string) => setActiveId(id),
|
|
148
|
+
userMenu: {
|
|
149
|
+
userName: "Auditor AXZY",
|
|
150
|
+
userEmail: "auditor@axzy.dev",
|
|
151
|
+
menuItems: [
|
|
152
|
+
{ label: "Ajustes", onClick: () => {} },
|
|
153
|
+
{ label: "Cerrar sesión", onClick: () => {} },
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
const sidebar = {
|
|
159
|
+
navigationItems: [
|
|
160
|
+
{ id: "dashboard", label: "Dashboard", icon: <FaChartLine />, isActive: activeId === "dashboard", action: () => setActiveId("dashboard") },
|
|
161
|
+
{ id: "users", label: "Usuarios", icon: <FaUsers />, isActive: activeId === "users", action: () => setActiveId("users") },
|
|
162
|
+
{
|
|
163
|
+
id: "sales",
|
|
164
|
+
label: "Ventas",
|
|
165
|
+
icon: <FaShoppingCart />,
|
|
166
|
+
isActive: activeId === "sales" || activeId === "orders",
|
|
167
|
+
subitems: [
|
|
168
|
+
{ id: "orders", label: "Órdenes", action: () => setActiveId("orders") },
|
|
169
|
+
{ id: "invoices", label: "Facturas", action: () => setActiveId("invoices") },
|
|
170
|
+
],
|
|
171
|
+
},
|
|
172
|
+
{ id: "products", label: "Productos", icon: <FaBoxOpen />, isActive: activeId === "products", action: () => setActiveId("products"), badge: "3" },
|
|
173
|
+
{ id: "settings", label: "Configuración", icon: <FaCog />, isActive: activeId === "settings", action: () => setActiveId("settings") },
|
|
174
|
+
],
|
|
175
|
+
isCollapsed: collapsed,
|
|
176
|
+
onToggleCollapse: () => setCollapsed(v => !v),
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
const code = `<ITLayout
|
|
180
|
+
topBar={{
|
|
181
|
+
logo: <Logo />,
|
|
182
|
+
logoText: "AXZY Console",
|
|
183
|
+
userMenu: { userName, userEmail, menuItems }
|
|
184
|
+
}}
|
|
185
|
+
sidebar={{
|
|
186
|
+
navigationItems: [...],
|
|
187
|
+
isCollapsed: false,
|
|
188
|
+
onToggleCollapse: () => {}
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
{/* Tu contenido */}
|
|
192
|
+
</ITLayout>`;
|
|
193
|
+
|
|
194
|
+
const navbarCode = `<ITNavbar
|
|
195
|
+
logoText="AXZY"
|
|
196
|
+
navigationItems={[
|
|
197
|
+
{ id: "1", label: "Inicio", icon: <FaHome />, isActive: true },
|
|
198
|
+
{ id: "2", label: "Auditoría" }
|
|
199
|
+
]}
|
|
200
|
+
userMenu={{
|
|
201
|
+
userName: "Auditor AXZY",
|
|
202
|
+
userEmail: "auditor@axzy.dev",
|
|
203
|
+
menuItems: [{ label: "Ajustes", onClick: () => {} }]
|
|
204
|
+
}}
|
|
205
|
+
/>`;
|
|
114
206
|
|
|
115
207
|
return (
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
208
|
+
<ShowcaseLayout
|
|
209
|
+
title="ITLayout & ITNavbar"
|
|
210
|
+
description="Chasis estructural del portal con barra superior y lateral colapsable. Totalmente responsivo con drawer móvil."
|
|
211
|
+
code={code}
|
|
212
|
+
demo={
|
|
213
|
+
<div className="w-full h-[640px] rounded-xl overflow-hidden border border-slate-200 dark:border-slate-700 shadow-md">
|
|
214
|
+
<ITLayout topBar={topBar} sidebar={sidebar}>
|
|
215
|
+
<ITStack spacing={5}>
|
|
216
|
+
<ITPageHeader
|
|
217
|
+
title="Dashboard"
|
|
218
|
+
description="Resumen general del sistema"
|
|
219
|
+
icon={<FaChartLine size={20} />}
|
|
220
|
+
iconColor="#6366f1"
|
|
221
|
+
/>
|
|
222
|
+
<ITGrid container spacing={3}>
|
|
223
|
+
<ITGrid item xs={12} sm={6} lg={3}>
|
|
224
|
+
<ITStatCard label="Usuarios" value="1,245" trend="+12%" trendDirection="up" />
|
|
225
|
+
</ITGrid>
|
|
226
|
+
<ITGrid item xs={12} sm={6} lg={3}>
|
|
227
|
+
<ITStatCard label="Ventas Hoy" value="$4,320" trend="+5.4%" trendDirection="up" color="bg-blue-50 dark:bg-blue-950/20" />
|
|
228
|
+
</ITGrid>
|
|
229
|
+
<ITGrid item xs={12} sm={6} lg={3}>
|
|
230
|
+
<ITStatCard label="Órdenes" value="89" trend="-2.1%" trendDirection="down" color="bg-amber-50 dark:bg-amber-950/20" />
|
|
231
|
+
</ITGrid>
|
|
232
|
+
<ITGrid item xs={12} sm={6} lg={3}>
|
|
233
|
+
<ITStatCard label="Tickets" value="12" trend="-8%" trendDirection="down" color="bg-rose-50 dark:bg-rose-950/20" />
|
|
234
|
+
</ITGrid>
|
|
235
|
+
</ITGrid>
|
|
236
|
+
<ITCard title="Actividad reciente">
|
|
237
|
+
<ITText className="text-sm text-slate-600 dark:text-slate-300">
|
|
238
|
+
El layout se adapta al colapsar/expandir el sidebar y muestra un drawer en móvil.
|
|
239
|
+
</ITText>
|
|
240
|
+
</ITCard>
|
|
241
|
+
</ITStack>
|
|
242
|
+
</ITLayout>
|
|
243
|
+
</div>
|
|
244
|
+
}
|
|
245
|
+
controls={
|
|
246
|
+
<ITStack spacing={4}>
|
|
247
|
+
<div className="flex items-center justify-between">
|
|
248
|
+
<span className="text-sm font-semibold text-slate-700 dark:text-slate-300">Sidebar colapsado</span>
|
|
249
|
+
<ITSlideToggle isOn={collapsed} onToggle={setCollapsed} size="sm" />
|
|
250
|
+
</div>
|
|
251
|
+
<div className="text-xs text-slate-500">
|
|
252
|
+
En móvil (<lg) el sidebar se abre como drawer con un fondo oscuro. Usa el botón ☰ del topbar.
|
|
253
|
+
</div>
|
|
254
|
+
</ITStack>
|
|
255
|
+
}
|
|
256
|
+
gallery={
|
|
257
|
+
<ITStack spacing={6}>
|
|
258
|
+
<div>
|
|
259
|
+
<h4 className="text-sm font-bold text-slate-700 dark:text-slate-200 mb-3">ITNavbar (standalone)</h4>
|
|
260
|
+
<div className="border border-slate-200 dark:border-slate-700 rounded-xl overflow-hidden h-[420px]">
|
|
261
|
+
<ITNavbar
|
|
262
|
+
logoText="AXZY"
|
|
263
|
+
navigationItems={[
|
|
264
|
+
{ id: "1", label: "Inicio", icon: <FaHome />, isActive: true },
|
|
265
|
+
{ id: "2", label: "Documentos", icon: <FaFileAlt /> },
|
|
266
|
+
{ id: "3", label: "Alertas", icon: <FaBell /> },
|
|
267
|
+
]}
|
|
268
|
+
userMenu={{
|
|
269
|
+
userName: "Auditor AXZY",
|
|
270
|
+
userEmail: "auditor@axzy.dev",
|
|
271
|
+
menuItems: [
|
|
272
|
+
{ label: "Ajustes", onClick: () => {} },
|
|
273
|
+
{ label: "Cerrar sesión", onClick: () => {} },
|
|
274
|
+
],
|
|
275
|
+
}}
|
|
276
|
+
>
|
|
277
|
+
<div className="p-8 text-center text-slate-500 text-sm">
|
|
278
|
+
Contenido principal (children)
|
|
279
|
+
</div>
|
|
280
|
+
</ITNavbar>
|
|
281
|
+
</div>
|
|
282
|
+
<div className="mt-3">
|
|
283
|
+
<CodeViewer code={navbarCode} />
|
|
284
|
+
</div>
|
|
285
|
+
</div>
|
|
121
286
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
287
|
+
<div>
|
|
288
|
+
<h4 className="text-sm font-bold text-slate-700 dark:text-slate-200 mb-3">ITNavbar con submenús</h4>
|
|
289
|
+
<div className="border border-slate-200 dark:border-slate-700 rounded-xl overflow-hidden h-[420px]">
|
|
290
|
+
<ITNavbar
|
|
291
|
+
logoText="Admin"
|
|
292
|
+
navigationItems={[
|
|
293
|
+
{ id: "u", label: "Usuarios", icon: <FaUsers /> },
|
|
294
|
+
{
|
|
295
|
+
id: "s",
|
|
296
|
+
label: "Ventas",
|
|
297
|
+
icon: <FaShoppingCart />,
|
|
298
|
+
subitems: [
|
|
299
|
+
{ id: "o", label: "Órdenes", action: () => {} },
|
|
300
|
+
{ id: "i", label: "Facturas", action: () => {} },
|
|
301
|
+
],
|
|
302
|
+
},
|
|
303
|
+
{ id: "c", label: "Configuración", icon: <FaCog /> },
|
|
304
|
+
]}
|
|
305
|
+
userMenu={{
|
|
306
|
+
userName: "Admin",
|
|
307
|
+
userEmail: "admin@axzy.dev",
|
|
308
|
+
menuItems: [{ label: "Salir", onClick: () => {} }],
|
|
309
|
+
}}
|
|
310
|
+
>
|
|
311
|
+
<div className="p-8 text-center text-slate-500 text-sm">
|
|
312
|
+
Click en "Ventas" para expandir el submenú
|
|
313
|
+
</div>
|
|
314
|
+
</ITNavbar>
|
|
315
|
+
</div>
|
|
146
316
|
</div>
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
</div>
|
|
317
|
+
</ITStack>
|
|
318
|
+
}
|
|
319
|
+
/>
|
|
151
320
|
);
|
|
152
321
|
};
|