gantri-components 1.154.0 → 1.155.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,3 +1,15 @@
1
1
  import { FC, PropsWithChildren } from 'react';
2
2
  import { TooltipProps } from './tooltip.types';
3
+ /**
4
+ * @example
5
+ * // With title/description
6
+ * <Tooltip title={TITLE_TO_RENDER} description={DESCRIPTION_TO_RENDER}>
7
+ * {ALWAYS_VISIBLE_TRIGGER}
8
+ * </Tooltip>
9
+ *
10
+ * // With custom content
11
+ * <Tooltip content={<div>CUSTOM_CONTENT</div>}>
12
+ * {ALWAYS_VISIBLE_TRIGGER}
13
+ * </Tooltip>
14
+ */
3
15
  export declare const Tooltip: FC<PropsWithChildren<TooltipProps>>;
@@ -1,2 +1,2 @@
1
- import { TooltipProps } from './tooltip.types';
2
- export declare const TooltipPresets: Partial<TooltipProps>;
1
+ import { TooltipDefaultProps } from './tooltip.types';
2
+ export declare const TooltipPresets: TooltipDefaultProps;
@@ -1,6 +1,7 @@
1
1
  import { ReactNode } from 'react';
2
2
  import { OverlayProps } from '../overlay/overlay.types';
3
- export interface TooltipProps extends Pick<OverlayProps, 'position'> {
3
+ export declare type TooltipProps = TooltipBaseProps & TriggerEventProps;
4
+ interface TooltipBaseProps extends Required<Pick<OverlayProps, 'position'>> {
4
5
  /**
5
6
  * If specified, it will take preference over title/description
6
7
  * */
@@ -9,5 +10,16 @@ export interface TooltipProps extends Pick<OverlayProps, 'position'> {
9
10
  descriptionTx?: string;
10
11
  title?: string;
11
12
  titleTx?: string;
12
- triggerEvent?: OverlayProps['triggerEvent'];
13
13
  }
14
+ export declare type TooltipDefaultProps = Required<Pick<OverlayProps, 'position'>> & TriggerEventProps;
15
+ declare type TriggerEventProps = WithManualTriggerEvent | WithoutManualTriggerEvent;
16
+ declare type WithManualTriggerEvent = {
17
+ /** Used when `triggerEvent === 'manual'` */
18
+ open: boolean;
19
+ triggerEvent: Extract<OverlayProps['triggerEvent'], 'manual'>;
20
+ };
21
+ declare type WithoutManualTriggerEvent = {
22
+ open?: never;
23
+ triggerEvent?: Exclude<OverlayProps['triggerEvent'], 'manual'>;
24
+ };
25
+ export {};