@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.
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { IAccordionProps } from './types';
3
+ export declare const Accordion: React.FC<IAccordionProps>;
@@ -0,0 +1,3 @@
1
+ import * as React from 'react';
2
+ import { IAccordionAnimatedLabelProps } from '../types';
3
+ export declare const AccordionAnimatedLabel: React.FC<IAccordionAnimatedLabelProps>;
@@ -0,0 +1,6 @@
1
+ import * as React from 'react';
2
+ export interface IAccordionMultilineElementProps {
3
+ children: React.ReactNode;
4
+ isExpanded: boolean;
5
+ }
6
+ export declare const AccordionMultilineElement: React.FC<IAccordionMultilineElementProps>;
@@ -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,3 @@
1
+ import { IPickerListItem } from '../Picker';
2
+ export declare const RULE_PICKER_OPTIONS: IPickerListItem[];
3
+ export declare const TAGS_PICKER_OPTIONS: IPickerListItem[];
@@ -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?: "right" | "left" | undefined;
61
+ iconPosition?: "left" | "right" | undefined;
62
62
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLButtonElement & HTMLAnchorElement>>;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
2
  export interface LinkProps extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
3
- bold: boolean;
3
+ bold?: boolean;
4
4
  }
5
5
  /**
6
6
  * Simple component which renders an `<a>` element.
@@ -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
  }
@@ -0,0 +1,2 @@
1
+ export { useAnimations } from './useAnimations';
2
+ export { useHeightResizer } from './useHeightResizer';
@@ -1,12 +1,12 @@
1
1
  import * as React from 'react';
2
- interface UseAppFrameAnimationsProps {
2
+ interface UseAnimationsProps {
3
3
  isVisible: boolean;
4
4
  elementRef: React.RefObject<HTMLDivElement>;
5
5
  }
6
- interface IUseAppFrameAnimations {
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 useAppFrameAnimations: ({ isVisible, elementRef, }: UseAppFrameAnimationsProps) => IUseAppFrameAnimations;
11
+ export declare const useAnimations: ({ isVisible, elementRef, }: UseAnimationsProps) => IUseAnimations;
12
12
  export {};
@@ -0,0 +1,7 @@
1
+ type NODE = HTMLDivElement | null;
2
+ interface IUseResizer {
3
+ size: number;
4
+ handleResize: (node: NODE) => void;
5
+ }
6
+ export declare const useHeightResizer: () => IUseResizer;
7
+ export {};