Skip to content
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

feat: v0 Loader style migration from v9 #25169

Merged

Conversation

GianoglioEnrico
Copy link
Contributor

@GianoglioEnrico GianoglioEnrico commented Oct 11, 2022

This Pull Request updates the v0 Loader to look like v9 Spinner.

Before this PR We were importing the SVG loader in the document as background-image in CSS.
The SVG Loader is now added to the document directly inside HTML code as <svg> tag.We have then applied styling to the new tag.
The Loader gets the right stroke color based on the theme we are in.
We took the following design spec as a reference:

Schermata 2022-10-11 alle 12 18 52

Current Behavior

Teams Teams Dark Teams High Contrast
Schermata 2022-10-11 alle 12 02 44 Schermata 2022-10-11 alle 12 03 02 Schermata 2022-10-11 alle 12 03 22

New Behavior

Teams Teams Dark Teams High Contrast
Schermata 2022-10-11 alle 11 47 02 Schermata 2022-10-11 alle 11 59 29 Schermata 2022-10-11 alle 11 59 44

Related Issue(s)

Fixes #

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 11, 2022

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 ebc3d74:

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

@size-auditor
Copy link

size-auditor bot commented Oct 11, 2022

Asset size changes

Project Bundle Baseline Size New Size Difference
office-ui-fabric-react fluentui-react-northstar-Alert 90.844 kB 90.932 kB ExceedsBaseline     88 bytes
office-ui-fabric-react fluentui-react-northstar-SplitButton 185.385 kB 185.473 kB ExceedsBaseline     88 bytes
office-ui-fabric-react fluentui-react-northstar-Attachment 90.087 kB 90.175 kB ExceedsBaseline     88 bytes
office-ui-fabric-react fluentui-react-northstar-Dropdown 204.462 kB 204.55 kB ExceedsBaseline     88 bytes
office-ui-fabric-react fluentui-react-northstar-Button 86.134 kB 86.222 kB ExceedsBaseline     88 bytes
office-ui-fabric-react fluentui-react-northstar-Dialog 116.847 kB 116.935 kB ExceedsBaseline     88 bytes
office-ui-fabric-react fluentui-react-northstar-Loader 81.281 kB 81.369 kB ExceedsBaseline     88 bytes
office-ui-fabric-react fluentui-react-northstar-Datepicker 194.263 kB 194.351 kB ExceedsBaseline     88 bytes

ExceedsTolerance Over Tolerance (1024 B) ExceedsBaseline Over Baseline BelowBaseline Below Baseline New New Deleted  Removed 1 kB = 1000 B

Baseline commit: f43aae1493a49053f7fe866a5c56056e73b1d709 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Oct 11, 2022

📊 Bundle size report

🤖 This report was generated against f43aae1493a49053f7fe866a5c56056e73b1d709

@fabricteam
Copy link
Collaborator

fabricteam commented Oct 11, 2022

Perf Analysis (@fluentui/react-northstar)

⚠️ 7 potential perf regressions detected

Potential regressions comparing to master

