@livechat/design-system-react-components 2.0.0-alpha.7 → 2.0.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 { IMobileNavigationProps } from './types';
2
+ import * as React from 'react';
3
+ export declare const MobileNavigation: React.FC<IMobileNavigationProps>;
@@ -0,0 +1,8 @@
1
+ import { ComponentCoreProps } from '../../../../utils/types';
2
+ import * as React from 'react';
3
+ export interface IMobileNavigationProps extends ComponentCoreProps {
4
+ /**
5
+ * It will display your navigation elements
6
+ */
7
+ children: React.ReactNode;
8
+ }
@@ -7,3 +7,4 @@ export { Navigation } from './Navigation/Navigation';
7
7
  export { NavigationTopBar, NavigationTopBarAlert, NavigationTopBarTitle, } from './NavigationTopBar/NavigationTopBar';
8
8
  export { SIDE_NAVIGATION_ITEM_TEST_ID, SIDE_NAVIGATION_ACTIVE_ITEM_TEST_ID, SIDE_NAVIGATION_PARENT_ICON_TEST_ID, } from './SideNavigationItem/constants';
9
9
  export { ExpirationCounter } from './ExpirationCounter/ExpirationCounter';
10
+ export { MobileNavigation } from './MobileNavigation/MobileNavigation';
@@ -9,6 +9,10 @@ export interface IAppFrameProps extends ComponentCoreProps {
9
9
  * It will display navigation elements
10
10
  */
11
11
  navigation: React.ReactNode;
12
+ /**
13
+ * It will display mobile navigation elements
14
+ */
15
+ mobileNavigation: React.ReactNode;
12
16
  /**
13
17
  * It will display the side navigation bar
14
18
  */
@@ -29,6 +33,11 @@ export interface IAppFrameProps extends ComponentCoreProps {
29
33
  * The CSS class for the content container
30
34
  */
31
35
  contentClassName?: string;
36
+ /**
37
+ * The value that will determine on which resolution mobile view will be displayed
38
+ * @default 705
39
+ */
40
+ mobileViewBreakpoint?: number;
32
41
  }
33
42
  export type { INavigationProps } from './components/Navigation/types';
34
43
  export type { INavigationGroupProps } from './components/NavigationGroup/types';
@@ -29,6 +29,10 @@ export type ButtonProps = {
29
29
  * Specify the place to render element given in `icon` prop
30
30
  */
31
31
  iconPosition?: 'left' | 'right';
32
+ /**
33
+ * Set to enable animation that will show label on button hover if icon is present
34
+ */
35
+ animatedLabel?: boolean;
32
36
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement>;
33
37
  export declare const Button: React.ForwardRefExoticComponent<{
34
38
  /**
@@ -59,4 +63,8 @@ export declare const Button: React.ForwardRefExoticComponent<{
59
63
  * Specify the place to render element given in `icon` prop
60
64
  */
61
65
  iconPosition?: "left" | "right" | undefined;
66
+ /**
67
+ * Set to enable animation that will show label on button hover if icon is present
68
+ */
69
+ animatedLabel?: boolean | undefined;
62
70
  } & React.ButtonHTMLAttributes<HTMLButtonElement> & React.AnchorHTMLAttributes<HTMLAnchorElement> & React.RefAttributes<HTMLButtonElement & HTMLAnchorElement>>;
@@ -1,3 +1,6 @@
1
1
  import { ButtonKind } from './types';
2
-
2
+ import * as React from 'react';
3
3
  export declare const getSpinnerColors: (kind: ButtonKind) => Record<string, string> | undefined;
4
+ export declare const handleMouseInteraction: (event: React.MouseEvent<HTMLButtonElement> | React.MouseEvent<HTMLAnchorElement>, internalHandler: () => void, userHandler?: React.MouseEventHandler<HTMLButtonElement | HTMLAnchorElement>) => void;
5
+ export declare const handleKeyboardInteraction: (event: React.FocusEvent<HTMLButtonElement> | React.FocusEvent<HTMLAnchorElement>, internalHandler: () => void, userHandler?: React.FocusEventHandler<HTMLButtonElement | HTMLAnchorElement>) => void;
6
+ export declare const buttonRef: (node: HTMLSpanElement | null, internalHandler: (width: number) => void) => void;
@@ -0,0 +1,3 @@
1
+ import { NODE } from './types';
2
+
3
+ export declare const resizeCallback: (node: NODE, handler: (newSize: DOMRectReadOnly) => void) => void;
@@ -1,2 +1,3 @@
1
1
  export { useAnimations } from './useAnimations';
2
2
  export { useHeightResizer } from './useHeightResizer';
3
+ export { useMobileViewDetector } from './useMobileViewDetector';
@@ -0,0 +1,13 @@
1
+ export type NODE = HTMLDivElement | null;
2
+ export type CALLBACK = (newSize: DOMRectReadOnly) => void;
3
+ export interface IUseHeightResizer {
4
+ size: number;
5
+ handleResizeRef: (node: NODE) => void;
6
+ }
7
+ export interface IUseMobileViewDetectorProps {
8
+ mobileBreakpoint: number;
9
+ }
10
+ export interface IUseMobileViewDetector {
11
+ isMobile: boolean;
12
+ handleResizeRef: (node: NODE) => void;
13
+ }
@@ -1,7 +1,3 @@
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 {};
1
+ import { IUseHeightResizer } from './types';
2
+
3
+ export declare const useHeightResizer: () => IUseHeightResizer;
@@ -0,0 +1,3 @@
1
+ import { IUseMobileViewDetector, IUseMobileViewDetectorProps } from './types';
2
+
3
+ export declare const useMobileViewDetector: ({ mobileBreakpoint, }: IUseMobileViewDetectorProps) => IUseMobileViewDetector;
@@ -0,0 +1,6 @@
1
+ import { CALLBACK, NODE } from './types';
2
+
3
+ export declare const useSharedResizeObserver: {
4
+ observe: (node: NODE, callback: CALLBACK) => void;
5
+ unobserve: (node: NODE) => void;
6
+ };