@carto/ps-react-ui 4.1.0 → 4.2.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,3 @@
1
1
  import { BasemapsUIProps } from './types';
2
2
  import { JSX } from 'react';
3
- export declare function BasemapsUI({ options, labels: _labels, position, selected, onChange, }: BasemapsUIProps): JSX.Element;
3
+ export declare function BasemapsUI({ options, labels: _labels, position, selected, onChange, TooltipProps, }: BasemapsUIProps): JSX.Element;
@@ -1,4 +1,4 @@
1
- import { SxProps, Theme } from '@mui/material';
1
+ import { SxProps, Theme, TooltipProps } from '@mui/material';
2
2
  export interface BasemapsUILabels {
3
3
  toggle: {
4
4
  title: string;
@@ -23,4 +23,5 @@ export interface BasemapsUIProps {
23
23
  selected: string | null | undefined;
24
24
  sx?: SxProps<Theme>;
25
25
  onChange: (id: string) => void;
26
+ TooltipProps?: Omit<TooltipProps, 'title'>;
26
27
  }
@@ -16,3 +16,5 @@ export type { ListDataProps, DataItem } from './list-data/types';
16
16
  export { ListDataUI } from './list-data/list-data';
17
17
  export { BasemapsUI } from './basemaps/basemaps';
18
18
  export type { BasemapsUIProps } from './basemaps/types';
19
+ export { Tooltip, setTooltipEnterDelay } from './tooltip/tooltip';
20
+ export { SmartTooltip } from './smart-tooltip/smart-tooltip';
@@ -0,0 +1,11 @@
1
+ import { TooltipProps } from '@mui/material';
2
+ import { JSX, Ref } from 'react';
3
+ export declare function SmartTooltip<T extends HTMLElement>({ title, dependencies, timeout, TooltipProps, children, }: {
4
+ title: string | undefined;
5
+ dependencies?: unknown[];
6
+ timeout?: number;
7
+ children: (props: {
8
+ ref: Ref<T>;
9
+ }) => JSX.Element;
10
+ TooltipProps?: Partial<TooltipProps>;
11
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { TooltipProps } from '@mui/material';
2
+ /**
3
+ * A wrapper around MUI's Tooltip component with enterNextDelay set to 1000ms by default.
4
+ *
5
+ * This component ensures consistent tooltip behavior across the application.
6
+ *
7
+ * @example
8
+ * <Tooltip title="This is a tooltip">
9
+ * <Button>Hover me</Button>
10
+ * </Tooltip>
11
+ */
12
+ export declare function Tooltip({ children, title, enterNextDelay, ...props }: TooltipProps): import("react/jsx-runtime").JSX.Element;
13
+ export declare function setTooltipEnterDelay(delay: number): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carto/ps-react-ui",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "description": "CARTO's Professional Service React Material library",
5
5
  "type": "module",
6
6
  "devDependencies": {