@livechat/design-system-react-components 1.30.1 → 1.32.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/components/NavigationTopBar/NavigationTopBar.d.ts +45 -0
- package/dist/components/AppFrame/components/NavigationTopBar/examples.d.ts +15 -0
- package/dist/components/AppFrame/components/NavigationTopBar/types.d.ts +59 -0
- package/dist/components/AppFrame/components/index.d.ts +1 -0
- package/dist/components/AppFrame/stories-helpers.d.ts +6 -3
- package/dist/components/Modal/index.d.ts +1 -0
- package/dist/components/OnboardingChecklist/OnboardingChecklist.d.ts +3 -0
- package/dist/components/OnboardingChecklist/components/CheckListItem.d.ts +3 -0
- package/dist/components/OnboardingChecklist/components/index.d.ts +1 -0
- package/dist/components/OnboardingChecklist/index.d.ts +2 -0
- package/dist/components/OnboardingChecklist/types.d.ts +93 -0
- package/dist/components/Picker/hooks/useFloatingPicker.d.ts +2 -1
- package/dist/foundations/design-token.d.ts +2 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +2867 -2495
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { INavigationTopBarProps, ITopBarAlertProps, ITopBarTitleProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* NavigationTopBar is used to display a top bar in the app frame - mostly to display alerts, but arbitrary content can be placed there too.
|
|
5
|
+
* @example
|
|
6
|
+
* <NavigationTopBar>
|
|
7
|
+
* <NavigationTopBar.Alert kind="error">
|
|
8
|
+
* Something went wrong
|
|
9
|
+
* </NavigationTopBar.Alert>
|
|
10
|
+
* </NavigationTopBar>
|
|
11
|
+
*/
|
|
12
|
+
export declare const NavigationTopBar: {
|
|
13
|
+
({ children, additionalNodes, }: INavigationTopBarProps): React.ReactElement;
|
|
14
|
+
Alert: React.FC<ITopBarAlertProps>;
|
|
15
|
+
Title: React.FC<ITopBarTitleProps>;
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* Title component for the NavigationTopBar. Supposed to be placed in the `additionalNodes` prop of the NavigationTopBar.
|
|
19
|
+
* @example
|
|
20
|
+
* <NavigationTopBar additionalNodes={<NavigationTopBar.Title>Example top bar content</NavigationTopBar.Title>}>
|
|
21
|
+
* </NavigationTopBar>
|
|
22
|
+
*/
|
|
23
|
+
export declare const NavigationTopBarTitle: React.FC<ITopBarTitleProps>;
|
|
24
|
+
/**
|
|
25
|
+
* Alert component for the NavigationTopBar.
|
|
26
|
+
* @example
|
|
27
|
+
* <NavigationTopBar>
|
|
28
|
+
* <NavigationTopBar.Alert kind="error" show={!!error}>
|
|
29
|
+
* Something went wrong
|
|
30
|
+
* </NavigationTopBar.Alert>
|
|
31
|
+
* </NavigationTopBar>
|
|
32
|
+
* @example
|
|
33
|
+
* <NavigationTopBar>
|
|
34
|
+
* <NavigationTopBarAlert
|
|
35
|
+
* kind="warning"
|
|
36
|
+
* primaryCta={{ label: 'Save', onClick: () => console.log('Save clicked') }}
|
|
37
|
+
* secondaryCta={{ label: 'Discard', onClick: () => console.log('Discard clicked') }}
|
|
38
|
+
* closeButton={{ onClick: () => console.log('Close clicked') }}
|
|
39
|
+
* show={!hasUnsavedChanges && !hasClosedAlert}
|
|
40
|
+
* >
|
|
41
|
+
* You have unsaved changes
|
|
42
|
+
* </NavigationTopBarAlert>
|
|
43
|
+
* </NavigationTopBar>
|
|
44
|
+
**/
|
|
45
|
+
export declare const NavigationTopBarAlert: React.FC<ITopBarAlertProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare const DisconnectedAlert: React.FC<{
|
|
3
|
+
show: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
}>;
|
|
6
|
+
export declare const ChameleonAlert: React.FC<{
|
|
7
|
+
show: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
kind: 'info' | 'success' | 'warning' | 'error';
|
|
10
|
+
changeKind: () => void;
|
|
11
|
+
}>;
|
|
12
|
+
export declare const CustomBackgroundAlert: React.FC<{
|
|
13
|
+
show: boolean;
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
}>;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentCoreProps } from 'utils/types';
|
|
3
|
+
export type NavigationTopBarKind = 'info' | 'success' | 'warning' | 'error';
|
|
4
|
+
export interface INavigationTopBarProps extends ComponentCoreProps {
|
|
5
|
+
/**
|
|
6
|
+
* Contents of the top bar. You can use the `NavigationTopBar.Alert` component to display alerts.
|
|
7
|
+
*/
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
/**
|
|
10
|
+
* Ńodes placed under the children.
|
|
11
|
+
*/
|
|
12
|
+
additionalNodes?: React.ReactNode;
|
|
13
|
+
}
|
|
14
|
+
export interface ITopBarTitleProps extends ComponentCoreProps {
|
|
15
|
+
/**
|
|
16
|
+
* Content of the title.
|
|
17
|
+
*/
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export interface ITopBarAlertProps extends ComponentCoreProps {
|
|
21
|
+
/**
|
|
22
|
+
* Visual style of the alert. You can also use `className` to style the alert if you need to set a custom background color.
|
|
23
|
+
* Defaults to `info`.
|
|
24
|
+
* */
|
|
25
|
+
kind?: NavigationTopBarKind;
|
|
26
|
+
/**
|
|
27
|
+
* Properties of the close button. If defined, the alert will be closable and the close button will be rendered.
|
|
28
|
+
* aria-label is highly recommended for accessibility.
|
|
29
|
+
* */
|
|
30
|
+
closeButton?: {
|
|
31
|
+
onClick: () => void;
|
|
32
|
+
'data-testid'?: string;
|
|
33
|
+
'aria-label'?: string;
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Content of the alert.
|
|
37
|
+
*/
|
|
38
|
+
children: React.ReactNode;
|
|
39
|
+
/**
|
|
40
|
+
* Primary CTA button. The button will be rendered if defined.
|
|
41
|
+
* Simple on purpose - if you need more complex buttons, you can use the `children` prop.
|
|
42
|
+
* */
|
|
43
|
+
primaryCta?: {
|
|
44
|
+
label: string;
|
|
45
|
+
onClick: () => void;
|
|
46
|
+
};
|
|
47
|
+
/**
|
|
48
|
+
* Secondary CTA button. The button will be rendered if defined.
|
|
49
|
+
* Simple on purpose - if you need more complex buttons, you can use the `children` prop.
|
|
50
|
+
* */
|
|
51
|
+
secondaryCta?: {
|
|
52
|
+
label: string;
|
|
53
|
+
onClick: () => void;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Show or hide the alert, defaults to `true`. Changes to this prop are animated - the alert will enter and leave smoothly.
|
|
57
|
+
* */
|
|
58
|
+
isVisible?: boolean;
|
|
59
|
+
}
|
|
@@ -4,4 +4,5 @@ export { SideNavigationItem } from './SideNavigationItem/SideNavigationItem';
|
|
|
4
4
|
export { NavigationGroup } from './NavigationGroup/NavigationGroup';
|
|
5
5
|
export { NavigationItem } from './NavigationItem/NavigationItem';
|
|
6
6
|
export { Navigation } from './Navigation/Navigation';
|
|
7
|
+
export { NavigationTopBar, NavigationTopBarAlert, NavigationTopBarTitle, } from './NavigationTopBar/NavigationTopBar';
|
|
7
8
|
export { SIDE_NAVIGATION_ITEM_TEST_ID, SIDE_NAVIGATION_ACTIVE_ITEM_TEST_ID, SIDE_NAVIGATION_PARENT_ICON_TEST_ID, } from './SideNavigationItem/constants';
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
interface ExampleAppContentProps {
|
|
3
3
|
showToggle: boolean;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
alerts?: boolean[];
|
|
5
|
+
setAlerts?: (alerts: boolean[]) => void;
|
|
6
6
|
}
|
|
7
7
|
export declare const ExampleAppContent: React.FC<ExampleAppContentProps>;
|
|
8
|
-
export declare const ExampleTopBar: React.FC
|
|
8
|
+
export declare const ExampleTopBar: React.FC<{
|
|
9
|
+
visibleAlerts: boolean[];
|
|
10
|
+
setAlerts: (alerts: boolean[]) => void;
|
|
11
|
+
}>;
|
|
9
12
|
export declare const getBadgeContent: (item: string) => "dot" | "alert" | 5 | undefined;
|
|
10
13
|
export declare const getChatsMenu: (activeSubItem: number, handler: (o: number) => void) => React.JSX.Element;
|
|
11
14
|
export declare const getEngageSubMenu: (activeSubItem: number, handler: (o: number) => void) => React.JSX.Element;
|
|
@@ -3,6 +3,7 @@ export { ModalBase } from './components/ModalBase';
|
|
|
3
3
|
export { ModalCloseButton } from './components/ModalCloseButton';
|
|
4
4
|
export { ModalPortal } from './components/ModalPortal';
|
|
5
5
|
export { ModalHeader } from './components/ModalHeader';
|
|
6
|
+
export { ActionModalContent } from './components/ActionModalContent';
|
|
6
7
|
export type { ModalProps } from './Modal';
|
|
7
8
|
export type { ModalBaseProps } from './components/ModalBase';
|
|
8
9
|
export type { ModalCloseButtonProps } from './components/ModalCloseButton';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { CheckListItem } from './CheckListItem';
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface IChecklistItemProps {
|
|
3
|
+
/**
|
|
4
|
+
* Define the unique id of the item
|
|
5
|
+
*/
|
|
6
|
+
id: string;
|
|
7
|
+
/**
|
|
8
|
+
* Set the title of the item
|
|
9
|
+
*/
|
|
10
|
+
title: string;
|
|
11
|
+
/**
|
|
12
|
+
* Set the description of the item
|
|
13
|
+
*/
|
|
14
|
+
description: string;
|
|
15
|
+
/**
|
|
16
|
+
* The element to display when the item is active
|
|
17
|
+
*/
|
|
18
|
+
cta: React.ReactElement;
|
|
19
|
+
/**
|
|
20
|
+
* The element to display in the right column when the item is active
|
|
21
|
+
*/
|
|
22
|
+
placeholder: React.ReactElement;
|
|
23
|
+
}
|
|
24
|
+
export interface ICheckListItem extends Omit<IChecklistItemProps, 'placeholder'> {
|
|
25
|
+
isActive: boolean;
|
|
26
|
+
isChecked: boolean;
|
|
27
|
+
isLastElement: boolean;
|
|
28
|
+
onClick: (id: string) => void;
|
|
29
|
+
}
|
|
30
|
+
export type ICompletionMessageDataProps = {
|
|
31
|
+
/**
|
|
32
|
+
* Set the title of the complete state
|
|
33
|
+
*/
|
|
34
|
+
title: string;
|
|
35
|
+
/**
|
|
36
|
+
* Set the greeting text of the complete state
|
|
37
|
+
*/
|
|
38
|
+
greetingText?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The element to display when the checklist is completed before the animation starts
|
|
41
|
+
*/
|
|
42
|
+
placeholder?: React.ReactElement;
|
|
43
|
+
/**
|
|
44
|
+
* Define the delay betweend displaying complete placeholder and the animation starts
|
|
45
|
+
*/
|
|
46
|
+
delay?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Define the custom heigh of content visible after checklist complete
|
|
49
|
+
*/
|
|
50
|
+
height?: number;
|
|
51
|
+
};
|
|
52
|
+
export interface IOnboardingChecklistProps {
|
|
53
|
+
/**
|
|
54
|
+
* The CSS class for the component
|
|
55
|
+
*/
|
|
56
|
+
className?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Set the title of the checklist
|
|
59
|
+
*/
|
|
60
|
+
title: string;
|
|
61
|
+
/**
|
|
62
|
+
* Set the greeting text of the checklist
|
|
63
|
+
*/
|
|
64
|
+
greetingText?: string;
|
|
65
|
+
/**
|
|
66
|
+
* The list of items to display
|
|
67
|
+
*/
|
|
68
|
+
items: IChecklistItemProps[];
|
|
69
|
+
/**
|
|
70
|
+
* Set to define the active item
|
|
71
|
+
*/
|
|
72
|
+
activeItemId: string;
|
|
73
|
+
/**
|
|
74
|
+
* Set to defined the complete items
|
|
75
|
+
*/
|
|
76
|
+
completedItemsIds: string[];
|
|
77
|
+
/**
|
|
78
|
+
* Callback function when list element is clicked
|
|
79
|
+
*/
|
|
80
|
+
onActiveChange: (id: string) => void;
|
|
81
|
+
/**
|
|
82
|
+
* The CSS class for the right column
|
|
83
|
+
*/
|
|
84
|
+
placeholderClassName?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Set to define the checklist is completed
|
|
87
|
+
*/
|
|
88
|
+
isCompleted?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Complete element which will be displayed when `isCompleted` is true
|
|
91
|
+
*/
|
|
92
|
+
completionMessageData: ICompletionMessageDataProps;
|
|
93
|
+
}
|
|
@@ -13,6 +13,7 @@ interface UseFloatingPickerProps {
|
|
|
13
13
|
maxListHeight: number;
|
|
14
14
|
isOpen?: boolean;
|
|
15
15
|
onVisibilityChange?: (open: boolean, event?: Event | undefined) => void;
|
|
16
|
+
searchPhrase?: string;
|
|
16
17
|
}
|
|
17
18
|
interface IUseFloatingPicker {
|
|
18
19
|
getReferenceProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
@@ -31,5 +32,5 @@ interface IUseFloatingPicker {
|
|
|
31
32
|
pointer: boolean;
|
|
32
33
|
setPointer: (pointer: boolean) => void;
|
|
33
34
|
}
|
|
34
|
-
export declare const useFloatingPicker: ({ disabled, items, placement, minListHeight, maxListHeight, floatingStrategy, useDismissHookProps, useClickHookProps, isOpen, onVisibilityChange, }: UseFloatingPickerProps) => IUseFloatingPicker;
|
|
35
|
+
export declare const useFloatingPicker: ({ disabled, items, placement, minListHeight, maxListHeight, floatingStrategy, useDismissHookProps, useClickHookProps, isOpen, onVisibilityChange, searchPhrase, }: UseFloatingPickerProps) => IUseFloatingPicker;
|
|
35
36
|
export {};
|
|
@@ -365,5 +365,7 @@ export declare const DesignToken: {
|
|
|
365
365
|
OnePopoverBorderActive: string;
|
|
366
366
|
OneTooltipBackground: string;
|
|
367
367
|
ContentBasicAutofill: string;
|
|
368
|
+
SurfaceCheckListItemOpenBackground: string;
|
|
369
|
+
SurfaceCheckListBackground: string;
|
|
368
370
|
};
|
|
369
371
|
export type DesignTokenKey = keyof typeof DesignToken;
|