microsoft / fluentui

Fluent UI web represents a collection of utilities, React components, and web components for building web applications.
https://react.fluentui.dev
Other
17.87k stars 2.66k forks source link

feat(react-shared-contexts): adds MaterialType context to support Semi Transparency #31409

Open bsunderhus opened 2 weeks ago

bsunderhus commented 2 weeks ago

Feature

Adds MaterialType inspired by Apple's human interface design guidelines (https://developer.apple.com/documentation/swiftui/material)

The MaterialTypeContextValue will be shared between surface components that will support different kinds of translucency levels on their surface.

First step for https://github.com/microsoft/fluentui/issues/29491

Summary

This pull request primarily introduces the MaterialType context in the @fluentui/react-shared-contexts and @fluentui/react-components packages to support semi-transparency. The changes include the creation of MaterialType, MaterialTypeContextValue, and MaterialTypeProvider, as well as the addition of these types and provider to various exports, imports, and context providers.

fabricteam commented 2 weeks ago

📊 Bundle size report

✅ No changes found

fabricteam commented 2 weeks ago

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 626 642 5000
Button mount 306 309 5000
Field mount 1099 1129 5000
FluentProvider mount 707 731 5000
FluentProviderWithTheme mount 77 83 10
FluentProviderWithTheme virtual-rerender 34 34 10
FluentProviderWithTheme virtual-rerender-with-unmount 83 77 10
MakeStyles mount 873 858 50000
Persona mount 1751 1715 5000
SpinButton mount 1352 1402 5000
SwatchPicker mount 1560 1566 5000