@livechat/design-system-react-components 1.29.0 → 1.30.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/components/AppFrame/AppFrame.d.ts +3 -0
- package/dist/components/AppFrame/components/Navigation/Navigation.d.ts +3 -0
- package/dist/components/AppFrame/components/Navigation/types.d.ts +8 -0
- package/dist/components/AppFrame/components/NavigationGroup/NavigationGroup.d.ts +3 -0
- package/dist/components/AppFrame/components/NavigationGroup/types.d.ts +16 -0
- package/dist/components/AppFrame/components/NavigationItem/NavigationItem.d.ts +3 -0
- package/dist/components/AppFrame/components/NavigationItem/types.d.ts +40 -0
- package/dist/components/AppFrame/components/SideNavigation/SideNavigation.d.ts +3 -0
- package/dist/components/AppFrame/components/SideNavigation/types.d.ts +28 -0
- package/dist/components/AppFrame/components/SideNavigationGroup/SideNavigationGroup.d.ts +3 -0
- package/dist/components/AppFrame/components/SideNavigationGroup/types.d.ts +32 -0
- package/dist/components/AppFrame/components/SideNavigationItem/SideNavigationItem.d.ts +3 -0
- package/dist/components/AppFrame/components/SideNavigationItem/constants.d.ts +3 -0
- package/dist/components/AppFrame/components/SideNavigationItem/types.d.ts +44 -0
- package/dist/components/AppFrame/components/index.d.ts +7 -0
- package/dist/components/AppFrame/hooks/useAppFrameAnimations.d.ts +12 -0
- package/dist/components/AppFrame/index.d.ts +2 -0
- package/dist/components/AppFrame/stories-helpers.d.ts +13 -0
- package/dist/components/AppFrame/types.d.ts +38 -0
- package/dist/components/Badge/Badge.d.ts +3 -0
- package/dist/components/StatusBadge/StatusBadge.d.ts +13 -0
- package/dist/components/StatusBadge/index.d.ts +1 -0
- package/dist/components/UpdateBadge/UpdateBadge.d.ts +2 -0
- package/dist/components/UpdateBadge/index.d.ts +1 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +4 -0
- package/dist/index.es.js +2368 -1876
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
3
|
+
export interface INavigationGroupProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* It will display your navigation elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The CSS class for the navigation bar list
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Specify whether the list should be scrollable
|
|
14
|
+
*/
|
|
15
|
+
scrollable?: boolean;
|
|
16
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
3
|
+
export interface INavigationItemProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* The ID of the item
|
|
6
|
+
*/
|
|
7
|
+
id: string;
|
|
8
|
+
/**
|
|
9
|
+
* The label of the item visible in the tooltip
|
|
10
|
+
*/
|
|
11
|
+
label: string;
|
|
12
|
+
/**
|
|
13
|
+
* Container for the icon or any other element
|
|
14
|
+
*/
|
|
15
|
+
icon: React.ReactElement;
|
|
16
|
+
/**
|
|
17
|
+
* The URL to navigate to
|
|
18
|
+
*/
|
|
19
|
+
url: string;
|
|
20
|
+
/**
|
|
21
|
+
* Specify whether the tooltip should be disabled after hover
|
|
22
|
+
*/
|
|
23
|
+
disableTooltip?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Set if you are preparing a custom element as a button icon and you do not want it to be semi-transparent without hover
|
|
26
|
+
*/
|
|
27
|
+
disableOpacity?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Specify whether the badge should be visible and what type it should be
|
|
30
|
+
*/
|
|
31
|
+
badge?: 'dot' | 'alert' | number;
|
|
32
|
+
/**
|
|
33
|
+
* Specify whether the item is active
|
|
34
|
+
*/
|
|
35
|
+
isActive?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The function to call on click
|
|
38
|
+
*/
|
|
39
|
+
onClick: (e: React.MouseEvent<HTMLAnchorElement>, id: string) => void;
|
|
40
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
3
|
+
export interface ISideNavigationProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* It will display your side navigation elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* It will display the title of the side navigation bar
|
|
10
|
+
*/
|
|
11
|
+
title?: string;
|
|
12
|
+
/**
|
|
13
|
+
* It will display the custom element as title of the side navigation bar
|
|
14
|
+
*/
|
|
15
|
+
customHeader?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* It will display the custom element as footer of the side navigation bar
|
|
18
|
+
*/
|
|
19
|
+
customFooter?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Specify whether the gaps between elements should be removed
|
|
22
|
+
*/
|
|
23
|
+
noGaps?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* It will display the custom element on the right side of the side navigation bar title
|
|
26
|
+
*/
|
|
27
|
+
rightNode?: React.ReactNode;
|
|
28
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
3
|
+
export interface ISideNavigationGroupProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* It will display your side navigation elements
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* The label of the side navigation list
|
|
10
|
+
*/
|
|
11
|
+
label?: React.ReactNode | ((isOpen: boolean) => React.ReactNode);
|
|
12
|
+
/**
|
|
13
|
+
* The right node of the side navigation list if `isCollapsible` is set to true
|
|
14
|
+
*/
|
|
15
|
+
rightNode?: React.ReactNode | ((isOpen: boolean) => React.ReactNode);
|
|
16
|
+
/**
|
|
17
|
+
* Specify whether the list should be collapsible
|
|
18
|
+
*/
|
|
19
|
+
isCollapsible?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The function to call on item hover
|
|
22
|
+
*/
|
|
23
|
+
onItemHover?: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* Specify whether the list should be open on the first render
|
|
26
|
+
*/
|
|
27
|
+
shouldOpenOnInit?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Specify whether the list should be open if an item within the group is active
|
|
30
|
+
*/
|
|
31
|
+
shouldOpenOnActive?: boolean;
|
|
32
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentCoreProps } from '../../../../utils/types';
|
|
3
|
+
export interface ISideNavigationItemProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* The label of the item
|
|
6
|
+
*/
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* Custom element on the right side of the side navigation item
|
|
10
|
+
*/
|
|
11
|
+
rightNode?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Custom element on the left side of the side navigation item
|
|
14
|
+
*/
|
|
15
|
+
leftNode?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Specify whether the icon space should be kept
|
|
18
|
+
*/
|
|
19
|
+
shouldKeepIconSpace?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* The URL to navigate to
|
|
22
|
+
*/
|
|
23
|
+
url?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Specify whether the item is active
|
|
26
|
+
*/
|
|
27
|
+
isActive?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Specify whether the item is seen as the main one
|
|
30
|
+
*/
|
|
31
|
+
isMainEntry?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The function to call on click
|
|
34
|
+
*/
|
|
35
|
+
onClick: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* The function to call on item hover
|
|
38
|
+
*/
|
|
39
|
+
onItemHover?: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Specify whether the icon should be hidden
|
|
42
|
+
*/
|
|
43
|
+
isIconHidden?: boolean;
|
|
44
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { SideNavigation } from './SideNavigation/SideNavigation';
|
|
2
|
+
export { SideNavigationGroup } from './SideNavigationGroup/SideNavigationGroup';
|
|
3
|
+
export { SideNavigationItem } from './SideNavigationItem/SideNavigationItem';
|
|
4
|
+
export { NavigationGroup } from './NavigationGroup/NavigationGroup';
|
|
5
|
+
export { NavigationItem } from './NavigationItem/NavigationItem';
|
|
6
|
+
export { Navigation } from './Navigation/Navigation';
|
|
7
|
+
export { SIDE_NAVIGATION_ITEM_TEST_ID, SIDE_NAVIGATION_ACTIVE_ITEM_TEST_ID, SIDE_NAVIGATION_PARENT_ICON_TEST_ID, } from './SideNavigationItem/constants';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface UseAppFrameAnimationsProps {
|
|
3
|
+
isVisible: boolean;
|
|
4
|
+
elementRef: React.RefObject<HTMLDivElement>;
|
|
5
|
+
}
|
|
6
|
+
interface IUseAppFrameAnimations {
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
isMounted: boolean;
|
|
9
|
+
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
|
+
}
|
|
11
|
+
export declare const useAppFrameAnimations: ({ isVisible, elementRef, }: UseAppFrameAnimationsProps) => IUseAppFrameAnimations;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface ExampleAppContentProps {
|
|
3
|
+
showToggle: boolean;
|
|
4
|
+
topBarVisible: boolean;
|
|
5
|
+
handleTopBarButtonClick: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare const ExampleAppContent: React.FC<ExampleAppContentProps>;
|
|
8
|
+
export declare const ExampleTopBar: React.FC;
|
|
9
|
+
export declare const getBadgeContent: (item: string) => "dot" | "alert" | 5 | undefined;
|
|
10
|
+
export declare const getChatsMenu: (activeSubItem: number, handler: (o: number) => void) => React.JSX.Element;
|
|
11
|
+
export declare const getEngageSubMenu: (activeSubItem: number, handler: (o: number) => void) => React.JSX.Element;
|
|
12
|
+
export declare const getArchivesSubMenu: (activeSubItem: number, handler: (o: number) => void) => React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentCoreProps } from '../../utils/types';
|
|
3
|
+
export interface IAppFrameProps extends ComponentCoreProps {
|
|
4
|
+
/**
|
|
5
|
+
* It will display your app in the content area
|
|
6
|
+
*/
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
/**
|
|
9
|
+
* It will display navigation elements
|
|
10
|
+
*/
|
|
11
|
+
navigation: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* It will display the side navigation bar
|
|
14
|
+
*/
|
|
15
|
+
sideNavigation?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* It will display the top bar with passed element
|
|
18
|
+
*/
|
|
19
|
+
topBar?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The CSS class for the top bar
|
|
22
|
+
*/
|
|
23
|
+
topBarClassName?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The CSS class for the sub navigation bar
|
|
26
|
+
*/
|
|
27
|
+
sideNavigationContainerClassName?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The CSS class for the content container
|
|
30
|
+
*/
|
|
31
|
+
contentClassName?: string;
|
|
32
|
+
}
|
|
33
|
+
export type { INavigationProps } from './components/Navigation/types';
|
|
34
|
+
export type { INavigationGroupProps } from './components/NavigationGroup/types';
|
|
35
|
+
export type { INavigationItemProps } from './components/NavigationItem/types';
|
|
36
|
+
export type { ISideNavigationProps } from './components/SideNavigation/types';
|
|
37
|
+
export type { ISideNavigationGroupProps } from './components/SideNavigationGroup/types';
|
|
38
|
+
export type { ISideNavigationItemProps } from './components/SideNavigationItem/types';
|
|
@@ -6,6 +6,7 @@ export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
6
6
|
count?: number;
|
|
7
7
|
/**
|
|
8
8
|
* Specify the badge kind
|
|
9
|
+
* @param secondary - is deprecated, use "primary" or "tertiary" instead
|
|
9
10
|
*/
|
|
10
11
|
kind?: 'primary' | 'secondary' | 'tertiary';
|
|
11
12
|
/**
|
|
@@ -14,10 +15,12 @@ export interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
|
14
15
|
max?: number;
|
|
15
16
|
/**
|
|
16
17
|
* Specify the badge size
|
|
18
|
+
* @param large - is deprecated, use "medium" or "compact" instead
|
|
17
19
|
*/
|
|
18
20
|
size?: 'large' | 'medium' | 'compact';
|
|
19
21
|
/**
|
|
20
22
|
* Specify the badge type
|
|
23
|
+
* @param dot - is deprecated, use "UpdateBadge" component instead
|
|
21
24
|
*/
|
|
22
25
|
type?: 'counter' | 'alert' | 'dot';
|
|
23
26
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type StatusBadgeSizes = '3XS' | '2XS' | 'XS' | 'SM' | 'MD' | 'LG' | 'XL' | '2XL' | '3XL';
|
|
3
|
+
export interface IStatusBadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/**
|
|
5
|
+
* Specify the status badge kind
|
|
6
|
+
*/
|
|
7
|
+
kind?: 'offline' | 'accept' | 'not-accept';
|
|
8
|
+
/**
|
|
9
|
+
* Specify the status badge size
|
|
10
|
+
*/
|
|
11
|
+
size?: StatusBadgeSizes;
|
|
12
|
+
}
|
|
13
|
+
export declare const StatusBadge: React.FC<IStatusBadgeProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { StatusBadge } from './StatusBadge';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UpdateBadge } from './UpdateBadge';
|