@am92/react-design-system 2.9.6 → 2.9.7
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/dist/Components/DsLink/DsLink.Overrides.d.ts +5 -0
- package/dist/Components/DsLink/DsLink.Overrides.js +6 -1
- package/dist/Components/DsTooltip/DsTooltip.Component.d.ts +3 -2
- package/dist/Components/DsTooltip/DsTooltip.Component.js +10 -14
- package/dist/Components/DsTooltip/DsTooltip.Overrides.d.ts +1 -1
- package/dist/Components/DsTooltip/DsTooltip.Types.d.ts +32 -4
- package/dist/Components/DsTooltip/DsTooltip.Types.js +14 -2
- package/dist/Theme/componentOverrides.d.ts +6 -1
- package/package.json +1 -1
|
@@ -6,6 +6,10 @@ export declare const DsLinkOverrides: {
|
|
|
6
6
|
cursor: string;
|
|
7
7
|
textDecorationColor: string;
|
|
8
8
|
textUnderlinePosition: string;
|
|
9
|
+
fontWeight: string;
|
|
10
|
+
fontSize: string;
|
|
11
|
+
lineHeight: string;
|
|
12
|
+
letterSpacing: string;
|
|
9
13
|
'&:visited': {
|
|
10
14
|
color: string;
|
|
11
15
|
textDecorationColor: string;
|
|
@@ -25,6 +29,7 @@ export declare const DsLinkOverrides: {
|
|
|
25
29
|
};
|
|
26
30
|
'&:focus': {
|
|
27
31
|
textDecoration: string;
|
|
32
|
+
textDecorationThickness: string;
|
|
28
33
|
};
|
|
29
34
|
};
|
|
30
35
|
};
|
|
@@ -7,6 +7,10 @@ export const DsLinkOverrides = {
|
|
|
7
7
|
cursor: 'pointer',
|
|
8
8
|
textDecorationColor: 'var(--ds-colour-actionSecondary)',
|
|
9
9
|
textUnderlinePosition: 'under',
|
|
10
|
+
fontWeight: 'var(--ds-typo-bodyRegularSmall-fontWeight)',
|
|
11
|
+
fontSize: 'var(--ds-typo-bodyRegularSmall-fontSize)',
|
|
12
|
+
lineHeight: 'var(--ds-typo-bodyRegularSmall-lineHeight)',
|
|
13
|
+
letterSpacing: 'var(--ds-typo-bodyRegularSmall-letterSpacing)',
|
|
10
14
|
'&:visited': {
|
|
11
15
|
color: 'var(--ds-colour-stateSelectedVisitedTextLink)',
|
|
12
16
|
textDecorationColor: 'var(--ds-colour-stateSelectedVisitedTextLink)'
|
|
@@ -25,7 +29,8 @@ export const DsLinkOverrides = {
|
|
|
25
29
|
textDecorationColor: 'var(--ds-colour-typoDisabled)'
|
|
26
30
|
},
|
|
27
31
|
'&:focus': {
|
|
28
|
-
textDecoration: 'underline'
|
|
32
|
+
textDecoration: 'underline',
|
|
33
|
+
textDecorationThickness: '2px',
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
36
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { DsTooltipProps } from './DsTooltip.Types';
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const CustomTooltip: <TWrapper extends React.ElementType = React.ElementType<any, keyof React.JSX.IntrinsicElements>>(InProps: DsTooltipProps<TWrapper>) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const DsTooltip: <TWrapper extends React.ElementType = React.ElementType<any, keyof React.JSX.IntrinsicElements>>(InProps: DsTooltipProps<TWrapper>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,21 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import Tooltip from '@mui/material/Tooltip';
|
|
4
|
+
import { DsTooltipDefaultProps } from './DsTooltip.Types';
|
|
4
5
|
import { DsTypography } from '../DsTypography';
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
export const CustomTooltip = (InProps) => {
|
|
7
|
+
const props = { ...DsTooltipDefaultProps, ...InProps };
|
|
7
8
|
const renderTitle = () => {
|
|
8
|
-
const { heading, description
|
|
9
|
-
|
|
10
|
-
? React.cloneElement(buttonGroup, {
|
|
11
|
-
size: 'small',
|
|
12
|
-
fullWidth: true,
|
|
13
|
-
noPadding: true,
|
|
14
|
-
sx: { bgcolor: 'transparent', mt: 'var(--ds-spacing-bitterCold)' }
|
|
15
|
-
})
|
|
16
|
-
: false;
|
|
17
|
-
return (_jsxs(_Fragment, { children: [heading && (_jsx(DsTypography, { component: "div", variant: "bodyBoldMedium", sx: { mb: 'var(--ds-spacing-glacial)' }, children: heading })), description && (_jsx(DsTypography, { component: "div", variant: "bodyRegularMedium", children: description })), tooltipButtonGroup] }));
|
|
9
|
+
const { heading, description } = props;
|
|
10
|
+
return (_jsxs(_Fragment, { children: [heading && (_jsx(DsTypography, { component: 'div', variant: 'bodyBoldMedium', sx: { mb: 'var(--ds-spacing-glacial)' }, children: heading })), description && (_jsx(DsTypography, { component: 'div', variant: 'bodyRegularMedium', children: description }))] }));
|
|
18
11
|
};
|
|
19
|
-
const { heading, description,
|
|
20
|
-
|
|
12
|
+
const { heading, description, slots, slotProps, children, ...tooltipProps } = props;
|
|
13
|
+
const WrapperComponent = slots?.wrapper || React.Fragment;
|
|
14
|
+
const wrapperProps = slotProps?.wrapper || {};
|
|
15
|
+
return (_jsx(Tooltip, { title: renderTitle(), ...tooltipProps, children: _jsx(WrapperComponent, { ...wrapperProps, children: children || null }) }));
|
|
21
16
|
};
|
|
17
|
+
export const DsTooltip = CustomTooltip;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const DsTooltipOverrides: {
|
|
2
2
|
MuiTooltip: {
|
|
3
|
-
defaultProps: import("./DsTooltip.Types").DsTooltipProps
|
|
3
|
+
defaultProps: import("./DsTooltip.Types").DsTooltipProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").LinkTypeMap<{}, "a">>>;
|
|
4
4
|
styleOverrides: {
|
|
5
5
|
popper: {
|
|
6
6
|
'&[data-popper-placement*="bottom"]': {
|
|
@@ -1,7 +1,35 @@
|
|
|
1
1
|
import { TooltipProps } from '@mui/material';
|
|
2
|
-
|
|
2
|
+
import { DsLink } from '../DsLink';
|
|
3
|
+
type DsTooltipSlots<TWrapper extends React.ElementType = React.ElementType> = TooltipProps['slots'] & {
|
|
4
|
+
/** This is a slot is used to provide custom component to the wrapping parent of the tooltip children */
|
|
5
|
+
wrapper?: TWrapper;
|
|
6
|
+
};
|
|
7
|
+
type DsTooltipSlotProps<TWrapper extends React.ElementType = React.ElementType> = TooltipProps['slotProps'] & {
|
|
8
|
+
/** This is a slot is used to provide props to the custom wrapping parent of the tooltip children */
|
|
9
|
+
wrapper?: React.ComponentProps<TWrapper>;
|
|
10
|
+
};
|
|
11
|
+
export type DsTooltipProps<TWrapper extends React.ElementType = React.ElementType> = Omit<TooltipProps, 'title' | 'slots' | 'slotProps'> & {
|
|
12
|
+
/** This prop can be used to provide a heading to the tooltip */
|
|
3
13
|
heading?: string;
|
|
14
|
+
/** This prop can be used to provide a description to the tooltip */
|
|
4
15
|
description?: string;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
16
|
+
/**
|
|
17
|
+
* The components used for each slot inside.
|
|
18
|
+
*
|
|
19
|
+
* This prop is an alias for the `components` prop, which will be deprecated in the future.
|
|
20
|
+
*
|
|
21
|
+
* @default {}
|
|
22
|
+
*/
|
|
23
|
+
slots?: DsTooltipSlots<TWrapper>;
|
|
24
|
+
/**
|
|
25
|
+
* The extra props for the slot components.
|
|
26
|
+
* You can override the existing props or add new ones.
|
|
27
|
+
*
|
|
28
|
+
* This prop is an alias for the `componentsProps` prop, which will be deprecated in the future.
|
|
29
|
+
*
|
|
30
|
+
* @default {}
|
|
31
|
+
*/
|
|
32
|
+
slotProps?: DsTooltipSlotProps<TWrapper>;
|
|
33
|
+
};
|
|
34
|
+
export declare const DsTooltipDefaultProps: DsTooltipProps<typeof DsLink>;
|
|
35
|
+
export {};
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DsLink } from '../DsLink';
|
|
2
3
|
export const DsTooltipDefaultProps = {
|
|
3
4
|
arrow: true,
|
|
4
|
-
placement: 'top
|
|
5
|
+
placement: 'top',
|
|
5
6
|
enterTouchDelay: 0,
|
|
6
7
|
leaveTouchDelay: 4000,
|
|
7
|
-
children: _jsx(_Fragment, {})
|
|
8
|
+
children: _jsx(_Fragment, {}),
|
|
9
|
+
slots: {
|
|
10
|
+
wrapper: DsLink
|
|
11
|
+
},
|
|
12
|
+
slotProps: {
|
|
13
|
+
wrapper: {
|
|
14
|
+
color: 'inherit',
|
|
15
|
+
variant: 'inherit',
|
|
16
|
+
underline: 'always',
|
|
17
|
+
sx: { textDecorationColor: 'inherit' }
|
|
18
|
+
}
|
|
19
|
+
}
|
|
8
20
|
};
|
|
@@ -288,7 +288,7 @@ declare const componentOverrides: {
|
|
|
288
288
|
defaultProps: import("../Components").DsTypographyProps;
|
|
289
289
|
};
|
|
290
290
|
MuiTooltip: {
|
|
291
|
-
defaultProps: import("../Components").DsTooltipProps
|
|
291
|
+
defaultProps: import("../Components").DsTooltipProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").LinkTypeMap<{}, "a">>>;
|
|
292
292
|
styleOverrides: {
|
|
293
293
|
popper: {
|
|
294
294
|
'&[data-popper-placement*="bottom"]': {
|
|
@@ -769,6 +769,10 @@ declare const componentOverrides: {
|
|
|
769
769
|
cursor: string;
|
|
770
770
|
textDecorationColor: string;
|
|
771
771
|
textUnderlinePosition: string;
|
|
772
|
+
fontWeight: string;
|
|
773
|
+
fontSize: string;
|
|
774
|
+
lineHeight: string;
|
|
775
|
+
letterSpacing: string;
|
|
772
776
|
'&:visited': {
|
|
773
777
|
color: string;
|
|
774
778
|
textDecorationColor: string;
|
|
@@ -788,6 +792,7 @@ declare const componentOverrides: {
|
|
|
788
792
|
};
|
|
789
793
|
'&:focus': {
|
|
790
794
|
textDecoration: string;
|
|
795
|
+
textDecorationThickness: string;
|
|
791
796
|
};
|
|
792
797
|
};
|
|
793
798
|
};
|