@livechat/design-system-react-components 1.0.0-beta.0 → 1.0.0-beta.10
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/ActionBar/ActionBar.d.ts +25 -0
- package/dist/components/ActionBar/ActionBar.stories.d.ts +10 -0
- package/dist/components/ActionBar/ActionBarItem.d.ts +15 -0
- package/dist/components/ActionBar/index.d.ts +2 -0
- package/dist/components/ActionMenu/ActionMenu.d.ts +15 -8
- package/dist/components/ActionMenu/ActionMenu.stories.d.ts +2 -1
- package/dist/components/ActionMenu/types.d.ts +9 -0
- package/dist/components/Alert/Alert.stories.d.ts +3 -3
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Avatar/Avatar.helpers.d.ts +1 -0
- package/dist/components/Avatar/Avatar.helpers.spec.d.ts +1 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +10 -10
- package/dist/components/Avatar/index.d.ts +1 -0
- package/dist/components/Badge/Badge.stories.d.ts +3 -3
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/DatePicker/helpers.d.ts +2 -25
- package/dist/components/DatePicker/types.d.ts +3 -3
- package/dist/components/FormField/FormField.stories.d.ts +1 -1
- package/dist/components/Icon/Icon.d.ts +2 -2
- package/dist/components/Icon/index.d.ts +1 -0
- package/dist/components/Icon/types.d.ts +2 -0
- package/dist/components/Input/Input.d.ts +4 -0
- package/dist/components/Input/Input.stories.d.ts +4 -4
- package/dist/components/Modal/Modal.d.ts +5 -1
- package/dist/components/Modal/{ModalBase.d.ts → components/ModalBase.d.ts} +4 -0
- package/dist/components/Modal/components/ModalBase.spec.d.ts +1 -0
- package/dist/components/Modal/{ModalCloseButton.d.ts → components/ModalCloseButton.d.ts} +2 -1
- package/dist/components/Modal/components/ModalHeader.d.ts +26 -0
- package/dist/components/Modal/index.d.ts +8 -8
- package/dist/components/NumericInput/NumericInput.d.ts +2 -4
- package/dist/components/NumericInput/NumericInput.stories.d.ts +20 -0
- package/dist/components/Picker/Picker.d.ts +5 -7
- package/dist/components/Picker/Picker.stories.d.ts +1 -0
- package/dist/components/Picker/PickerList.d.ts +1 -10
- package/dist/components/Picker/PickerListItem.d.ts +11 -0
- package/dist/components/Picker/TriggerBody.d.ts +4 -4
- package/dist/components/Picker/constants.d.ts +31 -2
- package/dist/components/Picker/helpers.d.ts +2 -0
- package/dist/components/Picker/index.d.ts +1 -0
- package/dist/components/Picker/types.d.ts +17 -0
- package/dist/components/Popover/Popover.d.ts +4 -0
- package/dist/components/PromoBanner/PromoBanner.d.ts +3 -0
- package/dist/components/PromoBannerV2/PromoBannerV2.d.ts +33 -0
- package/dist/components/PromoBannerV2/PromoBannerV2.spec.d.ts +1 -0
- package/dist/components/PromoBannerV2/PromoBannerV2.stories.d.ts +23 -0
- package/dist/components/PromoBannerV2/constants.d.ts +1 -0
- package/dist/components/PromoBannerV2/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +30 -0
- package/dist/components/Tab/Tab.stories.d.ts +2 -2
- package/dist/components/Tag/Tag.d.ts +5 -10
- package/dist/components/Tag/Tag.stories.d.ts +4 -2
- package/dist/components/TagInput/EmailTagInput.d.ts +1 -1
- package/dist/components/TagInput/TagInput.stories.d.ts +1 -1
- package/dist/components/Textarea/Textarea.stories.d.ts +1 -1
- package/dist/components/Toast/Toast.stories.d.ts +1 -1
- package/dist/components/Toast/ToastWrapper.stories.d.ts +1 -7
- package/dist/components/Tooltip/Tooltip.stories.d.ts +4 -4
- package/dist/components/Tooltip/components/Info.d.ts +2 -1
- package/dist/components/Tooltip/components/Interactive.d.ts +4 -12
- package/dist/components/Tooltip/components/UserGuide/SpotlightOverlay.d.ts +2 -1
- package/dist/components/Tooltip/components/UserGuide/UserGuideStep.d.ts +2 -1
- package/dist/components/Tooltip/helpers.d.ts +2 -1
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/types.d.ts +9 -1
- package/dist/components/Typography/Display.d.ts +10 -0
- package/dist/components/Typography/index.d.ts +1 -0
- package/dist/dsrc.cjs.js +10 -10
- package/dist/dsrc.es.js +3858 -3377
- package/dist/dsrc.umd.js +10 -10
- package/dist/foundations/radius-token.d.ts +6 -0
- package/dist/index.d.ts +3 -1
- package/dist/preview-stats.json +717 -519
- package/dist/stories/components/Radius.d.ts +2 -0
- package/dist/stories/components/RadiusExamples.d.ts +2 -0
- package/dist/style.css +1 -1
- package/package.json +14 -14
- package/dist/components/Modal/ModalHeader.d.ts +0 -9
- /package/dist/components/{Modal/ModalBase.spec.d.ts → ActionBar/ActionBar.spec.d.ts} +0 -0
- /package/dist/components/Modal/{ModalPortal.d.ts → components/ModalPortal.d.ts} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ButtonKind } from '../Button';
|
|
3
|
+
export interface IPromoBannerV2Props {
|
|
4
|
+
/**
|
|
5
|
+
* Specify an optional className to be applied to the main container node
|
|
6
|
+
*/
|
|
7
|
+
className?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Element with additional content for second column
|
|
10
|
+
*/
|
|
11
|
+
additionalContent?: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Shows the primary CTA button
|
|
14
|
+
*/
|
|
15
|
+
primaryButton?: {
|
|
16
|
+
handleClick: () => void;
|
|
17
|
+
label: string;
|
|
18
|
+
kind?: ButtonKind;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Shows the secondary CTA button
|
|
22
|
+
*/
|
|
23
|
+
secondaryButton?: {
|
|
24
|
+
handleClick: () => void;
|
|
25
|
+
label: string;
|
|
26
|
+
kind?: ButtonKind;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Event handler for close button press
|
|
30
|
+
*/
|
|
31
|
+
onClose?: () => void;
|
|
32
|
+
}
|
|
33
|
+
export declare const PromoBannerV2: React.FC<React.PropsWithChildren<IPromoBannerV2Props>>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: React.FC<React.PropsWithChildren<import("./PromoBannerV2").IPromoBannerV2Props>>;
|
|
5
|
+
argTypes: {
|
|
6
|
+
primaryButton: {
|
|
7
|
+
control: boolean;
|
|
8
|
+
};
|
|
9
|
+
secondaryButton: {
|
|
10
|
+
control: boolean;
|
|
11
|
+
};
|
|
12
|
+
additionalContent: {
|
|
13
|
+
control: boolean;
|
|
14
|
+
};
|
|
15
|
+
onClose: {
|
|
16
|
+
action: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
export default _default;
|
|
21
|
+
export declare const Default: () => React.ReactElement;
|
|
22
|
+
export declare const WithStyledAdditionalContent: () => React.ReactElement;
|
|
23
|
+
export declare const WithStyledMainContent: () => React.ReactElement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SMALL_CONTAINER_WIDTH_TRESHOLD = 559;
|
|
@@ -3,15 +3,45 @@ export declare const baseClass = "switch";
|
|
|
3
3
|
export type SwitchSize = 'compact' | 'medium' | 'large';
|
|
4
4
|
export type SwitchState = 'regular' | 'loading' | 'locked';
|
|
5
5
|
export interface SwitchProps {
|
|
6
|
+
/**
|
|
7
|
+
* Specify the label for the switch input
|
|
8
|
+
*/
|
|
6
9
|
ariaLabel?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The CSS class for switch container
|
|
12
|
+
*/
|
|
7
13
|
className?: string;
|
|
14
|
+
/**
|
|
15
|
+
* Will set the switch to "on" on component initialization
|
|
16
|
+
*/
|
|
8
17
|
defaultOn?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Specify whether the switch should be disabled
|
|
20
|
+
*/
|
|
9
21
|
disabled?: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* Ref object
|
|
24
|
+
*/
|
|
10
25
|
innerRef?: React.LegacyRef<HTMLInputElement> | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Specify the switch input name
|
|
28
|
+
*/
|
|
11
29
|
name?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Define if switch is "on"
|
|
32
|
+
*/
|
|
12
33
|
on?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The event handler for onChange
|
|
36
|
+
*/
|
|
13
37
|
onChange?(e: React.FormEvent, value: boolean): void;
|
|
38
|
+
/**
|
|
39
|
+
* Specify the switch size
|
|
40
|
+
*/
|
|
14
41
|
size?: SwitchSize;
|
|
42
|
+
/**
|
|
43
|
+
* Specify the switch state
|
|
44
|
+
*/
|
|
15
45
|
state?: SwitchState;
|
|
16
46
|
}
|
|
17
47
|
export declare const Switch: React.FC<SwitchProps>;
|
|
@@ -25,5 +25,5 @@ export declare const Tab: {
|
|
|
25
25
|
(args: ITabArgs): React.ReactElement;
|
|
26
26
|
args: TabProps;
|
|
27
27
|
};
|
|
28
|
-
export declare const StatesAndVariants: () =>
|
|
29
|
-
export declare const Sizes: () =>
|
|
28
|
+
export declare const StatesAndVariants: () => React.ReactElement;
|
|
29
|
+
export declare const Sizes: () => React.ReactElement;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { IconSize, IconSource } from '../Icon';
|
|
3
2
|
export interface TagProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
3
|
/**
|
|
5
4
|
* Specify the tag kind
|
|
@@ -8,11 +7,7 @@ export interface TagProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
8
7
|
/**
|
|
9
8
|
* Specify the tag size
|
|
10
9
|
*/
|
|
11
|
-
size?: 'medium' | 'large';
|
|
12
|
-
/**
|
|
13
|
-
* Specify the tag icon size if used
|
|
14
|
-
*/
|
|
15
|
-
iconSize?: IconSize;
|
|
10
|
+
size?: 'small' | 'medium' | 'large';
|
|
16
11
|
/**
|
|
17
12
|
* Set the tag custom color
|
|
18
13
|
*/
|
|
@@ -30,12 +25,12 @@ export interface TagProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
30
25
|
*/
|
|
31
26
|
onRemove?(): void;
|
|
32
27
|
/**
|
|
33
|
-
*
|
|
28
|
+
* React node element to show on the left
|
|
34
29
|
*/
|
|
35
|
-
|
|
30
|
+
leftNode?: React.ReactElement;
|
|
36
31
|
/**
|
|
37
|
-
*
|
|
32
|
+
* React node element to show on the right
|
|
38
33
|
*/
|
|
39
|
-
|
|
34
|
+
rightNode?: React.ReactElement;
|
|
40
35
|
}
|
|
41
36
|
export declare const Tag: React.FC<React.PropsWithChildren<TagProps>>;
|
|
@@ -12,13 +12,15 @@ export declare const Kinds: {
|
|
|
12
12
|
({ children, ...args }: TagProps): React.ReactElement;
|
|
13
13
|
args: {
|
|
14
14
|
children: string;
|
|
15
|
-
|
|
15
|
+
leftNode: React.JSX.Element;
|
|
16
|
+
rightNode: React.JSX.Element;
|
|
16
17
|
};
|
|
17
18
|
};
|
|
18
19
|
export declare const Sizes: {
|
|
19
20
|
({ children, ...args }: TagProps): React.ReactElement;
|
|
20
21
|
args: {
|
|
21
22
|
children: string;
|
|
22
|
-
|
|
23
|
+
leftNode: React.JSX.Element;
|
|
24
|
+
rightNode: React.JSX.Element;
|
|
23
25
|
};
|
|
24
26
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TagInputProps } from './TagInput';
|
|
2
1
|
import * as React from 'react';
|
|
2
|
+
import { TagInputProps } from './TagInput';
|
|
3
3
|
export type EmailTagInputProps = Omit<TagInputProps, 'validator'>;
|
|
4
4
|
export declare const emailRegex: RegExp;
|
|
5
5
|
export declare const EmailTagInput: React.FC<EmailTagInputProps>;
|
|
@@ -7,4 +7,4 @@ declare const _default: import("@storybook/types").ComponentAnnotations<import("
|
|
|
7
7
|
export default _default;
|
|
8
8
|
export declare const DefaultTagInput: Story<TagInputProps>;
|
|
9
9
|
export declare const DefaultEmailTagInput: Story<EmailTagInputProps>;
|
|
10
|
-
export declare const Sizes: () =>
|
|
10
|
+
export declare const Sizes: () => React.ReactElement;
|
|
@@ -4,4 +4,4 @@ import { TextareaProps } from './Textarea';
|
|
|
4
4
|
declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
|
|
5
5
|
export default _default;
|
|
6
6
|
export declare const Default: Story<TextareaProps>;
|
|
7
|
-
export declare const States: () =>
|
|
7
|
+
export declare const States: () => React.ReactElement;
|
|
@@ -9,6 +9,6 @@ export declare const Default: Story<ToastProps>;
|
|
|
9
9
|
export declare const Kinds: Story;
|
|
10
10
|
export declare const WithCloseIcon: Story;
|
|
11
11
|
export declare const WithCustomAction: {
|
|
12
|
-
():
|
|
12
|
+
(): React.ReactElement;
|
|
13
13
|
parameters: import("@storybook/types").Parameters;
|
|
14
14
|
};
|
|
@@ -11,7 +11,7 @@ export declare const ToastWrapper: {
|
|
|
11
11
|
toasts: ({
|
|
12
12
|
id: string;
|
|
13
13
|
kind: string;
|
|
14
|
-
content:
|
|
14
|
+
content: string;
|
|
15
15
|
removable?: undefined;
|
|
16
16
|
action?: undefined;
|
|
17
17
|
} | {
|
|
@@ -29,12 +29,6 @@ export declare const ToastWrapper: {
|
|
|
29
29
|
handler: () => void;
|
|
30
30
|
};
|
|
31
31
|
removable?: undefined;
|
|
32
|
-
} | {
|
|
33
|
-
id: string;
|
|
34
|
-
kind: string;
|
|
35
|
-
content: string;
|
|
36
|
-
removable?: undefined;
|
|
37
|
-
action?: undefined;
|
|
38
32
|
})[];
|
|
39
33
|
};
|
|
40
34
|
};
|
|
@@ -20,11 +20,11 @@ export declare const Default: {
|
|
|
20
20
|
hoverOutDelayTimeout: number;
|
|
21
21
|
};
|
|
22
22
|
};
|
|
23
|
-
export declare const TooltipInfo: () =>
|
|
24
|
-
export declare const TooltipInteractive: () =>
|
|
25
|
-
export declare const TooltipReports: () =>
|
|
23
|
+
export declare const TooltipInfo: () => React.ReactElement;
|
|
24
|
+
export declare const TooltipInteractive: () => React.ReactElement;
|
|
25
|
+
export declare const TooltipReports: () => React.ReactElement;
|
|
26
26
|
export declare const TooltipUserGuide: {
|
|
27
|
-
(args: ITooltipProps):
|
|
27
|
+
(args: ITooltipProps): React.ReactElement;
|
|
28
28
|
args: {
|
|
29
29
|
placement: string;
|
|
30
30
|
isVisible: boolean;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { TooltipTheme } from '../types';
|
|
2
3
|
export declare const Info: React.FC<{
|
|
3
4
|
header?: string;
|
|
4
5
|
text: string;
|
|
5
6
|
closeWithX?: boolean;
|
|
6
|
-
theme?:
|
|
7
|
+
theme?: TooltipTheme;
|
|
7
8
|
handleCloseAction?: (ev: React.MouseEvent) => void;
|
|
8
9
|
}>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { TooltipButton, TooltipTheme } from '../types';
|
|
3
3
|
export declare const Interactive: React.FC<{
|
|
4
4
|
header?: string;
|
|
5
5
|
text: string;
|
|
@@ -8,16 +8,8 @@ export declare const Interactive: React.FC<{
|
|
|
8
8
|
alt: string;
|
|
9
9
|
};
|
|
10
10
|
closeWithX?: boolean;
|
|
11
|
-
theme?:
|
|
11
|
+
theme?: TooltipTheme;
|
|
12
12
|
handleCloseAction?: (ev: React.MouseEvent) => void;
|
|
13
|
-
primaryButton:
|
|
14
|
-
|
|
15
|
-
label: string;
|
|
16
|
-
kind?: ButtonKind;
|
|
17
|
-
};
|
|
18
|
-
secondaryButton: {
|
|
19
|
-
handleClick: () => void;
|
|
20
|
-
label: string;
|
|
21
|
-
kind?: ButtonKind;
|
|
22
|
-
};
|
|
13
|
+
primaryButton: TooltipButton;
|
|
14
|
+
secondaryButton: TooltipButton;
|
|
23
15
|
}>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
declare const SpotlightOverlay: ({ gap, isVisible, slide, disablePointerEvents, }: {
|
|
2
3
|
gap: DOMRect | null;
|
|
3
4
|
isVisible: boolean;
|
|
4
5
|
slide: boolean;
|
|
5
6
|
disablePointerEvents: boolean;
|
|
6
|
-
}) =>
|
|
7
|
+
}) => React.ReactElement | null;
|
|
7
8
|
export default SpotlightOverlay;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
+
import { TooltipTheme } from '../../types';
|
|
2
3
|
export declare const UserGuideStep: React.FC<{
|
|
3
4
|
header: string;
|
|
4
5
|
text: string;
|
|
@@ -9,7 +10,7 @@ export declare const UserGuideStep: React.FC<{
|
|
|
9
10
|
currentStep: number;
|
|
10
11
|
stepMax: number;
|
|
11
12
|
closeWithX?: boolean;
|
|
12
|
-
theme?:
|
|
13
|
+
theme?: TooltipTheme;
|
|
13
14
|
handleClickPrimary: () => void;
|
|
14
15
|
handleCloseAction?: (ev: KeyboardEvent | React.MouseEvent) => void;
|
|
15
16
|
}>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { IconKind } from '../Icon';
|
|
2
|
-
|
|
2
|
+
import { TooltipTheme } from './types';
|
|
3
|
+
export declare function getIconType(theme: TooltipTheme): IconKind;
|
|
3
4
|
export declare const sleep: (milliseconds: number) => Promise<void>;
|
|
@@ -1,9 +1,17 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { Placement, VirtualElement } from '@floating-ui/react-dom';
|
|
3
|
+
import { ButtonKind } from '../Button';
|
|
4
|
+
export type TooltipTheme = 'invert' | 'important' | undefined;
|
|
5
|
+
export type TooltipButton = {
|
|
6
|
+
handleClick: () => void;
|
|
7
|
+
label: string;
|
|
8
|
+
kind?: ButtonKind;
|
|
9
|
+
};
|
|
3
10
|
export interface ITooltipProps {
|
|
4
11
|
children?: React.ReactNode;
|
|
5
12
|
className?: string;
|
|
6
|
-
|
|
13
|
+
triggerClassName?: string;
|
|
14
|
+
theme?: TooltipTheme;
|
|
7
15
|
placement?: Placement;
|
|
8
16
|
isVisible?: boolean;
|
|
9
17
|
withFadeAnimation?: boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
interface IProps {
|
|
3
|
+
size?: 'md' | 'sm';
|
|
4
|
+
/** DOM element name that will be rendered */
|
|
5
|
+
as?: string;
|
|
6
|
+
/** Optional custom className */
|
|
7
|
+
className?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const Display: React.FC<React.PropsWithChildren<IProps>>;
|
|
10
|
+
export {};
|