@digital-ai/dot-components 4.16.1 → 4.16.2

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.
package/index.esm.js CHANGED
@@ -6651,21 +6651,21 @@ const DotChip = ({
6651
6651
  size = 'medium',
6652
6652
  startIcon,
6653
6653
  tabIndex,
6654
- tooltipHoverVisibility = 'overflow'
6654
+ tooltipProps
6655
6655
  }) => {
6656
6656
  const errorClass = error ? 'Mui-error' : '';
6657
6657
  const rootClasses = useStylesWithRootClass(rootClassName$Z, className, errorClass);
6658
6658
  const isTruncated = charactersLimit > 0 && children.length > charactersLimit;
6659
- const getChipLabelWithTooltip = label => jsx(DotTooltip, {
6659
+ const getChipLabelWithTooltip = label => jsx(DotTooltip, Object.assign({}, tooltipProps, {
6660
6660
  hoverVisibility: "always",
6661
6661
  title: children,
6662
6662
  children: jsx("span", {
6663
6663
  children: label
6664
6664
  })
6665
- });
6665
+ }));
6666
6666
  const getChipLabel = () => {
6667
6667
  const label = isTruncated ? `${children.substring(0, charactersLimit)}...` : children;
6668
- if (tooltipHoverVisibility === 'always' || isTruncated && tooltipHoverVisibility === 'overflow') {
6668
+ if (!tooltipProps && isTruncated || (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.hoverVisibility) === 'always' || isTruncated && (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.hoverVisibility) === 'overflow') {
6669
6669
  return getChipLabelWithTooltip(label);
6670
6670
  } else return label;
6671
6671
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digital-ai/dot-components",
3
- "version": "4.16.1",
3
+ "version": "4.16.2",
4
4
  "private": false,
5
5
  "license": "SEE LICENSE IN <LICENSE.md>",
6
6
  "contributors": [
@@ -1,7 +1,8 @@
1
1
  import { MouseEvent, ReactElement } from 'react';
2
- import { TooltipHoverVisibility } from '../tooltip';
2
+ import { TooltipProps } from '../tooltip';
3
3
  import { CommonProps } from '../CommonProps';
4
4
  export type ChipSize = 'medium' | 'small';
5
+ export type ChipTooltipProps = Omit<TooltipProps, 'children' | 'title'>;
5
6
  export declare const DEFAULT_CHARACTERS_LIMIT = 32;
6
7
  export interface ChipProps extends CommonProps {
7
8
  /** If provided, will display an avatar which takes precedence over icon */
@@ -28,7 +29,7 @@ export interface ChipProps extends CommonProps {
28
29
  startIcon?: ReactElement;
29
30
  /** The tab index of the chip */
30
31
  tabIndex?: number;
31
- /** Tooltip option which governs when the tooltip text should be visible */
32
- tooltipHoverVisibility?: TooltipHoverVisibility;
32
+ /** Custom tooltip props to fine-tune tooltip display when rendered */
33
+ tooltipProps?: ChipTooltipProps;
33
34
  }
34
- export declare const DotChip: ({ ariaLabel, avatar, charactersLimit, children, className, "data-pendoid": dataPendoId, "data-testid": dataTestId, disabled, error, isClickable, isDeletable, onClick, onDelete, size, startIcon, tabIndex, tooltipHoverVisibility, }: ChipProps) => import("react/jsx-runtime").JSX.Element;
35
+ export declare const DotChip: ({ ariaLabel, avatar, charactersLimit, children, className, "data-pendoid": dataPendoId, "data-testid": dataTestId, disabled, error, isClickable, isDeletable, onClick, onDelete, size, startIcon, tabIndex, tooltipProps, }: ChipProps) => import("react/jsx-runtime").JSX.Element;
@@ -49,6 +49,7 @@ export type { CarouselAnimationVariant, CarouselNavigationButtonDisplayOption, C
49
49
  export type { StickyWithBorderProps } from './sticky-with-border';
50
50
  export type { SlotProps, TooltipProps, TooltipHoverVisibility, TooltipPlacement, } from './tooltip';
51
51
  export type { DashboardHeaderProps } from './analytics/dashboard-header/DashboardHeader';
52
+ export type { ChipTooltipProps, ChipProps, ChipSize } from './chip/Chip';
52
53
  export { DotAccordion } from './accordion/Accordion';
53
54
  export { DotActionToolbar } from './action-toolbar/ActionToolbar';
54
55
  export { DotAlertBanner } from './alert-banner/AlertBanner';