@wavv/ui 1.6.5 → 1.7.0-beta.1

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.
@@ -10,6 +10,8 @@ type SpinnerProps = {
10
10
  center?: boolean;
11
11
  /** If center positioned, adds a background overlay behind the spinner */
12
12
  background?: string | boolean;
13
+ /** If center positioned, specifies the zIndex of the spinner */
14
+ zIndex?: number;
13
15
  } & Margin & Position;
14
- declare const Spinner: ({ size, color, center, background, margin, marginTop, marginBottom, marginRight, marginLeft, position, top, bottom, right, left, ...props }: SpinnerProps) => JSX.Element;
16
+ declare const Spinner: ({ size, color, center, background, zIndex, margin, marginTop, marginBottom, marginRight, marginLeft, position, top, bottom, right, left, ...props }: SpinnerProps) => JSX.Element;
15
17
  export default Spinner;
@@ -1,28 +1,21 @@
1
1
  import { ReactNode } from 'react';
2
- import { ThemeProp } from './types';
3
- type Position = 'top' | 'bottom' | 'right' | 'left' | 'top left' | 'bottom left' | 'top right' | 'bottom right';
2
+ import type { ThemeProp } from './types';
3
+ type Side = 'top' | 'bottom' | 'right' | 'left';
4
+ type Top = 'top center' | 'top left' | 'top right';
5
+ type Bottom = 'bottom center' | 'bottom left' | 'bottom right';
6
+ type Left = 'left center' | 'left top' | 'left bottom';
7
+ type Right = 'right center' | 'right top' | 'right bottom';
8
+ type Position = Side | Top | Bottom | Left | Right;
4
9
  export type TooltipProps = {
5
10
  children?: ReactNode;
6
11
  /** The element that will trigger the opening of the Tooltip */
7
12
  trigger: ReactNode;
8
- /** Sets the instigator of the Tooltip opening */
9
- on?: 'hover' | 'click';
10
13
  /** The text content of the Tooltip */
11
14
  content?: string;
12
- /** The style prop of the Tooltip container */
13
- style?: {
14
- [key: string]: string | number;
15
- };
16
15
  /** The position of the Tooltip body and arrow in relation to the trigger */
17
16
  position?: Position;
18
- /** Offsets the vertical position of the Tooltip */
19
- offsetY?: number;
20
- /** Offsets the horizontal position of the Tooltip arrow */
21
- offsetArrowX?: number;
22
- /** Offsets the horizontal position of the Tooltip */
23
- offsetX?: number;
24
- /** The width of the Tooltip container */
25
- containerWidth?: number | string;
17
+ /** Offset of the Tooltip from the trigger */
18
+ offset?: number;
26
19
  /** The width of the Tooltip element */
27
20
  width?: number | string;
28
21
  /** The maxWidth of the Tooltip element */
@@ -33,17 +26,19 @@ export type TooltipProps = {
33
26
  disabled?: boolean;
34
27
  /** The id of the Tooltip element */
35
28
  id?: string;
36
- /** The function called after the Tooltip opens */
37
- afterShow?: () => void;
38
- /** The function called after the Tooltip closes */
39
- afterHide?: () => void;
40
29
  /** The backgroundColor of the Tooltip element */
41
30
  bgColor?: string;
42
31
  /** The text color of the Tooltip element */
43
32
  color?: string;
33
+ /** Specify a container element to portal the content into */
34
+ container?: HTMLElement;
35
+ /** The function called after the Tooltip opens */
36
+ afterShow?: () => void;
37
+ /** The function called after the Tooltip closes */
38
+ afterHide?: () => void;
44
39
  };
45
40
  declare const Tooltip: {
46
- ({ trigger, on, children, content, style, position, offsetY, offsetArrowX, offsetX, containerWidth, width, maxWidth, textAlign, disabled, id, afterShow, afterHide, bgColor, color, }: TooltipProps): JSX.Element;
41
+ ({ trigger, children, content, position, offset, width, maxWidth, textAlign, disabled, id, bgColor, color, container, afterShow, afterHide, }: TooltipProps): JSX.Element;
47
42
  Header: import("@emotion/styled").StyledComponent<{
48
43
  theme?: import("@emotion/react").Theme | undefined;
49
44
  as?: import("react").ElementType<any> | undefined;
@@ -0,0 +1,56 @@
1
+ import { ReactNode } from 'react';
2
+ import { ThemeProp } from './types';
3
+ type Position = 'top' | 'bottom' | 'right' | 'left' | 'top left' | 'bottom left' | 'top right' | 'bottom right';
4
+ export type TooltipProps = {
5
+ children?: ReactNode;
6
+ /** The element that will trigger the opening of the Tooltip */
7
+ trigger: ReactNode;
8
+ /** Sets the instigator of the Tooltip opening */
9
+ on?: 'hover' | 'click';
10
+ /** The text content of the Tooltip */
11
+ content?: string;
12
+ /** The style prop of the Tooltip container */
13
+ style?: {
14
+ [key: string]: string | number;
15
+ };
16
+ /** The position of the Tooltip body and arrow in relation to the trigger */
17
+ position?: Position;
18
+ /** Offsets the vertical position of the Tooltip */
19
+ offsetY?: number;
20
+ /** Offsets the horizontal position of the Tooltip arrow */
21
+ offsetArrowX?: number;
22
+ /** Offsets the horizontal position of the Tooltip */
23
+ offsetX?: number;
24
+ /** The width of the Tooltip container */
25
+ containerWidth?: number | string;
26
+ /** The width of the Tooltip element */
27
+ width?: number | string;
28
+ /** The maxWidth of the Tooltip element */
29
+ maxWidth?: number | string;
30
+ /** The textAlignment of the Tooltip text */
31
+ textAlign?: 'left' | 'right' | 'center';
32
+ /** Prevents the Tooltip from opening */
33
+ disabled?: boolean;
34
+ /** The id of the Tooltip element */
35
+ id?: string;
36
+ /** The function called after the Tooltip opens */
37
+ afterShow?: () => void;
38
+ /** The function called after the Tooltip closes */
39
+ afterHide?: () => void;
40
+ /** The backgroundColor of the Tooltip element */
41
+ bgColor?: string;
42
+ /** The text color of the Tooltip element */
43
+ color?: string;
44
+ };
45
+ declare const Tooltip: {
46
+ ({ trigger, on, children, content, style, position, offsetY, offsetArrowX, offsetX, containerWidth, width, maxWidth, textAlign, disabled, id, afterShow, afterHide, bgColor, color, }: TooltipProps): JSX.Element;
47
+ Header: import("@emotion/styled").StyledComponent<{
48
+ theme?: import("@emotion/react").Theme | undefined;
49
+ as?: import("react").ElementType<any> | undefined;
50
+ } & ThemeProp, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
51
+ Body: import("@emotion/styled").StyledComponent<{
52
+ theme?: import("@emotion/react").Theme | undefined;
53
+ as?: import("react").ElementType<any> | undefined;
54
+ } & ThemeProp, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
55
+ };
56
+ export default Tooltip;
@@ -38,6 +38,7 @@ export { default as TransferList } from './components/TransferList';
38
38
  export { default as Table } from './components/Table';
39
39
  export { default as Toggle } from './components/Toggle';
40
40
  export { default as Tooltip } from './components/Tooltip';
41
+ export { default as TooltipLegacy } from './components/TooltipLegacy';
41
42
  export { default as theme } from './theme';
42
43
  export type { ITheme, ThemeProp } from './theme/ThemeTypes';
43
44
  export type { IconNames } from './components/Icon/icons';
@@ -53,4 +54,5 @@ export { default as useConfirm } from './hooks/useConfirm';
53
54
  export { default as useElementObserver } from './hooks/useElementObserver';
54
55
  export { default as formatDate } from './utils/formatDate';
55
56
  export { default as copyToClipboard } from './utils/copyToClipboard';
57
+ export { default as numberWithCommas } from './utils/numberWithCommas';
56
58
  export { widthHeightProps, paddingProps, marginProps, positionProps } from './components/helpers/styledProps';
@@ -2,3 +2,4 @@ export { default as chunk } from './chunk';
2
2
  export { default as range } from './range';
3
3
  export { default as formatDate } from './formatDate';
4
4
  export { default as copyToClipboard } from './copyToClipboard';
5
+ export { default as numberWithCommas } from './numberWithCommas';
@@ -0,0 +1,2 @@
1
+ declare const numberWithCommas: (number: number) => string;
2
+ export default numberWithCommas;