Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
48fdc34
Semantic-tokens: Add initial package (#34121)
Mitch-At-Work Apr 3, 2025
e36c252
Semantic-tokens: Generation Scripts (#34159)
Mitch-At-Work Apr 11, 2025
ed5ca5b
Semantic Tokens: Generate token baseline (#34217)
Mitch-At-Work Apr 14, 2025
25ccb55
Semantic-tokens: Flat export deprecated tokens (Tree shakability in E…
Mitch-At-Work Apr 14, 2025
ef63809
Semantic-Tokens: React-Link (#34218)
Mitch-At-Work Apr 17, 2025
aaa46d0
Handle duplicate tokens and enable null for f2 overrides (#34277)
Mitch-At-Work Apr 17, 2025
6dd3bec
Extended-tokens: Cleanup token exports (#34384)
Mitch-At-Work May 8, 2025
f4759db
Extended-tokens: Update to latest JSON spec and fix camel casing (#34…
Mitch-At-Work May 14, 2025
75e3bc1
Semantic Tokens: Progress Bar (#34403)
etudie May 14, 2025
4cdeb03
Extended-tokens: Fix regressions from new JSON refactor (#34458)
Mitch-At-Work May 15, 2025
967e606
Extended-tokens: Fix link focus reference (changed in latest JSON upd…
Mitch-At-Work May 15, 2025
8b07b2a
Semantic Tokens: React-text and react-label (#34350)
Mitch-At-Work May 15, 2025
b79b1c2
Semantic-tokens: React-button (#34276)
Mitch-At-Work May 20, 2025
8e20f63
Extended-tokens: Fluent variant fallbacks (#34498)
Mitch-At-Work May 22, 2025
db6accd
Extended-tokens: Accordion (#34500)
Mitch-At-Work May 29, 2025
e1496a4
Extended-tokens: Ensure legacy variants also get flat exported from l…
Mitch-At-Work May 29, 2025
5bec65b
Extended-tokens: Add Kumo semantic theme (TEMPORARY - REMOVE BEFORE M…
Mitch-At-Work May 29, 2025
a3cbf70
Extended-tokens: Enable null tokens (#34544)
Mitch-At-Work May 30, 2025
826ae0d
update avatar to use semantic tokens (#34553)
rachethecreator Jun 5, 2025
d46d297
update divider to use semantic tokens (#34601)
rachethecreator Jun 13, 2025
2cf6df4
Extended-tokens: Simplify shadow set (#34660)
Mitch-At-Work Jun 17, 2025
78e2bd3
update fluentOverrides test to dedupe shadow tokens first (#34678)
rachethecreator Jun 18, 2025
068c086
update switch to use semantic tokens (#34489)
rachethecreator Jun 25, 2025
16661a0
update rating to use semantic tokens (#34672)
rachethecreator Jun 25, 2025
d482254
Extended Tokens: React-Drawer (#34683)
Mitch-At-Work Jun 25, 2025
e730dba
Extended Tokens: React-Spinner (#34645)
Mitch-At-Work Jun 25, 2025
6e775b1
React-Tree: Upgrade to extended tokens (#34602)
Mitch-At-Work Jun 25, 2025
bceb283
Extended Tokens: Text area (#34692)
etudie Jun 25, 2025
ada7f7b
Extended tokens: Migrate to custom style hooks + Button example (#34735)
Mitch-At-Work Jul 4, 2025
1878a8a
Extended-tokens: Migrate all semantic styles into custom style hooks …
Mitch-At-Work Jul 4, 2025
1c41b6d
Semantic Style Hooks: Update Readme (#34797)
Mitch-At-Work Jul 8, 2025
03128c7
React-Image: Add Semantic Tokens (#34625)
Mitch-At-Work Jul 10, 2025
8af5529
Extended-tokens: React-List (#34706)
Mitch-At-Work Jul 10, 2025
de23db2
update dialog to use semantic tokens (#34624)
rachethecreator Jul 10, 2025
34af3c9
update message bar to use semantic tokens (#34657)
rachethecreator Jul 10, 2025
c4bf8a7
update tabs to use semantic tokens (#34782)
rachethecreator Jul 11, 2025
428641d
update slider to use semantic tokens (#34758)
rachethecreator Jul 11, 2025
30d6f8e
update menu to use semantic tokens (#34723)
rachethecreator Jul 11, 2025
30ebd0f
update radio to use semantic tokens (#34739)
rachethecreator Jul 11, 2025
c1675f7
add persona to semantic style hooks (#34808)
rachethecreator Jul 14, 2025
eb445e1
Semantic tokens checkbox (#34811)
brandonthomas Jul 14, 2025
7e2289e
Update Badge to use semantic tokens (#34765)
terynk Jul 15, 2025
c5b9b2b
add breadcrumb to semantic style hooks (#34837)
rachethecreator Jul 15, 2025
7010733
Test: Ensure legacy fallback overrides originalToken exists (#34843)
Mitch-At-Work Jul 15, 2025
9ca9756
Field: Update to use Semantic Tokens (#34804)
terynk Jul 16, 2025
1eac911
add spin button to semantic style hooks (#34829)
rachethecreator Jul 16, 2025
54c547a
Extended Tokens: Input (#34796)
etudie Jul 16, 2025
1440974
add toolbar to semantic style hooks (#34840)
rachethecreator Jul 17, 2025
54dc2e6
Semantic Tokens: Tooltip (#34845)
mltejera Jul 17, 2025
cf6bdfb
add infolabel to semantic style hooks (#34856)
rachethecreator Jul 17, 2025
6b8216e
Toast: Update Toast to use semantic tokens (#34844)
terynk Jul 18, 2025
cf0be36
add table to semantic style hooks (#34863)
rachethecreator Jul 21, 2025
ab4bb48
Semantic Tokens: Fix classNames order in Avatar and Accordion (#34885)
Mitch-At-Work Jul 21, 2025
f7b8e4c
Extended Tokens: Search (#34842)
etudie Jul 23, 2025
a4e8061
add teaching popover to semantic style hooks (#34898)
rachethecreator Jul 24, 2025
d59715b
Semantic Tokens: Popover (#34907)
etudie Jul 24, 2025
c7eb8dc
add tokens switch to storybook addon for switching between semantic a…
rachethecreator Jul 29, 2025
3918775
add token switch to public doc site; rename to tokenswitch
rachethecreator Jul 30, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,7 @@ packages/react-components/react-virtualizer/stories @microsoft/xc-uxe @Mitch-At-
packages/react-components/react-skeleton/library @microsoft/cxe-prg
packages/react-components/react-skeleton/stories @microsoft/cxe-prg
packages/tokens @microsoft/teams-prg
packages/semantic-tokens @microsoft/xc-uxe
packages/react-components/react-tags/library @microsoft/cxe-prg @microsoft/teams-prg
packages/react-components/react-tags/stories @microsoft/cxe-prg @microsoft/teams-prg
packages/react-components/react-migration-v0-v9/library @microsoft/teams-prg
Expand Down Expand Up @@ -332,6 +333,8 @@ packages/react-components/react-color-picker/library @microsoft/cxe-prg
packages/react-components/react-color-picker/stories @microsoft/cxe-prg
packages/react-components/component-selector-preview/library @microsoft/teams-prg
packages/react-components/component-selector-preview/stories @microsoft/teams-prg
packages/react-components/semantic-style-hooks-preview/library @microsoft/xc-uxe
packages/react-components/semantic-style-hooks-preview/stories @microsoft/xc-uxe
# <%= NX-CODEOWNER-PLACEHOLDER %>

## Components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ import {
import type { PreparedStory, Renderer, SBEnumType } from '@storybook/types';
import { makeStyles, shorthands, tokens, Link, Text } from '@fluentui/react-components';
import { InfoFilled } from '@fluentui/react-icons';
import { DIR_ID, THEME_ID, themes } from '@fluentui/react-storybook-addon';
import { DIR_ID, THEME_ID, TOKEN_ID, themes } from '@fluentui/react-storybook-addon';
import { DirSwitch } from './DirSwitch.stories';
import { ThemePicker } from './ThemePicker.stories';
import { TokenSwitch } from './TokenSwitch.stories';
import { Toc, nameToHash } from './Toc.stories';

type PrimaryStory = PreparedStory<Renderer>;
Expand Down Expand Up @@ -281,6 +282,7 @@ export const FluentDocsPage = () => {
assertStoryMetaValues(primaryStory);

const dir = primaryStoryContext.parameters?.dir ?? primaryStoryContext.globals?.[DIR_ID] ?? 'ltr';
const token = primaryStoryContext.parameters?.token ?? primaryStoryContext.globals?.[TOKEN_ID] ?? 'semantic';
const selectedTheme = themes.find(theme => theme.id === primaryStoryContext.globals![THEME_ID]);

const hideArgsTable = Boolean(primaryStoryContext.parameters?.docs?.hideArgsTable);
Expand Down Expand Up @@ -308,6 +310,7 @@ export const FluentDocsPage = () => {
<div className={styles.globalTogglesContainer}>
<ThemePicker selectedThemeId={selectedTheme?.id} />
<DirSwitch dir={dir} />
<TokenSwitch token={token} />
</div>
<Subtitle />
<div className={styles.description}>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
import * as React from 'react';
import { makeStyles, Label, Switch, useId, typographyStyles } from '@fluentui/react-components';
import type { SwitchProps } from '@fluentui/react-components';
import { TOKEN_ID } from '@fluentui/react-storybook-addon';
import { addons } from '@storybook/preview-api';

const useStyles = makeStyles({
container: {
alignItems: 'center',
display: 'flex',
justifyContent: 'start',
},
label: {
...typographyStyles.subtitle2,
},
});

/**
* Tokens switch used in the react-components docs header
*/
export const TokenSwitch: React.FC<{ token?: 'semantic' | 'legacy' }> = ({ token }) => {
const switchId = useId('token-switch');

const styles = useStyles();

const [currentToken, setCurrentToken] = React.useState(token);
const checked = currentToken === 'legacy';

const setGlobalToken = (newToken: 'semantic' | 'legacy'): void => {
addons.getChannel().emit('updateGlobals', { globals: { [TOKEN_ID]: newToken } });
};

const onChange = React.useCallback<NonNullable<SwitchProps['onChange']>>((_, data) => {
const newToken = data.checked ? 'legacy' : 'semantic';
setGlobalToken(newToken);
setCurrentToken(newToken);
}, []);

return (
<div className={styles.container}>
<Label className={styles.label} htmlFor={currentToken === 'semantic' ? undefined : switchId}>
Semantic Tokens
</Label>
<Switch checked={checked} id={switchId} onChange={onChange} />
<Label className={styles.label} htmlFor={currentToken === 'legacy' ? switchId : undefined}>
Legacy Tokens
</Label>
</div>
);
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: Export dialog style constants",
"packageName": "@fluentui/react-dialog",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: Export DrawerBaseState for external usage",
"packageName": "@fluentui/react-drawer",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: Add DrawerSurfaceStyle custom style hook",
"packageName": "@fluentui/react-shared-contexts",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "none",
"comment": "docs: Temporarily add kumo semantic theme (will be removed before merge)",
"packageName": "@fluentui/react-storybook-addon",
"email": "[email protected]",
"dependentChangeType": "none"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: Export reservedSpaceClassNames and useTabAnimatedIndicatorStyles_unstable for style overrides",
"packageName": "@fluentui/react-tabs",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: Export ToastContainer state and classNames nessecary for style overrides",
"packageName": "@fluentui/react-toast",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: Export TreeItemCSSProperties for external usage",
"packageName": "@fluentui/react-tree",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "feat: Implement semantic style hooks framework",
"packageName": "@fluentui/semantic-style-hooks-preview",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "feat: Initial semantic token package scaffolding",
"packageName": "@fluentui/semantic-tokens",
"email": "[email protected]",
"dependentChangeType": "patch"
}
1 change: 1 addition & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@
"scripts/**/*",
"packages/eslint-plugin/**",
"packages/tokens/**",
"packages/semantic-tokens/**",
"packages/react-conformance/**",
"packages/react-components/**/*"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,15 @@ export type DialogTriggerState = {
children: React_2.ReactElement | null;
};

// @public (undocumented)
export const FULLSCREEN_DIALOG_SCROLLBAR_OFFSET = "4px";

// @public (undocumented)
export const MEDIA_QUERY_BREAKPOINT_SELECTOR = "@media screen and (max-width: 480px)";

// @public (undocumented)
export const MEDIA_QUERY_SHORT_SCREEN = "@media screen and (max-height: 359px)";

// @public
export const renderDialog_unstable: (state: DialogState, contextValues: DialogContextValues) => JSX.Element;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ const useResetStyles = makeResetStyles({
gridTemplateRows: 'auto 1fr',
gridTemplateColumns: '1fr 1fr auto',

'@supports (height: 1dvh)': {
maxHeight: `calc(100dvh - 2 * ${SURFACE_PADDING})`,
},

[MEDIA_QUERY_BREAKPOINT_SELECTOR]: {
maxWidth: '100vw',
gridTemplateRows: 'auto 1fr auto',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ const useRootBaseStyle = makeResetStyles({
// to ensure dialog will be properly styled when surfaceMotion is opted-out
boxShadow: tokens.shadow64,

'@supports (height: 1dvh)': {
maxHeight: '100dvh',
},

[MEDIA_QUERY_BREAKPOINT_SELECTOR]: {
maxWidth: '100vw',
},
Expand All @@ -64,7 +68,7 @@ const useBackdropBaseStyle = makeResetStyles({
position: 'fixed',
});

const useBackdropStyles = makeStyles({
const useStyles = makeStyles({
nestedDialogBackdrop: {
backgroundColor: tokens.colorTransparentBackground,
},
Expand All @@ -81,15 +85,15 @@ export const useDialogSurfaceStyles_unstable = (state: DialogSurfaceState): Dial
const rootBaseStyle = useRootBaseStyle();

const backdropBaseStyle = useBackdropBaseStyle();
const backdropStyles = useBackdropStyles();
const styles = useStyles();

root.className = mergeClasses(dialogSurfaceClassNames.root, rootBaseStyle, root.className);

if (backdrop) {
backdrop.className = mergeClasses(
dialogSurfaceClassNames.backdrop,
backdropBaseStyle,
isNestedDialog && backdropStyles.nestedDialogBackdrop,
isNestedDialog && styles.nestedDialogBackdrop,
backdrop.className,
);
}
Expand Down
6 changes: 6 additions & 0 deletions packages/react-components/react-dialog/library/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,9 @@ export {
} from './contexts/index';

export type { DialogContextValue, DialogSurfaceContextValue } from './contexts/index';

export {
MEDIA_QUERY_BREAKPOINT_SELECTOR,
MEDIA_QUERY_SHORT_SCREEN,
FULLSCREEN_DIALOG_SCROLLBAR_OFFSET,
} from './contexts/constants';
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ import type { SlotClassNames } from '@fluentui/react-utilities';
// @public
export const Drawer: ForwardRefComponent<DrawerProps>;

// @public (undocumented)
export type DrawerBaseState = Required<Pick<DrawerBaseProps, 'position' | 'size'>> & {
motion: MotionState<HTMLElement>;
open?: boolean;
};

// @public
export const DrawerBody: ForwardRefComponent<DrawerBodyProps>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {

import { useOverlayDrawerSurfaceStyles_unstable } from './useOverlayDrawerSurfaceStyles.styles';
import type { OverlayDrawerSurfaceProps } from './OverlayDrawerSurface.types';
import { useCustomStyleHook_unstable } from '@fluentui/react-shared-contexts';

/**
* @internal
Expand All @@ -30,6 +31,7 @@ export const OverlayDrawerSurface: ForwardRefComponent<OverlayDrawerSurfaceProps
const dialogSurfaceContextValues = useDialogSurfaceContextValues_unstable(dialogSurfaceState);

useOverlayDrawerSurfaceStyles_unstable(dialogSurfaceState);
useCustomStyleHook_unstable('useOverlayDrawerSurfaceStyles_unstable')(dialogSurfaceState);

return renderDialogSurface_unstable(dialogSurfaceState, dialogSurfaceContextValues);
});
Expand Down
2 changes: 2 additions & 0 deletions packages/react-components/react-drawer/library/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,5 @@ export {
useDrawerFooter_unstable,
} from './DrawerFooter';
export type { DrawerFooterProps, DrawerFooterSlots, DrawerFooterState } from './DrawerFooter';

export type { DrawerBaseState } from './shared';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type { DrawerBaseState } from './DrawerBase.types';
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ const useStyles = makeStyles({
},
itemSelected: {
backgroundColor: tokens.colorSubtleBackgroundSelected,
':hover': {
backgroundColor: tokens.colorSubtleBackgroundSelected,
},
':active': {
backgroundColor: tokens.colorSubtleBackgroundSelected,
},
'@media (forced-colors:active)': {
background: 'Highlight',
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ export const CustomStyleHooksContext_unstable: React_2.Context<Partial<{
useDrawerHeaderTitleStyles_unstable: CustomStyleHook;
useDrawerInlineStyles_unstable: CustomStyleHook;
useDrawerOverlayStyles_unstable: CustomStyleHook;
useOverlayDrawerSurfaceStyles_unstable: CustomStyleHook;
useDrawerStyles_unstable: CustomStyleHook;
useDropdownStyles_unstable: CustomStyleHook;
useEmptySwatchStyles_unstable: CustomStyleHook;
Expand Down Expand Up @@ -274,6 +275,7 @@ export type CustomStyleHooksContextValue_unstable = Partial<{
useDrawerHeaderTitleStyles_unstable: CustomStyleHook;
useDrawerInlineStyles_unstable: CustomStyleHook;
useDrawerOverlayStyles_unstable: CustomStyleHook;
useOverlayDrawerSurfaceStyles_unstable: CustomStyleHook;
useDrawerStyles_unstable: CustomStyleHook;
useDropdownStyles_unstable: CustomStyleHook;
useEmptySwatchStyles_unstable: CustomStyleHook;
Expand Down Expand Up @@ -456,6 +458,7 @@ export const CustomStyleHooksProvider_unstable: React_2.Provider<Partial<{
useDrawerHeaderTitleStyles_unstable: CustomStyleHook;
useDrawerInlineStyles_unstable: CustomStyleHook;
useDrawerOverlayStyles_unstable: CustomStyleHook;
useOverlayDrawerSurfaceStyles_unstable: CustomStyleHook;
useDrawerStyles_unstable: CustomStyleHook;
useDropdownStyles_unstable: CustomStyleHook;
useEmptySwatchStyles_unstable: CustomStyleHook;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ export type CustomStyleHooksContextValue = Partial<{
useDrawerInlineStyles_unstable: CustomStyleHook;
/** @deprecated Use useOverlayDrawerStyles_unstable instead. */
useDrawerOverlayStyles_unstable: CustomStyleHook;
useOverlayDrawerSurfaceStyles_unstable: CustomStyleHook;
useDrawerStyles_unstable: CustomStyleHook;
useDropdownStyles_unstable: CustomStyleHook;
useEmptySwatchStyles_unstable: CustomStyleHook;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ export interface FluentGlobals extends Args {
[STRICT_MODE_ID]?: boolean;
// (undocumented)
[THEME_ID]?: ThemeIds;
// (undocumented)
[TOKEN_ID]?: 'semantic' | 'legacy';
}

// @public
Expand All @@ -33,6 +35,8 @@ export interface FluentParameters extends Parameters_2 {
reactStorybookAddon?: {
disabledDecorators: ['AriaLive' | 'FluentProvider' | 'ReactStrictMode'];
};
// (undocumented)
token?: 'semantic' | 'legacy';
}

// @public (undocumented)
Expand All @@ -47,6 +51,7 @@ export interface FluentStoryContext extends StoryContext {
export function parameters(options?: FluentParameters): {
dir: string;
fluentTheme: string;
token: string;
mode: string;
reactStorybookAddon?: {
disabledDecorators: ["AriaLive" | "FluentProvider" | "ReactStrictMode"];
Expand Down Expand Up @@ -75,8 +80,14 @@ export const themes: readonly [{
}, {
readonly id: "teams-high-contrast";
readonly label: "Teams High Contrast";
}, {
readonly id: "semantic-kumo";
readonly label: "Semantic Kumo (Experimental)";
}];

// @public (undocumented)
export const TOKEN_ID: "storybook_fluentui-react-addon_token";

// (No @packageDocumentation comment for this package)

```
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"@fluentui/react-aria": "^9.14.6",
"@fluentui/react-provider": "^9.20.6",
"@fluentui/react-theme": "^9.1.24",
"@fluentui/semantic-style-hooks-preview": "^0.0.0",
"@fluentui/semantic-tokens": "0.0.0-alpha.1",
"@fluentui/react-shared-contexts": "^9.23.1",
"@swc/helpers": "^0.5.1"
},
"peerDependencies": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
"implicitDependencies": [],
"targets": {
"build": {
"dependsOn": [{ "projects": ["react-aria", "react-provider"], "target": "build" }]
"dependsOn": [
{
"projects": ["react-aria", "react-provider", "semantic-tokens", "semantic-style-hooks-preview"],
"target": "build"
}
]
}
}
}
Loading
Loading