@ws-ui/shared 1.11.2 → 1.11.3-rc2

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,2 @@
1
+ import { RefForwardingComponent, ToolbarIconProps } from './interfaces';
2
+ export declare const ToolbarIcon: RefForwardingComponent<'span', ToolbarIconProps>;
@@ -0,0 +1,21 @@
1
+ import { IconType } from '@ws-ui/icons';
2
+ export type Omit<T, U> = Pick<T, Exclude<keyof T, keyof U>>;
3
+ export type ReplaceProps<Inner extends React.ElementType, P> = Omit<React.ComponentPropsWithRef<Inner>, P> & P;
4
+ export interface WithAsProps<As extends React.ElementType | string = React.ElementType> {
5
+ /** You can use a custom element for this component */
6
+ as?: As;
7
+ }
8
+ export interface RefForwardingComponent<T extends React.ElementType, P> {
9
+ <As extends React.ElementType = T>(props: React.PropsWithChildren<ReplaceProps<As, WithAsProps<As> & P>>, context?: any): React.ReactElement | null;
10
+ propTypes?: any;
11
+ contextTypes?: any;
12
+ displayName?: string;
13
+ }
14
+ export interface ToolbarIconProps<As extends React.ElementType | string = React.ElementType> {
15
+ label: string;
16
+ disabled?: boolean;
17
+ disableHover?: boolean;
18
+ Icon: IconType;
19
+ iconClassname?: string;
20
+ as?: As;
21
+ }
@@ -1,11 +1,15 @@
1
- import { default as React } from 'react';
1
+ import { FC } from 'react';
2
2
  import { Placement } from '@popperjs/core';
3
3
  interface ITooltip {
4
- label: string;
4
+ label: string | JSX.Element;
5
5
  placement?: Placement;
6
6
  className?: string;
7
7
  isDisabled?: boolean;
8
8
  container?: Element;
9
9
  }
10
- export declare const Tooltip: React.FC<ITooltip>;
10
+ export declare const Tooltip: FC<ITooltip>;
11
+ export declare const PopperTooltip: FC<{
12
+ referenceElement: HTMLElement | null;
13
+ label: string;
14
+ }>;
11
15
  export {};
@@ -5,7 +5,6 @@ export * from './Tree';
5
5
  export * from './Incase';
6
6
  export * from './Tips';
7
7
  export * from './Tips/provider';
8
- export * from './ControlledSwitch';
9
8
  export * from './Tooltip';
10
9
  export * from './AppLoader';
11
10
  export * from './Modal';
@@ -13,3 +12,4 @@ export * from './ZoomComponent';
13
12
  export * from './FloatingTooltip';
14
13
  export * from './Panel';
15
14
  export * from './Checkbox';
15
+ export * from './ToolbarIcon';