Skip to content
Draft
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ packages/react-components/react-virtualizer/stories @microsoft/xc-uxe @Mitch-At-
packages/react-components/react-skeleton/library @microsoft/cxe-prg @marcosmoura
Copy link

@github-actions github-actions bot Oct 27, 2025

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/Charts-DonutChart 3 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Charts-DonutChart.Dynamic - Dark Mode.default.chromium.png 12635 Changed
vr-tests-react-components/Charts-DonutChart.Dynamic.default.chromium.png 27053 Changed
vr-tests-react-components/Charts-DonutChart.Dynamic - RTL.default.chromium.png 30793 Changed
vr-tests-react-components/Positioning 2 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-react-components/Positioning.Positioning end.chromium.png 139 Changed
vr-tests-react-components/Positioning.Positioning end.updated 2 times.chromium.png 36 Changed
vr-tests-web-components/Badge 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/Badge. - Dark Mode.normal.chromium.png 444 Changed
vr-tests-web-components/Checkbox 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/Checkbox. - Dark Mode.normal.chromium_1.png 3 Changed
vr-tests-web-components/MenuList 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/MenuList. - Dark Mode.normal.chromium.png 500 Changed
vr-tests-web-components/RadioGroup 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests-web-components/RadioGroup. - Dark Mode.normal.chromium_1.png 59 Changed
vr-tests/Callout 4 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/Callout.Bottom left edge - RTL.default.chromium.png 2186 Changed
vr-tests/Callout.Left bottom edge.default.chromium.png 3123 Changed
vr-tests/Callout.Bottom right edge - RTL.default.chromium.png 1114 Changed
vr-tests/Callout.No callout width specified.default.chromium.png 2126 Changed
vr-tests/Coachmark 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/Coachmark.Collapsed.default.chromium.png 159 Changed
vr-tests/react-charting-MultiStackBarChart 1 screenshots
Image Name Diff(in Pixels) Image Type
vr-tests/react-charting-MultiStackBarChart.Basic_PartToWhole - Dark Mode.default.chromium.png 363 Changed

packages/react-components/react-skeleton/stories @microsoft/cxe-prg @marcosmoura
packages/tokens @microsoft/teams-prg
packages/semantic-tokens @microsoft/xc-uxe
packages/react-components/react-tags/library @microsoft/cxe-prg @microsoft/teams-prg @ValentinaKozlova
packages/react-components/react-tags/stories @microsoft/cxe-prg @microsoft/teams-prg @ValentinaKozlova
packages/react-components/react-migration-v0-v9/library @microsoft/teams-prg
Expand Down Expand Up @@ -331,6 +332,8 @@ packages/react-components/component-selector-preview/library @microsoft/teams-pr
packages/react-components/component-selector-preview/stories @microsoft/teams-prg
packages/react-components/react-menu-grid-preview/library @microsoft/teams-prg
packages/react-components/react-menu-grid-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 %>

# Deprecated v9 packages - exposed as part of `/unstable` api
Expand Down
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 @@ -168,6 +168,7 @@
"packages/eslint-plugin/**",

"packages/tokens/**",
"packages/semantic-tokens/**",
"packages/react-conformance/**",
"packages/react-components/**/*",
"packages/charts/react-charts/**/*",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "../../../../.babelrc-v9.json",
"plugins": ["annotate-pure-calls", "@babel/transform-react-pure-annotations"]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["plugin:@fluentui/eslint-plugin/react"],
"root": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"exclude": [
"/testing",
"/**/*.cy.ts",
"/**/*.cy.tsx",
"/**/*.spec.ts",
"/**/*.spec.tsx",
"/**/*.test.ts",
"/**/*.test.tsx"
],
"jsc": {
"parser": {
"syntax": "typescript",
"tsx": true,
"decorators": false,
"dynamicImport": false
},
"externalHelpers": true,
"transform": {
"react": {
"runtime": "classic",
"useSpread": true
}
},
"target": "es2019"
},
"minify": false,
"sourceMaps": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@fluentui/semantic-style-hooks-preview

Copyright (c) Microsoft Corporation

All rights reserved.

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the ""Software""), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED _AS IS_, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note: Usage of the fonts and icons referenced in Fluent UI React is subject to the terms listed at https://aka.ms/fluentui-assets-license
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# @fluentui/semantic-style-hooks-preview

WARNING: Semantic tokens and their style hooks are undergoing rapid transformation as we prepare to build out AI adjacent design systems - we expect many breaking changes to occur in this preview release to the token names, however the overall structure and fallback implementation should remain consistent.

