From d4c6b4bc7dc512c997a0513427a730d5def99fd4 Mon Sep 17 00:00:00 2001 From: Chris Holt Date: Fri, 12 Apr 2024 11:14:09 -0700 Subject: [PATCH] fix(web-components): remove final dependencies on fast-foundation (#31009) Co-authored-by: Christopher Holt <=> --- .../src/utilities/WCThemeDecorator.tsx | 3 - ...-86d45358-8f3e-454f-92b1-96b3ea94e9a0.json | 7 + packages/web-components/docs/api-report.md | 46 +++++ packages/web-components/package.json | 2 +- .../accordion-item/accordion-item.styles.ts | 2 +- .../src/accordion/accordion.styles.ts | 2 +- .../src/avatar/avatar.styles.ts | 2 +- .../src/button/button.styles.ts | 2 +- .../src/checkbox/checkbox.styles.ts | 2 +- .../src/dialog/dialog.styles.ts | 2 +- .../src/divider/divider.styles.ts | 2 +- packages/web-components/src/index.ts | 4 + .../web-components/src/label/label.styles.ts | 2 +- .../src/menu-item/menu-item.styles.ts | 2 +- .../src/menu-list/menu-list.styles.ts | 2 +- .../src/progress-bar/progress-bar.styles.ts | 2 +- .../src/radio-group/radio-group.styles.ts | 2 +- .../web-components/src/radio/radio.styles.ts | 2 +- .../src/slider/slider.styles.ts | 2 +- .../src/spinner/spinner.styles.ts | 2 +- .../src/styles/partials/badge.partials.ts | 2 +- .../src/switch/switch.styles.ts | 2 +- .../src/tab-panel/tab-panel.styles.ts | 2 +- packages/web-components/src/tab/tab.styles.ts | 2 +- .../web-components/src/tabs/tabs.styles.ts | 2 +- .../src/text-input/text-input.styles.ts | 2 +- .../web-components/src/text/text.styles.ts | 2 +- .../web-components/src/theme/theme.stories.ts | 17 +- .../src/toggle-button/toggle-button.styles.ts | 2 +- .../match-media-stylesheet-behavior.ts | 187 ++++++++++++++++++ packages/web-components/src/utils/display.ts | 44 +++++ packages/web-components/src/utils/index.ts | 2 + packages/web-components/tensile.config.js | 2 - yarn.lock | 21 +- 34 files changed, 326 insertions(+), 55 deletions(-) create mode 100644 change/@fluentui-web-components-86d45358-8f3e-454f-92b1-96b3ea94e9a0.json create mode 100644 packages/web-components/src/utils/behaviors/match-media-stylesheet-behavior.ts create mode 100644 packages/web-components/src/utils/display.ts diff --git a/apps/vr-tests-web-components/src/utilities/WCThemeDecorator.tsx b/apps/vr-tests-web-components/src/utilities/WCThemeDecorator.tsx index 88e5f2b1760fb2..78568e7404cc9b 100644 --- a/apps/vr-tests-web-components/src/utilities/WCThemeDecorator.tsx +++ b/apps/vr-tests-web-components/src/utilities/WCThemeDecorator.tsx @@ -2,12 +2,9 @@ import * as React from 'react'; import { StoryContext } from '@storybook/addons'; import { ComponentStory } from '@storybook/react'; import { FASTElement, customElement, html, attr } from '@microsoft/fast-element'; -import { DesignToken } from '@microsoft/fast-foundation'; import { teamsLightTheme, teamsDarkTheme, webLightTheme, webDarkTheme } from '@fluentui/tokens'; import { setThemeFor } from '@fluentui/web-components'; -DesignToken.registerDefaultStyleTarget(); - const themes = [ { id: 'web-light', label: 'Web Light', theme: webLightTheme }, { id: 'web-dark', label: 'Web Dark', theme: webDarkTheme }, diff --git a/change/@fluentui-web-components-86d45358-8f3e-454f-92b1-96b3ea94e9a0.json b/change/@fluentui-web-components-86d45358-8f3e-454f-92b1-96b3ea94e9a0.json new file mode 100644 index 00000000000000..31e903961f35a4 --- /dev/null +++ b/change/@fluentui-web-components-86d45358-8f3e-454f-92b1-96b3ea94e9a0.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "fix(web-components): remove final dependencies on fast-foundation", + "packageName": "@fluentui/web-components", + "email": "=", + "dependentChangeType": "patch" +} diff --git a/packages/web-components/docs/api-report.md b/packages/web-components/docs/api-report.md index a072cf353e83ef..9930c47e615f96 100644 --- a/packages/web-components/docs/api-report.md +++ b/packages/web-components/docs/api-report.md @@ -10,6 +10,8 @@ import { ElementStyles } from '@microsoft/fast-element'; import { ElementViewTemplate } from '@microsoft/fast-element'; import { FASTElement } from '@microsoft/fast-element'; import { FASTElementDefinition } from '@microsoft/fast-element'; +import type { HostBehavior } from '@microsoft/fast-element'; +import type { HostController } from '@microsoft/fast-element'; import { HTMLDirective } from '@microsoft/fast-element'; import { Orientation } from '@microsoft/fast-web-utilities'; import type { SyntheticViewTemplate } from '@microsoft/fast-element'; @@ -1648,6 +1650,9 @@ export const CounterBadgeStyles: ElementStyles; // @public export const CounterBadgeTemplate: ElementViewTemplate; +// @public +export type CSSDisplayPropertyValue = 'block' | 'contents' | 'flex' | 'grid' | 'inherit' | 'initial' | 'inline' | 'inline-block' | 'inline-flex' | 'inline-grid' | 'inline-table' | 'list-item' | 'none' | 'run-in' | 'table' | 'table-caption' | 'table-cell' | 'table-column' | 'table-column-group' | 'table-footer-group' | 'table-header-group' | 'table-row' | 'table-row-group'; + // @public (undocumented) export const curveAccelerateMax = "var(--curveAccelerateMax)"; @@ -1675,6 +1680,9 @@ export const curveEasyEaseMax = "var(--curveEasyEaseMax)"; // @public (undocumented) export const curveLinear = "var(--curveLinear)"; +// @public +export const darkModeStylesheetBehavior: (styles: ElementStyles) => MatchMediaStyleSheetBehavior; + // Warning: (ae-internal-mixed-release-tag) Mixed release tags are not allowed for "DelegatesARIAButton" because one of its declarations is marked as @internal // // @public @@ -1741,6 +1749,9 @@ export const DialogStyles: ElementStyles; // @public export const DialogTemplate: ElementViewTemplate; +// @public +export function display(displayValue: CSSDisplayPropertyValue): string; + // @public export class Divider extends FASTElement { alignContent?: DividerAlignContent; @@ -1880,6 +1891,15 @@ export const fontWeightRegular = "var(--fontWeightRegular)"; // @public (undocumented) export const fontWeightSemibold = "var(--fontWeightSemibold)"; +// @public +export const forcedColorsStylesheetBehavior: (styles: ElementStyles) => MatchMediaStyleSheetBehavior; + +// @public +export const getDirection: (rootNode: HTMLElement) => Direction; + +// @public +export const hidden = ":host([hidden]){display:none}"; + // @public class Image_2 extends FASTElement { block?: boolean; @@ -1940,6 +1960,9 @@ export const LabelStyles: ElementStyles; // @public (undocumented) export const LabelTemplate: ElementViewTemplate