@livechat/design-system-react-components 1.4.0 → 1.6.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.
@@ -1,25 +1,3 @@
1
1
  import * as React from 'react';
2
- import { IActionBarOption } from './ActionBarItem';
3
- export interface IActionBarProps {
4
- /**
5
- * The CSS class for menu container
6
- */
7
- className?: string;
8
- /**
9
- * The unique id key
10
- */
11
- id?: string;
12
- /**
13
- * Array of action bar options
14
- */
15
- options: IActionBarOption[];
16
- /**
17
- * Set the key for active element
18
- */
19
- activeOptionKey?: string | null;
20
- /**
21
- * Set 'scroll' to disable menu and enable scroll
22
- */
23
- type?: 'menu' | 'scroll';
24
- }
2
+ import { IActionBarProps } from './types';
25
3
  export declare const ActionBar: React.FC<IActionBarProps>;
@@ -1,7 +1,7 @@
1
1
  import * as React from 'react';
2
2
  declare const _default: {
3
3
  title: string;
4
- component: React.FC<import("./ActionBar").IActionBarProps>;
4
+ component: React.FC<import("./types").IActionBarProps>;
5
5
  parameters: {
6
6
  layout: string;
7
7
  };
@@ -1,15 +1,3 @@
1
1
  import * as React from 'react';
2
- export type IActionBarOption = {
3
- key: string;
4
- element: React.ReactElement;
5
- label: string;
6
- showTooltip?: boolean;
7
- onClick: () => void;
8
- };
9
- interface ActionBarItem {
10
- option: IActionBarOption;
11
- menuItemsKeys: string[];
12
- activeOptionKey?: string | null;
13
- }
14
- export declare const ActionBarItem: React.FC<ActionBarItem>;
15
- export {};
2
+ import { IActionBarItem } from './types';
3
+ export declare const ActionBarItem: React.FC<IActionBarItem>;
@@ -1,2 +1,2 @@
1
1
  export { ActionBar } from './ActionBar';
2
- export type { IActionBarProps } from './ActionBar';
2
+ export type { IActionBarProps } from './types';
@@ -0,0 +1,40 @@
1
+ import * as React from 'react';
2
+ export interface IActionBarProps {
3
+ /**
4
+ * The CSS class for menu container
5
+ */
6
+ className?: string;
7
+ /**
8
+ * The unique id key
9
+ */
10
+ id?: string;
11
+ /**
12
+ * Array of action bar options
13
+ */
14
+ options: IActionBarOption[];
15
+ /**
16
+ * Set the key for active element
17
+ */
18
+ activeOptionKey?: string | null;
19
+ /**
20
+ * Set 'scroll' to disable menu and enable scroll
21
+ */
22
+ type?: 'menu' | 'scroll';
23
+ /**
24
+ * Set the bar buttons verticaly
25
+ */
26
+ vertical?: boolean;
27
+ }
28
+ export interface IActionBarOption {
29
+ key: string;
30
+ element: React.ReactElement;
31
+ label: string;
32
+ showTooltip?: boolean;
33
+ onClick: () => void;
34
+ }
35
+ export interface IActionBarItem {
36
+ option: IActionBarOption;
37
+ menuItemsKeys: string[];
38
+ activeOptionKey?: string | null;
39
+ vertical?: boolean;
40
+ }
@@ -1,9 +1,13 @@
1
1
  import * as React from 'react';
2
2
  export interface IDetailsCardProps {
3
3
  /**
4
- * The CSS class for accordion container
4
+ * The CSS class for card container
5
5
  */
6
6
  className?: string;
7
+ /**
8
+ * Additional element for the label
9
+ */
10
+ leftNode?: React.ReactNode;
7
11
  /**
8
12
  * Set the label
9
13
  */
@@ -1,38 +1,3 @@
1
1
  import * as React from 'react';
2
- import { Placement, flip } from '@floating-ui/react-dom';
3
- export interface IPopoverProps {
4
- children?: React.ReactNode;
5
- /**
6
- * The CSS class for popover container
7
- */
8
- className?: string;
9
- /**
10
- * The CSS class for trigger container
11
- */
12
- triggerClassName?: string;
13
- /**
14
- * The popover placement related to the trigger element
15
- */
16
- placement?: Placement;
17
- /**
18
- * Set popover visibility
19
- */
20
- isVisible?: boolean;
21
- /**
22
- * Set the popover placement to keep it in view
23
- */
24
- flipOptions?: Parameters<typeof flip>[0];
25
- /**
26
- * Set `false` if the menu is not to be closed with a esc press
27
- */
28
- closeOnEsc?: boolean;
29
- /**
30
- * Trigger element
31
- */
32
- triggerRenderer: () => React.ReactNode;
33
- /**
34
- * Optional callback called after popover close
35
- */
36
- onClose?: () => void;
37
- }
2
+ import { IPopoverProps } from './types';
38
3
  export declare const Popover: React.FC<IPopoverProps>;
@@ -1,13 +1,16 @@
1
1
  import * as React from 'react';
2
- import { IPopoverProps } from './Popover';
2
+ import { StoryFn } from '@storybook/react';
3
+ import type { IPopoverProps } from './types';
3
4
  declare const _default: import("@storybook/types").ComponentAnnotations<import("@storybook/react/dist/types-0a347bb9").R, IPopoverProps & {
4
5
  children?: React.ReactNode;
5
6
  }>;
6
7
  export default _default;
7
8
  export declare const Default: {
8
9
  (args: IPopoverProps): React.ReactElement;
10
+ decorators: ((Story: StoryFn) => React.JSX.Element)[];
9
11
  args: {
10
12
  placement: string;
11
- isVisible: boolean;
13
+ isVisible: undefined;
14
+ openedOnInit: boolean;
12
15
  };
13
16
  };
@@ -1 +1,2 @@
1
1
  export * from './Popover';
2
+ export type { IPopoverProps } from './types';
@@ -0,0 +1,59 @@
1
+ import * as React from 'react';
2
+ import { Placement, UseClickProps, UseDismissProps, FlipOptions } from '@floating-ui/react';
3
+ export interface IPopoverProps {
4
+ children?: React.ReactNode;
5
+ /**
6
+ * The CSS class for popover container
7
+ */
8
+ className?: string;
9
+ /**
10
+ * The CSS class for trigger container
11
+ */
12
+ triggerClassName?: string;
13
+ /**
14
+ * The popover placement related to the trigger element
15
+ */
16
+ placement?: Placement;
17
+ /**
18
+ * Optional handler called on tooltip hide
19
+ */
20
+ onClose?: () => void;
21
+ /**
22
+ * Optional handler called on tooltip show
23
+ */
24
+ onOpen?: () => void;
25
+ /**
26
+ * Set popover visibility
27
+ */
28
+ isVisible?: boolean;
29
+ /**
30
+ * Will open menu on component initialization
31
+ */
32
+ openedOnInit?: boolean;
33
+ /**
34
+ * Set the popover placement to keep it in view
35
+ */
36
+ flipOptions?: FlipOptions;
37
+ /**
38
+ * Set the popover offset
39
+ */
40
+ offsetSize?: number;
41
+ /**
42
+ * Set `false` if the menu is not to be closed with an esc press
43
+ */
44
+ closeOnEsc?: boolean;
45
+ /**
46
+ * Trigger element
47
+ */
48
+ triggerRenderer: React.ReactElement | (() => React.ReactNode);
49
+ /**
50
+ * Set the `floating-ui` useDismiss hook params if you need more control
51
+ * https://floating-ui.com/docs/usedismiss
52
+ */
53
+ useDismissHookProps?: UseDismissProps;
54
+ /**
55
+ * Set the `floating-ui` useClick hook params if you need more control
56
+ * https://floating-ui.com/docs/useclick
57
+ */
58
+ useClickHookProps?: UseClickProps;
59
+ }