@moderneinc/design-system-components 7.0.0-next.8282f1 → 7.0.0-next.e7c42e
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/Tooltip/Tooltip.d.ts +3 -4
- package/dist/index.d.ts +3 -4
- package/dist/index.esm.js +27 -28
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +27 -28
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -4711,29 +4711,19 @@ const variantConfig = {
|
|
|
4711
4711
|
// `.MuiTooltip-tooltip` selectors below actually reach the portaled tooltip
|
|
4712
4712
|
// (styled(Tooltip) alone applies to the anchor, not the popped content).
|
|
4713
4713
|
const StyledTooltip = styles.styled(({ className, ...props }) => jsxRuntime.jsx(Tooltip, { ...props, classes: { popper: className } }), {
|
|
4714
|
-
shouldForwardProp: prop => prop !== 'variant'
|
|
4715
|
-
})(({ variant = 'light'
|
|
4716
|
-
const hasDescription = Boolean(description);
|
|
4714
|
+
shouldForwardProp: prop => prop !== 'variant',
|
|
4715
|
+
})(({ variant = 'light' }) => {
|
|
4717
4716
|
const variantStyles = variantConfig[variant];
|
|
4718
4717
|
return {
|
|
4719
|
-
// Style the tooltip content
|
|
4718
|
+
// Style the tooltip content. Padding/line-height/radius are uniform
|
|
4719
|
+
// regardless of whether a description is present — Figma defines a
|
|
4720
|
+
// single tooltip treatment (title + optional content), not two.
|
|
4720
4721
|
[`& .${Tooltip.tooltipClasses.tooltip}`]: {
|
|
4721
4722
|
backgroundColor: variantStyles.backgroundColor,
|
|
4722
4723
|
color: variantStyles.color,
|
|
4723
|
-
|
|
4724
|
-
|
|
4725
|
-
|
|
4726
|
-
borderRadius: hasDescription ? designSystemTokens.borderRadius.s : designSystemTokens.borderRadius.xS,
|
|
4727
|
-
padding: hasDescription ? designSystemTokens.spacing.spacing_1_1_2 : `0 ${designSystemTokens.spacing.spacing_1}px`,
|
|
4728
|
-
...(hasDescription && {
|
|
4729
|
-
maxWidth: 296,
|
|
4730
|
-
}),
|
|
4731
|
-
...(!hasDescription && {
|
|
4732
|
-
height: designSystemTokens.spacing.spacing_3_1_4,
|
|
4733
|
-
display: 'flex',
|
|
4734
|
-
alignItems: 'center',
|
|
4735
|
-
justifyContent: 'center',
|
|
4736
|
-
}),
|
|
4724
|
+
...designSystemTokens.semanticTypography.tooltip,
|
|
4725
|
+
borderRadius: designSystemTokens.borderRadius.s,
|
|
4726
|
+
padding: `${designSystemTokens.spacing.spacing_1}px ${designSystemTokens.spacing.spacing_1_1_2}px`,
|
|
4737
4727
|
boxShadow: `${designSystemTokens.shadows.neutral.medium.x}px ${designSystemTokens.shadows.neutral.medium.y}px ${designSystemTokens.shadows.neutral.medium.blur}px ${designSystemTokens.shadows.neutral.medium.spread}px ${designSystemTokens.shadows.neutral.medium.shadow}`,
|
|
4738
4728
|
},
|
|
4739
4729
|
// Style the arrow
|
|
@@ -4753,18 +4743,17 @@ const StyledTooltip = styles.styled(({ className, ...props }) => jsxRuntime.jsx(
|
|
|
4753
4743
|
* - Dark: surfaces.white, typography.body
|
|
4754
4744
|
* - Brand: surfaces.snackbarBrand, typography.linkWhite (both fixed across modes)
|
|
4755
4745
|
* - Shadow: neutralMedium (0px 8px 15px 0px rgba(31,41,55,0.1))
|
|
4756
|
-
* - Typography:
|
|
4746
|
+
* - Typography: semanticTypography.tooltip (12px/1.5 line-height), fontWeight.semiBold (600) for the title
|
|
4757
4747
|
*/
|
|
4758
4748
|
const ModTooltip = ({ variant = 'light', title, description, children, arrow = false, placement, ...props }) => {
|
|
4759
|
-
//
|
|
4760
|
-
//
|
|
4761
|
-
//
|
|
4762
|
-
|
|
4763
|
-
|
|
4764
|
-
|
|
4765
|
-
|
|
4766
|
-
|
|
4767
|
-
return (jsxRuntime.jsx(StyledTooltip, { variant: variant, description: description, title: titleContent, arrow: arrow, placement: placement, ...props, children: children }));
|
|
4749
|
+
// variant="inherit" stops Typography from applying MUI's own body1 font
|
|
4750
|
+
// styles (which would otherwise win over the container's tooltip typography
|
|
4751
|
+
// — a directly-set style beats an inherited one regardless of specificity),
|
|
4752
|
+
// letting it inherit fontSize/lineHeight/fontFamily from `.MuiTooltip-tooltip`.
|
|
4753
|
+
// Title is always semibold; description (when present) inherits the
|
|
4754
|
+
// container's regular weight, distinguishing it from the title above it.
|
|
4755
|
+
const titleContent = description ? (jsxRuntime.jsxs(Stack, { sx: { gap: `${designSystemTokens.spacing.spacing_1_4}px` }, children: [jsxRuntime.jsx(Typography, { variant: "inherit", sx: { fontWeight: designSystemTokens.typography.fontWeight.semiBold }, children: title }), jsxRuntime.jsx(Typography, { variant: "inherit", children: description })] })) : (jsxRuntime.jsx(Typography, { variant: "inherit", sx: { fontWeight: designSystemTokens.typography.fontWeight.semiBold }, children: title }));
|
|
4756
|
+
return (jsxRuntime.jsx(StyledTooltip, { variant: variant, title: titleContent, arrow: arrow, placement: placement, ...props, children: children }));
|
|
4768
4757
|
};
|
|
4769
4758
|
ModTooltip.displayName = 'ModTooltip';
|
|
4770
4759
|
|
|
@@ -5802,6 +5791,13 @@ const StyledTab = styles.styled(MuiTab)(({ theme }) => ({
|
|
|
5802
5791
|
lineHeight: '1.5rem',
|
|
5803
5792
|
color: designSystemTokens.semanticColors.color.text.tabInactive,
|
|
5804
5793
|
transition: 'none', // Remove animation
|
|
5794
|
+
// The count stays a step quieter than the label, but on secondary text ink
|
|
5795
|
+
// rather than ModTag's neutral status ink. That one is tuned for standalone
|
|
5796
|
+
// badges and is a warm grey: in dark mode it lands #aca598 beside an #f1f0ea
|
|
5797
|
+
// label and reads as disabled rather than as secondary.
|
|
5798
|
+
[`& .${Chip.chipClasses.root}`]: {
|
|
5799
|
+
color: designSystemTokens.semanticColors.color.text.secondary,
|
|
5800
|
+
},
|
|
5805
5801
|
[`&.${MuiTab.tabClasses.selected}`]: {
|
|
5806
5802
|
color: designSystemTokens.semanticColors.color.text.tabActive,
|
|
5807
5803
|
fontWeight: designSystemTokens.typography.fontWeight.semiBold,
|
|
@@ -5827,6 +5823,9 @@ const StyledTab = styles.styled(MuiTab)(({ theme }) => ({
|
|
|
5827
5823
|
color: designSystemTokens.semanticColors.button.fgDisabled,
|
|
5828
5824
|
cursor: 'not-allowed',
|
|
5829
5825
|
pointerEvents: 'auto',
|
|
5826
|
+
[`& .${Chip.chipClasses.root}`]: {
|
|
5827
|
+
color: designSystemTokens.semanticColors.color.text.tabDisabled,
|
|
5828
|
+
},
|
|
5830
5829
|
'&:hover': {
|
|
5831
5830
|
backgroundColor: 'transparent',
|
|
5832
5831
|
},
|