-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Semantic Tokens #33831
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Semantic Tokens #33831
Changes from all commits
7a48bb0
13424bc
5badbf8
36cc985
88cc6f4
6b008bd
8dba624
4a8db31
e2aa7f2
96ef49f
1d6d672
f478839
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "type": "minor", | ||
| "comment": "feat: Semantic token implementation", | ||
| "packageName": "@fluentui/react-link", | ||
| "email": "mifraser@microsoft.com", | ||
| "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": "mifraser@microsoft.com", | ||
| "dependentChangeType": "patch" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| { | ||
| "plugins": ["annotate-pure-calls", "@babel/transform-react-pure-annotations"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "extends": ["plugin:@fluentui/eslint-plugin/react"], | ||
| "root": true, | ||
| "rules": { | ||
| "no-restricted-imports": [ | ||
| "error", | ||
| { | ||
| "patterns": ["@fluentui/*", "react", "react-dom"] | ||
| } | ||
| ] | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| { | ||
| "$schema": "https://json.schemastore.org/swcrc", | ||
| "exclude": [ | ||
| "/testing", | ||
| "/**/*.cy.ts", | ||
| "/**/*.cy.tsx", | ||
| "/**/*.spec-e2e.ts", | ||
| "/**/*.spec.ts", | ||
| "/**/*.spec.tsx", | ||
| "/**/*.test.ts", | ||
| "/**/*.test.tsx" | ||
| ], | ||
| "jsc": { | ||
| "baseUrl": ".", | ||
| "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,4 @@ | ||
| { | ||
| "name": "@fluentui/semantic-tokens", | ||
| "entries": [] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| # Change Log - @fluentui/semantic-tokens | ||
|
|
||
| This log was last generated on Thurs, 2 Feb 2025 16:26:46 GMT and should not be manually modified. | ||
|
|
||
| <!-- Start content --> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| @fluentui/semantic-tokens | ||
|
|
||
| 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,3 @@ | ||
| # @fluentui/semantic-tokens | ||
|
|
||
| **Fluent UI Theme semantic-tokens** |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "$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": "<projectFolder>/../../dist/out-tsc/types/packages/<unscopedPackageName>/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,84 @@ | ||
| ## API Report File for "@fluentui/semantic-tokens" | ||
|
|
||
| > Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). | ||
|
|
||
| ```ts | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlFocusOuterStroke: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundBrandHover: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundBrandHoverRaw = "--ctrl-link-foreground-brand-hover"; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shipped prefixing our tokens with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm a little concerned this isn't matching the JSON I've received, it's easy enough for us to add but need to be sure we are all synced on this - can discuss this at our meeting today. |
||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundBrandPressed: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundBrandPressedRaw = "--ctrl-link-foreground-brand-pressed"; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundBrandRest: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundBrandRestRaw = "--ctrl-link-foreground-brand-rest"; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundNeutralHover: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundNeutralHoverRaw = "--ctrl-link-foreground-neutral-hover"; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundNeutralPressed: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundNeutralPressedRaw = "--ctrl-link-foreground-neutral-pressed"; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundNeutralRest: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const ctrlLinkForegroundNeutralRestRaw = "--ctrl-link-foreground-neutral-rest"; | ||
|
|
||
| // @public (undocumented) | ||
| export const foregroundCtrlBrandHoverRaw = "--foreground-ctrl-brand-hover"; | ||
|
|
||
| // @public (undocumented) | ||
| export const foregroundCtrlBrandPressedRaw = "--foreground-ctrl-brand-pressed"; | ||
|
|
||
| // @public (undocumented) | ||
| export const foregroundCtrlBrandRestRaw = "--foreground-ctrl-brand-rest"; | ||
|
|
||
| // @public (undocumented) | ||
| export const foregroundCtrlNeutralPrimaryDisabled: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const foregroundCtrlNeutralPrimaryHoverRaw = "--foreground-ctrl-neutral-primary-hover"; | ||
|
|
||
| // @public (undocumented) | ||
| export const foregroundCtrlNeutralPrimaryPressedRaw = "--foreground-ctrl-neutral-primary-pressed"; | ||
|
|
||
| // @public (undocumented) | ||
| export const foregroundCtrlNeutralPrimaryRestRaw = "--foreground-ctrl-neutral-primary-rest"; | ||
|
|
||
| // @public (undocumented) | ||
| export const foregroundCtrlOntransparentDisabled: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const strokewidthDefault: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const textGlobalBody3Fontsize: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const textStyleDefaultRegularFontfamily: string; | ||
|
|
||
| // @public (undocumented) | ||
| export const textStyleDefaultRegularWeight: string; | ||
|
|
||
| // (No @packageDocumentation comment for this package) | ||
|
|
||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| // @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-tokens', | ||
| preset: '../../jest.preset.js', | ||
| transform: { | ||
| '^.+\\.tsx?$': ['@swc/jest', swcJestConfig], | ||
| }, | ||
| coverageDirectory: './coverage', | ||
| setupFilesAfterEnv: ['./config/tests.js'], | ||
| }; |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🕵🏾♀️ visual regressions to review in the fluentui-web-components-v3 Visual Regression Report
Accordion 1 screenshots
Avatar 1 screenshots
Switch 2 screenshots