prometeo-design-system 3.1.7 → 4.0.0
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/Icons/ReassignmentFill.es.js +1 -1
- package/dist/Icons/StarFill.d.ts +6 -0
- package/dist/Icons/StarFill.es.js +19 -0
- package/dist/Icons/components/StarFill.d.ts +4 -0
- package/dist/Icons/index.d.ts +1 -0
- package/dist/Icons/types.d.ts +4 -2
- package/dist/Icons.es.js +18 -16
- package/dist/Input.es.js +56 -52
- package/dist/PyrionLayout.d.ts +6 -0
- package/dist/PyrionLayout.es.js +1308 -0
- package/dist/RecurrentDatePicker.es.js +1 -1
- package/dist/Scrollable.es.js +118 -86
- package/dist/components/Input/Input.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +18 -11
- package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawerActions.d.ts +3 -2
- package/dist/components/NavigationDrawer/NavigationDrawerSidebar.d.ts +11 -0
- package/dist/components/NotificationCard/NotificationCard.d.ts +3 -2
- package/dist/components/PyrionNavigationDrawer/PLContent.d.ts +10 -0
- package/dist/components/PyrionNavigationDrawer/PLFooter.d.ts +20 -0
- package/dist/components/PyrionNavigationDrawer/PLHeader.d.ts +10 -0
- package/dist/components/PyrionNavigationDrawer/PLHelpSection.d.ts +8 -0
- package/dist/components/PyrionNavigationDrawer/{PyrionNavigationDrawerMobileAppSwitcher.d.ts → PLMobileAppSwitcher.d.ts} +3 -3
- package/dist/components/PyrionNavigationDrawer/PLNotificationsList.d.ts +15 -0
- package/dist/components/PyrionNavigationDrawer/PLSidebar.d.ts +12 -0
- package/dist/components/PyrionNavigationDrawer/PLSidebarContent.d.ts +17 -0
- package/dist/components/PyrionNavigationDrawer/{PyrionNavigationDrawerSystemLogo.d.ts → PLSystemLogo.d.ts} +1 -1
- package/dist/components/PyrionNavigationDrawer/PLSystemSessions.d.ts +14 -0
- package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +41 -0
- package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +143 -0
- package/dist/components/PyrionNavigationDrawer/index.d.ts +3 -2
- package/dist/components/Scrollable/Scrollable.d.ts +1 -0
- package/dist/exports/PyrionLayout.d.ts +2 -0
- package/dist/exports/usePyrionNavigation.d.ts +1 -1
- package/dist/prometeo-design-system.es.js +2423 -402
- package/dist/styles.css +1 -1
- package/dist/usePyrionNavigation.es.js +1 -1
- package/package.json +5 -13
- package/dist/LayoutGeneric-CfWhV1ov.js +0 -26
- package/dist/LayoutGeneric.d.ts +0 -6
- package/dist/LayoutGeneric.es.js +0 -4
- package/dist/PyrionNavigationDrawer.d.ts +0 -6
- package/dist/PyrionNavigationDrawer.es.js +0 -962
- package/dist/components/PyrionNavigationDrawer/PyrionHelpSection.d.ts +0 -8
- package/dist/components/PyrionNavigationDrawer/PyrionNavigationDrawer.d.ts +0 -130
- package/dist/components/PyrionNavigationDrawer/PyrionNotificationsList.d.ts +0 -8
- package/dist/components/PyrionNavigationDrawer/SidebarContent.d.ts +0 -13
- package/dist/components/PyrionNavigationDrawer/SystemSessions.d.ts +0 -12
- package/dist/exports/LayoutGeneric.d.ts +0 -2
- package/dist/exports/PyrionNavigationDrawer.d.ts +0 -2
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { NavigationDrawerActionItemProps } from '../NavigationDrawer/NavigationDrawerActionItem';
|
|
3
|
+
import { NavigationDrawerLinkItemProps } from '../NavigationDrawer/NavigationDrawerLinkItem';
|
|
4
|
+
import { TabSwitchElement } from '../TabSwitch/TabSwitch';
|
|
5
|
+
import { TicketCardHandlerProps } from '../TicketCard';
|
|
6
|
+
import { NotificationsListControlsHandler } from './PLNotificationsList';
|
|
7
|
+
import { PLSidebarContentHandle } from './PLSidebarContent';
|
|
8
|
+
import { AuthSession, PyrionNavigationControls, PyrionNavigationDrawerOptions, PyrionNavigationDrawerProps } from './PyrionLayout';
|
|
9
|
+
export type TLayoutBaseProps<TAppMetadata = unknown, TNotificationMetadata = unknown> = {
|
|
10
|
+
links?: NavigationDrawerLinkItemProps[];
|
|
11
|
+
handleNavigation: (path: string) => void;
|
|
12
|
+
allActions: NavigationDrawerActionItemProps[];
|
|
13
|
+
activeActionId?: string;
|
|
14
|
+
onActionClick?: (id: string, payload?: any) => void;
|
|
15
|
+
state: PyrionNavigationDrawerProps<TAppMetadata, TNotificationMetadata>['state'];
|
|
16
|
+
currentAppSessions: AuthSession<TAppMetadata>[];
|
|
17
|
+
resolveUserSecondarySlot: (metadata?: TAppMetadata) => ReactNode | string | null;
|
|
18
|
+
resolveSessionSecondarySlot: (session: AuthSession<TAppMetadata>) => ReactNode | string | null;
|
|
19
|
+
onSessionClick?: (session: AuthSession<TAppMetadata>) => void;
|
|
20
|
+
onLogoutClick?: () => void;
|
|
21
|
+
options?: PyrionNavigationDrawerOptions<TAppMetadata>;
|
|
22
|
+
currentSystemId: string;
|
|
23
|
+
userOptionsControls: React.RefObject<TicketCardHandlerProps | null>;
|
|
24
|
+
mobileAppSwitcherControls: React.RefObject<TicketCardHandlerProps | null>;
|
|
25
|
+
onSystemLogoClick?: (collapsed?: boolean) => void;
|
|
26
|
+
tabs: TabSwitchElement[];
|
|
27
|
+
helpSection?: ReactNode | (() => ReactNode);
|
|
28
|
+
sidebarContentRef: React.RefObject<PLSidebarContentHandle | null>;
|
|
29
|
+
initialSectionRef: React.RefObject<'notifications' | 'help'>;
|
|
30
|
+
navigationControlsRef: React.RefObject<PyrionNavigationControls<TNotificationMetadata>>;
|
|
31
|
+
notificationsListControls?: React.RefObject<NotificationsListControlsHandler<TNotificationMetadata> | null>;
|
|
32
|
+
outletRef: React.RefObject<HTMLDivElement | null>;
|
|
33
|
+
};
|
|
34
|
+
type LayoutBaseComponent = <TAppMetadata = unknown, TNotificationMetadata = unknown>(props: TLayoutBaseProps<TAppMetadata, TNotificationMetadata> & {
|
|
35
|
+
children?: ReactNode;
|
|
36
|
+
}) => ReactElement;
|
|
37
|
+
type LayoutBaseMemoComponent = LayoutBaseComponent & {
|
|
38
|
+
displayName?: string;
|
|
39
|
+
};
|
|
40
|
+
declare const LayoutBase: LayoutBaseMemoComponent;
|
|
41
|
+
export default LayoutBase;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { NavigationDrawerActionItemProps } from '../NavigationDrawer/NavigationDrawerActionItem';
|
|
3
|
+
import { NavigationDrawerLinkItemProps } from '../NavigationDrawer/NavigationDrawerLinkItem';
|
|
4
|
+
import { NotificationCardProps } from '../NotificationCard/NotificationCard';
|
|
5
|
+
import { AllOptionAccessor } from '../Shared/types';
|
|
6
|
+
import { TabSwitchElement } from '../TabSwitch/TabSwitch';
|
|
7
|
+
import { subImageUrlAccessor } from './PLSystemSessions';
|
|
8
|
+
import { NavigationDrawerSidebarProps } from '../NavigationDrawer/NavigationDrawerSidebar';
|
|
9
|
+
type TProduct = {
|
|
10
|
+
name: string;
|
|
11
|
+
domain: string;
|
|
12
|
+
active: boolean;
|
|
13
|
+
coverImage?: string;
|
|
14
|
+
thumbnail?: string;
|
|
15
|
+
};
|
|
16
|
+
type TCompany = {
|
|
17
|
+
name: string;
|
|
18
|
+
products?: TProduct[];
|
|
19
|
+
icon?: string;
|
|
20
|
+
};
|
|
21
|
+
type TUser = {
|
|
22
|
+
_id: string;
|
|
23
|
+
name: string;
|
|
24
|
+
surname?: string;
|
|
25
|
+
email?: string;
|
|
26
|
+
profile_picture?: string;
|
|
27
|
+
};
|
|
28
|
+
type TAuthUser = TUser & {
|
|
29
|
+
company: TCompany;
|
|
30
|
+
};
|
|
31
|
+
export type TSystem = {
|
|
32
|
+
name: string;
|
|
33
|
+
url: string;
|
|
34
|
+
coverImage?: string;
|
|
35
|
+
thumbnail?: string;
|
|
36
|
+
_id: string;
|
|
37
|
+
};
|
|
38
|
+
export interface AuthSession<TAppMetadata> {
|
|
39
|
+
_id: string;
|
|
40
|
+
token: string;
|
|
41
|
+
expires_at: string;
|
|
42
|
+
logoutDate?: string;
|
|
43
|
+
auth_id: TAuthUser;
|
|
44
|
+
metadata?: TAppMetadata;
|
|
45
|
+
}
|
|
46
|
+
export interface NavigationDrawerTabsProps {
|
|
47
|
+
currentTabName?: string;
|
|
48
|
+
customTabs?: TabSwitchElement[];
|
|
49
|
+
onTabClick?: (name: string) => void;
|
|
50
|
+
}
|
|
51
|
+
type AvailableData<TAppMetadata> = {
|
|
52
|
+
company: TCompany;
|
|
53
|
+
user: TUser;
|
|
54
|
+
system?: TSystem;
|
|
55
|
+
metadata?: TAppMetadata;
|
|
56
|
+
};
|
|
57
|
+
type SessionAvailableData<TAppMetadata> = {
|
|
58
|
+
company: TCompany;
|
|
59
|
+
user: TAuthUser;
|
|
60
|
+
system?: TSystem;
|
|
61
|
+
metadata?: TAppMetadata;
|
|
62
|
+
};
|
|
63
|
+
type MetadataFallback<T> = unknown extends T ? `metadata${string}` : never;
|
|
64
|
+
type UserCardAccesors<TAppMetadata> = AllOptionAccessor<AvailableData<TAppMetadata>, string> | MetadataFallback<TAppMetadata>;
|
|
65
|
+
type SessionCardAccesors<TAppMetadata> = AllOptionAccessor<SessionAvailableData<TAppMetadata>, string> | MetadataFallback<TAppMetadata>;
|
|
66
|
+
interface UserCardOptions<TAppMetadata> {
|
|
67
|
+
secondarySlot: UserCardAccesors<TAppMetadata> | [UserCardAccesors<TAppMetadata>, UserCardAccesors<TAppMetadata>] | ((data: AvailableData<TAppMetadata>) => React.ReactNode);
|
|
68
|
+
}
|
|
69
|
+
interface SessionCardOptions<TAppMetadata> {
|
|
70
|
+
secondarySlot: SessionCardAccesors<TAppMetadata> | [SessionCardAccesors<TAppMetadata>, SessionCardAccesors<TAppMetadata>] | ((data: SessionAvailableData<TAppMetadata>) => React.ReactNode);
|
|
71
|
+
subImageUrlAccessor?: subImageUrlAccessor<TAppMetadata>;
|
|
72
|
+
}
|
|
73
|
+
export interface NotificationsDrawerOptions {
|
|
74
|
+
hide?: boolean;
|
|
75
|
+
hideActionButton?: boolean;
|
|
76
|
+
onMarkAllAsRead?: () => void;
|
|
77
|
+
}
|
|
78
|
+
export interface HelpSectionDrawerOptions {
|
|
79
|
+
hide?: boolean;
|
|
80
|
+
hideActionButton?: boolean;
|
|
81
|
+
}
|
|
82
|
+
export interface ConfigurationActionOptions {
|
|
83
|
+
hideActionButton?: boolean;
|
|
84
|
+
onClick: VoidFunction;
|
|
85
|
+
}
|
|
86
|
+
export interface PyrionNavigationDrawerOptions<TAppMetadata> {
|
|
87
|
+
userCardOptions?: UserCardOptions<TAppMetadata>;
|
|
88
|
+
sessionCardOptions?: SessionCardOptions<TAppMetadata>;
|
|
89
|
+
notificationsDrawerOptions?: NotificationsDrawerOptions;
|
|
90
|
+
helpSectionDrawerOptions?: HelpSectionDrawerOptions;
|
|
91
|
+
configurationActionOptions?: ConfigurationActionOptions;
|
|
92
|
+
sidebarOptions: Pick<NavigationDrawerSidebarProps, 'modal' | 'closeOnOverlayClick'>;
|
|
93
|
+
disableDragOpen?: {
|
|
94
|
+
drawer?: boolean;
|
|
95
|
+
sidebar?: boolean;
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
export interface PyrionNavigationDrawerProps<TAppMetadata, TNotificationMetadata = unknown> {
|
|
99
|
+
links?: NavigationDrawerLinkItemProps[];
|
|
100
|
+
actions?: NavigationDrawerActionItemProps[];
|
|
101
|
+
tabsProps?: NavigationDrawerTabsProps;
|
|
102
|
+
activeActionId?: string;
|
|
103
|
+
currentSystemId: string;
|
|
104
|
+
helpSection?: ReactNode | (() => ReactNode);
|
|
105
|
+
children?: ReactNode;
|
|
106
|
+
state: {
|
|
107
|
+
company: TCompany;
|
|
108
|
+
enabled_systems: TSystem[];
|
|
109
|
+
user: TUser;
|
|
110
|
+
sessions?: AuthSession<TAppMetadata>[];
|
|
111
|
+
metadata?: TAppMetadata;
|
|
112
|
+
};
|
|
113
|
+
options?: PyrionNavigationDrawerOptions<TAppMetadata>;
|
|
114
|
+
onActionClick?: (id: string, payload?: any) => void;
|
|
115
|
+
onLinkClick?: (path: string) => void;
|
|
116
|
+
onSessionClick?: (session: AuthSession<TAppMetadata>) => void;
|
|
117
|
+
onNavigate?: (from: string, to: string) => void;
|
|
118
|
+
onSystemLogoClick?: (collapsed?: boolean) => void;
|
|
119
|
+
onLogoutClick?: () => void;
|
|
120
|
+
}
|
|
121
|
+
export type PyrionNavigationControls<TNotificationMetadata = unknown> = {
|
|
122
|
+
toggleCollapse?: () => void;
|
|
123
|
+
getIsCollapsed?: () => boolean;
|
|
124
|
+
subscribeToCollapse?: (listener: (collapsed: boolean) => void) => () => void;
|
|
125
|
+
openSidebar?: () => void;
|
|
126
|
+
closeSidebar?: () => void;
|
|
127
|
+
toggleSidebar?: () => void;
|
|
128
|
+
getIsSidebarOpen?: () => boolean;
|
|
129
|
+
subscribeToSidebarOpen?: (listener: (open: boolean) => void) => () => void;
|
|
130
|
+
setDrawerDragEnabled?: (enabled: boolean) => void;
|
|
131
|
+
setSidebarDragEnabled?: (enabled: boolean) => void;
|
|
132
|
+
openHelp?: () => void;
|
|
133
|
+
openNotifications?: () => void;
|
|
134
|
+
showErrorModal?: (disableDrawer: boolean) => void;
|
|
135
|
+
addNewNotification?: (notification: NotificationCardProps<TNotificationMetadata> | NotificationCardProps<TNotificationMetadata>[]) => void;
|
|
136
|
+
subscribeToNotificationsUpdates?: (callback: (notifications: NotificationCardProps<TNotificationMetadata>[], count: number) => void) => () => void;
|
|
137
|
+
setNotifications?: (notifications: NotificationCardProps<TNotificationMetadata>[]) => void;
|
|
138
|
+
removeAllNotifications?: () => void;
|
|
139
|
+
removeNotification?: (id: string | string[]) => void;
|
|
140
|
+
};
|
|
141
|
+
export declare const usePyrionNavigation: <TNotificationMetadata = unknown>() => PyrionNavigationControls<TNotificationMetadata>;
|
|
142
|
+
declare const PyrionNavigationDrawer: <TAppMetadata = unknown, TNotificationMetadata = unknown>({ children, helpSection, state, links: navlinks, onLinkClick, onNavigate, onLogoutClick, actions, activeActionId, onActionClick, tabsProps, currentSystemId, onSessionClick, options, onSystemLogoClick }: PyrionNavigationDrawerProps<TAppMetadata, TNotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
|
|
143
|
+
export default PyrionNavigationDrawer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { default as PyrionNavigationDrawer, PyrionNavigationDrawerProps, PyrionNavigationDrawerOptions, NavigationDrawerTabsProps, AuthSession } from './
|
|
2
|
-
|
|
1
|
+
import { default as PyrionNavigationDrawer, PyrionNavigationDrawerProps, PyrionNavigationDrawerOptions, NavigationDrawerTabsProps, AuthSession } from './PyrionLayout';
|
|
2
|
+
import { NotificationCardProps } from '../NotificationCard';
|
|
3
|
+
export { type PyrionNavigationDrawerProps, type PyrionNavigationDrawerOptions, type NavigationDrawerTabsProps, type AuthSession, type NotificationCardProps };
|
|
3
4
|
export default PyrionNavigationDrawer;
|
|
@@ -26,6 +26,7 @@ export interface ScrollableProps {
|
|
|
26
26
|
scrollbarProps?: ScrollbarProps;
|
|
27
27
|
disableMouseScroll?: boolean;
|
|
28
28
|
defaultBehavior?: 'scroll-on-click' | 'scroll-on-hover' | 'none';
|
|
29
|
+
persistScroll?: boolean | string;
|
|
29
30
|
}
|
|
30
31
|
declare const Scrollable: (props: ScrollableProps) => import("react/jsx-runtime").JSX.Element;
|
|
31
32
|
export default Scrollable;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { usePyrionNavigation as default } from '../components/PyrionNavigationDrawer/
|
|
1
|
+
export { usePyrionNavigation as default } from '../components/PyrionNavigationDrawer/PyrionLayout';
|