Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: apply CAP visual refresh and add 'brand' appearance variant",
"packageName": "@fluentui/react-tooltip",
"email": "egianoglio@microsoft.com",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const tooltipClassNames: SlotClassNames<TooltipSlots>;

Copy link
Copy Markdown

@github-actions github-actions Bot Apr 1, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕵🏾‍♀️ visual changes to review in the Visual Change Report

vr-tests-react-components/Avatar Converged 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Avatar Converged.badgeMask.normal.chromium.png 3 Changed
vr-tests-react-components/Avatar Converged.badgeMask - RTL.normal.chromium.png 6 Changed
vr-tests-react-components/Charts-DonutChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic - Dark Mode.default.chromium.png 7530 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default - RTL.submenus open.chromium.png 404 Changed
vr-tests-react-components/Menu Converged - submenuIndicator slotted content.default.submenus open.chromium.png 413 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 506 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 494 Changed
vr-tests-react-components/ProgressBar converged 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - High Contrast.default.chromium.png 69 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness.default.chromium.png 39 Changed
vr-tests-react-components/ProgressBar converged.Indeterminate + thickness - Dark Mode.default.chromium.png 34 Changed
vr-tests-react-components/TagPicker 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/TagPicker.disabled - Dark Mode.chromium.png 658 Changed
vr-tests-react-components/Tooltip Converged 17 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Tooltip Converged.basic - High Contrast.default.chromium.png 557 Changed
vr-tests-react-components/Tooltip Converged.basic.default.chromium.png 299 Changed
vr-tests-react-components/Tooltip Converged.basic - Dark Mode.default.chromium.png 213 Changed
vr-tests-react-components/Tooltip Converged.inverted - Dark Mode.default.chromium.png 232 Changed
vr-tests-react-components/Tooltip Converged.inverted withArrow - Dark Mode.default.chromium.png 480 Changed
vr-tests-react-components/Tooltip Converged.inverted withArrow.default.chromium.png 995 Changed
vr-tests-react-components/Tooltip Converged.overflow-wrap withArrow.default.chromium.png 1079 Changed
vr-tests-react-components/Tooltip Converged.overflow-wrap.default.chromium.png 1082 Changed
vr-tests-react-components/Tooltip Converged.inverted.default.chromium.png 496 Changed
vr-tests-react-components/Tooltip Converged.positioning - High Contrast.positioned tooltips.chromium.png 5001 Changed
vr-tests-react-components/Tooltip Converged.positioning - RTL.positioned tooltips.chromium.png 3544 Changed
vr-tests-react-components/Tooltip Converged.positioning with fallbacks.positioning fallbacks.chromium.png 1976 Changed
vr-tests-react-components/Tooltip Converged.text-wrapping.default.chromium.png 994 Changed
vr-tests-react-components/Tooltip Converged.withArrow - Dark Mode.default.chromium.png 345 Changed
vr-tests-react-components/Tooltip Converged.withArrow - High Contrast.default.chromium.png 797 Changed
vr-tests-react-components/Tooltip Converged.positioning.positioned tooltips.chromium.png 3553 Changed
vr-tests-react-components/Tooltip Converged.withArrow.default.chromium.png 460 Changed

There were 1 duplicate changes discarded. Check the build logs for more information.

// @public
export type TooltipProps = ComponentProps<TooltipSlots> & TriggerProps<TooltipTriggerProps> & Pick<PortalProps, 'mountNode'> & {
appearance?: 'normal' | 'inverted';
appearance?: 'normal' | 'inverted' | 'brand';
hideDelay?: number;
onVisibleChange?: (event: React_2.PointerEvent<HTMLElement> | React_2.FocusEvent<HTMLElement> | undefined, data: OnVisibleChangeData) => void;
positioning?: PositioningShorthand;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ export type TooltipProps = ComponentProps<TooltipSlots> &
* The tooltip's visual appearance.
* * `normal` - Uses the theme's background and text colors.
* * `inverted` - Higher contrast variant that uses the theme's inverted colors.
* * `brand` - Uses the brand colors from the theme.
*
* @default normal
*/
appearance?: 'normal' | 'inverted';
appearance?: 'normal' | 'inverted' | 'brand';
/**
* Delay before the tooltip is hidden, in milliseconds.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import { makeStyles, mergeClasses } from '@griffel/react';
import { createArrowStyles } from '@fluentui/react-positioning';
import { tokens } from '@fluentui/react-theme';
import { tokens, typographyStyles } from '@fluentui/react-theme';
import { arrowHeight } from './private/constants';
import type { TooltipSlots, TooltipState } from './Tooltip.types';
import type { SlotClassNames } from '@fluentui/react-utilities';
Expand All @@ -20,15 +20,14 @@ const useStyles = makeStyles({
boxSizing: 'border-box',
maxWidth: '240px',
cursor: 'default',
fontFamily: tokens.fontFamilyBase,
fontSize: tokens.fontSizeBase200,
lineHeight: tokens.lineHeightBase200,
overflowWrap: 'break-word',
borderRadius: tokens.borderRadiusMedium,
border: `1px solid ${tokens.colorTransparentStroke}`,
padding: '4px 11px 6px 11px', // '5px 12px 7px 12px' minus the border width '1px'
backgroundColor: tokens.colorNeutralBackground1,
color: tokens.colorNeutralForeground1,
...typographyStyles.caption1Strong,
borderRadius: tokens.borderRadiusXLarge,
boxShadow: tokens.shadow8,
padding: `${tokens.spacingVerticalSNudge} ${tokens.spacingHorizontalMNudge}`,

// TODO need to add versions of tokens.alias.shadow.shadow8, etc. that work with filter
filter:
Expand All @@ -45,6 +44,11 @@ const useStyles = makeStyles({
color: tokens.colorNeutralForegroundStaticInverted,
},

brand: {
backgroundColor: tokens.colorBrandBackground,
color: tokens.colorNeutralForegroundOnBrand,
},

arrow: createArrowStyles({ arrowHeight }),
});

Expand All @@ -60,6 +64,7 @@ export const useTooltipStyles_unstable = (state: TooltipState): TooltipState =>
tooltipClassNames.content,
styles.root,
state.appearance === 'inverted' && styles.inverted,
state.appearance === 'brand' && styles.brand,
state.visible && styles.visible,
state.content.className,
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import * as React from 'react';
import type { JSXElement } from '@fluentui/react-components';
import { Button, Tooltip } from '@fluentui/react-components';
import { SlideTextFilled } from '@fluentui/react-icons';

export const Brand = (): JSXElement => (
<Tooltip appearance="brand" content="Example brand tooltip" relationship="label">
<Button icon={<SlideTextFilled />} size="large" />
</Tooltip>
);

Brand.storyName = 'Appearance: brand';
Brand.parameters = {
docs: {
description: {
story: "The `appearance` prop can be set to `brand` to use the theme's brand colors.",
},
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export { Default } from './TooltipDefault.stories';
export { RelationshipLabel } from './TooltipRelationshipLabel.stories';
export { RelationshipDescription } from './TooltipRelationshipDescription.stories';
export { Inverted } from './TooltipInverted.stories';
export { Brand } from './TooltipBrand.stories';
export { WithArrow } from './TooltipWithArrow.stories';
export { Styled } from './TooltipStyled.stories';
export { CustomMount } from './TooltipCustomMount.stories';
Expand Down
Loading