@livechat/design-system-react-components 1.36.0 → 1.37.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/Accordion/Accordion.d.ts +3 -0
- package/dist/components/Accordion/components/AccordionAnimatedLabel.d.ts +3 -0
- package/dist/components/Accordion/components/AccordionMultilineElement.d.ts +6 -0
- package/dist/components/Accordion/helpers.d.ts +10 -0
- package/dist/components/Accordion/index.d.ts +1 -0
- package/dist/components/Accordion/stories-helpers.d.ts +3 -0
- package/dist/components/Accordion/types.d.ts +45 -0
- package/dist/components/Button/Button.d.ts +1 -1
- package/dist/components/Link/Link.d.ts +1 -1
- package/dist/components/Picker/components/PickerList.d.ts +3 -0
- package/dist/components/Picker/components/PickerTriggerBody.d.ts +1 -0
- package/dist/components/Picker/types.d.ts +5 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/{components/AppFrame/hooks/useAppFrameAnimations.d.ts → hooks/useAnimations.d.ts} +3 -3
- package/dist/hooks/useHeightResizer.d.ts +7 -0
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.es.js +3034 -2819
- package/dist/style.css +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { AccordionLabel } from './types';
|
|
3
|
+
export declare const isLabelObject: (label: React.ReactNode | {
|
|
4
|
+
open: React.ReactNode;
|
|
5
|
+
closed: React.ReactNode;
|
|
6
|
+
}) => label is {
|
|
7
|
+
open: React.ReactNode;
|
|
8
|
+
closed: React.ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare const getLabel: (label: AccordionLabel, currentlyOpen: boolean) => React.ReactNode;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Accordion } from './Accordion';
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { ComponentCoreProps } from '../../utils/types';
|
|
3
|
+
export type AccordionLabel = React.ReactNode | {
|
|
4
|
+
open: React.ReactNode;
|
|
5
|
+
closed: React.ReactNode;
|
|
6
|
+
};
|
|
7
|
+
export interface IAccordionProps extends ComponentCoreProps {
|
|
8
|
+
/**
|
|
9
|
+
* Specify the content of the accordion
|
|
10
|
+
*/
|
|
11
|
+
children: React.ReactNode;
|
|
12
|
+
/**
|
|
13
|
+
* Specify the label of the accordion, single element or different for open and closed state
|
|
14
|
+
*/
|
|
15
|
+
label: AccordionLabel;
|
|
16
|
+
/**
|
|
17
|
+
* Specify the multiline element, which will be displayed under the label
|
|
18
|
+
*/
|
|
19
|
+
multilineElement?: React.ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Specify the kind of the accordion
|
|
22
|
+
*/
|
|
23
|
+
kind?: 'default' | 'warning' | 'error';
|
|
24
|
+
/**
|
|
25
|
+
* Specify if the accordion should be open on init
|
|
26
|
+
*/
|
|
27
|
+
openOnInit?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Set to control accordion state
|
|
30
|
+
*/
|
|
31
|
+
isOpen?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Optional handler called on accordion close
|
|
34
|
+
*/
|
|
35
|
+
onClose?: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* Optional handler called on accordion open
|
|
38
|
+
*/
|
|
39
|
+
onOpen?: () => void;
|
|
40
|
+
}
|
|
41
|
+
export interface IAccordionAnimatedLabelProps {
|
|
42
|
+
open: React.ReactNode;
|
|
43
|
+
closed: React.ReactNode;
|
|
44
|
+
isOpen: boolean;
|
|
45
|
+
}
|
|
@@ -58,5 +58,5 @@ export declare const Button: React.ForwardRefExoticComponent<{
|
|
|
58
58
|
/**
|
|
59
59
|
* Specify the place to render element given in `icon` prop
|
|
60
60
|
*/
|
|
61
|
-
iconPosition?: "
|
|
61
|
+
iconPosition?: "left" | "right" | undefined;
|
|
62
62
|
} & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLButtonElement & HTMLAnchorElement>>;
|
|
@@ -12,6 +12,9 @@ export interface IPickerListProps {
|
|
|
12
12
|
listElementsRef: React.MutableRefObject<(HTMLElement | null)[]>;
|
|
13
13
|
activeIndex: number | null;
|
|
14
14
|
selectedKeys: string[];
|
|
15
|
+
isPositioned: boolean;
|
|
16
|
+
searchDisabled: boolean;
|
|
17
|
+
onItemRemove: (key: string) => void;
|
|
15
18
|
setPointer: (pointer: boolean) => void;
|
|
16
19
|
onSelect: (key: string) => void;
|
|
17
20
|
getFloatingProps: (userProps?: React.HTMLProps<HTMLElement> | undefined) => Record<string, unknown>;
|
|
@@ -18,5 +18,6 @@ export interface ITriggerBodyProps {
|
|
|
18
18
|
virtualItemRef: React.MutableRefObject<HTMLElement | null>;
|
|
19
19
|
isTriggerFocused: boolean;
|
|
20
20
|
inputRef?: React.RefObject<HTMLInputElement>;
|
|
21
|
+
inputProps?: React.InputHTMLAttributes<HTMLInputElement>;
|
|
21
22
|
}
|
|
22
23
|
export declare const PickerTriggerBody: React.FC<ITriggerBodyProps>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReactElement } from 'react';
|
|
1
|
+
import { InputHTMLAttributes, ReactElement } from 'react';
|
|
2
2
|
import { Placement, Strategy, UseClickProps, UseDismissProps } from '@floating-ui/react';
|
|
3
3
|
import { VirtuosoProps } from 'react-virtuoso';
|
|
4
4
|
import { Size } from '../../utils';
|
|
@@ -135,4 +135,8 @@ export interface IPickerProps extends ComponentCoreProps {
|
|
|
135
135
|
* https://virtuoso.dev/virtuoso-api-reference/
|
|
136
136
|
*/
|
|
137
137
|
virtuosoProps?: VirtuosoProps<IPickerListItem, unknown>;
|
|
138
|
+
/**
|
|
139
|
+
* Additional props for the input element
|
|
140
|
+
*/
|
|
141
|
+
inputProps?: InputHTMLAttributes<HTMLInputElement> | Record<string, unknown>;
|
|
138
142
|
}
|
package/dist/{components/AppFrame/hooks/useAppFrameAnimations.d.ts → hooks/useAnimations.d.ts}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
interface
|
|
2
|
+
interface UseAnimationsProps {
|
|
3
3
|
isVisible: boolean;
|
|
4
4
|
elementRef: React.RefObject<HTMLDivElement>;
|
|
5
5
|
}
|
|
6
|
-
interface
|
|
6
|
+
interface IUseAnimations {
|
|
7
7
|
isOpen: boolean;
|
|
8
8
|
isMounted: boolean;
|
|
9
9
|
setIsOpen: React.Dispatch<React.SetStateAction<boolean>>;
|
|
10
10
|
}
|
|
11
|
-
export declare const
|
|
11
|
+
export declare const useAnimations: ({ isVisible, elementRef, }: UseAnimationsProps) => IUseAnimations;
|
|
12
12
|
export {};
|