prometeo-design-system 3.1.7 → 4.1.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/{CardProfile-y9Knsg26.js → CardProfile-C1F83KJV.js} +1 -1
- package/dist/CardProfile.es.js +1 -1
- package/dist/{DatePicker-6eb-0Ns5.js → DatePicker-QuBgR5DQ.js} +799 -794
- package/dist/DatePicker.es.js +1 -1
- package/dist/DialogModal.es.js +25 -22
- 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/PlainTooltip.d.ts +6 -0
- package/dist/PlainTooltip.es.js +72 -0
- package/dist/PyrionLayout.d.ts +6 -0
- package/dist/PyrionLayout.es.js +1357 -0
- package/dist/RecurrentDatePicker.es.js +2 -2
- package/dist/RecurrentDatePickerRRule.es.js +1 -1
- package/dist/Scrollable.es.js +118 -86
- package/dist/Select.es.js +524 -524
- package/dist/SelectSearch.es.js +44 -43
- package/dist/TabLinks.es.js +81 -52
- package/dist/{badge-B1IK_-i5.js → badge-CbqYNrl4.js} +28 -28
- package/dist/components/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/Input/Input.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawer.d.ts +19 -11
- package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +5 -3
- package/dist/components/NavigationDrawer/NavigationDrawerActions.d.ts +3 -3
- package/dist/components/NavigationDrawer/NavigationDrawerItemBase.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawerLinkItem.d.ts +3 -2
- package/dist/components/NavigationDrawer/NavigationDrawerNavlinks.d.ts +2 -2
- package/dist/components/NavigationDrawer/NavigationDrawerSidebar.d.ts +11 -0
- package/dist/components/NotificationCard/NotificationCard.d.ts +3 -2
- package/dist/components/PlainTooltip/PlainTooltip.d.ts +11 -0
- package/dist/components/PyrionNavigationDrawer/PLContent.d.ts +10 -0
- package/dist/components/PyrionNavigationDrawer/PLFooter.d.ts +21 -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 +42 -0
- package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +146 -0
- package/dist/components/PyrionNavigationDrawer/index.d.ts +3 -2
- package/dist/components/Scrollable/Scrollable.d.ts +1 -0
- package/dist/components/Select/Select.d.ts +1 -0
- package/dist/components/TabLinks/TabLinks.d.ts +10 -1
- package/dist/components/TabSwitch/TabSwitch.d.ts +2 -0
- package/dist/exports/PlainTooltip.d.ts +2 -0
- package/dist/exports/PyrionLayout.d.ts +2 -0
- package/dist/exports/usePyrionNavigation.d.ts +1 -1
- package/dist/hooks/useDevice.d.ts +1 -0
- package/dist/index.d.ts +0 -1
- package/dist/prometeo-design-system.es.js +2421 -402
- package/dist/styles.css +1 -1
- package/dist/useDevice-vwn4GLwK.js +16 -0
- package/dist/useDevice.es.js +2 -11
- package/dist/usePyrionNavigation.es.js +1 -1
- package/package.json +8 -16
- package/src/styles/base.css +1 -0
- 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/SwipeContainer.d.ts +0 -4
- package/dist/SwipeContainer.es.js +0 -185
- 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/components/SwipeContainer/SwipeContainer.d.ts +0 -19
- package/dist/exports/LayoutGeneric.d.ts +0 -2
- package/dist/exports/PyrionNavigationDrawer.d.ts +0 -2
- package/dist/exports/SwipeContainer.d.ts +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { IconComponent } from '../../Icons/types';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { NavItemSecondaryProps } from './NavItemSecondary';
|
|
4
|
-
export interface
|
|
4
|
+
export interface PyrionLayoutLinkItemProps {
|
|
5
5
|
path: string;
|
|
6
6
|
title: string;
|
|
7
7
|
icon?: IconComponent;
|
|
@@ -17,6 +17,7 @@ export interface NavigationDrawerLinkItemProps {
|
|
|
17
17
|
onClick?: (path: string) => void;
|
|
18
18
|
sublinks?: NavItemSecondaryProps[];
|
|
19
19
|
subLinksRender?: (sublinks: NavItemSecondaryProps[], controls: NavItemHandler) => ReactNode;
|
|
20
|
+
tooltipText?: string;
|
|
20
21
|
}
|
|
21
22
|
interface NavItemHandler {
|
|
22
23
|
toggle: () => void;
|
|
@@ -26,5 +27,5 @@ interface NavItemHandler {
|
|
|
26
27
|
toggleDrawerCollapse?: () => void;
|
|
27
28
|
subscribeToCollapse?: (listener: (collapsed: boolean) => void) => () => void;
|
|
28
29
|
}
|
|
29
|
-
declare const NavigationDrawerLinkItem: import('react').NamedExoticComponent<
|
|
30
|
+
declare const NavigationDrawerLinkItem: import('react').NamedExoticComponent<PyrionLayoutLinkItemProps & import('react').RefAttributes<NavItemHandler>>;
|
|
30
31
|
export default NavigationDrawerLinkItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PyrionLayoutLinkItemProps } from './NavigationDrawerLinkItem';
|
|
2
2
|
export interface NavigationDrawerNavlinksProps {
|
|
3
|
-
navlinks?:
|
|
3
|
+
navlinks?: PyrionLayoutLinkItemProps[];
|
|
4
4
|
handleNavigation: (path: string) => void;
|
|
5
5
|
className?: string;
|
|
6
6
|
getIsCollapsed?: () => boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NavigationDrawerRenderContext, NavigationDrawerSlotChildren } from './NavigationDrawer';
|
|
2
|
+
export type NavigationDrawerSidebarProps = {
|
|
3
|
+
children?: NavigationDrawerSlotChildren;
|
|
4
|
+
className?: string;
|
|
5
|
+
context?: NavigationDrawerRenderContext;
|
|
6
|
+
modal?: boolean;
|
|
7
|
+
closeOnOverlayClick?: boolean;
|
|
8
|
+
unmountChildrenOnClose?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare const Sidebar: import('react').NamedExoticComponent<NavigationDrawerSidebarProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export default Sidebar;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { ButtonVariant } from '../Shared/types';
|
|
3
|
-
export interface NotificationAction<NotificationMetadata =
|
|
3
|
+
export interface NotificationAction<NotificationMetadata = any> {
|
|
4
4
|
label: string;
|
|
5
5
|
onClick: (metadata?: NotificationMetadata) => void;
|
|
6
6
|
variant?: ButtonVariant;
|
|
@@ -11,7 +11,8 @@ export interface NoitificationUser {
|
|
|
11
11
|
name: string;
|
|
12
12
|
profile_picture?: string;
|
|
13
13
|
}
|
|
14
|
-
export interface NotificationCardProps<NotificationMetadata =
|
|
14
|
+
export interface NotificationCardProps<NotificationMetadata = any> {
|
|
15
|
+
_id: string;
|
|
15
16
|
user: NoitificationUser;
|
|
16
17
|
body: string | React.ReactNode | ((metadata?: NotificationMetadata) => React.ReactNode);
|
|
17
18
|
date: string | Date;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface PlainTooltipProps {
|
|
2
|
+
title: string;
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
delayToShow?: number;
|
|
5
|
+
delayToClose?: number;
|
|
6
|
+
className?: string;
|
|
7
|
+
attachToParent?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare const PlainTooltip: import('react').MemoExoticComponent<({ title, children, delayToShow, delayToClose, className, attachToParent, disabled }: PlainTooltipProps) => string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | null | undefined>;
|
|
11
|
+
export default PlainTooltip;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { PyrionLayoutActionItemProps } from '../NavigationDrawer/NavigationDrawerActionItem';
|
|
2
|
+
import { PyrionLayoutLinkItemProps } from '../NavigationDrawer/NavigationDrawerLinkItem';
|
|
3
|
+
declare const DrawerContent: import('react').MemoExoticComponent<({ navlinks, handleNavigation, allActions, activeActionId, onActionClick }: {
|
|
4
|
+
navlinks?: PyrionLayoutLinkItemProps[];
|
|
5
|
+
handleNavigation: (path: string) => void;
|
|
6
|
+
allActions: PyrionLayoutActionItemProps[];
|
|
7
|
+
activeActionId?: string;
|
|
8
|
+
onActionClick?: (id: string, payload?: any) => void;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
export default DrawerContent;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TicketCardHandlerProps } from '../TicketCard';
|
|
3
|
+
import { AuthSession, PyrionLayoutOptions, PyrionNavigationDrawerProps } from './PyrionLayout';
|
|
4
|
+
export interface DrawerFooterProps<TAppMetadata> {
|
|
5
|
+
state: PyrionNavigationDrawerProps<TAppMetadata>['state'];
|
|
6
|
+
currentAppSessions: AuthSession<TAppMetadata>[];
|
|
7
|
+
resolveUserSecondarySlot: (metadata?: TAppMetadata) => ReactNode | string | null;
|
|
8
|
+
resolveSessionSecondarySlot: (session: AuthSession<TAppMetadata>) => ReactNode | string | null;
|
|
9
|
+
onSessionClick?: (session: AuthSession<TAppMetadata>) => void;
|
|
10
|
+
onLogoutClick?: () => void;
|
|
11
|
+
onProfileClick?: (collapsed: boolean) => void;
|
|
12
|
+
options?: PyrionLayoutOptions<TAppMetadata>;
|
|
13
|
+
currentSystemId: string;
|
|
14
|
+
userOptionsControls: React.RefObject<TicketCardHandlerProps | null>;
|
|
15
|
+
mobileAppSwitcherControls: React.RefObject<TicketCardHandlerProps | null>;
|
|
16
|
+
}
|
|
17
|
+
type DrawerFooterComponent = <TAppMetadata = unknown>(props: DrawerFooterProps<TAppMetadata>) => React.ReactElement;
|
|
18
|
+
declare const DrawerFooter: DrawerFooterComponent & {
|
|
19
|
+
displayName?: string;
|
|
20
|
+
};
|
|
21
|
+
export default DrawerFooter;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TabSwitchElement } from '../TabSwitch/TabSwitch';
|
|
2
|
+
import { TicketCardHandlerProps } from '../TicketCard';
|
|
3
|
+
declare const DrawerHeader: import('react').MemoExoticComponent<({ onSystemLogoClick, state, currentSystemId, tabs, mobileAppSwitcherControls }: {
|
|
4
|
+
onSystemLogoClick?: (collapsed?: boolean) => void;
|
|
5
|
+
state: any;
|
|
6
|
+
currentSystemId: string;
|
|
7
|
+
tabs: TabSwitchElement[];
|
|
8
|
+
mobileAppSwitcherControls: React.RefObject<TicketCardHandlerProps | null>;
|
|
9
|
+
}) => import("react/jsx-runtime").JSX.Element>;
|
|
10
|
+
export default DrawerHeader;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
interface PLHelpSectionProps {
|
|
3
|
+
onCloseClick?: VoidFunction;
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
title?: string;
|
|
6
|
+
}
|
|
7
|
+
declare const PLHelpSection: ({ onCloseClick, children, title }: PLHelpSectionProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export default PLHelpSection;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { TabSwitchElement } from '../TabSwitch/TabSwitch';
|
|
3
3
|
import { TicketCardHandlerProps } from '../TicketCard/TicketCard';
|
|
4
|
-
export interface
|
|
4
|
+
export interface PLMobileAppSwitcherProps {
|
|
5
5
|
tabs: TabSwitchElement[];
|
|
6
6
|
content: React.ReactNode | (() => React.ReactNode);
|
|
7
7
|
controls?: React.RefObject<TicketCardHandlerProps | null>;
|
|
8
8
|
}
|
|
9
|
-
declare const
|
|
10
|
-
export default
|
|
9
|
+
declare const PLMobileAppSwitcher: ({ tabs, content, controls }: PLMobileAppSwitcherProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default PLMobileAppSwitcher;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { NotificationCardProps } from '../NotificationCard/NotificationCard';
|
|
2
|
+
interface PLNotificationsDrawerProps<NotificationMetadata> {
|
|
3
|
+
onCloseClick?: VoidFunction;
|
|
4
|
+
onMarkAllAsRead?: () => void;
|
|
5
|
+
notificationsListControls?: React.RefObject<NotificationsListControlsHandler<NotificationMetadata> | null>;
|
|
6
|
+
}
|
|
7
|
+
export interface NotificationsListControlsHandler<NotificationMetadata> {
|
|
8
|
+
addNewNotification: (notification: NotificationCardProps<NotificationMetadata> | NotificationCardProps<NotificationMetadata>[]) => void;
|
|
9
|
+
subscribeToUpdates: (callback: (notifications: NotificationCardProps<NotificationMetadata>[], count: number) => void) => () => void;
|
|
10
|
+
removeNotification: (id: string | string[]) => void;
|
|
11
|
+
removeAllNotifications: () => void;
|
|
12
|
+
setNotifications: (notifications: NotificationCardProps<NotificationMetadata>[]) => void;
|
|
13
|
+
}
|
|
14
|
+
declare const PLNotificationsList: <NotificationMetadata = unknown>({ onCloseClick, onMarkAllAsRead, notificationsListControls }: PLNotificationsDrawerProps<NotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export default PLNotificationsList;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { PLSidebarContentHandle } from './PLSidebarContent';
|
|
3
|
+
import { NotificationsListControlsHandler } from './PLNotificationsList';
|
|
4
|
+
declare const _DrawerSidebarWrapper: <TNotificationMetadata = unknown>({ options, helpSection, sidebarContentRef, initialSectionRef, notificationsListControls, }: {
|
|
5
|
+
options?: any;
|
|
6
|
+
helpSection?: ReactNode | (() => ReactNode);
|
|
7
|
+
sidebarContentRef: React.RefObject<PLSidebarContentHandle | null>;
|
|
8
|
+
initialSectionRef: React.RefObject<"notifications" | "help">;
|
|
9
|
+
notificationsListControls?: React.RefObject<NotificationsListControlsHandler<TNotificationMetadata> | null>;
|
|
10
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const DrawerSidebarWrapper: typeof _DrawerSidebarWrapper;
|
|
12
|
+
export default DrawerSidebarWrapper;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ReactElement, ReactNode, ForwardedRef } from 'react';
|
|
2
|
+
import { PyrionLayoutOptions } from './PyrionLayout';
|
|
3
|
+
import { NotificationsListControlsHandler } from './PLNotificationsList';
|
|
4
|
+
export type PLSidebarContentHandle = {
|
|
5
|
+
setActiveSection: (section: 'notifications' | 'help') => void;
|
|
6
|
+
};
|
|
7
|
+
export type PLSidebarContentProps<TNotificationMetadata = unknown> = {
|
|
8
|
+
closeSidebar: () => void;
|
|
9
|
+
options?: PyrionLayoutOptions<any>;
|
|
10
|
+
helpSection?: ReactNode | (() => ReactNode);
|
|
11
|
+
initialSection?: 'notifications' | 'help';
|
|
12
|
+
notificationsListControls?: React.RefObject<NotificationsListControlsHandler<TNotificationMetadata> | null>;
|
|
13
|
+
};
|
|
14
|
+
declare const PLSidebarContent: <TNotificationMetadata = unknown>(props: PLSidebarContentProps<TNotificationMetadata> & {
|
|
15
|
+
ref?: ForwardedRef<PLSidebarContentHandle>;
|
|
16
|
+
}) => ReactElement | null;
|
|
17
|
+
export default PLSidebarContent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AllOptionAccessor } from '../Shared/types';
|
|
2
|
+
import { AuthSession } from './PyrionLayout';
|
|
3
|
+
export interface PLSystemSessionsProps<TAppMetadata> {
|
|
4
|
+
sessions?: AuthSession<TAppMetadata>[];
|
|
5
|
+
onSessionClick?: (session: AuthSession<TAppMetadata>) => void;
|
|
6
|
+
secondarySlot?: React.ReactNode | string | ((session: AuthSession<TAppMetadata>) => React.ReactNode | string | null) | null;
|
|
7
|
+
subImageUrlAccessor?: subImageUrlAccessor<TAppMetadata>;
|
|
8
|
+
currentSystemId: string;
|
|
9
|
+
}
|
|
10
|
+
export type subImageUrlAccessor<TAppMetadata> = AllOptionAccessor<{
|
|
11
|
+
metadata: TAppMetadata;
|
|
12
|
+
}, string>;
|
|
13
|
+
declare const PLSystemSessions: <TAppMetadata = unknown>(props: PLSystemSessionsProps<TAppMetadata>) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export default PLSystemSessions;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactElement, ReactNode } from 'react';
|
|
2
|
+
import { PyrionLayoutActionItemProps } from '../NavigationDrawer/NavigationDrawerActionItem';
|
|
3
|
+
import { PyrionLayoutLinkItemProps } 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, PyrionLayoutOptions, PyrionNavigationDrawerProps } from './PyrionLayout';
|
|
9
|
+
export type TLayoutBaseProps<TAppMetadata = unknown, TNotificationMetadata = unknown> = {
|
|
10
|
+
links?: PyrionLayoutLinkItemProps[];
|
|
11
|
+
handleNavigation: (path: string) => void;
|
|
12
|
+
allActions: PyrionLayoutActionItemProps[];
|
|
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?: PyrionLayoutOptions<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
|
+
onProfileClick?: (collapsed: boolean) => void;
|
|
34
|
+
};
|
|
35
|
+
type LayoutBaseComponent = <TAppMetadata = unknown, TNotificationMetadata = unknown>(props: TLayoutBaseProps<TAppMetadata, TNotificationMetadata> & {
|
|
36
|
+
children?: ReactNode;
|
|
37
|
+
}) => ReactElement;
|
|
38
|
+
type LayoutBaseMemoComponent = LayoutBaseComponent & {
|
|
39
|
+
displayName?: string;
|
|
40
|
+
};
|
|
41
|
+
declare const LayoutBase: LayoutBaseMemoComponent;
|
|
42
|
+
export default LayoutBase;
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import { default as React, ReactNode } from 'react';
|
|
2
|
+
import { PyrionLayoutActionItemProps } from '../NavigationDrawer/NavigationDrawerActionItem';
|
|
3
|
+
import { PyrionLayoutLinkItemProps } from '../NavigationDrawer/NavigationDrawerLinkItem';
|
|
4
|
+
import { NavigationDrawerSidebarProps } from '../NavigationDrawer/NavigationDrawerSidebar';
|
|
5
|
+
import { NotificationCardProps } from '../NotificationCard/NotificationCard';
|
|
6
|
+
import { AllOptionAccessor } from '../Shared/types';
|
|
7
|
+
import { TabSwitchElement } from '../TabSwitch/TabSwitch';
|
|
8
|
+
import { subImageUrlAccessor } from './PLSystemSessions';
|
|
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 PyrionLayoutTabsProps {
|
|
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 PyrionLayoutOptions<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
|
+
closeDrawerOnNavigate?: boolean;
|
|
94
|
+
disableDragOpen?: {
|
|
95
|
+
drawer?: boolean;
|
|
96
|
+
sidebar?: boolean;
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
export interface PyrionNavigationDrawerProps<TAppMetadata, TNotificationMetadata = unknown> {
|
|
100
|
+
links?: PyrionLayoutLinkItemProps[];
|
|
101
|
+
actions?: PyrionLayoutActionItemProps[];
|
|
102
|
+
tabsProps?: PyrionLayoutTabsProps;
|
|
103
|
+
activeActionId?: string;
|
|
104
|
+
currentSystemId: string;
|
|
105
|
+
helpSection?: ReactNode | (() => ReactNode);
|
|
106
|
+
children?: ReactNode;
|
|
107
|
+
state: {
|
|
108
|
+
company: TCompany;
|
|
109
|
+
enabled_systems: TSystem[];
|
|
110
|
+
user: TUser;
|
|
111
|
+
sessions?: AuthSession<TAppMetadata>[];
|
|
112
|
+
metadata?: TAppMetadata;
|
|
113
|
+
};
|
|
114
|
+
options?: PyrionLayoutOptions<TAppMetadata>;
|
|
115
|
+
onActionClick?: (id: string, payload?: any) => void;
|
|
116
|
+
onLinkClick?: (path: string) => void;
|
|
117
|
+
onSessionClick?: (session: AuthSession<TAppMetadata>) => void;
|
|
118
|
+
onNavigate?: (from: string, to: string) => void;
|
|
119
|
+
onSystemLogoClick?: (collapsed?: boolean) => void;
|
|
120
|
+
onLogoutClick?: () => void;
|
|
121
|
+
onProfileClick?: (collapsed: boolean) => void;
|
|
122
|
+
}
|
|
123
|
+
export type PyrionNavigationControls<TNotificationMetadata = unknown> = {
|
|
124
|
+
toggleCollapse?: () => void;
|
|
125
|
+
getIsCollapsed?: () => boolean;
|
|
126
|
+
subscribeToCollapse?: (listener: (collapsed: boolean) => void) => () => void;
|
|
127
|
+
openSidebar?: () => void;
|
|
128
|
+
closeSidebar?: () => void;
|
|
129
|
+
toggleSidebar?: () => void;
|
|
130
|
+
getIsSidebarOpen?: () => boolean;
|
|
131
|
+
subscribeToSidebarOpen?: (listener: (open: boolean) => void) => () => void;
|
|
132
|
+
setDrawerDragEnabled?: (enabled: boolean) => void;
|
|
133
|
+
setSidebarDragEnabled?: (enabled: boolean) => void;
|
|
134
|
+
openHelp?: () => void;
|
|
135
|
+
openNotifications?: () => void;
|
|
136
|
+
showErrorModal?: (node: (ReactNode | (() => ReactNode)), disableDrawer: boolean, hideCloseButton?: boolean) => void;
|
|
137
|
+
closeErrorModal?: () => void;
|
|
138
|
+
addNewNotification?: (notification: NotificationCardProps<TNotificationMetadata> | NotificationCardProps<TNotificationMetadata>[]) => void;
|
|
139
|
+
subscribeToNotificationsUpdates?: (callback: (notifications: NotificationCardProps<TNotificationMetadata>[], count: number) => void) => () => void;
|
|
140
|
+
setNotifications?: (notifications: NotificationCardProps<TNotificationMetadata>[]) => void;
|
|
141
|
+
removeAllNotifications?: () => void;
|
|
142
|
+
removeNotification?: (id: string | string[]) => void;
|
|
143
|
+
};
|
|
144
|
+
export declare const usePyrionNavigation: <TNotificationMetadata = unknown>() => PyrionNavigationControls<TNotificationMetadata>;
|
|
145
|
+
declare const PyrionNavigationDrawer: <TAppMetadata = unknown, TNotificationMetadata = unknown>({ children, helpSection, state, links: navlinks, onLinkClick, onNavigate, onLogoutClick, actions, activeActionId, onActionClick, tabsProps, currentSystemId, onSessionClick, onSystemLogoClick, onProfileClick, ...props }: PyrionNavigationDrawerProps<TAppMetadata, TNotificationMetadata>) => import("react/jsx-runtime").JSX.Element;
|
|
146
|
+
export default PyrionNavigationDrawer;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { default as PyrionNavigationDrawer, PyrionNavigationDrawerProps,
|
|
2
|
-
|
|
1
|
+
import { default as PyrionNavigationDrawer, PyrionNavigationDrawerProps, PyrionLayoutOptions, PyrionLayoutTabsProps, AuthSession } from './PyrionLayout';
|
|
2
|
+
import { NotificationCardProps } from '../NotificationCard';
|
|
3
|
+
export { type PyrionNavigationDrawerProps, type PyrionLayoutOptions as PyrionNavigationDrawerOptions, type PyrionLayoutTabsProps as 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,8 +1,17 @@
|
|
|
1
|
+
import { IconComponent } from '../../Icons';
|
|
2
|
+
import { PlainTooltipProps } from '../PlainTooltip/PlainTooltip';
|
|
1
3
|
export interface TabItem {
|
|
2
4
|
id: string | number;
|
|
3
5
|
title: string;
|
|
4
6
|
disabled?: boolean;
|
|
5
7
|
description?: string;
|
|
8
|
+
icon?: IconComponent | React.ReactNode | (() => React.ReactNode);
|
|
9
|
+
iconPosition?: "left" | "right" | "top";
|
|
10
|
+
onIconClick?: () => void;
|
|
11
|
+
onIconHover?: () => void;
|
|
12
|
+
iconTooltipTitle?: string;
|
|
13
|
+
iconTooltipProps?: PlainTooltipProps;
|
|
14
|
+
iconSize?: number;
|
|
6
15
|
}
|
|
7
16
|
export interface TabLinksProps {
|
|
8
17
|
readonly items: TabItem[];
|
|
@@ -13,7 +22,7 @@ export interface TabLinksProps {
|
|
|
13
22
|
readonly activeTabClassName?: string;
|
|
14
23
|
readonly indicatorClassName?: string;
|
|
15
24
|
readonly animated?: boolean;
|
|
16
|
-
readonly renderTab?: (item: TabItem, isActive: boolean, onClick: () => void) => React.ReactNode;
|
|
25
|
+
readonly renderTab?: (item: TabItem, isActive: boolean, onClick: () => void, onIconClick?: () => void, onIconHover?: () => void, iconTooltipTitle?: string, iconTooltipProps?: PlainTooltipProps, iconSize?: number) => React.ReactNode;
|
|
17
26
|
}
|
|
18
27
|
declare function TabLinks({ items, activeTab, onTabChange, className, tabClassName, activeTabClassName, indicatorClassName, animated, renderTab, }: TabLinksProps): import("react/jsx-runtime").JSX.Element;
|
|
19
28
|
declare namespace TabLinks {
|
|
@@ -5,11 +5,13 @@ export interface TabSwitchElement {
|
|
|
5
5
|
className?: string;
|
|
6
6
|
onClick?: (name: string) => void;
|
|
7
7
|
disabled?: boolean;
|
|
8
|
+
id?: string;
|
|
8
9
|
}
|
|
9
10
|
export interface TabsSwitchProps {
|
|
10
11
|
tabs: TabSwitchElement[];
|
|
11
12
|
className?: string;
|
|
12
13
|
currentTabName?: string;
|
|
14
|
+
currentSystemId?: string;
|
|
13
15
|
activeColor?: string;
|
|
14
16
|
}
|
|
15
17
|
declare const TabsSwitch: import('react').ForwardRefExoticComponent<TabsSwitchProps & import('react').RefAttributes<HTMLDivElement>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { usePyrionNavigation as default } from '../components/PyrionNavigationDrawer/
|
|
1
|
+
export { usePyrionNavigation as default } from '../components/PyrionNavigationDrawer/PyrionLayout';
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,6 @@ export { default as Select } from './components/Select/Select';
|
|
|
19
19
|
export { default as ChangueAccount } from './components/Sidebar/components/changue-account';
|
|
20
20
|
export { default as Spinner } from './components/Spinner/Spinner';
|
|
21
21
|
export { default as Steps } from './components/Steps/Steps';
|
|
22
|
-
export { default as SwipeContainer } from './components/SwipeContainer/SwipeContainer';
|
|
23
22
|
export { default as Switch } from './components/Switch/Switch';
|
|
24
23
|
export { default as DatePicker } from './components/DatePicker/DatePicker';
|
|
25
24
|
export { default as RecurrentDatePicker } from './components/RecurrentDatePicker/RecurrentDatePicker';
|