Scenario Current PR Ticks Baseline Ticks Ratio Regression Analysis
TreeWith60ListItems.default 178 154 1.16:1 analysis
ButtonMinimalPerf.default 153 141 1.09:1 analysis
RefMinimalPerf.default 209 203 1.03:1 analysis
AttachmentMinimalPerf.default 140 140 1:1 analysis
AvatarMinimalPerf.default 175 178 0.98:1 analysis
AccordionMinimalPerf.default 144 149 0.97:1 analysis
PortalMinimalPerf.default 155 162 0.96:1 analysis
Perf tests with no regressions
Scenario Current PR Ticks Baseline Ticks Ratio
FormMinimalPerf.default 376 351 1.07:1
LabelMinimalPerf.default 378 358 1.06:1
ReactionMinimalPerf.default 371 349 1.06:1
ChatWithPopoverPerf.default 360 347 1.04:1
HeaderSlotsPerf.default 759 731 1.04:1
SkeletonMinimalPerf.default 343 330 1.04:1
BoxMinimalPerf.default 327 316 1.03:1
ChatMinimalPerf.default 712 693 1.03:1
RosterPerf.default 2124 2054 1.03:1
TooltipMinimalPerf.default 2288 2221 1.03:1
AttachmentSlotsPerf.default 1092 1068 1.02:1
ButtonOverridesMissPerf.default 1285 1255 1.02:1
CarouselMinimalPerf.default 450 442 1.02:1
DropdownManyItemsPerf.default 637 626 1.02:1
GridMinimalPerf.default 332 327 1.02:1
LayoutMinimalPerf.default 342 335 1.02:1
SegmentMinimalPerf.default 333 326 1.02:1
SplitButtonMinimalPerf.default 4366 4268 1.02:1
StatusMinimalPerf.default 673 663 1.02:1
TableMinimalPerf.default 397 389 1.02:1
TextMinimalPerf.default 331 325 1.02:1
DividerMinimalPerf.default 338 334 1.01:1
ImageMinimalPerf.default 382 377 1.01:1
ItemLayoutMinimalPerf.default 1131 1123 1.01:1
ListMinimalPerf.default 483 476 1.01:1
MenuButtonMinimalPerf.default 1668 1651 1.01:1
RadioGroupMinimalPerf.default 422 417 1.01:1
TreeMinimalPerf.default 768 760 1.01:1
VideoMinimalPerf.default 703 697 1.01:1
AlertMinimalPerf.default 256 255 1:1
CardMinimalPerf.default 510 512 1:1
ChatDuplicateMessagesPerf.default 253 254 1:1
DropdownMinimalPerf.default 2611 2620 1:1
InputMinimalPerf.default 1075 1071 1:1
ProviderMinimalPerf.default 396 396 1:1
SliderMinimalPerf.default 1566 1567 1:1
TextAreaMinimalPerf.default 459 458 1:1
ToolbarMinimalPerf.default 903 903 1:1
AnimationMinimalPerf.default 515 518 0.99:1
DialogMinimalPerf.default 726 733 0.99:1
EmbedMinimalPerf.default 3531 3571 0.99:1
FlexMinimalPerf.default 268 272 0.99:1
ListCommonPerf.default 614 622 0.99:1
ListNestedPerf.default 516 519 0.99:1
ProviderMergeThemesPerf.default 1225 1243 0.99:1
TableManyItemsPerf.default 1854 1871 0.99:1
CustomToolbarPrototype.default 2616 2635 0.99:1
DatepickerMinimalPerf.default 5499 5583 0.98:1
ListWith60ListItems.default 588 601 0.98:1
MenuMinimalPerf.default 801 819 0.98:1
PopupMinimalPerf.default 616 628 0.98:1
HeaderMinimalPerf.default 330 345 0.96:1
ButtonSlotsPerf.default 524 554 0.95:1
CheckboxMinimalPerf.default 2010 2108 0.95:1
IconMinimalPerf.default 639 677 0.94:1
LoaderMinimalPerf.default 308 629 0.49:1

Copy link
Contributor

@codepretty codepretty left a comment

Choose a reason for hiding this comment

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

Is there a pixel rounding issue? Looks like in some examples the loader is cut off slightly
image

@GianoglioEnrico GianoglioEnrico marked this pull request as ready for review October 24, 2022 08:51
@GianoglioEnrico GianoglioEnrico requested a review from a team as a code owner October 24, 2022 08:51
Copy link
Member

@layershifter layershifter left a comment

Choose a reason for hiding this comment

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

Approving with small suggestions, nice job 👍

@layershifter layershifter merged commit 7f287bc into microsoft:master Oct 31, 2022
NotWoods pushed a commit to NotWoods/fluentui that referenced this pull request Nov 18, 2022
* Add new secondary svg loader

* Remove the unused style

* Generate loader svg based on theme color

* Add new svg loader

* Encode svg color with encodeURIComponent function

* Loader gets rendered as <svg> and <circle> tags

* Removed svg urls

* Add stroke color variables and secondary stroke

* Change svg heights

* Styling the Loader's <svg> and <circle>

* Use defined classname instead of nested selectors

* Remove unused interface variables

* Add @NoFlip to fix rtl rotate animation

* Set the loader track color of HC theme in black

* Set black background to HC secondary example

* Renamed variable

* Change loader's height when it is inside a button

* Add changelog entry

* Update changelog entry

* Change background color to secondary examples

* Function to get the common styles of the circles

* Remove unused svg classname

* Change loader's height when inside an attachment

Co-authored-by: Enrico <[email protected]>
@khmakoto khmakoto added Fluent UI react-northstar (v0) Work related to Fluent UI V0 and removed Fluent UI react-northstar labels Nov 30, 2022
Hotell pushed a commit to Hotell/fluentui that referenced this pull request Feb 9, 2023
* Add new secondary svg loader

* Remove the unused style

* Generate loader svg based on theme color

* Add new svg loader

* Encode svg color with encodeURIComponent function

* Loader gets rendered as <svg> and <circle> tags

* Removed svg urls

* Add stroke color variables and secondary stroke

* Change svg heights

* Styling the Loader's <svg> and <circle>

* Use defined classname instead of nested selectors

* Remove unused interface variables

* Add @NoFlip to fix rtl rotate animation

* Set the loader track color of HC theme in black

* Set black background to HC secondary example

* Renamed variable

* Change loader's height when it is inside a button

* Add changelog entry

* Update changelog entry

* Change background color to secondary examples

* Function to get the common styles of the circles

* Remove unused svg classname

* Change loader's height when inside an attachment

Co-authored-by: Enrico <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants