Skip to content

Conversation

@miroslavstastny
Copy link
Member

@miroslavstastny miroslavstastny commented May 25, 2023

This PR adds status color tokens to theme tokens package.

It adds success, warning and danger tokens which are mapped:
success ➡️ green
warning ➡️ orange
danger ➡️ cranberry

Each status color defines 10 tokens with the following mapping in individual themes:

token Light Dark Teams HC
colorStatus${color}Background1 tint60 shade40 hcCanvas
colorStatus${color}Background2 tint40 shade30 hcCanvas
colorStatus${color}Background3 primary primary hcCanvasText
colorStatus${color}Foreground1 shade10 tint30 hcCanvasText
colorStatus${color}Foreground2 shade30 tint40 hcCanvasText
colorStatus${color}Foreground3 primary tint20 hcCanvasText
colorStatus${color}ForegroundInverted tint30 tint30 hcHighlight
colorStatus${color}BorderActive primary primary hcCanvasText
colorStatus${color}Border1 tint40 primary hcCanvasText
colorStatus${color}Border2 primary tint20 hcCanvasText

Where ${color} is one of success, warning and danger. The mapping is the same for all three status colors with the following one-off overrides:
image

This are the hex values of all status tokens in code:

image image image

The tokens are currently not used anywhere in component styles.

@fabricteam
Copy link
Collaborator

fabricteam commented May 25, 2023

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: Button, FluentProvider & webLightTheme
67.576 kB
18.225 kB
68.637 kB
18.492 kB
1.061 kB
267 B
react-components
react-components: FluentProvider & webLightTheme
36.409 kB
12.003 kB
37.47 kB
12.271 kB
1.061 kB
268 B
react-theme
Teams: all themes
31.987 kB
6.85 kB
34.37 kB
7.257 kB
2.383 kB
407 B
react-theme
Teams: Light theme
18.121 kB
5.194 kB
19.167 kB
5.451 kB
1.046 kB
257 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-accordion
Accordion (including children components)
88.286 kB
26.724 kB
react-alert
Alert
84.992 kB
22.03 kB
react-avatar
Avatar
47.739 kB
14.521 kB
react-avatar
AvatarGroup
15.695 kB
6.314 kB
react-avatar
AvatarGroupItem
63.915 kB
19.001 kB
react-badge
Badge
23.604 kB
7.272 kB
react-badge
CounterBadge
24.506 kB
7.574 kB
react-badge
PresenceBadge
22.253 kB
7.891 kB
react-button
Button
39.193 kB
9.743 kB
react-button
CompoundButton
46.661 kB
11.257 kB
react-button
MenuButton
43.553 kB
10.979 kB
react-button
SplitButton
51.758 kB
12.571 kB
react-button
ToggleButton
57.629 kB
11.645 kB
react-card
Card - All
89.36 kB
25.284 kB
react-card
Card
83.778 kB
23.685 kB
react-card
CardFooter
9.24 kB
3.907 kB
react-card
CardHeader
11.652 kB
4.741 kB
react-card
CardPreview
10.048 kB
4.254 kB
react-checkbox
Checkbox
33.224 kB
10.727 kB
react-combobox
Combobox (including child components)
87.199 kB
28.143 kB
react-combobox
Dropdown (including child components)
85.602 kB
27.746 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
213.111 kB
59.12 kB
react-datepicker-compat
DatePicker Compat
223.394 kB
59.277 kB
react-dialog
Dialog (including children components)
92.762 kB
27.587 kB
react-divider
Divider
17.49 kB
6.364 kB
react-field
Field
18.174 kB
6.977 kB
react-image
Image
11.561 kB
4.637 kB
react-infobutton
InfoButton
131.361 kB
40.326 kB
react-infobutton
InfoLabel
134.966 kB
41.462 kB
react-input
Input
24.232 kB
7.781 kB
react-label
Label
10.186 kB
4.253 kB
react-link
Link
12.782 kB
5.247 kB
react-menu
Menu (including children components)
132.703 kB
40.62 kB
react-menu
Menu (including selectable components)
135.467 kB
41.115 kB
react-overflow
hooks only
12.505 kB
4.626 kB
react-persona
Persona
55.293 kB
16.535 kB
react-popover
Popover
119.925 kB
36.895 kB
react-portal
Portal
11.935 kB
4.421 kB
react-portal-compat
PortalCompatProvider
6.48 kB
2.203 kB
react-positioning
usePositioning
24.272 kB
8.866 kB
react-progress
ProgressBar
13.941 kB
5.498 kB
react-provider
FluentProvider
18.129 kB
6.73 kB
react-radio
Radio
27.017 kB
8.638 kB
react-radio
RadioGroup
11.376 kB
4.763 kB
react-select
Select
24.955 kB
8.722 kB
react-slider
Slider
34.87 kB
11.178 kB
react-spinbutton
SpinButton
33.756 kB
10.35 kB
react-spinner
Spinner
21.77 kB
7.134 kB
react-switch
Switch
29.511 kB
9.239 kB
react-table
DataGrid
158.216 kB
42.389 kB
react-table
Table (Primitives only)
43.95 kB
12.263 kB
react-table
Table as DataGrid
132.019 kB
33.82 kB
react-table
Table (Selection only)
77.643 kB
19.195 kB
react-table
Table (Sort only)
76.262 kB
18.798 kB
react-tags-preview
InteractionTag
34.171 kB
9.199 kB
react-tags-preview
Tag
25.962 kB
8.49 kB
react-tags-preview
TagGroup
69.142 kB
20.294 kB
react-text
Text - Default
12.574 kB
4.982 kB
react-text
Text - Wrappers
15.726 kB
5.302 kB
react-textarea
Textarea
27.703 kB
9.126 kB
react-theme
Single theme token import
69 B
89 B
react-toast
Toast (including Toaster)
78.365 kB
23.67 kB
react-tooltip
Tooltip
47.463 kB
16.655 kB
🤖 This report was generated against 1a8fcdedfaa41b4478342d3f7aa49f58a85c07dd

@miroslavstastny miroslavstastny force-pushed the feat/semantic-color-tokens branch from caf4451 to 57973da Compare May 25, 2023 20:15
@fabricteam
Copy link
Collaborator

fabricteam commented May 25, 2023

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
InfoButton mount 11 13 5000 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 583 601 5000
Button mount 290 301 5000
Field mount 1041 1064 5000
FluentProvider mount 672 653 5000
FluentProviderWithTheme mount 73 82 10
FluentProviderWithTheme virtual-rerender 65 69 10
FluentProviderWithTheme virtual-rerender-with-unmount 65 68 10
InfoButton mount 11 13 5000 Possible regression
MakeStyles mount 825 869 50000
Persona mount 1620 1636 5000
SpinButton mount 1311 1317 5000

@size-auditor
Copy link

size-auditor bot commented May 25, 2023

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: e6e662c52a7a7d9c4a9f95e01e1e2194f4e72b04 (build)

@codesandbox-ci
Copy link

codesandbox-ci bot commented May 25, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 771f040:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@fabricteam
Copy link
Collaborator

fabricteam commented May 25, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@fabricteam
Copy link
Collaborator

fabricteam commented Jul 24, 2023

🕵 fluentuiv9 No visual regressions between this PR and main

@miroslavstastny miroslavstastny force-pushed the feat/semantic-color-tokens branch from 888b51b to 771f040 Compare July 24, 2023 21:30
@miroslavstastny miroslavstastny marked this pull request as ready for review July 24, 2023 21:30
@miroslavstastny miroslavstastny requested review from a team as code owners July 24, 2023 21:30
@tudorpopams tudorpopams requested a review from marcosmoura July 25, 2023 12:18
Copy link
Contributor

@marcosmoura marcosmoura left a comment

Choose a reason for hiding this comment

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

Approved for files owned by @microsoft/fluentui-react-build

@miroslavstastny miroslavstastny merged commit 141424a into microsoft:master Aug 3, 2023
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Aug 7, 2023
* master:
  chore(cxe-prg): migrate to new slot API (microsoft#28752)
  chore(teams-prg): migrate to new slot API (microsoft#28751)
  chore: re-export slot and assertSlots methods (microsoft#28755)
  Docs(react-tree): Improve docs and stories (microsoft#28741)
  feat: implements nested tree selection (microsoft#28668)
  applying package updates
  applying package updates
  feature(react-utilities): implements new slot methods (`slot` and `assertSlots`) (microsoft#28373)
  fix(TimePicker): Selection now works in locales that don't use "am"/"pm" in their time format (microsoft#28469)
  bugfix: ensures controlled state works properly + (microsoft#28665)
  feat(tokens): Add status color tokens (microsoft#28006)
  feat(tokens): Add colorBrandStroke2Contrast and colorNeutralStrokeAlpha2 (microsoft#28638)
  Made BreadcrumbButton consistent with Item and Link (microsoft#28672)
marcosmoura added a commit to marcosmoura/fluentui that referenced this pull request Aug 7, 2023
* master:
  chore(cxe-prg): migrate to new slot API (microsoft#28752)
  chore(teams-prg): migrate to new slot API (microsoft#28751)
  chore: re-export slot and assertSlots methods (microsoft#28755)
  Docs(react-tree): Improve docs and stories (microsoft#28741)
  feat: implements nested tree selection (microsoft#28668)
  applying package updates
  applying package updates
  feature(react-utilities): implements new slot methods (`slot` and `assertSlots`) (microsoft#28373)
  fix(TimePicker): Selection now works in locales that don't use "am"/"pm" in their time format (microsoft#28469)
  bugfix: ensures controlled state works properly + (microsoft#28665)
  feat(tokens): Add status color tokens (microsoft#28006)
  feat(tokens): Add colorBrandStroke2Contrast and colorNeutralStrokeAlpha2 (microsoft#28638)
  Made BreadcrumbButton consistent with Item and Link (microsoft#28672)
  fix(EventListener): do not use `defaultProps` (microsoft#28725)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants