@moderneinc/design-system-components 7.0.0-next.57acda → 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.
@@ -19,9 +19,8 @@ export interface ModTooltipProps extends Omit<TooltipProps, 'title' | 'variant'>
19
19
  */
20
20
  title: ReactNode;
21
21
  /**
22
- * Optional supporting description text. When provided, shows a larger tooltip
23
- * with a heading + body hierarchy: title (13px semibold) above a muted
24
- * description (12px medium).
22
+ * Optional supporting description text. When provided, shows the title
23
+ * (semibold) above a muted description (regular weight).
25
24
  * @default undefined
26
25
  */
27
26
  description?: string;
@@ -37,7 +36,7 @@ export interface ModTooltipProps extends Omit<TooltipProps, 'title' | 'variant'>
37
36
  * - Dark: surfaces.white, typography.body
38
37
  * - Brand: surfaces.snackbarBrand, typography.linkWhite (both fixed across modes)
39
38
  * - Shadow: neutralMedium (0px 8px 15px 0px rgba(31,41,55,0.1))
40
- * - Typography: fontSize.xs (12), fontSize.caption (13), fontWeight.medium (500), fontWeight.semiBold (600)
39
+ * - Typography: semanticTypography.tooltip (12px/1.5 line-height), fontWeight.semiBold (600) for the title
41
40
  */
42
41
  export declare const ModTooltip: {
43
42
  ({ variant, title, description, children, arrow, placement, ...props }: ModTooltipProps): import("react/jsx-runtime").JSX.Element;
package/dist/index.d.ts CHANGED
@@ -3093,9 +3093,8 @@ interface ModTooltipProps extends Omit<TooltipProps, 'title' | 'variant'> {
3093
3093
  */
3094
3094
  title: ReactNode;
3095
3095
  /**
3096
- * Optional supporting description text. When provided, shows a larger tooltip
3097
- * with a heading + body hierarchy: title (13px semibold) above a muted
3098
- * description (12px medium).
3096
+ * Optional supporting description text. When provided, shows the title
3097
+ * (semibold) above a muted description (regular weight).
3099
3098
  * @default undefined
3100
3099
  */
3101
3100
  description?: string;
@@ -3111,7 +3110,7 @@ interface ModTooltipProps extends Omit<TooltipProps, 'title' | 'variant'> {
3111
3110
  * - Dark: surfaces.white, typography.body
3112
3111
  * - Brand: surfaces.snackbarBrand, typography.linkWhite (both fixed across modes)
3113
3112
  * - Shadow: neutralMedium (0px 8px 15px 0px rgba(31,41,55,0.1))
3114
- * - Typography: fontSize.xs (12), fontSize.caption (13), fontWeight.medium (500), fontWeight.semiBold (600)
3113
+ * - Typography: semanticTypography.tooltip (12px/1.5 line-height), fontWeight.semiBold (600) for the title
3115
3114
  */
3116
3115
  declare const ModTooltip: {
3117
3116
  ({ variant, title, description, children, arrow, placement, ...props }: ModTooltipProps): react_jsx_runtime.JSX.Element;
package/dist/index.esm.js CHANGED
@@ -4709,29 +4709,19 @@ const variantConfig = {
4709
4709
  // `.MuiTooltip-tooltip` selectors below actually reach the portaled tooltip
4710
4710
  // (styled(Tooltip) alone applies to the anchor, not the popped content).
4711
4711
  const StyledTooltip = styled(({ className, ...props }) => jsx(Tooltip, { ...props, classes: { popper: className } }), {
4712
- shouldForwardProp: prop => prop !== 'variant' && prop !== 'description',
4713
- })(({ variant = 'light', description }) => {
4714
- const hasDescription = Boolean(description);
4712
+ shouldForwardProp: prop => prop !== 'variant',
4713
+ })(({ variant = 'light' }) => {
4715
4714
  const variantStyles = variantConfig[variant];
4716
4715
  return {
4717
- // Style the tooltip content
4716
+ // Style the tooltip content. Padding/line-height/radius are uniform
4717
+ // regardless of whether a description is present — Figma defines a
4718
+ // single tooltip treatment (title + optional content), not two.
4718
4719
  [`& .${tooltipClasses.tooltip}`]: {
4719
4720
  backgroundColor: variantStyles.backgroundColor,
4720
4721
  color: variantStyles.color,
4721
- fontSize: typography.fontSize.xs,
4722
- fontWeight: typography.fontWeight.medium,
4723
- lineHeight: hasDescription ? 1.5 : 1,
4724
- borderRadius: hasDescription ? borderRadius.s : borderRadius.xS,
4725
- padding: hasDescription ? spacing.spacing_1_1_2 : `0 ${spacing.spacing_1}px`,
4726
- ...(hasDescription && {
4727
- maxWidth: 296,
4728
- }),
4729
- ...(!hasDescription && {
4730
- height: spacing.spacing_3_1_4,
4731
- display: 'flex',
4732
- alignItems: 'center',
4733
- justifyContent: 'center',
4734
- }),
4722
+ ...semanticTypography.tooltip,
4723
+ borderRadius: borderRadius.s,
4724
+ padding: `${spacing.spacing_1}px ${spacing.spacing_1_1_2}px`,
4735
4725
  boxShadow: `${shadows.neutral.medium.x}px ${shadows.neutral.medium.y}px ${shadows.neutral.medium.blur}px ${shadows.neutral.medium.spread}px ${shadows.neutral.medium.shadow}`,
4736
4726
  },
4737
4727
  // Style the arrow
@@ -4751,18 +4741,17 @@ const StyledTooltip = styled(({ className, ...props }) => jsx(Tooltip, { ...prop
4751
4741
  * - Dark: surfaces.white, typography.body
4752
4742
  * - Brand: surfaces.snackbarBrand, typography.linkWhite (both fixed across modes)
4753
4743
  * - Shadow: neutralMedium (0px 8px 15px 0px rgba(31,41,55,0.1))
4754
- * - Typography: fontSize.xs (12), fontSize.caption (13), fontWeight.medium (500), fontWeight.semiBold (600)
4744
+ * - Typography: semanticTypography.tooltip (12px/1.5 line-height), fontWeight.semiBold (600) for the title
4755
4745
  */
4756
4746
  const ModTooltip = ({ variant = 'light', title, description, children, arrow = false, placement, ...props }) => {
4757
- // Build the title content
4758
- // If description is provided, create a structured layout with title + description
4759
- // Otherwise, just show the title text
4760
- const titleContent = description ? (jsxs(Stack, { sx: { gap: 0.5 }, children: [jsx(Typography, { sx: { fontSize: typography.fontSize.caption, fontWeight: typography.fontWeight.semiBold }, children: title }), jsx(Typography, { sx: {
4761
- fontSize: typography.fontSize.xs,
4762
- fontWeight: typography.fontWeight.medium,
4763
- opacity: 0.75,
4764
- }, children: description })] })) : (title);
4765
- return (jsx(StyledTooltip, { variant: variant, description: description, title: titleContent, arrow: arrow, placement: placement, ...props, children: children }));
4747
+ // variant="inherit" stops Typography from applying MUI's own body1 font
4748
+ // styles (which would otherwise win over the container's tooltip typography
4749
+ // a directly-set style beats an inherited one regardless of specificity),
4750
+ // letting it inherit fontSize/lineHeight/fontFamily from `.MuiTooltip-tooltip`.
4751
+ // Title is always semibold; description (when present) inherits the
4752
+ // container's regular weight, distinguishing it from the title above it.
4753
+ const titleContent = description ? (jsxs(Stack, { sx: { gap: `${spacing.spacing_1_4}px` }, children: [jsx(Typography, { variant: "inherit", sx: { fontWeight: typography.fontWeight.semiBold }, children: title }), jsx(Typography, { variant: "inherit", children: description })] })) : (jsx(Typography, { variant: "inherit", sx: { fontWeight: typography.fontWeight.semiBold }, children: title }));
4754
+ return (jsx(StyledTooltip, { variant: variant, title: titleContent, arrow: arrow, placement: placement, ...props, children: children }));
4766
4755
  };
4767
4756
  ModTooltip.displayName = 'ModTooltip';
4768
4757
 
@@ -5800,6 +5789,13 @@ const StyledTab = styled(MuiTab)(({ theme }) => ({
5800
5789
  lineHeight: '1.5rem',
5801
5790
  color: semanticColors.color.text.tabInactive,
5802
5791
  transition: 'none', // Remove animation
5792
+ // The count stays a step quieter than the label, but on secondary text ink
5793
+ // rather than ModTag's neutral status ink. That one is tuned for standalone
5794
+ // badges and is a warm grey: in dark mode it lands #aca598 beside an #f1f0ea
5795
+ // label and reads as disabled rather than as secondary.
5796
+ [`& .${chipClasses.root}`]: {
5797
+ color: semanticColors.color.text.secondary,
5798
+ },
5803
5799
  [`&.${tabClasses.selected}`]: {
5804
5800
  color: semanticColors.color.text.tabActive,
5805
5801
  fontWeight: typography.fontWeight.semiBold,
@@ -5825,6 +5821,9 @@ const StyledTab = styled(MuiTab)(({ theme }) => ({
5825
5821
  color: semanticColors.button.fgDisabled,
5826
5822
  cursor: 'not-allowed',
5827
5823
  pointerEvents: 'auto',
5824
+ [`& .${chipClasses.root}`]: {
5825
+ color: semanticColors.color.text.tabDisabled,
5826
+ },
5828
5827
  '&:hover': {
5829
5828
  backgroundColor: 'transparent',
5830
5829
  },