**Semantic Style Hooks components for [Fluent UI React](https://react.fluentui.dev/)**

These are not production-ready components and **should never be used in product**. This space is useful for testing new components whose APIs might change before final release.

** Semantic Token Migration Guide **

This package exports custom style hooks (see https://react.fluentui.dev/?path=/docs/concepts-developer-advanced-styling-techniques--docs) that enable semantic tokens (@fluentui/semantic-tokens) usage in Fluent core component styles.

The SEMANTIC_STYLE_HOOKS object can be directly passed in to the FluentProvider:

```
import { SEMANTIC_STYLE_HOOKS } from '@fluentui/semantic-style-hooks-preview';

<FluentProvider theme={theme} customStyleHooks_unstable={SEMANTIC_STYLE_HOOKS}>
{// app code}
</FluentProvider>
```

If no FluentProvider is present, the CustomStyleHooksProvider can be used directly:

```
import { CustomStyleHooksProvider_unstable as CustomStyleHooksProvider } from '@fluentui/react-shared-contexts';
import { SEMANTIC_STYLE_HOOKS } from '@fluentui/semantic-style-hooks-preview';

<CustomStyleHooksProvider value={SEMANTIC_STYLE_HOOKS}>
{// app code}
</CustomStyleHooksProvider>
```

You can also opt in to specific component semantic styles via the flat exports for further scoping - if you use custom style hooks in your app already, we recommend calling these functions at the top of existing style hooks instead.

Legacy themes and tokens will continue to work once enabled thanks to the CSSVar fallback system - feel free to continue using existing token themes and optionally add semantic token values as we build out more tooling to assist with the generation of semantic token themes in the future.

** Bundle Size **

Please note, that the bundle size of these style hooks has not yet been optimized, as this package serves as an intermediate step until semantic tokens are stabilized and can be merged in the underlying styles files of each component.

** Deprecation Plan **

Once semantic tokens have been tested, stabilized, and confirmed backwards compatible, they will be optimized and enabled in the base component packages by default. At this point, the semantic style hooks package will be deprecated - please use this package to test and raise any issues prior to enable a smooth transition.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
"extends": "@fluentui/scripts-api-extractor/api-extractor.common.v-next.json",
"mainEntryPointFilePath": "<projectRoot>/../../../../../../dist/out-tsc/types/packages/react-components/<unscopedPackageName>/library/src/index.d.ts"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/** Jest test setup file. */
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# @fluentui/semantic-style-hooks-preview Spec

## Background

_Description and use cases of this component_

## Prior Art

_Include background research done for this component_

- _Link to Open UI research_
- _Link to comparison of v7 and v0_
- _Link to GitHub epic issue for the converged component_

## Sample Code

_Provide some representative example code that uses the proposed API for the component_

## Variants

_Describe visual or functional variants of this control, if applicable. For example, a slider could have a 2D variant._

## API

_List the **Props** and **Slots** proposed for the component. Ideally this would just be a link to the component's `.types.ts` file_

## Structure

- _**Public**_
- _**Internal**_
- _**DOM** - how the component will be rendered as HTML elements_

## Migration

_Describe what will need to be done to upgrade from the existing implementations:_

- _Migration from v8_
- _Migration from v0_

## Behaviors

_Explain how the component will behave in use, including:_

- _Component States_
- _Interaction_
- _Keyboard_
- _Cursor_
- _Touch_
- _Screen readers_

## Accessibility

Base accessibility information is included in the design document. After the spec is filled and review, outcomes from it need to be communicated to design and incorporated in the design document.

- Decide whether to use **native element** or folow **ARIA** and provide reasons
- Identify the **[ARIA](https://www.w3.org/TR/wai-aria-practices-1.2/) pattern** and, if the component is listed there, follow its specification as possible.
- Identify accessibility **variants**, the `role` ([ARIA roles](https://www.w3.org/TR/wai-aria-1.1/#role_definitions)) of the component, its `slots` and `aria-*` props.
- Describe the **keyboard navigation**: Tab Oder and Arrow Key Navigation. Describe any other keyboard **shortcuts** used
- Specify texts for **state change announcements** - [ARIA live regions
](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Live_Regions) (number of available items in dropdown, error messages, confirmations, ...)
- Identify UI parts that appear on **hover or focus** and specify keyboard and screen reader interaction with them
- List cases when **focus** needs to be **trapped** in sections of the UI (for dialogs and popups or for hierarchical navigation)
- List cases when **focus** needs to be **moved programatically** (if parts of the UI are appearing/disappearing or other cases)
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
## API Report File for "@fluentui/semantic-style-hooks-preview"

> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/).

```ts

// (No @packageDocumentation comment for this package)

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// @ts-check
/* eslint-disable */

const { readFileSync } = require('node:fs');
const { join } = require('node:path');

// Reading the SWC compilation config and remove the "exclude"
// for the test files to be compiled by SWC
const { exclude: _, ...swcJestConfig } = JSON.parse(readFileSync(join(__dirname, '.swcrc'), 'utf-8'));

// disable .swcrc look-up by SWC core because we're passing in swcJestConfig ourselves.
// If we do not disable this, SWC Core will read .swcrc and won't transform our test files due to "exclude"
if (swcJestConfig.swcrc === undefined) {
swcJestConfig.swcrc = false;
}

// Uncomment if using global setup/teardown files being transformed via swc
// https://nx.dev/packages/jest/documents/overview#global-setup/teardown-with-nx-libraries
// jest needs EsModule Interop to find the default exported setup/teardown functions
// swcJestConfig.module.noInterop = false;

/**
* @type {import('@jest/types').Config.InitialOptions}
*/
module.exports = {
displayName: 'semantic-style-hooks-preview',
preset: '../../../../jest.preset.js',
transform: {
'^.+\\.tsx?$': ['@swc/jest', swcJestConfig],
},
coverageDirectory: './coverage',
setupFilesAfterEnv: ['./config/tests.js'],
snapshotSerializers: ['@griffel/jest-serializer'],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "@fluentui/semantic-style-hooks-preview",
"version": "0.0.0",
"description": "New fluentui react package",
"main": "lib-commonjs/index.js",
"module": "lib/index.js",
"typings": "./dist/index.d.ts",
"sideEffects": false,
"files": [
"*.md",
"dist/*.d.ts",
"lib",
"lib-commonjs"
],
"repository": {
"type": "git",
"url": "https://github.com/microsoft/fluentui"
},
"license": "MIT",
"devDependencies": {
"@fluentui/eslint-plugin": "*",
"@fluentui/react-conformance": "*",
"@fluentui/react-conformance-griffel": "*",
"@fluentui/scripts-api-extractor": "*"
},
"dependencies": {
"@fluentui/react-button": "^9.4.6",
"@fluentui/semantic-tokens": "^0.0.1",
"@fluentui/react-icons": "^2.0.245",
"@fluentui/react-provider": "^9.22.7",
"@fluentui/react-tabster": "^9.24.6",
"@fluentui/react-theme": "^9.1.24",
"@fluentui/react-utilities": "^9.19.0",
"@griffel/react": "^1.5.22",
"@swc/helpers": "^0.5.1"
},
"peerDependencies": {
"@types/react": ">=16.14.0 <19.0.0",
"@types/react-dom": ">=16.9.0 <19.0.0",
"react": ">=16.14.0 <19.0.0",
"react-dom": ">=16.14.0 <19.0.0"
},
"exports": {
".": {
"types": "./dist/index.d.ts",
"node": "./lib-commonjs/index.js",
"import": "./lib/index.js",
"require": "./lib-commonjs/index.js"
},
"./package.json": "./package.json"
},
"beachball": {
"disallowedChangeTypes": [
"major",
"prerelease"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"name": "semantic-style-hooks-preview",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"projectType": "library",
"sourceRoot": "packages/react-components/semantic-style-hooks-preview/library/src",
"tags": ["platform:web", "vNext"],
"implicitDependencies": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export {};
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { isConformant as baseIsConformant } from '@fluentui/react-conformance';
import type { IsConformantOptions, TestObject } from '@fluentui/react-conformance';
import griffelTests from '@fluentui/react-conformance-griffel';

export function isConformant<TProps = {}>(
testInfo: Omit<IsConformantOptions<TProps>, 'componentPath'> & { componentPath?: string },
): void {
const defaultOptions: Partial<IsConformantOptions<TProps>> = {
tsConfig: { configName: 'tsconfig.spec.json' },
componentPath: require.main?.filename.replace('.test', ''),
extraTests: griffelTests as TestObject<TProps>,
};

baseIsConformant(defaultOptions, testInfo);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "../../../../tsconfig.base.json",
"compilerOptions": {
"target": "ES2019",
"noEmit": true,
"isolatedModules": true,
"importHelpers": true,
"jsx": "react",
"noUnusedLocals": true,
"preserveConstEnums": true
},
"include": [],
"files": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"noEmit": false,
"lib": ["ES2019", "dom"],
"declaration": true,
"declarationDir": "../../../../dist/out-tsc/types",
"outDir": "../../../../dist/out-tsc",
"inlineSources": true,
"types": ["static-assets", "environment"]
},
"exclude": [
"./src/testing/**",
"**/*.spec.ts",
"**/*.spec.tsx",
"**/*.test.ts",
"**/*.test.tsx",
"**/*.stories.ts",
"**/*.stories.tsx"
],
"include": ["./src/**/*.ts", "./src/**/*.tsx"]
}
Loading
Loading