-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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: Generate from token JSON export #33931
Draft
Mitch-At-Work
wants to merge
37
commits into
microsoft:master
Choose a base branch
from
Mitch-At-Work:user/mifraser/token-script
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 15 commits
Commits
Show all changes
37 commits
Select commit
Hold shift + click to select a range
7a48bb0
Stash initial for now
Mitch-At-Work 13424bc
Add initial Link tokens as example
Mitch-At-Work 5badbf8
Add tsconfig for semantic-tokens
Mitch-At-Work 36cc985
Update indexing and add token vars as exports
Mitch-At-Work 88cc6f4
Change files
Mitch-At-Work 6b008bd
Fix version of react-tokens
Mitch-At-Work 8dba624
Update and connect local build artifacts
Mitch-At-Work 4a8db31
Lint and fix exports
Mitch-At-Work e2aa7f2
Update E2E for semantic tokens to a dummy test (for now)
Mitch-At-Work 96ef49f
Fix up extra bracket and brand ref color
Mitch-At-Work 1d6d672
remove console
Mitch-At-Work f478839
Alphebetize order
Mitch-At-Work bb81096
Update tokens so far
Mitch-At-Work 940f605
Add script to generate
Mitch-At-Work 44bfcdf
Initial script gen
Mitch-At-Work 57c7867
Update tokens and script
Mitch-At-Work 81f1e05
Update script to handle duplicated tokens
Mitch-At-Work 6035592
Add strokeWidthThin fallback
Mitch-At-Work 83f6a0a
Set variable path correctly
Mitch-At-Work e5671d7
Update latest
Mitch-At-Work 0ed592f
Update with better fallback logic
Mitch-At-Work c81c862
Update script to handle fallbacks and f2 tokens better
Mitch-At-Work 4d4bd3f
Update naming to handle brackets and spacings
Mitch-At-Work 4609e99
Ensure fallbacks work correctly for FST
Mitch-At-Work 9c3a7fe
Simplify script to match design and add custom fluent fallback map
Mitch-At-Work 032d3b7
Add missing imports structure
Mitch-At-Work a750369
Fix imports
Mitch-At-Work a55568e
Update script to add exports
Mitch-At-Work 5658e2d
Update script to handle imports/exports
Mitch-At-Work 56e1102
Token script fixed
Mitch-At-Work e3a0bba
Update tokens and script
Mitch-At-Work 58bac11
Fix token reference fallback
Mitch-At-Work 791a838
Update api
Mitch-At-Work 9c1c981
Fix port
Mitch-At-Work 8884ea1
Lint all files
Mitch-At-Work a5bb059
Update and remove eslint rule
Mitch-At-Work c4719f4
Fix up the ESLint rule
Mitch-At-Work File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -272,6 +272,7 @@ packages/react-components/react-virtualizer/stories @microsoft/xc-uxe @Mitch-At- | |||||||||||||||||||||||||
packages/react-components/react-skeleton/library @microsoft/cxe-prg | ||||||||||||||||||||||||||
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. 🕵🏾♀️ visual regressions to review in the fluentuiv8 Visual Regression ReportCallout 1 screenshots
react-charting-AreaChart 1 screenshots
react-charting-LineChart 1 screenshots
react-charting-VerticalBarChart 1 screenshots
|
||||||||||||||||||||||||||
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 | ||||||||||||||||||||||||||
|
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-link-6efd96c1-bad9-4287-bed3-9cb7b90d0107.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-semantic-tokens-ab69ccc6-b777-4bb6-909a-c406cc6406d2.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"plugins": ["annotate-pure-calls", "@babel/transform-react-pure-annotations"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] | ||
} | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "@fluentui/semantic-tokens", | ||
"entries": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# @fluentui/semantic-tokens | ||
|
||
**Fluent UI Theme semantic-tokens** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/** Jest test setup file. */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = "--smtc-ctrl-link-foreground-brand-hover"; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundBrandPressed: string; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundBrandPressedRaw = "--smtc-ctrl-link-foreground-brand-pressed"; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundBrandRest: string; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundBrandRestRaw = "--smtc-ctrl-link-foreground-brand-rest"; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundNeutralHover: string; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundNeutralHoverRaw = "--smtc-ctrl-link-foreground-neutral-hover"; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundNeutralPressed: string; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundNeutralPressedRaw = "--smtc-ctrl-link-foreground-neutral-pressed"; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundNeutralRest: string; | ||
|
||
// @public (undocumented) | ||
export const ctrlLinkForegroundNeutralRestRaw = "--smtc-ctrl-link-foreground-neutral-rest"; | ||
|
||
// @public (undocumented) | ||
export const foregroundCtrlBrandHoverRaw = "--smtc-foreground-ctrl-brand-hover"; | ||
|
||
// @public (undocumented) | ||
export const foregroundCtrlBrandPressedRaw = "--smtc-foreground-ctrl-brand-pressed"; | ||
|
||
// @public (undocumented) | ||
export const foregroundCtrlBrandRestRaw = "--smtc-foreground-ctrl-brand-rest"; | ||
|
||
// @public (undocumented) | ||
export const foregroundCtrlNeutralPrimaryDisabled: string; | ||
|
||
// @public (undocumented) | ||
export const foregroundCtrlNeutralPrimaryHoverRaw = "--smtc-foreground-ctrl-neutral-primary-hover"; | ||
|
||
// @public (undocumented) | ||
export const foregroundCtrlNeutralPrimaryPressedRaw = "--smtc-foreground-ctrl-neutral-primary-pressed"; | ||
|
||
// @public (undocumented) | ||
export const foregroundCtrlNeutralPrimaryRestRaw = "--smtc-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) | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'], | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Badge 1 screenshots