prometeo-design-system 1.0.1 → 1.0.4
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 +17 -22
- package/dist/components/Button/Button.d.ts +1 -3
- package/dist/components/Sidebar/Sidebar.d.ts +1 -1
- package/dist/components/Sidebar/components/badge.d.ts +1 -2
- package/dist/components/Sidebar/components/collapse-button.d.ts +1 -2
- package/dist/components/Sidebar/components/company-logo.d.ts +1 -2
- package/dist/components/Sidebar/components/nav-links.d.ts +3 -3
- package/dist/components/Sidebar/components/user-profile.d.ts +1 -2
- package/dist/components/Sidebar/hooks/useNavLinks.d.ts +8 -0
- package/dist/components/UserProfile/UserProfile.d.ts +2 -0
- package/dist/index.d.ts +9 -3
- package/dist/prometeo-design-system.es.js +529 -531
- package/dist/prometeo-design-system.umd.js +7 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -303,7 +303,7 @@ hover:text-primary-default-hover
|
|
|
303
303
|
|
|
304
304
|
---
|
|
305
305
|
|
|
306
|
-
|
|
306
|
+
# Sidebar Component
|
|
307
307
|
|
|
308
308
|
Un componente de barra lateral completo y altamente funcional con soporte para navegación, perfil de usuario, gestión de sesiones múltiples, notificaciones y estados colapsables. Diseñado para aplicaciones empresariales con múltiples usuarios y funcionalidades avanzadas.
|
|
309
309
|
|
|
@@ -327,6 +327,8 @@ npm install react-router-dom framer-motion
|
|
|
327
327
|
yarn add react-router-dom framer-motion
|
|
328
328
|
```
|
|
329
329
|
|
|
330
|
+
#### nota: No es necesario instalarlo, seguramente en el template del proyecto ya este instalado.
|
|
331
|
+
|
|
330
332
|
## 📋 Importaciones Requeridas
|
|
331
333
|
|
|
332
334
|
```tsx
|
|
@@ -531,8 +533,6 @@ Muestra el logo y nombre de la empresa del usuario.
|
|
|
531
533
|
/>
|
|
532
534
|
```
|
|
533
535
|
|
|
534
|
-
|
|
535
|
-
|
|
536
536
|
```tsx
|
|
537
537
|
|
|
538
538
|
<NavbarLinks
|
|
@@ -567,9 +567,7 @@ Perfil de usuario con gestión de sesiones múltiples.
|
|
|
567
567
|
/>
|
|
568
568
|
```
|
|
569
569
|
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
## Estados
|
|
570
|
+
## Estados
|
|
573
571
|
|
|
574
572
|
### Estados Internos
|
|
575
573
|
|
|
@@ -677,9 +675,7 @@ const getLinksForUser = (user: IUser) => {
|
|
|
677
675
|
};
|
|
678
676
|
```
|
|
679
677
|
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
## Ejemplo de uso
|
|
678
|
+
## Ejemplo de uso
|
|
683
679
|
|
|
684
680
|
### Navbar completo
|
|
685
681
|
|
|
@@ -783,19 +779,18 @@ function Navbar() {
|
|
|
783
779
|
|
|
784
780
|
export default Navbar;
|
|
785
781
|
|
|
786
|
-
|
|
787
782
|
//<!--- En otro lugar de nuestra app>
|
|
788
783
|
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
784
|
+
/* REACT ROUTER */
|
|
785
|
+
<main className="flex-1 overflow-auto p-6">
|
|
786
|
+
<Routes>
|
|
787
|
+
<Route path="/dashboard" element={<DashboardContent />} />
|
|
788
|
+
<Route path="/tickets" element={<TicketsContent />} />
|
|
789
|
+
<Route path="/projects" element={<ProjectsContent />} />
|
|
790
|
+
<Route path="/reports" element={<ReportsContent />} />
|
|
791
|
+
<Route path="/notifications" element={<NotificationsContent />} />
|
|
792
|
+
<Route path="/settings" element={<SettingsContent />} />
|
|
793
|
+
<Route path="/profile" element={<ProfileContent />} />
|
|
794
|
+
</Routes>
|
|
795
|
+
</main>;
|
|
801
796
|
```
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export type ButtonVariant = "filled" | "outline" | "text";
|
|
2
2
|
export type ButtonColor = "primary" | "secondary";
|
|
3
3
|
export type ButtonSize = "small" | "medium" | "large";
|
|
4
|
-
export type ButtonState = "enabled" | "hovered" | "focused" | "pressed" | "disabled";
|
|
5
4
|
interface IButton {
|
|
6
5
|
label?: string;
|
|
7
6
|
onClick?: () => void;
|
|
@@ -18,7 +17,6 @@ interface IButton {
|
|
|
18
17
|
size?: ButtonSize;
|
|
19
18
|
children?: React.ReactNode;
|
|
20
19
|
Spinner?: React.ReactNode;
|
|
21
|
-
forceState?: ButtonState;
|
|
22
20
|
}
|
|
23
|
-
export default function Button({ label, onClick, icon, classButton, classButtonText, animate, animateIcon, isLoading, disabled, type, variant, color, size, children, Spinner,
|
|
21
|
+
export default function Button({ label, onClick, icon, classButton, classButtonText, animate, animateIcon, isLoading, disabled, type, variant, color, size, children, Spinner, }: IButton): import("react/jsx-runtime").JSX.Element;
|
|
24
22
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SessionLocalStorage } from '../../interfaces/User/SessionLocalStorage';
|
|
2
2
|
import { IUser } from 'shared-dependencies-tickets';
|
|
3
3
|
import { INavLink } from './hooks/useNavLinks';
|
|
4
|
-
interface SidebarProps {
|
|
4
|
+
export interface SidebarProps {
|
|
5
5
|
isNotificationModalOpen: boolean;
|
|
6
6
|
user: IUser;
|
|
7
7
|
sessions: SessionLocalStorage[];
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
interface NavbarCollapseButtonProps {
|
|
1
|
+
export interface NavbarCollapseButtonProps {
|
|
2
2
|
isCollapsed: boolean;
|
|
3
3
|
onToggle: () => void;
|
|
4
4
|
}
|
|
5
5
|
export declare const NavbarCollapseButton: ({ isCollapsed, onToggle, }: NavbarCollapseButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { JSX } from 'react';
|
|
2
|
-
interface NavbarLinksProps {
|
|
2
|
+
export interface NavbarLinksProps {
|
|
3
3
|
links: Array<{
|
|
4
4
|
path: string;
|
|
5
5
|
icon: (props: {
|
|
@@ -10,11 +10,11 @@ interface NavbarLinksProps {
|
|
|
10
10
|
roles: string[];
|
|
11
11
|
isView?: boolean;
|
|
12
12
|
relatedPaths?: string[];
|
|
13
|
+
count?: number;
|
|
13
14
|
}>;
|
|
14
15
|
isLinkActive: (path: string) => boolean;
|
|
15
|
-
componentBadge?: () => JSX.Element;
|
|
16
|
+
componentBadge?: (count?: number) => JSX.Element;
|
|
16
17
|
onClick?: () => void;
|
|
17
18
|
activeModal?: boolean;
|
|
18
19
|
}
|
|
19
20
|
export declare const NavbarLinks: ({ links, isLinkActive, componentBadge, onClick, activeModal, }: NavbarLinksProps) => import("react/jsx-runtime").JSX.Element;
|
|
20
|
-
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IUser } from 'shared-dependencies-tickets';
|
|
2
2
|
import { SessionLocalStorage } from '../../../interfaces/User/SessionLocalStorage';
|
|
3
|
-
interface UserProfileProps {
|
|
3
|
+
export interface UserProfileProps {
|
|
4
4
|
user: IUser;
|
|
5
5
|
isExpanded?: boolean;
|
|
6
6
|
onClick?: () => void;
|
|
@@ -11,4 +11,3 @@ interface UserProfileProps {
|
|
|
11
11
|
handleTokenLogin?: (token: string) => void;
|
|
12
12
|
}
|
|
13
13
|
export declare const UserProfile: ({ user, isExpanded, onClick, onProfileClick, showOptions, onClickLogout, sessions, handleTokenLogin, }: UserProfileProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import { IUser } from 'shared-dependencies-tickets';
|
|
2
2
|
export type Role = "Developer" | "SuperAdmin" | "Admin" | "Regular";
|
|
3
|
+
export declare const Roles: {
|
|
4
|
+
levelOne: readonly ["Developer"];
|
|
5
|
+
levelTwo: Role[];
|
|
6
|
+
levelThree: Role[];
|
|
7
|
+
levelFour: Role[];
|
|
8
|
+
};
|
|
9
|
+
export type RoleLevels = typeof Roles;
|
|
3
10
|
export interface INavLink {
|
|
4
11
|
path: string;
|
|
5
12
|
title: string;
|
|
@@ -11,6 +18,7 @@ export interface INavLink {
|
|
|
11
18
|
discover: "render" | "none";
|
|
12
19
|
isView?: boolean;
|
|
13
20
|
relatedPaths?: string[];
|
|
21
|
+
count?: number;
|
|
14
22
|
}
|
|
15
23
|
export declare const useNavbarLinks: (user: IUser, links: Record<"pages" | "utils", INavLink[]>) => {
|
|
16
24
|
pageLinks: INavLink[];
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as Button } from './components/Button/Button';
|
|
2
2
|
export { default as Input } from './components/Input/Input';
|
|
3
|
-
export { default as Sidebar } from './components/Sidebar/Sidebar';
|
|
4
3
|
export { default as Menu } from './components/Menu/Menu';
|
|
4
|
+
export { default as Sidebar } from './components/Sidebar/Sidebar';
|
|
5
5
|
export { LayoutGeneric } from './components/Layout/LayoutGeneric';
|
|
6
6
|
export { Badge } from './components/Sidebar/components/badge';
|
|
7
7
|
export { NavbarCollapseButton } from './components/Sidebar/components/collapse-button';
|
|
@@ -12,7 +12,13 @@ export { useNavbarCollapse } from './components/Sidebar/hooks/useNavBarCollapse'
|
|
|
12
12
|
export { useNavbarLinks } from './components/Sidebar/hooks/useNavLinks';
|
|
13
13
|
export { useNavbarAnimations } from './components/Sidebar/ui/useNavbarAnimation';
|
|
14
14
|
export { useClickOutside } from './hooks/useClickOutside';
|
|
15
|
-
export type {
|
|
16
|
-
export type {
|
|
15
|
+
export type { ButtonColor, ButtonSize, ButtonVariant, } from './components/Button/Button';
|
|
16
|
+
export type { SidebarProps } from './components/Sidebar/Sidebar';
|
|
17
|
+
export type { BadgeProps } from './components/Sidebar/components/badge';
|
|
18
|
+
export type { NavbarCollapseButtonProps } from './components/Sidebar/components/collapse-button';
|
|
19
|
+
export type { CompanyLogoProps } from './components/Sidebar/components/company-logo';
|
|
20
|
+
export type { NavbarLinksProps } from './components/Sidebar/components/nav-links';
|
|
21
|
+
export type { UserProfileProps } from './components/Sidebar/components/user-profile';
|
|
22
|
+
export type { INavLink, Role, RoleLevels, } from './components/Sidebar/hooks/useNavLinks';
|
|
17
23
|
export type { SessionLocalStorage } from './interfaces/User/SessionLocalStorage';
|
|
18
24
|
export { Icons } from './Icons/Icons';
|