@seeqdev/qomponents 0.0.63 → 0.0.65

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,4 +1,4 @@
1
- import { TooltipPosition } from '../Tooltip/Tooltip.types';
1
+ import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
2
2
  interface DropdownSubItems {
3
3
  /** icon class to be used with the dropdown subitems - if available (i.e. 'fc-zoom') */
4
4
  icon?: string;
@@ -37,7 +37,7 @@ interface DropdownSubItems {
37
37
  /** test id for the dropdown subitem */
38
38
  testId?: string;
39
39
  }
40
- export interface ButtonWithDropdownProps {
40
+ export interface ButtonWithDropdownProps extends TooltipComponentProps {
41
41
  /** items for the dropdown content */
42
42
  dropdownItems: DropdownSubItems[];
43
43
  /** icon element to be used as the trigger */
@@ -48,16 +48,6 @@ export interface ButtonWithDropdownProps {
48
48
  extraClassNames?: string;
49
49
  /** id that will be used in the data-testid attribute on the container element */
50
50
  containerTestId?: string;
51
- /** the text to be displayed on the triggers's tooltip */
52
- tooltipText?: string;
53
- /** optional testId applied to the tooltip - useful for testing */
54
- tooltipTestId?: string;
55
- /** number of milliseconds to wait before showing a tooltip on-hover */
56
- tooltipDelay?: number;
57
- /** position of the tooltip */
58
- tooltipPlacement?: TooltipPosition;
59
- /** true if the provided tooltip text should be rendered as HTML */
60
- isHtmlTooltip?: boolean;
61
51
  /** is the button disabled */
62
52
  disabled?: boolean;
63
53
  /** function called when the trigger is clicked on, i.e. for tracking (does not open the popover) */
@@ -1,6 +1,6 @@
1
1
  import React from 'react';
2
- import { TooltipPosition } from '../Tooltip/Tooltip.types';
3
- export interface ButtonWithPopoverProps {
2
+ import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
3
+ export interface ButtonWithPopoverProps extends TooltipComponentProps {
4
4
  /** icon class to be used with the toolbar (i.e. 'fc-zoom') */
5
5
  trigger: React.ReactNode;
6
6
  /** items for the popover content */
@@ -10,16 +10,6 @@ export interface ButtonWithPopoverProps {
10
10
  extraClassNames?: string;
11
11
  /** id that will be used in the data-testid attribute on the container element */
12
12
  containerTestId?: string;
13
- /** the text to be displayed on the icon's tooltip */
14
- tooltipText?: string;
15
- /** optional testId applied to the tooltip - useful for testing */
16
- tooltipTestId?: string;
17
- /** number of milliseconds to wait before showing a tooltip on-hover */
18
- tooltipDelay?: number;
19
- /** position of the tooltip */
20
- tooltipPlacement?: TooltipPosition;
21
- /** true if the provided tooltip text should be rendered as HTML */
22
- isHtmlTooltip?: boolean;
23
13
  disabled?: boolean;
24
14
  /** function called when the toolbar is clicked on, i.e. for tracking (does not open the popover) */
25
15
  onClick?: (isOpen: boolean) => void;
@@ -39,6 +29,8 @@ export interface ButtonWithPopoverProps {
39
29
  onOpenChange?: (isOpen: boolean) => void;
40
30
  /** set to display arrow or not */
41
31
  hasArrow?: boolean;
32
+ /** displays the popover when we hover over trigger */
33
+ isHoverEnabled?: boolean;
42
34
  /** extra trigger container classnames */
43
35
  extraTriggerClassNames?: string;
44
36
  /** extra popover container classnames */
@@ -1,5 +1,6 @@
1
+ import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
1
2
  type FormControlElement = HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement;
2
- export interface CheckboxProps {
3
+ export interface CheckboxProps extends TooltipComponentProps {
3
4
  extraClassNames?: string;
4
5
  extraLabelClassNames?: string;
5
6
  type?: 'radio' | 'checkbox';
@@ -1,7 +1,7 @@
1
- import { TooltipPosition } from '../Tooltip/Tooltip.types';
1
+ import { TooltipComponentProps } from '../Tooltip/Tooltip.types';
2
2
  export declare const iconTypes: readonly ["theme", "white", "dark-gray", "darkish-gray", "gray", "color", "info", "text", "warning", "inherit", "danger", "theme-light", "success"];
3
- export type IconType = typeof iconTypes[number];
4
- export interface IconProps {
3
+ export type IconType = (typeof iconTypes)[number];
4
+ export interface IconProps extends TooltipComponentProps {
5
5
  /** icon class to be used (i.e. fc-zoom) */
6
6
  icon: string;
7
7
  /** normally we want for Icon to prefix FontAwesome icons with the fa-sharp fa-regular prefix however there are a
@@ -26,14 +26,5 @@ export interface IconProps {
26
26
  /** id that will be used in the data-customid attribute on the icon.
27
27
  * Can be used to identify the icon as the click event target in an event handler */
28
28
  customId?: string;
29
- /** text to display on icon tooltip */
30
- tooltip?: string;
31
- /** number of milliseconds to wait before showing a tooltip on-hover */
32
- tooltipDelay?: number;
33
- tooltipPlacement?: TooltipPosition;
34
- /** true if the provided tooltip text should be rendered as HTML */
35
- isHtmlTooltip?: boolean;
36
- /** optional testId applied to the tooltip - useful for testing */
37
- tooltipTestId?: string;
38
29
  number?: number;
39
30
  }
@@ -1,9 +1,21 @@
1
1
  export declare const DEFAULT_TOOL_TIP_DELAY = 500;
2
2
  export declare const tooltipPositions: readonly ["top", "left", "right", "bottom"];
3
- export type TooltipPosition = typeof tooltipPositions[number];
3
+ export type TooltipPosition = (typeof tooltipPositions)[number];
4
4
  export interface TooltipProps {
5
5
  position?: TooltipPosition;
6
6
  children?: JSX.Element | string;
7
7
  text: JSX.Element | string;
8
8
  delay?: number;
9
9
  }
10
+ export interface TooltipComponentProps {
11
+ /** text to display on tooltip */
12
+ tooltip?: string;
13
+ /** number of milliseconds to wait before showing a tooltip on-hover */
14
+ tooltipDelay?: number;
15
+ /** one of four possible tooltip positions */
16
+ tooltipPlacement?: TooltipPosition;
17
+ /** true if the provided tooltip text should be rendered as HTML */
18
+ isHtmlTooltip?: boolean;
19
+ /** optional testId applied to the tooltip - useful for testing */
20
+ tooltipTestId?: string;
21
+ }
@@ -0,0 +1,3 @@
1
+ import { QTipDataAttributes } from './QTip.types';
2
+ import { TooltipComponentProps } from './Tooltip.types';
3
+ export declare const getQTipData: ({ tooltip, tooltipPlacement, isHtmlTooltip, tooltipTestId, tooltipDelay, }: TooltipComponentProps) => QTipDataAttributes | undefined;