@digital-ai/dot-components 4.16.0 → 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
|
@@ -3346,9 +3346,15 @@ const StyledMenuList = styled(MenuList)`
|
|
|
3346
3346
|
background: ${hoverGray};
|
|
3347
3347
|
}
|
|
3348
3348
|
|
|
3349
|
-
&.Mui-selected
|
|
3350
|
-
|
|
3351
|
-
|
|
3349
|
+
&.Mui-selected {
|
|
3350
|
+
&,
|
|
3351
|
+
&:hover {
|
|
3352
|
+
background: ${lightSelectedGray};
|
|
3353
|
+
}
|
|
3354
|
+
|
|
3355
|
+
&.Mui-focusVisible {
|
|
3356
|
+
background: ${selectedGray};
|
|
3357
|
+
}
|
|
3352
3358
|
}
|
|
3353
3359
|
|
|
3354
3360
|
&.${listItemWithSubmenuClassName} {
|
|
@@ -6645,21 +6651,21 @@ const DotChip = ({
|
|
|
6645
6651
|
size = 'medium',
|
|
6646
6652
|
startIcon,
|
|
6647
6653
|
tabIndex,
|
|
6648
|
-
|
|
6654
|
+
tooltipProps
|
|
6649
6655
|
}) => {
|
|
6650
6656
|
const errorClass = error ? 'Mui-error' : '';
|
|
6651
6657
|
const rootClasses = useStylesWithRootClass(rootClassName$Z, className, errorClass);
|
|
6652
6658
|
const isTruncated = charactersLimit > 0 && children.length > charactersLimit;
|
|
6653
|
-
const getChipLabelWithTooltip = label => jsx(DotTooltip, {
|
|
6659
|
+
const getChipLabelWithTooltip = label => jsx(DotTooltip, Object.assign({}, tooltipProps, {
|
|
6654
6660
|
hoverVisibility: "always",
|
|
6655
6661
|
title: children,
|
|
6656
6662
|
children: jsx("span", {
|
|
6657
6663
|
children: label
|
|
6658
6664
|
})
|
|
6659
|
-
});
|
|
6665
|
+
}));
|
|
6660
6666
|
const getChipLabel = () => {
|
|
6661
6667
|
const label = isTruncated ? `${children.substring(0, charactersLimit)}...` : children;
|
|
6662
|
-
if (
|
|
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') {
|
|
6663
6669
|
return getChipLabelWithTooltip(label);
|
|
6664
6670
|
} else return label;
|
|
6665
6671
|
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { MouseEvent, ReactElement } from 'react';
|
|
2
|
-
import {
|
|
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
|
-
/**
|
|
32
|
-
|
|
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,
|
|
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';
|