ptechcore_ui 1.0.2 → 1.0.3

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 CHANGED
@@ -29,6 +29,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
29
29
  // src/index.ts
30
30
  var index_exports = {};
31
31
  __export(index_exports, {
32
+ Pages: () => Pages_default,
32
33
  PrimaryButton: () => Buttons_default,
33
34
  RewiseLayout: () => ModernDoubleSidebarLayout_default,
34
35
  SecondaryButton: () => SecondaryButton,
@@ -454,7 +455,7 @@ var ThemeContext_default = ThemeProvider;
454
455
 
455
456
  // src/components/layout/ModernDoubleSidebarLayout.tsx
456
457
  var import_jsx_runtime3 = require("react/jsx-runtime");
457
- var RewiseLayout = ({ children, module_name = "Rewise", primaryMenuItems, secondaryMenuItems }) => {
458
+ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "Description du module", primaryMenuItems, secondaryMenuItems }) => {
458
459
  const location = (0, import_react_router_dom.useLocation)();
459
460
  const navigate = (0, import_react_router_dom.useNavigate)();
460
461
  const { theme, themeType, setTheme } = useTheme();
@@ -565,8 +566,8 @@ var RewiseLayout = ({ children, module_name = "Rewise", primaryMenuItems, second
565
566
  ), children: [
566
567
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-[var(--color-background)] font-bold text-xl", children: "W" }) }),
567
568
  !primaryCollapsed && /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { children: [
568
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h1", { className: "text-[var(--color-sidebar-text)] font-bold text-lg", children: "WiseBook" }),
569
- /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-[var(--color-sidebar-text-secondary)] text-xs", children: "ERP Next-Gen" })
569
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("h1", { className: "text-[var(--color-sidebar-text)] font-bold text-lg", children: module_name }),
570
+ /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("p", { className: "text-[var(--color-sidebar-text-secondary)] text-xs", children: module_description })
570
571
  ] })
571
572
  ] }),
572
573
  /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
@@ -1305,8 +1306,86 @@ var SessionProvider = ({ children }) => {
1305
1306
  logout
1306
1307
  }, children });
1307
1308
  };
1309
+
1310
+ // src/components/common/Pages.tsx
1311
+ var import_lucide_react3 = require("lucide-react");
1312
+ var import_react6 = require("react");
1313
+ var import_jsx_runtime7 = require("react/jsx-runtime");
1314
+ var Pages = ({
1315
+ title = "",
1316
+ description = "",
1317
+ sideAction,
1318
+ sidebar,
1319
+ tabs = [],
1320
+ children
1321
+ }) => {
1322
+ const [sidebarOpen, setSidebarOpen] = (0, import_react6.useState)(false);
1323
+ return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex h-full bg-gray-50", children: [
1324
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex-1 flex flex-col", children: [
1325
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "bg-white border-b border-gray-200 p-6", children: [
1326
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between", children: [
1327
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { children: [
1328
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h1", { className: "text-2xl font-bold text-gray-900", children: title }),
1329
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("p", { className: "text-sm text-gray-600", children: description })
1330
+ ] }) }),
1331
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex items-center space-x-3", children: sideAction })
1332
+ ] }),
1333
+ tabs.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex space-x-1 mt-4 overflow-x-auto", children: tabs.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1334
+ "button",
1335
+ {
1336
+ className: `px-4 py-2 text-sm rounded-lg transition-all whitespace-nowrap ${tab.id === "manual" ? "bg-[#6A8A82] text-white shadow-md" : "text-gray-600 hover:bg-gray-100"}`,
1337
+ children: tab.label
1338
+ },
1339
+ tab.id
1340
+ )) })
1341
+ ] }),
1342
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex-1 p-6 space-y-6", children })
1343
+ ] }),
1344
+ sidebar && /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: `${sidebarOpen ? "w-80" : "w-16"} bg-[var(--color-surface)] border-r border-[var(--color-border)] transition-all duration-300 flex flex-col`, children: [
1345
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-4 ", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "flex items-center justify-between", children: [
1346
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("h2", { className: `font-semibold text-[var(--color-text-primary)] ${!sidebarOpen && "hidden"}`, children: "Classes SYSCOHADA" }),
1347
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1348
+ "button",
1349
+ {
1350
+ onClick: () => setSidebarOpen(!sidebarOpen),
1351
+ className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
1352
+ "aria-label": sidebarOpen ? "R\xE9duire" : "Ouvrir",
1353
+ children: sidebarOpen ? /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.ChevronLeft, { className: "w-5 h-5" }) : /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Menu, { className: "w-5 h-5" })
1354
+ }
1355
+ )
1356
+ ] }) }),
1357
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "flex-1 overflow-y-auto py-2", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1358
+ "button",
1359
+ {
1360
+ onClick: () => {
1361
+ },
1362
+ className: `w-full flex items-center gap-3 px-4 py-3 transition-all relative group hover:bg-[var(--color-surface-hover)]`,
1363
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(
1364
+ "div",
1365
+ {
1366
+ className: `flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center transition-colors bg-[var(--color-background)]`,
1367
+ children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("span", { className: "font-bold text-lg", children: 1 })
1368
+ }
1369
+ )
1370
+ }
1371
+ ) }),
1372
+ sidebarOpen && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { className: "p-4 border-t border-[var(--color-border)]", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("div", { className: "space-y-2", children: [
1373
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { className: "w-full px-3 py-2 bg-[var(--color-background)] rounded-lg text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-hover)] transition-colors flex items-center gap-2", children: [
1374
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Download, { className: "w-4 h-4" }),
1375
+ "Exporter le plan"
1376
+ ] }),
1377
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)("button", { className: "w-full px-3 py-2 bg-[var(--color-background)] rounded-lg text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-hover)] transition-colors flex items-center gap-2", children: [
1378
+ /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_lucide_react3.Settings, { className: "w-4 h-4" }),
1379
+ "Configuration"
1380
+ ] })
1381
+ ] }) })
1382
+ ] })
1383
+ ] });
1384
+ };
1385
+ var Pages_default = Pages;
1308
1386
  // Annotate the CommonJS export names for ESM import in node:
1309
1387
  0 && (module.exports = {
1388
+ Pages,
1310
1389
  PrimaryButton,
1311
1390
  RewiseLayout,
1312
1391
  SecondaryButton,
package/dist/index.d.cts CHANGED
@@ -21,6 +21,7 @@ interface MenuItem {
21
21
  interface PrivateLayoutProps {
22
22
  children: React.ReactNode;
23
23
  module_name: string;
24
+ module_description?: string;
24
25
  primaryMenuItems: MenuItem[];
25
26
  secondaryMenuItems: Record<string, MenuItem[]>;
26
27
  }
@@ -42,4 +43,20 @@ interface ToastProviderProps {
42
43
  }
43
44
  declare const ToastProvider: React.FC<ToastProviderProps>;
44
45
 
45
- export { type MenuItem, PrimaryButton, RewiseLayout, SecondaryButton, SessionProvider, ThemeProvider, ToastContainer, ToastProvider };
46
+ interface PagesProps {
47
+ title?: string;
48
+ description?: string;
49
+ sideAction?: React.ReactNode;
50
+ sidebar?: React.ReactNode;
51
+ tabs?: Array<{
52
+ id: string;
53
+ label: string;
54
+ icon: React.ComponentType<{
55
+ className?: string;
56
+ }>;
57
+ }>;
58
+ children?: React.ReactNode;
59
+ }
60
+ declare const Pages: React.FC<PagesProps>;
61
+
62
+ export { type MenuItem, Pages, PrimaryButton, RewiseLayout, SecondaryButton, SessionProvider, ThemeProvider, ToastContainer, ToastProvider };
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ interface MenuItem {
21
21
  interface PrivateLayoutProps {
22
22
  children: React.ReactNode;
23
23
  module_name: string;
24
+ module_description?: string;
24
25
  primaryMenuItems: MenuItem[];
25
26
  secondaryMenuItems: Record<string, MenuItem[]>;
26
27
  }
@@ -42,4 +43,20 @@ interface ToastProviderProps {
42
43
  }
43
44
  declare const ToastProvider: React.FC<ToastProviderProps>;
44
45
 
45
- export { type MenuItem, PrimaryButton, RewiseLayout, SecondaryButton, SessionProvider, ThemeProvider, ToastContainer, ToastProvider };
46
+ interface PagesProps {
47
+ title?: string;
48
+ description?: string;
49
+ sideAction?: React.ReactNode;
50
+ sidebar?: React.ReactNode;
51
+ tabs?: Array<{
52
+ id: string;
53
+ label: string;
54
+ icon: React.ComponentType<{
55
+ className?: string;
56
+ }>;
57
+ }>;
58
+ children?: React.ReactNode;
59
+ }
60
+ declare const Pages: React.FC<PagesProps>;
61
+
62
+ export { type MenuItem, Pages, PrimaryButton, RewiseLayout, SecondaryButton, SessionProvider, ThemeProvider, ToastContainer, ToastProvider };
package/dist/index.js CHANGED
@@ -426,7 +426,7 @@ var ThemeContext_default = ThemeProvider;
426
426
 
427
427
  // src/components/layout/ModernDoubleSidebarLayout.tsx
428
428
  import { Fragment, jsx as jsx3, jsxs } from "react/jsx-runtime";
429
- var RewiseLayout = ({ children, module_name = "Rewise", primaryMenuItems, secondaryMenuItems }) => {
429
+ var RewiseLayout = ({ children, module_name = "Rewise", module_description = "Description du module", primaryMenuItems, secondaryMenuItems }) => {
430
430
  const location = useLocation();
431
431
  const navigate = useNavigate();
432
432
  const { theme, themeType, setTheme } = useTheme();
@@ -537,8 +537,8 @@ var RewiseLayout = ({ children, module_name = "Rewise", primaryMenuItems, second
537
537
  ), children: [
538
538
  /* @__PURE__ */ jsx3("div", { className: "w-10 h-10 bg-[var(--color-primary)] rounded-lg flex items-center justify-center", children: /* @__PURE__ */ jsx3("span", { className: "text-[var(--color-background)] font-bold text-xl", children: "W" }) }),
539
539
  !primaryCollapsed && /* @__PURE__ */ jsxs("div", { children: [
540
- /* @__PURE__ */ jsx3("h1", { className: "text-[var(--color-sidebar-text)] font-bold text-lg", children: "WiseBook" }),
541
- /* @__PURE__ */ jsx3("p", { className: "text-[var(--color-sidebar-text-secondary)] text-xs", children: "ERP Next-Gen" })
540
+ /* @__PURE__ */ jsx3("h1", { className: "text-[var(--color-sidebar-text)] font-bold text-lg", children: module_name }),
541
+ /* @__PURE__ */ jsx3("p", { className: "text-[var(--color-sidebar-text-secondary)] text-xs", children: module_description })
542
542
  ] })
543
543
  ] }),
544
544
  /* @__PURE__ */ jsx3(
@@ -1277,7 +1277,85 @@ var SessionProvider = ({ children }) => {
1277
1277
  logout
1278
1278
  }, children });
1279
1279
  };
1280
+
1281
+ // src/components/common/Pages.tsx
1282
+ import { ChevronLeft as ChevronLeft2, Download, Menu as Menu2, Settings as Settings2 } from "lucide-react";
1283
+ import { useState as useState6 } from "react";
1284
+ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
1285
+ var Pages = ({
1286
+ title = "",
1287
+ description = "",
1288
+ sideAction,
1289
+ sidebar,
1290
+ tabs = [],
1291
+ children
1292
+ }) => {
1293
+ const [sidebarOpen, setSidebarOpen] = useState6(false);
1294
+ return /* @__PURE__ */ jsxs3("div", { className: "flex h-full bg-gray-50", children: [
1295
+ /* @__PURE__ */ jsxs3("div", { className: "flex-1 flex flex-col", children: [
1296
+ /* @__PURE__ */ jsxs3("div", { className: "bg-white border-b border-gray-200 p-6", children: [
1297
+ /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between", children: [
1298
+ /* @__PURE__ */ jsx7("div", { className: "flex items-center space-x-4", children: /* @__PURE__ */ jsxs3("div", { children: [
1299
+ /* @__PURE__ */ jsx7("h1", { className: "text-2xl font-bold text-gray-900", children: title }),
1300
+ /* @__PURE__ */ jsx7("p", { className: "text-sm text-gray-600", children: description })
1301
+ ] }) }),
1302
+ /* @__PURE__ */ jsx7("div", { className: "flex items-center space-x-3", children: sideAction })
1303
+ ] }),
1304
+ tabs.length > 0 && /* @__PURE__ */ jsx7("div", { className: "flex space-x-1 mt-4 overflow-x-auto", children: tabs.map((tab) => /* @__PURE__ */ jsx7(
1305
+ "button",
1306
+ {
1307
+ className: `px-4 py-2 text-sm rounded-lg transition-all whitespace-nowrap ${tab.id === "manual" ? "bg-[#6A8A82] text-white shadow-md" : "text-gray-600 hover:bg-gray-100"}`,
1308
+ children: tab.label
1309
+ },
1310
+ tab.id
1311
+ )) })
1312
+ ] }),
1313
+ /* @__PURE__ */ jsx7("div", { className: "flex-1 p-6 space-y-6", children })
1314
+ ] }),
1315
+ sidebar && /* @__PURE__ */ jsxs3("div", { className: `${sidebarOpen ? "w-80" : "w-16"} bg-[var(--color-surface)] border-r border-[var(--color-border)] transition-all duration-300 flex flex-col`, children: [
1316
+ /* @__PURE__ */ jsx7("div", { className: "p-4 ", children: /* @__PURE__ */ jsxs3("div", { className: "flex items-center justify-between", children: [
1317
+ /* @__PURE__ */ jsx7("h2", { className: `font-semibold text-[var(--color-text-primary)] ${!sidebarOpen && "hidden"}`, children: "Classes SYSCOHADA" }),
1318
+ /* @__PURE__ */ jsx7(
1319
+ "button",
1320
+ {
1321
+ onClick: () => setSidebarOpen(!sidebarOpen),
1322
+ className: "p-2 hover:bg-[var(--color-surface-hover)] rounded-lg transition-colors",
1323
+ "aria-label": sidebarOpen ? "R\xE9duire" : "Ouvrir",
1324
+ children: sidebarOpen ? /* @__PURE__ */ jsx7(ChevronLeft2, { className: "w-5 h-5" }) : /* @__PURE__ */ jsx7(Menu2, { className: "w-5 h-5" })
1325
+ }
1326
+ )
1327
+ ] }) }),
1328
+ /* @__PURE__ */ jsx7("div", { className: "flex-1 overflow-y-auto py-2", children: /* @__PURE__ */ jsx7(
1329
+ "button",
1330
+ {
1331
+ onClick: () => {
1332
+ },
1333
+ className: `w-full flex items-center gap-3 px-4 py-3 transition-all relative group hover:bg-[var(--color-surface-hover)]`,
1334
+ children: /* @__PURE__ */ jsx7(
1335
+ "div",
1336
+ {
1337
+ className: `flex-shrink-0 w-10 h-10 rounded-lg flex items-center justify-center transition-colors bg-[var(--color-background)]`,
1338
+ children: /* @__PURE__ */ jsx7("span", { className: "font-bold text-lg", children: 1 })
1339
+ }
1340
+ )
1341
+ }
1342
+ ) }),
1343
+ sidebarOpen && /* @__PURE__ */ jsx7("div", { className: "p-4 border-t border-[var(--color-border)]", children: /* @__PURE__ */ jsxs3("div", { className: "space-y-2", children: [
1344
+ /* @__PURE__ */ jsxs3("button", { className: "w-full px-3 py-2 bg-[var(--color-background)] rounded-lg text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-hover)] transition-colors flex items-center gap-2", children: [
1345
+ /* @__PURE__ */ jsx7(Download, { className: "w-4 h-4" }),
1346
+ "Exporter le plan"
1347
+ ] }),
1348
+ /* @__PURE__ */ jsxs3("button", { className: "w-full px-3 py-2 bg-[var(--color-background)] rounded-lg text-sm text-[var(--color-text-secondary)] hover:bg-[var(--color-surface-hover)] transition-colors flex items-center gap-2", children: [
1349
+ /* @__PURE__ */ jsx7(Settings2, { className: "w-4 h-4" }),
1350
+ "Configuration"
1351
+ ] })
1352
+ ] }) })
1353
+ ] })
1354
+ ] });
1355
+ };
1356
+ var Pages_default = Pages;
1280
1357
  export {
1358
+ Pages_default as Pages,
1281
1359
  Buttons_default as PrimaryButton,
1282
1360
  ModernDoubleSidebarLayout_default as RewiseLayout,
1283
1361
  SecondaryButton,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ptechcore_ui",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.js",